.games-page { padding-block: 48px; }
.games-intro { max-width: 760px; margin-bottom: 32px; }
.games-intro h1 { font-size: clamp(34px, 5vw, 52px); }
.games-intro .eyebrow { color: var(--teal); }
.games-intro .hero-intro { max-width: 680px; }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.games-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: white; }
.games-card-art { display: grid; place-items: center; min-height: 140px; padding: 24px; background: #eaf3ed; color: var(--teal); font-size: 38px; font-weight: 800; }
.games-card:nth-child(even) .games-card-art { background: #f0ecf8; color: var(--purple); }
.games-card-content { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 26px; }
.games-card-content h2 { margin-block: 6px 10px; font-size: 24px; }
.games-card-content > p:not(.games-note) { margin-top: 0; color: var(--muted); line-height: 1.8; }
.games-card-content .button { margin-top: auto; }
.games-page button { font-family: inherit; cursor: pointer; border: 0; }
.games-page button:focus-visible, .games-result:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
.games-note { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.games-modal { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; border-radius: 21px; color: var(--ink); background: white; box-shadow: 0 16px 60px #123b5033; overflow-y: auto; }
.games-modal::backdrop { background: #123b50a6; }
body:has(.games-modal[open]) { overflow: hidden; }
.games-modal [hidden] { display: none !important; }
.games-modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.games-modal-header h2 { margin: 0; font-size: 20px; }
.games-page .games-close { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 28px; }
.games-modal-body { padding: 24px 32px 32px; text-align: center; }
.games-progress-label { margin: 0 0 10px; color: var(--muted); font-weight: 700; }
.games-progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 6px; accent-color: var(--teal); overflow: hidden; }
.games-progress::-webkit-progress-bar { background: #eaf3ed; }
.games-progress::-webkit-progress-value { background: var(--teal); border-radius: 6px; }
.games-progress::-moz-progress-bar { background: var(--teal); }
.games-factors { display: flex; justify-content: center; align-items: center; gap: 20px; padding-top: 32px; }
.games-factors:focus { outline: none; }
.games-number { display: grid; place-items: center; width: clamp(88px, 22vw, 132px); aspect-ratio: 1; border-radius: 16px; background: #eaf3ed; color: var(--teal); font-size: clamp(2.8rem, 10vw, 4.6rem); font-weight: 700; }
.games-number-square { width: auto; min-width: clamp(132px, 40vw, 240px); padding: 16px; aspect-ratio: auto; }
.games-multiply { font-size: 2.6rem; color: var(--muted); }
.games-prompt { margin: 26px 0 16px; font-weight: 700; }
.games-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.games-page .games-answer { min-height: 92px; border: 2px solid var(--line); border-radius: 14px; background: white; color: var(--ink); font-size: clamp(1.8rem, 7vw, 2.5rem); font-weight: 700; transition: background .15s, border-color .15s; }
@media (hover: hover) and (pointer: fine) {
    .games-page .games-answer:hover:not(:disabled) { background: #eaf3ed; border-color: var(--teal); }
}
.games-page .games-answer:disabled { cursor: default; }
.games-page .games-answer.is-selected { border-color: var(--teal); background: #eaf3ed; }
.games-page .games-answer.is-correct { border-color: #16864b; background: #eaf6ee; color: #18603e; }
.games-page .games-answer.is-incorrect { border-color: #bf6900; background: #fff4d7; }
.games-feedback { min-height: 3.2em; margin: 20px 0 0; font-weight: 700; }
.games-result-stars { display: flex; justify-content: center; gap: 6px; }
.games-result-star { position: relative; color: #c8d1dc; font-size: clamp(2.3rem, 9vw, 3.5rem); line-height: 1.3; }
.games-result-star.is-full { color: #ae7100; }
.games-result-star.is-half::after { content: '★'; position: absolute; top: 0; left: 0; width: 50%; overflow: hidden; color: #ae7100; }
.games-result h3 { margin-block: 16px; font-size: 26px; }
.games-result-encouragement { white-space: pre-line; line-height: 1.7; }
.games-score { color: var(--teal); font-size: 22px; font-weight: 700; }
.games-result .button { margin-top: 16px; }
.games-error { margin-top: 18px; padding: 18px; border-radius: 12px; background: #fff4d7; }
.games-title-flags::before { content: '🇪🇺'; margin-right: 8px; }
.games-title-world-flags::before { content: '🌍'; }
.games-question-flags .games-factors { box-sizing: content-box; height: 170px; }
.games-flag { display: block; width: min(280px, 100%); height: 170px; object-fit: contain; }
.games-flag, .games-flag-emoji { filter: drop-shadow(0 0 1px #123b5070) drop-shadow(0 2px 4px #123b5028); }
.games-flag-emoji { font-size: clamp(5rem, 25vw, 8rem); line-height: 1; }
.games-question-flags .games-feedback { min-height: 4.8em; }
.games-page .games-answers-flags .games-answer { padding: 12px 8px; font-size: clamp(1rem, 3vw, 1.2rem); overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .games-grid { grid-template-columns: 1fr; gap: 18px; }
    .games-page { padding-block: 32px; }
}
@media (max-width: 420px) {
    .games-modal-header { padding: 12px 16px; }
    .games-modal-body { padding: 20px 16px; }
    .games-answers { gap: 9px; }
    .games-page .games-answer { min-height: 78px; }
    .games-factors { gap: 16px; }
    .games-answers-flags { grid-template-columns: 1fr; }
    .games-page .games-answers-flags .games-answer { min-height: 48px; }
    .games-question-flags .games-factors { height: 125px; }
    .games-question-flags .games-feedback { min-height: 6.4em; }
    .games-flag { height: 125px; }
}
@media (prefers-reduced-motion: reduce) { .games-page .games-answer { transition: none; } }
