* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #0f2233; color: #f4f1e8; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; border-radius: 12px; min-height: 44px; min-width: 44px; padding: 0 16px; background: #24435c; }
button:hover { background: #2e5675; }
a { color: #9fd8ff; }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; font: 600 11px/1 system-ui, sans-serif; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px #0009, 0 0 3px #0008; transform: translate(10px, -50%); }
.tag.mayday { color: #ffd0d0; }
.tag .fuel { color: #ff6b6b; margin-left: 3px; }
.tag .gauge { display: block; width: 30px; height: 3px; margin-top: 3px; background: #0006; border-radius: 2px; overflow: hidden; }
.tag .gauge i { display: block; height: 100%; background: #7ee08a; }
.tag.low { color: #ffd0d0; }
.tag.low .gauge i { background: #ff5252; animation: blink .4s infinite alternate; }
#hint { position: absolute; inset: 0; pointer-events: none; }
#hint .finger { position: absolute; left: var(--fx); top: var(--fy); width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff8; border: 3px solid #fff; box-shadow: 0 2px 8px #0006; opacity: var(--fo); }
#hint span { position: absolute; left: var(--lx); top: var(--ly); transform: translate(-50%, 26px); padding: 6px 10px; border-radius: 8px; background: #0f2233e6; color: #fff; font: 600 13px/1.2 system-ui, sans-serif; white-space: nowrap; }
.edge { position: absolute; width: 0; height: 0; transform: translate(-50%, -50%); }
.edge i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; opacity: .85; animation: blink .5s infinite alternate; }
.edge.mayday i { border-color: #ff5252; }
@keyframes blink { to { opacity: .25; } }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; gap: 8px; align-items: center; justify-content: center; }
#hud-top span { background: #0f2233cc; padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
#hud-top .icon { pointer-events: auto; background: #0f2233cc; font-weight: 800; padding: 0; width: 44px; }
#card { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 52px); left: 50%; transform: translateX(-50%); background: #0f2233e6; padding: 8px 12px; border-radius: 12px; font-size: 13px; text-align: center; max-width: 92vw; }
#card b { font-size: 14px; }
#toast { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 112px); left: 50%; transform: translateX(-50%); background: #0f2233ee; padding: 10px 16px; border-radius: 14px; font-weight: 700; text-align: center; max-width: 88vw; }
#toast.red { background: #8a1c1cee; }
#radio { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #0f2233e6; padding: 8px 14px; border-radius: 12px; font-size: 14px; max-width: 94vw; text-align: center; }
#radio b { color: #9fd8ff; }
#radio.mayday { background: #8a1c1cee; }
#radio.mayday b { color: #fff; }

.sheet { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #0a1824a8; padding: 16px; }
.sheet[hidden], [hidden] { display: none !important; }
.panel { background: #f4f1e8; color: #17283a; border-radius: 20px; padding: 22px 20px; width: min(420px, 100%); text-align: center; box-shadow: 0 10px 40px #0007; max-height: 100%; overflow: auto; }
.panel h1 { font-size: 40px; letter-spacing: -1px; }
.panel h2 { font-size: 28px; margin-bottom: 4px; }
.panel p { margin: 8px 0; }
.panel a { color: #1f6fa8; }
.lede { font-size: 17px; }
.today { font-weight: 700; color: #1f6fa8; }
.how { font-size: 15px; }
.legend { list-style: none; text-align: left; margin: 12px auto; font-size: 14px; max-width: 330px; }
.legend li { margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot.heavy, .c-heavy { background: none; color: #d9790f; } .dot.heavy { background: #ff9f43; }
.dot.jet { background: #39a9e0; } .c-jet { color: #1e88c4; }
.dot.prop { background: #43c66b; } .c-prop { color: #22994a; }
.big { font-size: 18px; font-weight: 800; padding: 0 26px; min-height: 52px; background: #1f6fa8; color: #fff; margin: 8px 4px; }
.big:hover { background: #2681c2; }
.big.alt { background: #24435c; }
.panel button:not(.big) { background: #dfe7ee; color: #17283a; margin: 4px; }
.row { display: flex; justify-content: center; flex-wrap: wrap; }
.small { font-size: 12px; opacity: .8; }
.score { font-size: 34px; font-weight: 800; }
body.touch .mouse-only, body:not(.touch) .touch-only { display: none; }

/* The end-screen vote, the fake door and the studio row (house rules §4) */
#mark { display: block; font-size: 11px; opacity: .6; margin: 2px 0 6px; }
#vote { margin-top: 10px; border-top: 1px solid #17283a22; }
#vote p.small { margin: 8px 0 4px; }
#vote .opts { display: flex; gap: 6px; overflow-x: auto; justify-content: safe center; scrollbar-width: thin; touch-action: pan-x pan-y; padding-bottom: 2px; }
#vote .opts button { flex: none; white-space: nowrap; min-height: 44px; font-size: 13px; padding: 4px 10px; margin: 0; }
#door { min-height: 44px; font-size: 13px; margin-top: 8px !important; border: 1px dashed #17283a55; background: transparent !important; }
#more { margin: 10px -8px 0; }
#result .panel { padding-top: 16px; padding-bottom: 14px; }
