:root {
  --il: env(safe-area-inset-left, 0px); --ir: env(safe-area-inset-right, 0px);
  --it: env(safe-area-inset-top, 0px); --ib: env(safe-area-inset-bottom, 0px);
  --bg: #05080d; --panel: rgba(10, 16, 26, 0.9); --line: rgba(160, 200, 255, 0.14);
  --tx: #eef4ff; --tx2: #a9b6cc; --tx3: #6c7a92;
  --a: #3ff0d0; --b: #ff4fb4; --c: #b6ff4a; --d: #ffb43d; --warn: #ffcf4a; --bad: #ff5d6c; --good: #6ff2a1;
  --grad: linear-gradient(100deg, #3ff0d0, #7fb4ff 45%, #ff4fb4);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--tx);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#c { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; }
/* Android: the 3D world is a native OpenGL view behind this page, so the page itself is see-through. */
html.native, body.native { background: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: var(--tx); }

#fx { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity 0.5s; }

/* ---------- loading & logo ---------- */
#loading { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; text-align: center; background: radial-gradient(ellipse at 50% 40%, #0f1f2e, #03060a 70%); z-index: 50; transition: opacity 0.6s; }
#loading.gone { opacity: 0; pointer-events: none; }
#loading p { color: var(--tx2); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; margin-top: 14px; }
.logo { font-weight: 900; font-style: italic; font-size: clamp(40px, 7vw, 86px); letter-spacing: -0.02em; line-height: 0.9;
  background: linear-gradient(180deg, #ffffff, #b9d8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(63, 240, 208, 0.35)); }
/* The slanted letters reach past their box: room on both sides so the gradient fills all of them (the P's right side too). */
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 0.16em 0 0.06em; margin: 0 -0.16em 0 -0.06em; }

/* ---------- menus ---------- */
#menu { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; display: none; padding: calc(14px + var(--it)) calc(18px + var(--ir)) calc(14px + var(--ib)) calc(18px + var(--il)); }
/* Whatever a screen holds can always be reached: what doesn't fit scrolls, instead of being cut off at the top and bottom. */
#menu { overflow: hidden auto; overscroll-behavior: contain; touch-action: pan-y; }
#menu::-webkit-scrollbar { display: none; }
#menu.on { display: flex; }
#menu.dim { background: radial-gradient(ellipse at 50% 50%, rgba(3, 6, 12, 0.7), rgba(3, 6, 12, 0.92)); }
.title { display: flex; width: 100%; min-height: 100%; align-self: flex-start; align-items: center; gap: clamp(12px, 4vw, 60px); }
.brand { flex: 1.3; min-width: 0; }
.brand .tag { color: rgba(255, 255, 255, 0.86); font-size: 15px; margin: 14px 0 0 4px; max-width: 34ch; line-height: 1.45; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6); }
.brand .ver { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
/* A soft dark fade behind the title text so it reads over the bright 3D scene. */
#menu:not(.dim) .title::before { content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 50% 60%, rgba(3, 7, 13, 0) 48%, rgba(3, 7, 13, 0.5) 100%), linear-gradient(90deg, rgba(3, 7, 13, 0.62) 0%, rgba(3, 7, 13, 0.35) 34%, rgba(3, 7, 13, 0) 52%); }
.brand .ver { color: var(--tx3); font-size: 11px; letter-spacing: 0.16em; margin: 18px 0 0 4px; text-transform: uppercase; }
.mainbtns { flex: 0.9; display: flex; flex-direction: column; gap: 9px; max-width: 360px; min-width: min(260px, 44vw); }
.row { display: flex; gap: 9px; }
.row > * { flex: 1; min-width: 0; }

.btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  transition: transform 0.12s, border-color 0.2s, background 0.2s; position: relative; overflow: hidden; }
.btn b { font-size: 16px; font-weight: 750; letter-spacing: 0.01em; }
.btn small { color: var(--tx2); font-size: 12px; }
.btn:active { transform: scale(0.97); }
.btn.sm { padding: 10px 14px; align-items: center; text-align: center; font-weight: 650; font-size: 14px; }
.btn.primary { border-color: transparent; background: linear-gradient(100deg, rgba(63, 240, 208, 0.95), rgba(127, 180, 255, 0.95)); color: #04121a; }
.btn.primary small { color: rgba(4, 18, 26, 0.72); }
.btn.primary::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.2s infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.btn.danger { border-color: rgba(255, 93, 108, 0.4); color: #ffc3c9; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.panel { margin: auto; width: min(780px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 16px 18px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.panel::-webkit-scrollbar { display: none; }
.ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: 0.01em; flex: 1; }
.back { width: 36px; height: 36px; flex: none; padding: 0; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); }
.back svg { display: block; width: 22px; height: 22px; }
.back path { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
/* The shop's way out: big, bright and labelled, so nobody has to hunt for it. */
.back.big { width: auto; height: 42px; padding: 0 16px 0 10px; display: flex; align-items: center; gap: 6px; border-radius: 12px; font: 800 16px/1 system-ui;
  color: #06222a; background: linear-gradient(180deg, #8ff6dc, #4fd8c0); border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 14px rgba(127, 248, 216, 0.55); }
.back.big:active { transform: scale(0.96); }
.sub { color: var(--tx2); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.card { text-align: left; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; transition: border-color 0.2s, background 0.2s, transform 0.12s; }
.card:active { transform: scale(0.98); }
.card b { font-size: 16px; }
.card small { color: var(--tx2); font-size: 12px; line-height: 1.45; }
.card .ic { align-self: flex-start; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; letter-spacing: 1px; white-space: nowrap; background: rgba(255, 255, 255, 0.06); }
.card.sel { border-color: var(--a); background: rgba(63, 240, 208, 0.1); box-shadow: inset 0 0 0 1px var(--a); }
.card.d0 .ic { color: var(--good); } .card.d1 .ic { color: var(--warn); } .card.d2 .ic { color: var(--bad); } .card.d3 .ic { color: #d86bff; }
.card .best { color: var(--tx3); font-size: 11px; margin-top: auto; }

.tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, 0.04); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.tabs button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--tx2); }
.tabs button.on { background: rgba(63, 240, 208, 0.16); color: var(--tx); }
.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; }
.field input:focus { border-color: var(--a); }
.field input.code { font-size: 26px; letter-spacing: 0.4em; text-transform: uppercase; font-weight: 800; text-align: center; font-family: ui-monospace, monospace; }
.field .btn { width: auto; align-items: center; justify-content: center; }
.list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); text-align: left; width: 100%; }
.item b { font-weight: 700; }
.item small { color: var(--tx2); display: block; font-size: 12px; }
.item .go { margin-left: auto; color: var(--a); font-weight: 700; font-size: 13px; }
.empty { color: var(--tx3); font-size: 13px; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--a); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }

.lobby { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.room { padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.room .code { font: 900 40px/1 ui-monospace, monospace; letter-spacing: 0.22em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 6px 0 8px; }
.room p { margin: 4px 0; color: var(--tx2); font-size: 13px; line-height: 1.45; }
.room p.warn { color: #ffcf6a; } .room p.good { color: #7dffb0; }
.room .ip { color: var(--tx); font: 700 18px ui-monospace, monospace; overflow-wrap: anywhere; }
.kind { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a); font-weight: 800; }
.slots { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.slot .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px currentColor; background: currentColor; }
.slot.empty { color: var(--tx3); border: 1px dashed var(--line); background: none; }
.slot small { margin-left: auto; color: var(--tx3); font-size: 11px; }
.dsel { display: flex; flex-direction: column; gap: 6px; }
.dsel button { display: flex; flex-direction: column; text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.dsel button b { font-size: 14px; } .dsel button small { color: var(--tx2); font-size: 11.5px; }
.dsel button.sel { border-color: var(--a); background: rgba(63, 240, 208, 0.1); }
.dsel.ro button:not(.sel) { display: none; }
.dsel.mrow { flex-direction: row; flex-wrap: wrap; } .dsel.mrow button { flex: 1 1 30%; align-items: center; text-align: center; padding: 9px 6px; } .dsel.mrow button b { font-size: 13px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); margin-top: 8px; font-size: 13px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--a); }

.set { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.set label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--tx2); }
.set .seg { display: flex; flex-wrap: wrap; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 3px; }
.set .seg button { flex: 1; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--tx2); }
.set .seg button.on { background: rgba(63, 240, 208, 0.18); color: var(--tx); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; width: 100%; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--a) var(--p, 50%), rgba(255, 255, 255, 0.12) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; margin-top: -7px; box-shadow: 0 0 0 4px rgba(63, 240, 208, 0.3); }
.set .chk { flex-direction: row; align-items: center; gap: 10px; padding: 8px 0; color: var(--tx); }
.set .chk input { flex: none; width: 20px; height: 20px; accent-color: var(--a); }
/* A button next to something taller keeps its own size, level with the bottom of its neighbour. */
.set > .btn { align-self: end; }
.set .chks { display: flex; flex-wrap: wrap; gap: 0 22px; }
.set .full { grid-column: 1 / -1; }

.how { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.how div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13px; color: var(--tx2); line-height: 1.5; }
.how b { color: var(--tx); display: block; font-size: 14px; margin-bottom: 2px; }
.how kbd { font: 700 11px ui-monospace, monospace; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); color: var(--tx); }

.pause { margin: auto; width: min(380px, 100%); display: flex; flex-direction: column; gap: 9px; }
.pause h2 { margin: 0 0 6px; text-align: center; font-size: 26px; font-weight: 900; font-style: italic; }
.pause .note { text-align: center; color: var(--tx3); font-size: 12px; }

.results { margin: auto; text-align: center; width: min(560px, 100%); }
.results h1 { font-size: clamp(34px, 7vw, 60px); font-weight: 900; font-style: italic; margin: 0; background: linear-gradient(180deg, #fff6d8, #ffd76a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px rgba(255, 215, 106, 0.5)); }
.results .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.results .stats div { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.results .stats b { display: block; font-size: 24px; font-weight: 850; }
.results .stats small { color: var(--tx2); font-size: 12px; }
.results .rec { color: #ffd76a; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 12px; }

/* ---------- touch controls ---------- */
#touch { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; display: none; }
#touch.on { display: block; }
#stick { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; opacity: 0; transition: opacity 0.15s;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1)); border: 2px solid rgba(255, 255, 255, 0.18); pointer-events: none; }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 34px; top: 34px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 18px rgba(63, 240, 208, 0.6); }
/* Buttons are placed by main.js (applyLayout): size, position and side come from the Controls settings. */
#btns { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: var(--ba, 0.9); }
.tb { position: absolute; pointer-events: auto; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 850; letter-spacing: 0.1em;
  background: rgba(10, 18, 30, 0.5); border: 2px solid rgba(255, 255, 255, 0.22); transition: transform 0.08s, background 0.12s; touch-action: none; }
.tb span { position: relative; z-index: 1; }
.tb.down { transform: scale(0.92); background: rgba(63, 240, 208, 0.35); border-color: var(--a); }
.tb.big { font-size: 14px; border-color: rgba(63, 240, 208, 0.6); }
#bShoot { border-color: rgba(255, 130, 100, 0.75); }
#bShoot .sight { position: absolute; top: 22%; right: 22%; bottom: 22%; left: 22%; border-radius: 50%; border: 1.5px solid rgba(255, 150, 120, 0.55); }
#bShoot.down { background: rgba(255, 110, 80, 0.35); }
.tb .ring { position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; border-radius: 50%; background: conic-gradient(var(--rc, var(--a)) calc(var(--v, 1) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); opacity: 0.85; }
#bGrab .ring { --rc: #9ffff0; }
#bGrab.low .ring { --rc: var(--bad); }
#bReel .ring { --rc: var(--b); opacity: var(--o, 0); }
#bReel.nocord { display: none; }
#bReel.help { border-color: rgba(255, 214, 90, 0.85); box-shadow: 0 0 16px rgba(255, 214, 90, 0.45); }
#bAct { font-size: 10px; letter-spacing: 0.06em; border-color: rgba(127, 248, 255, 0.75); background: rgba(20, 60, 80, 0.55);
  box-shadow: 0 0 18px rgba(127, 248, 255, 0.35); transition: transform 0.08s, opacity 0.15s; }
#bAct.off { opacity: 0; pointer-events: none; }
#bShield { display: none; border-color: rgba(255, 224, 102, 0.7); }
#bShield.on { display: grid; }
#bShield .ring { --rc: #ffe066; }
#bDash { border-color: rgba(120, 190, 255, 0.75); }
#bDash .ring { --rc: #8ec8ff; }
#bDash.used { opacity: 0.55; }
#bDash.down { background: rgba(120, 190, 255, 0.35); }
#bShield.ready { box-shadow: 0 0 22px rgba(255, 224, 102, 0.55); }
#bShield.alert { animation: tbPulse 0.18s infinite alternate; background: rgba(255, 224, 102, 0.4); }
.maps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.map { position: relative; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); min-height: 92px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; transition: border-color 0.2s, transform 0.12s; }
.map::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--bg); opacity: 0.9; z-index: 0; }
.map > * { position: relative; z-index: 1; }
.map b { font-size: 15px; } .map small { color: rgba(255, 255, 255, 0.82); font-size: 11.5px; line-height: 1.35; }
.map.sel { border-color: var(--mc); box-shadow: inset 0 0 0 2px var(--mc); }
.map:active { transform: scale(0.98); }
.map.m0 { --bg: linear-gradient(160deg, #0b1424 10%, #1d1440 60%, #3ff0d055); --mc: #3ff0d0; }
.map.m1 { --bg: linear-gradient(160deg, #2f7fd0 0%, #7cc7f0 55%, #f3d58a); --mc: #ffb703; }
.map.m2 { --bg: linear-gradient(160deg, #10241a 0%, #2c4a2a 55%, #6b5338); --mc: #9be564; }
.map.m3 { --bg: linear-gradient(160deg, #1c0806 0%, #5a1608 55%, #ff6a2a); --mc: #ff8a3a; }
.map.m4 { --bg: linear-gradient(160deg, #221a4a 0%, #5a2a6a 55%, #ff8a5a); --mc: #ff4fd8; }
.map.m5 { --bg: linear-gradient(160deg, #1a8ad0 0%, #3fd8e8 50%, #6ad89a); --mc: #3fe0ff; }
.map.m5 b, .map.m5 small { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.map.m1 b, .map.m1 small { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 6; display: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 8px rgba(0, 0, 0, 0.35); }
#hud.on { display: block; }
#hPause { position: absolute; left: calc(14px + var(--il)); top: calc(12px + var(--it)); width: 44px; height: 44px; border-radius: 14px; pointer-events: auto;
  background: rgba(10, 18, 30, 0.55); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 5px; }
#hPause i { width: 4px; height: 16px; border-radius: 2px; background: #fff; }
#hZone { position: absolute; left: calc(70px + var(--il)); top: calc(12px + var(--it)); display: flex; flex-direction: column; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
#hZone b { font-size: 15px; font-weight: 800; }
#hZone span { font-size: 12px; color: rgba(255, 255, 255, 0.86); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6); }
#hTime { position: absolute; left: 50%; top: calc(12px + var(--it)); transform: translateX(-50%); font: 800 18px/1 system-ui; font-variant-numeric: tabular-nums;
  padding: 8px 14px; border-radius: 12px; background: rgba(10, 18, 30, 0.5); border: 1px solid var(--line); white-space: nowrap; }
#hTime small { color: var(--tx2); font-weight: 650; font-size: 13px; margin-left: 10px; }
/* The way up: an arrow under the clock, turned toward the next part of the route. */
#hNav { position: absolute; left: 50%; top: calc(54px + var(--it)); width: 34px; height: 34px; transform: translateX(-50%); transform-origin: 50% 50%; pointer-events: none; }
#hNav[hidden] { display: none; }
#hNav svg { width: 100%; height: 100%; display: block; animation: navPulse 1.4s ease-in-out infinite; }
#hNav path { fill: #7ff8d8; stroke: rgba(6, 20, 26, 0.85); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(127, 248, 216, 0.8)); }
@keyframes navPulse { 0%, 100% { transform: translateY(0); opacity: 0.95; } 50% { transform: translateY(-3px); opacity: 0.75; } }
/* The marker for the nearest relic: over its gate, or on the edge of the screen on its side. */
#hHearts { position: absolute; left: 50%; top: calc(94px + var(--it)); transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
#hHearts[hidden] { display: none; }
#hHearts svg { width: 30px; height: 30px; display: block; fill: #ff3b5c; stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
#hHearts svg.off { fill: rgba(20, 20, 30, .55); stroke: rgba(255, 255, 255, .55); }
#hHearts.hit { animation: heartHit .45s ease-out; }
@keyframes heartHit { 0% { transform: translateX(-50%) scale(1.45); } 35% { transform: translateX(-50%) scale(.9); } 100% { transform: translateX(-50%) scale(1); } }
#hGhost { position: absolute; left: 50%; top: calc(36px + var(--it)); transform: translateX(-50%); padding: 3px 10px; border-radius: 99px; background: rgba(10, 14, 24, 0.45); color: #bfefff; font: 700 12px/1.3 system-ui; white-space: nowrap; pointer-events: none; }
#hGhost.behind { color: #ffd27a; }
#hRelic { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; color: #ffa030; --m: 255, 160, 48; }
#hRelic[hidden] { display: none; }
#hRelic.epic { color: #c070ff; --m: 192, 112, 255; }
#hRelic.weapon { color: #ffd040; --m: 255, 208, 64; }
#hRelic i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; transform: rotate(45deg); background: currentColor; border: 2px solid rgba(255, 255, 255, 0.92); border-radius: 3px; box-shadow: 0 0 12px rgba(var(--m), 0.95); animation: relicPulse 1.2s ease-in-out infinite; }
@keyframes relicPulse { 0%, 100% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(1.22); } }
#hRelic b { position: absolute; left: 0; top: 15px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
#hAlt .marks .rl { width: 8px; height: 8px; left: 0; border: 0; border-radius: 1px; background: #ffa030; color: #ffa030; transform: translateY(50%) rotate(45deg); box-shadow: 0 0 6px currentColor; }
#hAlt .marks .rl.epic { background: #c070ff; color: #c070ff; }
#hAlt .marks .rl.weapon { background: #ffd040; color: #ffd040; }
#hAlt { position: absolute; left: calc(22px + var(--il)); top: 76px; bottom: 30%; width: 8px; }
#hAlt .track { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
#hAlt .track i { position: absolute; left: 0; right: 0; opacity: 0.75; }
#hAlt .marks i { position: absolute; left: -4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; transform: translateY(50%); box-shadow: 0 0 10px currentColor; background: currentColor; transition: bottom 0.3s; }
#hAlt .marks .cp { width: 8px; height: 8px; left: 0; border: 0; background: #fff; opacity: 0.6; box-shadow: none; }
#hWarn { position: absolute; left: 50%; top: calc(60px + var(--it)); transform: translateX(-50%); font-weight: 900; letter-spacing: 0.12em; font-size: 14px; padding: 7px 14px; border-radius: 10px; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
#hWarn.on { opacity: 1; }
#hWarn.w { color: #1a1300; background: var(--warn); }
#hWarn.g { color: #fff; background: var(--bad); animation: pulse 0.3s infinite alternate; }
@keyframes pulse { to { transform: translateX(-50%) scale(1.06); } }
@keyframes tbPulse { to { transform: scale(1.1); } }
#hPlayers { position: absolute; right: calc(66px + var(--ir)); top: calc(12px + var(--it)); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#hPlayers div { font-size: 12px; padding: 4px 10px; border-radius: 9px; background: rgba(10, 18, 30, 0.5); display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
#hPlayers i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
#hPlayers small { color: var(--tx3); }
/* The counter can sit anywhere inside the safe part of the screen (main.js, applyFpsPos). */
#fpsArea { position: absolute; left: var(--il); right: var(--ir); top: var(--it); bottom: var(--ib); }
#hFps { position: absolute; right: 10px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(5, 10, 18, 0.45); white-space: nowrap; font: 11px ui-monospace, monospace; color: var(--tx3); }

#tags { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 4; }
#tags div { position: absolute; transform: translate(-50%, -100%); font-size: 12px; font-weight: 750; padding: 3px 9px; border-radius: 8px; background: rgba(5, 10, 18, 0.6); white-space: nowrap; border: 1px solid currentColor; }
#tags div.edge { opacity: 0.8; }
.card .best.first { color: #ffd76a; font-weight: 700; }
#tags .emoB { position: absolute; transform: translate(-50%, -100%); font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55)); animation: emoPop 2s ease-out forwards; }
@keyframes emoPop { 0% { opacity: 0; scale: 0.4; } 10% { opacity: 1; scale: 1.15; } 18% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
#hEmote { position: absolute; right: calc(14px + var(--ir)); top: calc(12px + var(--it)); width: 44px; height: 44px; border-radius: 14px; pointer-events: auto; font-size: 23px; line-height: 1;
  background: rgba(10, 18, 30, 0.55); border: 1px solid var(--line); display: grid; place-items: center; }
#emoteMenu { position: fixed; z-index: 9; display: none; right: calc(14px + var(--ir)); top: calc(64px + var(--it)); width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 84px - var(--it)); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 12px 12px; border-radius: 16px; background: rgba(8, 14, 24, 0.82); border: 1px solid var(--line); backdrop-filter: blur(6px); }
#emoteMenu.on { display: block; }
.emHead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.emHead b { font-size: 14px; font-weight: 800; } .emHead small { font-size: 11.5px; color: var(--tx2); }
.emGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.emo { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px 6px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.emo i { font-style: normal; font-size: 26px; line-height: 1.1; } .emo span { font-size: 10.5px; font-weight: 650; line-height: 1.15; text-align: center; color: var(--tx2); }
.emo.spr img { width: 46px; height: 46px; display: block; }
.emCp { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 12px; padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: inherit; font: inherit; text-align: left; }
.emCp span { font-size: 12px; color: var(--tx2); } .emCp b { flex: 1; font-size: 13px; font-weight: 750; } .emCp small { font-size: 10.5px; color: var(--tx2); }
.emSub { margin: -4px 0 8px; font-size: 11.5px; color: var(--tx2); }
.sprbig { display: block; width: min(200px, 70%); margin: 8px auto 4px; image-rendering: auto; }
.emo.r1 { border-color: rgba(74, 168, 255, 0.5); } .emo.r2 { border-color: rgba(184, 107, 255, 0.55); } .emo.r3 { border-color: rgba(255, 154, 46, 0.6); }
.emo:active { background: rgba(63, 240, 208, 0.25); }

#zoneTitle { position: fixed; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; z-index: 7; opacity: 0; transform: translateY(10px); transition: opacity 0.6s, transform 0.6s; }
#zoneTitle.show { opacity: 1; transform: none; }
#zoneTitle small { letter-spacing: 0.4em; font-weight: 800; font-size: 12px; color: var(--zc, var(--a)); text-transform: uppercase; }
#zoneTitle h2 { margin: 4px 0; font-size: clamp(30px, 6vw, 54px); font-weight: 900; font-style: italic; text-shadow: 0 0 30px var(--zc, var(--a)), 0 4px 20px rgba(0, 0, 0, 0.8); }
#zoneTitle p { margin: 0; color: var(--tx2); font-size: 15px; text-shadow: 0 2px 10px #000; }

#toasts { position: fixed; left: 50%; bottom: calc(22px + var(--ib)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 12px; font-size: 14px; font-weight: 650; background: rgba(10, 18, 30, 0.85); border: 1px solid var(--line); animation: tin 0.25s ease-out; max-width: 80vw; text-align: center; }
.toast.good { border-color: rgba(111, 242, 161, 0.5); } .toast.bad { border-color: rgba(255, 93, 108, 0.55); }
.toast.out { opacity: 0; transform: translateY(8px); transition: 0.3s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

@media (orientation: portrait) {
  .title { flex-direction: column; justify-content: center; gap: 30px; }
  .brand { flex: 0; text-align: center; } .brand .tag { margin: 12px auto 0; }
  .mainbtns { width: 100%; max-width: 420px; flex: 0; }
  .cards, .lobby, .set, .how, .results .stats { grid-template-columns: 1fr; }
  .maps { grid-template-columns: 1fr; } .map { min-height: 64px; }
}

/* ---------- layout editor ---------- */
#editBar { display: none; position: absolute; left: 50%; top: calc(14px + var(--it)); transform: translateX(-50%); z-index: 3; align-items: center; gap: 10px;
  background: rgba(8, 14, 24, 0.85); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 16px; white-space: nowrap; }
#editBar b { font-size: 13px; font-weight: 700; }
#editBar button { padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
#editBar button.pri { background: var(--a); color: #04110e; border-color: transparent; }
#touch.edit #editBar { display: flex; }
#touch.edit #btns { opacity: 1; }
/* Moving the FPS counter: the rest of the screen shows what it should stay clear of, and only the counter moves. */
#hud.fpsmove { display: block; }
#hud.fpsmove:not(.on) > :not(#fpsArea) { visibility: hidden; }
#hud.fpsmove .hb { pointer-events: none; }
#hud.fpsmove #hFps { pointer-events: auto; touch-action: none; cursor: grab; color: #fff; outline: 2px dashed rgba(255, 255, 255, 0.6); outline-offset: 3px; }
#hud.fpsmove #hFps::after { content: ''; position: absolute; top: -16px; right: -16px; bottom: -16px; left: -16px; }
#touch.fpsmove #editBar { display: flex; }
#touch.fpsmove.barlow #editBar { top: auto; bottom: calc(14px + var(--ib)); }
#touch.fpsmove #btns { opacity: 1; }
#touch.fpsmove .tb { display: grid !important; opacity: 0.35 !important; pointer-events: none !important; }
#touch.edit .tb { display: grid !important; opacity: 1 !important; pointer-events: auto !important; outline: 2px dashed rgba(255, 255, 255, 0.35); outline-offset: 4px; }

/* ---------- aiming ---------- */
#cross { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; opacity: 0; transition: opacity 0.12s; text-shadow: none; }
#cross.on { opacity: 1; }
#cross::before, #cross::after { content: ''; position: absolute; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 3px rgba(0, 0, 0, 0.8); }
#cross::before { left: 16px; top: 0; width: 2px; height: 34px; -webkit-mask: linear-gradient(#000 35%, transparent 35% 65%, #000 65%); mask: linear-gradient(#000 35%, transparent 35% 65%, #000 65%); }
#cross::after { top: 16px; left: 0; height: 2px; width: 34px; -webkit-mask: linear-gradient(90deg, #000 35%, transparent 35% 65%, #000 65%); mask: linear-gradient(90deg, #000 35%, transparent 35% 65%, #000 65%); }
#cross i { position: absolute; left: 15px; top: 15px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
#cross.hot::before, #cross.hot::after, #cross.hot i { background: #ff5a3c; }
#cross.hot { transform: scale(1.15); }

/* ---------- tips ---------- */
#tipMarks { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 6; }
#tipMarks button { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: auto; font-weight: 900; font-size: 17px;
  color: #04110e; background: rgba(255, 214, 90, 0.78); border: 2px solid rgba(255, 255, 255, 0.7); box-shadow: 0 0 10px rgba(255, 214, 90, 0.45); }
#tipMarks button.seen { background: rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.9); box-shadow: none; }
#tipCard { position: fixed; left: 50%; top: calc(64px + var(--it)); transform: translate(-50%, -8px); width: min(420px, 70vw); z-index: 7; pointer-events: none;
  background: rgba(8, 14, 24, 0.6); border: 1px solid rgba(255, 214, 90, 0.35); border-radius: 14px; padding: 10px 14px; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
#tipCard.on { opacity: 1; transform: translate(-50%, 0); }
#tipCard b { color: #ffd65a; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
#tipCard p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.92); }
.set h3 { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a); }
.set .val { float: right; color: var(--tx2); font-weight: 600; font-size: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches .sw { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.swatches .sw.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); transform: scale(1.1); }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.rules label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--tx2); }
.rules .seg { display: flex; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.rules .seg button { flex: 1 1 22%; padding: 7px 4px; border-radius: 8px; font-size: 12px; font-weight: 650; color: var(--tx2); }
.rules .seg button.on { background: rgba(63, 240, 208, 0.18); color: var(--tx); }
.rules .seg.ro button:not(.on) { display: none; }
@media (orientation: portrait) { .rules { grid-template-columns: 1fr; } }

/* ---------- coins, shop and records ---------- */
i.coin { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.32em; border-radius: 50%; vertical-align: -0.12em; background: radial-gradient(circle at 35% 30%, #fff4b0, #ffc830 55%, #c88a10); box-shadow: inset 0 0 0 0.11em rgba(150, 90, 0, 0.6), 0 0 6px rgba(255, 190, 40, 0.45); }
#hCoins { position: absolute; left: calc(70px + var(--il)); top: calc(49px + var(--it)); font: 800 15px/1 system-ui; font-variant-numeric: tabular-nums; color: #ffe08a; }
#hCoins.pop { animation: coinpop 0.22s ease-out; }
@keyframes coinpop { 40% { transform: scale(1.28); } }
.toast.gold { border-color: #ff9a2e; color: #ffd9a0; }
.shopbtn { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; }
.shopbtn .wal { color: #ffe08a; font-variant-numeric: tabular-nums; font-weight: 800; }
.role { font-style: normal; font-size: 9px; font-weight: 900; letter-spacing: 0.08em; padding: 2px 5px; margin-left: 6px; border-radius: 5px; color: #fff; background: #ff3b5c; }
.rec.gold { color: #ffb45a; }

.shop { display: flex; width: 100%; height: 100%; gap: 12px; touch-action: none; }
.shopside { flex: 0 0 clamp(170px, 31%, 380px); min-width: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.shopside > * { pointer-events: auto; }
.shopside .ph { margin: 0; }
.wallet { padding: 7px 13px; border-radius: 12px; background: rgba(8, 13, 22, 0.8); border: 1px solid var(--line); color: #ffe08a; font-size: 16px; font-variant-numeric: tabular-nums; }
.shopinfo { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; border-radius: 14px; background: rgba(8, 13, 22, 0.82); border: 1px solid var(--line); }
.shopinfo .sname { font-size: 17px; font-weight: 800; }
.shopinfo .srar { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.shopinfo .hint { margin: 2px 0; font-size: 12px; line-height: 1.4; color: #ffd9a0; }
.shopinfo .need { margin: 0; font-size: 12px; color: var(--tx3); }
.shopinfo .btn { margin-top: 5px; }
.shopinfo .btn[disabled] { opacity: 0.55; }
.shopmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.tabs { display: flex; gap: 5px; }
.tabs button { flex: 1; padding: 8px 2px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--tx2); background: rgba(255, 255, 255, 0.05); }
.tabs button.on { color: #06121a; background: var(--a); }
.sub.lg { margin: 0; font-size: 12px; line-height: 1.4; color: #ffd9a0; }
.shopgrid { flex: 1; min-height: 0; overflow: auto; touch-action: pan-y; padding-right: 2px; }
.shopgrid::-webkit-scrollbar { display: none; }
h3.rar { display: flex; align-items: center; gap: 7px; margin: 10px 2px 7px; font-size: 13px; font-weight: 800; color: var(--rc); }
h3.rar:first-child { margin-top: 2px; }
h3.rar span { width: 9px; height: 9px; border-radius: 3px; background: var(--rc); box-shadow: 0 0 8px var(--rc); }
h3.rar small { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--tx3); }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px; }
.skin { --rc: #4fe06e; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 3px 6px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid var(--rc); background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 22%, transparent), rgba(255, 255, 255, 0.03)); border: 1.5px solid color-mix(in srgb, var(--rc) 55%, transparent); }
.skin.r1 { --rc: #4aa8ff; } .skin.r2 { --rc: #b86bff; } .skin.r3 { --rc: #ff9a2e; } .skin.r4 { --rc: #ff3b5c; }
.skin.sel { border-color: #fff; box-shadow: 0 0 0 1px #fff, 0 0 12px var(--rc); }
.skin img { width: 60px; height: 75px; object-fit: contain; }
.skin b { width: 100%; font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.skin em { font-style: normal; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.skin em.price { color: #ffe08a; } .skin em.have { color: var(--tx3); } .skin em.wearing { color: var(--a); } .skin em.lock { color: #ffb45a; }
.skin.no img { opacity: 0.86; }

.mapchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mapchips button { padding: 7px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: var(--tx2); background: rgba(255, 255, 255, 0.05); }
.mapchips button.on { color: #06121a; background: var(--a); }
.rcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rcard { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.rcard b { font-size: 12px; font-weight: 800; }
.rcard.d0 b, .rd.d0 { color: var(--good); } .rcard.d1 b, .rd.d1 { color: var(--warn); } .rcard.d2 b, .rd.d2 { color: var(--bad); } .rcard.d3 b, .rd.d3 { color: #d86bff; }
.rcard strong { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rcard strong.none { font-size: 14px; font-weight: 700; color: var(--tx3); padding: 5px 0; }
.rcard small { font-size: 11px; color: var(--tx2); }
.rrows { display: flex; flex-direction: column; gap: 4px; }
.rrow { display: grid; grid-template-columns: 22px 62px minmax(70px, 1fr) 62px 62px 60px minmax(90px, 1.2fr); align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, 0.035); }
.rrow.won { background: rgba(255, 190, 60, 0.09); }
.rrow .rn { color: var(--tx3); font-weight: 700; }
.rrow b { font-size: 14px; font-weight: 800; }
.rrow small { color: var(--tx3); font-size: 11px; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rc { color: #ffe08a; font-weight: 700; }
.rtot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); text-align: center; }
.rtot b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rtot small { font-size: 10.5px; color: var(--tx3); }

/* Controller: the highlight, what the buttons do, the letter board and the stick test. */
.pf { scroll-margin: 30px; outline: 2.5px solid #fff !important; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(63, 240, 208, 0.6) !important; }
.shopgrid .pf, .maps .pf, .mapchips .pf, .tabs .pf { outline-offset: -3px; box-shadow: inset 0 0 0 5px rgba(63, 240, 208, 0.45) !important; }
body.pad .set { grid-template-columns: 1fr; }
#padHint { position: fixed; left: 50%; bottom: 5px; transform: translateX(-50%); z-index: 40; display: none; gap: 14px; padding: 3px 12px; border-radius: 999px;
  background: rgba(3, 6, 12, 0.78); color: var(--tx2); font-size: 11.5px; pointer-events: none; white-space: nowrap; }
#padHint.on { display: flex; }
#padHint b { color: var(--a); font-weight: 750; margin-right: 2px; }
#padKeys { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(3, 6, 12, 0.82); }
.pkbox { display: flex; flex-direction: column; gap: 5px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.pkv { min-height: 30px; padding: 5px 12px; border-radius: 9px; background: rgba(0, 0, 0, 0.35); font-size: 16px; font-weight: 650; letter-spacing: 0.04em; }
.pkr { display: flex; gap: 5px; justify-content: center; }
.pkr button { min-width: 42px; height: 36px; padding: 0 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); font-weight: 650; font-size: 14px; }
.pkr button.w { flex: 1; }
.pkr button.pri { background: rgba(63, 240, 208, 0.25); }
.padtest { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.padtest .ps { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--tx2); }
.padtest .pc { position: relative; width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.padtest .pc u { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px dashed var(--warn); text-decoration: none; }
.padtest .pc i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--a); }
.padtest .pc.in i { background: var(--tx3); }
.padtest .sub { flex: 1 1 200px; margin: 0; }

/* The game server: sign in, terms, server browser */
.seg.vis { display: flex; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 3px; }
.seg.vis button { flex: 1; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--tx2); }
.seg.vis button.on { background: rgba(63, 240, 208, 0.18); color: var(--tx); }
.brand .ver.made { margin-top: 4px; letter-spacing: 0.1em; }
.acct { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.terms { max-height: min(62vh, 300px); overflow: auto; white-space: pre-wrap; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; line-height: 1.5; color: var(--tx2); }
.madeby { margin: 0 0 8px; font-size: 13.5px; color: var(--tx2); }
.madeby b { color: var(--tx); }
.provs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.prov.discord:not([disabled]) { background: #5865f2; border-color: transparent; color: #fff; }
.prov.steam:not([disabled]) { background: #1b2838; border-color: #66c0f4; color: #fff; }
.prov.google:not([disabled]) { background: #fff; border-color: transparent; color: #1f1f1f; }
.bbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.bbtns { display: flex; gap: 8px; }
.bbtns .btn { width: auto; }
.item[disabled] { opacity: 0.5; pointer-events: none; }
.acctbtn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .acct { grid-template-columns: 1fr; } }
.donate { color: #ffb3c8; border-color: rgba(255, 120, 160, 0.45); }
.brand .donate { width: auto; align-self: flex-start; margin-top: 8px; padding: 7px 14px; font-size: 13px; pointer-events: auto; }
/* A word from the server on the title: stays readable over whatever the climbers are doing behind it. */
.notice { margin: 8px 0 2px; padding: 8px 12px; max-width: 460px; font-size: 13px; line-height: 1.35; color: #d8fff6; background: rgba(8, 12, 20, .86); border: 1px solid rgba(63, 240, 208, .55); border-radius: 10px; }
.notice.warn { color: #ffe3ad; border-color: rgba(255, 176, 32, .6); }
.notice.bad { color: #ffd6da; border-color: rgba(255, 75, 95, .7); }
.notice.coinx { color: #ffe9a8; font-weight: 800; border-color: rgba(255, 200, 48, .75); box-shadow: 0 0 14px rgba(255, 196, 40, .3); }
/* Two buttons side by side, one of them on two lines: both labels stay in the middle. */
.row > .btn.sm { display: flex; align-items: center; justify-content: center; }
/* Banned: every way into the game is grayed out, and the reason is the first thing on the screen. */
.title.banned .mainbtns .btn[aria-disabled="true"] { filter: grayscale(1); opacity: 0.45; }
.title.banned .mainbtns .btn[aria-disabled="true"] small { color: #ffd6da; }
.bancard { margin: 12px 0 6px; padding: 14px 16px; max-width: 460px; color: #ffe1e4; background: rgba(40, 8, 14, 0.92); border: 1px solid rgba(255, 75, 95, 0.8); border-radius: 12px; }
.bancard b { display: block; font-size: 20px; color: #ff8a97; }
.bancard p { margin: 6px 0; font-size: 15px; line-height: 1.35; }
.bancard small { color: #d9a6ac; font-size: 12px; }
/* A word from the admins, over whatever is on the screen. */
.svmsg { position: fixed; z-index: 1000; top: calc(12px + var(--it, 0px)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; text-align: left; font: inherit; color: #e8fff9; background: rgba(8, 12, 20, 0.95); border: 1px solid rgba(63, 240, 208, 0.7); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5); }
.svmsg b { font-size: 12px; letter-spacing: 0.04em; color: #3ff0d0; }
.svmsg span { font-size: 15px; line-height: 1.35; }
.svmsg small { font-size: 11px; color: #8fa3b5; }
/* The flags the server gives out. */
.role.owner { background: #ff3b5c; } .role.admin { background: #e8690c; } .role.mod { background: #2f7bff; }
.row > .btn.sm.acctbtn { flex-direction: row; gap: 5px; }
.acctbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acctbtn .role { flex: none; margin-left: 0; }

/* ---------- every phone size ---------- */
/* From 450 px tall everything fits as it is. Below that it gets tighter in steps, each worked out so the longest main menu
   (the one with Continue climb) still fits without scrolling. Below the last step the menu scrolls. */
.title .logo { font-size: clamp(30px, min(7vw, 15vh), 86px); }
.mainbtns .btn b, .mainbtns .btn small { max-width: 100%; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mainbtns .btn.sm { line-height: 1.2; }
.bancard { overflow-wrap: anywhere; }
.shopinfo { min-height: 0; overflow-y: auto; touch-action: pan-y; }
.shopinfo::-webkit-scrollbar { display: none; }
.shopside .ph { flex: none; }
.tabs button { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Eight tabs in the shop: each as wide as its name, so the long ones still fit. */
.shopmain .tabs { gap: 4px; }
.shopmain .tabs button { flex: 1 1 auto; padding-left: 5px; padding-right: 5px; }

/* Foldables and tablets: everything bigger, rather than small buttons on a big empty screen. */
@media (min-width: 900px) and (min-height: 620px) { #menu { zoom: 1.25; } }
@media (min-width: 1100px) and (min-height: 760px) { #menu { zoom: 1.5; } }
/* 1440p and 4K: the same layout as 1080p, at the same share of the screen. */
@media (min-width: 2400px) and (min-height: 1300px) { #menu { zoom: 2; } }
@media (min-width: 3600px) and (min-height: 2000px) { #menu { zoom: 3; } }

@media (max-height: 449px) {
  #menu { padding: calc(10px + var(--it)) calc(14px + var(--ir)) calc(10px + var(--ib)) calc(14px + var(--il)); }
  .mainbtns { gap: 7px; }
  .mainbtns .btn { padding: 9px 14px; }
  .mainbtns .btn.sm { padding: 9px 10px; font-size: 13.5px; }
  .btn b { font-size: 15px; }
  .btn small { font-size: 11.5px; }
  .brand .tag { max-width: 46ch; margin-top: 8px; font-size: 13.5px; line-height: 1.38; }
  .brand .ver { margin-top: 10px; }
  .brand .donate { margin-top: 6px; padding: 5px 12px; }
  .notice { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; }
  .bancard { margin: 8px 0 4px; padding: 10px 12px; }
  .bancard b { font-size: 17px; }
  .bancard p { margin: 4px 0; font-size: 13.5px; }
  .panel { padding: 12px 14px; border-radius: 16px; }
  .ph { margin-bottom: 8px; }
  .ph h2 { font-size: 18px; }
  .back { width: 32px; height: 32px; }
  .back svg { width: 20px; height: 20px; }
  .back.big { width: auto; height: 38px; font-size: 15px; }
  .sub { margin-bottom: 8px; font-size: 12.5px; line-height: 1.4; }
  .cards, .maps { gap: 7px; }
  .card { padding: 10px; gap: 4px; }
  .card b { font-size: 15px; }
  .card small { font-size: 11.5px; line-height: 1.35; }
  .card .ic { min-width: 28px; height: 28px; font-size: 13px; }
  .maps { margin-bottom: 8px; }
  .map { min-height: 70px; padding: 8px 10px; }
  .list { margin: 8px 0; gap: 6px; }
  .item { padding: 9px 12px; }
  .tabs { margin-bottom: 8px; }
  .tabs button { padding: 7px 2px; font-size: 12.5px; }
  .field input { padding: 9px 12px; }
  .field input.code { font-size: 22px; }
  .lobby { gap: 10px; }
  .room { padding: 10px 12px; }
  .room .code { font-size: 32px; }
  .slots { margin-top: 8px; gap: 5px; }
  .slot { padding: 7px 10px; font-size: 13px; }
  .dsel button { padding: 7px 10px; }
  .toggle { margin-top: 6px; padding: 7px 10px; }
  .set { gap: 8px 14px; }
  .how { gap: 7px; }
  .how div { padding: 9px 11px; font-size: 12.5px; line-height: 1.4; }
  .pause { gap: 7px; }
  .pause h2 { margin-bottom: 2px; font-size: 22px; }
  .pause .btn { padding: 9px 14px; }
  .results h1 { font-size: clamp(28px, 6vw, 44px); }
  .results .stats { margin: 10px 0; gap: 7px; }
  .results .stats div { padding: 8px 10px; }
  .results .stats b { font-size: 20px; }
  .terms { max-height: min(56vh, 240px); }
  .rcards { margin-top: 8px; gap: 6px; }
  .rcard { padding: 7px 10px; }
  .rcard strong { font-size: 18px; }
  .rrow { padding: 5px 8px; }
  .rtot { margin-top: 8px; padding-top: 8px; }
  .shop { gap: 8px; }
  .shopmain { padding: 8px; }
  .shopinfo { padding: 9px 11px; gap: 3px; }
}
@media (max-height: 389px) {
  #menu { padding: calc(8px + var(--it)) calc(12px + var(--ir)) calc(8px + var(--ib)) calc(12px + var(--il)); }
  .mainbtns { gap: 5px; }
  .mainbtns .btn { padding: 7px 14px; }
  .mainbtns .btn.sm { padding: 7px 10px; }
  .brand .tag { font-size: 12.5px; line-height: 1.35; }
  .pause { gap: 5px; }
  .pause .btn { padding: 7px 14px; }
  .map { min-height: 62px; }
}
@media (max-height: 349px) {
  #menu { padding: calc(6px + var(--it)) calc(12px + var(--ir)) calc(6px + var(--ib)) calc(12px + var(--il)); }
  .mainbtns { gap: 4px; }
  .mainbtns .btn { padding: 6px 14px; }
  .mainbtns .btn.sm { padding: 6px 10px; }
  .title:not(.banned) .mainbtns .btn small { display: none; }
  .brand .tag { display: none; }
  .map { min-height: 54px; }
  .pause .btn small { display: none; }
}
@media (max-width: 620px) {
  .title .logo { font-size: clamp(28px, min(6vw, 15vh), 60px); }
}
@media (max-width: 540px) {
  .cards, .maps, .rcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby, .set, .how { grid-template-columns: minmax(0, 1fr); }
  .rrow { grid-template-columns: 20px 54px minmax(60px, 1fr) 56px 56px 52px; }
  .rrow small { display: none; }
}

/* Friends. */
.row.three > .btn.sm { padding-left: 6px; padding-right: 6px; font-size: 13px; }
.row > .btn.sm.frbtn { flex-direction: row; gap: 6px; }
#frCount { display: inline-flex; gap: 3px; }
#frCount:empty { display: none; }
.frc { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #04130f; background: var(--good); }
.frc.req { color: #fff; background: var(--bad); }
.frpanel { width: min(880px, 100%); }
.friends { display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); gap: 12px; align-items: start; }
.fside { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fid { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 12px; border-radius: 14px; text-align: center; background: linear-gradient(135deg, rgba(63, 240, 208, 0.16), rgba(63, 240, 208, 0.04)); border: 1px solid rgba(63, 240, 208, 0.35); }
.fid small { color: var(--tx2); font-size: 10px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.fid b { color: var(--a); font-size: 28px; font-weight: 850; line-height: 1.1; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.fid span { color: var(--tx2); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fid .btn { margin-top: 5px; }
.ftabs { display: flex; flex-direction: column; gap: 4px; }
.ftabs button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 11px; border-radius: 10px; text-align: left; font-size: 14px; font-weight: 650; color: var(--tx2); background: rgba(255, 255, 255, 0.04); }
.ftabs button.on { color: var(--tx); background: rgba(63, 240, 208, 0.16); }
.ftabs i { font-style: normal; font-size: 12px; font-weight: 750; color: var(--tx3); font-variant-numeric: tabular-nums; }
.ftabs i.hot { min-width: 18px; padding: 1px 5px; border-radius: 9px; text-align: center; color: #fff; background: var(--bad); }
.fside .toggle { margin-top: 0; font-size: 12px; line-height: 1.3; }
.fmain { min-width: 0; }
.fmain .list { margin: 0; }
.fmain .sub { margin-bottom: 8px; }
#ffound { margin-top: 10px; }
.frow { display: flex; align-items: stretch; gap: 8px; }
.frow .item { flex: 1; min-width: 0; text-align: left; }
.frow > .btn { width: auto; flex: none; min-width: 72px; align-items: center; justify-content: center; }
.fdot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tx3); }
.fdot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.fdot.lobby { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.fdot.climb { background: var(--a); box-shadow: 0 0 10px var(--a); animation: fpulse 1.4s ease-in-out infinite; }
@keyframes fpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.ftext { display: block; flex: 1; min-width: 0; }
.ftext b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fnum { margin-left: 6px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--tx3); }
.fbar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.fbar i { display: block; height: 100%; border-radius: 2px; background: var(--a); transition: width 0.6s; }
.ftag { flex: none; align-self: center; padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--tx2); }
.ftag.good { color: var(--good); }
.fchead { display: flex; align-items: flex-start; gap: 10px; }
.fchead .fdot { margin-top: 5px; }
.fchead .ftext b { font-size: 18px; }
.fchead .ftext small { display: block; color: var(--tx2); font-size: 12px; }
.fstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: 12px 0; }
.fstats div { padding: 9px 6px; border-radius: 12px; text-align: center; background: rgba(255, 255, 255, 0.05); }
.fstats b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fstats small { color: var(--tx2); font-size: 11px; }
.fbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.fbtns .btn { width: auto; flex: 1 1 auto; align-items: center; justify-content: center; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
@media (max-width: 620px) {
  .friends { grid-template-columns: minmax(0, 1fr); }
  .frow { flex-wrap: wrap; }
}
@media (max-height: 389px) {
  .fid { padding: 7px 10px; }
  .fid b { font-size: 22px; }
  .ftabs button { padding: 7px 10px; }
  .frow .item { padding: 8px 11px; }
}

/* Watching a friend's climb. */
#menu.specm { padding: 0; overflow: hidden; touch-action: none; }
.specui { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.specui button { pointer-events: auto; }
.sptop { position: absolute; left: calc(14px + var(--il)); right: calc(14px + var(--ir)); top: calc(10px + var(--it)); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spwho { display: flex; flex-direction: column; min-width: 0; max-width: 38vw; padding: 8px 14px; border-radius: 14px; background: rgba(6, 12, 20, 0.55); border: 1px solid var(--line); }
.spwho small { display: flex; align-items: center; gap: 6px; color: var(--a); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.spdot { width: 7px; height: 7px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 8px #ff4d5e; animation: fpulse 1.4s ease-in-out infinite; }
.spwho b { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#spMap { color: var(--tx2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sptime { position: absolute; left: 50%; top: 0; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; font: 800 22px/1 system-ui; font-variant-numeric: tabular-nums; background: rgba(6, 12, 20, 0.55); }
.specui .spleave { width: auto; background: rgba(6, 12, 20, 0.6); }
.spalt { position: absolute; left: calc(22px + var(--il)); top: calc(96px + var(--it)); bottom: calc(84px + var(--ib)); width: 8px; }
.spalt .track { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.spalt .track i { position: absolute; left: 0; right: 0; opacity: 0.75; }
.spalt .marks i { position: absolute; left: -4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; background: currentColor; box-shadow: 0 0 10px currentColor; transform: translateY(50%); transition: bottom 0.25s linear; }
.spnote { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); padding: 8px 18px; border-radius: 14px; font-size: 20px; font-weight: 800; white-space: nowrap; background: rgba(6, 12, 20, 0.6); }
.spnote:empty { display: none; }
.spfly { position: absolute; left: calc(44px + var(--il)); right: calc(14px + var(--ir)); bottom: calc(84px + var(--ib)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.spfly[hidden] { display: none; }
.spflyhelp { align-self: flex-end; padding: 6px 12px; border-radius: 10px; font-size: 13px; background: rgba(6, 12, 20, 0.6); }
.spstick { position: relative; flex: none; display: flex; width: 128px; height: 128px; border-radius: 50%; background: rgba(6, 12, 20, 0.45); border: 1px solid rgba(255, 255, 255, 0.28); pointer-events: auto; touch-action: none; }
.spstick i { display: block; width: 52px; height: 52px; margin: auto; border-radius: 50%; background: rgba(111, 242, 161, 0.65); box-shadow: 0 0 14px rgba(111, 242, 161, 0.5); pointer-events: none; }
.spflybtns { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.specui .spflybtns .btn { width: auto; min-width: 84px; flex: none; align-items: center; justify-content: center; padding: 11px 14px; background: rgba(6, 12, 20, 0.62); touch-action: none; user-select: none; -webkit-user-select: none; }
.specui .spflybtns .btn.on { background: rgba(111, 242, 161, 0.45); }
.spbot { position: absolute; left: calc(14px + var(--il)); right: calc(14px + var(--ir)); bottom: calc(10px + var(--ib)); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.spstats { display: flex; gap: 6px; }
.spstats div { min-width: 56px; padding: 6px 12px; border-radius: 12px; text-align: center; background: rgba(6, 12, 20, 0.55); }
.spstats b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.spstats small { color: var(--tx2); font-size: 10px; }
.spteam { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-width: 0; }
.spchip { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 20px; font-size: 12px; font-weight: 750; background: rgba(6, 12, 20, 0.55); border: 1px solid var(--line); }
.spchip span { color: var(--tx); }
.spchip i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.spchip.on { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.specui .spjoin { width: auto; }

/* While someone is watching your climb. */
#hWatch { position: absolute; left: 50%; top: calc(38px + var(--it)); transform: translateX(-50%); display: none; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 750; background: rgba(6, 12, 20, 0.5); }
#hWatch.on { display: block; }

/* Host and Join only have two choices: the panel fits them, with the icon beside the title to keep the cards low. */
.panel.fitpanel { width: min(500px, 100%); }
.fitpanel .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fitpanel .card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: start; gap: 6px 10px; padding: 11px 12px; }
.fitpanel .card .ic { align-self: center; }
.fitpanel .card small { grid-column: 1 / -1; }

/* On a PC: the touch buttons only show keys and what is ready, the mouse does the rest. */
body.pc .tb { pointer-events: none; }
.tb kbd { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); z-index: 2; padding: 1px 6px; border-radius: 6px; font: 700 10px/1.35 system-ui, sans-serif; color: #fff; background: rgba(8, 14, 24, 0.9); border: 1px solid rgba(255, 255, 255, 0.28); white-space: nowrap; }
#mouseHint { display: none; position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 9px 18px; border-radius: 999px; font-weight: 750; color: #fff; background: rgba(8, 14, 24, 0.82); border: 1px solid rgba(255, 255, 255, 0.22); pointer-events: none; white-space: nowrap; }
body.needclick #mouseHint { display: block; }
body.pc #menu { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
body.pc .btn:hover:not(:disabled), body.pc .seg button:hover { filter: brightness(1.18); cursor: pointer; }

/* A phone's browser can't be held sideways by the game. */
#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: grid; place-content: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; padding: 24px; text-align: center; font-size: 20px; color: #fff; background: #03060a; }
}

/* The game did not get going: why, and what to do about it. */
#bootFail { box-sizing: border-box; width: min(520px, 92vw); max-height: 60vh; overflow: auto; margin: 16px auto 0; padding: 14px 16px; border-radius: 14px; text-align: left; background: rgba(8, 14, 24, 0.85); border: 1px solid rgba(255, 255, 255, 0.16); }
#bootFail b { display: block; margin-bottom: 6px; font-size: 16px; color: #fff; }
#bootFail p { margin: 0 0 12px; font-size: 14px; line-height: 1.4; letter-spacing: normal; text-transform: none; color: var(--tx2); }
#bootFail .row { display: flex; flex-wrap: wrap; gap: 8px; }
#bootFail .btn { flex: 1 1 auto; margin: 0 4px 4px 0; }
#bootFail small { display: block; margin-top: 8px; font-size: 11px; line-height: 1.3; opacity: 0.6; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
#loading.failed > p { display: none; }

/* The sight of a scoped weapon: black round the lens, fine lines, little marks to judge distance by. */
#scope { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity 0.08s;
  background: radial-gradient(circle 46vh at center, rgba(120, 200, 255, 0.02) 0, rgba(120, 200, 255, 0.05) 88%, rgba(0, 0, 0, 0.55) 95%, #000 100%); }
#scope.on { opacity: 1; }
#scope::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, #000 0, #000 calc(50% - 46vh), rgba(0, 0, 0, 0.9) calc(50% - 46vh), rgba(0, 0, 0, 0.9) calc(50% - 16px), transparent calc(50% - 16px), transparent calc(50% + 16px), rgba(0, 0, 0, 0.9) calc(50% + 16px), rgba(0, 0, 0, 0.9) calc(50% + 46vh), #000 calc(50% + 46vh)); }
#scope::after { content: ''; position: absolute; top: 4vh; bottom: 4vh; left: 50%; width: 1px; background: linear-gradient(rgba(0, 0, 0, 0.9) 0, rgba(0, 0, 0, 0.9) calc(50% - 16px), transparent calc(50% - 16px), transparent calc(50% + 16px), rgba(0, 0, 0, 0.9) calc(50% + 16px)); }
#scope i { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ff3a30; box-shadow: 0 0 6px #ff3a30, 22px 0 0 -1px rgba(0, 0, 0, 0.85), 44px 0 0 -1px rgba(0, 0, 0, 0.85), 66px 0 0 -1px rgba(0, 0, 0, 0.85), -22px 0 0 -1px rgba(0, 0, 0, 0.85), -44px 0 0 -1px rgba(0, 0, 0, 0.85), -66px 0 0 -1px rgba(0, 0, 0, 0.85), 0 22px 0 -1px rgba(0, 0, 0, 0.85), 0 44px 0 -1px rgba(0, 0, 0, 0.85), 0 66px 0 -1px rgba(0, 0, 0, 0.85); }
#scope.hot i { background: #40ff70; box-shadow: 0 0 9px #40ff70, 22px 0 0 -1px rgba(0, 0, 0, 0.85), 44px 0 0 -1px rgba(0, 0, 0, 0.85), 66px 0 0 -1px rgba(0, 0, 0, 0.85), -22px 0 0 -1px rgba(0, 0, 0, 0.85), -44px 0 0 -1px rgba(0, 0, 0, 0.85), -66px 0 0 -1px rgba(0, 0, 0, 0.85), 0 22px 0 -1px rgba(0, 0, 0, 0.85), 0 44px 0 -1px rgba(0, 0, 0, 0.85), 0 66px 0 -1px rgba(0, 0, 0, 0.85); }
#scopeD { position: absolute; left: calc(50% + 30px); top: calc(50% + 22px); font: 700 13px ui-monospace, monospace; color: #bff4ff; text-shadow: 0 0 4px #000, 0 0 2px #000; }

/* With a controller: small buttons that say which button on the controller is which. */
.gp { display: none; }
body.pad .tb > kbd:not(.gp) { display: none; }
body.pad .gp, body.pad .hb .gp { display: block; }
.tb .gp, .hb .gp { position: absolute; top: -7px; right: -7px; left: auto; bottom: auto; transform: none; z-index: 3; min-width: 21px; height: 21px; padding: 0 3px; box-sizing: border-box; border-radius: 50%; font: 800 12px/19px system-ui, sans-serif; text-align: center; color: #fff; background: #20242e; border: 1.5px solid rgba(255, 255, 255, 0.55); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); letter-spacing: 0; }
.gp.wide { border-radius: 7px; font-size: 10px; padding: 0 5px; }
.gp.c0 { background: #1f9e4a; border-color: #5fe88a; } .gp.c1 { background: #c2303a; border-color: #ff7a82; } .gp.c2 { background: #2b64c8; border-color: #7aaeff; } .gp.c3 { background: #c79a1a; border-color: #ffe06a; }
.pstyle-ps .gp.c0 { background: #2b64c8; border-color: #7aaeff; } .pstyle-ps .gp.c1 { background: #c2303a; border-color: #ff7a82; } .pstyle-ps .gp.c2 { background: #a83a9a; border-color: #ff8ae8; } .pstyle-ps .gp.c3 { background: #178a78; border-color: #5fe8d0; }
.pstyle-nin .gp.c0, .pstyle-nin .gp.c1, .pstyle-nin .gp.c2, .pstyle-nin .gp.c3 { background: #2a2e38; border-color: rgba(255, 255, 255, 0.6); }
#padCard { display: none; position: absolute; left: 50%; top: 56px; transform: translateX(-50%); max-width: min(620px, 92vw); padding: 8px 12px; border-radius: 14px; background: rgba(8, 14, 24, 0.82); border: 1px solid rgba(255, 255, 255, 0.14); pointer-events: none; }
body.pad #padCard.on { display: block; }
.padkeys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 12px; font-weight: 650; color: var(--tx); }
.padkeys span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.padkeys .gp { display: inline-block; position: static; }
.pause .padkeys { margin-top: 10px; display: none; }
body.pad .pause .padkeys { display: flex; }

/* Weapons in the shop. */
.wstats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin: 2px 0 8px; width: 100%; font-size: 10.5px; color: var(--tx2); }
.wstats div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1px 6px; }
.wstats i { grid-column: 1 / -1; grid-row: 2; display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.wstats i::before { content: ''; display: block; height: 100%; width: var(--v); border-radius: 3px; background: var(--c, var(--a)); }
.wstats b { font-weight: 700; color: var(--tx); text-align: right; font-size: 11px; }
.wtag { font-size: 11px; color: var(--tx2); margin: 0 0 5px; }

/* ---------- the terminal, for the team (js/terminal.js) ---------- */
#term { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 25; display: none; align-items: stretch; justify-content: center; padding: calc(10px + var(--it)) calc(12px + var(--ir)) calc(10px + var(--ib)) calc(12px + var(--il)); background: rgba(2, 5, 10, 0.55); }
#term.on { display: flex; }
.termbox { width: min(980px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 16px; background: #060a12; border: 1px solid rgba(63, 240, 208, 0.35); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.termhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.termhead > b { font-size: 16px; letter-spacing: 0.04em; }
.termvan { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: 0.1em; padding: 3px 7px; border-radius: 6px; background: #5b2bd6; color: #fff; }
.termtabs { display: flex; gap: 4px; margin-left: auto; }
.termtabs button { padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--tx2); background: rgba(255, 255, 255, 0.06); }
.termtabs button.on { color: #04121a; background: var(--a); }
.termout, .termlist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.termout { font: 13px/1.45 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; user-select: text; -webkit-user-select: text; }
.termlist { display: none; }
#term.players .termout, #term.players .termsug, #term.players .termin { display: none; }
#term.players .termlist { display: block; }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 0; color: var(--tx); }
.tl.me { color: var(--a); margin-top: 8px; font-weight: 700; }
.tl.good { color: var(--good); } .tl.warn { color: var(--warn); } .tl.bad { color: var(--bad); } .tl.dim { color: var(--tx3); }
.termsug { display: flex; flex-direction: column; gap: 2px; max-height: 32%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.termsug:empty { display: none; }
.termsug button { display: flex; gap: 10px; align-items: baseline; min-width: 0; text-align: left; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
.termsug button b { font: 600 13px ui-monospace, Menlo, Consolas, monospace; color: var(--tx); white-space: nowrap; flex: none; }
.termsug button small { color: var(--tx3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.termsug button.info { background: none; cursor: default; padding-top: 2px; padding-bottom: 2px; }
.termsug button.info b { color: var(--a); }
.termin { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.termin span { color: var(--a); font: 700 15px ui-monospace, Menlo, Consolas, monospace; }
.termin input { flex: 1; min-width: 0; padding: 9px 0; border: 0; outline: 0; background: none; font: 15px ui-monospace, Menlo, Consolas, monospace; user-select: text; -webkit-user-select: text; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.trow .fdot { flex: none; }
.ttext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ttext b { font-size: 14px; }
.ttext b small { font-weight: 500; color: var(--tx3); }
.ttext > small { color: var(--tx2); font-size: 12px; }
.tbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.termnote { color: var(--tx3); font-size: 12px; margin: 2px 0 6px; }
.ttext b small.tvan { color: #b89cff; }
#termSlot:empty { display: none; }
.termbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1px solid rgba(63, 240, 208, 0.45); }
.spterm { margin-left: 6px; }
#term .btn { width: auto; flex: none; align-items: center; padding: 8px 14px; }
.termhead .termx { margin-left: 4px; }
.tbtns .btn { padding: 7px 12px; }
.spbot .spterm { width: auto; flex: none; align-items: center; padding: 8px 14px; }

/* A friend's invite: a card at the top, over the game and the menus. */
#invite, #update { position: fixed; left: 50%; top: calc(12px + var(--it)); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px;
  padding: 10px 12px 10px 16px; border-radius: 14px; background: rgba(10, 18, 30, 0.94); border: 1px solid rgba(111, 242, 161, 0.55); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 32px); width: max-content; transform: translate(-50%, calc(-100% - 40px)); transition: transform 0.3s ease-out; pointer-events: none; }
#invite.on, #update.on { transform: translate(-50%, 0); pointer-events: auto; }
#invite .itext, #update .itext { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 1.35; }
#invite .itext b, #update .itext b { font-weight: 750; }
#invite .itext small, #update .itext small { opacity: 0.75; font-size: 12px; }
#invite .ibtns, #update .ibtns { display: flex; gap: 6px; flex-shrink: 0; }
#update { z-index: 39; }
#update .btn { width: auto; flex: none; align-items: center; padding: 8px 14px; }
#update .ubar { display: block; width: 180px; max-width: 100%; height: 6px; margin-top: 4px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.14); }
#update .ubar i { display: block; height: 100%; border-radius: 3px; background: #6ff2a1; transition: width 0.25s linear; }
.fnote { margin: 0 0 10px; }

/* The generated maps: one card between two arrows, and the day's climb (main.js genRow). */
.genrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: stretch; }
.genrow.ro { grid-template-columns: minmax(0, 1fr); }
.genrow.ro .gnav { display: none; }
.gnav { border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: var(--tx); display: grid; place-items: center; cursor: pointer; padding: 0; }
.gnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gnav:active { background: rgba(255, 255, 255, 0.16); }
.map.gen { --bg: linear-gradient(160deg, #0d1220 10%, #1a1a30 55%, color-mix(in srgb, var(--acc, #3ff0d0) 45%, transparent)); --mc: var(--acc, #3ff0d0); min-height: 84px; border-left: 4px solid var(--acc, #3ff0d0); min-width: 0; }
.genbtns > .btn.sm { flex-direction: column; }
.map.gen b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map.gen.hol { --bg: linear-gradient(135deg, #3a1a08 0%, #2a1050 60%, color-mix(in srgb, var(--acc, #ff8a28) 50%, transparent)); }
.gtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gtags em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); color: var(--tx); }
.gtags em.gr.g0 { background: #2f8a4a; } .gtags em.gr.g1 { background: #2f6aa8; } .gtags em.gr.g2 { background: #a8562f; } .gtags em.gr.g3 { background: #a82f4e; }
.gtags em.today { background: #ffd040; color: #1a1408; }
.genbtns { margin-top: 8px; }
.btn.daily { border-left: 4px solid var(--acc, #ffd040); }
.btn.daily.hol { background: linear-gradient(135deg, rgba(255, 140, 40, 0.22), rgba(160, 60, 255, 0.2)); }

/* Traitor mode (traitor.js): the traitor's mask button and sabotage list, everyone's vote button, the vote, and the sabotages. */
#hTr, #hSab { position: absolute; right: calc(14px + var(--ir)); width: 44px; height: 44px; border-radius: 14px; pointer-events: auto; font-size: 22px; line-height: 1; display: grid; place-items: center; }
#hTr { top: calc(116px + var(--it)); }
#hSab { top: calc(168px + var(--it)); background: rgba(120, 10, 30, 0.6); box-shadow: 0 0 14px rgba(255, 40, 80, 0.45); }
#hTr[hidden], #hSab[hidden] { display: none; }
#sabMenu { position: fixed; z-index: 9; display: none; right: calc(66px + var(--ir)); top: calc(64px + var(--it)); width: min(300px, calc(100vw - 96px)); padding: 10px; border-radius: 16px; background: rgba(24, 6, 12, 0.92); border: 1px solid rgba(255, 70, 100, 0.45); flex-direction: column; gap: 6px; }
#sabMenu.on { display: flex; }
#sabMenu > b { color: #ff6a86; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
#sabMenu button { text-align: left; padding: 8px 10px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 60, 90, 0.16); color: #fff; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
#sabMenu button b { font-size: 14px; }
#sabMenu button small { font-size: 11.5px; color: rgba(255, 255, 255, 0.75); }
#sabMenu button.wait { opacity: 0.5; }
#sabMenu .sabnote { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
#trVote { position: fixed; z-index: 8; left: 50%; top: calc(62px + var(--it)); transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 16px; background: rgba(30, 8, 16, 0.9); border: 1px solid rgba(255, 70, 100, 0.5); color: #fff; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
#trVote[hidden] { display: none; }
#trVote > b { font-size: 15px; color: #ff8aa0; }
#trVote > small { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
#trVote .trv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
#trVote .trv button { flex: 1 1 40%; min-width: 0; padding: 8px 6px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08); color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#trVote .trv button.on { background: #ff3b5c; border-color: #ff3b5c; }
#trVote .trv button.skip { flex-basis: 100%; color: rgba(255, 255, 255, 0.7); }
#trVote .trv button:disabled:not(.on) { opacity: 0.45; }
#trDark { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 0.6s; background: radial-gradient(circle at 50% 56%, rgba(0, 0, 0, 0.55) 0, rgba(0, 0, 0, 0.97) 120px, #000 260px); }
#trDark.on { opacity: 1; transition: opacity 0.15s; }
body.trStatic #hNav, body.trStatic #hAlt, body.trStatic #tags, body.trStatic #hPlayers, body.trStatic #hZone, body.trStatic #hRelic { visibility: hidden; }
body.trStatic #hud::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.22; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 3px); animation: trStatic 0.12s steps(3) infinite; }
@keyframes trStatic { 0% { transform: translateY(0); } 50% { transform: translateY(1px); } 100% { transform: translateY(-1px); } }
.trclues { margin: 4px 0 10px; padding-left: 18px; text-align: left; font-size: 13px; line-height: 1.45; }
.trEnd { margin: 8px 0 0; font-weight: 750; }
.trEnd.good { color: #6ff08e; } .trEnd.bad { color: #ff7a90; }

/* ---------- chat (chat.js): soft and round, pink and lilac ---------- */
#hChat { position: absolute; right: calc(14px + var(--ir)); top: calc(64px + var(--it)); width: 44px; height: 44px; border-radius: 14px; pointer-events: auto; font-size: 22px; line-height: 1; display: grid; place-items: center; }
#hChat[hidden] { display: none; }
#hChat em, .chn { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: linear-gradient(135deg, #ff6fb5, #c06bff); color: #fff; font: 800 11px/18px system-ui; font-style: normal; text-align: center; box-shadow: 0 0 10px rgba(255, 105, 180, 0.75); animation: chBeat 1.6s ease-in-out infinite; }
[data-chatn]:empty { display: none; }
.lobrow { margin-top: 10px; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.btn.chatb { position: relative; }
#chat { position: fixed; z-index: 45; left: calc(10px + var(--il)); top: calc(10px + var(--it)); bottom: calc(10px + var(--ib)); width: min(380px, calc(100vw - 20px - var(--il) - var(--ir))); display: none; }
#chat.on { display: flex; }
.chbox { flex: 1; display: flex; flex-direction: column; min-height: 0; color: #fff; background: linear-gradient(165deg, rgba(62, 34, 92, 0.94), rgba(24, 28, 62, 0.94)); border: 1px solid rgba(255, 182, 232, 0.38); border-radius: 24px; box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 120, 200, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1); overflow: hidden; animation: chIn 0.24s ease-out; }
.chhead { display: flex; align-items: center; gap: 6px; padding: 10px 12px 8px; }
.chhead b { flex: 1; font-size: 17px; font-weight: 850; letter-spacing: 0.3px; background: linear-gradient(90deg, #ffb8e8, #c3b1ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chico { width: 36px; height: 36px; border-radius: 13px; border: 0; background: rgba(255, 255, 255, 0.09); color: #fff; font-size: 17px; display: grid; place-items: center; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.chico:active { transform: scale(0.92); }
.chico.on { background: rgba(255, 130, 200, 0.32); }
.chlist { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 7px; overscroll-behavior: contain; }
.chm { display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; animation: chPop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); }
.chm.me { align-self: flex-end; align-items: flex-end; }
.chb { padding: 6px 12px 7px; border-radius: 17px 17px 17px 6px; background: rgba(255, 255, 255, 0.1); border-left: 3px solid var(--pc); }
.chm.me .chb { border-radius: 17px 17px 6px 17px; border-left: 0; background: linear-gradient(135deg, rgba(255, 122, 196, 0.88), rgba(155, 120, 255, 0.88)); box-shadow: 0 3px 12px rgba(255, 110, 190, 0.25); }
.chname { display: inline; font-size: 12px; font-weight: 800; color: var(--pc); }
.chm.me .chname { display: none; }
.chb .role { margin-left: 2px; vertical-align: 1px; }
.chtx { display: block; font-size: 14px; line-height: 1.32; word-break: break-word; }
.chm small { font-size: 10px; opacity: 0.5; margin: 2px 7px 0; }
.chempty { margin: auto; padding: 18px 8px; text-align: center; opacity: 0.75; font-size: 13.5px; }
.chquick { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 0 10px 6px; flex-shrink: 0; }
.chemo { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); justify-items: center; padding: 0 8px 4px; flex-shrink: 0; }
.chquick button { border: 1px solid rgba(255, 182, 232, 0.3); border-radius: 99px; padding: 5px 11px; font: 750 12.5px system-ui; color: #ffe6f6; background: rgba(255, 150, 215, 0.16); cursor: pointer; white-space: nowrap; }
.chquick button:active, .chemo button:active { transform: scale(0.9); }
.chemo button { border: 0; background: transparent; font-size: 21px; line-height: 1.25; padding: 2px 0; width: 32px; cursor: pointer; }
.chin { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); flex-shrink: 0; }
.chin .btn { width: auto; flex: none; padding: 0 18px; justify-content: center; }
.chin input { flex: 1; min-width: 0; border-radius: 15px; border: 1px solid rgba(255, 190, 235, 0.32); background: rgba(0, 0, 0, 0.26); color: #fff; padding: 9px 13px; font-size: 14px; outline: none; }
.chin input:focus { border-color: rgba(255, 150, 215, 0.8); box-shadow: 0 0 0 3px rgba(255, 130, 200, 0.18); }
.chpeople { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; }
#chat.people .chpeople { display: block; }
#chat.people .chlist, #chat.people .chquick, #chat.people .chemo, #chat.people .chin { display: none; }
.chp { display: flex; align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.chp i { width: 11px; height: 11px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px var(--pc); flex-shrink: 0; }
.chp .chname { flex: 1; font-size: 14px; color: #fff; }
.chall { margin-top: 12px; width: 100%; }
#chatFeed { position: fixed; z-index: 25; left: calc(14px + var(--il)); bottom: calc(16px + var(--ib)); max-width: min(40vw, 340px); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 5px; pointer-events: none; }
.chpop { padding: 5px 12px 6px; border-radius: 15px 15px 15px 6px; background: rgba(40, 22, 64, 0.74); border-left: 3px solid var(--pc); font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); animation: chPop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); transition: opacity 1.2s ease, transform 1.2s ease; }
.chpop.out { opacity: 0; transform: translateY(6px); }
.chpop { transform-origin: left bottom; }
.chpop .chname { display: inline; margin-right: 6px; }
.chpop .chtx { display: inline; font-size: 13px; }
#tags .chatB { position: absolute; transform: translate(-50%, -100%); max-width: 190px; padding: 5px 11px 6px; border-radius: 15px; background: rgba(255, 246, 252, 0.94); color: #3a1f55; font: 750 13px/1.25 system-ui; text-align: center; word-break: break-word; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35); animation: chFade 0.25s ease-out; }
#tags .chatB::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: rgba(255, 246, 252, 0.94); border-bottom: 0; }
@keyframes chPop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes chFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes chIn { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes chBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

