:root {
  --paper: #fffaf2;
  --paper-2: #f8efe2;
  --ink: #2a1115;
  --muted: #81686a;
  --line: #ead9ca;
  --wine: #5b1220;
  --wine-2: #7a1727;
  --red: #c72d2d;
  --orange: #d87817;
  --amber: #eba32e;
  --gold: #f0b642;
  --success: #247255;
  --shadow: 0 16px 48px rgba(64, 21, 25, 0.11);
  --radius: 8px;
}


* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
summary,
.upload-button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(216, 120, 23, 0.3);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  display: block;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  min-height: 100vh;
  background: var(--paper);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 100vh;
  padding: clamp(42px, 7vw, 110px);
  overflow: hidden;
  background: var(--wine);
  color: white;
}

.auth-brand::before {
  content: "VS";
  position: absolute;
  top: -0.18em;
  left: -0.08em;
  color: rgba(255, 255, 255, 0.045);
  font-family: Georgia, serif;
  font-size: min(58vw, 680px);
  font-weight: 900;
  line-height: 1;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 58%, rgba(235, 163, 46, 0.2)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.03) 80px);
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.vs-seal {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 44px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 2.1rem;
  font-weight: 900;
}

.auth-brand p,
.auth-brand h1,
.auth-brand span {
  margin: 0;
}

.auth-brand p {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-brand h1 {
  max-width: 700px;
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 6vw, 6.8rem);
  font-weight: 700;
  line-height: 0.9;
}

.auth-brand span {
  margin-top: 20px;
  color: #f4d9d5;
  font-size: 1rem;
}

.login-card {
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 22px;
  width: min(440px, calc(100% - 48px));
  padding: 48px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 8px 0 4px;
  font-family: Georgia, serif;
  font-size: 2.4rem;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  text-transform: none;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 850;
}

.button.large {
  min-height: 52px;
}

.button.primary {
  background: var(--orange);
  color: white;
  box-shadow: 0 8px 20px rgba(216, 120, 23, 0.22);
}

.button.primary:hover {
  background: #c96b0d;
}

.button.subtle {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button.danger-outline {
  background: white;
  border-color: #e4b2ad;
  color: var(--red);
}

.form-error {
  min-height: 20px;
  color: var(--red) !important;
  font-weight: 750;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1420px) / 2));
  background: rgba(255, 250, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--wine);
  text-align: left;
}

.brand-monogram {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--wine);
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 900;
}

.brand-button strong,
.brand-button small {
  display: block;
}

.brand-button strong {
  font-size: 0.84rem;
  text-transform: uppercase;
}

.brand-button small {
  color: var(--muted);
  font-size: 0.7rem;
}

.main-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 4px;
}

.nav-button {
  position: relative;
  align-self: stretch;
  padding: 0 18px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.nav-button.active {
  color: var(--wine);
}

.nav-button.active::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 3px;
  background: var(--orange);
}

.account {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--wine);
  font-size: 1.15rem;
  font-weight: 900;
}

.workspace {
  width: min(1420px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 46px 0 80px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.page-heading h1,
.page-heading p {
  margin: 0;
}

.page-heading h1 {
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.page-heading p {
  max-width: 720px;
  margin-top: 13px;
  color: var(--muted);
}

.session-summary {
  display: grid;
  min-width: 120px;
  padding-left: 20px;
  border-left: 3px solid var(--orange);
}

.session-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.session-summary strong {
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 2.2rem;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(64, 21, 25, 0.055);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.7fr);
  gap: 22px;
}

.session-panel,
.schedule-panel {
  padding: 26px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--paper-2);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
}

.status-dot {
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--success);
  border-radius: 50%;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--paper-2);
  border-radius: 5px;
}

.segmented button {
  min-height: 40px;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: white;
  color: var(--wine);
  box-shadow: 0 2px 8px rgba(64, 21, 25, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.session-rules {
  display: flex;
  gap: 18px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.session-rules span {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.session-rules span:last-child {
  border: 0;
}

.session-rules strong {
  color: var(--wine);
}

.launch {
  width: 100%;
  min-height: 54px;
}

.final-preview {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  padding: 20px;
  background: var(--wine);
  color: white;
}

.final-preview span {
  color: #e8cdd0;
  font-size: 0.78rem;
}

.final-preview i {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.3rem;
  font-style: normal;
  font-weight: 900;
}

.schedule-list {
  display: grid;
}

.schedule-list div {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.schedule-list span {
  color: var(--muted);
}

.schedule-total {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding: 16px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-total strong {
  color: var(--wine);
}

.compact-ranking {
  margin-top: 22px;
  padding: 26px;
}

.text-button {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--orange);
  font-weight: 850;
}

.ranking-table {
  display: grid;
}

.ranking-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 70px;
  border-top: 1px solid var(--line);
}

.ranking-row .rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--wine);
  color: white;
  font-size: 0.74rem;
  font-weight: 900;
}

.ranking-row strong,
.ranking-row small {
  display: block;
}

.ranking-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.ranking-row > b {
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.empty {
  color: var(--muted);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.group-card {
  overflow: hidden;
}

.group-heading {
  display: grid;
  grid-template-columns: 52px 1fr 38px;
  align-items: end;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.group-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--wine);
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.group-heading input {
  min-height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 750;
}

.remove-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--red);
}

.mini-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mini-team {
  min-width: 0;
  padding: 20px 22px;
}

.mini-team + .mini-team {
  border-left: 1px solid var(--line);
}

.mini-team-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-name-input {
  min-height: 40px;
  margin-bottom: 14px;
  background: var(--paper);
  color: var(--wine);
  font-weight: 800;
}

.member-editor {
  display: grid;
  gap: 6px;
}

.member-item {
  display: grid;
  grid-template-columns: 24px 1fr 28px;
  align-items: center;
  gap: 7px;
}

.member-item > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.member-item input {
  min-height: 34px;
  padding: 0 8px;
  background: white;
}

.member-item .remove-button {
  width: 28px;
  height: 28px;
}

.add-member-form {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 6px;
  margin-top: 10px;
}

.add-member-form input {
  min-height: 36px;
}

.add-member-form button {
  background: var(--orange);
  border: 0;
  border-radius: 3px;
  color: white;
  font-size: 1.1rem;
}

.group-total {
  display: flex;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.78rem;
}

.group-total strong {
  color: var(--wine);
}

.upload-button {
  display: grid;
  place-items: center;
  min-height: 46px;
}

.upload-button input {
  display: none;
}

.import-report {
  margin-bottom: 20px;
  padding: 17px 20px;
  background: #f3e6cb;
  border-left: 4px solid var(--orange);
  color: var(--wine);
}

.import-report.error {
  background: #f8dfdc;
  border-left-color: var(--red);
}

.set-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  padding: 22px;
}

.set-progress strong {
  display: block;
  margin-top: 5px;
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 4px;
}

.progress-track i {
  display: block;
  height: 100%;
  background: var(--orange);
}

.set-progress > b {
  color: var(--wine);
}

.sets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.set-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
}

.set-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--orange);
}

.set-card.reserve::after {
  background: var(--red);
}

.set-card.final {
  background: var(--wine);
  color: white;
}

.set-card.final::after {
  background: var(--gold);
}

.set-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.set-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--paper-2);
  color: var(--wine);
  font-family: Georgia, serif;
  font-weight: 900;
}

.final .set-index {
  background: var(--gold);
}

.set-status {
  padding: 5px 8px;
  background: var(--paper-2);
  color: var(--muted);
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.set-status.complete {
  background: #e0efe6;
  color: var(--success);
}

.set-status.partial {
  background: #f4e5cd;
  color: #9b590d;
}

.set-card h2 {
  margin: 18px 0 3px;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.set-card p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.final p {
  color: #e8cdd0;
}

.ab-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 5px;
  margin: 16px 0;
}

.ab-pair span {
  overflow: hidden;
  padding: 7px 5px;
  background: var(--paper-2);
  color: var(--wine);
  border-radius: 3px;
  font-size: 0.66rem;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ab-pair i {
  color: var(--orange);
  font-style: normal;
  font-weight: 900;
}

.set-count {
  display: flex;
  align-items: end;
  gap: 5px;
}

.set-count strong {
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 2.2rem;
}

.final .set-count strong {
  color: var(--gold);
}

.set-count span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.word-preview {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.72rem;
}

.word-preview div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.word-preview div span {
  padding: 4px 6px;
  background: var(--paper-2);
  color: var(--wine);
  border-radius: 2px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.podium-card {
  display: grid;
  gap: 7px;
  min-height: 150px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
}

.podium-card.place-1 {
  background: var(--wine);
  color: white;
  border-color: var(--wine);
}

.podium-card span {
  color: var(--orange);
  font-size: 0.68rem;
  font-weight: 900;
}

.podium-card strong {
  font-family: Georgia, serif;
  font-size: 1.6rem;
}

.podium-card b {
  align-self: end;
  color: var(--orange);
  font-size: 1.3rem;
}

.ranking-table.full {
  padding: 10px 24px;
}

.ranking-table.full .ranking-row {
  grid-template-columns: 44px minmax(180px, 1fr) 130px 130px 120px;
}

.room-score {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.room-score b {
  margin-left: 5px;
  color: var(--ink);
}

body.playing {
  overflow: hidden;
}

.game-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  grid-template-rows: 76px minmax(0, 1fr) 94px;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(91, 18, 32, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 80px 100%;
}

.stage-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 40px;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  background: var(--wine);
  color: white;
}

.stage-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.stage-brand > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 900;
}

.stage-brand strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stage-score span {
  color: #e8cdd0;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stage-score strong {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.icon-button.light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.word-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 34px clamp(24px, 6vw, 100px);
  text-align: center;
}

.contestant-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.contestant-line strong {
  color: var(--orange);
}

.definition {
  width: min(1050px, 100%);
  min-height: 2.5em;
  font-family: Georgia, serif;
  font-size: clamp(1.65rem, 3.1vw, 3.8rem);
  line-height: 1.12;
}

.word-tiles {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 0.8vw, 12px);
  width: 100%;
  margin: clamp(34px, 7vh, 76px) 0;
}

.word-tiles span {
  display: grid;
  place-items: center;
  width: clamp(38px, 5.2vw, 76px);
  aspect-ratio: 0.82;
  background: white;
  border: 2px solid var(--wine);
  box-shadow: 0 8px 0 rgba(91, 18, 32, 0.12);
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 3rem);
  font-weight: 900;
}

.word-tiles span.revealed {
  background: var(--wine);
  color: var(--gold);
}

.next-word {
  display: grid;
  gap: 6px;
  width: min(780px, 100%);
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.next-word span {
  color: var(--orange);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.next-word strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  background: #f7ebde;
  border-left: 1px solid var(--line);
}

.timer-button {
  display: grid;
  place-items: center;
  align-content: center;
  width: 178px;
  height: 178px;
  background: var(--red);
  border: 9px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--red), 0 20px 40px rgba(199, 45, 45, 0.22);
  color: white;
}

.timer-button.running {
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  50% {
    box-shadow: 0 0 0 2px var(--red), 0 0 0 12px rgba(199, 45, 45, 0.13);
  }
}

.timer-button span {
  font-family: Georgia, serif;
  font-size: 2.7rem;
  font-weight: 900;
}

.timer-button small {
  margin-top: 5px;
  font-size: 0.64rem;
  font-weight: 900;
}

.potential {
  display: grid;
  gap: 3px;
  text-align: center;
}

.potential span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.potential strong {
  color: var(--wine);
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.stage-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border-top: 1px solid var(--line);
}

.stage-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  background: white;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-weight: 850;
}

.stage-action:last-child {
  border: 0;
}

.stage-action kbd {
  min-width: 42px;
  padding: 7px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--wine);
  font-family: inherit;
  font-size: 0.66rem;
}

.correct-action {
  background: var(--wine);
  color: white;
}

.correct-action kbd {
  background: var(--gold);
  border-color: var(--gold);
}

.wrong-action {
  color: var(--red);
}

.stage-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(91, 18, 32, 0.96);
  color: white;
  animation: result-in 0.18s ease-out;
}

.result-overlay.wrong {
  background: rgba(199, 45, 45, 0.97);
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
}

.result-symbol {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin-bottom: 22px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 5rem;
  font-weight: 300;
}

.result-overlay > strong {
  font-family: Georgia, serif;
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 1;
}

.result-overlay > span {
  margin-top: 18px;
  color: #f6dbbe;
  font-size: 1.2rem;
  font-weight: 800;
}

.soundboard {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.soundboard::backdrop {
  background: rgba(42, 17, 21, 0.58);
  backdrop-filter: blur(5px);
}

.soundboard form {
  padding: 26px;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 5px 0 20px;
  font-family: Georgia, serif;
}

.sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.sound-grid button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-weight: 800;
}

.sound-grid kbd {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--wine);
  color: var(--gold);
  border-radius: 3px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  max-width: 420px;
  padding: 15px 18px;
  background: var(--wine);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    height: 48px;
  }

  .dashboard-grid,
  .groups-grid {
    grid-template-columns: 1fr;
  }

  .sets-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-stage {
    grid-template-columns: 1fr;
    grid-template-rows: 70px minmax(0, 1fr) 110px 84px;
  }

  .timer-block {
    grid-row: 3;
    flex-direction: row;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .timer-button {
    width: 86px;
    height: 86px;
    border-width: 5px;
  }

  .timer-button span {
    font-size: 1.45rem;
  }

  .stage-controls {
    grid-row: 4;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 34vh;
    padding: 30px;
  }

  .auth-brand h1 {
    font-size: 3.1rem;
  }

  .auth-brand span,
  .vs-seal {
    display: none;
  }

  .login-card {
    margin: 30px auto;
    padding: 28px;
  }

  .topbar {
    position: static;
    padding: 12px 16px 0;
  }

  .brand-button strong,
  .brand-button small,
  .account > span {
    display: none;
  }

  .main-nav {
    justify-content: start;
    overflow-x: auto;
  }

  .nav-button {
    flex: 0 0 auto;
    padding: 0 13px;
  }

  .workspace {
    width: min(100% - 28px, 1420px);
    padding-top: 30px;
  }

  .page-heading {
    align-items: start;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 2.4rem;
  }

  .sets-grid,
  .podium {
    grid-template-columns: 1fr;
  }

  .mini-teams {
    grid-template-columns: 1fr;
  }

  .mini-team + .mini-team {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .session-rules {
    display: grid;
  }

  .session-rules span {
    border: 0;
  }

  .ranking-table.full .ranking-row,
  .ranking-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .ranking-table.full .room-score {
    display: none;
  }

  .set-progress {
    grid-template-columns: 1fr auto;
  }

  .progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .stage-header {
    padding: 0 14px;
  }

  .stage-score span {
    display: none;
  }

  .word-stage {
    padding: 20px 12px;
  }

  .definition {
    font-size: 1.45rem;
  }

  .word-tiles {
    flex-wrap: wrap;
    margin: 26px 0;
  }

  .word-tiles span {
    width: 34px;
  }

  .stage-action {
    gap: 4px;
    flex-direction: column;
    font-size: 0.7rem;
  }

  .stage-action kbd {
    min-width: 30px;
    padding: 4px;
  }

  .result-symbol {
    width: 84px;
    height: 84px;
    font-size: 3.5rem;
  }

  .result-overlay > strong {
    font-size: 3.5rem;
  }
}

/* VS playful edition */
:root {
  --paper: #fff7df;
  --paper-2: #ffe8ad;
  --ink: #35151b;
  --muted: #7b5055;
  --line: #7a1d2f;
  --wine: #651426;
  --wine-2: #861b2e;
  --red: #d83b35;
  --orange: #ed7b19;
  --amber: #f2a51f;
  --gold: #ffc53d;
  --success: #c65a18;
  --shadow: 7px 7px 0 rgba(101, 20, 38, 0.14);
}

body {
  background: var(--paper);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
.auth-brand h1,
.page-heading h1,
.panel-heading h2,
.login-card h2,
.ranking-row > b,
.set-card h2,
.set-count strong,
.podium-card strong,
.definition,
.timer-button span,
.potential strong,
.result-overlay > strong {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

.auth-shell {
  grid-template-columns: minmax(380px, 1.08fr) minmax(390px, 0.92fr);
  background: #fffdf7;
}

.auth-brand {
  justify-content: center;
  padding: clamp(44px, 7vw, 110px);
  background: var(--orange);
  color: white;
  border-right: 5px solid var(--wine);
}

.auth-brand::before {
  content: "VS";
  top: auto;
  right: -0.08em;
  bottom: -0.18em;
  left: auto;
  color: rgba(101, 20, 38, 0.09);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: min(50vw, 650px);
  transform: rotate(-5deg);
}

.auth-brand::after {
  background: none;
}

.vs-seal {
  width: 94px;
  height: 94px;
  margin-bottom: 30px;
  background: var(--wine);
  border: 4px solid white;
  border-radius: 8px;
  box-shadow: 7px 7px 0 var(--gold);
  color: var(--gold);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 2rem;
  transform: rotate(-4deg);
}

.auth-brand p {
  color: var(--wine);
  font-size: 0.86rem;
}

.auth-brand h1 {
  max-width: 760px;
  margin-top: 10px;
  color: white;
  font-size: clamp(3.4rem, 6vw, 6.8rem);
  line-height: 0.94;
  text-shadow: 4px 4px 0 var(--wine);
}

.auth-brand span {
  max-width: 520px;
  color: var(--wine);
  font-size: 1.12rem;
  font-weight: 900;
}

.floating-letter {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 72px;
  background: var(--gold);
  border: 4px solid var(--wine);
  border-radius: 8px;
  box-shadow: 5px 5px 0 rgba(101, 20, 38, 0.28);
  color: var(--wine);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 2rem;
}

.letter-one {
  top: 9%;
  left: 13%;
  transform: rotate(-12deg);
}

.letter-two {
  top: 14%;
  right: 16%;
  background: white;
  transform: rotate(9deg);
}

.letter-three {
  right: 10%;
  bottom: 12%;
  background: var(--red);
  color: white;
  transform: rotate(-8deg);
}

.login-card {
  gap: 21px;
  padding: clamp(30px, 5vw, 52px);
  background: white;
  border: 4px solid var(--wine);
  border-radius: 8px;
  box-shadow: 10px 10px 0 var(--gold);
}

.login-card h2 {
  color: var(--wine);
  font-size: 2.7rem;
}

.eyebrow {
  color: var(--red);
  letter-spacing: 0;
}

label {
  color: var(--wine);
}

input,
select,
textarea {
  background: #fffdf7;
  border: 2px solid #d6a283;
  border-radius: 6px;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
}

textarea {
  width: 100%;
  padding: 13px;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
  text-transform: none;
}

.button {
  border: 2px solid var(--wine);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--wine);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--wine);
}

.button.primary {
  background: var(--orange);
  color: white;
  box-shadow: 4px 4px 0 var(--wine);
}

.button.primary:hover {
  background: #dd6810;
}

.button.secondary {
  background: var(--gold);
  color: var(--wine);
}

.button.subtle {
  background: white;
  border-color: var(--wine);
}

.topbar {
  min-height: 78px;
  background: #fffdf7;
  border-bottom: 4px solid var(--wine);
  backdrop-filter: none;
}

.brand-monogram,
.group-number,
.ranking-row .rank {
  background: var(--wine);
  border: 2px solid var(--wine);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--gold);
  color: var(--gold);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

.main-nav {
  align-self: center;
  height: 46px;
  padding: 4px;
  background: var(--paper-2);
  border: 2px solid var(--wine);
  border-radius: 8px;
}

.nav-button {
  align-self: stretch;
  padding: 0 16px;
  border-radius: 5px;
  color: var(--wine);
}

.nav-button.active {
  background: var(--wine);
  color: white;
}

.nav-button.active::after {
  display: none;
}

.icon-button {
  border: 2px solid var(--wine);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--gold);
}

.workspace {
  padding-top: 38px;
}

.page-heading h1 {
  max-width: 920px;
  color: var(--wine);
  font-size: clamp(2.2rem, 4vw, 4.3rem);
  line-height: 1;
}

.page-heading p {
  color: var(--muted);
  font-weight: 650;
}

.session-summary {
  min-width: 130px;
  padding: 12px 16px;
  background: var(--gold);
  border: 3px solid var(--wine);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--wine);
}

.session-summary strong {
  color: var(--wine);
}

.panel,
.podium-card {
  background: white;
  border: 3px solid var(--wine);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading h2 {
  color: var(--wine);
}

.step {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border: 2px solid var(--wine);
  border-radius: 6px;
  color: var(--wine);
  transform: rotate(-4deg);
}

.status-dot {
  color: var(--red);
}

.status-dot::before {
  background: var(--orange);
}

.segmented {
  gap: 5px;
  background: var(--paper-2);
  border: 2px solid var(--wine);
  border-radius: 8px;
}

.segmented button {
  border-radius: 5px;
  color: var(--wine);
}

.segmented button.active {
  background: var(--wine);
  color: white;
  box-shadow: none;
}

.match-preview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  background: var(--paper);
  border: 3px solid var(--wine);
  border-radius: 8px;
}

.match-preview > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 88px;
  padding: 13px;
  background: white;
  border: 2px solid var(--orange);
  border-radius: 6px;
  text-align: center;
}

.match-preview > div:nth-of-type(2) {
  border-color: var(--red);
}

.match-preview small,
.match-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-preview small {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-preview strong {
  margin-top: 5px;
  color: var(--wine);
  font-size: 1.03rem;
}

.match-preview i {
  display: grid;
  place-items: center;
  align-self: center;
  width: 54px;
  height: 54px;
  background: var(--wine);
  border-radius: 50%;
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}

.match-preview > b {
  position: absolute;
  right: 18px;
  bottom: -12px;
  padding: 5px 9px;
  background: var(--gold);
  border: 2px solid var(--wine);
  border-radius: 5px;
  color: var(--wine);
  font-size: 0.65rem;
}

.session-rules span,
.schedule-list div,
.ranking-row {
  border-color: #e5c5a7;
}

.launch {
  background: var(--red) !important;
  font-size: 1rem;
}

.schedule-panel {
  background: var(--gold);
}

.schedule-list div {
  border-bottom: 2px dashed var(--wine);
}

.schedule-total {
  background: white;
  border: 2px solid var(--wine);
  border-radius: 6px;
}

.ranking-row .rank {
  box-shadow: 2px 2px 0 var(--orange);
}

.ranking-row > b {
  color: var(--red);
}

.group-heading {
  background: var(--gold);
  border-bottom: 3px solid var(--wine);
}

.group-heading input {
  border-bottom: 2px solid var(--wine);
  color: var(--wine);
}

.mini-team:first-child {
  background: #fff9ea;
}

.mini-team + .mini-team {
  background: #fff3e8;
  border-left: 3px solid var(--wine);
}

.mini-team-heading {
  color: var(--red);
}

.team-name-input {
  background: white;
  border-color: var(--orange);
}

.member-item input {
  border: 1px solid #d6a283;
}

.add-member-form button {
  background: var(--orange);
  border: 2px solid var(--wine);
  color: white;
}

.group-total {
  background: var(--wine);
  color: #ffd9bf;
}

.group-total strong {
  color: var(--gold);
}

.import-report {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  padding: 22px;
  background: white;
  border: 3px solid var(--wine);
  border-left: 9px solid var(--orange);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ai-loader {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 4px 13px;
}

.ai-loader i {
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
  border: 5px solid var(--paper-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-loader span,
.import-summary p {
  color: var(--muted);
}

.import-summary > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--red);
  border: 2px solid var(--wine);
  border-radius: 6px;
  color: white;
  font-weight: 900;
}

.mapping-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mapping-chips span {
  padding: 6px 9px;
  background: var(--paper-2);
  border: 1px solid var(--wine);
  border-radius: 5px;
  color: var(--wine);
  font-size: 0.7rem;
  font-weight: 800;
}

.import-preview {
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 2px solid #e5c5a7;
  border-radius: 6px;
}

.import-preview > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 58px;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5c5a7;
}

.import-preview span {
  color: var(--muted);
}

.import-preview b {
  color: var(--orange);
  font-size: 0.72rem;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.import-complete {
  background: var(--gold);
}

.manual-import {
  margin-bottom: 22px;
  padding: 24px;
  background: #fffdf7;
}

.manual-import-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.manual-import-heading h2 {
  margin: 5px 0 0;
  color: var(--wine);
}

.manual-import-heading > span {
  padding: 7px 10px;
  background: var(--gold);
  border: 2px solid var(--wine);
  border-radius: 5px;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 900;
}

.manual-import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.manual-lines,
.manual-import-grid .secondary {
  grid-column: 1 / -1;
}

.manual-import-grid .secondary {
  min-height: 48px;
}

.set-progress,
.set-card {
  border-width: 3px;
}

.progress-track {
  height: 13px;
  background: var(--paper-2);
  border: 2px solid var(--wine);
}

.progress-track i {
  background: var(--orange);
}

.set-card::after {
  height: 8px;
  background: var(--orange);
}

.set-card.reserve::after {
  background: var(--red);
}

.set-card.final {
  background: var(--wine);
  border-color: var(--wine);
}

.set-index,
.set-status,
.ab-pair span,
.word-preview div span {
  border: 1px solid var(--wine);
  border-radius: 5px;
}

.set-status.complete,
.set-status.partial {
  background: var(--gold);
  color: var(--wine);
}

.podium-card {
  border-width: 3px;
  box-shadow: 5px 5px 0 var(--gold);
}

.podium-card.place-1 {
  background: var(--wine);
  box-shadow: 6px 6px 0 var(--orange);
}

.game-stage {
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-rows: 90px minmax(0, 1fr) 100px;
  background: var(--paper);
  background-size: auto;
}

.stage-header {
  grid-template-columns: minmax(220px, 1fr) minmax(440px, auto) 40px;
  padding: 0 24px;
  background: var(--gold);
  border-bottom: 4px solid var(--wine);
  color: var(--wine);
}

.stage-brand > span {
  width: 48px;
  height: 48px;
  background: var(--wine);
  border: 3px solid var(--wine);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--orange);
  color: var(--gold);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

.stage-brand strong {
  color: var(--wine);
}

.stage-scores {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 42px minmax(140px, 1fr);
  align-items: center;
  gap: 8px;
}

.stage-scores > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px;
  background: white;
  border: 2px solid var(--wine);
  border-radius: 6px;
  opacity: 0.7;
}

.stage-scores > div.active {
  background: var(--red);
  color: white;
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--wine);
}

.stage-scores span {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-scores strong {
  flex: 0 0 auto;
  font-size: 1.1rem;
}

.stage-scores i {
  color: var(--wine);
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.icon-button.light {
  background: var(--wine);
  border-color: var(--wine);
  color: white;
}

.word-stage {
  background: #fffdf7;
}

.contestant-line {
  margin-bottom: 24px;
  padding: 7px 12px;
  background: var(--gold);
  border: 2px solid var(--wine);
  border-radius: 6px;
  color: var(--wine);
}

.contestant-line strong {
  color: var(--red);
}

.definition {
  color: var(--wine);
  font-size: clamp(1.6rem, 2.8vw, 3.3rem);
}

.word-tiles span {
  border: 4px solid var(--wine);
  border-radius: 7px;
  box-shadow: 5px 6px 0 var(--orange);
  color: var(--wine);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

.word-tiles span.revealed {
  background: var(--gold);
  color: var(--wine);
}

.next-word {
  padding: 13px 16px;
  background: var(--paper);
  border: 2px dashed var(--orange);
  border-radius: 6px;
}

.next-word strong {
  color: var(--wine);
}

.timer-block {
  background: var(--orange);
  border-left: 4px solid var(--wine);
}

.timer-button {
  width: 180px;
  height: 180px;
  background: var(--red);
  border: 8px solid white;
  box-shadow: 0 0 0 4px var(--wine), 8px 9px 0 var(--wine);
}

.timer-button.running {
  animation: timer-playful 1s ease-in-out infinite;
}

@keyframes timer-playful {
  50% {
    transform: scale(1.035);
    box-shadow: 0 0 0 4px var(--wine), 4px 5px 0 var(--wine);
  }
}

.potential span,
.potential strong {
  color: white;
}

.stage-controls {
  border-top: 4px solid var(--wine);
}

.stage-action {
  border-right: 3px solid var(--wine);
  color: var(--wine);
}

.stage-action kbd {
  background: var(--gold);
  border: 2px solid var(--wine);
  border-radius: 5px;
  color: var(--wine);
  box-shadow: 2px 2px 0 var(--orange);
}

.letter-action {
  background: var(--gold);
}

.wrong-action {
  background: #fff0e7;
  color: var(--red);
}

.correct-action {
  background: var(--red);
  color: white;
}

.result-overlay {
  background: rgba(237, 123, 25, 0.98);
}

.result-overlay.wrong {
  background: rgba(216, 59, 53, 0.98);
}

.result-symbol {
  background: var(--gold);
  border: 5px solid white;
  border-radius: 8px;
  box-shadow: 10px 10px 0 var(--wine);
  color: var(--wine);
  transform: rotate(-4deg);
}

.result-overlay > strong {
  color: white;
  text-shadow: 6px 6px 0 var(--wine);
}

.result-overlay > span {
  color: white;
}

.soundboard {
  border: 4px solid var(--wine);
  box-shadow: 8px 8px 0 var(--gold);
}

.sound-grid button {
  border: 2px solid var(--wine);
}

.toast {
  border: 3px solid var(--wine);
  border-radius: 7px;
  box-shadow: 5px 5px 0 var(--gold);
}

@media (max-width: 1050px) {
  .topbar {
    padding-top: 8px;
  }

  .main-nav {
    margin-bottom: 8px;
  }

  .stage-header {
    grid-template-columns: minmax(180px, 1fr) minmax(360px, auto) 40px;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 42vh;
    padding: 90px 28px 34px;
    border-right: 0;
    border-bottom: 5px solid var(--wine);
  }

  .auth-brand h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 11vw, 4.2rem);
    overflow-wrap: anywhere;
  }

  .floating-letter {
    width: 48px;
    height: 54px;
    font-size: 1.4rem;
  }

  .letter-two {
    display: none;
  }

  .login-card {
    margin: 34px 0;
  }

  .match-preview {
    grid-template-columns: 1fr;
  }

  .match-preview i {
    justify-self: center;
    width: 42px;
    height: 42px;
  }

  .manual-import-grid {
    grid-template-columns: 1fr;
  }

  .manual-lines,
  .manual-import-grid .secondary {
    grid-column: auto;
  }

  .import-preview > div {
    grid-template-columns: 1fr auto;
  }

  .import-preview span {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .game-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 118px minmax(0, 1fr) 92px 86px;
  }

  .stage-header {
    grid-template-columns: 1fr 38px;
    grid-template-rows: 42px 58px;
    gap: 4px 10px;
    padding: 8px 12px;
  }

  .stage-brand {
    min-width: 0;
  }

  .stage-brand > span {
    width: 36px;
    height: 36px;
  }

  .stage-scores {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  }

  .stage-scores > div {
    padding: 7px 8px;
  }

  .stage-scores span {
    display: none;
  }

  .timer-block {
    grid-row: 3;
    flex-direction: row;
    gap: 18px;
    padding: 7px 20px;
    border-top: 4px solid var(--wine);
    border-left: 0;
  }

  .timer-button {
    width: 75px;
    height: 75px;
    border-width: 4px;
    box-shadow: 0 0 0 2px var(--wine), 4px 4px 0 var(--wine);
  }

  .timer-button span {
    font-size: 1.35rem;
  }

  .stage-controls {
    grid-row: 4;
  }

  .word-tiles span {
    width: 31px;
    border-width: 3px;
    box-shadow: 3px 4px 0 var(--orange);
  }
}

/* VS live edition */
.group-heading {
  grid-template-columns: 72px minmax(0, 1fr) 40px;
}

.group-identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.group-identity span,
.team-field,
.participant-field {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.group-identity strong {
  color: var(--wine);
  font-size: 1.8rem;
}

.team-field,
.participant-field {
  display: grid;
  gap: 7px;
}

.team-name-input {
  min-height: 54px;
  color: var(--wine);
  font-size: 1.15rem;
  font-weight: 900;
}

.participant-field {
  position: relative;
  margin-top: 16px;
}

.participant-field input {
  width: 100%;
  min-height: 54px;
  padding-right: 90px;
  color: var(--red);
  font-size: 1.2rem;
  font-weight: 900;
}

.participant-field span {
  position: absolute;
  right: 14px;
  bottom: 18px;
  color: var(--muted);
  font-size: 0.68rem;
}

.match-preview > b {
  grid-column: 1 / -1;
  color: var(--wine);
  font-size: 0.75rem;
  text-align: center;
}

.game-stage {
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: 96px minmax(0, 1fr) 112px;
}

.stage-header {
  background: #f1b53d;
}

.stage-brand strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-scores span {
  display: grid;
  gap: 1px;
  font-size: 0.88rem;
}

.stage-scores span small {
  font-size: 0.58rem;
  opacity: 0.72;
}

.stage-scores > div.active span {
  color: white;
}

.word-stage {
  justify-content: center;
  background-color: #fff0c9;
  box-shadow: inset 0 0 0 12px #f5c95f;
}

.contestant-line {
  display: grid;
  justify-items: center;
  width: min(900px, 100%);
  margin: 0 auto 34px;
  padding: 16px 20px 18px;
  background: var(--wine);
  border-color: var(--wine);
  color: #ffd66b;
  box-shadow: 7px 7px 0 var(--red);
}

.contestant-line span {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contestant-line strong {
  max-width: 100%;
  color: white;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
}

.definition {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--wine);
  border-radius: 7px;
  font-size: clamp(1.7rem, 3vw, 3.6rem);
  line-height: 1.12;
  box-shadow: 7px 7px 0 var(--orange);
}

.word-tiles {
  margin-top: 42px;
}

.word-tiles span {
  width: clamp(44px, 5vw, 76px);
  height: clamp(56px, 7vw, 94px);
  font-size: clamp(1.7rem, 3.4vw, 3.6rem);
}

.timer-button:disabled {
  cursor: default;
  opacity: 1;
}

.stage-controls {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stage-action {
  min-width: 0;
  padding: 15px 10px;
  font-size: clamp(0.92rem, 1.4vw, 1.35rem);
  font-weight: 950;
}

.next-action {
  background: var(--wine);
  color: white;
}

.next-action.ready {
  background: var(--orange);
  color: white;
}

.meme-action {
  background: white;
}

.stage-action:disabled {
  filter: saturate(0.35);
  opacity: 0.45;
}

.soundboard {
  width: min(760px, calc(100% - 32px));
}

.soundboard form {
  display: grid;
  gap: 18px;
}

.sound-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sound-grid button {
  display: grid;
  min-height: 76px;
  place-content: center;
  background: #fff0c9;
  color: var(--wine);
}

.sound-grid button span {
  font-size: 1rem;
  font-weight: 900;
}

.sound-grid button small {
  color: var(--red);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.meme-player {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--wine);
  border: 3px solid var(--wine);
  border-radius: 6px;
}

.meme-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 760px) {
  .game-stage {
    grid-template-rows: 120px minmax(0, 1fr) 92px 120px;
  }

  .stage-brand strong {
    font-size: 0.78rem;
  }

  .contestant-line {
    margin-bottom: 18px;
    padding: 10px;
  }

  .contestant-line strong {
    font-size: clamp(1.55rem, 8vw, 2.5rem);
  }

  .definition {
    padding: 12px;
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }

  .word-tiles {
    margin-top: 20px;
  }

  .stage-controls {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stage-action {
    padding: 8px 3px;
    font-size: 0.67rem;
    overflow-wrap: anywhere;
  }

  .sound-grid {
    grid-template-columns: 1fr;
  }
}

.auth-logo-lockup {
  position: relative;
  z-index: 1;
  width: min(360px, 86%);
  margin-bottom: 12px;
  overflow: hidden;
  background: white;
  border: 4px solid var(--gold);
  border-radius: 8px;
  box-shadow: 9px 9px 0 var(--red);
}

.auth-logo-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-button {
  min-width: 126px;
}

.brand-logo-lockup,
.stage-logo-lockup {
  position: relative;
  display: block;
  overflow: hidden;
  background: white;
  border: 2px solid var(--wine);
  border-radius: 6px;
}

.brand-logo-lockup {
  width: 112px;
  height: 70px;
}

.brand-logo-lockup img,
.stage-logo-lockup img {
  position: absolute;
  display: block;
  width: 152px;
  max-width: none;
  left: -24px;
  top: -53px;
}

.stage-brand > .stage-logo-lockup {
  width: 104px;
  height: 66px;
  background: white;
  border: 2px solid var(--wine);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--red);
}

.stage-logo-lockup img {
  width: 142px;
  left: -22px;
  top: -49px;
}

.stage-brand {
  gap: 14px;
}

.game-stage {
  grid-template-rows: 96px minmax(0, 1fr);
}

.word-stage {
  grid-column: 1;
  grid-row: 2;
}

.timer-block {
  grid-column: 2;
  grid-row: 2;
}

.meme-audio-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -10px;
  bottom: -10px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 760px) {
  .auth-logo-lockup {
    width: min(280px, 90%);
  }

  .brand-logo-lockup {
    width: 94px;
    height: 58px;
  }

  .brand-logo-lockup img {
    width: 128px;
    left: -20px;
    top: -45px;
  }

  .stage-brand > .stage-logo-lockup {
    width: 78px;
    height: 48px;
  }

  .stage-logo-lockup img {
    width: 106px;
    left: -16px;
    top: -37px;
  }

  .game-stage {
    grid-template-rows: 120px minmax(0, 1fr) 92px;
  }

  .timer-block {
    grid-column: 1;
    grid-row: 3;
  }
}
