/* Home screen "adventure map" design: wooden title sign, stage-style grade cards, bold outlines.
   Loaded after cozy-ui.css. Readable controls keep Pretendard with no text shadow (see tests/typography.cjs). */
@font-face{font-family:'Do Hyeon';src:url('fonts/DoHyeon-Title.woff2') format('woff2');font-display:swap}
#startPanel{background:#cfe9f2}
#startPanel .card{position:relative;overflow:hidden;border:4px solid #3b5d3a;border-radius:26px;box-shadow:0 8px 0 #2c4a2b,0 18px 36px #1d3a4a44;
 background:
  radial-gradient(ellipse at 15% 85%,#bfe3a6 0 70px,transparent 71px),
  radial-gradient(ellipse at 95% 95%,#9fd3e8 0 90px,transparent 91px),
  #fff3d6}
#startPanel .card>*{position:relative}

/* Title: one line on a full-width sign, with the chips on their own row above it. */
#startPanel .titleRow{display:flex;flex-direction:column;align-items:stretch;gap:6px}
#startPanel .topChips{order:-1;align-self:flex-end}
#startPanel .installChip{background:#fffaf0;border:3px solid #2f4a2e;box-shadow:0 3px 0 #2f4a2e;border-radius:12px;color:#2f4a2e}
#startPanel .titleRow h1{position:relative;box-sizing:border-box;width:100%;margin:52px 0 0;padding:.22em .3em .26em;text-align:center;
 font-family:'Do Hyeon','Jua',sans-serif;font-weight:400;font-size:clamp(36px,12vw,78px);line-height:1;letter-spacing:0;white-space:nowrap;
 border:4px solid #2f4a2e;border-radius:18px;background:repeating-linear-gradient(0deg,#0000 0 14px,#00000014 14px 16px),linear-gradient(#4f8a4c,#3b6e39);box-shadow:0 6px 0 #2f4a2e,inset 0 3px 0 #ffffff33}
#startPanel .titleRow h1::before,#startPanel .titleRow h1::after{content:'';position:absolute;bottom:100%;width:8px;height:26px;background:#7a5230;border:3px solid #2f4a2e;border-bottom:0;border-radius:4px 4px 0 0}
#startPanel .titleRow h1::before{left:14%}#startPanel .titleRow h1::after{right:14%}
#startPanel .homeTitle{color:#ffe14d;-webkit-text-stroke:3px #1f331e;paint-order:stroke fill;text-shadow:0 4px 0 #1f331e}
#startPanel .titleRow h1 .edition{position:absolute;right:-6px;top:-16px;font-family:inherit;font-size:.3em;background:#e2533c;color:#fff;border:3px solid #2f4a2e;border-radius:10px;padding:0 8px;box-shadow:0 3px 0 #2f4a2e;transform:rotate(8deg)}
/* Characters wait on the left post, clear of the right-aligned install/QR chips. */
#startPanel .homePals{position:absolute;left:calc(14% - 25px);bottom:calc(100% + 18px);display:flex;gap:4px;pointer-events:none}
#startPanel .homePals img{width:58px;height:58px;filter:drop-shadow(0 3px 0 #2f4a2e66)}
#startPanel .subtitle{text-align:center;color:#3d5a3c;font-weight:700;margin-top:14px}

/* Quick start: prompt, stage cards, summary, start. */
#quickStart{display:flex;flex-direction:column}
#quickStart .quickPrompt{order:-1;color:#2f4a2e;font-weight:800;margin:10px 0 6px}
#gradeCards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 6px}
#gradeCards button{display:grid;justify-items:center;padding:6px 4px 8px;border-radius:16px;border:3px solid #2f4a2e;color:#2f4a2e;cursor:pointer;box-shadow:0 4px 0 #2f4a2e;transition:transform .12s}
#gradeCards small{font-size:12px;font-weight:800;color:#7a5f30}
#gradeCards b{font-family:'Do Hyeon','Jua',sans-serif;font-weight:400;font-size:26px;line-height:1.05}
#gradeCards i{font-style:normal}
#gradeCards button:nth-child(1){background:#d8f0c4}#gradeCards button:nth-child(2){background:#fde7b0}#gradeCards button:nth-child(3){background:#e6dcfa}
#gradeCards button:nth-child(4){background:#c9e9f6}#gradeCards button:nth-child(5){background:#f7d9c4}#gradeCards button:nth-child(6){background:#d6ecff}
#gradeCards button.on{transform:translateY(2px);box-shadow:0 2px 0 #2f4a2e;outline:4px solid #ffd23f;outline-offset:1px}
/* The native select is visually hidden but keeps keyboard focus; its zero-height field stays out of layout checks. */
#quickStart > label.srOnly .selectField{height:0;min-height:0;padding:0;border:0;overflow:hidden}
/* Show the hidden select's focus on the selected card. */
#quickStart:has(#grade:focus-visible) #gradeCards button.on{outline-color:#1d63c9;outline-width:5px}
#quickSummary{color:#3f5f3d;font-weight:600}
#startPanel #quickStart #startBtn{border:4px solid #2f4a2e;border-radius:18px;background:#2e7d3a linear-gradient(#348d42,#2a7335);color:#fff;font-size:clamp(24px,6.6vw,30px);font-weight:850;box-shadow:0 8px 0 #2f4a2e,0 14px 24px #2f4a2e44}

/* Bottom menus: same specificity as the existing nth-of-type rules so these win. */
#startPanel .card>details,#startPanel .card>details:nth-of-type(2),#startPanel .card>details:nth-of-type(3){border:3px solid #2f4a2e;border-radius:16px;box-shadow:0 4px 0 #2f4a2e}
#startPanel .card>details:nth-of-type(1){background:#e5f4d8}
#startPanel .card>details:nth-of-type(2){background:#fff0c8}
#startPanel .card>details:nth-of-type(3){background:#dcefff}
#startPanel .card>details>summary{color:#2f4a2e;font-weight:800}
@media(prefers-reduced-motion:reduce){#gradeCards button{transition:none}}

/* Short screens: smaller sign and one row of grade cards so the start button stays on the first screen. */
@media(max-height:700px){
 #startPanel .titleRow h1{margin-top:40px;font-size:clamp(32px,9.6vw,52px)}
 #startPanel .homePals{bottom:calc(100% + 14px)}#startPanel .homePals img{width:44px;height:44px}
 #startPanel .titleRow h1::before,#startPanel .titleRow h1::after{height:18px}
 #startPanel .subtitle{margin-top:10px}
 #gradeCards{grid-template-columns:repeat(6,1fr);gap:5px}
 #gradeCards button{padding:4px 2px 5px;border-radius:12px;box-shadow:0 3px 0 #2f4a2e}
 #gradeCards small{display:none}
 #gradeCards b{display:grid;justify-items:center;font-size:13px;line-height:1.1}#gradeCards b i{font-size:24px;line-height:1}
}
/* Landscape phones: the sign alone carries the title. */
@media(max-height:500px){
 #startPanel .titleRow{flex-direction:row;align-items:center;gap:12px}
 #startPanel .topChips{order:1}
 #startPanel .titleRow{flex-wrap:nowrap}
 #startPanel .titleRow h1{flex:1;width:auto;min-width:0;margin-top:0;font-size:clamp(28px,5vw,40px);padding:.14em .3em .18em}
 #startPanel .homePals,#startPanel .titleRow h1::before,#startPanel .titleRow h1::after,#startPanel .subtitle{display:none}
 #startPanel .titleRow h1 .edition{top:-10px}
 #quickStart .quickPrompt{margin:6px 0 4px}
}
#quickStart>#studentField{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 8px;font-size:17px;font-weight:800;color:#2f4a2e}
#studentField input{width:110px;min-height:44px;padding:6px 10px;border:3px solid #2f4a2e;border-radius:12px;font:inherit;font-size:20px;text-align:center;background:#fffdf5;color:#2f4a2e}
#studentField small{flex:1 1 180px;font-size:13px;font-weight:600;color:#5b6b52;line-height:1.35;word-break:keep-all}
/* Continue a saved run: sits above the start button only while a save exists for this number. */
#continueBox{display:flex;flex-direction:column;gap:6px;margin:2px 0 6px;padding:10px;border:3px solid #2f4a2e;border-radius:18px;background:#fff6d8}
#continueBox[hidden]{display:none}
#startPanel #continueBtn{min-height:56px;border:3px solid #8a5a12;border-radius:14px;background:#f2b33d linear-gradient(#f6c25a,#e9a42c);color:#3b2605;font-size:clamp(21px,5.6vw,26px);font-weight:850;box-shadow:0 5px 0 #8a5a12}
#continueInfo{margin:0;font-size:14px;font-weight:600;line-height:1.4;color:#5b4a22;word-break:keep-all}
body.simple-play #menuActions #saveExitBtn{grid-column:1/-1;background:#fff0c8;border:2px solid #8a5a12;color:#3b2605;font-weight:800}
/* The first screen fills the whole window edge to edge; the content stays in a readable centered column. */
#startPanel{display:block;padding:0;background:#fff3d6}
#startPanel .card{box-sizing:border-box;width:100%;max-width:none;min-height:100%;margin:0;border:0;border-radius:0;box-shadow:none;overflow:visible;
 display:flex;flex-direction:column;justify-content:safe center;
 padding-block:max(16px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-bottom));
 padding-inline:max(16px,env(safe-area-inset-left),calc(50% - 380px)) max(16px,env(safe-area-inset-right),calc(50% - 380px))}
#startPanel .card{background:radial-gradient(180px 80px at 0 100%,#bfe3a6 99%,transparent 100%),radial-gradient(220px 100px at 100% 100%,#9fd3e8 99%,transparent 100%),#fff3d6}
#startPanel .card>*{flex-shrink:0}
/* Narrow phones: three chips reach the characters, so the sign drops below the chip row. */
@media(max-width:520px){#startPanel .titleRow h1{margin-top:74px}}
@media(max-width:520px) and (max-height:700px){#startPanel .titleRow h1{margin-top:56px}}
#startPanel .topChips{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
#startPanel .exitChip{background:#fde3dc;border-color:#8a2f1f;box-shadow:0 3px 0 #8a2f1f;color:#7a2416}
/* Goodbye screen when the browser keeps the tab open after "quit". */
#exitPanel{z-index:210;padding:16px;background:#fff3d6;place-items:center}
#exitPanel .card{width:min(520px,100%);margin:auto;text-align:center;border:4px solid #3b5d3a;border-radius:26px;box-shadow:0 8px 0 #2c4a2b;background:#fffaf0}
#exitPanel h1{font-family:'Do Hyeon','Jua',sans-serif;font-weight:400;color:#2f4a2e;font-size:clamp(30px,7vw,44px);margin:0 0 8px}
#exitPanel .subtitle{color:#3d5a3c;font-weight:700;font-size:18px;word-break:keep-all}
#exitBackBtn{min-height:52px;padding:8px 18px;border:3px solid #2f4a2e;border-radius:14px;background:#fffaf0;color:#2f4a2e;font-size:18px;font-weight:800;box-shadow:0 4px 0 #2f4a2e;cursor:pointer}
