/* Kids games (hub and game pages). Dark site chrome (bg #161616, cards #232323, lime #DDF247, muted #8A8AA0)
   around bright, colorful play areas. No purple anywhere: indigo (#3949AB) is used for focus rings.
   Versioned file name: the CDN caches static files for years. Copy to games.v2.css (and update the templates)
   when changing it. Everything is scoped to .gm so it cannot leak into the rest of the site.
   Note: the theme sets html font-size to 62.5 percent (1rem = 10px), so sizes here are in px or em. */

.gm {
    --gm-card: #232323;
    --gm-card-2: #2c2c2c;
    --gm-line: rgba(255, 255, 255, .09);
    --gm-lime: #DDF247;
    --gm-lime-dark: #A8BA1E;
    --gm-muted: #8A8AA0;
    --gm-soft: #D6D6E0;
    --gm-ink: #1F2330;
    --gm-ink-2: #4A5368;
    --gm-cream: #FFF7EA;
    --gm-warm-line: #F0DDC3;
    --gm-coral: #FF6B4A;
    --gm-coral-dark: #C23A1E;
    --gm-mint: #4FD19B;
    --gm-mint-dark: #17754F;
    --gm-sun: #FFCD3A;
    --gm-sky: #7BBCF0;
    --gm-teal: #26A69A;
    --gm-indigo: #3949AB;
    color: var(--gm-soft);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}
.gm *, .gm *::before, .gm *::after { box-sizing: border-box; }
.gm [hidden] { display: none !important; }
.gm img { max-width: 100%; height: auto; }
.gm ul, .gm ol { margin: 0; padding: 0; }

.gm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons (the theme styles every bare button, so every state is restored here) ---------- */
.gm button {
    height: auto; min-height: 48px; padding: 10px 18px; border-radius: 999px; margin: 0;
    background-color: var(--b-bg, #fff); color: var(--b-fg, var(--gm-ink));
    border: var(--b-bw, 2px) solid var(--b-bd, var(--gm-warm-line));
    font-family: inherit; font-size: 16px; font-weight: 800; line-height: 1; letter-spacing: 0; text-transform: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
    cursor: pointer; -webkit-appearance: none; appearance: none; outline: 0;
    transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.gm button:hover, .gm button:focus, .gm button:active {
    background-color: var(--b-bg, #fff); color: var(--b-fg, var(--gm-ink));
    border: var(--b-bw, 2px) solid var(--b-bd, var(--gm-warm-line)); outline: 0;
}
.gm button:focus-visible { outline: 3px solid var(--gm-indigo); outline-offset: 2px; }
.gm button:disabled { cursor: default; }
.gm button:active:not(:disabled) { transform: translateY(1px) scale(.98); }

.gm-btn:hover { --b-bg: #FFF1DC; }
.gm-btn[aria-pressed="true"], .gm-btn[aria-pressed="true"]:hover { --b-bg: #161616; --b-fg: var(--gm-lime); --b-bd: #161616; }
.gm .gm-btn-sm { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.gm .gm-btn-icon { width: 48px; padding: 0; font-size: 22px; flex: 0 0 auto; margin-left: auto; }
.gm-btn-primary, .gm-btn-primary:hover { --b-bg: var(--gm-lime); --b-fg: #161616; --b-bd: var(--gm-lime); box-shadow: 0 5px 0 var(--gm-lime-dark); }
.gm-btn-primary:hover { --b-bg: #E8F76A; }
.gm-btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--gm-lime-dark); }

/* ---------- Page chrome ---------- */
.gm-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.gm-chips li {
    background: var(--gm-card-2); border: 1px solid var(--gm-line); border-radius: 999px; padding: 6px 12px;
    font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--gm-soft);
}
.gm-chips-lead { justify-content: center; margin: 0 0 18px; }

.gm a { color: var(--gm-lime); text-decoration: underline; text-underline-offset: 3px; }
.gm a:hover, .gm a:focus { color: #fff; }
.gm a:focus-visible { outline: 3px solid var(--gm-lime); outline-offset: 3px; border-radius: 4px; }

.gm-card {
    background: var(--gm-card); border: 1px solid var(--gm-line); border-radius: 28px; padding: 10px; margin: 0 auto 8px;
    max-width: 880px;
}
@media (min-width: 576px) { .gm-card { padding: 14px; } }
.gm-noscript { margin: 12px; color: var(--gm-lime); font-weight: 700; }

/* ---------- Guide text under a game or on the hub ---------- */
.gm-guide { max-width: 820px; margin: 44px auto 0; }
.gm-guide h2, .gm-more h2 { font-size: 26px; line-height: 1.3; font-weight: 800; color: #fff; margin: 38px 0 12px; }
.gm-guide h2:first-child { margin-top: 0; }
.gm-guide p { font-size: 17px; line-height: 1.75; color: var(--gm-soft); margin: 0 0 14px; }
.gm-list { list-style: none; display: grid; gap: 10px; margin: 0 0 16px; padding: 0; }
.gm-list li { position: relative; padding-left: 26px; font-size: 17px; line-height: 1.65; color: var(--gm-soft); }
.gm-list li::before {
    content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--gm-lime);
}
.gm-list strong { color: #fff; }
.gm-guide .gm-tip {
    margin: 18px 0 0; padding: 16px 18px; background: var(--gm-card); border-left: 4px solid var(--gm-lime);
    border-radius: 14px; color: var(--gm-soft); font-size: 16px; line-height: 1.7;
}

/* ---------- More games ---------- */
.gm-more { max-width: 1140px; margin: 46px auto 0; }
.gm-more h2 { margin-top: 0; }
.gm-more-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; }
@media (min-width: 768px) { .gm-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.gm a.gm-mini, .gm a.gm-mini:hover { display: block; height: 100%; text-decoration: none; color: #fff; }
.gm a.gm-mini {
    background: var(--gm-card); border: 1px solid var(--gm-line); border-radius: 18px; overflow: hidden;
    transition: border-color .2s ease, transform .2s ease;
}
.gm a.gm-mini:hover { border-color: var(--gm-lime); transform: translateY(-3px); }
.gm-mini img { display: block; width: 100%; height: auto; }
.gm-mini-name { display: block; padding: 10px 12px 0; font-size: 16px; font-weight: 800; line-height: 1.3; }
.gm-mini-age { display: block; padding: 2px 12px 12px; font-size: 14px; color: var(--gm-muted); }
.gm-all { margin: 16px 0 0; font-weight: 800; font-size: 16px; }

/* ---------- Hub grid ---------- */
.gm-grid { list-style: none; display: grid; grid-template-columns: 1fr; gap: 18px; margin: 0; padding: 0; }
@media (min-width: 720px) { .gm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }
@media (min-width: 1040px) { .gm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gm-grid-wide { grid-column: span 2; } }
.gm-grid-item { display: flex; min-width: 0; }
.gm-tile {
    position: relative; display: flex; flex-direction: column; width: 100%; background: var(--gm-card);
    border: 1px solid var(--gm-line); border-radius: 22px; overflow: hidden; transition: border-color .2s ease, transform .2s ease;
}
.gm-tile:hover, .gm-tile:focus-within { border-color: var(--gm-lime); transform: translateY(-3px); }
.gm-tile-img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; }
.gm-tile-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 20px; }
.gm-tile-title { font-size: 22px; line-height: 1.25; font-weight: 800; margin: 0 0 8px; color: #fff; }
.gm a.gm-tile-link, .gm a.gm-tile-link:hover, .gm a.gm-tile-link:focus { color: #fff; text-decoration: none; }
.gm-tile-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 22px; }
.gm a.gm-tile-link:focus-visible { outline: 3px solid var(--gm-lime); outline-offset: -3px; border-radius: 22px; }
.gm-tile-text { font-size: 16px; line-height: 1.6; color: var(--gm-soft); margin: 0 0 12px; }
.gm-tile .gm-chips { margin: 0 0 16px; }
.gm-tile .gm-chips li { font-size: 13px; padding: 5px 10px; }
.gm-play {
    margin-top: auto; align-self: flex-start; background: var(--gm-lime); color: #161616; border-radius: 999px;
    padding: 12px 22px; font-weight: 800; font-size: 16px; line-height: 1; box-shadow: 0 5px 0 var(--gm-lime-dark);
}
.gm-start {
    width: 100%; background: radial-gradient(120% 140% at 0% 0%, rgba(221, 242, 71, .12), transparent 55%), var(--gm-card);
    border: 1px solid rgba(221, 242, 71, .35); border-radius: 22px; padding: 22px 24px 24px;
    display: flex; flex-direction: column; justify-content: center;
}
.gm-start-title { font-size: 22px; line-height: 1.25; font-weight: 800; margin: 0 0 12px; color: #fff; }
.gm-start-list { list-style: none; display: grid; gap: 14px; margin: 0; padding: 0; }
.gm-start-list li { font-size: 17px; line-height: 1.6; color: var(--gm-soft); }
.gm-start-list strong { color: #fff; }

/* ---------- Play area (bright and colorful) ---------- */
.gm-stage {
    position: relative; overflow: hidden; color: var(--gm-ink); border-radius: 20px; padding: 14px;
    background: linear-gradient(180deg, var(--gm-cream) 0%, #FFFDF8 100%);
}
@media (min-width: 576px) { .gm-stage { padding: 22px; } }
@media (max-width: 420px) {
    .gm-stage { padding: 12px 10px; }
    .gm .gm-btn-sm { padding: 8px 9px; font-size: 13.5px; gap: 4px; }
    .gm .gm-btn-icon { width: 44px; min-height: 44px; font-size: 20px; }
    .gm-math-apples { font-size: 22px; }
    .gm-bar, .gm-seg { gap: 6px; }
    .gm-seg .gm-btn > span[aria-hidden="true"] { display: none; }
}

.gm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.gm-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; flex: 1 1 0; min-width: 0; scrollbar-width: thin; }
.gm-scroll .gm-btn { flex: 0 0 auto; }
.gm-center { display: flex; justify-content: center; margin: 4px 0; }
.gm-loading { margin: 24px 0; text-align: center; font-weight: 700; color: var(--gm-ink-2); }
.gm-hint { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--gm-ink-2); }

.gm-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.gm-dots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 16px; }
.gm-dots span { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--gm-warm-line); }
.gm-dots span.is-right { background: var(--gm-mint); border-color: var(--gm-mint); }
.gm-dots span.is-miss { background: var(--gm-sun); border-color: var(--gm-sun); }
.gm-dots span.is-now { border-color: var(--gm-coral); transform: scale(1.25); }
.gm-best { margin: 0; font-size: 14px; font-weight: 700; color: var(--gm-ink-2); }

.gm-feedback { min-height: 1.6em; margin: 12px 0 0; text-align: center; font-weight: 800; font-size: 18px; line-height: 1.35; color: var(--gm-ink-2); }
.gm-feedback.is-good { color: var(--gm-mint-dark); }
.gm-feedback.is-gentle { color: var(--gm-coral-dark); }

/* Result card and confetti (common.v1.js) */
.gm-result { text-align: center; padding: 18px 8px 6px; animation: gm-pop .45s ease both; }
.gm-result-stars { font-size: 30px; letter-spacing: 4px; line-height: 1.2; }
.gm-result-title { font-size: 26px; line-height: 1.25; font-weight: 800; margin: 6px 0; color: var(--gm-ink); }
.gm-result-text { font-size: 18px; line-height: 1.5; color: var(--gm-ink-2); margin: 0 0 6px; }
.gm-result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.gm-confetti { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: gm-fall 1.4s ease-in forwards; }

@keyframes gm-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes gm-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes gm-fall { to { transform: translateY(460px) rotate(540deg); opacity: 0; } }
@keyframes gm-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 205, 58, .9); } 50% { box-shadow: 0 0 0 10px rgba(255, 205, 58, 0); } }
.gm .is-shake { animation: gm-shake .35s ease; }

/* ---------- Math game ---------- */
.gm-math-q { text-align: center; margin: 6px 0 10px; }
.gm-math-sum { font-size: clamp(40px, 12vw, 60px); font-weight: 900; line-height: 1.15; letter-spacing: .02em; color: var(--gm-ink); }
.gm-math-apples { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 42px; margin-top: 6px; font-size: 26px; line-height: 1.2; }
.gm-math-apples .group { display: inline-flex; flex-wrap: wrap; max-width: 46%; justify-content: center; gap: 2px; }
.gm-math-apples .plus { font-weight: 900; color: var(--gm-coral-dark); font-size: 30px; }
.gm-math-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.gm .gm-math-answer { min-height: 76px; font-size: 32px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
.gm .gm-math-answer:nth-child(1) { --b-bg: #FFE0D6; }
.gm .gm-math-answer:nth-child(2) { --b-bg: #D8F5E7; }
.gm .gm-math-answer:nth-child(3) { --b-bg: #DCEEFD; }
.gm .gm-math-answer.is-right, .gm .gm-math-answer.is-right:hover { --b-bg: var(--gm-mint); --b-bd: var(--gm-mint); }
.gm .gm-math-answer.is-hint { animation: gm-glow 1s ease 2; --b-bd: var(--gm-sun); }

/* ---------- Animal quiz ---------- */
.gm-animal { display: grid; justify-items: center; gap: 10px; }
.gm-animal-pic {
    width: min(220px, 62vw); aspect-ratio: 1; object-fit: contain; padding: 14px; border-radius: 28px; background: #fff;
    border: 6px solid #fff; box-shadow: 0 10px 30px rgba(217, 72, 42, .14);
}
.gm-animal-q { margin: 0; font-size: 20px; font-weight: 800; text-align: center; }
.gm-animal-choices { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; max-width: 640px; margin-top: 4px; }
.gm-animal-choices[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 576px) { .gm-animal-choices[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gm .gm-animal-choice { min-height: 62px; font-size: 22px; border-radius: 20px; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.gm .gm-animal-choice.is-right, .gm .gm-animal-choice.is-right:hover { --b-bg: var(--gm-mint); --b-bd: var(--gm-mint); }
.gm .gm-animal-choice.is-miss, .gm .gm-animal-choice.is-miss:hover { --b-bg: #FFE3A3; --b-bd: var(--gm-sun); }
.gm-animal-word {
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; background: #fff;
    border: 2px dashed var(--gm-sky); border-radius: 18px; padding: 8px 16px; animation: gm-pop .3s ease both;
}
.gm-animal-word strong { font-size: 26px; font-weight: 900; line-height: 1.2; }
.gm-animal-extras { display: grid; justify-items: center; gap: 10px; width: 100%; }
.gm-animal-next { margin-top: 4px; }

/* ---------- Memory game ---------- */
.gm-mem-board { display: grid; gap: 10px; margin: 0 auto; max-width: 520px; }
.gm-mem-board.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; }
.gm-mem-board.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gm .gm-mem-card {
    --b-bg: transparent; --b-bd: transparent; --b-bw: 0;
    position: relative; display: block; aspect-ratio: 1; min-height: 0; padding: 0; border-radius: 18px; perspective: 700px;
}
.gm-mem-inner { position: absolute; inset: 0; transition: transform .45s ease; transform-style: preserve-3d; }
.gm-mem-card.is-open .gm-mem-inner { transform: rotateY(180deg); }
.gm-mem-face {
    position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    display: grid; place-items: center;
}
.gm-mem-back {
    background: radial-gradient(circle at 30% 25%, #FFB36B 0, #E5502F 62%); border: 3px solid #fff;
    box-shadow: 0 5px 0 #B93A1D; color: #fff; font-size: 30px; font-weight: 900; line-height: 1;
}
.gm-mem-front { background: #fff; transform: rotateY(180deg); border: 3px solid var(--gm-warm-line); }
.gm-mem-front img { width: 70%; height: 70%; object-fit: contain; }
.gm-mem-card.is-matched .gm-mem-front { border-color: var(--gm-mint); box-shadow: 0 0 0 3px rgba(79, 209, 155, .35); }
.gm-mem-label { position: absolute; bottom: 3px; left: 3px; right: 3px; font-size: 12px; font-weight: 800; line-height: 1.1; color: var(--gm-mint-dark); text-align: center; }
.gm-mem-info { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-weight: 800; margin-top: 14px; }
.gm-mem-info span { background: #fff; border-radius: 999px; padding: 6px 14px; border: 1px solid var(--gm-warm-line); font-size: 15px; }
.gm-credit { font-size: 13px; color: var(--gm-ink-2); margin: 10px 0 0; text-align: center; }

/* ---------- Coloring game ---------- */
.gm-canvas { background: #fff; border-radius: 18px; border: 2px solid var(--gm-warm-line); margin: 10px auto; max-width: 520px; touch-action: manipulation; }
.gm-canvas svg { display: block; width: 100%; height: auto; }
.gm-canvas .b { cursor: pointer; transition: fill .12s ease; }
.gm-canvas .b:focus { outline: none; }
.gm-canvas .b:focus-visible { outline: 3px solid var(--gm-indigo); outline-offset: -2px; stroke: var(--gm-indigo); stroke-width: 7px; }
.gm-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; max-width: 520px; margin: 0 auto; }
.gm .gm-swatch { --b-bd: #fff; --b-bw: 3px; aspect-ratio: 1; min-height: 44px; width: 100%; padding: 0; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.gm .gm-swatch.is-selected { box-shadow: 0 0 0 3px var(--gm-ink); transform: scale(1.08); }
.gm-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.gm-print-sheet { display: none; }

/* ---------- Xylophone ---------- */
.gm-xylo {
    display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 10px; margin: 8px 0;
    background: linear-gradient(180deg, #8D5A2B, #6B421E); border-radius: 22px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2);
}
.gm .gm-key {
    --b-bw: 0; flex: 1 1 0; min-width: 0; min-height: 0; border-radius: 12px; padding: 0 0 10px; position: relative;
    align-items: flex-end; font-size: clamp(16px, 4.6vw, 22px); font-weight: 900;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 4px 0 rgba(0, 0, 0, .25); transition: transform .08s ease, filter .08s ease;
}
.gm-key::before, .gm-key::after { content: ""; position: absolute; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.gm-key::before { top: 10px; }
.gm-key::after { bottom: 40px; }
.gm .gm-key.is-playing { transform: translateY(3px) scale(.97); filter: brightness(1.18); }
.gm .gm-key.is-next { animation: gm-glow 1s ease infinite; outline: 4px solid #fff; outline-offset: 2px; }
.gm .gm-key:focus-visible { outline: 4px solid var(--gm-indigo); outline-offset: 3px; z-index: 2; }
.gm .gm-key.is-next:focus-visible { outline-color: #fff; box-shadow: 0 0 0 7px var(--gm-indigo); }
@media (max-width: 420px) { .gm-xylo { gap: 3px; padding: 14px 4px; margin-left: -4px; margin-right: -4px; } }
.gm-notes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 10px; }
.gm-notes span { min-width: 30px; padding: 4px 6px; border-radius: 8px; background: #fff; border: 1px solid var(--gm-warm-line); font-size: 14px; font-weight: 800; text-align: center; color: var(--gm-ink-2); }
.gm-notes span.is-high { text-decoration: overline; }
.gm-notes span.is-done { background: var(--gm-mint); border-color: var(--gm-mint); color: var(--gm-ink); }
.gm-notes span.is-now { background: var(--gm-sun); border-color: var(--gm-sun); color: var(--gm-ink); }

/* ---------- Maze game ---------- */
.gm-maze-board {
    position: relative; width: min(100%, 440px); aspect-ratio: 1; margin: 0 auto; border-radius: 16px; overflow: hidden;
    background: #FFFDF6; box-shadow: 0 0 0 3px #0B4F5B inset; touch-action: none; cursor: pointer;
}
.gm-maze-board canvas { display: block; }
.gm-maze-board:focus-visible { outline: 3px solid var(--gm-indigo); outline-offset: 3px; }
.gm-maze-bunny, .gm-maze-carrot { position: absolute; left: 0; top: 0; pointer-events: none; object-fit: contain; }
.gm-maze-bunny { transition: transform .12s ease; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.gm-maze-pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 8px; justify-content: center; margin-top: 14px; }
.gm .gm-maze-arrow { width: 56px; min-height: 56px; padding: 0; font-size: 24px; border-radius: 16px; }
.gm-maze-pad .gm-maze-arrow:nth-child(1) { grid-column: 2; grid-row: 1; }
.gm-maze-pad .gm-maze-arrow:nth-child(2) { grid-column: 1; grid-row: 2; }
.gm-maze-pad .gm-maze-arrow:nth-child(3) { grid-column: 2; grid-row: 2; }
.gm-maze-pad .gm-maze-arrow:nth-child(4) { grid-column: 3; grid-row: 2; }
.gm-maze-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 12px; }
.gm-maze-steps { margin: 0; font-weight: 800; font-size: 15px; color: var(--gm-ink-2); }

/* ---------- Tic tac toe ---------- */
.gm-ttt-status { min-height: 46px; display: flex; justify-content: center; align-items: center; margin-bottom: 8px; }
.gm-ttt-turn { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; line-height: 1.2; padding: 6px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--gm-warm-line); }
.gm-ttt-turn.is-x { color: var(--gm-coral-dark); border-color: #FFC9B8; }
.gm-ttt-turn.is-o { color: #0B6E66; border-color: #A8E3DD; }
.gm-ttt-turn img { width: 30px; height: 30px; }
.gm-ttt-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 360px); margin: 0 auto; }
.gm-ttt-board.is-waiting .gm-ttt-cell { cursor: wait; }
.gm .gm-ttt-cell { --b-bd: var(--gm-warm-line); aspect-ratio: 1; min-height: 0; padding: 6%; border-radius: 20px; box-shadow: 0 5px 0 #F3D9C4; display: block; }
.gm .gm-ttt-cell:disabled { cursor: default; }
.gm .gm-ttt-cell.is-win, .gm .gm-ttt-cell.is-win:hover { --b-bg: #E4F9EF; --b-bd: var(--gm-mint); box-shadow: 0 5px 0 var(--gm-mint); }
.gm-ttt-mark { display: block; width: 100%; height: 100%; fill: none; stroke-width: 13; stroke-linecap: round; }
.gm-ttt-mark.is-x { stroke: var(--gm-coral); }
.gm-ttt-mark.is-o { stroke: var(--gm-teal); }
.gm-ttt-mark path, .gm-ttt-mark circle { stroke-dasharray: 180; stroke-dashoffset: 180; animation: gm-draw .35s ease forwards; }
.gm-ttt-mark path + path { animation-delay: .12s; }
@keyframes gm-draw { to { stroke-dashoffset: 0; } }
.gm-ttt-score { text-align: center; font-weight: 800; font-size: 16px; color: var(--gm-ink-2); margin: 14px 0 0; }
.gm-ttt-end { display: grid; justify-items: center; gap: 10px; margin-top: 8px; }
.gm-ttt-end .gm-feedback { margin: 4px 0 0; }

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
    .gm *, .gm *::before, .gm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .gm-tile:hover, .gm-tile:focus-within, .gm a.gm-mini:hover { transform: none; }
    .gm-ttt-mark path, .gm-ttt-mark circle { stroke-dashoffset: 0; }
}

@media print {
    body.gm-printing > *:not(.gm-print-sheet) { display: none !important; }
    body.gm-printing .gm-print-sheet { display: block !important; width: 100%; margin: 0; padding: 0; color: #000; background: #fff; }
    body.gm-printing .gm-print-sheet svg { display: block; width: 100%; max-width: 680px; height: auto; margin: 0 auto; }
    body.gm-printing .gm-print-sheet p { text-align: center; font: 14px/1.4 Arial, sans-serif; margin: 12px 0 0; }
    body.gm-printing { background: #fff !important; }
}
