@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #080815;
  --bg-2: #140f2b;
  --card: rgba(16, 15, 36, 0.88);
  --card-border: rgba(136, 152, 255, 0.38);
  --panel: rgba(16, 14, 36, 0.94);
  --panel-2: rgba(8, 10, 22, 0.96);
  --panel-glow: rgba(108, 126, 255, 0.36);
  --panel-inner: rgba(255, 255, 255, 0.08);
  --accent: #ffb703;
  --accent-2: #4deeea;
  --accent-3: #ff5ea6;
  --accent-4: #6bff7a;
  --accent-5: #5c7cff;
  --gold: #ffd166;
  --silver: #c7d2e4;
  --bronze: #d99b6c;
  --text: #fff7f0;
  --muted: rgba(255, 247, 240, 0.72);
  --danger: #ff3366;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --bg-image: url('assets/background.jpg');
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    var(--bg-image),
    radial-gradient(circle at 12% 18%, rgba(92, 124, 255, 0.32), transparent 55%),
    radial-gradient(circle at 86% 24%, rgba(255, 183, 3, 0.2), transparent 50%),
    radial-gradient(circle at 60% 82%, rgba(255, 94, 166, 0.18), transparent 55%),
    linear-gradient(180deg, #1a1237 0%, #0b0a1b 58%, #06060f 100%);
  background-repeat: no-repeat;
  background-size: cover, 140% 140%, 140% 140%, 140% 140%, 100% 100%;
  background-position: center, center, center, center, center;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px),
    radial-gradient(rgba(92, 124, 255, 0.16) 2px, transparent 2px);
  background-size: 120px 120px, 220px 220px;
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: -10% -10% 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 94, 166, 0.22), transparent 55%),
    radial-gradient(circle at 86% 18%, rgba(107, 255, 122, 0.2), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 183, 3, 0.2), transparent 55%),
    radial-gradient(circle at 30% 70%, rgba(92, 124, 255, 0.2), transparent 55%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  mix-blend-mode: screen;
}

.app {
  position: relative;
  z-index: 1;
  padding: 32px clamp(16px, 4vw, 48px) 48px;
  max-width: 1480px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 14px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(24, 20, 52, 0.94), rgba(12, 16, 32, 0.92));
  border: 1px solid rgba(130, 150, 255, 0.45);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 0;
}

.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 55%);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

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

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 72px;
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35));
}

.partner-logo {
  width: 110px;
}

.secondary-logo {
  width: 48px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.brand h1 {
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  margin: 6px 0 4px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(255, 183, 3, 0.35);
}

h2,
h3 {
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  letter-spacing: 0.08em;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.36em;
  font-size: 12px;
  margin: 0;
  color: var(--accent-2);
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-banner {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(40, 46, 92, 0.7), rgba(14, 14, 28, 0.9));
  border: 1px solid rgba(255, 183, 3, 0.6);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 320px;
}

.header-banner:hover {
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 16px 32px rgba(255, 183, 3, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.banner-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.pill {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(92, 124, 255, 0.16));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 600;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 2px solid rgba(77, 238, 234, 0.6);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px) scale(0.98);
}

button.primary {
  background: linear-gradient(135deg, #ffd166 0%, #ff8f3b 45%, #ff5ea6 100%);
  color: #2a1400;
  border: 1px solid rgba(255, 209, 102, 0.9);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 32px rgba(255, 122, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

button.primary:hover {
  box-shadow: 0 18px 38px rgba(255, 122, 61, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

button.ghost {
  background: linear-gradient(135deg, rgba(38, 44, 92, 0.6), rgba(18, 18, 34, 0.8));
  color: var(--text);
  border: 1px solid rgba(122, 146, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

button.ghost:hover {
  box-shadow: 0 12px 26px rgba(80, 100, 200, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button-link:hover {
  transform: translateY(-1px);
}

.button-link:active {
  transform: translateY(1px) scale(0.98);
}

.button-link.primary {
  background: linear-gradient(135deg, #ffd166 0%, #ff8f3b 45%, #ff5ea6 100%);
  color: #2a1400;
  border: 1px solid rgba(255, 209, 102, 0.9);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 32px rgba(255, 122, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.button-link.primary:hover {
  box-shadow: 0 18px 38px rgba(255, 122, 61, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.icon-button {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(12, 16, 34, 0.85);
  border: 1px solid rgba(122, 146, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 20px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.game-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-panel {
  position: relative;
  background:
    radial-gradient(circle at 50% -20%, rgba(100, 130, 255, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(24, 18, 52, 0.98) 0%, rgba(7, 8, 20, 0.98) 100%);
  border-radius: 30px;
  border: 1px solid rgba(130, 150, 255, 0.55);
  box-shadow: 0 45px 90px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(90, 120, 255, 0.18);
  overflow: hidden;
  height: min(62vh, 560px);
  min-height: 420px;
}

.game-panel::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 30px rgba(120, 140, 255, 0.18);
  pointer-events: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(20, 18, 40, 0.9), rgba(10, 10, 22, 0.96));
  border: 1px solid rgba(120, 140, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.4), rgba(255, 94, 166, 0.28));
  border: 1px solid rgba(255, 209, 102, 0.9);
  box-shadow: 0 0 28px rgba(255, 183, 3, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.score-pill span {
  font-size: 24px;
}

.score-icon {
  width: 30px;
  height: 49px;
  object-fit: contain;
  display: inline-block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.hud-pill {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(58, 70, 130, 0.45), rgba(20, 22, 42, 0.72));
  border: 1px solid rgba(120, 142, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.life-pulse {
  animation: lifePulse 0.7s ease;
}

@keyframes lifePulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  40% {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(255, 209, 102, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
}

.player-name-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.player-name-pill span {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.floating-word-bank {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(520px, 92%);
  z-index: 4;
}

.floating-sentence-panel {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: min(640px, 92%);
  z-index: 4;
}

.sentence-panel.floating {
  background: rgba(12, 16, 36, 0.92);
  border: 1px solid rgba(120, 140, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.sentence-panel h3 {
  text-align: center;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  background: rgba(7, 8, 18, 0.75);
}

.overlay-card {
  position: relative;
  text-align: center;
  padding: 32px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(20, 16, 42, 0.97), rgba(9, 10, 22, 0.98));
  border: 1px solid rgba(130, 150, 255, 0.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: floatIn 0.6s ease;
}

.overlay-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.overlay-actions > * {
  flex: 1 1 180px;
}

.overlay-actions button,
.overlay-actions .button-link {
  width: 100%;
}

.round-card {
  width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.player-card {
  width: min(520px, 92vw);
}

.player-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 10px;
}

.loading-bar {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 255, 0.45);
  background: rgba(10, 12, 24, 0.85);
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(92, 124, 255, 0.9), rgba(255, 183, 3, 0.9));
  box-shadow: 0 0 18px rgba(92, 124, 255, 0.45);
  transition: width 0.2s ease;
}

.choice-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.difficulty-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 6px;
  text-align: left;
}

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

.difficulty-options button {
  padding: 10px 14px;
  font-size: 13px;
}

.difficulty-options button.is-on {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.9), rgba(255, 94, 166, 0.85));
  color: #2a1400;
  border: 1px solid rgba(255, 209, 102, 0.9);
  box-shadow: 0 10px 22px rgba(255, 183, 3, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
}

.code-reveal {
  margin: 12px 0 16px;
}

.code-box {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 183, 3, 0.6);
  color: var(--accent);
}

.code-warning {
  margin: 10px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 183, 3, 0.18);
  border: 2px solid rgba(255, 183, 3, 0.6);
  color: #ffe39b;
}

.status {
  margin-top: 10px;
  font-size: 14px;
  color: var(--accent-2);
}

.status.warn {
  color: var(--danger);
}

.overlay-card h2 {
  font-family: 'Orbitron', sans-serif;
  margin: 0 0 10px;
  color: #ffe6a3;
  text-shadow: 0 0 18px rgba(255, 183, 3, 0.35);
}

.welcome-logo {
  display: block;
  width: min(280px, 70%);
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
}

.overlay-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.round-card .eyebrow {
  margin: 0;
}

.round-image {
  width: min(360px, 82vw);
  height: 180px;
  border-radius: 18px;
  border: 1px solid rgba(130, 150, 255, 0.5);
  background-color: rgba(12, 14, 28, 0.6);
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.round-image.is-empty {
  background: radial-gradient(circle at 30% 30%, rgba(255, 214, 102, 0.35), transparent 55%),
    radial-gradient(circle at 70% 20%, rgba(92, 124, 255, 0.4), transparent 45%),
    linear-gradient(135deg, rgba(36, 22, 64, 0.95), rgba(16, 20, 44, 0.95));
}

.round-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
}

.round-score strong {
  font-size: 32px;
  color: var(--accent);
}

.level-sentence {
  margin: 6px 0 12px;
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  font-size: 16px;
  color: var(--accent-4);
  text-transform: none;
}

.level-bonus {
  margin: 4px 0 16px;
  font-weight: 700;
  color: var(--accent);
}

.level-medal {
  margin: -8px 0 16px;
  font-weight: 700;
}

.level-medal.gold {
  color: var(--gold);
}

.level-medal.silver {
  color: var(--silver);
}

.level-medal.bronze {
  color: var(--bronze);
}

.level-medal.none {
  color: var(--muted);
}

.medals-pill {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.medal-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.medal-sep {
  color: rgba(255, 255, 255, 0.4);
  margin: 0 6px;
}

.medal-img {
  width: 30px;
  height: 34px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.medal-gold {
  color: var(--gold);
  font-weight: 700;
}

.medal-silver {
  color: var(--silver);
  font-weight: 700;
}

.medal-bronze {
  color: var(--bronze);
  font-weight: 700;
}

.medal-summary {
  margin: 6px 0 16px;
  font-weight: 700;
  color: var(--accent-2);
}

.hidden {
  display: none !important;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(20, 18, 44, 0.92), rgba(9, 12, 26, 0.96));
  border-radius: 22px;
  border: 1px solid var(--card-border);
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: fadeUp 0.6s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

#wordBankSlot {
  min-height: 120px;
}

#sentenceSlot {
  min-height: 140px;
}

.card h3 {
  margin-top: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #ffe6a3;
  text-shadow: 0 0 16px rgba(255, 183, 3, 0.28);
}

.sentence-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 12px;
}

.sentence-controls {
  display: flex;
  justify-content: flex-end;
}

.sentence-controls button {
  padding: 8px 14px;
  font-size: 12px;
}

.wordbank-controls {
  margin-top: 8px;
  justify-content: center;
}

.sentence-slot {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 16, 36, 0.8);
  border: 1px dashed rgba(120, 142, 255, 0.6);
  font-size: 14px;
  color: #f7f6f1;
}

.sentence-slot.filled {
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.3), rgba(255, 94, 166, 0.24));
  border-style: solid;
  box-shadow: 0 0 16px rgba(92, 124, 255, 0.35);
}

.translation {
  min-height: 24px;
  color: var(--accent-4);
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.translation.visible {
  opacity: 1;
  transform: translateY(0);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
}

.word-bank.highlight {
  padding: 12px;
  border-radius: 16px;
  border: 2px solid rgba(92, 124, 255, 0.7);
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.2), rgba(255, 94, 166, 0.2));
  box-shadow: 0 0 28px rgba(92, 124, 255, 0.35);
}

.word-bank.highlight .word-chip {
  animation: pulseGlow 1.6s ease-in-out infinite;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.muted.warn {
  color: var(--danger);
}

.word-chip {
  background: linear-gradient(135deg, rgba(30, 34, 70, 0.7), rgba(15, 16, 30, 0.85));
  border-radius: 999px;
  border: 1px solid rgba(132, 152, 255, 0.45);
  padding: 8px 14px;
  font-size: 14px;
  color: #f7f6f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.word-chip:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(64, 74, 140, 0.7), rgba(22, 24, 40, 0.85));
  box-shadow: 0 10px 22px rgba(92, 124, 255, 0.25);
}

.word-bank-card.floating {
  border: 2px solid rgba(255, 183, 3, 0.6);
  background: rgba(12, 8, 28, 0.95);
  box-shadow: 0 0 30px rgba(255, 183, 3, 0.28);
}

.word-bank-card.floating h3 {
  text-align: center;
}

.word-bank.shake {
  animation: shake 0.35s ease;
}

.instructions-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.audio-toggle {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audio-toggle span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.audio-toggle button {
  padding: 8px 14px;
  font-size: 12px;
}

.audio-toggle button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.audio-subtoggle {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.audio-subtoggle span {
  font-size: 12px;
  color: rgba(255, 247, 240, 0.65);
}

.audio-toggle button.is-on {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.9), rgba(255, 94, 166, 0.85));
  color: #2a1400;
  border: 1px solid rgba(255, 209, 102, 0.9);
  box-shadow: 0 10px 22px rgba(255, 183, 3, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.scoreboard-heading,
.scoreboard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.score-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  border: 1px solid rgba(120, 140, 255, 0.55);
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.28), rgba(20, 22, 44, 0.9));
}

.scoreboard-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.scoreboard-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

.scoreboard-difficulty {
  min-width: min(240px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-status {
  font-size: 13px;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.score-status.warn {
  color: var(--accent-3);
}

.score-rank {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(92, 124, 255, 0.6);
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.3), rgba(18, 20, 44, 0.85));
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(24, 26, 54, 0.9), rgba(12, 12, 24, 0.88));
  border: 1px solid rgba(128, 150, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  gap: 12px;
}

.score-row.is-player {
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.32), rgba(255, 94, 166, 0.24));
  border-color: rgba(92, 124, 255, 0.85);
  box-shadow: 0 0 18px rgba(92, 124, 255, 0.4);
}

.score-row span {
  font-weight: 600;
}

.score-row span:last-child {
  font-weight: 800;
  color: var(--accent);
  min-width: 64px;
  text-align: right;
  letter-spacing: 0.04em;
}

.score-card .score-row {
  align-items: flex-start;
}

.score-card .score-row span:first-child {
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  flex: 1;
  min-width: 0;
}

.score-card .score-row span:last-child {
  font-size: 14px;
}

.score-row:nth-child(1) {
  border-color: rgba(255, 209, 102, 0.85);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.35);
}

.score-row:nth-child(2) {
  border-color: rgba(199, 210, 228, 0.8);
  box-shadow: 0 0 14px rgba(199, 210, 228, 0.25);
}

.score-row:nth-child(3) {
  border-color: rgba(217, 155, 108, 0.75);
  box-shadow: 0 0 12px rgba(217, 155, 108, 0.25);
}

.scoreboard-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.scoreboard-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.scoreboard-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.page-info {
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
}

.video-modal {
  max-width: min(720px, 94vw);
}

.final-video {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(120, 142, 255, 0.4);
  background: rgba(8, 10, 20, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.video-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.player-actions {
  justify-content: center;
}

.player-actions button {
  min-width: 160px;
}

.field-row input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 255, 0.35);
  background: rgba(16, 18, 38, 0.85);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.round-select {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 255, 0.35);
  background: rgba(16, 18, 38, 0.85);
  color: var(--text);
  appearance: none;
}

.field-row input:focus,
.round-select:focus,
.level-row input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(77, 238, 234, 0.2);
}

.field-row input::placeholder,
.level-row input::placeholder {
  color: rgba(255, 247, 240, 0.55);
}

.input-error {
  border-color: var(--danger) !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(18, 18, 40, 0.97), rgba(9, 10, 22, 0.98));
  border-radius: 22px;
  border: 1px solid rgba(130, 150, 255, 0.4);
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.modal-content::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.levels-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shape-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shape-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 255, 0.35);
  background: rgba(16, 18, 38, 0.75);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.shape-option:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 140, 255, 0.6);
  box-shadow: 0 8px 18px rgba(92, 124, 255, 0.2);
}

.shape-option input {
  accent-color: var(--accent);
  cursor: pointer;
}

.shape-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.round-image-preview {
  display: flex;
  justify-content: center;
}

.round-image-preview img {
  width: min(240px, 80%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.level-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.level-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 140, 255, 0.35);
  background: rgba(16, 18, 38, 0.85);
  color: var(--text);
}

.level-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.3), rgba(18, 20, 44, 0.85));
  border: 1px solid rgba(120, 140, 255, 0.45);
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0 4px;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(92, 124, 255, 0.25);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(92, 124, 255, 0.45);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(92, 124, 255, 0.25);
  }
}

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

  .game-panel {
    height: min(55vh, 520px);
    min-height: 360px;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 14px;
  }

  .brand-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
  }

  .difficulty-options {
    grid-template-columns: 1fr;
  }

  .header-banner {
    width: 100%;
    max-width: none;
    padding: 10px 12px;
    grid-column: 1 / -1;
  }

  .logo {
    width: 56px;
  }

  .partner-logo {
    width: 90px;
  }

  .brand-logos {
    gap: 8px;
  }

  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.24em;
  }

  .tagline {
    font-size: 13px;
  }

  .hud {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }

  .banner-title {
    font-size: 12px;
  }

  .player-name-pill {
    justify-self: end;
    padding: 6px 10px;
    font-size: 12px;
  }

  .overlay-card {
    padding: 20px;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay {
    align-items: flex-start;
    padding: 16px;
    overflow-y: auto;
  }

  .game-panel {
    height: 52vh;
    min-height: 320px;
  }

  .game-hud {
    gap: 6px;
    padding: 8px 10px;
  }

  .score-pill {
    padding: 8px 12px;
    font-size: 15px;
  }

  .score-pill span {
    font-size: 18px;
  }

  .hud-pill {
    font-size: 12px;
    padding: 6px 10px;
  }

  .level-row {
    grid-template-columns: 32px 1fr;
  }

  .level-row button {
    grid-column: span 2;
  }
}
