@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Press+Start+2P&display=swap');

:root { --ink:#182235; --cream:#fff0b8; --paper:#f0cf8d; --red:#df472d; --green:#35493e; --cyan:#61d6dc; --pixel:'Press Start 2P',monospace; }
* { box-sizing:border-box; }
html,body { height:100%; margin:0; }
body { height:100dvh; display:flex; flex-direction:column; background:var(--ink); color:var(--cream); font:14px 'DM Sans',sans-serif; overflow:hidden; }
[hidden] { display:none!important; }
button,a { -webkit-tap-highlight-color:transparent; }
button { position:relative; min-height:44px; padding:10px 18px; border:2px solid var(--cream); border-radius:0; background:var(--green); color:var(--cream); font:10px/1.6 var(--pixel); cursor:pointer; box-shadow:3px 3px 0 #0c1425; transition:filter 120ms, background-color 120ms; }
button:hover { filter:brightness(1.12); }
button:focus-visible,a:focus-visible { outline:3px solid var(--cyan); outline-offset:4px; }
button:disabled { opacity:.6; cursor:wait; }
.primary { background:var(--red); box-shadow:inset 0 0 0 2px #f7946255,3px 4px 0 #111a2d; }
.icon-button { display:inline-grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; font:20px/1 'DM Sans',sans-serif; border:1px solid #fff0b84d; box-shadow:none; background:var(--ink); }
.quiet-button { border:0; box-shadow:none; background:transparent; font:13px 'DM Sans',sans-serif; padding:8px; }
#soundToggle { position:fixed; top:14px; right:24px; z-index:110; }
#soundToggle svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.sound-off, #soundToggle[aria-pressed="true"] .sound-waves { display:none; }
#soundToggle[aria-pressed="true"] .sound-off { display:block; }
header { flex:0 0 72px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 88px 12px 4%; }
header a { color:var(--cream); text-decoration:none; font:clamp(9px,1.1vw,13px)/1.6 var(--pixel); }
.header-actions { display:flex; align-items:center; gap:20px; }
#progress { font:11px var(--pixel); color:var(--cyan); white-space:nowrap; }
#mapView { flex:1; min-height:0; display:flex; flex-direction:column; }
.map-heading { display:flex; align-items:center; justify-content:space-between; padding:6px 4% 18px; }
.map-heading h2 { font:clamp(14px,1.8vw,22px)/1.6 var(--pixel); margin:0; }
.map { flex:1; min-height:220px; margin:0 4%; position:relative; overflow:hidden; border:3px solid var(--cream); background:#9daf7a url('assets/sobo-world.png') center/cover; image-rendering:pixelated; }
.world-map { position:absolute; inset:0; width:100%; height:100%; shape-rendering:crispEdges; }
.pin { position:absolute; transform:translate(-50%,-50%); border:0; outline:0; background:none; box-shadow:none; text-align:center; min-width:130px; max-width:230px; padding:8px; color:var(--ink); }
.landmark { display:block; margin-bottom:8px; filter:drop-shadow(4px 4px 0 #18223560); }
.landmark svg { width:clamp(48px,9vh,90px); height:clamp(48px,9vh,90px); shape-rendering:crispEdges; }
.pin strong { display:block; font:10px/1.6 var(--pixel); background:var(--cream); border:2px solid var(--ink); box-shadow:3px 3px 0 #18223566; padding:10px 12px; }
.pin small { display:inline-block; font:11px 'DM Sans',sans-serif; margin-top:6px; background:var(--ink); color:var(--cream); padding:3px 8px; }
.pin.done strong { background:var(--green); color:var(--cream); border-color:var(--cream); }
.trees { position:absolute; display:flex; gap:4px; pointer-events:none; }
.trees i { display:block; width:26px; height:45px; background:#3f644a; clip-path:polygon(35% 0,65% 0,65% 15%,80% 15%,80% 35%,100% 35%,100% 75%,60% 75%,60% 100%,40% 100%,40% 75%,0 75%,0 35%,20% 35%,20% 15%,35% 15%); box-shadow:inset 10px 0 #638457; }
.t1 { left:35%; top:28%; }.t2 { left:12%; top:65%; }.t3 { right:9%; top:48%; }
.compass { position:absolute; right:20px; top:18px; font:12px/1.6 var(--pixel); text-align:center; color:#20362f; }
footer { flex:0 0 46px; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:10px 4%; font-size:12px; color:#b8c4b8; }
#handStatus { color:var(--cyan); }
.footer-credit { white-space:nowrap; font-size:11px; }
#gameView { flex:1; min-height:0; display:flex; flex-direction:column; }
.gamebar { display:flex; align-items:center; gap:18px; flex:0 0 64px; padding:0 4% 16px; }
.gamebar strong { flex:1; font:11px/1.7 var(--pixel); }
#counter { font:11px/1.8 'DM Sans',sans-serif; color:var(--cyan); white-space:nowrap; }
.stage { position:relative; flex:1; min-height:0; margin:0 4%; background:#142733; border:2px solid #fff0b86b; overflow:hidden; }
.stage video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1); }
.stageShade { position:absolute; inset:0; background:#102034bd; }
.quiz { position:relative; height:100%; max-width:1100px; margin:auto; padding:56px 32px 24px; display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:clamp(14px,3vh,32px); overflow:auto; }
.quiz h2 { font:clamp(14px,2.4vh,24px)/1.7 var(--pixel); text-align:center; max-width:900px; margin:0 auto; text-wrap:balance; }
#answers { display:flex; gap:20px; justify-content:center; }
.answer { position:relative; flex:1; max-width:300px; min-height:clamp(90px,15vh,150px); display:flex; align-items:center; justify-content:center; padding:16px; background:var(--cream); color:var(--ink); border:3px solid #a58961; box-shadow:4px 4px 0 #080e1c66; font:clamp(10px,1.6vh,15px)/1.7 var(--pixel); text-align:center; user-select:none; }
.answer.correct { background:#c6e69d; border-color:#69c08c; }
.answer.wrong { background:#f3b395; border-color:#e65639; }
.answer.grabbed { outline:4px solid var(--cyan); z-index:9; }
#dropSlot { position:relative; width:100%; height:174px; flex-shrink:0; }
#drop { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); display:flex; align-items:center; justify-content:center; width:260px; max-width:100%; height:58px; border:2px dashed #fff0b87a; background:#101e3277; padding:10px; font-size:13px; text-align:center; transition:width 220ms ease-out,height 220ms ease-out,background-color 160ms,border-color 160ms; }
#drop.ready { border-color:var(--cyan); background:#203e48; }
#drop.over { background:#376846; border-color:var(--cyan); }
#drop.over::after { content:''; position:absolute; inset:5px; border:1px solid var(--cyan); pointer-events:none; }
#answerEffects { position:fixed; inset:0; z-index:90; pointer-events:none; overflow:hidden; }
.answer-pixel { position:absolute; width:8px; height:8px; background:var(--color); animation:answer-burst 800ms ease-out both; }
.answer-pixel.star { width:14px; height:14px; clip-path:polygon(35% 0,65% 0,65% 35%,100% 35%,100% 65%,65% 65%,65% 100%,35% 100%,35% 65%,0 65%,0 35%,35% 35%); }
@keyframes answer-burst { 0% { opacity:0; transform:translate(-50%,-50%) scale(.4); } 12% { opacity:1; } 75% { opacity:1; } 100% { opacity:0; transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(var(--turn)) scale(.5); } }
#feedback { max-width:850px; margin:0 auto; font-size:15px; text-align:center; line-height:1.6; }
#feedback:empty { display:none; }
#next { align-self:center; font-size:10px; min-width:150px; }
#enableCam { position:absolute; right:10px; top:10px; z-index:3; }
#cursor { position:fixed; width:36px; height:36px; z-index:10000; border:3px solid #fff2b6; background:conic-gradient(#61d6dc var(--fill,0deg),#182235 0); box-shadow:0 0 0 3px #18223580; transform:translate(-50%,-50%); pointer-events:none; color:#fff3b8; text-align:center; line-height:28px; font-size:18px; border-radius:50%; }
#cursor.pinching { background:#e7a44c; box-shadow:0 0 0 7px #f3ce7250; }
.dwelling { outline:4px solid var(--cyan)!important; outline-offset:4px; background-image:linear-gradient(90deg,#61d6dc80 var(--hold),transparent var(--hold))!important; }
dialog { position:fixed; border:3px solid var(--cream); border-radius:0; background:var(--paper); color:#302c2b; max-width:520px; width:calc(100% - 40px); max-height:85dvh; overflow:auto; padding:28px; box-shadow:8px 8px 0 #111a2c; }
dialog::backdrop { background:#101c30c7; }
dialog h2 { font:clamp(15px,2vw,21px)/1.7 var(--pixel); margin:20px 0 16px; }
dialog p { line-height:1.6; font-size:15px; }
dialog .primary { width:100%; margin-top:12px; }
dialog .close { float:right; color:var(--ink); background:transparent; border-color:#18223550; }
dialog a { color:inherit; }
.guide-steps { clear:both; padding-left:22px; line-height:1.65; }
.guide-steps li { padding:6px 0; }
.guide-note { font-size:12px; color:#5e5142; border-top:1px solid #18223530; padding-top:16px; }
.bigicon { font-size:40px; }
.destination-art { clear:both; height:130px; margin-top:12px; background:#647d54 url('assets/sobo-world.png') center/cover; image-rendering:pixelated; display:grid; place-items:center; }
.destination-art svg { width:90px; height:90px; shape-rendering:crispEdges; filter:drop-shadow(4px 4px 0 #18223566); }
#setup { position:fixed; inset:0; z-index:100; display:grid; place-items:center; overflow:auto; padding:64px 30px; background:#263c3b url('assets/sobo-world.png') center/cover; image-rendering:pixelated; }
.title-panel { position:relative; width:min(46%,520px); margin-left:35%; padding:40px 32px 24px; text-align:center; background:#182235ed; border:3px solid var(--cream); box-shadow:7px 7px 0 #101b2f80; }
.game-title { font:clamp(24px,3.8vw,48px)/1.6 var(--pixel); letter-spacing:-2px; color:var(--cream); margin:0; text-shadow:3px 3px 0 #db492a; }
.game-title span { font-size:.83em; }
.byline { color:#b8c7c0; font-size:12px; margin:16px 0 32px; }
.title-panel .primary { width:100%; font-size:12px; padding:16px; }
#setupStatus { font-size:12px; line-height:1.6; color:#c1cbbd; margin:16px 0 0; min-height:20px; }
body:not(.playing) #camera { position:fixed; bottom:64px; right:5%; width:112px; height:80px; z-index:3; border:2px solid var(--cream); object-fit:cover; transform:scaleX(-1); pointer-events:none; }
body:not(.camera-ready) #camera { display:none; }
@media(max-width:700px) {
  header { flex-basis:64px; padding:10px 68px 10px 16px; gap:10px; }
  header a { max-width:110px; font-size:9px; }
  .header-actions { gap:10px; }
  #progress { font-size:9px; }
  #soundToggle { top:10px; right:12px; }
  .map-heading { padding:8px 16px 14px; }
  .map-heading h2 { font-size:14px; }
  .map { margin:0 16px; }
  .pin { min-width:0; width:46%; max-width:180px; padding:4px; }
  .pin strong { font-size:8px; padding:8px 6px; }
  .landmark svg { width:54px; height:54px; }
  .landmark { margin-bottom:6px; }
  .pin small { font-size:10px; }
  .compass { font-size:9px; right:10px; top:10px; }
  footer { padding:10px 16px; font-size:11px; }
  .footer-credit { display:none; }
  .stage { margin:0 12px; }
  .gamebar { padding:0 12px 12px; gap:10px; flex-basis:66px; }
  .gamebar strong { font-size:9px; }
  #counter { font-size:10px; }
  .quiz { padding:60px 14px 18px; gap:18px; justify-content:flex-start; }
  .quiz h2 { font-size:14px; }
  #answers { flex-direction:column; gap:12px; }
  .answer { flex:none; width:100%; max-width:none; min-height:68px; font-size:10px; padding:12px; }
  #drop { width:100%; padding:14px 8px; font-size:12px; }
  #feedback { font-size:13px; }
  .title-panel { width:100%; max-width:410px; margin:0; padding:32px 24px 24px; }
  #setup { padding:70px 24px 28px; background-position:25% center; }
  .game-title { font-size:clamp(23px,6vw,36px); }
  dialog { padding:20px; }
  body:not(.playing) #camera { width:80px; height:60px; right:25px; bottom:62px; }
}
@media(max-height:600px) and (min-width:701px) {
  header { flex-basis:58px; }
  #soundToggle { top:7px; }
  .map-heading { padding:0 4% 8px; }
  .map-heading h2 { font-size:15px; }
  .map { min-height:160px; }
  .landmark svg { width:38px; height:38px; }
  .landmark { margin-bottom:4px; }
  .pin strong { font-size:8px; padding:7px; }
  .gamebar { flex-basis:52px; padding-bottom:8px; }
  .quiz { gap:8px; padding:46px 24px 12px; justify-content:flex-start; }
  .quiz h2 { font-size:13px; }
  .answer { min-height:60px; font-size:10px; }
  #drop { padding:10px 20px; }
  .title-panel { padding:24px; }
  .game-title { font-size:28px; }
  .byline { margin:10px 0 20px; }
  footer { flex-basis:36px; }
  #feedback { font-size:12px; }
  #next { min-height:36px; padding:6px 12px; font-size:9px; }
}
@media(max-height:700px) and (max-width:700px) {
  .quiz { padding:50px 12px 12px; gap:10px; }
  .quiz h2 { font-size:11px; }
  .answer { min-height:44px; padding:8px; font-size:9px; }
  #answers { gap:10px; }
  #drop { padding:10px 6px; }
  #feedback { font-size:12px; }
  #next { min-height:38px; padding:6px 12px; }
}
@media(prefers-reduced-motion:reduce) { button,#drop { transition:none; } .answer-pixel { display:none; animation:none; } }
