:root { --blue: #1f5fa8; --blue2: #2c8fc9; --ink: #16202b; --paper: #fbfaf7; --muted: #5c6672; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1a26; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; cursor: pointer; }

#intro { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, rgba(31,95,168,.55), rgba(8,20,34,.92)), #0d1a26; z-index: 20; padding: 16px; transition: opacity .6s; }
#intro.gone { opacity: 0; pointer-events: none; }
.card { background: var(--paper); border-radius: 14px; padding: 28px 30px; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.card.small { max-width: 320px; text-align: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; font-weight: 800; font-size: 30px; padding: 4px 12px; border-radius: 6px; letter-spacing: 1px; }
.brand .sub { font-weight: 700; color: var(--blue); line-height: 1.15; font-size: 15px; }
.brand .sub i { font-weight: 400; font-family: Georgia, serif; color: var(--muted); }
h1 { margin: 18px 0 8px; font-size: 28px; }
.lead { color: #33404d; line-height: 1.5; margin: 0 0 16px; }
.how { background: #eef3f8; border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: #2a3744; }
.how .mob { display: none; }
@media (pointer: coarse) { .how .desk { display: none; } .how .mob { display: block; } }
#loadbar { height: 4px; background: #e2e7ec; border-radius: 2px; margin: 18px 0 12px; overflow: hidden; }
#loadbar i { display: block; height: 100%; width: 0; background: var(--blue2); transition: width .2s; }
#enter, #resume { width: 100%; padding: 13px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 600; }
#enter:disabled { background: #9fb2c6; cursor: default; }
.fine { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; display: none; }
body.playing #hud { display: block; }
#room { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(10,25,40,.62); color: #fff; padding: 7px 16px; border-radius: 20px; font-size: 15px; font-weight: 600; letter-spacing: .2px; opacity: 0; transition: opacity .4s; max-width: calc(100% - 140px); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#room.on { opacity: 1; }
#room small { display: block; font-weight: 400; font-size: 12px; opacity: .85; white-space: normal; }
#cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
#cross.hot { width: 14px; height: 14px; margin: -7px; background: transparent; border: 2px solid #fff; }
#prompt { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); color: #fff; background: rgba(10,25,40,.6); padding: 5px 12px; border-radius: 14px; font-size: 14px; display: none; white-space: nowrap; }
#prompt.on { display: block; }
#menuBtn { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(10,25,40,.62); color: #fff; font-size: 20px; pointer-events: auto; }
#map { position: absolute; right: 12px; bottom: 12px; width: 180px; height: 180px; border-radius: 12px; background: rgba(10,25,40,.55); pointer-events: auto; display: none; }
#map.on { display: block; }
@media (max-width: 600px) { #map { width: 130px; height: 130px; } }

.panel { position: fixed; z-index: 12; background: rgba(251,250,247,.97); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.hidden { display: none !important; }
#tour { top: 64px; right: 12px; width: 300px; max-height: calc(100% - 80px); overflow: auto; padding: 12px 14px; }
@media (max-width: 600px) { #tour { left: 12px; right: 12px; width: auto; } }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 17px; }
.x { border: 0; background: none; font-size: 18px; color: var(--muted); }
#tourList h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
#tourList button { display: block; width: 100%; text-align: left; border: 0; background: #eef3f8; margin: 3px 0; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; }
#tourList button:hover { background: #dfe9f3; }
#tourList button small { color: var(--muted); }
.pfoot { margin-top: 10px; font-size: 13px; color: var(--muted); }

#dialog { left: 50%; bottom: 18px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); padding: 16px 18px; }
#dialog .who { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
#dName { font-weight: 700; font-size: 17px; color: var(--blue); }
#dRole { color: var(--muted); font-size: 13px; }
#dText { line-height: 1.55; font-size: 15.5px; min-height: 2.5em; }
#dOpts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#dOpts button { border: 1px solid #c9d6e3; background: #fff; border-radius: 18px; padding: 7px 13px; font-size: 14px; color: var(--ink); }
#dOpts button:hover { background: #eef3f8; }
#dOpts button .k { color: var(--muted); font-size: 12px; margin-right: 5px; }

#pause { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(8,20,34,.45); }
#stick { position: fixed; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); z-index: 6; display: none; pointer-events: none; }
#stick.on { display: block; }
#knob { position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.6); }
