.event-body {
  --event-ink: #f4efe6;
  --event-muted: rgba(244, 239, 230, 0.72);
  --event-panel: rgba(12, 16, 14, 0.78);
  --event-line: rgba(244, 239, 230, 0.14);
  --event-accent: #c4a35a;
  --event-good: #3f8f6b;
  --event-bad: #b04a4a;
}

.leave-game-btn {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 22;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(176, 74, 74, 0.55);
  background: rgba(5, 8, 6, 0.82);
  color: #e8a0a0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.leave-game-btn:hover,
.leave-game-btn:focus-visible {
  border-color: rgba(220, 100, 100, 0.85);
  background: rgba(80, 20, 20, 0.55);
  transform: translateY(-1px);
  outline: none;
}

.event-body.has-leave-game .server-badge {
  display: none;
}

.game-over-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  background: #000;
  color: #f4efe6;
  text-align: center;
  padding: 2rem 1.25rem;
  animation: shell-in 0.55s ease;
}

.game-over-screen[hidden] {
  display: none !important;
}

.game-over-eyebrow {
  margin: 0;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(244, 239, 230, 0.55);
}

.game-over-title {
  margin: 0.4rem 0 1.25rem;
  font-family: Cinzel, serif;
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  letter-spacing: 0.18em;
  font-weight: 700;
}

.game-over-winners-label {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: rgba(244, 239, 230, 0.65);
}

.game-over-winners {
  margin: 0.35rem 0 0;
  font-family: Cinzel, serif;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: #c4a35a;
  letter-spacing: 0.06em;
}

.game-over-roster {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  justify-content: center;
  max-width: 40rem;
}

.game-over-roster[hidden] {
  display: none !important;
}

.game-over-roster li {
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  letter-spacing: 0.04em;
  color: rgba(244, 239, 230, 0.9);
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: rgba(196, 163, 90, 0.08);
}

.game-over-note {
  margin: 1.75rem 0 0;
  max-width: 36rem;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  letter-spacing: 0.08em;
  line-height: 1.45;
  color: rgba(244, 239, 230, 0.88);
  text-transform: uppercase;
}

.game-over-actions {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
}

.game-over-actions .btn {
  min-width: 12rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-body.is-game-over .capo-start-bar {
  position: fixed;
  top: 4.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(96vw, 1100px);
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: rgba(8, 10, 9, 0.92);
  border: 1px solid rgba(196, 163, 90, 0.35);
  backdrop-filter: blur(10px);
}

.game-over-picker-card textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--event-line);
  color: var(--event-ink);
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: vertical;
  min-height: 4.5rem;
}

.game-over-picker {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
}

.game-over-picker[hidden] {
  display: none !important;
}

.game-over-picker-card {
  width: min(26rem, 100%);
  background: var(--event-panel);
  border: 1px solid var(--event-line);
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.game-over-picker-card h2 {
  margin: 0;
  font-family: Cinzel, serif;
  color: var(--event-ink);
}

.game-over-picker-card p {
  margin: 0;
  color: var(--event-muted);
  font-size: 0.9rem;
}

.game-over-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.event-hero {
  max-width: 1100px;
  margin: 4.2rem auto 1rem;
  padding: 0 1.25rem;
  text-align: center;
}

.event-hero .brand {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.06em;
  color: var(--event-ink);
  margin: 0.25rem 0;
}

.event-hero .tagline {
  max-width: 36rem;
  margin: 0.35rem auto 0;
  color: var(--event-muted);
}

.event-gate {
  max-width: 36rem;
  margin: 1.5rem auto;
  padding: 1.5rem;
  text-align: center;
  background: var(--event-panel);
  border: 1px solid var(--event-line);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 0.85rem;
  justify-items: stretch;
  animation: shell-in 0.4s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.lobby-picker {
  width: 100%;
  text-align: left;
}

.lobby-picker-title {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  color: var(--event-ink);
  letter-spacing: 0.08em;
  text-align: center;
}

.lobby-picker-sub {
  margin: 0.35rem 0 0.85rem;
  color: var(--event-muted);
  font-size: 0.88rem;
  text-align: center;
}

.lobby-picker-list {
  display: grid;
  gap: 0.55rem;
}

.lobby-pick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.32);
  text-align: left;
}

.lobby-pick-card.is-live {
  border-color: rgba(63, 143, 107, 0.45);
}

.lobby-pick-info {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.lobby-pick-info strong {
  color: var(--event-ink);
  font-size: 1rem;
}

.lobby-pick-meta {
  color: var(--event-muted);
  font-size: 0.75rem;
}

.lobby-pick-status {
  color: var(--event-accent);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.join-target {
  margin: 0;
  text-align: center;
  font-family: Cinzel, serif;
  color: var(--event-ink);
  font-size: 1.05rem;
}

.btn.linkish {
  background: transparent;
  border: none;
  color: var(--event-muted);
  padding: 0.25rem 0;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.btn.linkish:hover {
  color: var(--event-accent);
}

.code-form {
  width: 100%;
  display: grid;
  gap: 0.65rem;
  text-align: left;
}

.code-form label,
.admin-card label,
.event-folder-label {
  display: grid;
  gap: 0.3rem;
  color: var(--event-muted);
  font-size: 0.9rem;
}

.code-form input,
.admin-card input,
.admin-card select,
.admin-card textarea,
.team-box input,
.team-box select,
.chat-form input,
.challenge-modal-card input,
.challenge-modal-card textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--event-line);
  color: var(--event-ink);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.code-form input::placeholder {
  color: rgba(244, 239, 230, 0.38);
}

#event-code-input {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--event-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--event-ink);
  padding: 0.55rem 0.9rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(196, 163, 90, 0.55);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, #d4b36a, #9a7840);
  border-color: transparent;
  color: #1a140a;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(154, 120, 64, 0.28);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(154, 120, 64, 0.4);
}

.btn.good {
  background: rgba(63, 143, 107, 0.25);
  border-color: rgba(63, 143, 107, 0.55);
}

.btn.bad {
  background: rgba(176, 74, 74, 0.22);
  border-color: rgba(176, 74, 74, 0.5);
}

.admin-msg {
  margin: 0;
  min-height: 1.2em;
  color: var(--event-accent);
  font-size: 0.88rem;
}

.start-countdown {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  background: rgba(4, 6, 5, 0.82);
  backdrop-filter: blur(8px);
  text-align: center;
  animation: shell-in 0.25s ease;
}

.start-countdown[hidden] {
  display: none !important;
}

.start-countdown-label {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--event-accent);
}

.start-countdown-num {
  font-family: Cinzel, serif;
  font-size: clamp(5rem, 22vw, 11rem);
  line-height: 1;
  color: var(--event-ink);
  text-shadow: 0 0 60px rgba(196, 163, 90, 0.45);
  animation: count-pop 0.35s ease;
}

@keyframes count-pop {
  from {
    transform: scale(1.25);
    opacity: 0.35;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.capo-pending-banner a {
  color: #ffe6a0;
  font-weight: 700;
}

.capo-start-bar {
  max-width: 1280px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.event-folder-label select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--event-line);
  color: var(--event-ink);
  padding: 0.5rem 0.65rem;
  font: inherit;
  min-width: 12rem;
}

/* —— Main game shell: race | stage | activity —— */
.event-shell {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 0.85rem;
  max-width: 1480px;
  margin: 0 auto 3rem;
  padding: 0 1rem 2rem;
  align-items: start;
  min-height: 70vh;
  animation: shell-in 0.45s ease-out;
}

.event-shell.mode-lobby {
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(260px, 320px);
}

.race-panel {
  position: sticky;
  top: 4.4rem;
  background: var(--event-panel);
  border: 1px solid var(--event-line);
  backdrop-filter: blur(12px);
  padding: 0.85rem;
  max-height: calc(100vh - 5rem);
  overflow: auto;
}

.race-panel h2 {
  font-family: Cinzel, serif;
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: var(--event-ink);
}

.race-sub {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
}

.race-board {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.race-row {
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
}

.race-row.is-mine {
  border-color: rgba(196, 163, 90, 0.45);
  background: rgba(196, 163, 90, 0.08);
}

.race-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.race-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--event-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-meta {
  font-size: 0.68rem;
  color: var(--event-muted);
  flex-shrink: 0;
}

.race-bar {
  display: grid;
  grid-template-columns: repeat(var(--race-count, 11), minmax(0, 1fr));
  gap: 3px;
}

.race-cell {
  aspect-ratio: 1;
  min-height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.race-cell.is-off {
  background: #0a0a0a;
}

.race-cell.is-on {
  background: #2f8f4e;
  border-color: #3db865;
  box-shadow: 0 0 6px rgba(47, 143, 78, 0.35);
}

@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.event-stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 58vh;
  padding: 1.25rem 1.1rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(18, 22, 20, 0.72), rgba(8, 10, 9, 0.82)),
    radial-gradient(ellipse at 50% 0%, rgba(196, 163, 90, 0.12), transparent 55%);
  border: 1px solid var(--event-line);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  position: relative;
}

.event-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--event-accent), transparent);
  opacity: 0.7;
}

.play-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  animation: hud-in 0.4s ease;
}

.play-hud[hidden],
.lobby-hud[hidden] {
  display: none !important;
}

@keyframes hud-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage-hint {
  margin: 0 0 1.25rem;
  color: var(--event-muted);
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

/* —— COD-style lobby —— */
.lobby-hud {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  animation: hud-in 0.45s ease;
}

.lobby-banner {
  text-align: center;
  padding: 0.75rem 0.5rem 0.25rem;
}

.lobby-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--event-accent);
  animation: pulse-soft 2.4s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

.lobby-title {
  margin: 0.35rem 0 0.25rem;
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.18em;
  color: var(--event-ink);
  text-shadow: 0 0 40px rgba(196, 163, 90, 0.25);
}

.lobby-sub {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--event-muted);
  font-size: 0.95rem;
}

.lobby-main-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.75rem;
  align-items: stretch;
}

.lobby-squad-card {
  grid-column: 1;
  grid-row: 1;
}

.lobby-squads-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.lobby-roster-card {
  grid-column: 1;
  grid-row: 2;
}

.lobby-squads-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 22rem;
  overflow: auto;
}

.lobby-squad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}

.lobby-squad-row.is-mine {
  border-color: rgba(196, 163, 90, 0.4);
}

.lobby-squad-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.lobby-squad-info strong {
  color: var(--event-ink);
  font-size: 0.9rem;
}

.lobby-squad-info span {
  font-size: 0.72rem;
  color: var(--event-muted);
}

.lobby-squad-empty {
  color: var(--event-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.btn-join-squad {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.squad-you {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--event-accent);
  flex-shrink: 0;
}

.lobby-card {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--event-line);
  padding: 0.85rem 0.9rem 1rem;
  min-height: 11rem;
  position: relative;
  overflow: hidden;
}

.lobby-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--event-accent), transparent);
  opacity: 0.55;
}

.lobby-card h3 {
  margin: 0 0 0.75rem;
  font-family: Cinzel, serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--event-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lobby-count {
  font-family: Manrope, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--event-accent);
  border: 1px solid rgba(196, 163, 90, 0.4);
  padding: 0.1rem 0.45rem;
}

.lobby-squad-card .warmup-btn {
  width: 100%;
  margin-top: 0.85rem;
  letter-spacing: 0.14em;
  min-height: 2.75rem;
}

.squad-status {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.squad-name {
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  color: var(--event-ink);
  letter-spacing: 0.04em;
}

.squad-meta {
  color: var(--event-muted);
  font-size: 0.85rem;
}

.squad-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.squad-chip {
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: rgba(196, 163, 90, 0.1);
  color: var(--event-ink);
  font-size: 0.78rem;
}

.lobby-player-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.4rem;
  max-height: 14rem;
  overflow: auto;
}

.lobby-player-grid li {
  padding: 0.55rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--event-line);
  border-left: 2px solid rgba(196, 163, 90, 0.55);
  animation: card-in 0.35s ease backwards;
}

.lobby-player-grid li:nth-child(odd) {
  animation-delay: 0.04s;
}

.lobby-player-grid .name {
  display: block;
  color: var(--event-ink);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-player-grid .team {
  display: block;
  margin-top: 0.15rem;
  color: var(--event-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-player-grid .team.is-solo {
  color: rgba(244, 239, 230, 0.4);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.lobby-scoreboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
}

.lobby-scoreboard li {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--event-line);
  color: var(--event-ink);
  font-size: 0.84rem;
}

.lobby-scoreboard .rank {
  font-family: Cinzel, serif;
  color: var(--event-accent);
}

.lobby-scoreboard .pts {
  color: var(--event-accent);
  font-weight: 700;
}

.lobby-letter-preview-label {
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.4);
}

.lobby-letter-board {
  opacity: 0.55;
  pointer-events: none;
  transform: scale(0.92);
  transform-origin: center top;
}

.lobby-letter-board .letter-tile {
  cursor: default;
}

@media (max-width: 1100px) {
  .lobby-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lobby-teams-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.letter-board {
  --count: 11;
  --gap: clamp(0.35rem, 0.9vw, 0.65rem);
  list-style: none;
  margin: 0.75rem auto 0;
  padding: 0.35rem 0;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap);
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: min(100%, 52rem);
  overflow: visible;
}

.letter-tile {
  flex: 1 1 0;
  min-width: 2.6rem;
  max-width: 4.75rem;
  aspect-ratio: 1 / 1;
  width: auto;
  height: auto;
  min-height: 2.6rem;
  display: grid;
  place-items: center;
  font-family: Cinzel, serif;
  font-size: clamp(1.05rem, 3.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1;
  border: 3px solid rgba(244, 239, 230, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: transparent;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
}

.letter-tile .glyph {
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  text-transform: uppercase;
}

.letter-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 163, 90, 0.7);
}

.letter-tile:focus-visible {
  outline: 2px solid var(--event-accent);
  outline-offset: 3px;
}

.letter-tile .slot {
  position: absolute;
  bottom: 0.25rem;
  right: 0.3rem;
  font-family: Manrope, sans-serif;
  font-size: clamp(0.55rem, 1.2vw, 0.72rem);
  color: rgba(244, 239, 230, 0.4);
  line-height: 1;
}

.letter-tile.is-unlocked {
  color: var(--event-ink);
  border-color: #3f8f6b;
  box-shadow: 0 0 0 1px rgba(63, 143, 107, 0.45), inset 0 0 24px rgba(63, 143, 107, 0.18);
  background: linear-gradient(180deg, rgba(63, 143, 107, 0.28), rgba(0, 0, 0, 0.4));
}

.letter-tile.is-pending {
  border-color: rgba(184, 134, 11, 0.7);
}

.letter-tile.is-rejected {
  border-color: rgba(180, 70, 70, 0.75);
}

.final-hint {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(196, 163, 90, 0.45);
  color: var(--event-ink);
  background: rgba(196, 163, 90, 0.12);
  max-width: 36rem;
  text-align: center;
}

.warmup-btn {
  margin: 0.85rem 0 0.25rem;
  min-width: 10rem;
  letter-spacing: 0.08em;
}

.modal-prompt-img,
.modal-prompt-video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  margin: 0 0 1rem;
  border: 1px solid var(--event-line);
  background: rgba(0, 0, 0, 0.35);
}

.modal-prompt-video {
  max-height: 320px;
}

.modal-prompt-youtube {
  width: 100%;
  margin: 0 0 1rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--event-line);
  background: rgba(0, 0, 0, 0.35);
}

.modal-prompt-youtube iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.team-box {
  margin: 0.5rem 0 0.75rem;
}

.nick-set-form {
  display: grid;
  gap: 0.35rem;
  margin: 0.35rem 0 0.85rem;
}

.nick-set-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--event-muted);
}

.nick-set-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.nick-set-row input {
  flex: 1 1 10rem;
  min-width: 0;
}

.nick-set-form .admin-msg {
  margin: 0;
  min-height: 1em;
  font-size: 0.8rem;
}

.submit-form .modal-nick-field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--event-muted);
}

.submit-form .modal-nick-field input {
  text-transform: none;
  letter-spacing: normal;
  font-size: 1rem;
}

.team-box form,
.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.team-box input,
.team-box select {
  flex: 1 1 8rem;
  width: auto;
}

.drop-zone {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px dashed rgba(196, 163, 90, 0.45);
  background: rgba(0, 0, 0, 0.28);
  color: var(--event-muted);
  font-size: 0.88rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.drop-zone:hover,
.drop-zone.is-drag {
  border-color: var(--event-accent);
  background: rgba(196, 163, 90, 0.1);
  color: var(--event-ink);
}

.drop-zone strong {
  color: var(--event-ink);
  font-weight: 600;
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-preview {
  display: none;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin: 0 auto;
  border: 1px solid var(--event-line);
}

.drop-zone.has-file .drop-preview {
  display: block;
}

.drop-zone.has-file .drop-hint {
  display: none;
}

.drop-filename {
  font-size: 0.75rem;
  color: var(--event-accent);
}

/* —— Side rail —— */
.event-side {
  position: sticky;
  top: 4.4rem;
  display: grid;
  gap: 0.65rem;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  align-content: start;
}

.feed-panel {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  max-height: calc(100vh - 5.5rem);
}

.activity-log {
  flex: 1;
  min-height: 14rem;
  max-height: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.activity-line {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--event-muted);
  animation: kill-in 0.3s ease-out;
}

.activity-line.chat .who {
  color: var(--event-accent);
  font-weight: 600;
}

.activity-line.kill.is-correct,
.activity-line.system {
  color: #f0d58a;
}

.activity-line.kill.is-wrong {
  color: #e8a0a0;
}

.kill-feed {
  display: none;
}

.kill-item {
  font-size: 0.8rem;
  color: #f0d58a;
  animation: kill-in 0.35s ease-out;
}

.kill-item.is-wrong {
  color: #e8a0a0;
}

@keyframes kill-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.side-panel {
  background: var(--event-panel);
  border: 1px solid var(--event-line);
  backdrop-filter: blur(12px);
  padding: 0.85rem;
  transition: border-color 0.2s ease;
}

.side-panel:hover {
  border-color: rgba(196, 163, 90, 0.28);
}

.side-panel h2 {
  font-family: Cinzel, serif;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--event-ink);
}

.play-only-panel[hidden] {
  display: none !important;
}

.subhead {
  margin: 0.75rem 0 0.4rem;
  font-family: Cinzel, serif;
  font-size: 0.88rem;
  color: var(--event-ink);
}

.scoreboard,
.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.scoreboard li {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--event-line);
  color: var(--event-ink);
  font-size: 0.88rem;
}

.scoreboard .rank {
  color: var(--event-accent);
  font-family: Cinzel, serif;
}

.scoreboard .pts {
  font-weight: 700;
  color: var(--event-accent);
}

.scoreboard .meta {
  grid-column: 2 / -1;
  font-size: 0.72rem;
  color: var(--event-muted);
}

.player-list li {
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--event-line);
  color: var(--event-ink);
  font-size: 0.86rem;
}

.player-list .muted {
  color: var(--event-muted);
  font-size: 0.75rem;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(8rem, 1fr) auto;
  gap: 0.45rem;
  min-height: 14rem;
  max-height: 22rem;
}

.chat-log {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-line {
  font-size: 0.84rem;
  color: var(--event-ink);
  line-height: 1.35;
}

.chat-line .who {
  color: var(--event-accent);
  font-weight: 600;
}

.chat-line.kill {
  color: #f0d58a;
}

.chat-line.system {
  color: var(--event-muted);
  font-style: italic;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
}

/* —— Challenge modal —— */
.challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.challenge-modal[hidden] {
  display: none !important;
}

.challenge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.challenge-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  max-height: min(90vh, 40rem);
  overflow: auto;
  background: linear-gradient(180deg, rgba(28, 32, 28, 0.97), rgba(10, 12, 11, 0.98));
  border: 1px solid rgba(196, 163, 90, 0.4);
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.28s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--event-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-slot {
  margin: 0 0 0.25rem;
  color: var(--event-accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-modal-card h2 {
  margin: 0 0 0.5rem;
  font-family: Cinzel, serif;
  font-size: 1.35rem;
  color: var(--event-ink);
}

.challenge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.chip {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--event-line);
  color: var(--event-muted);
}

.chip.auto {
  border-color: rgba(196, 163, 90, 0.5);
  color: var(--event-accent);
}

.chip.manual {
  border-color: rgba(120, 160, 200, 0.45);
  color: #9ec0e0;
}

.chip.ok {
  border-color: rgba(63, 143, 107, 0.55);
  color: #8fd0b0;
}

.chip.wait {
  border-color: rgba(184, 134, 11, 0.55);
  color: #e0c070;
}

.chip.no {
  border-color: rgba(176, 74, 74, 0.5);
  color: #e09090;
}

.modal-desc {
  color: var(--event-muted);
  white-space: pre-wrap;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

#modal-body form {
  display: grid;
  gap: 0.5rem;
}

.panel-sub {
  margin: 0 0 0.65rem;
  color: var(--event-muted);
  font-size: 0.9rem;
}

.event-admin {
  max-width: 1280px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}

.event-admin h2 {
  font-family: Cinzel, serif;
  color: var(--event-ink);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.admin-card {
  background: var(--event-panel);
  border: 1px solid var(--event-line);
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}

.admin-card h3 {
  margin: 0;
  font-family: Cinzel, serif;
  font-size: 1rem;
  color: var(--event-ink);
}

.admin-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 28rem;
  overflow: auto;
  scroll-margin-top: 5rem;
}

.pending-item {
  border: 1px solid var(--event-line);
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
}

.pending-item h4 {
  margin: 0 0 0.35rem;
  color: var(--event-ink);
  font-size: 0.95rem;
}

.pending-item p {
  margin: 0 0 0.4rem;
  color: var(--event-muted);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.pending-item img {
  max-width: 100%;
  max-height: 180px;
  display: block;
  margin: 0.4rem 0;
  border: 1px solid var(--event-line);
}

.pending-note-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.55rem 0 0.65rem;
  color: var(--event-muted);
  font-size: 0.82rem;
}

.pending-note {
  width: 100%;
  resize: vertical;
  min-height: 3.2rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--event-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--event-ink);
  font: inherit;
}

.pending-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.review-feedback {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(180, 70, 70, 0.55);
  background: rgba(140, 40, 40, 0.2);
  color: var(--event-ink);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.review-feedback strong {
  color: #e8a0a0;
}

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

  .race-panel,
  .event-side {
    position: static;
    max-height: none;
  }

  .lobby-main-grid {
    grid-template-columns: 1fr;
  }

  .lobby-squad-card,
  .lobby-squads-card,
  .lobby-roster-card {
    grid-column: 1;
    grid-row: auto;
  }

  .letter-tile {
    min-width: 2.1rem;
    min-height: 2.1rem;
    font-size: clamp(0.95rem, 4.5vw, 1.35rem);
  }

  .admin-row {
    grid-template-columns: 1fr;
  }
}
