/* Final app-style shell for the playable Trivia Mundial experience. */
body.game-app {
  min-height: 100svh;
  overflow-x: clip;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(36, 36, 36, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 36, 36, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 85% 10%, rgba(250, 204, 21, 0.28), transparent 25%),
    radial-gradient(circle at 10% 88%, rgba(22, 163, 74, 0.22), transparent 28%),
    var(--color-bg);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

[data-theme="dark"] body.game-app {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 85% 10%, rgba(250, 204, 21, 0.18), transparent 25%),
    radial-gradient(circle at 10% 88%, rgba(79, 70, 229, 0.24), transparent 28%),
    var(--color-bg);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.game-app .app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  min-height: 100svh;
  padding: clamp(10px, 2vw, 18px);
}

body.game-app:has(.game-panel:not([hidden])) {
  height: 100svh;
  overflow: hidden;
}

body.game-app:has(.game-panel:not([hidden])) .app-shell {
  height: 100svh;
}

.game-app .site-header {
  min-height: 56px;
  padding: 0 0 clamp(8px, 1.5vw, 12px);
}

.game-app .brand-logo {
  width: 46px;
  height: 34px;
  padding: 4px;
  border-radius: 10px;
}

.game-app .brand {
  gap: 9px;
}

.game-app .brand span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 7px;
}

.game-app .brand strong {
  font-size: 0.94rem;
  line-height: 1;
}

.game-app .brand small {
  font-size: 0.68rem;
  line-height: 1.1;
}

.game-app .header-actions {
  gap: 8px;
}

.game-app .theme-toggle,
.game-app .sound-toggle {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
}

.game-app [data-theme-label],
.game-app [data-sound-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-app main {
  min-height: 0;
}

.game-app .hero,
.game-app .result-panel {
  min-height: auto;
}

.game-app .hero[hidden],
.game-app .game-panel[hidden],
.game-app .result-panel[hidden] {
  display: none;
  height: auto;
}

.game-app .hero {
  display: grid;
  align-items: start;
  padding: 0;
}

.game-app .start-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, auto);
  gap: clamp(14px, 2vh, 20px);
  width: 100%;
  overflow: visible;
  padding: clamp(18px, 3.2vw, 28px);
  border-radius: 22px;
}

.game-app .hero-copy {
  gap: 6px;
}

.game-app .hero-copy .eyebrow {
  font-size: 0.72rem;
}

.game-app h1 {
  font-size: clamp(2rem, 7.6vw, 4.2rem);
  line-height: 0.94;
}

.game-app .hero-lead {
  max-width: 34rem;
  font-size: clamp(0.86rem, 1.6vw, 1rem);
  line-height: 1.35;
}

.game-app .playtype-grid,
.game-app .mode-grid {
  gap: 8px;
}

.game-app .playtype-grid legend,
.game-app .mode-grid legend {
  margin-bottom: 7px;
  font-size: 0.76rem;
}

.game-app .playtype-option {
  min-height: 54px;
  padding: 10px;
  outline: 0 !important;
}

.game-app .playtype-icon {
  width: 30px;
  height: 30px;
}

.game-app .playtype-copy small,
.game-app .mode-option small {
  font-size: 0.66rem;
}

.game-app .mode-option {
  min-height: 50px;
  padding: 8px 6px;
  outline: 0 !important;
}

.game-app .playtype-option:has(input:checked),
.game-app .mode-option:has(input:checked) {
  box-shadow: none;
}

.game-app .playtype-option:focus-within,
.game-app .mode-option:focus-within {
  outline: 0 !important;
}

.game-app .playtype-option input:focus-visible,
.game-app .mode-option input:focus-visible {
  outline: 0 !important;
}

.game-app .mode-title {
  font-size: clamp(0.72rem, 1.8vw, 0.9rem);
}

.game-app .player-fields {
  gap: 8px;
  align-self: start;
}

.game-app .name-field,
.game-app .team-field {
  gap: 5px;
}

.game-app .name-field span,
.game-app .team-field span {
  font-size: 0.76rem;
}

.game-app .name-field input,
.game-app .team-field input {
  min-height: 40px;
}

.game-app .button-primary {
  min-height: 50px;
}

.game-app .button-row {
  align-self: start;
}

.game-app .button-row .button-primary {
  height: 50px;
}

.game-app .start-status {
  min-height: 0;
}

body.game-app:has(.game-panel:not([hidden])) .discovery-stack {
  display: none;
}

.game-app .game-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto auto auto;
  gap: clamp(8px, 1.4vh, 12px);
  overflow: hidden;
  padding: clamp(10px, 1.8vw, 16px);
  border-radius: 22px;
}

.game-app .game-topline {
  order: 1;
}

.game-app .score-grid {
  order: 5;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.game-app .score-grid article {
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

[data-theme="dark"] .game-app .score-grid article {
  background: rgba(15, 23, 42, 0.72);
}

.game-app .score-grid span {
  font-size: 0.62rem;
}

.game-app .score-grid strong {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.game-app .progress-block {
  order: 2;
}

.game-app .question-card {
  order: 3;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  align-self: start;
  min-height: 0;
  overflow: hidden;
  padding: clamp(14px, 2vw, 24px);
}

.game-app .question-card h2 {
  font-size: clamp(1.45rem, 5vw, 2.65rem);
  line-height: 1.05;
}

.game-app .options-grid {
  gap: 8px;
}

.game-app .option-button {
  min-height: 58px;
  padding: 10px;
}

.game-app .answer-panel {
  order: 4;
  z-index: 2;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(36, 36, 36, 0.14);
}

.game-app .answer-panel p {
  line-height: 1.35;
}

.game-app .answer-explanation {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-app .result-panel {
  overflow: visible;
  align-content: start;
  min-height: auto;
  padding-bottom: 18px;
}

.game-app .result-layout {
  min-height: 0;
  gap: 14px;
}

.game-app .result-summary .eyebrow,
.game-app .result-summary h2,
.game-app .result-copy {
  display: block;
}

.game-app .result-summary {
  gap: 9px;
}

.game-app .result-summary h2 {
  max-width: 20ch;
  font-size: clamp(1.25rem, 5.4vw, 2rem);
  line-height: 1.02;
}

.game-app .result-copy {
  font-size: clamp(0.82rem, 3.2vw, 0.96rem);
  line-height: 1.32;
}

.game-app .app-extra-trigger {
  width: 100%;
  border: 2px solid #16a34a;
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
}

.game-app .app-extra-trigger:hover {
  border-color: #15803d;
  color: #ffffff;
  background: #16a34a;
}

.game-app .app-extra-video {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #111111;
}

.game-app .app-extra-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-app .app-extra-socials {
  display: grid;
  gap: 8px;
}

.game-app .app-extra-socials[hidden] {
  display: none;
}

.game-app .app-extra-socials p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.game-app .app-extra-social-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.game-app .app-social-button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.game-app .app-social-youtube {
  background: #ff0000;
}

.game-app .app-social-instagram {
  background: linear-gradient(35deg, #fd1d1d, #833ab4);
}

.game-app .app-social-tiktok {
  background: #000000;
}

.game-app .app-extra-game {
  --mode-color: var(--color-primary);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.game-app .app-extra-game .game-topline {
  align-items: center;
}

.game-app .app-extra-game [data-extra-back-top] {
  min-width: 0;
  white-space: nowrap;
}

.game-app .app-extra-question-card {
  gap: 12px;
  overflow: visible;
}

.game-app .app-extra-answer-actions {
  display: grid;
  gap: 8px;
}

@media (min-width: 760px) {
  .game-app .start-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto auto;
    align-content: start;
    gap: 18px;
  }

  .game-app .hero-copy,
  .game-app .player-fields,
  .game-app .button-row,
  .game-app .playtype-grid,
  .game-app .mode-grid,
  .game-app .start-status {
    grid-column: 1;
  }

  .game-app .hero-copy {
    max-width: none;
  }

  .game-app .playtype-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

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

  .game-app .player-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-app .button-row {
    align-self: start;
  }

  .game-app .game-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
  }

  .game-app .game-topline,
  .game-app .progress-block,
  .game-app .question-card,
  .game-app .answer-panel,
  .game-app .score-grid {
    grid-column: 1;
  }

  .game-app .score-grid {
    grid-row: auto;
    align-self: stretch;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-app .score-grid article {
    min-height: 58px;
    border-radius: 16px;
  }

  .game-app .app-extra-question-card:has(.app-extra-video) {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto minmax(0, auto);
    align-items: start;
  }

  .game-app .app-extra-question-card:has(.app-extra-video) .eyebrow,
  .game-app .app-extra-question-card:has(.app-extra-video) h2 {
    grid-column: 1 / -1;
  }

  .game-app .app-extra-question-card:has(.app-extra-video) .app-extra-video {
    grid-column: 1;
  }

  .game-app .app-extra-question-card:has(.app-extra-video) .app-extra-options {
    grid-column: 2;
    grid-template-columns: 1fr;
    align-self: stretch;
  }
}

@media (max-width: 640px) {
  .game-app .app-shell {
    padding: 10px;
  }

  .game-app .site-header {
    min-height: 46px;
    padding-bottom: 8px;
  }

  .game-app .brand-logo {
    width: 38px;
    height: 30px;
  }

  .game-app .brand strong {
    font-size: 0.82rem;
  }

  .game-app .brand small {
    display: inline;
    font-size: 0.66rem;
  }

  .game-app .brand small::before {
    content: "· ";
  }

  .game-app .theme-toggle,
  .game-app .sound-toggle {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .game-app .start-panel {
    align-content: space-between;
    min-height: calc(100svh - 66px);
    gap: 12px;
    padding: 10px 12px 14px;
  }

  .game-app .hero-copy .eyebrow {
    display: block;
    font-size: 0.66rem;
  }

  .game-app .hero-lead {
    display: block;
    font-size: 0.82rem;
    line-height: 1.28;
  }

  .game-app h1 {
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  .game-app .playtype-option {
    min-height: 50px;
  }

  .game-app .playtype-copy small {
    display: block;
    font-size: 0.6rem;
    line-height: 1.08;
  }

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

  .game-app .mode-option small {
    display: block;
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .game-app .player-fields {
    grid-template-columns: 1fr 1fr;
  }

  .game-app .name-field input,
  .game-app .team-field input {
    min-height: 38px;
  }

  .game-app .button-primary {
    min-height: 48px;
  }

  .game-app .button-row .button-primary {
    height: 48px;
  }

  .game-app .result-panel {
    padding-top: 8px;
  }

  .game-app .result-layout {
    gap: 10px;
  }

  .game-app .share-card {
    width: min(100%, 332px);
  }

  .game-app .result-actions {
    gap: 6px;
  }

  .game-app .app-extra-socials {
    gap: 7px;
  }

  .game-app .app-extra-socials p {
    font-size: 0.78rem;
  }

  .game-app .app-extra-social-buttons {
    gap: 6px;
  }

  .game-app .app-social-button {
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.72rem;
  }

  .game-app .game-panel {
    grid-template-rows: auto auto auto auto auto;
    gap: 5px;
    padding: 9px;
  }

  .game-app .button-compact,
  .game-app .game-mode {
    min-height: 34px;
    padding: 7px 9px;
  }

  .game-app .app-extra-game [data-extra-back-top] {
    max-width: 112px;
    padding-inline: 9px;
  }

  .game-app .app-extra-question-card {
    overflow: visible;
    padding-bottom: 12px;
  }

  .game-app .app-extra-game .app-extra-options {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .game-app .app-extra-game .option-button {
    min-height: 48px;
  }

  .game-app .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .game-app .score-grid article {
    min-height: 34px;
    padding: 5px 7px;
  }

  .game-app .score-grid article:nth-child(4) {
    display: none;
  }

  .game-app .question-card {
    gap: 10px;
    padding: 12px 12px 8px;
  }

  .game-app .question-card .eyebrow {
    font-size: 0.66rem;
  }

  .game-app .question-card h2 {
    font-size: clamp(1.35rem, 7vw, 2rem);
  }

  .game-app .option-button {
    min-height: 54px;
    grid-template-columns: 30px 1fr auto;
    gap: 9px;
  }

  .game-app .option-letter {
    width: 30px;
    height: 30px;
  }

  .game-app .answer-panel {
    max-height: 172px;
    overflow: hidden;
  }

  .game-app .app-extra-answer {
    max-height: none;
    overflow: visible;
  }

  .game-app .answer-panel .button {
    min-height: 44px;
  }
}
