@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');
:root { color-scheme: dark; font-family: 'DM Sans',system-ui,sans-serif; background: #171826; color: #faf7ff; --accent:#ffd989; --sky:#292142; --muted:#c7c4d5; }
* { box-sizing: border-box }
body { margin:0 }
button { font: inherit; color: inherit }
button:focus-visible { outline: 2px solid var(--accent); outline-offset:3px }
button:not(:disabled) { cursor:pointer }
button:disabled { opacity:.5 }
#game { min-width: 0; min-height: min(92dvh,650px); max-height: 1000px; overflow:auto; width: min(100%,1260px); margin:auto; background:#191a2b; display:flex; flex-direction:column; overscroll-behavior:contain; scrollbar-width:thin; }
.masthead { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px clamp(12px,3vw,34px); background:#191a2b; border-bottom:1px solid #ffffff16; }
h1,h2,p { margin:0 }
h1,h2 { font-family:'Space Grotesk',system-ui,sans-serif; letter-spacing:-.04em }
h1 { color:var(--accent); font-size:clamp(19px,3.3vw,32px); line-height:1 }
#subtitle { margin-top:5px; font-size:clamp(11px,1.8vw,13px); color:var(--muted) }
.tools { display:flex; gap:5px; flex:none }
.tools button { border:1px solid #ffffff24; border-radius:8px; background:#27283c; padding:7px 9px; font-size:12px; min-height:36px; }
#stage { height: clamp(218px,58dvh,620px); flex:none; position:relative; isolation:isolate; background:var(--sky); overflow:hidden; }
#canvas,#markers { position:absolute; inset:0 }
#canvas canvas { display:block; width:100%; height:100%; touch-action:manipulation }
#markers { pointer-events:none; }
.marker { position:absolute; padding:2px 5px; min-width:24px; min-height:22px; border:1px solid #fff8; border-radius:7px; line-height:1.04; font-size:clamp(10px,2.2vw,15px); font-weight:700; color:#191725; background:var(--accent); text-align:center; transform:translate(-50%,-50%); user-select:none; white-space:nowrap }
button.marker { pointer-events:auto; touch-action:manipulation; min-height:30px; min-width:30px; box-shadow:0 2px 0 #17172488 }
.marker[hidden] { display:none }
#hud { position:absolute; z-index:1; top:10px; left:10px; right:10px; display:flex; justify-content:space-between; pointer-events:none; }
#hud span { border:1px solid #ffffff35; border-radius:999px; background:#171629dc; color:#fef8ff; font-size:clamp(10px,1.8vw,13px); font-weight:700; padding:6px 10px; max-width:70%; text-align:right; }
#hud span:empty { display:none }
.overlay { position:absolute; z-index:3; inset:0; display:grid; place-items:center; padding:12px; background:linear-gradient(110deg,#1b1735e8,#191d36b5); }
.overlay[hidden] { display:none }
.intro { display:grid; grid-template-columns:clamp(94px,24vw,160px) 1fr; align-items:center; gap:clamp(10px,3vw,26px); background:#202036; border:1px solid #ffffff37; box-shadow:0 16px 60px #1312297a; padding:clamp(9px,2.5vw,23px); border-radius:18px; width:min(100%,630px); }
.intro img { width:100%; height:auto; border-radius:10px; aspect-ratio:1; object-fit:cover; }
.intro h2 { color:var(--accent); font-size:clamp(19px,3.5vw,34px); line-height:1.05; }
.intro p { color:#e5dff1; font-size:clamp(12px,2.2vw,15px); line-height:1.42; margin-top:7px; }
#overlay-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:11px; }
.chip { min-height:41px; min-width:42px; padding:6px 11px; border:1px solid #ffffff25; border-radius:8px; background:#2c2e47; box-shadow:0 2px 0 #141421; font-weight:700; font-size:clamp(12px,2vw,14px); line-height:1.16; touch-action:manipulation; }
.chip:hover:not(:disabled) { border-color:var(--accent); }
.chip:active:not(:disabled),.chip.is-held { transform:translateY(1px); background:var(--accent); color:#1b1832; }
.chip.primary,.chip[aria-pressed="true"] { background:var(--accent); border-color:transparent; color:#211a31; }
#dock { min-height:118px; padding:10px clamp(12px,3vw,34px) 12px; display:grid; gap:8px; align-content:start; }
.brief h2 { font-size:clamp(18px,3vw,24px); line-height:1.05; }
.brief p { color:#d4cfe3; margin-top:4px; font-size:clamp(12px,1.9vw,14px); line-height:1.35; }
#controls { display:flex; flex-wrap:wrap; gap:5px; min-width:0; }
#controls:empty,#message:empty { display:none }
#message { color:var(--accent); font-size:13px; font-weight:600; min-height:1.15em; }
#game[data-mode="story"] #stage { height:clamp(170px,42dvh,420px); }
#game[data-mode="story"] #dock { max-width:850px; margin-inline:auto; width:100%; }
#game[data-mode="story"] .brief p { line-height:1.5; }
#game[data-mode="story"] #controls { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr)); }
@media (max-width:530px) {
 .masthead { gap:8px }
 #stage { height:clamp(195px,44dvh,480px) }
 .chip { padding-inline:8px; min-height:44px }
 .intro { grid-template-columns:76px 1fr }
 #game[data-mode="dress"] #dock { gap:6px }
}
@media (max-height:440px) and (orientation:landscape) {
 .masthead { padding-block:6px }
 #stage { height:52dvh; min-height:150px }
 #game[data-mode="story"] #stage { height:140px }
 #dock { padding-block:7px }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto } }
