body.game-active {
  min-height: 100vh;
  min-height: 100svh;
}

body.game-active[data-card-theme="spring"] {
  background-color: #07120d;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(74, 145, 84, 0.2) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(37, 111, 73, 0.16) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(34, 91, 62, 0.08) 0%, transparent 70%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="summer"] {
  background-color: #151008;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(201, 126, 35, 0.2) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(164, 83, 24, 0.16) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(126, 83, 30, 0.08) 0%, transparent 70%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="fall"] {
  background-color: #160c08;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(180, 78, 28, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(125, 53, 23, 0.18) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(112, 52, 29, 0.09) 0%, transparent 70%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="winter"] {
  background-color: #080f18;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(58, 112, 169, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(48, 77, 139, 0.17) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, rgba(40, 78, 114, 0.09) 0%, transparent 70%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="christmas"] {
  background-color: #07140f;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(34, 197, 94, 0.2) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(185, 28, 28, 0.16) 0%, transparent 48%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="halloween"] {
  background-color: #120a1f;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(147, 51, 234, 0.24) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(249, 115, 22, 0.18) 0%, transparent 48%);
  background-attachment: fixed;
}

body.game-active[data-card-theme="loy_kratong"] {
  background-color: #08142b;
  background-image:
    radial-gradient(ellipse at 16% 0%, rgba(59, 130, 246, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 100%, rgba(236, 72, 153, 0.18) 0%, transparent 48%);
  background-attachment: fixed;
}

body.game-active .tiles-container {
  display: flex;
  width: min(calc(100% - 2rem), 1840px);
  min-height: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(0.8rem, 1.8vh, 1.25rem);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vh, 1.75rem) 0 1.5rem;
  box-sizing: border-box;
  z-index: 1;
}

.flipquiz-game-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 9rem;
}

.flipquiz-game-title {
  min-width: 0;
}

.flipquiz-game-eyebrow {
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.flipquiz-game-title h1 {
  overflow: hidden;
  max-width: min(70vw, 780px);
  margin: 0.25rem 0 0;
  color: #f8fafc;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flipquiz-game-instruction {
  flex: 0 0 auto;
  margin: 0 0 0.15rem;
  color: #aab3c5;
  font-size: 0.88rem;
}

body.game-active .teamDisplay {
  position: relative;
  inset: auto;
  display: flex;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: center;
  gap: 0.7rem;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.game-active .teamDisplay .team-block {
  min-width: 0;
  max-width: 220px;
  min-height: 70px;
  flex: 1 1 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid currentColor;
  border-radius: 0.8rem;
  background: rgba(20, 22, 38, 0.88);
}

body.game-active .teamDisplay .team-block.active {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

body.game-active .teamDisplay .team-block.active::before {
  display: none;
}

body.game-active .teamDisplay .team-name-label {
  margin-bottom: 0.3rem;
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  letter-spacing: 0.04em;
}

body.game-active .teamDisplay .team-score-label {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

body.game-active .tiles-grid {
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 1 1 0;
  align-self: center;
  gap: clamp(0.45rem, 1vw, 0.8rem);
}

@media (min-width: 761px) {
  body.game-active .tiles-grid[data-count="20"] {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  }

  body.game-active .tiles-grid[data-count="30"] {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
  }
}

body.game-active .question-card {
  min-width: 0;
  min-height: 0;
  perspective: 1000px;
}

body.game-active .card-face {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: filter 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body.game-active .card-front {
  container-name: flip-card-face;
  container-type: size;
  min-width: 0;
  min-height: 0;
  padding: clamp(0.15rem, 3%, 0.5rem);
  overflow: hidden;
}

body.game-active .card-front > * {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.game-active .card-front .card-question {
  display: flex;
  flex: 2 1 60%;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: clamp(0.15rem, 2cqi, 0.5rem);
  font-size: clamp(0.35rem, min(7cqi, 7cqb), 0.9rem);
  line-height: 1.2;
}

body.game-active .card-front .card-question .card-text-content,
body.game-active .card-front .card-answer .card-text-content {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  text-align: center;
}

body.game-active .card-front .card-question .card-text-content {
  -webkit-line-clamp: 8;
  line-clamp: 8;
}

body.game-active .card-front .card-answer {
  display: flex;
  flex: 1 1 30%;
  width: 100%;
  min-height: 0;
  padding: clamp(0.15rem, 2cqi, 0.5rem);
  font-size: clamp(0.35rem, min(7cqi, 7cqb), 1rem);
  line-height: 1.15;
  text-overflow: clip;
}

body.game-active .card-front .card-answer .card-text-content {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

@container flip-card-face (max-height: 180px) {
  body.game-active .card-front .card-question .card-text-content {
    -webkit-line-clamp: 6;
    line-clamp: 6;
  }

  body.game-active .card-front .card-answer .card-text-content {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

body.game-active .card-front .card-points-badge {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.14em 0.55em;
  border: 1px solid rgba(252, 211, 77, 0.28);
  border-radius: 999px;
  background: rgba(15, 13, 37, 0.78);
  color: #fcd34d;
  font-size: clamp(0.45rem, 5cqi, 0.7rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(252, 211, 77, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: none;
}

body.game-active .card-front .doubleedge-card-face {
  gap: clamp(0.1rem, 1.2cqi, 0.3rem);
}

body.game-active .doubleedge-card-face .card-question {
  flex: 3 1 0;
}

body.game-active .doubleedge-card-face .card-answer {
  flex: 1 1 0;
}

body.game-active .card-front .steal-card-face,
body.game-active .card-front .steal-modal-message,
body.game-active .card-front .steal-result,
body.game-active .card-front .doubleedge-card-face {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: clamp(0.1rem, 1.5cqi, 0.35rem);
  padding: clamp(0.2rem, 2.5cqi, 0.6rem);
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: clamp(0.55rem, 7cqi, 0.95rem);
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

body.game-active .card-front .steal-label,
body.game-active .card-front .special-card-eyebrow,
body.game-active .card-front .doubleedge-label {
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0.15em 0.35em;
  font-size: 0.9em;
  line-height: 1.1;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

body.game-active .card-front .steal-result {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(0.1rem, 1.5cqi, 0.35rem);
  background: rgba(91, 33, 182, 0.34);
}

body.game-active .card-front .special-card-title {
  font-size: clamp(0.65rem, 11cqi, 1rem);
  line-height: 1.1;
}

body.game-active .card-front .special-card-copy {
  font-size: clamp(0.48rem, 7cqi, 0.78rem);
  line-height: 1.2;
}

body.game-active .card-back {
  background: linear-gradient(145deg, #155e75 0%, #1d4ed8 55%, #312e81 100%);
  font-size: clamp(1.6rem, 4vw, 3.25rem);
  letter-spacing: 0;
  border-color: rgba(191, 219, 254, 0.42);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

body.game-active[data-card-theme="spring"] .card-back {
  background: url("../img/card_themes/Spring.png") center / cover no-repeat;
}

body.game-active[data-card-theme="summer"] .card-back {
  background: url("../img/card_themes/Summer.png") center / cover no-repeat;
}

body.game-active[data-card-theme="fall"] .card-back {
  background: url("../img/card_themes/Fall.png") center / cover no-repeat;
}

body.game-active[data-card-theme="winter"] .card-back {
  background: url("../img/card_themes/Winter.png") center / cover no-repeat;
}

body.game-active[data-card-theme="christmas"] .card-back {
  background: url("../../classic/img/card_themes/christmas.png") center / cover no-repeat;
}

body.game-active[data-card-theme="halloween"] .card-back {
  background: url("../../classic/img/card_themes/halloween.png") center / cover no-repeat;
}

body.game-active[data-card-theme="loy_kratong"] .card-back {
  background: url("../../classic/img/card_themes/loy_kratong.png") center / cover no-repeat;
}

body.game-active .card-back::after {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.18), transparent 50%, rgba(15, 23, 42, 0.12));
}

@media (hover: hover) and (pointer: fine) {
  body.game-active .question-card:not(.answered):not(.flipped):hover .card-back {
    transform: scale(1.025) rotate(-1deg);
    animation: none;
    filter: brightness(1.08);
    border-color: rgba(221, 214, 254, 0.95);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }

  body.game-active:not([data-card-theme]) .question-card:not(.answered):not(.flipped):hover .card-back {
    background: linear-gradient(145deg, #0e7490 0%, #2563eb 55%, #4338a8 100%);
    border-color: rgba(191, 219, 254, 0.82);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }

  body.game-active[data-card-theme="spring"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../img/card_themes/Spring.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="summer"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../img/card_themes/Summer.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="fall"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../img/card_themes/Fall.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="winter"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../img/card_themes/Winter.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="christmas"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../../classic/img/card_themes/christmas.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="halloween"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../../classic/img/card_themes/halloween.png") center / cover no-repeat;
  }

  body.game-active[data-card-theme="loy_kratong"] .question-card:not(.answered):not(.flipped):hover .card-back {
    background: url("../../classic/img/card_themes/loy_kratong.png") center / cover no-repeat;
  }

  body.game-active .question-card:not(.answered):not(.flipped):focus-visible .card-back {
    outline: 2px solid #c4b5fd;
    outline-offset: 3px;
  }
}

body.game-active .game-menu-fab {
  right: max(1.25rem, env(safe-area-inset-right));
  top: max(1.25rem, env(safe-area-inset-top));
  bottom: auto;
  z-index: 10002;
}

body.game-active .fab-toggle {
  width: auto;
  min-width: 7.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 999px;
  background: rgba(26, 24, 48, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #f8fafc;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.game-active .fab-toggle:hover,
body.game-active .game-menu-fab.active .fab-toggle {
  transform: none;
  border-color: #a78bfa;
  background: #282344;
  box-shadow: 0 8px 26px rgba(124, 92, 246, 0.25);
}

body.game-active .fab-toggle:focus-visible,
body.game-active .fab-action-btn:focus-visible,
body.game-active .fab-confirm-btns button:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

body.game-active .game-menu-fab .fab-dropdown,
body.game-active .game-menu-fab .fab-confirm-panel {
  top: calc(2.75rem + 0.65rem);
  bottom: auto;
  right: 0;
  box-sizing: border-box;
  width: min(17rem, calc(100vw - 1.5rem));
  padding: 0.65rem;
  gap: 0.4rem;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 1rem;
  background: rgba(17, 16, 34, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.game-active .game-menu-fab .fab-dropdown {
  grid-template-columns: 1fr;
}

body.game-active .fab-action-btn {
  width: 100%;
  min-height: 2.75rem;
  align-items: flex-start;
  justify-content: center;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.045);
  color: #eef0ff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
}

body.game-active .fab-action-btn:hover {
  transform: none;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: none;
}

body.game-active .fab-action-btn.fab-muted {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.18);
  opacity: 1;
}

body.game-active .fab-action-btn.fab-muted:hover {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.3);
}

body.game-active .fab-action-btn.fab-exit-btn:hover {
  border-color: rgba(251, 146, 60, 0.5);
  background: rgba(194, 65, 12, 0.18);
}

body.game-active .fab-action-btn.fab-end-btn:hover {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(185, 28, 28, 0.2);
}

body.game-active .game-menu-fab .fab-confirm-panel {
  align-items: stretch;
  gap: 0.85rem;
  padding: 1rem;
}

body.game-active .fab-confirm-msg {
  margin: 0;
  color: #f1f0fa;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

body.game-active .fab-confirm-btns {
  justify-content: flex-end;
  gap: 0.5rem;
}

body.game-active .fab-confirm-btns button {
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.65rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
}

body.game-active .fab-confirm-yes {
  background: #7c3aed;
  border-color: #8b5cf6;
}

body.game-active .fab-confirm-yes:hover,
body.game-active .fab-confirm-no:hover {
  transform: none;
}

body.game-active .quiz-modal {
  z-index: 10003;
  right: 0;
  bottom: 0;
  padding-top: max(0.75rem, 5svh, env(safe-area-inset-top));
  padding-right: max(0.75rem, 5vw, env(safe-area-inset-right));
  padding-bottom: max(0.75rem, 5svh, env(safe-area-inset-bottom));
  padding-left: max(0.75rem, 5vw, env(safe-area-inset-left));
  overflow: hidden;
}

html:has(body.game-active #quizModal[style*="display: flex"]),
body.game-active:has(#quizModal[style*="display: flex"]) {
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

body.game-active .quiz-modal-content {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse at 50% 0, rgba(124, 92, 246, 0.18), transparent 55%),
    linear-gradient(155deg, rgba(20, 19, 42, 0.99), rgba(13, 12, 27, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 48px rgba(124, 92, 246, 0.12);
}

body.game-active .quiz-main-content {
  gap: clamp(1rem, 2.5vh, 1.5rem);
  padding: clamp(3rem, 6vh, 5rem) clamp(1.5rem, 5vw, 4.5rem) 2rem;
  overflow-y: auto;
}

body.game-active .quiz-modal-kicker {
  color: #b8a7ff;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}

body.game-active .quiz-timer {
  min-width: 4.5rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(196, 181, 253, 0.28);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  color: #f5f3ff;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  box-shadow: none;
}

body.game-active .quiz-timer.timer-warning {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(185, 28, 28, 0.8);
}

body.game-active .quiz-question {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: clamp(8rem, 24vh, 20rem);
  min-height: 0;
  flex: 0 0 auto;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #a78bfa;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.045);
  color: #f8fafc;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  line-height: 1.3;
  text-align: left;
  text-shadow: none;
  overflow-wrap: anywhere;
}

body.game-active .quiz-question-text,
body.game-active .choice-text-content {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

body.game-active .quiz-question:has(.steal-result) {
  justify-content: center;
  border-left-width: 1px;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  text-align: center;
}

body.game-active .quiz-question.game-complete-summary {
  display: grid;
  justify-items: center;
  gap: clamp(0.7rem, 1.8vh, 1.1rem);
  border-left-width: 1px;
  text-align: center;
}

body.game-active .game-complete-eyebrow {
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

body.game-active .game-complete-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

body.game-active .game-complete-copy {
  margin: 0;
  color: #b8b5c9;
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  line-height: 1.5;
}

.welcome-tutorial-panel {
  box-sizing: border-box;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(8, 8, 18, 0.72);
}

.welcome-tutorial-overlay {
  background: rgba(8, 8, 18, 0.78);
  background-image: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.welcome-tutorial-content {
  box-sizing: border-box;
  width: min(100%, 620px);
  max-width: 620px;
  max-height: min(90vh, 760px);
  max-height: min(90dvh, 760px);
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  background: #171827;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  color: #f8fafc;
  transform: translateY(0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.welcome-tutorial-panel.visible .welcome-tutorial-content,
.welcome-tutorial-overlay.active .welcome-tutorial-content {
  transform: translateY(0);
}

.welcome-tutorial-panel.hiding .welcome-tutorial-content {
  transform: translateY(0.5rem);
}

.welcome-tutorial-content::before,
.welcome-tutorial-content .fun-elements {
  display: none;
}

.welcome-tutorial-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.welcome-tutorial-content .tutorial-eyebrow {
  margin-bottom: 0.4rem;
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.welcome-tutorial-content .logo-text {
  margin: 0;
  background: none;
  color: #f8fafc;
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  -webkit-text-fill-color: currentColor;
  animation: none;
}

.welcome-tutorial-content .welcome-subtitle {
  margin: 0.5rem 0 0;
  color: #b8b5c9;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
  opacity: 1;
  transform: none;
  animation: none;
}

.welcome-tutorial-content .tutorial-steps {
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  margin: 0 0 1rem;
}

.welcome-tutorial-content .tutorial-steps.transitioning {
  opacity: 0.85;
  transform: none;
}

.welcome-tutorial-content .tutorial-step {
  display: none;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid #a78bfa;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  transform: none;
  opacity: 1;
}

.welcome-tutorial-content .tutorial-step::before {
  display: none;
}

.welcome-tutorial-content .tutorial-step.active {
  display: block;
  border-color: rgba(255, 255, 255, 0.09);
  border-left-color: #a78bfa;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.welcome-tutorial-content .step-content h2 {
  margin: 0 0 0.6rem;
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: none;
}

.welcome-tutorial-content .step-content p,
.welcome-tutorial-content .step-content li {
  color: #d1d5e0;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
}

.welcome-tutorial-content .step-content p {
  margin: 0;
}

.welcome-tutorial-content .step-content ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.2rem;
}

.welcome-tutorial-content .step-content li {
  padding-left: 0.2rem;
}

.welcome-tutorial-content .step-content li::marker {
  color: #a78bfa;
}

.welcome-tutorial-content .step-content strong {
  color: #e9d5ff;
  font-weight: 700;
}

.welcome-tutorial-content .tutorial-progress {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 0 1rem;
  color: #aab3c5;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
}

.welcome-tutorial-content .tutorial-step-current {
  color: #e9d5ff;
}

.welcome-tutorial-content .tutorial-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
}

.welcome-tutorial-content .tutorial-btn {
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  color: #d1d5e0;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.welcome-tutorial-content .tutorial-btn::before {
  display: none;
}

.welcome-tutorial-content .tutorial-btn:hover:not(:disabled) {
  transform: none;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: none;
  color: #fff;
}

.welcome-tutorial-content .tutorial-btn:disabled {
  opacity: 0.45;
}

.welcome-tutorial-content .tutorial-btn.tutorial-next,
.welcome-tutorial-content .tutorial-btn.tutorial-start {
  border-color: #8b5cf6;
  background: #7c3aed;
  color: #fff;
}

.welcome-tutorial-content .tutorial-btn.tutorial-skip {
  border-color: transparent;
  background: transparent;
  color: #c4b5fd;
}

.welcome-tutorial-content .tutorial-btn:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

#winnerOverlay #quizRatingWidget {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.035);
}

#winnerOverlay .rating-widget {
  gap: 0.35rem;
}

#winnerOverlay .rating-prompt {
  color: #cbd5e1;
  font-size: 0.82rem;
}

#winnerOverlay .rating-stars {
  gap: 0.2rem;
}

#winnerOverlay .star-btn {
  padding: 0.1rem;
  color: rgba(203, 213, 225, 0.4);
  font-size: 1.8rem;
  line-height: 1;
}

#winnerOverlay .star-btn.filled,
#winnerOverlay .star-btn.hover {
  color: #fbbf24;
}

#winnerOverlay .star-btn:hover {
  transform: translateY(-2px);
}

#winnerOverlay .star-btn:disabled {
  transform: none;
  opacity: 0.6;
}

#winnerOverlay .star-btn:focus-visible,
#winnerOverlay .rating-retry-btn:focus-visible {
  outline: 2px solid #fcd34d;
  outline-offset: 3px;
}

#winnerOverlay .rating-feedback {
  color: #94a3b8;
  font-size: 0.75rem;
}

#winnerOverlay .rating-success {
  color: #86efac !important;
}

#winnerOverlay .rating-error {
  color: #fca5a5;
}

#winnerOverlay .rating-retry-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 0.55rem;
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

#winnerOverlay .rating-retry-btn:hover {
  background: rgba(239, 68, 68, 0.18);
}

body.game-active .special-card-eyebrow {
  color: #c4b5fd;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
}

body.game-active .steal-result {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: center;
  gap: clamp(0.65rem, 1.5vh, 1rem);
}

body.game-active .special-card-title {
  color: #fff;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  text-align: center;
}

body.game-active .special-card-copy {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #d7d2e8;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

body.game-active .points-highlight {
  color: #fcd34d !important;
  font-weight: 800;
  text-shadow: 0 0 16px rgba(252, 211, 77, 0.2);
}

body.game-active #quizModal.skip-pay-mode .quiz-question {
  display: block;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border-left-width: 1px;
  text-align: center;
}

body.game-active .skip-pay-prompt {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(3rem, 1fr) auto;
  justify-items: center;
  gap: clamp(0.4rem, 1vh, 0.65rem);
}

body.game-active #quizModal.skip-pay-mode .quiz-question {
  height: clamp(10rem, 26vh, 20rem);
}

body.game-active .skip-pay-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

body.game-active .skip-pay-team {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #d7d2e8;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body.game-active .skip-pay-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 38rem);
  gap: 0.75rem;
  margin-top: 0.35rem;
}

body.game-active .skip-pay-score > div {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(196, 181, 253, 0.2);
  border-radius: 0.85rem;
  background: rgba(139, 92, 246, 0.09);
}

body.game-active .skip-pay-score span {
  color: #c9c4dd;
  font-size: 0.82rem;
  line-height: 1.3;
}

body.game-active .skip-pay-score strong {
  color: #fcd34d;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  line-height: 1.2;
}

body.game-active .quiz-card-description {
  box-sizing: border-box;
  width: 100%;
  margin: -0.5rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 0.75rem;
  background: rgba(139, 92, 246, 0.09);
  color: #c9c4dd;
  font-size: clamp(0.88rem, 1.5vw, 1rem);
  line-height: 1.45;
  text-align: left;
}

body.game-active .quiz-choices {
  width: 100%;
  max-width: 100%;
  gap: 0.7rem;
  grid-auto-rows: clamp(5rem, 14vh, 9rem);
}

body.game-active .choice-item {
  box-sizing: border-box;
  height: 100%;
  min-height: 4.25rem;
  max-height: none;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.045);
  color: #e9e7f5;
  font-size: clamp(2.2rem, 3vw, 2.8rem);
  line-height: 1.4;
  text-align: left;
  align-items: flex-start;
  box-shadow: none;
}

body.game-active .choice-item:hover {
  transform: translateY(-1px);
  border-color: rgba(196, 181, 253, 0.6);
  background: rgba(139, 92, 246, 0.13);
  box-shadow: none;
}

body.game-active .choice-item.selected-choice {
  border-color: rgba(167, 139, 250, 0.9);
  background: rgba(109, 72, 196, 0.38);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.28), 0 0 22px rgba(139, 92, 246, 0.22);
}

body.game-active .choice-item.correct-choice {
  border-color: rgba(74, 222, 128, 0.7) !important;
  background: rgba(22, 101, 52, 0.55) !important;
  color: #f0fdf4 !important;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.18);
}

body.game-active .quiz-answer {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 1rem;
  background: rgba(22, 101, 52, 0.28);
  color: #dcfce7;
  font-size: clamp(1.2rem, 2.3vw, 1.8rem);
  line-height: 1.4;
  text-shadow: none;
  box-shadow: none;
  overflow-wrap: anywhere;
}

body.game-active .quiz-points {
  align-self: center;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(252, 211, 77, 0.28);
  border-radius: 999px;
  background: rgba(15, 13, 37, 0.72);
  color: #fcd34d;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(252, 211, 77, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  animation: none;
}

body.game-active .quiz-points .doubleedge-label-inline {
  margin-right: 0.45rem;
  padding: 0.18em 0.5em;
  border: 1px solid rgba(196, 181, 253, 0.24);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  font-size: 0.75em;
  letter-spacing: 0.08em;
  text-shadow: none;
}

body.game-active .quiz-footer-buttons {
  justify-content: center;
  gap: 0.65rem;
  min-height: 0;
  padding: 1rem clamp(1rem, 4vw, 2rem) 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.14);
}

body.game-active .quiz-footer-buttons .quiz-btn {
  position: static;
  flex: 1 1 8rem;
  width: auto;
  max-width: 13rem;
  min-width: 0;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.75rem;
  font-size: 1rem;
  letter-spacing: 0.03em;
  box-shadow: none;
}

body.game-active .quiz-footer-buttons .show-answer-btn {
  border-color: rgba(167, 139, 250, 0.5);
  background: #6d4bd1;
  color: white;
  animation: none;
  text-shadow: none;
}

body.game-active .quiz-footer-buttons .show-answer-btn:hover {
  transform: translateY(-1px);
  border-color: #c4b5fd;
  background: #7c5ce8;
  box-shadow: 0 8px 20px rgba(109, 75, 209, 0.25);
}

body.game-active .quiz-footer-buttons .correct-btn {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(22, 101, 52, 0.72);
}

body.game-active .quiz-footer-buttons .wrong-btn {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(153, 27, 27, 0.65);
}

body.game-active .quiz-footer-buttons .correct-btn:hover:not(:disabled),
body.game-active .quiz-footer-buttons .wrong-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

body.game-active #quizModal.skip-pay-mode .quiz-footer-buttons {
  justify-content: center;
  gap: 0.75rem;
}

body.game-active #quizModal.skip-pay-mode .quiz-footer-buttons .quiz-btn {
  flex: 1 1 12rem;
  max-width: 19rem;
  min-height: 3.25rem;
  font-weight: 750;
  line-height: 1.25;
}

body.game-active .close-quiz-btn {
  top: 0.9rem;
  right: 1rem;
  z-index: 2;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #c7c3d8;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

body.game-active .close-quiz-btn:hover {
  border-color: rgba(196, 181, 253, 0.45);
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

body.game-active .close-quiz-btn:focus-visible,
body.game-active .quiz-footer-buttons .quiz-btn:focus-visible,
body.game-active .choice-item:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

#winnerOverlay.winner-screen {
  box-sizing: border-box;
  min-height: 100svh;
  padding: clamp(0.75rem, 3vw, 2rem);
  overflow-x: hidden;
  overflow-y: auto;
}

#winnerOverlay.winner-screen .winner-content {
  box-sizing: border-box;
  display: flex;
  width: min(100%, 900px);
  max-width: 100%;
  max-height: calc(100svh - 2rem);
  flex-direction: column;
  align-items: center;
  gap: clamp(0.7rem, 1.8vh, 1.1rem);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 0, rgba(124, 92, 246, 0.16), transparent 55%),
    linear-gradient(155deg, rgba(20, 19, 42, 0.99), rgba(13, 12, 27, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 48px rgba(124, 92, 246, 0.12);
}

#winnerOverlay .trophy-container {
  margin: 0;
  line-height: 0;
}

#winnerOverlay .trophy-image {
  display: block;
  width: auto;
  height: clamp(3.5rem, 10vh, 6rem);
}

#winnerOverlay .winner-title {
  margin: 0;
  background: linear-gradient(110deg, #fde68a, #fbbf24 52%, #f8fafc);
  background-clip: text;
  color: #fbbf24;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: 0.06em;
  line-height: 1;
  -webkit-text-fill-color: transparent;
}

#winnerOverlay .winner-message {
  max-width: 100%;
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#winnerOverlay .winner-scores {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  align-items: stretch;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

#winnerOverlay .winner-score-item {
  box-sizing: border-box;
  display: flex;
  min-width: 0;
  min-height: 6rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease;
}

#winnerOverlay .winner-score-item:hover {
  transform: none;
  box-shadow: none;
}

#winnerOverlay .winner-score-item.winner {
  padding-top: 1.7rem;
  border-color: rgba(252, 211, 77, 0.6);
  background: linear-gradient(145deg, rgba(180, 83, 9, 0.2), rgba(245, 158, 11, 0.07));
  box-shadow: 0 0 28px rgba(252, 211, 77, 0.1);
}

#winnerOverlay .winner-score-item.winner::before {
  top: 0.4rem;
  right: 0.55rem;
  font-size: 1.2rem;
}

#winnerOverlay .score-name {
  max-width: 100%;
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-transform: none;
}

#winnerOverlay .winner-score-item.winner .score-name {
  color: #fde68a;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

#winnerOverlay .score-value {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  color: #e2e8f0;
  font-family: inherit;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: none;
}

#winnerOverlay .winner-score-item.winner .score-value {
  color: #fcd34d;
}

#winnerOverlay #quizRatingWidget,
#winnerOverlay #quizFavWidget {
  margin: 0;
}

#winnerOverlay .winner-buttons-container {
  display: grid;
  width: min(100%, 42rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.25rem 0 0;
}

#winnerOverlay .winner-btn {
  box-sizing: border-box;
  display: inline-flex;
  min-width: 0;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 0.8rem;
  background: rgba(139, 92, 246, 0.16);
  box-shadow: none;
  color: #f8fafc;
  font: inherit;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

#winnerOverlay .winner-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 181, 253, 0.65);
  background: rgba(139, 92, 246, 0.28);
  box-shadow: none;
}

#winnerOverlay .winner-btn.setup-btn {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.1);
}

#winnerOverlay .winner-btn.home-btn {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 760px) {
  #winnerOverlay.winner-screen {
    padding: 0.65rem;
  }

  #winnerOverlay.winner-screen .winner-content {
    max-height: calc(100svh - 1.3rem);
    gap: 0.7rem;
    padding: 1.1rem;
    border-radius: 1.1rem;
  }

  #winnerOverlay .winner-scores {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    gap: 0.55rem;
  }

  #winnerOverlay .winner-score-item {
    min-height: 5rem;
    padding: 0.75rem 0.5rem;
  }

  #winnerOverlay .winner-score-item.winner {
    padding-top: 1.5rem;
  }

  #winnerOverlay .winner-buttons-container {
    gap: 0.45rem;
  }

  #winnerOverlay .winner-btn {
    min-height: 2.75rem;
    padding: 0.6rem 0.35rem;
    font-size: 0.72rem;
  }

  body.game-active .tiles-container {
    width: calc(100% - 1.25rem);
    height: auto;
    flex: 1 0 auto;
    gap: 0.8rem;
    padding: 1rem 0 1.25rem;
  }

  .flipquiz-game-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 8rem;
  }

  .flipquiz-game-title h1 {
    max-width: calc(100vw - 9.25rem);
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  .flipquiz-game-instruction {
    font-size: 0.78rem;
  }

  body.game-active .teamDisplay {
    gap: 0.4rem;
  }

  body.game-active .teamDisplay .team-block {
    min-height: 58px;
    padding: 0.45rem 0.3rem;
    border-radius: 0.65rem;
  }

  body.game-active .teamDisplay .team-name-label {
    overflow: hidden;
    max-width: 100%;
    font-size: clamp(0.55rem, 2.2vw, 0.72rem);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.game-active .teamDisplay .team-score-label {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }

  body.game-active .tiles-grid {
    height: clamp(340px, calc(100svh - 245px), 560px);
    flex: 0 0 auto;
    gap: 0.4rem;
  }

  body.game-active .tiles-grid[data-count="12"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  }

  body.game-active .tiles-grid[data-count="20"] {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
  }

  body.game-active .tiles-grid[data-count="30"] {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(6, minmax(0, 1fr)) !important;
  }

  body.game-active .card-face {
    border-radius: 0.55rem;
  }

  body.game-active .card-back {
    font-size: clamp(1.2rem, 7vw, 2rem);
  }

  body.game-active .game-menu-fab {
    right: max(0.75rem, env(safe-area-inset-right));
    top: max(0.75rem, env(safe-area-inset-top));
  }

  body.game-active .quiz-modal {
    align-items: center;
  }

  body.game-active .quiz-modal-content {
    width: 100%;
    border-radius: 1rem;
  }

  body.game-active .quiz-main-content {
    gap: 1rem;
    padding: 3.75rem clamp(1rem, 5vw, 2rem) 1.5rem;
  }

  body.game-active .quiz-question {
    height: clamp(7rem, 18vh, 12rem);
    padding: 1rem;
    font-size: clamp(2.7rem, 11vw, 4rem);
  }

  body.game-active #quizModal.skip-pay-mode .quiz-question {
    height: clamp(10rem, 26vh, 14rem);
    padding: 1rem;
  }

  body.game-active .skip-pay-score {
    gap: 0.5rem;
  }

  body.game-active .skip-pay-score > div {
    padding: 0.7rem 0.55rem;
  }

  body.game-active .skip-pay-score span {
    font-size: 0.72rem;
  }

  body.game-active .quiz-choices {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    grid-auto-rows: clamp(6rem, 13vh, 8rem);
  }

  body.game-active .choice-item {
    min-height: 0;
    padding: 0.75rem;
    font-size: clamp(2.1rem, 8vw, 2.8rem);
  }

  body.game-active .quiz-footer-buttons {
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  body.game-active .quiz-footer-buttons .quiz-btn {
    flex: 1 1 7rem;
    min-height: 2.75rem;
    padding: 0.6rem 0.7rem;
    font-size: 0.9rem;
  }

  body.game-active #quizModal.skip-pay-mode .quiz-footer-buttons .quiz-btn {
    flex-basis: 8rem;
    max-width: none;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  body.game-active .tiles-container {
    gap: 0.65rem;
    padding-top: 0.75rem;
  }

  body.game-active .teamDisplay .team-block {
    min-height: 58px;
  }

  body.game-active .tiles-grid {
    height: auto;
    flex: 1 1 0;
    min-height: 280px;
  }
}

@media (max-width: 480px) {
  .welcome-tutorial-panel {
    padding: 0.65rem;
  }

  .welcome-tutorial-content .tutorial-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-tutorial-content .tutorial-btn.tutorial-prev {
    order: 1;
  }

  .welcome-tutorial-content .tutorial-btn.tutorial-next,
  .welcome-tutorial-content .tutorial-btn.tutorial-start {
    order: 2;
  }

  .welcome-tutorial-content .tutorial-btn.tutorial-skip {
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-tutorial-panel,
  .welcome-tutorial-content,
  .welcome-tutorial-content .tutorial-btn {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
