/* 369 — overrides on shared Sabelotodo shell */

body[data-page="game-369"] {
  overflow: hidden;
}

html.is-sabelotodo-entering body[data-page="game-369"].is-sabelotodo-entering {
  overflow: hidden;
}

body[data-page="game-369"].is-sabelotodo-entering::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 100% 50%, rgba(22, 100, 65, 0.18) 0%, transparent 62%),
    rgba(247, 246, 243, 0.42);
  animation: sabelotodo-wash-in 0.38s ease both;
}

[data-theme="dark"] body[data-page="game-369"].is-sabelotodo-entering::before {
  background:
    radial-gradient(ellipse 90% 70% at 100% 50%, rgba(22, 100, 65, 0.14) 0%, transparent 62%),
    rgba(0, 0, 0, 0.35);
}

body[data-page="game-369"].is-sabelotodo-entering .sabelotodo {
  animation: sabelotodo-page-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="game-369"].is-sabelotodo-entering .sabelotodo,
  body[data-page="game-369"].is-sabelotodo-entering::before {
    animation: none;
  }
}

.sabelotodo.game369 {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(22, 100, 65, 0.14) 0%, transparent 55%),
    var(--bg);
  min-height: 100dvh;
}

.sabelotodo.game369.is-bg-play {
  background: var(--bg);
}

.sabelotodo.game369.is-bg-play .sabelotodo__main {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding:
    calc(var(--games-shell-top-h) + 0.5rem)
    max(var(--space-md), env(safe-area-inset-right, 0px))
    calc(env(safe-area-inset-bottom, 0px) + 0.5rem)
    max(var(--space-md), env(safe-area-inset-left, 0px));
}

.sabelotodo.game369.is-bg-play .sabelotodo__panel.game369__panel--wide {
  width: min(58rem, 100%);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: auto;
  max-height: calc(100dvh - var(--games-shell-top-h) - 1rem);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.game369__round-screen {
  width: 100%;
  max-width: 54rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-inline: auto;
  padding: 0.25rem 0;
}

.game369__round-screen.sabelotodo__hidden {
  display: none;
}

.game369__round-screen--compact {
  gap: 0.45rem;
}

.game369__round-screen--compact .game369__round-instruction {
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.22;
}

.game369__round-screen--compact .game369__round-title {
  margin-top: 0.15rem;
  font-size: clamp(0.72rem, 1.2vw, 0.84rem);
}

.game369__round-head {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 0;
  text-align: center;
  padding-inline: 0.75rem;
}

.game369__round-head-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
}

.game369__round-copy {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.game369__round-timer {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
}

.game369__round-timer .sabelotodo__timer-progress {
  stroke: rgba(22, 100, 65, 0.92);
}

.game369__round-timer.is-urgent .sabelotodo__timer-progress {
  stroke: rgba(180, 60, 50, 0.95);
}

.game369__round-title {
  font-size: clamp(0.78rem, 1.4vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(22, 100, 65, 0.88);
  margin: 0.35rem 0 0;
  line-height: 1.25;
}

.game369__round-instruction {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.28;
  text-wrap: balance;
}

.game369__grid {
  display: grid;
  gap: var(--space-md);
  width: 100%;
  flex: 0 0 auto;
  justify-items: stretch;
  align-items: stretch;
}

.game369__round-actions {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 0;
  padding: 0;
  justify-content: center;
  background: none;
}

html:fullscreen body[data-page="game-369"],
html:-webkit-full-screen body[data-page="game-369"] {
  overflow: hidden;
  background: var(--bg);
}

html:fullscreen .sabelotodo.game369,
html:-webkit-full-screen .sabelotodo.game369 {
  min-height: 100dvh;
  max-height: 100dvh;
}

html:fullscreen .sabelotodo.game369 .sabelotodo__main,
html:-webkit-full-screen .sabelotodo.game369 .sabelotodo__main {
  flex: 1;
  min-height: 0;
  padding-top: var(--space-lg);
  max-height: calc(100dvh - var(--games-shell-top-h, 3.75rem));
}

.sabelotodo.game369 .sabelotodo__brand span {
  color: rgba(22, 100, 65, 0.95);
}

.sabelotodo.game369 .sabelotodo__panel.game369__panel--wide {
  width: min(58rem, calc(100vw - 2rem));
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.sabelotodo.game369 .sabelotodo__btn--primary {
  background: linear-gradient(180deg, rgba(28, 120, 78, 0.96) 0%, rgba(18, 95, 62, 0.98) 100%);
  box-shadow: 0 4px 14px rgba(22, 100, 65, 0.28);
}

.game369__title {
  min-height: 1.15em;
  letter-spacing: -0.03em;
  color: rgba(22, 100, 65, 0.95);
}

.game369__title-text {
  display: inline-block;
  transition: opacity 0.28s ease, transform 0.28s ease;
  will-change: opacity, transform;
}

.game369__title-text.is-out {
  opacity: 0;
  transform: translateY(-0.4rem);
}

.game369__title-text.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .game369__title-text {
    transition: none;
  }
}

.game369__grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  max-width: 52rem;
  margin-inline: auto;
}

.game369__grid--3 .game369__media--flag {
  aspect-ratio: 4 / 5;
  min-height: clamp(6.5rem, 15vh, 8.5rem);
}

.game369__grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 50rem;
  margin-inline: auto;
}

.game369__grid--9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.game369__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  isolation: isolate;
}

.game369__media {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 88%, rgba(22, 100, 65, 0.08));
  border-bottom: 1px solid var(--border);
}

.game369__grid--6 .game369__media {
  aspect-ratio: 4 / 3;
}

.game369__grid--9 .game369__media {
  aspect-ratio: 16 / 10;
}

.game369__media--flag {
  background: color-mix(in srgb, var(--bg) 92%, rgba(22, 100, 65, 0.06));
}

.game369__media--flag .game369__img {
  object-fit: contain;
  padding: 0.85rem;
}

.game369__media--player {
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, rgba(12, 42, 30, 0.08) 0%, rgba(12, 42, 30, 0.2) 100%);
}

.game369__media--player .game369__img {
  object-fit: cover;
  object-position: top center;
}

.game369__grid--6 .game369__media--player {
  aspect-ratio: 4 / 5;
  min-height: clamp(6.75rem, 14vh, 8.75rem);
  max-height: clamp(7.5rem, 16vh, 9.5rem);
}

.game369__media--text,
.game369__media--challenge {
  background: color-mix(in srgb, var(--bg) 88%, rgba(22, 100, 65, 0.1));
}

.game369__media--question {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 0.85rem 0.95rem;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--bg) 82%, rgba(22, 100, 65, 0.14)) 0%, color-mix(in srgb, var(--bg) 94%, transparent) 100%);
}

.game369__grid--9 .game369__media--question {
  aspect-ratio: unset;
  min-height: 0;
  height: auto;
  padding: 0.48rem 0.52rem;
}

.game369__card--question {
  background: color-mix(in srgb, rgba(22, 100, 65, 0.14) 42%, var(--surface));
  border-color: color-mix(in srgb, rgba(22, 100, 65, 0.38) 55%, var(--border));
  box-shadow: 0 3px 16px rgba(22, 100, 65, 0.1);
}

.game369__card--question .game369__media--question {
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, rgba(22, 100, 65, 0.28) 48%, var(--bg)) 0%,
      color-mix(in srgb, rgba(22, 100, 65, 0.12) 38%, var(--surface)) 100%
    );
}

.game369__question-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-height: 100%;
  text-align: center;
}

.game369__grid--9 .game369__question-body {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.game369__question-kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(22, 100, 65, 0.88);
}

.game369__grid--9 .game369__question-kicker {
  font-size: clamp(0.82rem, 1.15vw, 0.98rem);
  letter-spacing: 0.07em;
  line-height: 1.15;
}

.game369__question-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 3.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.28;
  color: var(--text);
  text-wrap: balance;
  hyphens: auto;
}

.game369__grid--9 .game369__question-text {
  display: grid;
  width: fit-content;
  height: fit-content;
  max-width: 100%;
  justify-self: center;
  font-size: clamp(1.18rem, 1.75vw, 1.58rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 3.8px;
}

.game369__card--question .game369__card-foot {
  padding-top: 0.42rem;
  gap: 0.3rem;
  background: color-mix(in srgb, rgba(22, 100, 65, 0.08) 35%, var(--surface));
}

.game369__card--question .game369__media {
  border-bottom: 1px solid var(--border);
}

.game369__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game369__media--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
}

.game369__media--text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.game369__media-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.25;
  color: rgba(22, 100, 65, 0.95);
}

.game369__card-foot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: var(--space-sm);
}

.game369__grid--6 .game369__card-foot {
  padding: 0.32rem 0.36rem 0.38rem;
  gap: 0.22rem;
}

.game369__grid--9 .game369__card-foot {
  padding: 0.28rem;
  gap: 0.18rem;
}

.game369__grid--9 .game369__card--question .game369__card-foot {
  padding: 0.22rem 0.26rem 0.26rem;
  gap: 0.16rem;
}

.game369__card.is-locked .game369__option {
  pointer-events: none;
}

.game369__card.is-wrong {
  border-color: rgba(180, 60, 50, 0.55);
}

.game369__card.is-wrong .game369__card-foot {
  background: rgba(180, 60, 50, 0.06);
}

.game369__card.is-correct {
  border-color: rgba(22, 100, 65, 0.45);
}

.game369__card.is-correct .game369__card-foot {
  background: rgba(22, 100, 65, 0.06);
}

.game369__label {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  margin: 0;
}

.game369__grid--6 .game369__label {
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game369__grid--9 .game369__label {
  font-size: 0.65rem;
  line-height: 1.2;
}

.game369__hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
}

.game369__grid--6 .game369__hint {
  font-size: 0.62rem;
}

.game369__grid--9 .game369__hint {
  font-size: 0.58rem;
  line-height: 1.2;
}

.game369__options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.32rem;
  margin-top: 0.15rem;
}

.game369__grid--6 .game369__options {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.18rem;
  margin-top: 0.08rem;
}

.game369__grid--9 .game369__options {
  gap: 0.22rem;
}

.game369__option {
  appearance: none;
  width: auto;
  flex: 1 1 calc(33.333% - 0.32rem);
  min-width: 0;
  padding: 0.38rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 94%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.game369__option-flag {
  font-size: 0.95em;
  line-height: 1;
  flex-shrink: 0;
}

.game369__option-text {
  display: block;
  width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
  text-wrap: balance;
}

.game369__grid--3 .game369__options {
  flex-direction: column;
  gap: 0.38rem;
}

.game369__grid--3 .game369__option {
  flex: 1 1 auto;
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
}

.game369__grid--6 .game369__option,
.game369__grid--6 .game369__option.game369__badge {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 1.72rem;
  padding: 0.24rem 0.34rem;
  font-size: 0.62rem;
  font-weight: 600;
  border-width: 1px;
  border-radius: 999px;
  line-height: 1.15;
  box-shadow: none;
}

.game369__grid--6 .game369__option-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  text-wrap: nowrap;
}

.game369__grid--9 .game369__option {
  flex-basis: calc(50% - 0.22rem);
  padding: 0.28rem 0.36rem;
  font-size: 0.58rem;
  gap: 0.2rem;
}

.game369__grid--9 .game369__option-flag {
  font-size: 0.9em;
}

.game369__option:hover:not(:disabled) {
  border-color: rgba(22, 100, 65, 0.45);
  background: rgba(22, 100, 65, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(22, 100, 65, 0.1);
}

.game369__option.is-picked {
  border-color: rgba(46, 111, 168, 0.62);
  background: rgba(46, 111, 168, 0.14);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(46, 111, 168, 0.12);
}

.game369__option.is-selected {
  border-color: rgba(22, 100, 65, 0.7);
  background: rgba(22, 100, 65, 0.18);
  color: rgba(18, 95, 62, 0.98);
  box-shadow: 0 0 0 2px rgba(22, 100, 65, 0.14);
}

.game369__option.is-picked-wrong {
  border-color: rgba(180, 60, 50, 0.62);
  background: rgba(180, 60, 50, 0.12);
  color: rgba(150, 45, 38, 0.98);
  box-shadow: 0 0 0 2px rgba(180, 60, 50, 0.1);
}

.game369__win-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 18rem;
  margin-inline: auto;
}

.game369__win-actions .sabelotodo__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#g369Check:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#g369Check:disabled:active {
  transform: none;
}

.game369__option:disabled:not(.is-picked):not(.is-selected):not(.is-picked-wrong) {
  opacity: 0.45;
}

@media (min-width: 721px) {
  .game369__grid--3 {
    gap: 1rem;
  }

  .game369__grid--3 .game369__media--flag .game369__img {
    padding: 0.65rem;
  }

  .game369__grid--3 .game369__media--flag {
    min-height: clamp(7rem, 16vh, 9rem);
  }

  .game369__grid--6 {
    gap: 0.55rem;
    max-width: 48rem;
  }

  .game369__grid--6 .game369__media--player {
    aspect-ratio: 4 / 5;
    min-height: clamp(7.25rem, 15vh, 9.25rem);
    max-height: clamp(8rem, 17vh, 10rem);
  }

  .game369__grid--6 .game369__option,
  .game369__grid--6 .game369__option.game369__badge {
    min-height: 1.82rem;
    padding: 0.26rem 0.38rem;
    font-size: 0.66rem;
  }

  .game369__grid--9 .game369__media--question {
    aspect-ratio: unset;
    min-height: 0;
    height: auto;
    padding: 0.42rem 0.48rem;
  }

  .game369__round-screen--compact #g369Check {
    padding: 0.58rem 1.1rem;
    font-size: 0.88rem;
  }

  .game369__grid--9 {
    gap: 0.42rem;
  }

  .game369__grid--9 .game369__question-text {
    font-size: clamp(1.22rem, 1.45vw, 1.62rem);
  }

  #g369Check {
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 720px) {
  .game369__grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game369__grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game369__grid--9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .game369__grid--3,
  .game369__grid--6 {
    grid-template-columns: 1fr;
  }

  .game369__grid--9 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sabelotodo.game369 .sabelotodo__status.is-fail h2 {
  color: rgba(180, 60, 50, 0.95);
}

.sabelotodo.game369 .sabelotodo__status.is-win h2 {
  color: rgba(22, 100, 65, 0.95);
}
