:root {
  --ink: #3b2c1f; --paper: #fff8ea; --glass: rgba(255, 248, 234, .78); --glass-d: rgba(35, 28, 48, .6);
  --accent: #e8893c; --accent2: #5aa6a0; --gold: #f6c85f; --line: rgba(80, 55, 30, .18);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fdf8ec; font-family: var(--font); color: var(--ink); touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
canvas#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
button, select, input { font-family: inherit; }
.i { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* HUD */
#hud { position: absolute; left: calc(14px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; gap: 8px; flex-wrap: wrap; max-width: calc(100vw - 150px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); box-shadow: 0 2px 10px rgba(60, 40, 10, .18), inset 0 0 0 1px rgba(255, 255, 255, .5); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.pill .dim { opacity: .5; font-weight: 700; margin-left: -3px; }
.pill .i { color: var(--accent); }
#pill-time .i { color: #f0a23a; }
#topright { position: absolute; right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); display: flex; gap: 8px; }
#topright .ibtn { pointer-events: auto; }
.ibtn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(60, 40, 10, .18), inset 0 0 0 1px rgba(255, 255, 255, .5); transition: transform .12s, background .2s; }
.ibtn:hover { transform: translateY(-1px); background: #fff; } .ibtn:active { transform: scale(.94); }
.ibtn:focus-visible, .btn:focus-visible, .tbtn:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

#compass { position: absolute; left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-t)); width: min(340px, 44vw); height: 34px; border-radius: 99px; overflow: hidden; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(60, 40, 10, .18), inset 0 0 0 1px rgba(255, 255, 255, .5); font-weight: 800; font-size: 12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#compass-strip { position: absolute; top: 0; height: 100%; left: 0; width: 100%; will-change: transform; }
#compass-strip span { position: absolute; top: 50%; transform: translate(-50%, -50%); letter-spacing: .08em; opacity: .75; }
#compass-strip span.card { opacity: 1; color: var(--accent); font-size: 14px; }
#compass-mark { position: absolute; left: 50%; bottom: 3px; width: 0; height: 0; transform: translateX(-50%); border: 5px solid transparent; border-bottom: 6px solid var(--ink); border-top: 0; }
#compass-target { position: absolute; top: 4px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); display: grid; place-items: center; font-size: 12px; transition: left .15s linear; }
@media (max-width: 640px) {
  #compass { top: calc(60px + var(--safe-t)); width: min(300px, 78vw); height: 30px; }
  #hud { gap: 5px; flex-wrap: nowrap; left: calc(10px + var(--safe-l)); top: calc(10px + var(--safe-t)); max-width: none; }
  .pill { padding: 5px 9px 5px 8px; font-size: 13px; gap: 4px; } .pill .i { width: 17px; height: 17px; }
  #pill-time #time-text { display: none; } #pill-time { padding: 5px 8px; }
  #topright { gap: 5px; right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t)); } .ibtn { width: 34px; height: 34px; border-radius: 11px; } .ibtn .i { width: 18px; height: 18px; }
  #chal { top: calc(100px + var(--safe-t)); }
  .sheet { padding: 14px 14px 12px; border-radius: 20px; }
}
@media (max-width: 380px) { #pill-time { display: none; } }
body.touch #hint { bottom: calc(210px + var(--safe-b)); }
body.touch #toast { bottom: calc(240px + var(--safe-b)); }
body.touch #card { bottom: calc(190px + var(--safe-b)); }

#toast { position: absolute; left: 50%; bottom: calc(22% + var(--safe-b)); transform: translate(-50%, 12px); padding: 10px 18px; border-radius: 99px; background: var(--glass-d); color: #fff; font-weight: 800; font-size: 15px; opacity: 0; transition: opacity .3s, transform .3s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: center; max-width: 86vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#hint { position: absolute; left: 50%; bottom: calc(10% + var(--safe-b)); transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: var(--glass-d); color: #fff; font-weight: 700; font-size: 14px; max-width: 86vw; text-align: center; }
#card { position: absolute; left: 50%; bottom: calc(14% + var(--safe-b)); transform: translate(-50%, 20px); display: flex; gap: 14px; align-items: center; width: min(440px, 92vw); padding: 14px 18px; border-radius: 22px; background: var(--paper); box-shadow: 0 10px 40px rgba(60, 30, 0, .35), inset 0 0 0 2px rgba(246, 200, 95, .7); opacity: 0; transition: opacity .5s, transform .5s cubic-bezier(.2, .9, .3, 1.2); }
#card.show { opacity: 1; transform: translate(-50%, 0); }
.card-ico { font-size: 38px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.card-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 900; color: var(--accent); }
#card h3 { margin: 2px 0 4px; font-size: 20px; } #card p { margin: 0; font-size: 14px; line-height: 1.4; opacity: .85; }
#chal { position: absolute; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); text-align: center; padding: 8px 20px 10px; border-radius: 18px; background: var(--glass-d); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-width: 170px; }
.chal-name { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 900; opacity: .8; }
.chal-time { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chal-time.low { color: #ffb0a0; }
.chal-gates { display: flex; gap: 4px; justify-content: center; margin-top: 4px; } .chal-gates i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); } .chal-gates i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
#fps { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); font: 600 11px/1.4 ui-monospace, Menlo, Consolas, monospace; color: #fff; background: rgba(0,0,0,.55); padding: 6px 9px; border-radius: 8px; white-space: pre; }

/* touch */
#touch { position: absolute; inset: 0; }
#stick { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: rgba(255, 248, 234, .25); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); display: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .8); box-shadow: 0 2px 8px rgba(0,0,0,.25); transform: translate(-50%, -50%); }
.tbtn { position: absolute; pointer-events: auto; border: 0; border-radius: 50%; background: rgba(255, 248, 234, .6); color: var(--ink); font-weight: 900; letter-spacing: .06em; box-shadow: 0 3px 12px rgba(0,0,0,.25), inset 0 0 0 2px rgba(255,255,255,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: none; }
.tbtn:active { background: #fff; transform: scale(.94); }
.tbtn.big { right: calc(22px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 92px; height: 92px; font-size: 15px; }
.tbtn:not(.big):not(.small) { right: calc(126px + var(--safe-r)); bottom: calc(30px + var(--safe-b)); width: 68px; height: 68px; font-size: 13px; }
.tbtn.small { right: calc(30px + var(--safe-r)); bottom: calc(132px + var(--safe-b)); width: 52px; height: 52px; font-size: 22px; }

/* loading */
#loading { position: absolute; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; pointer-events: auto; background: radial-gradient(120% 90% at 50% 100%, #ffd9a0 0%, #fff0d2 45%, #fdf8ec 100%); transition: opacity .8s ease; }
#loading.hide { opacity: 0; pointer-events: none; }
.load-sun { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c9, #f9c762 55%, #f19a45); box-shadow: 0 0 60px 20px rgba(249, 199, 98, .55); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
#loading h1 { margin: 6px 0 0; font-size: clamp(36px, 8vw, 58px); letter-spacing: -.02em; font-weight: 900; } #loading h1 span { color: var(--accent); }
.load-bar { width: min(280px, 70vw); height: 8px; border-radius: 9px; background: rgba(60, 40, 10, .12); overflow: hidden; } .load-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #f6c85f, #e8893c); transition: width .25s; border-radius: 9px; }
#load-text { margin: 0; opacity: .7; font-weight: 700; min-height: 1.4em; } .load-tip { margin: 8px 0 0; max-width: 360px; opacity: .6; font-size: 13px; line-height: 1.5; }
#btn-start { padding: 14px 30px; border: 0; border-radius: 99px; font-size: 18px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #f6a04d, #e0702f); box-shadow: 0 6px 0 #b9541e, 0 12px 24px rgba(180, 80, 20, .35); cursor: pointer; } #btn-start:active { transform: translateY(3px); box-shadow: 0 3px 0 #b9541e; }

/* panels */
.panel { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(40, 28, 20, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: auto !important; padding: 12px; }
.panel[hidden] { display: none; }
.sheet { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 24px; padding: 18px 20px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); user-select: none; touch-action: pan-y; }
.sheet.wide { width: min(680px, 100%); }
.sheet header { display: flex; justify-content: space-between; align-items: center; } .sheet h2 { margin: 0; font-size: 24px; } .sheet h4 { margin: 14px 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.x { border: 0; background: rgba(0,0,0,.07); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 14px; } @media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 13px; } .grid label output { float: right; opacity: .6; font-weight: 700; }
.grid label.chk { flex-direction: row; align-items: center; gap: 8px; }
select, input[type=range] { width: 100%; } select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--ink); }
input[type=range] { accent-color: var(--accent); height: 28px; }
.keys { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(90, 166, 160, .12); font-size: 12.5px; line-height: 1.7; } .keys b { color: var(--accent2); }
footer { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.btn { padding: 10px 20px; border: 0; border-radius: 99px; font-weight: 900; font-size: 14px; color: #fff; background: var(--accent); cursor: pointer; box-shadow: 0 3px 0 #b9541e; } .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b9541e; } .btn.ghost { background: rgba(0,0,0,.08); color: var(--ink); box-shadow: none; }
.pct { display: flex; gap: 12px; align-items: center; margin-top: 10px; } .pct-bar { flex: 1; height: 12px; border-radius: 9px; background: rgba(0,0,0,.08); overflow: hidden; } .pct-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f6c85f, #e8893c); border-radius: 9px; transition: width .6s; } #pct-text { font-weight: 900; font-variant-numeric: tabular-nums; }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.jcell { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.05); font-weight: 800; font-size: 14px; } .jcell .e { font-size: 26px; } .jcell small { display: block; font-weight: 600; opacity: .65; font-size: 12px; line-height: 1.35; } .jcell.locked { opacity: .45; filter: grayscale(1); } .jcell.done { background: rgba(246, 200, 95, .28); }
.shells { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; } .shells i { aspect-ratio: 1; border-radius: 50%; background: rgba(0,0,0,.09); display: grid; place-items: center; font-style: normal; font-size: 13px; } .shells i.on { background: radial-gradient(circle at 35% 30%, #fff1b8, #f6c85f 60%, #e49a3a); box-shadow: 0 0 8px rgba(246, 200, 95, .8); }
@media (max-width: 520px) { .shells { grid-template-columns: repeat(8, 1fr); } }

/* photo */
#photo-ui { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px calc(12px + var(--safe-b)); display: flex; justify-content: center; }
.ph-bar { pointer-events: auto; display: flex; gap: 14px; align-items: end; flex-wrap: wrap; justify-content: center; padding: 12px 16px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.ph-bar label { display: flex; flex-direction: column; gap: 3px; font-weight: 800; font-size: 12px; min-width: 110px; } .ph-bar label.chk { flex-direction: row; align-items: center; min-width: 0; gap: 6px; }
#photo-ui[hidden] { display: none; }
#nogl { position: absolute; inset: 0; z-index: 90; display: grid; place-items: center; text-align: center; background: #fdf8ec; padding: 24px; } #nogl[hidden] { display: none; } #nogl h2 { margin: 0 0 8px; } #nogl p { max-width: 380px; opacity: .75; line-height: 1.5; }
[hidden] { display: none !important; }
body.photo #hud, body.photo #topright, body.photo #compass, body.photo #touch, body.photo #chal { display: none; }
.pill, .ibtn { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .load-sun { animation: none; } #card, #toast { transition: none; } }
@media (prefers-color-scheme: dark) { :root { --paper: #2b2438; --ink: #f6ead8; --glass: rgba(43, 36, 56, .74); --line: rgba(255,255,255,.14); } #loading { background: radial-gradient(120% 90% at 50% 100%, #8a4d6a 0%, #2a2347 55%, #15122b 100%); color: #fff0d8; } .sheet, #card { color: var(--ink); } select { background: #3a3150; } .jcell, .x, .btn.ghost { background: rgba(255,255,255,.1); } html, body { background: #15122b; } }

/* ---- map + minimap (Step 1 expansion) */
#minimap { position: fixed; left: calc(12px + var(--safe-l, 0px)); top: calc(56px + var(--safe-t, 0px)); width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 2px 12px rgba(40, 30, 10, .35); z-index: 5; pointer-events: none; background: #6fb2d0; }
#mapwrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(30, 28, 40, .55); backdrop-filter: blur(4px); cursor: pointer; }
#mapwrap[hidden] { display: none; }
#mapfull { border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 255, 255, .75); max-width: 96vw; max-height: 86vh; }
.maphint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; background: var(--glass, rgba(255, 255, 255, .8)); font-weight: 700; font-size: 13px; }
@media (max-width: 700px) { #minimap { width: 80px; height: 80px; top: calc(92px + var(--safe-t, 0px)); } }

#placecard { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b, 0px)); z-index: 6; pointer-events: none; display: grid; gap: 1px; padding: 8px 16px; border-radius: 14px; background: var(--glass, rgba(255, 255, 255, .85)); backdrop-filter: blur(10px); box-shadow: 0 2px 12px rgba(60, 40, 10, .22); text-align: center; max-width: 88vw; }
#placecard[hidden] { display: none; } #placecard b { font-size: 15px; } #placecard span { font-size: 12px; opacity: .75; } #placecard i { font-size: 12px; font-style: normal; font-weight: 800; color: #b5651d; }

/* ---- riding HUD */
#ridecard { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t, 0px)); z-index: 7; pointer-events: none; min-width: 210px; padding: 9px 16px 8px; border-radius: 16px; background: var(--glass, rgba(255, 255, 255, .85)); backdrop-filter: blur(10px); box-shadow: 0 2px 14px rgba(60, 40, 10, .25); text-align: center; display: grid; gap: 4px; }
#ridecard[hidden] { display: none; } #ridecard .rc-top { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; } #ridecard b { font-size: 16px; } #ridecard span { font-size: 12px; font-weight: 800; color: #b5651d; } #ridecard small { font-size: 11px; opacity: .7; }
#ridecard .rc-bar { height: 7px; border-radius: 99px; background: rgba(0, 0, 0, .12); overflow: hidden; } #ridecard .rc-bar[hidden] { display: none; } #ridecard .rc-bar i { display: block; height: 100%; width: 100%; background: #4caf6e; transition: width .2s; }
#tb-use { position: fixed; right: calc(18px + var(--safe-r, 0px)); bottom: calc(220px + var(--safe-b, 0px)); z-index: 8; width: 74px; height: 74px; border-radius: 50%; border: 0; font-weight: 900; font-size: 13px; color: #fff; background: #b5651d; box-shadow: 0 3px 14px rgba(0, 0, 0, .35); } #tb-use[hidden] { display: none; }
body.riding #placecard { display: none; }

/* ---- interaction card + coin pill */
#usecard { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b, 0px)); z-index: 9; display: grid; gap: 3px; justify-items: center; padding: 9px 14px 10px; border-radius: 16px; background: var(--glass, rgba(255, 255, 255, .88)); backdrop-filter: blur(10px); box-shadow: 0 2px 14px rgba(60, 40, 10, .28); max-width: 94vw; }
#usecard[hidden] { display: none; } #usecard .uc-title { font-weight: 800; font-size: 15px; } #usecard .uc-sub { font-size: 12px; opacity: .72; margin-top: -2px; }
#usecard .uc-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
#usecard .uc-act { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 11px; border: 0; background: #fff; font-weight: 800; font-size: 13px; color: #171717; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); cursor: pointer; }
#usecard .uc-act:disabled { opacity: .45; cursor: default; } #usecard .uc-act kbd { background: #2b2a33; color: #fff; border-radius: 6px; padding: 1px 6px; font: 800 11px system-ui; } #usecard .uc-act i { font-style: normal; color: #b5651d; font-size: 12px; }
#coin-pill b { color: #b5651d; }
body.riding #usecard { bottom: calc(24px + var(--safe-b, 0px)); }

/* ---- houses: fade, dialogue */
#fade { position: fixed; inset: 0; background: #14121a; opacity: 0; pointer-events: none; z-index: 60; transition: opacity .22s ease; } #fade.on { opacity: 1; pointer-events: auto; }
body.indoors #minimap { display: none; }
#dialogue { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b, 0px)); z-index: 50; width: min(640px, 94vw); padding: 14px 18px 14px; border-radius: 18px; background: rgba(255, 252, 244, .95); backdrop-filter: blur(10px); box-shadow: 0 6px 30px rgba(40, 28, 10, .38); display: grid; gap: 8px; }
#dialogue[hidden] { display: none; } #dialogue .dl-head { display: flex; gap: 10px; align-items: baseline; } #dialogue .dl-head b { font-size: 17px; } #dialogue .dl-head span { font-size: 12px; font-weight: 800; color: #b5651d; text-transform: capitalize; }
#dialogue .dl-text { margin: 0; font-size: 15px; line-height: 1.45; } #dialogue .dl-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
#dialogue .dl-choice { text-align: left; padding: 8px 12px; border-radius: 11px; border: 0; background: #fff; font-weight: 700; font-size: 13.5px; color: #171717; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); cursor: pointer; }
#dialogue .dl-choice:hover:not(:disabled) { background: #fff3d8; } #dialogue .dl-choice:disabled { opacity: .45; cursor: default; } #dialogue kbd { background: #2b2a33; color: #fff; border-radius: 6px; padding: 1px 6px; font: 800 11px system-ui; margin-right: 4px; }
body:has(#dialogue:not([hidden])) #usecard { display: none; }

/* ---- the sea: dive gauge, underwater wash, dive button ---- */
#uwfx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(ellipse at center, rgba(10,70,90,0) 38%, rgba(4,30,48,.55) 100%); mix-blend-mode: multiply; z-index: 1; }
body.underwater #uwfx { opacity: 1; }
#dive { position: absolute; left: 50%; top: calc(64px + var(--safe-t, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px 9px; border-radius: 16px; background: rgba(7, 38, 56, .62); backdrop-filter: blur(6px); color: #e9fbff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.35); pointer-events: none; min-width: 190px; }
#dive[hidden] { display: none; }
#dive .dv-zone { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
#dive .dv-row { display: flex; align-items: baseline; gap: 6px; }
#dive .dv-row b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
#dive .dv-row span { font-size: 12px; opacity: .8; }
#dive .dv-row em { font-style: normal; font-size: 11px; opacity: .75; margin-left: 6px; }
#dive .dv-o2 { width: 92px; height: 8px; border-radius: 5px; background: rgba(255,255,255,.18); overflow: hidden; align-self: center; }
#dive .dv-o2 i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #62e6ff, #b9f6ff); transform-origin: left; transition: background .3s; }
#dive.low .dv-o2 i { background: linear-gradient(90deg, #ff8a5c, #ffd36b); }
#dive .dv-hint { font-size: 11px; font-weight: 700; opacity: .85; min-height: 13px; }
.tbtn.dive:not(.big):not(.small) { display: none; right: calc(30px + var(--safe-r)); bottom: calc(196px + var(--safe-b)); width: 60px; height: 60px; font-size: 12px; background: rgba(170, 235, 255, .7); }
body.swimming .tbtn.dive:not(.big):not(.small) { display: block; }

/* ---- sea journal ---- */
.sea-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; } .sea-title b { font-size: 15px; color: var(--accent2); } .sea-title span { font-size: 12px; font-weight: 700; opacity: .65; }
.sea-tabs { display: flex; gap: 6px; margin: 10px 0 6px; } .sea-tabs button { flex: 1; padding: 8px 6px; border: 0; border-radius: 10px; font-weight: 800; background: rgba(0,0,0,.06); cursor: pointer; color: var(--ink); } .sea-tabs button.on { background: var(--accent2); color: #fff; }
.sea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; }
.sea-card { padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.05); opacity: .7; } .sea-card.on { opacity: 1; background: rgba(90, 166, 160, .14); } .sea-card.shot { box-shadow: inset 0 0 0 2px rgba(240, 160, 60, .55); }
.sea-card .ic { font-size: 24px; display: block; } .sea-card b { display: block; font-size: 13.5px; } .sea-card small { display: block; font-size: 11px; opacity: .7; font-weight: 700; } .sea-card p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.35; opacity: .85; }
.sea-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 4px 0; border-radius: 12px; background: rgba(0,0,0,.05); } .sea-row span { font-size: 22px; } .sea-row b { flex: 1; font-size: 13.5px; } .sea-row small { font-weight: 700; opacity: .7; text-align: right; font-size: 11.5px; }
#sj-body { max-height: 62vh; overflow: auto; } .dim { opacity: .6; font-size: 13px; }

#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 70; transition: opacity .25s; } #flash.on { opacity: .75; transition: none; }
#sj-chart { width: 100%; max-width: 560px; aspect-ratio: 1; border-radius: 14px; display: block; margin: 6px auto; background: #1a4a6a; }

/* ---- harbour desk ---- */
.dk-wallet { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 2px; } .dk-wallet b { font-size: 18px; color: var(--accent2); } .dk-wallet span { font-size: 12px; font-weight: 700; opacity: .7; }
#dk-body { max-height: 58vh; overflow: auto; padding-right: 4px; } #dk-body h4 { margin: 12px 0 6px; }
.dk-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin: 4px 0; border-radius: 12px; background: rgba(0,0,0,.05); flex-wrap: wrap; } .dk-row .dk-l { flex: 1 1 200px; font-size: 13.5px; } .dk-row small { flex: 1 1 180px; font-weight: 700; opacity: .7; font-size: 11.5px; }
.dk-card { margin: 8px 0; padding: 4px; border-radius: 14px; background: rgba(90,166,160,.12); } .dk-ups { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.dk-btn { border: 0; border-radius: 99px; padding: 7px 14px; font-weight: 800; font-size: 12.5px; cursor: pointer; background: rgba(0,0,0,.12); color: var(--ink); } .dk-btn.go { background: var(--accent); color: #fff; } .dk-btn:disabled { opacity: .4; cursor: default; } .dk-btn:not(:disabled):active { transform: translateY(1px); }
#dk-msg { min-height: 18px; margin-top: 8px; font-weight: 800; font-size: 13px; } #dk-msg.ok { color: #2f8f5b; } #dk-msg.bad { color: #c0483b; }
#holdpill { position: absolute; left: calc(14px + var(--safe-l, 0px)); top: 112px; padding: 5px 11px; border-radius: 99px; background: rgba(20, 50, 70, .62); color: #fff; font-weight: 800; font-size: 12px; backdrop-filter: blur(5px); } #holdpill[hidden] { display: none; }

body.sea-panel #minimap, body.sea-panel #compass, body.sea-panel #dive, body.sea-panel #holdpill { display: none; }
@media (max-width: 700px) { #dive { top: calc(104px + var(--safe-t, 0px)); left: auto; right: calc(12px + var(--safe-r, 0px)); transform: none; min-width: 168px; padding: 6px 12px 7px; } #dive .dv-row b { font-size: 22px; } #holdpill { top: 188px; } }

/* GPS route card and place search on the big map */
#gpscard { position: fixed; left: 50%; transform: translateX(-50%); top: calc(74px + var(--safe-t, 0px)); z-index: 7; display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; align-items: center; padding: 8px 12px 8px 16px; border-radius: 14px; background: rgba(30, 40, 62, .82); color: #fff; backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0, 0, 0, .28); min-width: 220px; }
#gpscard[hidden] { display: none; } #gpscard b { font-size: 15px; grid-column: 1; } #gpscard span { font-size: 12px; opacity: .8; grid-column: 1; } #gpscard i { font-size: 13px; font-style: normal; font-weight: 800; color: #7cc4ff; grid-column: 1; }
#gpscard button { grid-column: 2; grid-row: 1 / span 3; border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 800; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
#mapsearch { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; width: min(520px, 86vw); padding: 10px 14px; border-radius: 12px; border: 0; font: 600 14px system-ui, sans-serif; background: rgba(255, 255, 255, .94); color: #1b2230; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); z-index: 3; }

/* the way out of a house is always on screen indoors (E at the door works too) */
#leave-btn { position: fixed; left: 16px; bottom: 16px; z-index: 55; padding: 10px 16px; border: 0; border-radius: 14px; background: var(--glass); color: var(--ink); font: 700 14px/1 var(--font); box-shadow: 0 4px 14px rgba(40, 25, 10, .22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; touch-action: manipulation; }
#leave-btn[hidden] { display: none; }
#leave-btn:hover { background: var(--paper); }

/* Passenger movement uses the aisle joystick and contextual seat/exit actions. */
body.public-transit #tb-jump, body.public-transit #tb-sprint, body.public-transit #tb-dive { display: none; }

body.public-transit #usecard .uc-title { display: none; }

/* Keep the passenger status legible without covering a narrow cabin view. */
#ridecard { box-sizing: border-box; max-width: min(520px, calc(100vw - 24px)); }
#ridecard .rc-top b { min-width: 0; }
#ridecard .rc-top span { flex-shrink: 0; }
@media (max-width: 480px) {
  #ridecard { min-width: 0; width: 240px; padding: 7px 10px; }
  #ridecard b { font-size: 13px; }
  #ridecard .rc-top { gap: 8px; }
}
