/* DEAD RAIL */
:root {
  --bg: #14110f; --panel: rgba(22, 20, 19, 0.94); --panel2: #221e1b; --line: rgba(255, 255, 255, 0.1); --ink: #f3ede4; --mute: #a59b8f;
  --red: #e53935; --red2: #ff5a4f; --hz: #ffcc00; --green: #3ddc84; --blue: #3da5ff; --steel: #8b96a3;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --topH: 50px; --dockH: 88px;
  --disp: 'Bebas Neue', 'Barlow Condensed', Impact, sans-serif; --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif; --body: 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
#app { position: fixed; inset: 0; }
[hidden] { display: none !important; }

#cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; background: #0d0b0a; }
body.ingame #cv { top: calc(var(--topH) + var(--sat)); height: calc(100% - var(--topH) - var(--dockH) - var(--sat) - var(--sab)); }
#labels { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; overflow: hidden; z-index: 2; }
body.ingame #labels { top: calc(var(--topH) + var(--sat)); height: calc(100% - var(--topH) - var(--dockH) - var(--sat) - var(--sab)); }

.screen { position: absolute; inset: 0; display: none; z-index: 5; }
.screen.show { display: block; }
#hud { pointer-events: none; z-index: 4; }
#hud > *:not(.center-banner) { pointer-events: auto; }   /* the big banner must not eat map taps */

/* ---------------------------------------------------------------- shared bits */
.logo { font-family: var(--disp); font-weight: 400; margin: 0; line-height: 0.82; letter-spacing: 2px; display: flex; flex-direction: column; }
.logo span { font-size: clamp(54px, 10vw, 120px); color: #f3ede4; text-shadow: 0 4px 0 #000; }
.logo b { font-size: clamp(64px, 13vw, 156px); color: var(--red); text-shadow: 0 5px 0 #4a0d0b, 0 0 40px rgba(229, 57, 53, 0.45); font-weight: 400; margin-top: -4px; }
.logo.small span { font-size: 42px; } .logo.small b { font-size: 56px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; background: #2c2723; border: 1px solid var(--line); font-family: var(--cond); font-weight: 700; font-size: 18px; letter-spacing: 0.5px; text-decoration: none; text-transform: uppercase; }
.btn:active { transform: translateY(1px); }
.btn.red { background: linear-gradient(#ef4a40, #c62828); border-color: #ff7a70; box-shadow: 0 3px 0 #6d1510; }
.btn.green { background: linear-gradient(#41d987, #1f9d5b); border-color: #7dffb5; color: #062a15; box-shadow: 0 3px 0 #0d4a2a; }
.btn.hz { background: linear-gradient(#ffd84d, #e0a800); color: #2a1f00; border-color: #fff09a; box-shadow: 0 3px 0 #6b5000; }
.btn.small { min-height: 34px; font-size: 15px; padding: 0 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row.center { justify-content: center; }
.center { text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-width: 520px; margin: auto; }
#gate { display: none; place-items: center; } #gate.show { display: grid; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); font-family: var(--cond); font-weight: 600; font-size: 15px; text-decoration: none; }
.muted { color: var(--mute); } .small { font-size: 13px; }
.hz-stripe { background: repeating-linear-gradient(45deg, var(--hz) 0 10px, #1a1a1a 10px 20px); height: 6px; border-radius: 3px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-family: var(--cond); font-weight: 700; font-size: 12px; letter-spacing: 0.5px; background: #333; }

/* ---------------------------------------------------------------- menu */
#menu { background: radial-gradient(120% 90% at 70% 30%, #3a1512 0%, #1a1311 45%, #0d0b0a 100%); overflow: hidden; }
.menu-bg { position: absolute; inset: 0; pointer-events: none; }
.menu-bg .rail { position: absolute; left: -10%; right: -10%; height: 16px; background: repeating-linear-gradient(90deg, #4a3a2e 0 6px, transparent 6px 22px), linear-gradient(transparent 3px, #8b96a3 3px 5px, transparent 5px 11px, #8b96a3 11px 13px, transparent 13px); opacity: 0.35; transform: rotate(-8deg); }
.menu-bg .r1 { top: 70%; } .menu-bg .r2 { top: 86%; transform: rotate(-4deg); opacity: 0.2; }
.menu-bg .mtrain { position: absolute; top: calc(70% - 22px); left: -200px; width: 170px; height: 26px; border-radius: 6px 14px 4px 4px; background: linear-gradient(90deg, #c62828 0 30%, #2b2b2b 30% 32%, #c62828 32% 62%, #2b2b2b 62% 64%, #c62828 64%); box-shadow: 0 0 30px rgba(255, 210, 120, 0.25), inset 0 -6px 0 rgba(0, 0, 0, 0.35); transform: rotate(-8deg); animation: mtrain 9s linear infinite; }
.menu-bg .mtrain::after { content: ''; position: absolute; right: 8px; top: 6px; width: 140px; height: 6px; background: repeating-linear-gradient(90deg, #ffd27a 0 10px, transparent 10px 18px); opacity: 0.8; }
@keyframes mtrain { 0% { left: -220px; top: calc(70% + 10px); } 100% { left: 110%; top: calc(70% - 120px); } }
.menu-bg .swarmdot { position: absolute; right: 8%; top: 18%; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(90, 200, 60, 0.18), transparent 65%); filter: blur(4px); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: 0.7; } }
.menu-wrap { position: absolute; inset: calc(var(--sat) + 18px) calc(var(--sar) + 24px) calc(var(--sab) + 58px) calc(var(--sal) + 24px); display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.25fr); gap: 24px; align-items: center; }
.tagline { font-family: var(--cond); font-weight: 600; font-size: clamp(15px, 2vw, 21px); color: #d8cfc3; margin: 12px 0 8px; letter-spacing: 0.4px; }
.preview-tag { display: inline-block; background: var(--hz); color: #221a00; font-family: var(--cond); font-weight: 800; padding: 3px 10px; border-radius: 6px; letter-spacing: 1px; font-size: 13px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mbtn { text-align: left; background: rgba(28, 25, 23, 0.88); border: 1px solid var(--line); border-left: 4px solid #5a4a3e; border-radius: 10px; padding: 9px 14px; display: flex; flex-direction: column; min-height: 54px; justify-content: center; transition: transform 0.12s, border-color 0.12s; }
.mbtn b { font-family: var(--disp); font-weight: 400; font-size: 26px; letter-spacing: 1.5px; line-height: 1; }
.mbtn small { color: var(--mute); font-family: var(--cond); font-size: 14px; font-weight: 600; }
.mbtn:hover { transform: translateX(3px); border-left-color: var(--red); }
.mbtn.hero { grid-column: span 2; background: linear-gradient(100deg, #c62828, #8e1c17); border-color: #ff7a70; border-left-color: var(--hz); min-height: 70px; }
.mbtn.hero b { font-size: 38px; } .mbtn.hero small { color: #ffd9d4; }
.menu-foot { position: absolute; left: calc(var(--sal) + 24px); right: calc(var(--sar) + 24px); bottom: calc(var(--sab) + 12px); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-foot .who { margin-left: auto; color: var(--mute); font-size: 13px; }
.banner-card { margin-top: 16px; max-width: 420px; }
.dbanner { --bb: linear-gradient(135deg, #3a2f28, #6b5444); position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bb); border: 2px solid rgba(255, 255, 255, 0.15); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); overflow: hidden; cursor: pointer; }
.dbanner.b-steel { border: 3px solid #9aa4b0; box-shadow: inset 0 0 0 2px #5d6670, 0 6px 18px rgba(0, 0, 0, 0.4); }
.dbanner.b-gold { border: 3px solid #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, 0.35); }
.dbanner.b-neon { border: 2px solid #ff2bd6; box-shadow: 0 0 14px #ff2bd6, inset 0 0 10px rgba(43, 243, 255, 0.4); }
.dbanner.b-legend { border: 3px solid transparent; background: var(--bb) padding-box, linear-gradient(90deg, #ffd34d, #ff5a4f, #7b5cff, #3ddc84) border-box; }
.dbanner .ic { width: 52px; height: 52px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; font-size: 30px; flex: none; }
.dbanner .nm { font-family: var(--disp); font-size: 26px; letter-spacing: 1px; line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.dbanner .tt { font-family: var(--cond); font-weight: 700; color: var(--hz); font-size: 14px; text-shadow: 0 1px 0 #000; }
.dbanner .meta { font-size: 12px; color: #eee; opacity: 0.85; font-family: var(--cond); }
.dbanner .lvl { margin-left: auto; text-align: center; font-family: var(--disp); font-size: 30px; line-height: 0.9; text-shadow: 0 2px 0 #000; }
.dbanner .lvl small { display: block; font-family: var(--cond); font-size: 11px; font-weight: 700; }
.xpbar { height: 6px; background: rgba(0, 0, 0, 0.45); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--hz), #ff8a3d); }

/* ---------------------------------------------------------------- sub pages */
#page { background: linear-gradient(#1b1715, #0f0d0c); }
.page-top { position: absolute; left: 0; right: 0; top: 0; height: calc(52px + var(--sat)); padding: var(--sat) calc(var(--sar) + 14px) 0 calc(var(--sal) + 10px); display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(10, 9, 8, 0.8); }
.page-top h2 { font-family: var(--disp); font-weight: 400; font-size: 32px; letter-spacing: 1.5px; margin: 0; }
.page-top .back { width: 42px; height: 42px; border-radius: 10px; background: #2c2723; font-size: 30px; line-height: 1; }
.page-top .tok { margin-left: auto; font-family: var(--cond); font-weight: 700; color: var(--hz); }
.page-body { position: absolute; left: 0; right: 0; top: calc(52px + var(--sat)); bottom: 0; overflow: auto; padding: 16px calc(var(--sar) + 16px) calc(var(--sab) + 24px) calc(var(--sal) + 16px); -webkit-overflow-scrolling: touch; }
.sec { margin: 0 auto 18px; max-width: 1100px; }
.sec h3 { font-family: var(--cond); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 17px; color: var(--mute); margin: 0 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 14px; border-radius: 10px; background: #26211e; border: 2px solid transparent; font-family: var(--cond); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.opt small { display: block; font-weight: 500; color: var(--mute); text-transform: none; font-size: 12px; }
.opt.on { border-color: var(--red); background: #3a1d1a; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile { position: relative; background: #221e1b; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile h4 { margin: 0 0 4px; font-family: var(--cond); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 0.4px; }
.tile p { margin: 0; color: var(--mute); font-size: 13px; }
.tile.on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.35); }
.tile.locked { opacity: 0.6; }
.tile .swatch { height: 44px; border-radius: 8px; margin-bottom: 8px; display: flex; overflow: hidden; }
.tile .swatch i { flex: 1; }
.tile .acts { margin-top: 8px; display: flex; gap: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.tabs button { flex: none; padding: 7px 12px; border-radius: 999px; background: #26211e; font-family: var(--cond); font-weight: 700; font-size: 14px; text-transform: uppercase; white-space: nowrap; }
.tabs button.on { background: var(--red); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme { border-radius: 10px; padding: 10px; min-height: 74px; text-align: left; border: 2px solid transparent; position: relative; overflow: hidden; }
.theme::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.15)); }   /* keeps white text readable on the snowy / sandy maps */
.theme b { font-family: var(--cond); font-weight: 800; font-size: 16px; text-transform: uppercase; text-shadow: 0 1px 2px #000; position: relative; }
.theme small { display: block; font-size: 12px; color: #fff; opacity: 0.85; text-shadow: 0 1px 2px #000; position: relative; }
.theme.on { border-color: #fff; box-shadow: 0 0 0 2px var(--red); }
.region { border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #1f1b18; border: 1px solid var(--line); border-left: 6px solid var(--rc, #888); }
.region h4 { margin: 0; font-family: var(--disp); font-size: 28px; letter-spacing: 1px; font-weight: 400; }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.mission { text-align: left; background: #2a2420; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.mission b { font-family: var(--cond); font-weight: 800; font-size: 17px; text-transform: uppercase; }
.mission .st { color: var(--hz); letter-spacing: 2px; float: right; }
.mission[disabled] { opacity: 0.4; }
.mlist .m { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #221e1b; margin-bottom: 6px; }
.mlist .m .bar { flex: 1; } .mlist .m .bar i { display: block; height: 7px; border-radius: 4px; background: #3a332e; overflow: hidden; } .mlist .m .bar i i { background: var(--green); height: 100%; }
.mlist .m b { font-family: var(--cond); font-size: 16px; }
.tiers { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.tier { flex: none; width: 82px; border-radius: 10px; padding: 8px 6px; background: #221e1b; text-align: center; font-family: var(--cond); font-size: 13px; border: 1px solid var(--line); }
.tier.got { border-color: var(--hz); } .tier.done { opacity: 0.55; }
.tier b { display: block; font-size: 18px; }
table.lb { width: 100%; border-collapse: collapse; font-family: var(--cond); font-size: 16px; }
table.lb td, table.lb th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb th { color: var(--mute); font-size: 13px; letter-spacing: 1px; }
table.lb tr.me td { color: var(--hz); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.statgrid div { background: #221e1b; border-radius: 10px; padding: 10px; }
.statgrid small { display: block; color: var(--mute); font-family: var(--cond); font-weight: 700; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; }
.statgrid b { font-family: var(--disp); font-size: 28px; font-weight: 400; letter-spacing: 1px; }
input.txt, select.txt { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #2a2420; color: var(--ink); padding: 0 12px; font: 600 16px var(--body); }
.seats { display: grid; gap: 6px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #221e1b; border-left: 5px solid var(--pc, #555); }
.seat b { font-family: var(--cond); font-size: 17px; } .seat .sp { margin-left: auto; display: flex; gap: 4px; }
.roomcode { font-family: var(--disp); font-size: 54px; letter-spacing: 8px; color: var(--hz); line-height: 1; }

/* ---------------------------------------------------------------- HUD */
.tbar { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--topH) + var(--sat)); padding: var(--sat) calc(var(--sar) + 8px) 0 calc(var(--sal) + 8px); display: flex; align-items: center; gap: 8px; background: linear-gradient(#0f0d0c, #1a1614); border-bottom: 2px solid #000; box-shadow: 0 2px 0 rgba(255, 255, 255, 0.04); }
.wavechip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 92px; height: 40px; border-radius: 8px; background: #2a1d1a; border: 1px solid #5a2a24; }
.wavechip b { font-family: var(--disp); font-weight: 400; font-size: 20px; letter-spacing: 1px; line-height: 1; color: var(--red2); }
.wavechip span { font-family: var(--cond); font-weight: 700; font-size: 13px; color: #ffd2cc; }
.wavechip.plan { background: #1a2a1f; border-color: #2a5a3a; } .wavechip.plan b { color: var(--green); }
.wavechip.prev { background: #2a2614; border-color: #6a5a1a; } .wavechip.prev b { color: var(--hz); }
.stat { display: flex; flex-direction: column; align-items: flex-start; padding: 0 6px; min-width: 64px; }
.stat small { font-family: var(--cond); font-weight: 700; font-size: 11px; color: var(--mute); letter-spacing: 0.8px; }
.stat b { font-family: var(--disp); font-weight: 400; font-size: 23px; letter-spacing: 0.8px; line-height: 1; }
.stat.cr b { color: var(--hz); }
.coopbar { display: flex; flex-direction: column; min-width: 130px; } .coopbar small { font-family: var(--cond); font-weight: 700; font-size: 11px; color: var(--mute); }
.coopbar > i { display: block; height: 8px; border-radius: 4px; background: #333; overflow: hidden; } .coopbar > i > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #b8ff5a); width: 0; transition: width 0.4s; }
.coopbar b { font-family: var(--cond); font-size: 13px; }
.ticker { flex: 1; min-width: 0; height: 36px; border-radius: 8px; background: #0b0a09; border: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px; overflow: hidden; font-family: var(--cond); font-weight: 600; font-size: 15px; white-space: nowrap; }
.ticker span { overflow: hidden; text-overflow: ellipsis; }
.ticker.bad { border-color: var(--red); color: #ffb3ad; background: #2a0f0d; } .ticker.good { border-color: var(--green); color: #b8ffd6; } .ticker.radio { color: #ffe9a8; }
.ticker span.in { animation: tin 0.35s ease-out; } @keyframes tin { from { transform: translateY(14px); opacity: 0; } }
.tbtns { display: flex; gap: 6px; }
.ib { width: 40px; height: 40px; border-radius: 9px; background: #2a2420; border: 1px solid var(--line); font-size: 19px; }
.dock { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--dockH) + var(--sab)); padding: 6px calc(var(--sar) + 8px) calc(var(--sab) + 6px) calc(var(--sal) + 8px); display: flex; gap: 8px; background: linear-gradient(#1a1614, #0f0d0c); border-top: 2px solid #000; }
.cards { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.tcard { flex: 0 0 auto; width: 128px; height: 100%; border-radius: 10px; background: #26211e; border: 2px solid #3a332e; border-top: 4px solid var(--pc, #888); padding: 4px 8px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.tcard .tn { font-family: var(--disp); font-size: 19px; letter-spacing: 1px; line-height: 1; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.tcard .tn em { margin-left: auto; overflow: hidden; text-overflow: ellipsis; font-style: normal; font-family: var(--cond); font-weight: 700; font-size: 11px; color: var(--mute); letter-spacing: 0.4px; }
.tcard .pax { font-family: var(--cond); font-weight: 800; font-size: 17px; }
.tcard .pax i { display: block; height: 5px; border-radius: 3px; background: #3a332e; overflow: hidden; margin-top: 2px; } .tcard .pax i i { display: block; height: 100%; background: var(--green); }
.tcard .to { font-family: var(--cond); font-weight: 700; font-size: 13px; color: #d8cfc3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard.sel { border-color: #fff; background: #3a302a; box-shadow: 0 0 14px rgba(255, 255, 255, 0.18); }
.tcard.idle .to { color: var(--hz); } .tcard.wait .to { color: #ff9a3d; } .tcard.full .pax { color: var(--green); }
.tcard.locked { opacity: 0.4; pointer-events: none; } .tcard.locked .to { color: var(--mute); }
.tcard .k { position: absolute; right: 6px; bottom: 3px; font-size: 10px; color: #6b625a; font-family: var(--cond); }
.dock-btns { display: flex; gap: 6px; }
.db { width: 58px; border-radius: 10px; background: #2a2420; border: 1px solid var(--line); font-size: 21px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.db small { font-family: var(--cond); font-weight: 700; font-size: 11px; color: var(--mute); }
.db.on { background: #3a2e12; border-color: var(--hz); }

/* labels on the map */
.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; white-space: nowrap; will-change: transform; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }
.lbl .nm { font-family: var(--cond); font-weight: 800; font-size: 14px; letter-spacing: 0.6px; text-transform: uppercase; background: rgba(15, 13, 12, 0.88); padding: 1px 7px; border-radius: 5px 5px 0 0; border-bottom: 2px solid var(--lc, #888); }
.lbl .sv { font-family: var(--cond); font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, 0.92); color: #1a1614; padding: 0 7px; border-radius: 0 0 5px 5px; }
.lbl .sv:empty { display: none; } .lbl .th:empty { display: none; }
.lbl .th { font-style: normal; font-family: var(--cond); font-weight: 800; font-size: 12px; padding: 0 6px; border-radius: 4px; margin-top: 2px; background: var(--lc); color: #111; }
.lbl.lv0 { --lc: #3ddc84; } .lbl.lv1 { --lc: #9be15d; } .lbl.lv2 { --lc: #ffd23f; } .lbl.lv3 { --lc: #ff9a3d; } .lbl.lv4 { --lc: #ff3b3b; } .lbl.lv5 { --lc: #7a1020; }
.lbl.lv5 .th, .lbl.lv4 .th { color: #fff; }
.lbl.crit .th { animation: blink 0.5s steps(2) infinite; font-size: 14px; }
.lbl.crit .sv { background: #ff3b3b; color: #fff; }
.lbl.lv5 .sv { background: #3a0d10; color: #ff8a8a; } .lbl.lv5 .nm { text-decoration: line-through; opacity: 0.8; }
@keyframes blink { 50% { opacity: 0.35; } }
.lbl.t-town .nm { font-size: 12px; } .lbl.small .sv { font-size: 11px; }
.lbl.t-junction .nm { font-size: 10px; background: rgba(15, 13, 12, 0.6); border-bottom: 0; border-radius: 4px; color: #bbb; }
.lbl.t-safe .nm { background: #1f6b40; border-bottom-color: #7dffb0; } .lbl.t-safe .sv { background: #7dffb0; color: #06331a; font-size: 11px; letter-spacing: 1px; }
.lbl.t-depot .nm { background: var(--pc, #555); border-bottom-color: #fff; font-size: 12px; }
.lbl.t-abandoned .nm { background: rgba(60, 50, 45, 0.9); font-style: italic; font-size: 12px; }
.lbl.on .nm { outline: 2px solid #fff; }
.lbl.hid { opacity: 0; pointer-events: none; }
.ttag { position: absolute; left: 0; top: 0; pointer-events: none; font-family: var(--cond); font-weight: 800; font-size: 12px; white-space: nowrap; background: rgba(15, 13, 12, 0.88); border: 1px solid var(--pc); border-radius: 6px; padding: 0 5px; color: #fff; will-change: transform; }
.ttag b { display: inline-block; min-width: 15px; text-align: center; background: var(--pc); border-radius: 4px; color: #111; margin-left: -4px; padding: 0 3px; }
.ttag.on { box-shadow: 0 0 0 2px #fff; } .ttag.full { border-color: var(--green); } .ttag.wait { background: #4a2a0a; border-color: #ff9a3d; color: #ffd2a0; animation: blink 0.8s steps(2) infinite; }
.ttag:not(.mine) { font-size: 10px; opacity: 0.85; }
.flt { position: absolute; left: 0; top: 0; pointer-events: none; font-family: var(--disp); font-size: 26px; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.5); white-space: nowrap; will-change: transform; text-align: center; }
.flt small { display: block; font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: 0.5px; }
.flt.gold { color: var(--hz); font-size: 32px; } .flt.green { color: #7dffb0; } .flt.red { color: #ff5a4f; font-size: 30px; } .flt.other { font-size: 18px; opacity: 0.85; }
.flt.ping { font-size: 30px; }

/* panels over the map */
.info { position: absolute; right: calc(var(--sar) + 8px); top: calc(var(--topH) + var(--sat) + 8px); width: 270px; max-height: calc(100% - var(--topH) - var(--dockH) - var(--sat) - var(--sab) - 16px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; z-index: 6; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.info h4 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 26px; letter-spacing: 1px; line-height: 1; padding-right: 28px; }
.info .x { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 8px; background: #2c2723; }
.info .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0; font-family: var(--cond); font-size: 15px; }
.info .kv span { color: var(--mute); font-weight: 600; } .info .kv b { text-align: right; }
.info .lvpill { display: inline-block; padding: 1px 8px; border-radius: 5px; font-family: var(--cond); font-weight: 800; color: #111; }
.info .btn { width: 100%; margin-top: 6px; }
.auction { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--topH) + var(--sat) + 8px); width: min(560px, 92vw); background: linear-gradient(#2a2210, #1a150a); border: 2px solid var(--hz); border-radius: 12px; padding: 8px 12px; z-index: 7; display: flex; gap: 10px; align-items: center; box-shadow: 0 0 24px rgba(255, 204, 0, 0.25); }
.auction .a-t { flex: 1; min-width: 0; font-family: var(--cond); }
.auction .a-t small { display: block; color: var(--hz); font-weight: 800; letter-spacing: 1px; font-size: 12px; }
.auction .a-t b { font-size: 18px; } .auction .a-t span { display: block; font-size: 13px; color: #d8cfc3; }
.auction .a-c { font-family: var(--disp); font-size: 34px; color: var(--hz); width: 44px; text-align: center; }
.coach { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--dockH) + var(--sab) + 10px); width: min(560px, 94vw); background: #fff8e6; color: #241c12; border-radius: 12px; padding: 10px 14px 10px 54px; font-size: 16px; z-index: 8; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); border: 3px solid var(--hz); }
.coach::before { content: '📻'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.coach .cbtns { margin-top: 6px; display: flex; gap: 6px; justify-content: flex-end; }
.coach .btn { min-height: 34px; font-size: 15px; color: #fff; }
.center-banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 9; text-align: center; pointer-events: none; animation: cb 2.6s ease-out forwards; }
.center-banner b { display: block; font-family: var(--disp); font-weight: 400; font-size: clamp(44px, 9vw, 96px); letter-spacing: 3px; line-height: 0.95; text-shadow: 0 5px 0 #000, 0 0 40px rgba(0, 0, 0, 0.6); }
.center-banner small { display: inline-block; margin-top: 6px; font-family: var(--cond); font-weight: 700; font-size: 20px; background: rgba(0, 0, 0, 0.7); padding: 3px 12px; border-radius: 8px; }
.center-banner.red b { color: var(--red2); } .center-banner.green b { color: #7dffb0; } .center-banner.gold b { color: var(--hz); }
@keyframes cb { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
body.redflash #app::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 20; box-shadow: inset 0 0 120px 30px rgba(255, 30, 30, 0.6); animation: rf 1.2s ease-out forwards; }
@keyframes rf { to { opacity: 0; } }
.ranks { position: absolute; left: calc(var(--sal) + 8px); top: calc(var(--topH) + var(--sat) + 8px); width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; z-index: 6; font-family: var(--cond); }
.ranks .r { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; font-size: 15px; }
.ranks .r.me { background: rgba(255, 255, 255, 0.08); }
.ranks .r i { width: 10px; height: 10px; border-radius: 3px; background: var(--pc); flex: none; }
.ranks .r span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ranks .r b { font-weight: 800; }
.ranks .r.gone span { opacity: 0.5; }
.pingbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--dockH) + var(--sab) + 10px); display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--hz); border-radius: 12px; padding: 6px; z-index: 8; }
.pingbar button { padding: 6px 10px; border-radius: 8px; background: #2a2420; font-family: var(--cond); font-weight: 800; font-size: 13px; }
.pingbar button.on { background: var(--hz); color: #222; }
.pingbar span { align-self: center; font-family: var(--cond); font-size: 13px; color: var(--mute); padding: 0 6px; }

/* results */
#results { background: rgba(10, 9, 8, 0.92); overflow: auto; }
.res-wrap { max-width: 1100px; margin: 0 auto; padding: calc(var(--sat) + 16px) calc(var(--sar) + 16px) calc(var(--sab) + 24px) calc(var(--sal) + 16px); }
.res-head { text-align: center; margin-bottom: 12px; }
.res-head h2 { font-family: var(--disp); font-weight: 400; font-size: clamp(44px, 7vw, 76px); letter-spacing: 2px; margin: 0; line-height: 0.95; }
.res-head h2.win { color: var(--hz); } .res-head h2.lose { color: var(--red2); }
.res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.res-box { background: #1c1816; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.res-box h3 { margin: 0 0 6px; font-family: var(--cond); font-weight: 800; letter-spacing: 1px; color: var(--mute); font-size: 15px; text-transform: uppercase; }
.res-stats .s { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); font-family: var(--cond); font-size: 17px; }
.res-stats .s b { font-family: var(--disp); font-weight: 400; font-size: 22px; letter-spacing: 1px; }
.res-stats .s.total b { color: var(--hz); font-size: 30px; }
.award { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: #26211e; margin-bottom: 5px; font-family: var(--cond); }
.award i { font-style: normal; font-size: 20px; } .award b { font-size: 14px; letter-spacing: 0.5px; } .award span { margin-left: auto; font-weight: 700; color: var(--pc); }
.notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.notes span { background: #2a2420; border-radius: 8px; padding: 4px 9px; font-family: var(--cond); font-size: 14px; }

/* modal + toast + rotate */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; }
.modal .card { width: min(480px, 94vw); max-height: 90vh; overflow: auto; }
.modal h3 { font-family: var(--disp); font-weight: 400; font-size: 34px; letter-spacing: 1px; margin: 0 0 10px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-family: var(--cond); font-size: 17px; font-weight: 600; }
.sw { width: 52px; height: 30px; border-radius: 15px; background: #3a332e; position: relative; flex: none; }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #bbb; transition: left 0.15s; }
.sw.on { background: var(--green); } .sw.on::after { left: 25px; background: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(var(--dockH) + var(--sab) + 70px); transform: translateX(-50%); background: #2a2420; border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; z-index: 40; font-family: var(--cond); font-weight: 700; font-size: 16px; max-width: 90vw; text-align: center; }
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 50; background: #0d0b0a; place-items: center; text-align: center; font-size: 60px; }
.rotate-hint b { display: block; font-family: var(--disp); font-size: 32px; letter-spacing: 1px; } .rotate-hint small { font-size: 15px; color: var(--mute); }
@media (orientation: portrait) and (pointer: coarse) { body.ingame .rotate-hint { display: grid; } }

/* small landscape phones */
@media (max-height: 460px) {
  :root { --topH: 44px; --dockH: 74px; }
  .stat b { font-size: 19px; } .stat { min-width: 52px; } .wavechip { min-width: 78px; height: 36px; } .wavechip b { font-size: 17px; }
  .tcard { width: 112px; } .tcard .tn { font-size: 16px; } .tcard .pax { font-size: 15px; } .tcard .to { font-size: 12px; }
  .db { width: 48px; font-size: 18px; } .ib { width: 36px; height: 36px; }
  .info { width: 240px; padding: 10px; } .info h4 { font-size: 22px; }
  .auction { left: calc(var(--sal) + 8px); transform: none; width: min(520px, calc(100vw - 280px - var(--sal) - var(--sar))); }   /* keep clear of the info panel */
  .menu-wrap { grid-template-columns: 1fr 1.4fr; gap: 14px; } .mbtn { min-height: 44px; padding: 6px 12px; } .mbtn b { font-size: 21px; } .mbtn.hero { min-height: 54px; } .mbtn.hero b { font-size: 30px; }
  .logo span { font-size: 48px; } .logo b { font-size: 62px; } .banner-card { margin-top: 8px; } .tagline { margin: 6px 0; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .mbtn.hero { grid-column: span 3; } .mbtn { min-height: 46px; padding: 5px 10px; } .mbtn b { font-size: 19px; } .mbtn small { font-size: 12px; }
  .menu-wrap { bottom: calc(var(--sab) + 50px); }
  .tcard { padding: 2px 7px; } .tcard .tn { font-size: 15px; } .tcard .pax { font-size: 14px; } .tcard .pax i { height: 4px; margin-top: 1px; } .tcard .to { font-size: 11px; }
  .coach { top: calc(var(--topH) + var(--sat) + 6px); bottom: auto; left: calc(var(--sal) + 8px); transform: none; width: min(420px, 60vw); font-size: 13px; padding: 7px 10px 7px 40px; }
  .coach::before { font-size: 20px; left: 9px; } .coach .cbtns { margin-top: 3px; } .coach .btn { min-height: 28px; font-size: 13px; }
  .dbanner .ic { width: 42px; height: 42px; font-size: 24px; } .dbanner .nm { font-size: 22px; }
}
@media (max-width: 720px) {
  #hRescWrap { display: none; }
  .res-cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .menu-wrap { grid-template-columns: 1fr; align-content: start; overflow: auto; }
}
