/* Counter Stocks — shared design system (Panorama-inspired) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b1119;
  --panel: rgba(24, 33, 46, 0.62);
  --panel-solid: #16202e;
  --hairline: rgba(255, 255, 255, 0.08);
  --text: #dce7f2;
  --dim: #8296ab;
  --gold: #f26a1b;
  --gold-bright: #ff8a3c;
  --up: #17c784;
  --down: #ef4b5d;
  --display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--body); min-height: 100vh; overflow-x: hidden; }

.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 500px at 78% 12%, rgba(90, 140, 190, 0.18), transparent 60%),
    radial-gradient(900px 600px at 15% 85%, rgba(242, 106, 27, 0.06), transparent 60%),
    linear-gradient(160deg, #101c2c 0%, #0b1119 55%, #080d13 100%);
}
.backdrop::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
.backdrop::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(4, 7, 11, 0.5) 100%);
}

/* ---------- left rail ---------- */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: 74px; z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 18px; gap: 6px;
  background: rgba(10, 15, 22, 0.82); backdrop-filter: blur(14px);
  border-right: 1px solid var(--hairline);
}
.rail .mark {
  font-family: var(--display); font-weight: 700; font-size: 17px; color: #fff;
  line-height: 1; padding: 10px 0 16px; text-align: center; user-select: none;
}
.rail .mark b { color: var(--gold); }
.rail a.ric {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 10px; color: var(--dim);
  transition: background 0.15s, color 0.15s; position: relative;
}
.rail a.ric:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.rail a.ric.active { color: var(--gold-bright); background: rgba(242, 106, 27, 0.1); }
.rail a.ric.active::before {
  content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px;
  background: var(--gold); transform: skewY(-14deg);
}
.rail a.ric.play {
  background: var(--gold); color: #14100a; margin-bottom: 8px;
  box-shadow: 0 4px 18px rgba(242, 106, 27, 0.35);
}
.rail a.ric.play:hover { background: var(--gold-bright); color: #14100a; }
.rail .spacer { flex: 1; }
.rail svg { width: 21px; height: 21px; }

/* ---------- shell + topbar ---------- */
.shell { margin-left: 74px; padding: clamp(16px, 3vw, 36px); max-width: 1180px; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: clamp(16px, 2.5vw, 26px); }
.wordmark img { height: clamp(34px, 4.2vw, 48px); display: block; }
.rail .mark-img { width: 46px; height: 46px; object-fit: contain; margin: 4px 0 12px; }
.modal-logo { display: block; max-width: 72%; margin: 0 auto 10px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.6vw, 26px); letter-spacing: 2.5px; color: #fff; text-decoration: none; }
.wordmark b { color: var(--gold); }
.season {
  font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 1.5px;
  color: var(--gold); border: 1px solid rgba(242, 106, 27, 0.45); border-radius: 3px;
  padding: 3px 9px; transform: skewX(-8deg);
}
.topbar .grow { flex: 1; }
.crumbs { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 2px; color: var(--dim); }
.crumbs b { color: var(--text); }

.wallet-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--hairline); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--dim);
}
.wallet-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #5a6a7c; }
.wallet-chip .dot.on { background: var(--up); box-shadow: 0 0 8px rgba(23, 199, 132, 0.6); }
.wallet-chip button {
  font: 600 12.5px var(--body); background: transparent;
  border: 1px solid rgba(242, 106, 27, 0.55); color: var(--gold-bright);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; transition: background 0.15s;
}
.wallet-chip button:hover { background: rgba(242, 106, 27, 0.12); }
.wallet-chip .addr { font-family: ui-monospace, Consolas, monospace; color: var(--text); font-size: 12.5px; }

/* ---------- ticker ---------- */
.ticker-wrap {
  overflow: hidden; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: rgba(10, 15, 22, 0.55); backdrop-filter: blur(10px);
  margin-bottom: clamp(18px, 2.5vw, 28px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker {
  display: flex; gap: 34px; width: max-content; padding: 8px 0;
  animation: tick 40s linear infinite;
  font-family: var(--display); font-weight: 600; font-size: 13.5px; letter-spacing: 1px;
}
.ticker span { color: var(--dim); white-space: nowrap; }
.ticker b { color: var(--text); font-weight: 600; }
.ticker .u { color: var(--up); }
.ticker .d { color: var(--down); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); backdrop-filter: blur(16px);
  border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 2.2px; color: #fff;
}
.panel-head .tag { margin-left: auto; font-size: 11px; letter-spacing: 1.2px; color: var(--dim); font-weight: 600; }
.panel-head .tag.gold { color: var(--gold); }
.panel-head .tag.green { color: var(--up); }

.grid { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); margin-bottom: clamp(16px, 2.2vw, 24px); }
.grid .wide { grid-column: 1 / -1; }

/* ---------- hero ---------- */
.hero {
  position: relative; padding: clamp(26px, 4.5vw, 52px) clamp(20px, 4vw, 46px);
  margin-bottom: clamp(16px, 2.2vw, 24px);
  background:
    linear-gradient(105deg, rgba(13, 20, 30, 0.92) 34%, rgba(13, 20, 30, 0.55) 70%, rgba(13, 20, 30, 0.25)),
    radial-gradient(700px 300px at 85% 30%, rgba(120, 165, 210, 0.22), transparent 65%),
    var(--panel);
}
.hero h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 52px);
  line-height: 1.02; letter-spacing: 1px; color: #fff; text-transform: uppercase; max-width: 14ch;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.sub { margin: 14px 0 24px; max-width: 52ch; color: var(--dim); font-size: clamp(13.5px, 1.4vw, 15px); line-height: 1.65; }
.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn-play {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 16px var(--display); letter-spacing: 2.5px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #14100a; border: none; border-radius: 4px; padding: 14px 34px;
  cursor: pointer; text-decoration: none; transform: skewX(-6deg);
  box-shadow: 0 6px 26px rgba(242, 106, 27, 0.35); transition: transform 0.12s, box-shadow 0.12s;
}
.btn-play > * { transform: skewX(6deg); }
.btn-play:hover { transform: skewX(-6deg) translateY(-1px); box-shadow: 0 10px 32px rgba(242, 106, 27, 0.5); }
.btn-ghost {
  font: 600 13px var(--body); color: var(--text); text-decoration: none;
  border: 1px solid var(--hairline); border-radius: 4px; padding: 12px 20px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.05); }
.hero .meta {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px;
  font-family: var(--display); font-weight: 600; font-size: 12.5px; letter-spacing: 1.6px; color: var(--dim);
}
.hero .meta b { color: var(--text); }

/* ---------- server browser ---------- */
.srv-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); transition: background 0.15s; }
.srv-row:last-child { border-bottom: none; }
.srv-row:hover { background: rgba(255, 255, 255, 0.04); }
.srv-dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6a7c; flex-shrink: 0; }
.srv-dot.on { background: var(--up); box-shadow: 0 0 10px rgba(23, 199, 132, 0.7); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.srv-name { font: 600 14.5px var(--body); color: #fff; }
.srv-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.srv-map {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  color: var(--gold-bright); background: rgba(242, 106, 27, 0.08);
  border: 1px solid rgba(242, 106, 27, 0.25); border-radius: 4px; padding: 3px 8px;
}
.srv-count { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--text); letter-spacing: 1px; }
.srv-join {
  margin-left: auto; font: 700 12.5px var(--display); letter-spacing: 2px;
  background: transparent; border: 1px solid rgba(242, 106, 27, 0.6);
  color: var(--gold-bright); border-radius: 4px; padding: 8px 18px;
  cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.srv-join:hover { background: var(--gold); color: #14100a; }
.empty { padding: 26px 18px; color: var(--dim); font-size: 13px; text-align: center; }

/* ---------- tables ---------- */
table.lb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.lb th {
  font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: 1.8px;
  color: var(--dim); text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--hairline);
}
table.lb td { padding: 11px 18px; border-bottom: 1px solid var(--hairline); }
table.lb tr:last-child td { border-bottom: none; }
table.lb tbody tr:hover td { background: rgba(255, 255, 255, 0.035); }
td.rank { font-family: var(--display); font-weight: 700; color: var(--dim); width: 44px; }
tbody tr:nth-child(1) td.rank { color: var(--gold-bright); }
tbody tr:nth-child(2) td.rank { color: #c8d4de; }
tbody tr:nth-child(3) td.rank { color: #b0793f; }
td.nick { font-weight: 600; color: #fff; }
td.nick .w { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--dim); display: block; margin-top: 1px; }
td.num { font-family: ui-monospace, Consolas, monospace; color: var(--text); }
td.num.up { color: var(--up); }

/* ---------- basket / treasury ---------- */
.basket { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stock {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(9, 14, 20, 0.65); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 18px 10px 14px; min-height: 108px;
  transition: border-color 0.15s, transform 0.15s;
}
.stock:hover { border-color: rgba(242, 106, 27, 0.5); transform: translateY(-2px); }
.stock img { height: 30px; max-width: 90px; object-fit: contain; filter: invert(1) grayscale(1) brightness(1.4); }
.stock img.wide { height: 16px; }
.stock .sym { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 2px; color: var(--gold-bright); }
.stock .odds { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--dim); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--dim); }
.kv .v { font-family: ui-monospace, Consolas, monospace; color: var(--text); }
.kv .v.gold { color: var(--gold-bright); }

.payout-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.payout-line { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--dim); line-height: 1.6; }
.payout-line .n {
  font-family: var(--display); font-weight: 700; color: var(--gold);
  border: 1px solid rgba(242, 106, 27, 0.4); border-radius: 3px;
  min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; transform: skewX(-8deg);
}
.payout-line b { color: var(--text); }
.soon {
  align-self: flex-start; font: 600 11px var(--display); letter-spacing: 2px;
  color: #0b1119; background: var(--up); border-radius: 3px; padding: 4px 10px; transform: skewX(-8deg);
}

/* ---------- matches ---------- */
.match-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.match-row:last-child { border-bottom: none; }
.match-row .map { font-family: ui-monospace, Consolas, monospace; color: var(--gold-bright); }
.match-row .score { font-family: var(--display); font-weight: 700; letter-spacing: 1px; color: #fff; }
.match-row .who { color: var(--dim); margin-left: auto; text-align: right; }
.match-row .who b { color: var(--text); }

/* ---------- account card ---------- */
.acct-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.acct-body label { font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: 0.4px; }
.acct-row { display: flex; gap: 10px; }
.acct-row input {
  flex: 1; min-width: 0; background: rgba(9, 14, 20, 0.8); color: #fff;
  border: 1px solid var(--hairline); border-radius: 6px;
  padding: 11px 13px; font: 500 14px var(--body); outline: none; transition: border-color 0.15s;
}
.acct-row input:focus { border-color: var(--gold); }
.acct-row button {
  font: 700 12.5px var(--display); letter-spacing: 1.5px;
  background: var(--gold); color: #14100a; border: none; border-radius: 6px;
  padding: 0 18px; cursor: pointer; transition: background 0.15s;
}
.acct-row button:hover { background: var(--gold-bright); }
.hint { font-size: 12px; color: var(--dim); line-height: 1.55; }
.hint.ok { color: var(--up); }
.hint.err { color: var(--down); }

/* ---------- join modal ---------- */
.modal-veil {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(4, 7, 11, 0.72); backdrop-filter: blur(6px);
}
.modal-veil.open { display: flex; }
.modal {
  width: min(92vw, 420px); background: var(--panel-solid);
  border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6); padding: 24px;
}
.modal h3 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 2.5px; color: #fff; text-align: center; }
.modal h3::after { content: ''; display: block; width: 44px; height: 3px; margin: 8px auto 0; background: var(--gold); transform: skewX(-18deg); }
.modal .sub { text-align: center; color: var(--dim); font-size: 12.5px; margin: 10px 0 18px; line-height: 1.55; }
.modal label { display: block; font-size: 12px; color: var(--dim); font-weight: 600; margin: 12px 0 6px; }
.modal input {
  width: 100%; background: rgba(9, 14, 20, 0.8); color: #fff;
  border: 1px solid var(--hairline); border-radius: 6px;
  padding: 11px 13px; font: 500 14px var(--body); outline: none;
}
.modal input:focus { border-color: var(--gold); }
.modal input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.modal .row { display: flex; gap: 10px; margin-top: 18px; }
.modal .join-btn {
  flex: 1; font: 700 14px var(--display); letter-spacing: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #14100a; border: none; border-radius: 6px; padding: 12px; cursor: pointer;
}
.modal .guest-btn { font: 600 12px var(--body); background: none; color: var(--dim); border: 1px solid var(--hairline); border-radius: 6px; padding: 12px 14px; cursor: pointer; }
.modal .guest-btn:hover { color: var(--text); }
.modal .conn-btn {
  font: 600 12px var(--body); background: none; color: var(--gold-bright);
  border: 1px solid rgba(242, 106, 27, 0.5); border-radius: 6px;
  padding: 0 12px; cursor: pointer; white-space: nowrap;
}
.modal .err { color: var(--down); font-size: 12px; margin-top: 10px; display: none; }
.modal .addr-row { display: flex; gap: 8px; }

footer {
  margin-top: clamp(18px, 3vw, 30px); padding: 18px 4px 8px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  color: #5a6a7c; font-size: 11.5px; line-height: 1.6;
  border-top: 1px solid var(--hairline);
}

footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--gold-bright); }

@media (max-width: 860px) {
  .rail { display: none; }
  .shell { margin-left: 0; }
}
