* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0f1b2d; color: #eef3fa;
  font: 16px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
#menu, #end, #progress { justify-content: center; gap: 12px; }
h1 { margin: 0; font-size: 34px; letter-spacing: .5px; }
.sub { margin: 0 0 8px; color: #9fb2cc; text-align: center; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
.mode { width: min(420px, 100%); background: #1d3352; border-radius: 16px; padding: 16px 18px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; box-shadow: 0 2px 0 #0a1424; }
.mode:active { transform: translateY(1px); background: #25416a; }
.mode b { font-size: 19px; } .mode span { color: #9fb2cc; font-size: 14px; }
#again, #progBack { text-align: center; }
.link { background: none; color: #8fc1ff; padding: 8px; }
.len { display: flex; align-items: center; gap: 8px; color: #9fb2cc; margin-top: 4px; }
.len button { background: #1d3352; border-radius: 10px; padding: 8px 14px; }
.len button.on { background: #3b82f6; color: #fff; }

#game { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); gap: 8px; }
.bar { width: 100%; display: flex; align-items: center; gap: 10px; }
.icon { background: #1d3352; border-radius: 10px; padding: 8px 12px; }
.icon.small { font-size: 14px; padding: 6px 10px; }
.icon.on { background: #3b82f6; }
#prompt { flex: 1; text-align: center; font-size: 22px; font-weight: 700; }
#score { color: #9fb2cc; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
#stage { flex: 1; width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; position: relative; }
#stage svg { width: 100%; height: 100%; max-height: 100%; }
#feedback { min-height: 24px; font-weight: 600; text-align: center; }
#feedback.good { color: #4ade80; } #feedback.bad { color: #f87171; }
#choices { width: min(520px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#choices:empty { display: none; }
#choices button { background: #1d3352; border-radius: 12px; padding: 14px 8px; font-size: 17px; font-weight: 600; }
#choices button.good { background: #15803d; } #choices button.bad { background: #b91c1c; }
.tools { min-height: 8px; }

.st { fill: #d8e2ee; stroke: #0f1b2d; stroke-width: 1; stroke-linejoin: round; }
#map.find .st:active { fill: #b9cbe2; }
.st.good { fill: #4ade80; } .st.bad { fill: #f87171; } .st.reveal { fill: #facc15; }
.st.done { fill: #5f7894; } .st.hl { fill: #facc15; }
.hit { fill: transparent; stroke: #facc15; stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .7; }
#shape path { fill: #facc15; stroke: #0f1b2d; stroke-width: .6; }
.lbl { fill: #0f1b2d; font-size: 13px; font-weight: 700; text-anchor: middle; pointer-events: none; }

#progMap { width: min(700px, 100%); }
#progMap .st.l0 { fill: #d8e2ee; } #progMap .st.l1 { fill: #facc15; } #progMap .st.l2 { fill: #4ade80; }
.legend { display: flex; gap: 6px; align-items: center; color: #9fb2cc; font-size: 14px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.l0 { background: #d8e2ee; } .l1 { background: #facc15; } .l2 { background: #4ade80; }
#missed { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 480px; }
#missed span { background: #3a1d24; color: #fca5a5; border-radius: 8px; padding: 4px 8px; font-size: 14px; }
