:root {
  --bg: #08090e;
  --bg-2: #0d1017;
  --panel: #12161f;
  --panel-2: #171c28;
  --panel-3: #1d2331;
  --line: #232a39;
  --line-2: #2e374a;
  --text: #e9ecf3;
  --muted: #8d96aa;
  --dim: #5e677b;
  --red: #ff4d5e;
  --red-2: #ff7a86;
  --red-bg: rgba(255, 77, 94, 0.12);
  --blue: #3d8bff;
  --blue-2: #7ab0ff;
  --blue-bg: rgba(61, 139, 255, 0.12);
  --gold: #ffc542;
  --gold-bg: rgba(255, 197, 66, 0.12);
  --green: #39d98a;
  --green-bg: rgba(57, 217, 138, 0.12);
  --orange: #ff8a3d;
  --purple: #a685ff;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 139, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 77, 94, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.gold { color: var(--gold); }
.green { color: var(--green); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: rgba(8, 9, 14, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none !important; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, var(--red), var(--gold), var(--blue), var(--red));
  box-shadow: 0 0 16px rgba(255, 77, 94, 0.35);
}
.brand-name { font-weight: 800; letter-spacing: 0.22em; font-size: 15px; }
.brand-game {
  font: 700 10px var(--mono); letter-spacing: 0.15em; color: var(--gold);
  border: 1px solid rgba(255, 197, 66, 0.35); padding: 2px 6px; border-radius: 5px;
}
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap;
  text-decoration: none !important;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--red); }
.nav-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.nav-count:empty { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.balance-pill {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px;
  background: var(--gold-bg); border: 1px solid rgba(255, 197, 66, 0.28); color: var(--gold);
  font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none !important;
}
.coin {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2c2, var(--gold) 45%, #b8861b);
  box-shadow: 0 0 8px rgba(255, 197, 66, 0.5);
}
.test-tag { font: 700 9px var(--mono); color: var(--bg); background: var(--gold); padding: 1px 4px; border-radius: 4px; }
.balance-usd { font-weight: 600; font-size: 12px; color: rgba(255, 197, 66, 0.75); }
@media (max-width: 640px) { .balance-usd { display: none; } }
.usd { color: var(--muted); font-weight: 500; font-size: 0.85em; }
.asset-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.asset-toggle button { padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); cursor: pointer; text-align: left; }
.asset-toggle button b { display: block; color: var(--text); font-size: 14px; }
.asset-toggle button.on { border-color: var(--gold); background: var(--gold-bg); color: var(--text); }
.quote { border-radius: var(--radius-sm); border: 1px dashed var(--line-2); background: var(--bg-2); padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.quote .line { display: flex; justify-content: space-between; gap: 10px; }
.quote .line b { font-family: var(--mono); }
.quote .total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; font-weight: 700; }
.balance-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.balance-big .amt { font: 900 30px var(--mono); color: var(--gold); }
.balance-big .usd { font-size: 16px; }
.price-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.price-row .chg { font: 700 12px var(--mono); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
}
.user-chip:hover { border-color: var(--line-2); }

/* ---------------------------------------------------------------- layout */
.view { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: 0.02em; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 16px 16px 48px; }
  .topbar { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-game { display: none; }
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card.tight { padding: 12px 14px; }
.card.flat { background: var(--panel); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h2 { margin: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--panel-3); color: var(--text); font-weight: 650; cursor: pointer;
  transition: transform 0.06s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover:not(:disabled) { border-color: #3c475e; background: #222a3b; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ff5d6c, #e23d4e); border-color: #ff6b79; color: #fff; box-shadow: 0 6px 18px rgba(255, 77, 94, 0.25); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ff6d7b, #ea4556); }
.btn.gold { background: linear-gradient(180deg, #ffd166, #f2b231); border-color: #ffd77a; color: #241a02; }
.btn.red { background: var(--red-bg); border-color: rgba(255, 77, 94, 0.45); color: var(--red-2); }
.btn.red:hover:not(:disabled) { background: rgba(255, 77, 94, 0.22); }
.btn.blue { background: var(--blue-bg); border-color: rgba(61, 139, 255, 0.45); color: var(--blue-2); }
.btn.blue:hover:not(:disabled) { background: rgba(61, 139, 255, 0.22); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.big { padding: 13px 20px; font-size: 15px; }

input[type=text], input[type=number], select {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.2); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 650; cursor: pointer; }
.segmented button.on { background: var(--panel-3); color: var(--text); }

/* ---------------------------------------------------------------- badges */
.ovr {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 6px; font: 800 12px var(--mono); color: #10131a;
  background: linear-gradient(180deg, #e9edf6, #b9c2d6);
}
.ovr.t2 { background: linear-gradient(180deg, #9ff0c4, #39d98a); }
.ovr.t3 { background: linear-gradient(180deg, #a9cbff, #3d8bff); color: #fff; }
.ovr.t4 { background: linear-gradient(180deg, #d4c2ff, #a685ff); color: #fff; }
.ovr.t5 { background: linear-gradient(180deg, #ffe39a, #ffc542); }
.ovr.big { min-width: 64px; height: 48px; font-size: 26px; border-radius: 10px; }
.streak {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 138, 61, 0.14); color: var(--orange); font: 800 11px var(--mono);
  border: 1px solid rgba(255, 138, 61, 0.35);
}
.streak.hot { background: rgba(255, 77, 94, 0.18); color: #ff9a6b; border-color: rgba(255, 120, 80, 0.5); box-shadow: 0 0 12px rgba(255, 100, 60, 0.25); }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font: 700 10px var(--mono); letter-spacing: 0.08em;
  background: var(--panel-3); color: var(--muted); border: 1px solid var(--line-2); text-transform: uppercase;
}
.tag.live { background: var(--red); color: #fff; border-color: var(--red); animation: pulse 1.6s infinite; }
.tag.gold { color: var(--gold); border-color: rgba(255, 197, 66, 0.4); }
.tag.green { color: var(--green); border-color: rgba(57, 217, 138, 0.4); }
.tag.blue { color: var(--blue-2); border-color: rgba(61, 139, 255, 0.4); }
.tag.bot { color: var(--purple); border-color: rgba(166, 133, 255, 0.4); }
.team-tag { font: 800 11px var(--mono); color: var(--muted); }
@keyframes pulse { 50% { opacity: 0.6; } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dim); }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.ready { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.side-red { color: var(--red); }
.side-blue { color: var(--blue); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.red { background: var(--red); }
.swatch.blue { background: var(--blue); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.class-cell { display: flex; align-items: center; gap: 10px; }
.kit-thumb { width: 96px; height: 60px; flex: none; image-rendering: pixelated; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: rgba(255, 255, 255, 0.025); }
table.data .r { text-align: right; }
.rank { font: 800 13px var(--mono); color: var(--dim); }
.rank.top { color: var(--gold); }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: calc(100vh - 112px); display: grid; place-items: center; padding: 8px 0 24px; }
.auth-card { width: min(440px, 100%); }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero .brand-mark { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 14px; }
.auth-hero h1 { margin: 0; font-size: 34px; letter-spacing: 0.3em; padding-left: 0.3em; }
.auth-hero p { margin: 8px 0 0; color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.feature-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.feature-list li { display: flex; gap: 10px; }
.feature-list b { color: var(--text); }

/* ---------------------------------------------------------------- play */
.queue-card { position: relative; overflow: hidden; cursor: pointer; text-align: left; width: 100%; color: inherit; font: inherit; transition: border-color 0.15s, transform 0.06s; }
.queue-card:hover { border-color: var(--line-2); }
.queue-card:active { transform: translateY(1px); }
a.card:hover { border-color: var(--line-2); text-decoration: none; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--panel-3); border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 5px; }
.queue-card .mode { font: 900 30px var(--mono); letter-spacing: -0.02em; }
.queue-card .sub { color: var(--muted); font-size: 12px; }
.map-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.map-pick {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.map-pick:hover { border-color: var(--line-2); }
.map-pick canvas {
  width: 56px; height: 56px; flex: none; border-radius: 6px; background: #1a1e26; image-rendering: pixelated;
  opacity: 0.35; filter: grayscale(1); transition: opacity 0.15s, filter 0.15s;
}
.map-pick .nm { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--muted); }
.map-pick .check { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: 4px; border: 1px solid var(--line-2); font-size: 11px; }
.map-pick.on { border-color: rgba(255, 197, 66, 0.55); background: var(--gold-bg); }
.map-pick.on canvas { opacity: 1; filter: none; }
.map-pick.on .nm { color: var(--text); }
.map-pick.on .check { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.queue-card.searching { border-color: rgba(255, 77, 94, 0.6); box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.3), 0 10px 30px rgba(255, 77, 94, 0.12); }
.queue-card.searching::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: scan 1.2s linear infinite;
}
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.stat .v { font: 800 18px var(--mono); margin-top: 2px; }
/* weapon charms (views/charms.js): the art swings from its ring */
.charm-row { display: flex; gap: 14px; align-items: flex-start; }
.charm-art {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(91, 209, 127, 0.14), transparent 70%), var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.charm-icon { width: 60px; height: 60px; image-rendering: pixelated; transform-origin: 50% 6%; animation: charm-swing 2.4s ease-in-out infinite; }
@keyframes charm-swing { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.charm-name { font-weight: 800; font-size: 15px; }
.charm-price { margin-top: 4px; color: var(--text); }
.charm-actions { gap: 8px; margin-top: 10px; }
.rules { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; font-size: 13px; }
.rules b { color: var(--text); }

/* ---------------------------------------------------------------- live matches */
.match-card { display: flex; flex-direction: column; gap: 14px; }
.match-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.match-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match-side.right { align-items: flex-end; text-align: right; }
.match-side .name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.match-side .players { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.scorebox { text-align: center; }
.scorebox .score { font: 900 30px var(--mono); letter-spacing: 0.04em; }
.scorebox .clock { font: 700 12px var(--mono); color: var(--muted); }
.chance { height: 6px; border-radius: 3px; overflow: hidden; display: flex; background: var(--bg-2); }
.chance > div:first-child { background: var(--red); }
.chance > div:last-child { background: var(--blue); }
.pool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pool { border-radius: var(--radius-sm); padding: 8px 10px; border: 1px solid var(--line); background: var(--bg-2); }
.pool.red { border-color: rgba(255, 77, 94, 0.35); background: var(--red-bg); }
.pool.blue { border-color: rgba(61, 139, 255, 0.35); background: var(--blue-bg); }
.pool .amt { font: 800 16px var(--mono); }
.pool .meta { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- bet slip */
.betslip { display: flex; flex-direction: column; gap: 12px; }
.betslip .weight { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.weight-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-top: 4px; }
.weight-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--green)); transition: width 0.4s; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { flex: 1; min-width: 46px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font: 700 12px var(--mono); cursor: pointer; }
.chips button:hover { color: var(--text); border-color: #3c475e; }
.bet-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bet-buttons .btn { flex-direction: column; gap: 2px; padding: 10px; }
.bet-buttons .btn small { font-weight: 600; opacity: 0.85; font-size: 11px; }
.betslip .note { font-size: 12px; color: var(--muted); }
.betslip .closed { padding: 10px; text-align: center; border-radius: var(--radius-sm); background: var(--bg-2); color: var(--muted); border: 1px dashed var(--line-2); }
.mybets { display: grid; gap: 6px; }
.mybet { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 6px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- brackets */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 6px; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.bracket-round h3 { text-align: center; }
.bnode { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.bnode.live { border-color: rgba(255, 77, 94, 0.6); box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.25); }
.bentry { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; }
.bentry + .bentry { border-top: 1px solid var(--line); }
.bentry .seed { font: 700 11px var(--mono); color: var(--dim); width: 16px; }
.bentry .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bentry.win .nm { color: var(--gold); font-weight: 800; }
.bentry.lose { opacity: 0.5; }
.bentry .sc { font: 800 12px var(--mono); }
.bnode-foot { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }

/* ---------------------------------------------------------------- toasts & modal */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 11px 14px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 13px; animation: toast-in 0.2s ease-out;
}
.toast.good { border-color: rgba(57, 217, 138, 0.5); }
.toast.bad { border-color: rgba(255, 77, 94, 0.55); }
.toast.gold { border-color: rgba(255, 197, 66, 0.55); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 9, 0.7); display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- match overlay */
.match-overlay {
  position: fixed; inset: 0; z-index: 50; background: #020306;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
.match-overlay.spectator { grid-template-columns: minmax(0, 1fr) 360px; background: var(--bg); }
@media (max-width: 980px) {
  .match-overlay.spectator { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; overflow-y: auto; position: fixed; }
}
.match-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.match-overlay:not(.spectator) .match-stage { align-items: center; justify-content: center; }
.viewport {
  position: relative; width: min(100%, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto;
  background: #000; overflow: hidden; user-select: none; -webkit-user-select: none;
}
.match-overlay.spectator .viewport { width: min(100%, calc((100vh - 120px) * 16 / 9)); margin-top: 12px; border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 980px) { .match-overlay.spectator .viewport { width: 100%; margin-top: 0; border-radius: 0; border: 0; } }
.viewport > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.game-canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.map-canvas { background: #07090d; }
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.hud > * { position: absolute; }
.hud-score {
  top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; border-radius: 8px; overflow: hidden;
  background: rgba(5, 7, 12, 0.72); border: 1px solid rgba(255, 255, 255, 0.08);
}
.hud-score .side { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-weight: 800; font-size: clamp(11px, 1.3vw, 14px); }
.hud-score .side.red { background: linear-gradient(90deg, rgba(255, 77, 94, 0.35), rgba(255, 77, 94, 0.1)); }
.hud-score .side.blue { background: linear-gradient(270deg, rgba(61, 139, 255, 0.35), rgba(61, 139, 255, 0.1)); }
.hud-score .pts { font-size: clamp(16px, 2.2vw, 24px); }
.hud-score .clock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 12px; min-width: 80px; }
.hud-score .clock .t { font-size: clamp(13px, 1.6vw, 18px); font-weight: 800; }
.hud-score .clock .ph { font-size: 9px; letter-spacing: 0.18em; color: var(--muted); }
.hud-score .clock .ph.ot { color: var(--gold); }
.killfeed { top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: clamp(10px, 1.1vw, 13px); }
.kf { background: rgba(5, 7, 12, 0.7); padding: 3px 9px; border-radius: 5px; display: flex; gap: 8px; align-items: center; animation: fade 0.2s; }
.kf.me { box-shadow: inset 0 0 0 1px rgba(255, 197, 66, 0.6); }
.kf .gun { color: var(--muted); font-size: 0.85em; }
.minimap { top: 12px; left: 12px; width: 18%; aspect-ratio: 32 / 20; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(4, 6, 10, 0.7); }
.crosshair { left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 2px #000; }
.crosshair::before { left: 10px; top: 2px; width: 2px; height: 18px; clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%, 0 62%, 100% 62%, 100% 100%, 0 100%); }
.crosshair::after { top: 10px; left: 2px; height: 2px; width: 18px; clip-path: polygon(0 0, 38% 0, 38% 100%, 0 100%, 0 0, 62% 0, 100% 0, 100% 100%, 62% 100%); }
.hitmarker { left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; }
.hitmarker::before, .hitmarker::after { content: ""; position: absolute; background: #fff; }
.hitmarker::before { left: 12px; top: 0; width: 2px; height: 26px; clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%, 0 65%, 100% 65%, 100% 100%, 0 100%); }
.hitmarker::after { top: 12px; left: 0; height: 2px; width: 26px; clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%); }
.hitmarker.kill::before, .hitmarker.kill::after { background: var(--red); }
.hitmarker.show { animation: hitm 0.25s ease-out; }
@keyframes hitm { from { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.25); } to { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(1); } }
.vignette { inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(220, 0, 20, 0.55) 100%); opacity: 0; transition: opacity 0.35s; }
.lowhp { inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(160, 0, 10, 0.35) 100%); opacity: 0; transition: opacity 0.6s; }
.dmg-dir { left: 50%; top: 50%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.5s; }
.dmg-dir::before { content: ""; position: absolute; left: 50%; top: 0; width: 26%; height: 8%; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: rgba(255, 50, 60, 0.85); filter: blur(1px); }
.hud-bottom { left: 0; right: 0; bottom: 12px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 16px; }
.hp-box, .ammo-box { background: rgba(5, 7, 12, 0.7); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; padding: 6px 12px; min-width: 120px; }
.hp-box .lbl, .ammo-box .lbl { font-size: 9px; letter-spacing: 0.2em; color: var(--muted); }
.hp-box .val, .ammo-box .val { font-size: clamp(20px, 3vw, 32px); font-weight: 900; line-height: 1.05; }
.hp-bar { height: 5px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.hp-bar > div { height: 100%; background: var(--green); transition: width 0.15s, background 0.2s; }
.ammo-box { text-align: right; }
.ammo-box .val small { font-size: 0.5em; color: var(--muted); }
.spec-name { left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(5, 7, 12, 0.75); padding: 5px 14px; border-radius: 8px; font-weight: 800; font-size: 13px; border: 1px solid rgba(255, 255, 255, 0.08); }
.center-msg { left: 0; right: 0; top: 30%; text-align: center; }
.center-msg .big { font-size: clamp(28px, 6vw, 64px); font-weight: 900; letter-spacing: 0.06em; }
.center-msg .sub { font-size: clamp(11px, 1.4vw, 15px); color: #d6dbe6; margin-top: 4px; }
.center-msg .pointer { pointer-events: auto; margin-top: 12px; }
.click-to-play { inset: 0; display: grid; place-items: center; background: rgba(2, 3, 6, 0.55); pointer-events: auto; cursor: pointer; }
.click-to-play .box { text-align: center; padding: 18px 26px; border-radius: 12px; background: rgba(10, 12, 18, 0.85); border: 1px solid var(--line-2); font-family: var(--sans); }
.click-to-play .box b { font-size: 18px; display: block; margin-bottom: 4px; }
.keys { display: inline-grid; grid-template-columns: auto auto; gap: 4px 14px; text-align: left; font-size: 12px; color: var(--muted); margin-top: 10px; }
.keys kbd { font: 700 11px var(--mono); color: var(--text); background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 4px; }
.scoreboard { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 92%); background: rgba(6, 8, 13, 0.92); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; font-family: var(--sans); }
.scoreboard .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.scoreboard table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scoreboard th { font-size: 10px; color: var(--muted); text-align: left; padding: 4px 6px; letter-spacing: 0.12em; }
.scoreboard td { padding: 5px 6px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.scoreboard tr.me td { background: rgba(255, 197, 66, 0.08); }
.overlay-panel { pointer-events: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 92%); max-height: 92%; overflow: auto; background: rgba(10, 12, 18, 0.96); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; font-family: var(--sans); text-shadow: none; }
.end-screen { pointer-events: auto; inset: 0; display: grid; place-items: center; background: rgba(2, 3, 6, 0.7); font-family: var(--sans); text-shadow: none; overflow: auto; padding: 16px; }
.end-card { width: min(640px, 100%); background: rgba(12, 15, 22, 0.97); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; }
.end-card .result { font: 900 clamp(26px, 5vw, 44px) var(--sans); letter-spacing: 0.04em; text-align: center; }
.end-card .final { text-align: center; font: 800 22px var(--mono); margin: 4px 0 14px; }
.hash { font: 11px var(--mono); color: var(--dim); word-break: break-all; }
.spec-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.chip.on { color: var(--text); border-color: var(--text); }
.chip.red { border-color: rgba(255, 77, 94, 0.45); }
.chip.blue { border-color: rgba(61, 139, 255, 0.45); }
.chip.dead { opacity: 0.45; }
.match-aside { border-left: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 980px) { .match-aside { border-left: 0; border-top: 1px solid var(--line); } }
.delay-note { font-size: 11px; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; }
.roster { display: grid; gap: 4px; }
.roster-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.roster-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-row .kd { font: 700 12px var(--mono); color: var(--muted); }
.top-left-btn { pointer-events: auto; position: absolute; top: 12px; left: 12px; }

/* Play page: your own match when it's running without this tab (rejoin / decline) */
.mine-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; border-color: rgba(255, 197, 66, 0.45); }
.mine-card .grow { flex: 1; min-width: 200px; }

/* Sign-in: create account / sign in tabs */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.auth-tabs button { padding: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.auth-tabs button.on { background: var(--panel-3); color: var(--text); }
input[type=password] {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  outline: none;
}

/* Wallet: your deposit address (QR code + copy) */
.deposit-qr { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.deposit-qr img { width: 132px; height: 132px; display: block; border-radius: var(--radius-sm); background: #fff; image-rendering: pixelated; }
.deposit-address {
  font: 600 13px var(--mono); word-break: break-all; line-height: 1.45;
  padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2);
}
.deposit-steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.deposit-steps b { color: var(--text); }
.incoming { display: grid; gap: 6px; }
.incoming .item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.spinner { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .charm-icon { animation: none; } }
@media (max-width: 420px) {
  .deposit-qr { grid-template-columns: 1fr; justify-items: center; }
  .deposit-qr img { width: 180px; height: 180px; }
}
