:root {
  --ink: #0b0910;
  --bg: #100c16;
  --panel: rgba(11, 9, 15, .84);
  --panel-solid: #141019;
  --raise: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f2eee6;
  --muted: #a49dac;
  --dim: #6d6678;
  --accent: #ff4a1c;
  --accent-2: #ff7a3d;
  --gold: #ffbf3c;
  --good: #5be38a;
  --bad: #ff4458;
  --lime: var(--good); --red: var(--bad); --orange: #ff8a3d; --cyan: #5cc8ff; --pink: var(--accent); /* aliases used by the admin page */
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --ui: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--ui); font-weight: 500; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

#gl, #labels { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#gl { cursor: grab; touch-action: none; }
#gl.grabbing { cursor: grabbing; }
#gl.pointer { cursor: pointer; }
#labels { pointer-events: none; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }

/* ---------------------------------------------------------------- primitives (no blur: it re-blurs the 3D canvas every frame) */
.panel { position: relative; background: var(--panel); border-radius: 3px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; cursor: pointer; user-select: none; }
.panel-h span { font-family: var(--display); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.panel-h small { font-size: 12px; color: var(--muted); letter-spacing: .08em; font-weight: 600; }
.mini { background: none; border: 0; width: 22px; height: 22px; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; transition: transform .2s; }
.board.collapsed .mini { transform: rotate(-90deg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 0; border-radius: 3px; cursor: pointer;
  font-family: var(--ui); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; transition: background .15s, color .15s, transform .12s; }
.btn:active { transform: translateY(1px); }
.btn-gold, .btn-accent { background: var(--accent); color: #fff; }
.btn-gold:hover, .btn-accent:hover { background: var(--accent-2); }
.btn-pink { background: var(--text); color: var(--ink); }
.btn-pink:hover { background: #fff; }
.btn-ghost { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; background: var(--panel); border: 0; border-radius: 3px; cursor: pointer; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s; }
.icon-btn:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.on { background: var(--text); color: var(--ink); }

/* ---------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 12px; justify-self: start; }
.logo, .ld-logo {
  display: inline-block; font-family: var(--display); font-size: 40px; line-height: 1; letter-spacing: .02em; color: var(--ink);
  background: var(--accent); padding: 6px 14px 4px 12px; transform: skewX(-10deg); box-shadow: 4px 4px 0 var(--ink);
}
.brand-sub { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 56px; font-size: 13px; font-weight: 700; letter-spacing: .24em; color: var(--text); text-transform: uppercase; line-height: 1; background: var(--panel); padding: 7px 12px 7px; border-radius: 3px; }
.brand-sub i { font-style: normal; font-size: 11px; letter-spacing: .22em; color: var(--muted); font-weight: 700; }
.brand-sub .wm { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: .9; letter-spacing: .03em; color: var(--text); }
.logo-mark { width: 56px; height: 56px; display: block; box-shadow: 4px 4px 0 #000; }
.ld-mark { width: 132px; height: 132px; box-shadow: 8px 8px 0 #000; animation: bob 1.6s ease-in-out infinite alternate; }
.badge { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--ink); background: var(--gold); padding: 3px 6px 2px; border-radius: 2px; text-shadow: none; }

/* ---------------------------------------------------------------- top */
.top { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 16px; padding: 20px 22px; pointer-events: none; }
.top > * { pointer-events: auto; }

.drop { min-width: 260px; padding: 12px 20px 13px; text-align: center; }
.drop-label { font-size: 11px; font-weight: 700; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.drop-time { font-family: var(--display); font-size: 44px; line-height: 1.05; color: var(--text); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.drop.hot .drop-time { color: var(--gold); }
.drop.hot .drop-label { color: var(--gold); }
.bar { height: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin: 7px 0 7px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s linear; }
.drop.hot .bar i { background: var(--gold); }
.drop-pool { font-size: 13px; color: var(--muted); letter-spacing: .08em; font-weight: 600; text-transform: uppercase; }
.drop-pool b { color: var(--text); font-weight: 700; }

.chips { justify-self: end; display: flex; gap: 1px; background: var(--line); border-radius: 3px; overflow: hidden; }
.chip { background: var(--panel); padding: 9px 14px 8px; min-width: 92px; }
.chip span { display: block; font-size: 10.5px; letter-spacing: .18em; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.chip b { font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--text); letter-spacing: .02em; }
.chip.gold b { color: var(--gold); }

/* ---------------------------------------------------------------- leaderboard */
.board { position: absolute; left: 22px; top: 132px; width: 280px; max-height: calc(100vh - 240px); display: flex; flex-direction: column; }
.board ol { list-style: none; margin: 0; padding: 0 6px 6px; overflow: auto; scrollbar-width: thin; border-top: 1px solid var(--line); }
.board li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; cursor: pointer; border-radius: 2px; }
.board li:hover { background: var(--raise); }
.board li .rk { font-family: var(--display); font-size: 15px; color: var(--dim); text-align: center; }
.board li:nth-child(-n+3) .rk { color: var(--gold); }
.board li .nm { min-width: 0; }
.board li .nm b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.board li .nm small { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.board li .tm { font-family: var(--mono); font-size: 12px; color: var(--text); text-align: right; }
.board li .tm small { display: block; font-family: var(--ui); font-size: 11px; color: var(--muted); letter-spacing: .08em; font-weight: 600; }
.board.collapsed ol, .board.collapsed .board-more { display: none; }
.board-more { font-size: 11.5px; color: var(--dim); text-align: center; padding: 4px 0 10px; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; }

/* ---------------------------------------------------------------- feed */
.feed { position: absolute; right: 22px; top: 132px; width: 320px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.ev { pointer-events: auto; display: flex; gap: 9px; align-items: baseline; padding: 7px 11px; background: var(--panel); border-radius: 3px; font-size: 14.5px; line-height: 1.3; max-width: 100%;
  animation: evIn .3s ease-out; transition: opacity .6s, transform .6s; cursor: pointer; }
.ev.out { opacity: 0; transform: translateX(16px); }
.ev .i { width: 7px; height: 7px; border-radius: 1px; flex-shrink: 0; transform: translateY(-1px); background: var(--muted); }
.ev b { color: #fff; font-weight: 700; }
.ev .a { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.ev.join .i { background: var(--good); } .ev.leave .i { background: var(--bad); } .ev.moved .i { background: var(--accent-2); } .ev.podium .i, .ev.loot .i { background: var(--gold); }
.ev.loot { box-shadow: inset 2px 0 0 var(--gold); }
@keyframes evIn { from { opacity: 0; transform: translateX(16px); } }

/* ---------------------------------------------------------------- bottom */
.bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; padding: 18px 22px 20px; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.ca { justify-self: start; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 5px 0 13px; border: 0; cursor: pointer; max-width: 100%; color: var(--text); }
.ca span { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--muted); }
.ca b { font-size: 12.5px; font-weight: 500; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca i { font-style: normal; font-weight: 700; font-size: 11.5px; letter-spacing: .14em; background: var(--raise); padding: 7px 10px; border-radius: 2px; }
.ca:hover i { background: rgba(255,255,255,.1); }
.find { display: flex; gap: 4px; padding: 4px; width: min(500px, 44vw); }
.find input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 0 12px; font-family: var(--mono); font-size: 13px; height: 42px; }
.find input::placeholder { color: var(--dim); font-family: var(--ui); font-weight: 600; letter-spacing: .06em; font-size: 15px; }
.actions { justify-self: end; display: flex; gap: 6px; align-items: center; }
.hint { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); font-size: 11.5px; letter-spacing: .22em; color: rgba(255,255,255,.55); font-weight: 600; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); transition: opacity 1s; white-space: nowrap; }
.hint.gone { opacity: 0; }

/* ---------------------------------------------------------------- tooltip */
.tip { position: fixed; z-index: 20; pointer-events: none; width: 260px; background: var(--panel-solid); border-radius: 3px; padding: 12px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 2px 0 var(--rc, #cfd3e6); }
.tip .t-rar { font-size: 10.5px; letter-spacing: .18em; font-weight: 700; color: var(--rc); text-transform: uppercase; }
.tip .t-name { font-family: var(--display); font-size: 20px; line-height: 1.1; margin: 3px 0 2px; color: var(--text); letter-spacing: .02em; text-transform: uppercase; }
.tip .t-w { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.tip .t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tip .t-grid span { display: block; font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.tip .t-grid b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.tip .t-foot { margin-top: 10px; font-size: 11px; color: var(--dim); letter-spacing: .14em; font-weight: 700; }

/* ---------------------------------------------------------------- big banner */
.empty { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .k { font-weight: 700; font-size: 13px; letter-spacing: .32em; color: #0b0910; background: #ff4a1c; padding: 5px 10px 4px 13px; text-transform: uppercase; }
.empty b { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 76px); line-height: .95; text-transform: uppercase; color: #f2eee6; text-shadow: 0 5px 0 #0b0910; }
.empty i { font-style: normal; font-weight: 700; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: #d8d1e0; text-shadow: 0 2px 6px #000; }
.banner { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; z-index: 8; }
.banner .bn { animation: bnIn 3.4s cubic-bezier(.2, .9, .3, 1) forwards; display: flex; flex-direction: column; align-items: center; }
.banner .bn-k { font-size: 13px; font-weight: 700; letter-spacing: .3em; color: var(--ink); background: var(--gold); padding: 4px 10px 3px; text-transform: uppercase; }
.banner .bn-t { font-family: var(--display); font-size: clamp(48px, 7vw, 104px); line-height: 1; color: #fff; letter-spacing: .01em; text-transform: uppercase; margin-top: 8px;
  text-shadow: 0 4px 0 var(--ink), 0 0 40px rgba(0,0,0,.5); }
.banner .bn-s { margin-top: 8px; font-weight: 700; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.banner .red .bn-k { background: var(--bad); color: #fff; }
@keyframes bnIn { 0% { opacity: 0; transform: translateY(14px) scale(.96); } 8% { opacity: 1; transform: none; } 84% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(6, 4, 10, .72); padding: 20px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.close { position: absolute; right: 12px; top: 12px; z-index: 3; background: var(--raise); border: 0; border-radius: 3px; width: 34px; height: 34px; cursor: pointer; font-size: 14px; color: var(--muted); }
.close:hover { background: rgba(255,255,255,.1); color: var(--text); }

.sheet { width: min(960px, 100%); max-height: calc(100vh - 40px); display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-solid); overflow: hidden; animation: popIn .25s ease-out; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px); } }
.sheet-view { position: relative; min-height: 520px; background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--rc, #888) 22%, transparent), transparent 60%), #0d0a12; overflow: hidden; }
#preview { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.rar-tag { position: absolute; left: 18px; top: 18px; font-size: 12px; font-weight: 700; letter-spacing: .2em; padding: 5px 9px 4px; color: var(--ink); background: var(--rc, #cfd3e6); border-radius: 2px; text-transform: uppercase; }
.drag-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .24em; color: var(--dim); font-weight: 700; }
.sheet-info { padding: 26px 28px 24px; overflow: auto; }
.sh-kicker { font-size: 12px; letter-spacing: .2em; font-weight: 700; color: var(--muted); }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.02; margin: 6px 0 6px; color: var(--text); text-transform: uppercase; letter-spacing: .01em; }
.sh-wallet { font-size: 11.5px; color: var(--dim); word-break: break-all; }
.sh-wallet:hover { color: var(--text); }
.sh-level { display: flex; gap: 14px; align-items: center; margin: 18px 0 16px; padding: 12px 14px; background: var(--raise); border-radius: 3px; }
.lv { min-width: 54px; height: 54px; display: grid; place-items: center; flex-shrink: 0; font-family: var(--display); font-size: 20px; color: var(--ink); background: var(--gold); border-radius: 2px; }
.lv-info { flex: 1; }
.lv-info b { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .03em; text-transform: uppercase; }
.lv-info small { color: var(--muted); font-size: 13px; }
.lv-info .bar i { background: var(--gold); }
.sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sh-stats div { background: var(--panel-solid); padding: 10px 12px; }
.sh-stats span { display: block; font-size: 10.5px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.sh-stats b { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }
.sh-traits { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.trait { font-size: 14px; padding: 4px 9px; background: var(--raise); border-radius: 2px; }
.trait span { color: var(--dim); font-weight: 700; font-size: 10.5px; letter-spacing: .14em; margin-right: 6px; }
.sh-hist { margin-top: 14px; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.sh-hist a { display: flex; justify-content: space-between; padding: 5px 9px; background: var(--raise); border-radius: 2px; }
.sh-hist a b { color: var(--gold); font-family: var(--mono); font-weight: 500; }
.sh-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.sh-note { margin-top: 14px; padding: 11px 13px; background: var(--raise); box-shadow: inset 2px 0 0 var(--gold); font-size: 14.5px; color: var(--text); }

.how { width: min(1000px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 30px 32px 28px; background: var(--panel-solid); animation: popIn .25s ease-out; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.how-title { font-family: var(--display); font-weight: 400; font-size: 40px; margin: 0 0 20px; text-transform: uppercase; letter-spacing: .01em; }
.how-title span { color: var(--accent); }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 3px; overflow: hidden; }
.step { background: var(--panel-solid); padding: 16px 18px 16px; }
.step i { font-style: normal; font-family: var(--display); font-size: 15px; color: var(--accent); }
.step b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; margin: 2px 0 6px; text-transform: uppercase; letter-spacing: .02em; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.4; }
.how-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin-top: 24px; }
.how h3 { font-size: 12px; font-weight: 700; letter-spacing: .22em; color: var(--text); margin: 0 0 10px; text-transform: uppercase; }
.how-list { margin: 0 0 20px; padding: 0 0 0 16px; color: var(--muted); font-size: 15.5px; line-height: 1.45; display: grid; gap: 6px; }
.how-list b { color: var(--text); }
.how-list a { color: var(--text); font-family: var(--mono); font-size: 12px; text-decoration: underline; text-decoration-color: var(--line-2); }
.g1, .g2, .g3 { color: var(--gold) !important; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); font-size: 14px; border-radius: 3px; overflow: hidden; }
.levels div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; background: var(--panel-solid); }
.levels b { font-family: var(--display); font-weight: 400; color: var(--gold); width: 24px; }
.levels span { flex: 1; }
.levels em { font-style: normal; font-family: var(--mono); color: var(--dim); font-size: 11px; }

/* ---------------------------------------------------------------- loader */
#loader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: var(--bg); transition: opacity .7s, visibility .7s; }
#loader.done { opacity: 0; visibility: hidden; }
.ld-logo { font-size: 92px; padding: 8px 26px 4px 22px; box-shadow: 7px 7px 0 #000; }
@keyframes bob { to { transform: translateY(-8px); } }
.ld-bar { width: 220px; height: 3px; background: rgba(255,255,255,.1); }
.ld-bar i { display: block; height: 100%; width: 5%; background: var(--accent); transition: width .3s; }
.ld-tip { font-weight: 700; letter-spacing: .22em; font-size: 12px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(10px); z-index: 60; background: var(--text); color: var(--ink); padding: 9px 16px; font-weight: 700; font-size: 14px; letter-spacing: .1em; border-radius: 3px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) { .feed { width: 280px; } .board { width: 250px; } .chips .chip:nth-child(3) { display: none; } }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; padding: 12px; }
  .chips { display: none; }
  .logo-mark { width: 44px; height: 44px; }
  .brand-sub { min-height: 44px; }
  .brand-sub .wm { font-size: 20px; }
  .brand-sub i { display: none; }
  .drop { min-width: 0; padding: 8px 14px 9px; }
  .drop-time { font-size: 30px; }
  .board { top: auto; bottom: 150px; left: 12px; width: 220px; max-height: 34vh; }
  .feed { top: auto; bottom: 200px; right: 12px; width: 220px; }
  .feed .ev:nth-child(n+3) { display: none; }
  .ev { font-size: 12.5px; padding: 6px 9px; }
  .bottom { grid-template-columns: 1fr; padding: 10px 12px 12px; gap: 6px; }
  .ca { display: none; }
  .find { width: 100%; }
  .actions { justify-self: stretch; justify-content: space-between; }
  .actions .btn { flex: 1; padding: 0 10px; font-size: 13px; }
  .hint { display: none; }
  .sheet { grid-template-columns: 1fr; overflow: auto; }
  .sheet-view { min-height: 320px; }
  .how-steps, .how-cols { grid-template-columns: 1fr; }
}
