:root {
  --bg: #0b0d10;
  --panel: #13161b;
  --panel-2: #1a1e25;
  --line: #262b34;
  --text: #e8ebf0;
  --muted: #8a93a3;
  --cyan: #28c8e6;
  --green: #22e58b;
  --red: #ff5d6c;
  --amber: #ffb547;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 "Space Grotesk", system-ui, sans-serif; min-height: 100vh; }
.mono, code { font-family: "JetBrains Mono", ui-monospace, monospace; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.cyan { color: var(--cyan); }
button { font: inherit; cursor: pointer; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: .12em; display: flex; align-items: center; gap: 10px; }
.brand small { font-weight: 400; letter-spacing: 0; color: var(--muted); font-size: 12px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.login { display: flex; gap: 8px; }
.login input, .stake input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; min-width: 0;
}
.login button, .chips button {
  background: var(--text); color: var(--bg); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600;
}
.me { display: flex; align-items: center; gap: 14px; }
.me .balance { background: var(--panel-2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.me .balance b { color: var(--green); font-family: "JetBrains Mono", monospace; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 6px 12px; }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px;
  padding: 20px 24px; max-width: 1500px; margin: 0 auto;
}
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; padding: 16px; } .top { padding: 12px 16px; } }

.video { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; border: 1px solid var(--line); }
.video video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.badge {
  position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px); padding: 5px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
}
.badge span { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
.badge.down span { background: var(--muted); animation: none; }
.badge b { font-weight: 700; }
.badge em { font-style: normal; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.badge.demo span { background: var(--amber); }
@keyframes pulse { 50% { opacity: .3; } }
.hud {
  position: absolute; top: 14px; right: 14px; text-align: right;
  background: rgba(0,0,0,.62); backdrop-filter: blur(6px); padding: 10px 16px; border-radius: 12px; min-width: 170px;
}
.hud-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hud-count { font-family: "JetBrains Mono", monospace; font-size: 44px; font-weight: 700; line-height: 1.05; }
.hud-count small { font-size: 15px; color: var(--muted); margin-left: 6px; }
.hud-count.bump { animation: bump .35s; }
@keyframes bump { 30% { color: var(--green); transform: scale(1.08); } }
.hud-timer { font-family: "JetBrains Mono", monospace; color: var(--cyan); }
.offline { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.7); color: var(--muted); }

.meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.explain { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.explain code { color: var(--text); }

.side { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tag.open { color: var(--green); }
.tag.counting { color: var(--amber); }
.card h2 { margin: 4px 0 6px; font-size: 19px; }
.sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.sub b { color: var(--text); }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  transition: transform .08s, border-color .15s;
}
.side-btn em { font-style: normal; font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 700; }
.side-btn.over em { color: var(--green); }
.side-btn.under em { color: var(--red); }
.side-btn.over:hover { border-color: var(--green); }
.side-btn.under:hover { border-color: var(--red); }
.side-btn:active { transform: scale(.98); }
.side-btn:disabled { opacity: .45; cursor: not-allowed; }

.stake { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; margin-top: 14px; }
.stake label { color: var(--muted); font-size: 13px; }
.stake .chips { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 6px; }
.pool { margin-top: 10px; font-size: 12px; color: var(--muted); }
.msg { min-height: 20px; margin-top: 8px; font-size: 13px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.progress-row { display: flex; justify-content: space-between; align-items: baseline; }
.big { font-size: 34px; }
.bar { position: relative; height: 8px; background: var(--panel-2); border-radius: 999px; margin: 10px 0 8px; overflow: visible; }
.bar div { height: 100%; width: 0; background: var(--amber); border-radius: 999px; transition: width .3s; }
.bar div.over { background: var(--green); }
.bar i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 7px 10px; background: var(--panel-2); border-radius: 8px; }
.list a { color: inherit; text-decoration: none; }
.win { color: var(--green); }
.lose { color: var(--red); }
.pend { color: var(--amber); }
