/* Subject games: shell, shared widgets and per-game layouts. All classes use the g- prefix (gl- for the game list). */

/* ---- game list on /module ---------------------------------------------------- */
.gl-main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }
.gl-head { display: flex; align-items: center; gap: 18px; margin: 12px 0 24px; }
.gl-head img { width: 84px; height: 84px; border-radius: 20px; }
.gl-head h1 { margin: 0 0 6px; font-size: 28px; }
.gl-head p { margin: 0; color: #5b6475; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gl-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(40, 60, 110, .08); border: 1px solid #eef1f7; }
.gl-card .gl-emoji { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(160deg, #fff, #f3f8ff); box-shadow: inset 0 0 0 1px #e2ebf5, 0 6px 0 #e7eef8; font-size: 34px; line-height: 1; }
.gl-card h2 { margin: 0; font-size: 18px; }
.gl-card p { margin: 0; color: #5b6475; font-size: 14px; line-height: 1.5; flex: 1; }
.gl-card .button { align-self: flex-start; }
.gl-card.is-locked { opacity: .92; }
.gl-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef4ff; color: #3d6fd8; align-self: flex-start; }
.gl-card.is-locked .gl-tag { background: #fff4e0; color: #b7791f; }
.gl-note { margin-top: 24px; color: #7a8394; font-size: 14px; }

/* ---- shell ----------------------------------------------------------------------- */
.g-stage { max-width: 1280px; margin: 0 auto; padding: 12px 16px 32px; }
.g-pack-main { padding: 0; min-height: 0; }
.g-pack { display: flex; flex-direction: column; height: calc(100vh - 74px); background: #f4f7fb; }
.g-pack-bar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #e2ebf5; }
.g-pack-bar a { color: #326fcc; font-weight: 700; text-decoration: none; }
.g-pack iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.g-shell {
  --g-accent: #4b87e7; --g-accent-soft: #e8f0ff; --g-ink: #203654;
  --g-sky: #d7ebff; --g-sky-2: #f4f9ff;
  position: relative; display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 600px;
  border-radius: 28px; overflow: hidden; color: var(--g-ink); user-select: none; -webkit-user-select: none;
  font-size: 18px;
  background:
    radial-gradient(circle at 8% 18%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 16% 30%, rgba(255, 255, 255, .9) 0 1.5px, transparent 2px),
    radial-gradient(circle at 88% 14%, #fff 0 2px, transparent 3px),
    radial-gradient(ellipse 70% 40% at 50% -8%, rgba(255, 255, 255, .75), transparent 70%),
    linear-gradient(165deg, var(--g-sky), var(--g-sky-2) 55%, #fff 100%);
  box-shadow: 0 16px 40px rgba(50, 90, 140, .14), inset 0 0 0 3px rgba(255, 255, 255, .7);
}
.g-shell:fullscreen { height: 100vh; border-radius: 0; }
.g-theme-chinese { --g-accent: #e85d9a; --g-accent-soft: #ffe8f2; --g-sky: #ffd6ea; --g-sky-2: #fff5fa; }
.g-theme-math { --g-accent: #e8962a; --g-accent-soft: #fff1da; --g-sky: #ffe3b8; --g-sky-2: #fff8ec; }
.g-title, .g-panel h2, .g-quiz-prompt, .g-q-prompt, .g-kwd-word, .g-letter-big, .g-syllable, .g-contest-q, .g-flower-heart, .g-beat-card b, .g-beat-sentence, .g-fruit-prompt, .g-level { font-family: var(--font-display, "YouYuan", "幼圆", sans-serif); }
:where(.g-shell) button { font: inherit; cursor: pointer; }
:where(.g-shell) input, :where(.g-shell) textarea { user-select: text; -webkit-user-select: text; }

.g-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255, 255, 255, .72); border-bottom: 1px solid rgba(255, 255, 255, .85); backdrop-filter: blur(12px); flex-wrap: wrap; }
.g-back { color: var(--g-accent); font-weight: 700; text-decoration: none; font-size: 15px; white-space: nowrap; }
.g-title { margin: 0; font-size: 24px; display: flex; gap: 8px; align-items: center; white-space: nowrap; letter-spacing: .5px; }
.g-hud { display: flex; gap: 8px; flex: 1; justify-content: center; flex-wrap: wrap; }
.g-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 14px; border-radius: 99px; background: #fff; border: 2px solid var(--g-accent-soft); box-shadow: 0 3px 0 rgba(40, 70, 120, .06); font-size: 14px; }
.g-chip small { color: #66708a; font-size: 13px; }
.g-chip b { font-size: 17px; }
.g-chip.red { background: #ffe5e3; } .g-chip.blue { background: #e3eeff; } .g-chip.green { background: #e2f8e9; } .g-chip.gold { background: #fff3cf; }
.g-chip.is-active { outline: 3px solid currentColor; outline-offset: -1px; }
.g-chip.red.is-active { color: #d93a32; } .g-chip.blue.is-active { color: #2f6fd8; } .g-chip.green.is-active { color: #23964b; } .g-chip.gold.is-active { color: #c58a00; }
.g-chip.is-warn { background: #ffe1e1; color: #c62828; }
.g-bar-actions { display: flex; gap: 6px; }
.g-bar-actions button { border: 0; background: #fff; color: #36405a; border-radius: 12px; padding: 7px 12px; font-size: 14px; box-shadow: 0 3px 0 var(--g-accent-soft); }
.g-bar-actions button:hover { filter: brightness(.96); }

.g-body { position: relative; flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; }
.g-body > * { flex: 1; }
.g-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(30, 40, 70, .45); overflow: auto; }
.g-overlay[hidden] { display: none; }
.g-panel { width: min(620px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(#fff, #f8fbff); border-radius: 28px; padding: 28px 30px 26px; border: 4px solid #fff; box-shadow: 0 24px 60px rgba(24, 40, 80, .28), 0 0 0 8px rgba(255, 255, 255, .18); text-align: center; animation: g-pop-in .25s ease-out; }
.g-panel h2 { margin: 6px 0 12px; font-size: 26px; }
.g-panel-emoji { font-size: 56px; line-height: 1.1; }
.g-rules { text-align: left; margin: 0 auto 14px; padding-left: 22px; line-height: 1.7; font-size: 16px; color: #3d4762; }
.g-option { border: 0; margin: 10px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.g-option legend { float: left; margin-right: 8px; font-weight: 600; font-size: 15px; color: #56607a; }
.g-option label { position: relative; }
.g-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.g-option span { display: inline-block; padding: 6px 14px; border-radius: 99px; background: #f1f3f8; font-size: 15px; }
.g-option input:checked + span { background: var(--g-accent); color: #fff; }
.g-option input:focus-visible + span { outline: 3px solid #26304a; }
.g-checks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.g-checks label { display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 10px; background: #f1f3f8; font-size: 15px; }
.g-textarea { width: 100%; box-sizing: border-box; border: 1px solid #d8dde8; border-radius: 12px; padding: 10px; font: inherit; font-size: 15px; resize: vertical; }
.g-note { color: #6d7690; font-size: 14px; margin: 8px 0; }
.g-end-line { font-size: 18px; margin: 6px 0; color: #3d4762; }
.g-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 10px 20px; background: #eef1f7; color: #26304a; font-weight: 600; font-size: 16px; text-decoration: none; transition: transform .1s; }
.g-btn:hover { filter: brightness(.97); }
.g-btn:active { transform: scale(.97); }
.g-btn:disabled { opacity: .45; cursor: not-allowed; }
.g-btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--g-accent) 78%, #fff), var(--g-accent)); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--g-accent) 70%, #000); }
.g-btn-big { font-size: 20px; padding: 14px 28px; border-radius: 18px; }
.g-btn.team-red { background: #ffe1df; color: #c8302a; } .g-btn.team-blue { background: #dfeaff; color: #2b62c6; }
.g-btn.team-green { background: #dcf6e4; color: #1f8443; } .g-btn.team-gold { background: #fff0c2; color: #a87400; }
.g-message { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 40; background: rgba(38, 48, 74, .92); color: #fff; padding: 10px 22px; border-radius: 99px; font-size: 18px; pointer-events: none; animation: g-msg 1.4s ease forwards; white-space: nowrap; }
.g-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.g-confetti i { position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 2px; animation: g-fall linear forwards; }

/* ---- common bits ------------------------------------------------------------------- */
.g-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.g-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 24px; align-items: center; }
.g-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.g-banner { padding: 10px 16px; border-radius: 14px; background: #fff; font-weight: 700; text-align: center; font-size: 18px; box-shadow: 0 3px 10px rgba(0, 0, 0, .05); }
.g-banner.red { background: #ffe5e3; color: #c8302a; } .g-banner.blue { background: #e3eeff; color: #2b62c6; }
.g-banner.green { background: #dcf6e4; color: #1f8443; } .g-banner.gold { background: #fff0c2; color: #a87400; }
.g-banner.dark { background: #3b2a5c; color: #fff; }
.g-level { font-size: 20px; font-weight: 700; color: var(--g-accent); }
.g-tip { min-height: 1.6em; font-size: 18px; margin: 0; }
.g-tip.is-right { color: #23964b; } .g-tip.is-wrong { color: #c62828; }
.g-feedback { min-height: 1.5em; font-size: 20px; margin: 0; }
.g-answer-form { display: flex; gap: 10px; }
.g-input { font: inherit; font-size: 28px; padding: 10px 16px; border-radius: 14px; border: 2px solid #d5dbe8; width: min(360px, 60vw); text-align: center; letter-spacing: 2px; }
.g-input:focus { outline: none; border-color: var(--g-accent); }
.g-input.is-right { border-color: #35c46a; background: #effcf3; }
.g-input.is-wrong { border-color: #e5534b; background: #fff1f0; }
.g-big-btn { border: 0; background: var(--g-accent); color: #fff; font-size: 22px; padding: 16px 32px; border-radius: 20px; box-shadow: 0 5px 0 rgba(0, 0, 0, .15); }
.g-blanks { font-size: 34px; letter-spacing: 6px; font-family: ui-monospace, Consolas, monospace; color: #66708a; }

/* quiz panel */
.g-quiz { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto; }
.g-quiz.is-disabled, .is-disabled > .g-quiz { opacity: .45; pointer-events: none; }
.g-quiz-label { font-weight: 700; font-size: 16px; text-align: center; }
.g-quiz-prompt { font-size: clamp(26px, 4vw, 46px); font-weight: 800; text-align: center; padding: 18px 20px; border-radius: 24px; background: linear-gradient(#fff, #f7fbff); border: 3px solid #fff; box-shadow: 0 8px 0 rgba(75, 135, 231, .1), 0 14px 28px rgba(40, 70, 120, .08); word-break: break-word; letter-spacing: 1px; }
.g-quiz-sub { text-align: center; font-size: 22px; color: #66708a; min-height: 1.2em; }
.g-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-opt { display: flex; align-items: center; gap: 10px; border: 3px solid #fff; border-radius: 18px; padding: 14px 16px; background: linear-gradient(#fff, #f4f8fd); box-shadow: 0 6px 0 #d5e2f2; font-size: 22px; font-weight: 700; text-align: left; min-height: 64px; transition: transform .1s; }
.g-opt:hover { transform: translateY(-2px); }
.g-opt kbd { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--g-accent-soft); font-size: 14px; font-family: inherit; color: #56607a; }
.g-opt span { flex: 1; word-break: break-word; }
.g-opt.is-right { background: #35c46a; color: #fff; box-shadow: 0 4px 0 #23964b; }
.g-opt.is-wrong { background: #e5534b; color: #fff; box-shadow: 0 4px 0 #b3362f; }
.g-quiz.compact .g-quiz-prompt { font-size: clamp(22px, 3vw, 34px); padding: 12px; }
.g-quiz.compact .g-opt { font-size: 19px; min-height: 52px; padding: 10px 12px; }

/* animations */
.g-shake { animation: g-shake .4s; }
.g-quake { animation: g-quake .45s; }
.g-hop { animation: g-hop .4s; }
.g-pop { animation: g-pop-in .3s; }
.g-wobble { animation: g-wobble .7s; }
@keyframes g-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes g-quake { 0%, 100% { transform: translate(0); } 25% { transform: translate(-6px, 3px); } 50% { transform: translate(6px, -3px); } 75% { transform: translate(-3px, 2px); } }
@keyframes g-hop { 50% { transform: translateY(-14px) scale(1.1); } }
@keyframes g-pop-in { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes g-wobble { 25% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-2deg); } }
@keyframes g-msg { 0% { opacity: 0; transform: translate(-50%, 10px); } 15%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
@keyframes g-fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes g-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }

/* ---- pairs ---------------------------------------------------------------------------- */
.g-pairs { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; max-width: 920px; width: 100%; margin: auto; align-content: center; }
.g-card { position: relative; border: 0; border-radius: 16px; min-height: 86px; background: #fff; box-shadow: 0 5px 0 #dde3ee; font-size: 22px; font-weight: 700; padding: 10px; transition: transform .15s, opacity .3s; }
.g-card.side-b { background: #fffdf3; }
.g-card.is-selected { outline: 4px solid var(--g-accent); transform: translateY(-3px); }
.g-card.is-matched { background: #35c46a; color: #fff; box-shadow: none; opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .5s .2s, transform .5s .2s; }
.g-pairs.face-down .g-card.is-matched { opacity: .55; transform: none; }
.g-card-back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--g-accent), #ffb44a); color: #fff; font-size: 34px; transition: opacity .2s; }
.g-card.is-open .g-card-back, .g-card.is-matched .g-card-back { opacity: 0; }
.g-card.is-wrong { background: #ffe3e1; }

/* ---- witch ---------------------------------------------------------------------------- */
.g-witch { display: flex; flex-direction: column; gap: 14px; }
.g-witch-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; flex: 1; align-content: center; }
.g-witch-card { position: relative; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 #d9cdef; padding: 14px 8px; min-height: 84px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.g-witch-card b { font-size: 26px; }
.g-witch-card small { color: #7b6d99; font-size: 15px; }
.g-witch-card.is-poisoned-pick { outline: 3px dashed #8b5cf6; }
.g-witch-card.is-safe { opacity: .8; }
.g-witch-card.team-red { background: #ffe5e3; } .g-witch-card.team-blue { background: #e3eeff; } .g-witch-card.team-green { background: #dcf6e4; } .g-witch-card.team-gold { background: #fff0c2; }
.g-witch-card.is-poison { background: #3b2a5c; color: #fff; }
.g-witch-card.is-poison small { color: #d6c8f2; }
.g-witch-mark { position: absolute; top: 6px; right: 10px; font-size: 20px; }
.g-witch-actions { display: flex; justify-content: center; }

/* ---- fruit ------------------------------------------------------------------------------ */
.g-fruit { display: flex; flex-direction: column; gap: 10px; }
.g-fruit-prompt { text-align: center; font-size: clamp(24px, 3.4vw, 38px); font-weight: 800; }
.g-fruit-arena { position: relative; flex: 1; min-height: 380px; border-radius: 28px; overflow: hidden; touch-action: none; background: radial-gradient(circle at 18% 22%, #fff 0 22px, transparent 23px), radial-gradient(circle at 22% 26%, #fff 0 12px, transparent 13px), radial-gradient(circle at 78% 16%, #fff 0 30px, transparent 31px), linear-gradient(#79c8ff 0 58%, #bfe8ff 58% 64%, #8fd36f 64% 80%, #5aaa42 80%); box-shadow: inset 0 -30px 0 rgba(40, 110, 30, .12), inset 0 0 0 5px rgba(255, 255, 255, .35); }
.g-fruit-item { position: absolute; transform: translate(-50%, 50%); border: 0; background: none; display: flex; flex-direction: column; align-items: center; color: #203654; }
.g-fruit-emoji { font-size: 84px; line-height: 1; filter: drop-shadow(0 10px 0 rgba(40, 80, 20, .12)); }
.g-fruit-label { margin-top: -8px; padding: 3px 14px; border-radius: 99px; background: #fff; font-size: 22px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 0 rgba(40, 70, 30, .15); }
.g-fruit-item.is-sliced .g-fruit-emoji { animation: g-slice .45s forwards; }
.g-fruit-item.is-fading { opacity: 0; transition: opacity .3s; }
.g-fruit-item.is-bad { filter: grayscale(1); opacity: .5; }
@keyframes g-slice { to { transform: scale(1.5) rotate(40deg); opacity: 0; } }

/* ---- police chase ------------------------------------------------------------------------ */
.g-chase { display: flex; flex-direction: column; gap: 20px; }
.g-track { position: relative; height: 110px; flex: none; border-radius: 20px; background: #9ad17f; overflow: hidden; }
.g-track-road { position: absolute; left: 0; right: 0; top: 40px; height: 44px; background: #646b7a; border-top: 4px solid #fff; border-bottom: 4px solid #fff; }
.g-runner { position: absolute; top: 26px; font-size: 52px; transition: left .5s ease; transform: scaleX(-1); }
.g-runner.thief { z-index: 2; }
.g-track-goal { position: absolute; right: 10px; top: 10px; font-size: 52px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.g-track-goal small { font-size: 13px; background: #fff; padding: 2px 6px; border-radius: 6px; }

/* ---- wheel --------------------------------------------------------------------------------- */
.g-wheel { position: relative; width: min(380px, 70vw); aspect-ratio: 1; }
.g-wheel-pointer { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); z-index: 2; color: #e5534b; font-size: 36px; text-shadow: 0 2px 0 #fff; }
.g-wheel-disc { width: 100%; height: 100%; transition: transform 3.8s cubic-bezier(.15, .7, .2, 1); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .15)); }
.g-wheel-disc text { font-weight: 800; fill: #26304a; font-family: inherit; }
.g-wheel-hub { fill: #fff; stroke: #26304a; stroke-width: 2; }
.g-wheel-game .g-center .g-wheel { width: min(420px, 60vw); }

/* ---- duel ------------------------------------------------------------------------------------ */
.g-duel { display: grid; grid-template-columns: 1fr minmax(220px, .9fr) 1fr; gap: 18px; align-items: center; }
.g-duel.is-single { grid-template-columns: 1fr 1.1fr; }
.g-duel-side { padding: 16px; border-radius: 22px; min-width: 0; }
.g-duel-side.red { background: rgba(255, 90, 80, .1); }
.g-duel-side.blue { background: rgba(60, 130, 250, .1); }
.g-duel-side .g-quiz-options { grid-template-columns: 1fr; }
.g-duel.is-single .g-duel-side .g-quiz-options { grid-template-columns: 1fr 1fr; }
.g-duel-mid { min-width: 0; }

/* ---- gomoku ------------------------------------------------------------------------------------ */
.g-go-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 560px); aspect-ratio: 1; margin: auto; padding: 14px; border-radius: 10px; background: repeating-linear-gradient(90deg, rgba(120, 72, 24, .05) 0 2px, transparent 2px 14px), linear-gradient(145deg, #f8e4b8, #e8c27c 42%, #d9aa5e); border: 12px solid #c48945; box-shadow: inset 0 0 0 3px #f6e4bc, 0 14px 0 #a86c30, 0 22px 30px rgba(90, 50, 10, .18); }
.g-go-cell { position: relative; border: 0; background: none; padding: 0; }
.g-go-cell::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #8a6230; }
.g-go-cell::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid #8a6230; }
.g-go-board.is-active .g-go-cell:hover::before { border-top-width: 3px; }
.g-go-board:not(.is-active) .g-go-cell { cursor: default; }
.g-stone { position: absolute; inset: 8%; border-radius: 50%; z-index: 1; animation: g-pop-in .2s; }
.g-stone.red { background: radial-gradient(circle at 35% 30%, #ff9a8f, #d6352b); }
.g-stone.blue { background: radial-gradient(circle at 35% 30%, #9cc2ff, #2b62c6); }
.g-go-cell.is-win .g-stone { box-shadow: 0 0 0 4px #fff, 0 0 12px 6px #ffd54f; }

/* ---- beat ---------------------------------------------------------------------------------------- */
.g-beat { position: relative; }
.g-beat-stage { min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; width: 100%; }
.g-beat-pulse { width: 26px; height: 26px; border-radius: 50%; background: var(--g-accent); }
.g-beat-pulse.is-on { animation: g-pulse .45s ease-out; }
.g-beat-count { font-size: 140px; font-weight: 900; color: var(--g-accent); animation: g-pop-in .3s; }
.g-beat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 1000px; }
.g-beat-card { background: linear-gradient(#fff, #f5f9ff); border-radius: 26px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 3px solid #fff; box-shadow: 0 8px 0 #d5e2f2; transition: transform .12s, background .12s; }
.g-beat-card b { font-size: clamp(26px, 3.6vw, 44px); }
.g-beat-card small { color: #66708a; font-size: 18px; }
.g-beat-emoji { font-size: 52px; }
.g-beat-card.is-lit { background: var(--g-accent); color: #fff; transform: scale(1.12); }
.g-beat-card.is-lit small { color: #fff; }
.g-beat-card.is-done { opacity: .5; }
.g-beat-sentence { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: clamp(32px, 5vw, 60px); font-weight: 800; }
.g-beat-sentence span { padding: 4px 14px; border-radius: 14px; transition: transform .12s, background .12s; }
.g-beat-sentence span.is-lit { background: var(--g-accent); color: #fff; transform: scale(1.15); }
.g-beat-sentence span.is-done { color: #8a93a8; }
.g-beat-zh { font-size: 28px; color: #56607a; min-height: 1.3em; }

/* ---- choubei ---------------------------------------------------------------------------------------- */
.g-choubei { display: grid; grid-template-columns: 140px 1fr 140px; gap: 20px; align-items: center; }
.g-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 10px; border-radius: 20px; background: #fff; box-shadow: 0 6px 0 #dde3ee; }
.g-pile b { font-size: 46px; }
.g-pile.known b { color: #23964b; } .g-pile.practice b { color: #e8962a; }
.g-flashcard { width: min(460px, 80vw); aspect-ratio: 3 / 2; border: 0; border-radius: 28px; background: #fff; box-shadow: 0 10px 0 #dde3ee; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: clamp(36px, 6vw, 72px); font-weight: 800; transition: transform .3s; }
.g-flashcard small { font-size: 30px; color: var(--g-accent); min-height: 1.2em; }
.g-flashcard.is-back { background: repeating-linear-gradient(45deg, var(--g-accent), var(--g-accent) 14px, #6aa0f0 14px, #6aa0f0 28px); color: #fff; font-size: 30px; }
.g-flashcard.is-flip { transform: rotateY(90deg); }

/* ---- spelling ----------------------------------------------------------------------------------------- */
.g-spell-pic { font-size: 96px; line-height: 1; }
.g-slots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.g-slot { width: 58px; height: 68px; border: 0; border-radius: 14px; background: #fff; border-bottom: 4px solid #cfd6e4; font-size: 34px; font-weight: 800; display: grid; place-items: center; }
.g-slot.is-filled { background: var(--g-accent-soft); }
.g-slot.is-reveal { color: #e5534b; }
.g-slots.is-right .g-slot, .g-slot.is-right { background: #35c46a; color: #fff; border-color: #23964b; }
.g-tiles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 760px; }
.g-tile { width: 60px; height: 60px; border: 0; border-radius: 14px; background: var(--g-accent); color: #fff; font-size: 30px; font-weight: 800; box-shadow: 0 5px 0 rgba(0, 0, 0, .18); }
.g-tile.big { width: 76px; height: 76px; font-size: 38px; }
.g-tile.is-used { opacity: .2; }

/* ---- meteor ---------------------------------------------------------------------------------------------- */
.g-sky { position: relative; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 12% 18%, #fff 0 1.4px, transparent 2px), radial-gradient(circle at 28% 36%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 46% 14%, #fff 0 1.6px, transparent 2.2px), radial-gradient(circle at 70% 28%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 86% 12%, #fff 0 1.8px, transparent 2.4px), radial-gradient(circle at 62% 52%, #fff 0 1px, transparent 1.6px), radial-gradient(ellipse at top, #3d55a8, #0c1230 72%); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .08); }
.g-sky-field { position: relative; flex: 1; min-height: 380px; }
.g-meteor { position: absolute; transform: translate(-50%, 0); border: 0; padding: 12px 20px; border-radius: 40px 40px 40px 12px; background: linear-gradient(135deg, #ffb74d, #ff7043); color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 0 24px 6px rgba(255, 152, 0, .45); white-space: nowrap; }
.g-meteor.is-hit { animation: g-boom .4s forwards; }
.g-meteor.is-wrong { background: #6b6f82; box-shadow: none; }
.g-meteor.is-landed { background: #e5534b; }
@keyframes g-boom { to { transform: translate(-50%, 0) scale(1.8); opacity: 0; } }
.g-sky-ground { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; background: #3c2f5c; color: #fff; font-size: 20px; }
.g-sky-ground b { font-size: 30px; }

/* ---- pk rope ------------------------------------------------------------------------------------------------ */
.g-rope-area { display: flex; flex-direction: column; gap: 10px; }
.g-rope { position: relative; height: 18px; border-radius: 9px; background: repeating-linear-gradient(90deg, #c8a06a, #c8a06a 10px, #a57d48 10px, #a57d48 20px); }
.g-rope-knot { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 40px; transition: left .4s ease; }
.g-rope-ends { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }
.g-rope-marks { position: relative; height: 8px; }
.g-rope-marks span { position: absolute; top: 0; width: 4px; height: 20px; margin-top: -36px; }
.g-rope-marks .red { left: 10%; background: #e5534b; } .g-rope-marks .blue { right: 10%; background: #3d8bfd; }

/* ---- train ------------------------------------------------------------------------------------------------------ */
.g-train-track { width: 100%; overflow: hidden; padding: 10px 0 14px; border-bottom: 6px solid #8a6230; }
.g-train { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; min-height: 72px; transition: transform 1.4s ease-in; }
.g-train.is-leaving { transform: translateX(110%); }
.g-engine { font-size: 60px; line-height: 1; transform: scaleX(-1); }
.g-car { border: 0; padding: 12px 16px; border-radius: 12px 12px 6px 6px; background: #3d8bfd; color: #fff; font-size: 22px; font-weight: 700; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18); }
.g-car.on-platform { background: #ffb44a; }
.g-car.is-wrong { background: #e5534b; }
.g-platform { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 60px; }

/* ---- link ---------------------------------------------------------------------------------------------------------- */
.g-link { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 120px; max-width: 900px; margin: auto; width: 100%; }
.g-link-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.g-link-lines line { stroke-width: 5; stroke-linecap: round; }
.g-link-lines line.ok { stroke: #35c46a; }
.g-link-lines line.bad { stroke: #e5534b; stroke-dasharray: 8 6; }
.g-link-col { display: flex; flex-direction: column; gap: 12px; }
.g-link-item { border: 0; border-radius: 14px; padding: 14px; background: #fff; box-shadow: 0 4px 0 #dde3ee; font-size: 22px; font-weight: 700; }
.g-link-item.is-selected { outline: 4px solid var(--g-accent); }
.g-link-item.is-done { background: #e2f8e9; color: #23964b; box-shadow: none; }

/* ---- qiangda ---------------------------------------------------------------------------------------------------------- */
.g-qiangda { display: flex; flex-direction: column; gap: 18px; }
.g-q-card { flex: 1; min-height: 200px; border-radius: 26px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .06); }
.g-q-card.is-live { animation: g-pop-in .25s; }
.g-q-prompt { font-size: clamp(40px, 7vw, 84px); font-weight: 900; }
.g-q-answer { font-size: 32px; color: #23964b; min-height: 1.2em; }
.g-judge { display: flex; gap: 12px; justify-content: center; align-items: center; min-height: 50px; flex-wrap: wrap; }
.g-judge-who { font-weight: 800; font-size: 20px; }
.g-judge-who.red { color: #c8302a; } .g-judge-who.blue { color: #2b62c6; } .g-judge-who.green { color: #1f8443; } .g-judge-who.gold { color: #a87400; }
.g-buzzers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.g-buzzer { border: 0; width: 160px; height: 110px; border-radius: 24px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 8px 0 rgba(0, 0, 0, .2); }
.g-buzzer b { font-size: 26px; }
.g-buzzer:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.g-buzzer.red { background: #e5534b; } .g-buzzer.blue { background: #3d8bfd; } .g-buzzer.green { background: #35c46a; } .g-buzzer.gold { background: #f2b01e; }
.g-buzzer.is-first { outline: 6px solid #ffd54f; transform: scale(1.06); }
.g-buzzer.is-out { opacity: .35; }

/* ---- kuaiwenda ------------------------------------------------------------------------------------------------------------ */
.g-kwd-word { font-size: clamp(48px, 9vw, 110px); font-weight: 900; }
.g-kwd-answer { font-size: 28px; color: #66708a; min-height: 1.3em; }

/* ---- flower (bloom, garden) ------------------------------------------------------------------------------------------------ */
.g-garden, .g-bloom-game { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 16% 14%, #fff 0 20px, transparent 21px), radial-gradient(circle at 20% 18%, #fff 0 11px, transparent 12px), radial-gradient(circle at 82% 12%, #fff 0 26px, transparent 27px), radial-gradient(circle at 76% 16%, #fff 0 12px, transparent 13px), linear-gradient(#8fd4ff 0 56%, #9adf78 56% 70%, #62b84a 70%); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .4); padding: 18px 12px 24px; }
.g-garden::before, .g-bloom-game::before { content: ""; position: absolute; left: -6%; right: -6%; bottom: 0; height: 32%; background: radial-gradient(ellipse 16% 70% at 10% 100%, #95e484 0 68%, transparent 69%), radial-gradient(ellipse 20% 90% at 38% 115%, #6bc456 0 68%, transparent 69%), radial-gradient(ellipse 18% 80% at 72% 105%, #8edc74 0 68%, transparent 69%), radial-gradient(ellipse 14% 60% at 92% 100%, #57b043 0 68%, transparent 69%); pointer-events: none; }
.g-flower { position: relative; z-index: 1; width: min(420px, 80vw); aspect-ratio: 1; }
.g-flower.big { width: min(480px, 84vw); }
.g-flower::before { content: ""; position: absolute; left: 50%; top: 64%; width: 18px; height: 30%; margin-left: -9px; border-radius: 12px; background: linear-gradient(#46c15a, #267a34); z-index: 0; }
.g-flower::after { content: ""; position: absolute; left: 58%; top: 72%; width: 78px; height: 38px; background: linear-gradient(#7adf6a, #3aaa48); border-radius: 0 90% 10% 90%; transform: rotate(-16deg); z-index: 0; }
.g-petal { position: absolute; z-index: 1; left: 50%; top: 50%; width: 34%; height: 36%; margin: -18% 0 0 -17%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 72% 72% 68% 68% / 82% 82% 42% 42%; background: radial-gradient(circle at 34% 28%, #fff 0 9%, transparent 10%), linear-gradient(165deg, #ffd4e8, #ff7eb0 52%, #ef4d8c); transform: rotate(var(--a)) translateY(-108%) rotate(calc(-1 * var(--a))); font-size: 36px; font-weight: 800; color: #9a2158; text-shadow: 0 1px 0 #fff; box-shadow: 0 8px 0 rgba(180, 40, 90, .16), inset 0 -8px 0 rgba(160, 20, 70, .08); transition: background .2s, opacity .3s, transform .2s; }
.g-theme-english .g-petal { background: radial-gradient(circle at 34% 28%, #fff 0 9%, transparent 10%), linear-gradient(165deg, #e7f0ff, #8eb6ff 52%, #4d86ef); color: #1d4e9a; box-shadow: 0 8px 0 rgba(40, 90, 180, .16); }
.g-petal.is-wilted { background: linear-gradient(#d9d3c8, #b7b0a4); color: #6e685e; text-shadow: none; box-shadow: none; opacity: .7; }
.g-petal.is-picked { background: radial-gradient(circle at 34% 28%, #fff 0 9%, transparent 10%), linear-gradient(165deg, #b6f0c4, #3ec56a); color: #fff; text-shadow: none; box-shadow: 0 8px 0 #23964b; }
.g-flower-heart { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 36%; padding: 12px 16px; border-radius: 999px; background: radial-gradient(circle at 38% 32%, #fff6c4, #ffc83d 46%, #f09a12); border: 6px solid #fff6d0; box-shadow: 0 8px 0 #e09a18, 0 0 0 8px rgba(255, 214, 90, .35); font-size: 44px; font-weight: 900; color: #8a4b00; display: flex; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; }
.g-flower.big .g-flower-heart { width: 38%; aspect-ratio: 1; min-width: 0; padding: 8px; border-radius: 50%; font-size: 56px; }
.g-flower-heart span.gap { color: #c45a12; }
.g-flower-heart span.is-filled { color: #1f8443; }
.g-flower.is-bloom .g-petal { animation: g-bloom .9s ease; }
.g-flower.is-bloom .g-flower-heart { background: radial-gradient(circle at 38% 32%, #d8ffdf, #35c46a); color: #fff; box-shadow: 0 8px 0 #23964b, 0 0 0 10px rgba(53, 196, 106, .35); }
@keyframes g-bloom { 50% { transform: rotate(var(--a)) translateY(-128%) rotate(calc(-1 * var(--a))) scale(1.12); } }
.g-found { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 44px; }
.g-found-word { padding: 6px 16px; border-radius: 99px; background: #fff; border: 2px solid #ffe08a; font-size: 24px; font-weight: 700; box-shadow: 0 4px 0 rgba(180, 120, 20, .12); animation: g-pop-in .3s; }

/* ---- letter wheel ---------------------------------------------------------------------------------------------------------------- */
.g-letter-card { padding: 20px; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 5px 0 #dde3ee; }
.g-letter-big { display: block; font-size: 90px; font-weight: 900; color: var(--g-accent); line-height: 1.1; }
.g-letter-card p { margin: 6px 0 0; font-size: 20px; }
.g-score-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.g-hint-words, .g-example-chars { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-hint-word { border: 0; border-radius: 14px; padding: 8px 14px; background: #fff; box-shadow: 0 3px 0 #dde3ee; font-size: 20px; font-weight: 700; display: flex; flex-direction: column; align-items: center; }
.g-hint-word small { font-weight: 400; font-size: 14px; color: #66708a; }

/* ---- verb castle ------------------------------------------------------------------------------------------------------------------- */
.g-castle-path { display: flex; gap: 30px; }
.g-castle-step { display: flex; flex-direction: column; align-items: center; font-size: 44px; opacity: .35; }
.g-castle-step small { font-size: 14px; }
.g-castle-step.is-current { opacity: 1; transform: scale(1.15); }
.g-castle-step.is-done { opacity: .8; filter: hue-rotate(90deg); }

/* ---- phonics ---------------------------------------------------------------------------------------------------------------------- */
.g-phonics-word { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.g-chunk { border: 0; border-radius: 18px; padding: 10px 18px; font-size: clamp(48px, 8vw, 96px); font-weight: 900; background: #fff; box-shadow: 0 6px 0 #dde3ee; transition: transform .15s; font-family: inherit; }
.g-chunk.vowel, .g-legend .vowel { color: #e5534b; }
.g-chunk.consonant, .g-legend .consonant { color: #2b62c6; }
.g-chunk.team, .g-legend .team { color: #8b5cf6; }
.g-chunk.silent, .g-legend .silent { color: #a3a9b8; }
.g-chunk.is-lit { transform: translateY(-10px) scale(1.12); background: #fff6c8; }
.g-legend { display: flex; gap: 16px; font-weight: 700; font-size: 15px; }

/* ---- pinyin wheels ------------------------------------------------------------------------------------------------------------------- */
.g-pinyin-wheels { display: grid; grid-template-columns: 1fr minmax(220px, .8fr) 1fr; gap: 18px; align-items: center; }
.g-pinyin-wheels h3 { margin: 0; }
.g-pinyin-wheels .g-wheel { width: min(320px, 28vw); }
.g-syllable-card { padding: 20px; border-radius: 24px; background: #fff; box-shadow: 0 5px 0 #f3cfe0; min-height: 240px; }
.g-syllable { font-size: 76px; font-weight: 900; }
.g-syllable .ini { color: #2b62c6; } .g-syllable .fin { color: #e5534b; }
.g-tones { display: flex; gap: 12px; font-size: 32px; font-weight: 700; }

/* ---- adventure path --------------------------------------------------------------------------------------------------------------------- */
.g-path { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; }
.g-path-cell { position: relative; aspect-ratio: 1; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 #f3cfe0; display: flex; align-items: center; justify-content: center; }
.g-path-cell.special { background: #fff7d6; }
.g-path-cell small { position: absolute; left: 8px; top: 4px; color: #a08aa0; font-size: 12px; }
.g-path-mark { font-size: 30px; }
.g-tokens { position: absolute; bottom: 6px; display: flex; gap: 4px; }
.g-token { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.g-token.red { background: #e5534b; } .g-token.blue { background: #3d8bfd; }
.g-dice-area { display: flex; align-items: center; justify-content: center; gap: 16px; }
.g-dice-area[hidden] { display: none; }
.g-dice { font-size: 72px; line-height: 1; }

/* ---- spotter ------------------------------------------------------------------------------------------------------------------------- */
.g-spot-tip { font-size: 22px; font-weight: 700; }
.g-spot { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(100%, 620px, calc(100vh - 300px)); aspect-ratio: 1; }
.g-spot-cell { border: 0; border-radius: 10px; background: #fff; box-shadow: 0 3px 0 #f3cfe0; font-size: clamp(18px, calc(420px / var(--n)), 54px); font-weight: 700; padding: 0; }
.g-spot-cell.is-found { background: #35c46a; color: #fff; transform: scale(1.15); }
.g-spot-cell.is-answer { background: #ffd54f; }

/* ---- character puzzle ----------------------------------------------------------------------------------------------------------------- */
.g-puzzle-eq { display: flex; align-items: center; gap: 14px; font-size: 40px; }
.g-puzzle-eq i { font-style: normal; color: #a08aa0; }
.g-brick { display: grid; place-items: center; width: 110px; height: 110px; border-radius: 22px; background: #fff; box-shadow: 0 6px 0 #f3cfe0; font-size: 66px; font-weight: 800; }
.g-brick.is-empty { background: #fbeef4; color: #c79bb3; }
.g-brick.is-right { background: #35c46a; color: #fff; box-shadow: 0 6px 0 #23964b; }
.g-brick.is-reveal { background: #ffd54f; }

/* ---- poem ---------------------------------------------------------------------------------------------------------------------------- */
.g-scroll { padding: 24px 30px; border-radius: 18px; background: #fbf3df; box-shadow: inset 0 0 0 6px #e8d4a8, 0 6px 16px rgba(0, 0, 0, .08); text-align: center; font-family: "KaiTi", "STKaiti", serif; }
.g-scroll h2 { margin: 0; font-size: 34px; }
.g-poem-author { margin: 4px 0 14px; color: #8a6d3b; }
.g-poem-line { margin: 8px 0; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: 4px; }
.g-poem-line.is-right { color: #23964b; } .g-poem-line.is-wrong { color: #c62828; }

/* ---- idiom tower ----------------------------------------------------------------------------------------------------------------------- */
.g-tower { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; height: 100%; min-height: 360px; max-height: calc(100vh - 260px); overflow: auto; padding: 10px; border-radius: 20px; background: linear-gradient(#dff1ff, #fff); transform-origin: bottom center; }
.g-tower.is-falling { animation: g-topple 1.2s ease-in forwards; }
@keyframes g-topple { to { transform: rotate(25deg) translateY(40px); opacity: .3; } }
.g-tower-base { width: 80%; padding: 8px; border-radius: 10px; background: #8a6230; color: #fff; text-align: center; font-size: 14px; flex: none; }
.g-floor { flex: none; padding: 10px 22px; border-radius: 12px; background: linear-gradient(#ff9a8f, #e5534b); color: #fff; font-size: 26px; font-weight: 800; letter-spacing: 4px; transform: translateX(var(--shift)); box-shadow: 0 4px 0 #b3362f; animation: g-drop .35s ease-out; }
.g-floor:nth-child(3n) { background: linear-gradient(#ffd77a, #f2b01e); box-shadow: 0 4px 0 #c38a00; }
.g-floor:nth-child(3n+1) { background: linear-gradient(#8fc3ff, #3d8bfd); box-shadow: 0 4px 0 #2b62c6; }
@keyframes g-drop { from { transform: translate(var(--shift), -40px); opacity: 0; } }
.g-idiom-slots { display: flex; gap: 10px; }
.g-idiom-slots .g-slot { width: 76px; height: 76px; font-size: 40px; }

/* ---- snake ------------------------------------------------------------------------------------------------------------------------------- */
.g-snake { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 3px; width: min(100%, 760px, calc((100vh - 360px) * 1.5)); aspect-ratio: 12 / 8; padding: 10px; border-radius: 22px; background: #4e9a32; box-shadow: inset 0 0 0 6px #3d7c28, 0 12px 0 #326624; }
.g-snake-cell { border-radius: 8px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-weight: 800; font-size: clamp(14px, 2vw, 24px); }
.g-snake-cell:nth-child(2n) { background: rgba(0, 0, 0, .05); }
.g-snake-cell.body { background: #2e7d32; border-radius: 30%; }
.g-snake-cell.head { background: #1b5e20; border-radius: 40%; position: relative; }
.g-snake-cell.head::after { content: '••'; color: #fff; font-size: 14px; letter-spacing: 2px; }
.g-snake-cell.food { background: #fff6c8; color: #b9461c; border-radius: 50%; box-shadow: 0 3px 0 #e0b528; }
.g-dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; }
.g-dpad button { border: 0; border-radius: 14px; background: #fff; box-shadow: 0 4px 0 #dde3ee; font-size: 22px; }
.g-dpad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.g-dpad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.g-dpad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.g-dpad [data-dir="right"] { grid-column: 3; grid-row: 2; }

/* ---- ladder ---------------------------------------------------------------------------------------------------------------------------------- */
.g-ladders { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; height: min(460px, calc(100vh - 260px)); padding-top: 50px; }
.g-peak { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 40px; }
.g-ladder { position: relative; border-left: 6px solid #a57d48; border-right: 6px solid #a57d48; }
.g-rung { position: absolute; left: 0; right: 0; height: 6px; background: #c8a06a; }
.g-climber { position: absolute; left: 50%; transform: translate(-50%, 0); font-size: 44px; transition: bottom .4s ease; bottom: 0; }
.g-ladder.red { background: rgba(255, 90, 80, .08); } .g-ladder.blue { background: rgba(60, 130, 250, .08); }

/* ---- goose pond -------------------------------------------------------------------------------------------------------------------------------- */
.g-pond-game { display: flex; flex-direction: column; gap: 12px; }
.g-pond { position: relative; flex: 1; min-height: 380px; border-radius: 36px; overflow: hidden; background: radial-gradient(ellipse 90px 26px at 18% 28%, #8fe07a 0 62%, transparent 63%), radial-gradient(circle at 20% 30%, #d8ffb0 0 8px, transparent 9px), radial-gradient(ellipse 110px 30px at 72% 58%, #74d468 0 62%, transparent 63%), radial-gradient(circle at 74% 60%, #e7ffc8 0 8px, transparent 9px), radial-gradient(ellipse at 50% 42%, #c7f1ff, #2f98d8 72%); box-shadow: inset 0 0 0 14px #6fbf4a, inset 0 0 0 22px #b7e89a; }
.g-basket { position: absolute; right: 18px; bottom: 14px; font-size: 34px; background: rgba(255, 255, 255, .8); padding: 4px 14px; border-radius: 16px; }
.g-goose { position: absolute; transform: translate(-50%, -50%); border: 0; background: none; display: flex; flex-direction: column; align-items: center; padding: 0; transition: opacity .3s; }
.g-goose-body { font-size: 64px; line-height: 1; display: inline-block; }
.g-goose.face-right .g-goose-body { transform: scaleX(-1); }
.g-goose b { margin-top: -10px; padding: 2px 12px; border-radius: 99px; background: #fff; font-size: 24px; box-shadow: 0 3px 0 #dde3ee; }
.g-goose.is-caught { opacity: 0; transform: translate(-50%, -50%) scale(.3); transition: opacity .5s, transform .5s; }
.g-goose.is-wrong b { background: #e5534b; color: #fff; }

/* ---- racing ------------------------------------------------------------------------------------------------------------------------------------- */
.g-race { display: flex; flex-direction: column; gap: 14px; }
.g-lane { position: relative; height: 90px; border-radius: 18px; background: repeating-linear-gradient(90deg, #5c6372, #5c6372 30px, #686f7f 30px, #686f7f 60px); overflow: hidden; }
.g-lane.red { box-shadow: inset 0 0 0 4px #e5534b; } .g-lane.blue { box-shadow: inset 0 0 0 4px #3d8bfd; }
.g-lane-name { position: absolute; left: 10px; top: 6px; color: #fff; font-size: 13px; }
.g-car-icon { position: absolute; top: 18px; left: 0; font-size: 50px; transform: scaleX(-1); z-index: 2; }
.g-flame { position: absolute; top: 30px; left: 0; font-size: 30px; margin-left: -24px; opacity: 0; transform: rotate(-90deg); }
.g-flame.is-on { opacity: 1; }
.g-finish { position: absolute; right: 8px; top: 20px; font-size: 44px; }

/* ---- contest ------------------------------------------------------------------------------------------------------------------------------------- */
.g-contest-q { font-size: clamp(44px, 7vw, 80px); font-weight: 900; }
.g-contest-input { display: inline-block; min-width: 2.2em; padding: 0 14px; border-radius: 16px; background: #fff; box-shadow: 0 5px 0 #f1dcb8; color: var(--g-accent); }
.g-keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.g-key { height: 70px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 #f1dcb8; font-size: 32px; font-weight: 800; }
.g-key:active { transform: translateY(3px); box-shadow: 0 2px 0 #f1dcb8; }
.g-key.ok { background: #35c46a; color: #fff; box-shadow: 0 5px 0 #23964b; }
.g-key.del { background: #ffe1df; }

/* ---- space ---------------------------------------------------------------------------------------------------------------------------------------- */
.g-space { position: relative; display: grid; grid-template-columns: repeat(var(--lanes), 1fr); min-height: 420px; border-radius: 28px; overflow: hidden; touch-action: none; background: radial-gradient(circle at 14% 20%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 32% 48%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 58% 16%, #fff 0 1.8px, transparent 2.4px), radial-gradient(circle at 76% 36%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 90% 12%, #fff 0 1.4px, transparent 2px), radial-gradient(ellipse at 50% 120%, #35508f, #070b22 62%); box-shadow: inset 0 0 80px rgba(80, 140, 255, .25); }
.g-space-lane { position: relative; border-right: 1px dashed rgba(255, 255, 255, .12); cursor: crosshair; }
.g-space-lane:last-of-type { border-right: 0; }
.g-laser { position: absolute; left: 50%; bottom: 120px; top: 0; width: 6px; margin-left: -3px; background: linear-gradient(transparent, #7cf6ff); opacity: 0; border-radius: 3px; }
.g-laser.is-on { opacity: 1; }
.g-rock { position: absolute; left: 50%; transform: translateX(-50%); width: 92px; height: 92px; border-radius: 46% 54% 50% 50%; background: radial-gradient(circle at 30% 30%, #b08a6a, #6d4c35); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 900; box-shadow: 0 0 18px rgba(255, 170, 80, .35); }
.g-rock.is-hit { animation: g-boom .4s forwards; }
.g-rock.is-gone { opacity: 0; transition: opacity .3s; }
.g-ship { position: absolute; bottom: 62px; transform: translateX(-50%); font-size: 54px; transition: left .15s; z-index: 2; pointer-events: none; }
.g-space-q { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center; background: rgba(10, 16, 50, .85); color: #fff; font-size: 30px; pointer-events: none; }

/* ---- responsive ---------------------------------------------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .g-shell { height: auto; min-height: calc(100vh - 100px); font-size: 16px; }
  .g-split, .g-duel, .g-pinyin-wheels { grid-template-columns: 1fr; }
  .g-choubei { grid-template-columns: 1fr 1fr; }
  .g-choubei .g-center { grid-column: 1 / -1; grid-row: 1; }
  .g-link { gap: 50px; }
  .g-beat-row { grid-template-columns: repeat(2, 1fr); }
  .g-pinyin-wheels .g-wheel { width: min(320px, 80vw); }
  .g-title { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .g-wheel-disc { transition-duration: 1.2s; }
  .g-shake, .g-quake, .g-hop, .g-wobble { animation: none; }
}
