:root { --blue: #2447f9; --yellow: #ffd129; --ink: #12162a; --paper: #f4f6fb; --line: #dfe5f1; --dim: #667091; --dock: calc(76px + env(safe-area-inset-bottom)); }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { height: 100dvh; overflow: hidden; background: var(--paper); color: var(--ink); font: 500 14px/1.5 "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

main { position: relative; width: 100%; height: 100%; }
.tab { position: absolute; inset: 0; display: none; }
.tab.active { display: block; }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; background: linear-gradient(#6fa8ff, #cfe3ff 55%); }
.labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.labels span { position: absolute; left: 0; top: 0; padding: 2px 8px; border-radius: 5px; background: #fff; box-shadow: 0 2px 8px #12162a33; font-size: 11px; font-weight: 800; white-space: nowrap; }
.labels .place::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--dot); }
.labels .who { background: var(--yellow); }
.labels .me { background: var(--ink); color: #fff; }
.labels .live { background: #e5254a; color: #fff; }
#live { position: absolute; z-index: 1; top: 84px; left: 12px; padding: 6px 12px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
#live.on { background: #e5254a; }
#keyForm input { margin-bottom: 10px; }

header { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 76px); padding: 8px 16px 8px 8px; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px #12162a22; }
.logo { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--blue); color: var(--yellow); font-size: 22px; font-weight: 900; }
h1 { font-size: 15px; font-weight: 900; line-height: 1.2; letter-spacing: -.02em; }
header p { font-size: 12px; color: var(--dim); }
.day { padding: 0 6px; border-radius: 4px; background: var(--yellow); color: var(--ink); font-size: 10px; font-weight: 900; }

.tools { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #12162a22; }
.tools button { width: 42px; height: 42px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 19px; font-weight: 800; }
.tools button:last-child { border: 0; color: var(--blue); }
#joystick { position: absolute; left: 16px; bottom: calc(var(--dock) + 8px); width: 96px; height: 96px; border: 2px solid #fff; border-radius: 24px; background: #ffffff88; touch-action: none; }
#knob { position: absolute; left: 28px; top: 28px; width: 36px; height: 36px; border-radius: 12px; background: var(--blue); pointer-events: none; }
#enter { position: absolute; right: 16px; bottom: calc(var(--dock) + 24px); max-width: calc(100% - 144px); }
.hint { position: absolute; left: 50%; bottom: var(--dock); transform: translateX(-50%); padding: 4px 12px; border-radius: 6px; background: #12162acc; color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; }
@media (max-width: 720px), (pointer: coarse) { .hint { display: none; } }

nav { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; width: min(420px, calc(100% - 24px)); padding: 6px; border-radius: 16px; background: var(--ink); box-shadow: 0 10px 30px #12162a55; }
nav button { flex: 1; padding: 10px 0; border: 0; border-radius: 11px; background: none; color: #aab4d4; font-size: 12px; font-weight: 800; }
nav button.active { background: var(--yellow); color: var(--ink); }

.btn { display: inline-block; padding: 11px 18px; border: 2px solid var(--blue); border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; text-align: center; text-decoration: none; }
.btn.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn.block { display: block; width: 100%; }

.page { overflow-y: auto; padding: 24px 16px calc(var(--dock) + 24px); }
.page > * { max-width: 560px; margin-inline: auto; }
.page h2 { font-size: 30px; font-weight: 900; line-height: 1.15; letter-spacing: -.03em; }
.page h3 { margin-top: 28px; margin-bottom: 10px; font-size: 17px; font-weight: 900; }
.muted { color: var(--dim); }
.card { margin-top: 12px; padding: 16px; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px #12162a0f; overflow-wrap: anywhere; }
.card > * + * { margin-top: 10px; }
.card.hero { background: var(--blue); color: #fff; }
.card.hero .tag { background: var(--yellow); color: var(--ink); }
.card.hero h4 { font-size: 20px; line-height: 1.25; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--paper); font-size: 11px; font-weight: 900; white-space: nowrap; }
.timeline { margin-top: 0; border-left: 3px solid var(--line); padding-left: 14px; }
.timeline > div { padding: 8px 0; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; }
label { display: block; font-size: 12px; font-weight: 800; }
input, select { width: 100%; margin-top: 4px; padding: 11px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500; }
input:focus, select:focus { border-color: var(--blue); outline: 0; }
.bar { height: 6px; margin-top: 6px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.bar span { display: block; height: 100%; }
#idCanvas { display: block; width: 100%; max-width: 320px; height: auto; margin-inline: auto; border-radius: 18px; box-shadow: 0 12px 30px #2447f944; }

dialog { margin: auto; width: min(340px, calc(100% - 32px)); padding: 22px; border: 0; border-top: 6px solid var(--yellow); border-radius: 16px; }
dialog::backdrop { background: #12162a99; }
dialog p { margin: 8px 0 16px; color: var(--dim); }
