/* Shared game layout: approved mock/game.html values. Only opt-in studio games. */
/* THE three versions (notes/rules/design.md): phone ≤600 / tablet 601–1023 / computer ≥1024.
   Every game page reads its picture, Japanese/Chinese text, button and column sizes from here — never its own numbers. */
body.studio-game{--size-pic:48px;--size-jp:22px;--size-btn:48px;--size-cols:2;--size-gap:12px;--size-col-w:100%}
@media(min-width:601px){body.studio-game{--size-pic:64px;--size-jp:28px;--size-btn:56px;--size-cols:3;--size-gap:16px;--size-col-w:680px}}
@media(min-width:1024px){body.studio-game{--size-pic:clamp(72px,5vw,100px);--size-jp:clamp(32px,2.2vw,42px);--size-btn:clamp(64px,4vw,76px);--size-cols:4;--size-gap:20px;--size-col-w:100%}}
body.studio-game{--game-header-h:64px;min-height:0}
.studio-game>header.bar{padding:0 3vw}
.studio-game .g{position:relative;z-index:1;width:min(94%,1240px);margin:0 auto;height:calc(var(--game-viewport-h,100dvh) - var(--game-header-h));display:flex;flex-direction:column;padding:12px 0 16px;min-height:0}
.studio-game .ghead{display:flex;align-items:center;gap:16px;min-height:44px;height:44px;flex-shrink:0}
.studio-game .ghead .back{display:inline-flex;align-items:center;gap:4px;font-size:15px;color:var(--gold);font-weight:600;white-space:nowrap}
.studio-game .gname{font-size:17px;font-weight:600;color:var(--star);line-height:1.4;letter-spacing:0}
.studio-game .prog{margin-left:auto;display:flex;align-items:center;gap:12px;font-size:15px;color:var(--soft);white-space:nowrap}
.studio-game .bar2{width:180px;height:6px;border-radius:3px;background:rgba(255,255,255,.12);overflow:hidden}
.studio-game .bar2 i{display:block;height:100%;background:var(--gold)}
/* The instruction is the card's header strip: same paper as the card, joined to its top edge, so it is read as part of the task. */
.studio-game .gdo{position:relative;margin:6px 0 0;padding:9px 24px 9px 48px;background:var(--paper);color:var(--ink);border:1.5px solid var(--ink-line);border-bottom:0;border-radius:18px 18px 0 0;font-size:24px;font-weight:700;flex-shrink:0;line-height:1.45}
.studio-game .gdo::before{content:"";position:absolute;left:22px;top:50%;width:11px;height:11px;margin-top:-5.5px;border-radius:50%;background:var(--ink)}
.studio-game .gdo:empty{display:none}
.studio-game .gdo.gdo-alone{border-bottom:1.5px solid var(--ink-line);border-radius:18px;margin-bottom:12px}
.studio-game .gdo:not(:empty)+.game-stage .desk{border-top-left-radius:0;border-top-right-radius:0}
.studio-game .gdo.gdo-new{animation:gdoNew 1.1s ease-out 1}
@keyframes gdoNew{0%{box-shadow:0 0 0 0 rgba(217,180,90,0)}25%{box-shadow:0 0 0 6px rgba(217,180,90,.6)}100%{box-shadow:0 0 0 0 rgba(217,180,90,0)}}
@media(prefers-reduced-motion:reduce){.studio-game .gdo.gdo-new{animation:none}}
.studio-game .game-stage{flex:1;position:relative;min-height:0}
.studio-game #app,.studio-game #app>.desk{height:100%;min-height:0}
.studio-game .desk{padding:56px 40px 24px}
.studio-game .gfoot{display:flex;align-items:center;justify-content:space-between;margin-top:14px;flex-shrink:0}
.studio-game .gfoot .link{font:600 16px var(--sans);background:transparent;border:0;border-bottom:1px solid var(--gold-line);color:var(--gold);cursor:pointer}
.studio-game .learning-controls{position:absolute;z-index:2;top:14px;right:24px;display:flex;gap:16px;align-items:center}
.studio-game .learn-switch{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:var(--ink-soft);padding:0;font:400 14px var(--sans);cursor:pointer;min-height:30px}
.studio-game .switch-track{display:block;width:42px;height:24px;flex-shrink:0;border-radius:12px;background:rgba(23,34,59,.08);border:1px solid var(--ink-soft);position:relative}
.studio-game .switch-track::after{content:"";position:absolute;width:16px;height:16px;top:3px;left:3px;border-radius:50%;background:var(--ink-soft)}
.studio-game .learn-switch[aria-pressed=true] .switch-track{background:var(--gold)}
.studio-game .learn-switch[aria-pressed=true] .switch-track::after{left:21px;background:var(--ink)}
.studio-game :is(button,a):focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.studio-game .desk :is(button,a):focus-visible,.studio-game .learning-controls button:focus-visible{outline-color:var(--ink)}
.studio-game .sg-options{container-type:inline-size;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-content:center}
.studio-game .sg-options[data-count="3"]>:last-child{grid-column:1/-1;justify-self:center;width:calc((100% - 18px)/2)}
.studio-game.embed{--game-header-h:0px}
.studio-game.embed>.stars{display:none}
.studio-game .game-help{margin:auto;width:min(650px,calc(100% - 32px));max-height:calc(100% - 32px);overflow:auto;padding:28px;border:1px solid var(--gold-line);border-radius:18px;background:var(--night-2);color:var(--text);font:18px/1.65 var(--sans)}
.studio-game .game-help::backdrop{background:rgba(6,8,25,.6);backdrop-filter:blur(3px)}
.studio-game .game-help>button{float:right;background:transparent;color:var(--star);border:1px solid var(--gold-line);width:44px;height:44px;border-radius:50%;font-size:24px;cursor:pointer}
.studio-game .game-help footer{margin-top:20px;font-size:16px;padding:0;border:0;display:block}
.studio-game .drawer .ml-music-options{position:static;width:100%;margin-top:8px;box-shadow:none}
.studio-game .drawer .studio-music{align-items:flex-start}
.studio-game .drawer .ml-zone-music details{display:block}
.studio-game .drawer .music-control{flex-wrap:wrap;justify-content:flex-end}
.studio-game .drawer .ml-zone-music summary{height:40px;min-height:40px;border-color:var(--gold-line)}
@media(max-width:899px){body.studio-game{--game-header-h:56px}}
@media(max-width:1023px){.studio-game .gdo{font-size:21px}}
@media(max-width:600px){
 body.studio-game{--game-header-h:56px}
 .studio-game .g{width:100%;padding:8px 16px 16px}
 .studio-game .ghead{gap:12px}
 .studio-game .bt,.studio-game .bar2{display:none}
 .studio-game .gname{display:block;font-size:16px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .studio-game .ghead .back{display:inline-flex;align-items:center;gap:4px;font-size:22px}
 .studio-game .gdo{font-size:17px;margin:4px 0 0;padding:10px 16px 10px 38px}
 .studio-game .gdo::before{left:17px;width:9px;height:9px;margin-top:-4.5px}
 .studio-game .desk{padding:52px 20px 16px}
 .studio-game .learning-controls{right:18px;top:12px;gap:12px}
 .studio-game .learn-switch{font-size:12px;gap:6px}
 .studio-game .gfoot{justify-content:center}
 .studio-game.embed{--game-header-h:0px}
 .studio-game .g{height:auto;min-height:calc(var(--game-viewport-h,100dvh) - var(--game-header-h))}
 .studio-game .game-stage{flex:none}
 .studio-game #app,.studio-game #app>.desk{height:auto}
}

/* ===== Desk kit (body.sg-kit) =====
   The one standard look for what sits on the paper desk: text, buttons, inputs, right/wrong, writing box, pop-up sheet.
   A page that joins deletes its own colours, font sizes and button styles and keeps layout only. Model page: clock.html.
   Text      .sg-jp Japanese/Chinese to learn · .sg-jp-s the same inside a sentence, bubble or long option · .sg-big the one big thing
             .sg-do what to do next · .sg-label small heading · .sg-note secondary line
   Buttons   every button is a white outlined button · .sg-main the one main action · .sg-opts answer choices (.sg-long = sentences)
             .sg-tabs sections of the page · .sg-chips range / level / mode choices · .sg-dense tight grid (calendar, floor list)
   Kana      .sg-kana textbook-style kana (Klee One)
   States    .sg-on chosen · .sg-ok right · .sg-no wrong · .sg-used already used · .sg-sun／.sg-sat calendar Sunday red／Saturday blue
   Boxes     .sg-slot empty place for an answer · .sg-blank gap in a sentence · .sg-tile movable word · .sg-card white card
             .sg-write handwriting box · .sg-feedback verdict + model answer · .sg-overlay + .sg-sheet pop-up · .sg-toast */
body.sg-kit{--sg-text:17px;--sg-note:15px;--sg-ctl:44px;--sg-jp-s:max(16px,calc(var(--size-jp)*.75));--sg-pick:#f3e5bf;--sg-ok:#28774a;--sg-ok-bg:#e3f3e8;--sg-no:#b03c36;--sg-no-bg:#fbe7e4;--sg-sun:#c0303a;--sg-sat:#2a5fb4}
@media(max-width:600px){body.sg-kit{--sg-text:16px;--sg-note:14px}}
.sg-kit :is(.desk,.sg-sheet){font:400 var(--sg-text)/1.5 var(--sans);color:var(--ink)}
@media(min-width:1024px){.sg-kit .game-stage>.desk{height:100%;min-height:0;overflow:auto}}
.sg-kit :is(.desk,.sg-sheet) :is(h2,h3){font-size:20px;line-height:1.3;font-weight:700;color:var(--ink)}
.sg-kit .sg-jp{font-size:var(--size-jp);font-weight:700;line-height:1.45}
.sg-kit .sg-jp-s{font-size:var(--sg-jp-s);font-weight:700;line-height:1.5}
/* Japanese is written with spaces between phrases: a long line breaks at those spaces, not inside a word */
.sg-kit :is(.sg-jp,.sg-jp-s,.sg-big,.sg-opts button,.sg-feedback span){word-break:keep-all;overflow-wrap:anywhere}
.sg-kit .sg-big{font-size:calc(var(--size-jp)*1.4);font-weight:700;line-height:1.25}
.sg-kit .sg-do{font-size:calc(var(--sg-text) + 3px);font-weight:700;line-height:1.4}
.sg-kit .sg-label{font-size:var(--sg-note);font-weight:700;color:var(--ink-soft)}
.sg-kit .sg-note{font-size:var(--sg-note);color:var(--ink-soft)}
.sg-kit :is(.desk,.sg-sheet) rt{font-size:.5em;font-weight:500;color:var(--ink-soft)}
.sg-kit :is(.desk,.sg-sheet) button{margin:0;min-height:var(--sg-ctl);padding:6px 16px;font:600 var(--sg-text)/1.3 var(--sans);color:var(--ink);background:#fff;border:1.5px solid var(--ink);border-radius:14px;cursor:pointer}
.sg-kit :is(.desk,.sg-sheet) button:disabled{cursor:default}
.sg-kit :is(.desk,.sg-sheet) button:disabled:not(.sg-on,.sg-ok,.sg-no,.sg-used){opacity:.5}
.sg-kit :is(.desk,.sg-sheet) button.sg-main{min-height:var(--size-btn);padding:6px 28px;font-size:20px;color:#fff;background:var(--ink)}
.sg-kit .sg-opts button{min-height:var(--size-btn);padding:4px 16px;font-size:var(--size-jp);font-weight:700}
.sg-kit .sg-opts.sg-long button{font-size:var(--sg-jp-s);line-height:1.45}
.sg-kit .sg-tabs{display:flex;gap:8px}
.sg-kit .sg-tabs button{flex:none;min-height:40px;padding:4px 14px;font-size:15px;white-space:nowrap}
.sg-kit .sg-chips{display:flex;flex-wrap:wrap;gap:8px}
.sg-kit .sg-dense button{min-height:32px;padding:2px 10px;font-size:var(--sg-note)}
@media(max-width:1023px){.sg-kit .sg-dense button{min-height:44px}}
.sg-kit :is(.desk,.sg-sheet) .sg-on{background:var(--sg-pick);box-shadow:inset 0 0 0 1px var(--ink)}
.sg-kit :is(.desk,.sg-sheet) .sg-ok{background:var(--sg-ok-bg);border-color:var(--sg-ok);border-style:solid}
.sg-kit :is(.desk,.sg-sheet) .sg-no{background:var(--sg-no-bg);border-color:var(--sg-no)}
.sg-kit :is(.desk,.sg-sheet) .sg-used{opacity:.4}
.sg-kit .desk input{width:100%;min-height:var(--size-btn);padding:6px 14px;font:500 var(--sg-jp-s)/1.3 var(--sans);color:var(--ink);background:#fff;border:1.5px solid var(--ink);border-radius:14px}
.sg-kit .desk input::placeholder{color:var(--ink-soft);opacity:.75}
.sg-kit .sg-slot{background:transparent;border:1.5px dashed rgba(23,34,59,.5);border-radius:14px}
.sg-kit .sg-blank{display:inline-flex;align-items:center;justify-content:center;min-width:3em;min-height:var(--sg-ctl);padding:0 8px;border-bottom:3px solid var(--ink)}
.sg-kit .sg-blank.sg-ok{background:transparent;border-color:var(--sg-ok);color:var(--sg-ok)}
.sg-kit .sg-tile{display:inline-flex;align-items:center;justify-content:center;min-height:max(44px,calc(var(--size-btn) - 12px));padding:4px 14px;font-size:var(--sg-jp-s);font-weight:700;background:#fff;border:1.5px solid var(--ink);border-radius:14px}
.sg-kit .sg-card{background:#fff;border:1.5px solid var(--ink);border-radius:14px}
.sg-kit canvas.sg-write{display:block;width:100%;color:var(--ink);background:#fff;border:1.5px dashed var(--ink);border-radius:14px;touch-action:none}
.sg-kit .sg-feedback{font-weight:600}
.sg-kit .sg-feedback span{display:block;font-size:var(--sg-jp-s);font-weight:700}
.sg-kit .sg-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:14px;background:rgba(6,8,25,.6);backdrop-filter:blur(3px)}
.sg-kit .sg-sheet{width:min(560px,100%);max-height:92dvh;overflow:auto;padding:24px 20px;background:var(--paper);border:1.5px solid var(--ink);border-radius:18px}
.sg-kit .sg-toast{position:fixed;left:50%;top:18px;transform:translateX(-50%);z-index:200;padding:12px 18px;font:700 var(--sg-text)/1.4 var(--sans);color:var(--ink);background:var(--gold);border-radius:14px}
/* The "How to play" box holds the page title, who is practising, the stamp report button and the version. */
.sg-kit .game-help h1{font-size:24px;line-height:1.3;font-weight:600;color:var(--star)}
.sg-kit .game-help a{color:var(--gold);border-bottom:1px solid var(--gold-line)}
.sg-kit .game-help button:not([data-help-close]){min-height:var(--sg-ctl);padding:6px 18px;font:600 var(--sg-text)/1.3 var(--sans);color:var(--night);background:var(--gold);border:0;border-radius:999px;cursor:pointer}
.sg-kit .game-help .sg-note{color:var(--soft)}
/* Calendars: Sunday red, Saturday blue, as on Japanese calendars (part of reading 日曜日／土曜日) */
.sg-kit :is(.desk,.sg-sheet) .sg-sun{color:var(--sg-sun)}
.sg-kit :is(.desk,.sg-sheet) .sg-sat{color:var(--sg-sat)}
/* Kana to read/recognise: textbook-style face (Klee One SemiBold, kana-only subset, OFL; assets/fonts/klee-one-LICENSE.txt). Mint 11-07. */
@font-face{font-family:"ML Kana";src:url("fonts/klee-one-kana-600.woff2") format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+3000-30FF,U+FF01,U+FF1F,U+FF5E}
.sg-kit .sg-kana,.sg-kit .sg-kana :is(button,span){font-family:"ML Kana",var(--sans)}
