/* === Unit 10 game: kill site header offset (empty top band) === */
.arcade-header-bar,
.arcade-nav,
.nav-profile,
.profile-fab,
[data-theme-toggle],
.theme-toggle,
body > header,
.site-footer {
  display: none !important;
}
html, body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}
body.game-page,
body[data-type="game"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Kill global header offset on game pages */
html, body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}
body.game-page,
body[data-type="game"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ===== Classroom Bingo – Starter PE1 (styled) ===== */

.arcade-header-bar,
.arcade-nav,
.nav-profile,
[data-theme-toggle],
.theme-toggle,
body > header,
.site-footer {
  display: none !important;
}

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0 !important;
  overflow: hidden !important;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(167, 139, 250, 0.35) 0%, transparent 55%),
    linear-gradient(165deg, #faf8ff 0%, #f0ebff 100%) !important;
  color: #1e1b4b !important;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(109, 40, 217, 0.28) 0%, transparent 50%),
    #0f0b1a !important;
  color: #f1f5f9 !important;
}

*, *::before, *::after { box-sizing: border-box; }

.cb-game {
  width: 100%;
  max-width: min(560px, 100%);
  margin: 0 auto;
  padding:
    max(10px, env(safe-area-inset-top))
    clamp(12px, 3vw, 20px)
    max(12px, env(safe-area-inset-bottom));
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* —— Top bar —— */
.cb-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.cb-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid rgba(91, 33, 182, 0.12);
  background: #faf8ff;
  color: #5b21b6;
  font-size: 1.2rem;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.06);
  transition: background 0.15s, transform 0.1s;
}

.cb-back:active { transform: scale(0.95); }

html[data-theme="dark"] .cb-back {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  box-shadow: none;
}

.cb-topbar-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cb-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b5cf6;
}

html[data-theme="dark"] .cb-kicker { color: #c4b5fd; }

.cb-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: #5b21b6;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

html[data-theme="dark"] .cb-title { color: #f8fafc; }

.cb-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #5b21b6;
  background: #faf8ff;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(91, 33, 182, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.05);
  min-width: 44px;
  text-align: center;
}

html[data-theme="dark"] .cb-badge {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  box-shadow: none;
}

.cb-btn-ghost {
  appearance: none;
  border: 1.5px solid rgba(91, 33, 182, 0.14);
  background: #faf8ff;
  color: #5b21b6;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.05);
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.cb-btn-ghost:active { transform: scale(0.96); }

html[data-theme="dark"] .cb-btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: none;
}

/* —— Scroll area —— */
.cb-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* —— Start / Done —— */
.cb-start,
.cb-done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 4px 20px;
  gap: 12px;
  overflow-y: auto;
}

.cb-start h1,
.cb-done h1 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #5b21b6;
  margin: 4px 0 0;
  letter-spacing: -0.03em;
}

html[data-theme="dark"] .cb-start h1,
html[data-theme="dark"] .cb-done h1 { color: #f8fafc; }

.cb-desc {
  color: #6b7280;
  max-width: 300px;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.55;
}

html[data-theme="dark"] .cb-desc { color: #94a3b8; }

.cb-hero-wrap {
  position: relative;
  width: 100%;
  max-width: 240px;
  margin: 8px 0 10px;
}

.cb-hero-img {
  width: 100%;
  height: 148px;
  object-fit: contain;
  background: linear-gradient(160deg, #faf8ff 0%, #ede9fe 100%);
  border-radius: 22px;
  border: 2px solid rgba(124, 58, 237, 0.15);
  box-shadow:
    0 14px 32px rgba(109, 40, 217, 0.18),
    0 4px 10px rgba(91, 33, 182, 0.08);
  padding: 12px;
}

html[data-theme="dark"] .cb-hero-img {
  background: linear-gradient(160deg, #2a2048 0%, #1a1530 100%);
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(167, 139, 250, 0.08);
}

.cb-hero-chip {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow:
    0 4px 14px rgba(109, 40, 217, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cb-steps {
  list-style: none;
  margin: 14px 0 6px;
  padding: 16px 18px;
  text-align: left;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: rgba(250, 248, 255, 0.9);
  border: 1.5px solid rgba(124, 58, 237, 0.12);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.08);
}

html[data-theme="dark"] .cb-steps {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.15);
  box-shadow: none;
}

.cb-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #1e1b4b;
}

html[data-theme="dark"] .cb-steps li { color: #e2e8f0; }

.cb-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(109, 40, 217, 0.35);
}

/* —— Buttons —— */
.cb-btn {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #9b6cff 0%, #7c3aed 45%, #6d28d9 100%);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 15px 28px;
  min-height: 54px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 6px 0 #4c1d95,
    0 14px 28px rgba(109, 40, 217, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.14s, box-shadow 0.15s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.02em;
}

.cb-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 7px 0 #4c1d95,
    0 16px 32px rgba(109, 40, 217, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.cb-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow:
    0 2px 0 #4c1d95,
    0 6px 14px rgba(109, 40, 217, 0.3);
}
.cb-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  filter: none;
}

.cb-btn-full { width: 100%; }

.cb-btn-listen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cb-btn-listen .cb-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(250, 248, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.cb-btn-listen.is-playing .cb-ico {
  animation: cb-pulse 1s ease-in-out infinite;
}

@keyframes cb-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

/* —— Bingo grid —— */
.cb-board-wrap {
  background: #faf8ff;
  border: 2px solid rgba(91, 33, 182, 0.1);
  border-radius: 18px;
  padding: 10px;
  box-shadow:
    0 10px 28px rgba(91, 33, 182, 0.08),
    0 1px 3px rgba(91, 33, 182, 0.04);
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

html[data-theme="dark"] .cb-board-wrap {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.cb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.cb-cell {
  appearance: none;
  position: relative;
  aspect-ratio: 1 / 1.08;
  width: 100%;
  min-width: 0;
  border: 2px solid #ddd6fe;
  background: linear-gradient(165deg, #fefcff 0%, #f5f0ff 100%);
  border-radius: 14px;
  padding: 6px 4px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .cb-cell {
  background: linear-gradient(165deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

.cb-cell:active:not(.marked) { transform: scale(0.95); }

.cb-cell img {
  width: 100%;
  height: auto;
  max-height: 72%;
  object-fit: contain;
  flex: 1 1 auto;
  min-height: 0;
  pointer-events: none;
  user-select: none;
}

.cb-cell-word {
  flex: 0 0 auto;
  font-size: clamp(0.58rem, 2.4vw, 0.72rem);
  font-weight: 700;
  color: #4c1d95;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .cb-cell-word { color: #e2e8f0; }

.cb-cell.marked {
  border-color: #8b5cf6;
  background: linear-gradient(165deg, #f3eefe, #e9d5ff);
}

html[data-theme="dark"] .cb-cell.marked {
  background: rgba(124, 58, 237, 0.28);
  border-color: #a78bfa;
}

.cb-cell.win-line {
  border-color: #8b5cf6;
  box-shadow:
    0 0 0 2px rgba(124, 58, 237, 0.45),
    0 4px 14px rgba(124, 58, 237, 0.25);
  animation: cb-win-pulse 1.1s ease-in-out infinite;
}

.cb-grid.is-bingo .cb-cell.win-line {
  animation: cb-win-pulse 1.1s ease-in-out infinite, cb-win-glow 0.7s ease-out;
}

@keyframes cb-win-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(124, 58, 237, 0.45),
      0 4px 14px rgba(124, 58, 237, 0.25);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(124, 58, 237, 0.35),
      0 6px 20px rgba(124, 58, 237, 0.35);
    transform: scale(1.03);
  }
}

@keyframes cb-win-glow {
  0% {
    filter: brightness(1.4);
    transform: scale(1.08);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

.cb-stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.28);
  pointer-events: none;
  animation: cb-stamp-in 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.cb-cell.win-line .cb-stamp {
  background: rgba(124, 58, 237, 0.38);
}

.cb-cell.win-line .cb-stamp span {
  animation: cb-stamp-pop 0.5s cubic-bezier(0.34, 1.5, 0.64, 1) both;
}

@keyframes cb-stamp-in {
  0% { opacity: 0; transform: scale(1.4); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes cb-stamp-pop {
  0% { transform: scale(0.6); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.cb-stamp span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a78bfa, #8b5cf6);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow:
    0 4px 12px rgba(124, 58, 237, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.cb-cell.shake {
  animation: cb-shake 0.4s ease;
}

@keyframes cb-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* —— Control panel —— */
.cb-panel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;

  background: #faf8ff;
  border: 2px solid rgba(91, 33, 182, 0.1);
  border-radius: 20px;
  padding: 14px;
  flex-shrink: 0;
  box-shadow:
    0 8px 24px rgba(91, 33, 182, 0.07),
    0 1px 3px rgba(91, 33, 182, 0.04);
}

html[data-theme="dark"] .cb-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.cb-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cb-call-num {
  font-size: 0.8rem;
  font-weight: 800;
  color: #8b5cf6;
  background: rgba(124, 58, 237, 0.1);
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .cb-call-num {
  color: #c4b5fd;
  background: rgba(110, 207, 184, 0.12);
}

.cb-status {
  font-size: 0.88rem;
  font-weight: 800;
  color: #5b21b6;
  text-align: right;
}

html[data-theme="dark"] .cb-status { color: #e2e8f0; }

.cb-status.hint {
  color: #8b5cf6;
  background: rgba(124, 58, 237, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

/* —— Bingo win panel —— */
.cb-panel.is-bingo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #f0faf6 0%, #faf8ff 55%, #f7f0e4 100%);
  border-color: rgba(124, 58, 237, 0.22);
  box-shadow:
    0 12px 32px rgba(124, 58, 237, 0.12),
    0 2px 6px rgba(91, 33, 182, 0.06);
  animation: cb-panel-in 0.45s cubic-bezier(0.22, 1.2, 0.36, 1);
}

html[data-theme="dark"] .cb-panel.is-bingo {
  background: linear-gradient(165deg, #152a24 0%, #1a2220 60%, #151a18 100%);
  border-color: rgba(110, 207, 184, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

@keyframes cb-panel-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cb-bingo-msg {
  position: relative;
  text-align: center;
  padding: 10px 4px 4px;
  z-index: 1;
}

/* Confetti particles */
.cb-confetti-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.cb-particle {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: cb-confetti-fly 1.15s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 0.035s);
}

.cb-particle:nth-child(odd) {
  background: #8b5cf6;
  border-radius: 50%;
  width: 7px;
  height: 7px;
}
.cb-particle:nth-child(3n) {
  background: #e8b84a;
  width: 6px;
  height: 10px;
  border-radius: 1px;
}
.cb-particle:nth-child(4n) {
  background: #e87a5a;
  width: 9px;
  height: 5px;
}
.cb-particle:nth-child(5n) {
  background: #c4b5fd;
  border-radius: 50%;
}

@keyframes cb-confetti-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.4) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + (var(--i) - 5.5) * 18px),
        calc(-40px - (var(--i) % 4) * 22px)
      )
      scale(1)
      rotate(calc(var(--i) * 48deg));
  }
}

/* Icon row */
.cb-bingo-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
  line-height: 1;
}

.cb-ico-pop {
  display: inline-block;
  font-size: 1.55rem;
  animation: cb-ico-bounce 0.7s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.cb-ico-pop:nth-child(1) { animation-delay: 0.05s; }
.cb-ico-pop:nth-child(2) { animation-delay: 0.15s; }
.cb-ico-pop:nth-child(3) { animation-delay: 0.25s; }

@keyframes cb-ico-bounce {
  0% { opacity: 0; transform: scale(0.2) translateY(12px); }
  60% { opacity: 1; transform: scale(1.18) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Big “Bingo!” title */
.cb-bingo-msg .big {
  font-size: 2.35rem;
  font-weight: 900;
  margin: 2px 0 6px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, #1f6b5c 0%, #8b5cf6 40%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cb-bingo-title 0.65s cubic-bezier(0.22, 1.35, 0.36, 1) both;
  text-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(124, 58, 237, 0.25));
}

html[data-theme="dark"] .cb-bingo-msg .big {
  background: linear-gradient(135deg, #c4b5fd 0%, #4db89e 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(110, 207, 184, 0.3));
}

@keyframes cb-bingo-title {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(16px);
    letter-spacing: 0.12em;
  }
  55% {
    opacity: 1;
    transform: scale(1.08) translateY(-3px);
    letter-spacing: -0.01em;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    letter-spacing: -0.03em;
  }
}

.cb-bingo-sub {
  margin: 0 0 16px !important;
  color: #5c564e;
  font-size: 0.98rem;
  font-weight: 650;
  animation: cb-sub-in 0.5s ease 0.28s both;
}

html[data-theme="dark"] .cb-bingo-sub {
  color: #94a3b8;
}

@keyframes cb-sub-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Play again button entrance */
.cb-btn-again {
  animation: cb-btn-in 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) 0.38s both;
}

@keyframes cb-btn-in {
  0% { opacity: 0; transform: translateY(12px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Board subtle reaction when bingo */
.cb-board-wrap.is-bingo {
  animation: cb-board-celebrate 0.6s ease-out;
}

@keyframes cb-board-celebrate {
  0% { transform: scale(1); }
  35% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* —— Responsive: compact board, scales gently —— */

@media (max-width: 360px) {
  .cb-game { padding: 8px 8px max(10px, env(safe-area-inset-bottom)); }
  .cb-board-wrap, .cb-panel { max-width: 100%; }
  .cb-grid { gap: 6px; }
  .cb-cell { padding: 4px 3px 4px; border-radius: 12px; }
  .cb-cell-word { font-size: 0.55rem; }
  .cb-stamp span { width: 28px; height: 28px; font-size: 0.9rem; }
  .cb-title { font-size: 1.05rem; }
  .cb-btn-listen { min-height: 48px; }
}

@media (min-width: 480px) {
  .cb-board-wrap, .cb-panel { max-width: 440px; }
  .cb-grid { gap: 9px; }
  .cb-cell-word { font-size: 0.7rem; }
  .cb-title { font-size: 1.2rem; }
}

@media (min-width: 768px) {
  .cb-game { max-width: 520px; }
  .cb-board-wrap, .cb-panel { max-width: 460px; }
  .cb-grid { gap: 10px; }
  .cb-cell { border-radius: 16px; padding: 8px 6px 6px; }
  .cb-cell-word { font-size: 0.75rem; }
  .cb-title { font-size: 1.3rem; }
  .cb-btn-listen { min-height: 54px; font-size: 1.05rem; }
  .cb-stamp span { width: 40px; height: 40px; font-size: 1.2rem; }
}

@media (min-width: 1024px) {
  .cb-game { max-width: 540px; }
  .cb-board-wrap, .cb-panel { max-width: 480px; }
  .cb-grid { gap: 11px; }
  .cb-cell-word { font-size: 0.78rem; }
  .cb-title { font-size: 1.35rem; }
}

/* Landscape short: keep compact side-by-side only if needed */
@media (max-height: 500px) and (orientation: landscape) {
  .cb-scroll {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }
  .cb-board-wrap {
    max-width: min(42vh, 320px);
    flex: 0 0 auto;
  }
  .cb-panel {
    max-width: 260px;
    flex: 0 0 auto;
  }
  .cb-cell-word { font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-stamp,
  .cb-cell.win-line .cb-stamp span,
  .cb-bingo-msg .big,
  .cb-btn-listen.is-playing .cb-ico,
  .cb-cell.win-line,
  .cb-grid.is-bingo .cb-cell.win-line,
  .cb-panel.is-bingo,
  .cb-particle,
  .cb-ico-pop,
  .cb-bingo-sub,
  .cb-btn-again,
  .cb-board-wrap.is-bingo {
    animation: none !important;
  }
}

/* ===== Arcade design refresh + polish (shared) ===== */
html:not([data-theme="dark"]){--bg:#f3f0ff;--bg-card:#ffffff;--bg-soft:#ede9fe;--border:#ddd6fe;--accent:#7c3aed;--accent-soft:#ede9fe;--accent-text:#6d28d9;--text:#1e1b4b;--muted:#64748b;--ps-bg:#f3f0ff;--ps-card:#ffffff;--ps-purple:#7c3aed;--ps-purple-soft:rgba(124,58,237,.12);--ps-text:#1e1b4b}
html:not([data-theme="dark"]) body{background:radial-gradient(900px 520px at 8% -8%,rgba(251,207,232,.85),transparent 60%),radial-gradient(800px 480px at 100% 0,rgba(191,219,254,.8),transparent 58%),radial-gradient(700px 500px at 50% 110%,rgba(221,214,254,.9),transparent 60%),#f5f3ff!important;background-attachment:fixed!important}
html[data-theme="dark"] body{background:radial-gradient(800px 480px at 0 -10%,rgba(124,58,237,.30),transparent 60%),radial-gradient(700px 420px at 100% 0,rgba(236,72,153,.16),transparent 55%),#0f1220!important;background-attachment:fixed!important}
[class*="-chip"]:not([class*="-chips"]),[class*="-choice"]:not([class*="-choices"]),[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]){border-radius:14px;border:2px solid rgba(124,58,237,.22);box-shadow:0 4px 0 rgba(124,58,237,.18),0 8px 18px rgba(30,27,75,.08);font-weight:700;transition:transform .14s cubic-bezier(.22,.9,.3,1),box-shadow .14s,border-color .2s,background-color .2s}
[class*="-chip"]:not([class*="-chips"]):not(:disabled):hover,[class*="-choice"]:not([class*="-choices"]):not(:disabled):hover,[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]):not(:disabled):hover{transform:translateY(-2px);box-shadow:0 6px 0 rgba(124,58,237,.2),0 12px 22px rgba(30,27,75,.12)}
[class*="-chip"]:not([class*="-chips"]):not(:disabled):active,[class*="-choice"]:not([class*="-choices"]):not(:disabled):active,[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]):not(:disabled):active{transform:translateY(3px);box-shadow:0 1px 0 rgba(124,58,237,.2)}
[class*="-btn"]{border-radius:14px;font-weight:800;letter-spacing:.01em}
[class*="-card"]:not([class*="-cards"]),[class*="-panel"]:not([class*="-panels"]){border-radius:22px;box-shadow:0 14px 36px rgba(30,27,75,.10)}
html[data-theme="dark"] [class*="-chip"]:not([class*="-chips"]),html[data-theme="dark"] [class*="-choice"]:not([class*="-choices"]),html[data-theme="dark"] [class*="-opt"]:not([class*="-options"]):not([class*="-opts"]){border-color:rgba(167,139,250,.3);box-shadow:0 4px 0 rgba(0,0,0,.35)}
input,textarea{border-radius:14px}
@keyframes ap-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes ap-pop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
.screen:not(.hidden),#game-app>section,#game-app>main,#game-app>div{animation:ap-in .38s cubic-bezier(.22,.9,.3,1) both}
button{cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:transform .16s cubic-bezier(.22,.9,.3,1),box-shadow .2s,background-color .2s,opacity .2s}
button:not(:disabled):active{transform:scale(.96)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid rgba(124,58,237,.55);outline-offset:3px}
[class*="-star"]{animation:ap-pop .55s cubic-bezier(.34,1.56,.64,1) both}
[class*="-star"]:nth-child(2){animation-delay:.15s}[class*="-star"]:nth-child(3){animation-delay:.3s}
@media (max-width:480px){button{min-height:44px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* progress bar, combo, celebration */
.afx-bar{height:12px;border-radius:999px;background:rgba(139,92,246,.16);overflow:hidden;margin:8px 0 10px}
.afx-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b);background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1);box-shadow:0 0 12px rgba(139,92,246,.55)}
@keyframes afx-shine{to{background-position:-200% 0}}
.afx-combo{position:fixed;right:14px;top:68px;z-index:900;font-weight:800;font-size:15px;padding:6px 14px;border-radius:999px;opacity:0;transform:scale(.7);pointer-events:none;transition:opacity .2s,transform .3s;white-space:nowrap}
.afx-combo em{font-style:normal;font-size:11px;letter-spacing:.08em;margin-left:4px;opacity:.9}
.afx-combo.is-on{opacity:1;transform:none;background:linear-gradient(135deg,#fb923c,#f59e0b);color:#fff;box-shadow:0 6px 16px rgba(245,158,11,.4)}
.afx-combo.is-hot{background:linear-gradient(135deg,#ef4444,#f97316);box-shadow:0 6px 20px rgba(239,68,68,.5)}
.afx-combo.is-bump{animation:afx-bump .45s cubic-bezier(.34,1.56,.64,1)}
.afx-combo.is-lost{opacity:1;transform:none;background:#e2e8f0;color:#64748b;font-size:13px;animation:afx-shake .4s}
.afx-fire{display:inline-block;animation:afx-flick .7s ease-in-out infinite alternate}
@keyframes afx-bump{0%{transform:scale(.8)}55%{transform:scale(1.28) rotate(-3deg)}100%{transform:scale(1)}}
@keyframes afx-flick{to{transform:scale(1.2) rotate(8deg)}}
@keyframes afx-shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.afx-burst{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,rgba(139,92,246,.35),rgba(15,18,32,.55));overflow:hidden;pointer-events:none;animation:afx-fin .25s both}
.afx-burst.is-out{animation:afx-fout .4s both}
@keyframes afx-fin{from{opacity:0}}@keyframes afx-fout{to{opacity:0}}
.afx-burst i{position:absolute;top:-16px;width:10px;height:16px;border-radius:2px;animation:afx-fall linear both}
@keyframes afx-fall{to{transform:translateY(110vh) rotate(720deg)}}
.afx-card{text-align:center;padding:28px 40px;border-radius:28px;background:#fff;color:#1e1b4b;box-shadow:0 24px 60px rgba(0,0,0,.4);animation:afx-zoom .7s cubic-bezier(.34,1.56,.64,1) both;max-width:88vw}
html[data-theme="dark"] .afx-card{background:#1a1f35;color:#f1f5f9}
.afx-emoji{font-size:76px;line-height:1;animation:afx-spin 1s cubic-bezier(.34,1.56,.64,1) both}
.afx-title{font-size:30px;font-weight:900;margin-top:8px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b);-webkit-background-clip:text;background-clip:text;color:transparent}
.afx-sub{margin-top:6px;font-weight:600;opacity:.75}
@keyframes afx-zoom{from{transform:scale(.2) rotate(-8deg);opacity:0}}
@keyframes afx-spin{from{transform:scale(0) rotate(-360deg)}}
@media (prefers-reduced-motion:reduce){#game-app *,#game-app,.afx-burst i,.afx-fire,.afx-bar i{animation:none!important;transition:none!important}}

/* existing progress bars → same animated gradient bar */
.fc-progress,.clf-bar,.cw-bar,.wt-bar{height:12px!important;border-radius:999px;background:rgba(139,92,246,.16)!important;overflow:hidden}
.fc-progress-fill,.clf-bar-fill,.cw-bar-fill,.wt-bar-fill{border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b)!important;background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1)!important;box-shadow:0 0 12px rgba(139,92,246,.55)}

/* existing bars of this batch */
.lw-progress,.progress,.mc-set-progress{height:12px!important;border-radius:999px;background:rgba(139,92,246,.16)!important;overflow:hidden}
.lw-progress-fill,.progress-fill,.mc-set-progress-fill{border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b)!important;background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1)!important;box-shadow:0 0 12px rgba(139,92,246,.55)}
