:root {
  --bg: #0a0a0f;
  --card: #12121c;
  --line: #26263a;
  --text: #e8e8f2;
  --dim: #8b8ba7;
  --accent: #ff3b5c;
  --green: #2fe08b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 50% -10%, #1a1030 0%, var(--bg) 55%);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.tagline { color: var(--dim); font-size: 13px; flex: 1; }
.tagline b { color: var(--text); }

main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 16px;
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.stage { text-align: center; }

.round {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 8px;
}
.chip.waiting { background: #33334d; color: var(--dim); }
.chip.live { background: rgba(47, 224, 139, 0.15); color: var(--green); }
.chip.intermission { background: rgba(255, 59, 92, 0.15); color: var(--accent); }

.pot-label { color: var(--dim); font-size: 11px; letter-spacing: 3px; }
.crown {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 800;
  color: var(--green);
  text-shadow: 0 0 30px rgba(47, 224, 139, 0.35);
  margin: 2px 0 6px;
}
.crown.empty { color: var(--dim); text-shadow: none; font-weight: 400; }
.crown .avatar { width: 34px; height: 34px; vertical-align: middle; margin-right: 8px; }

.timer {
  font-size: clamp(64px, 16vw, 120px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.05;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.timer.warn { color: #ffb020; }
.timer.crit { color: var(--accent); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

.last { color: var(--dim); font-size: 13px; min-height: 20px; }
.last span { color: var(--text); font-weight: 700; }

.controls {
  display: grid;
  grid-template-columns: minmax(190px, 280px) 1fr;
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 480px) { .controls { grid-template-columns: 1fr; } }

input {
  background: #0d0d16;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 0 rgba(255, 59, 92, 0);
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(255, 59, 92, 0.45); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font-weight: 400;
  font-size: 13px;
  box-shadow: none;
}
button.ghost:hover { color: var(--text); border-color: var(--dim); }

.seize-btn {
  width: 100%;
  margin-top: 10px;
  background: #7c5cff;
  font-size: 14px;
  letter-spacing: 1px;
}
.seize-btn:hover:not(:disabled) { box-shadow: 0 6px 30px rgba(124, 92, 255, 0.5); }

.mystats { color: var(--dim); font-size: 12px; margin-top: 12px; min-height: 16px; }
.fineprint { color: #55556e; font-size: 11px; margin-top: 14px; }

.side { padding: 0; overflow: hidden; align-self: start; }
.side-head { padding: 18px 18px 8px; }
.side-head h2 { font-size: 13px; }
.side nav { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  padding: 14px 6px;
  border-radius: 0;
  box-shadow: none;
}
.tab.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tabpane { padding: 12px 16px; max-height: 420px; overflow-y: auto; min-height: 120px; }
.hidden { display: none !important; }

ul, ol { list-style: none; }
#feed li, #winners li, #spenders li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  font-size: 13px;
  border-bottom: 1px dashed #1d1d2c;
}
li.feed-empty { justify-content: center; color: #55556e; font-size: 12px; border-bottom: none; padding: 18px 4px; }
#winners li, #spenders li { counter-increment: rank; }
#winners li::before, #spenders li::before { content: counter(rank) "."; color: var(--dim); width: 24px; }
.pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plink {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #33334d;
  text-underline-offset: 3px;
}
.plink:hover { color: var(--accent); text-decoration-color: var(--accent); }
.avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -3px;
  margin-right: 6px;
  background: #26263a;
}
.winname .avatar { width: 48px; height: 48px; vertical-align: -14px; margin-right: 10px; }
.pamt { color: var(--green); white-space: nowrap; }
.pamt.red { color: var(--accent); }
.ptag { color: var(--dim); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.winbox { text-align: center; animation: zoomin 0.35s ease; }
@keyframes zoomin { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.winlabel { letter-spacing: 6px; color: var(--accent); font-size: 14px; }
.winname { font-size: clamp(36px, 9vw, 72px); font-weight: 900; margin: 8px 0; }
.winamt { font-size: 28px; color: var(--green); font-weight: 700; }

.modalbox { width: min(360px, 90vw); }
.modalbox h3 { margin-bottom: 10px; }
.checkout-line { color: var(--dim); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c2b;
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 60;
}

.confetti {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  z-index: 55;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}

footer {
  text-align: center;
  color: #55556e;
  font-size: 11px;
  padding: 20px;
}
footer a { color: #55556e; }

.rules { max-width: 760px; margin: 24px auto; }
.rules h2 { font-size: 15px; margin: 22px 0 8px; color: var(--text); }
.rules h2:first-child { margin-top: 0; }
.rules p { font-size: 13px; line-height: 1.7; color: #c3c3d5; }

.crowned { max-width: 980px; margin: 0 auto 16px; }
.rank {
  flex-shrink: 0;
  min-width: 26px;
  font-size: 11px;
  font-weight: 800;
  color: var(--dim);
}
.tile.top .rank { color: var(--green); }
.wall {
  max-width: 980px;
  margin: 0 auto 40px;
}
.wall-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.wall-head h2 {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
}
.wall-sub { font-size: 11px; color: #55556e; }
.wallgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #0d0d16;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  min-width: 0;
}
.tile:hover { border-color: var(--dim); transform: translateY(-1px); }
.tile .avatar { margin-right: 0; flex-shrink: 0; }
.tile-body { min-width: 0; }
.tname {
  display: block;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tspent { display: block; font-size: 10px; color: var(--dim); }
.tile.big { border-color: #4a4a70; }
.tile.top { border-color: var(--green); box-shadow: 0 0 20px rgba(47, 224, 139, 0.15); }
.topchip {
  position: absolute;
  top: -7px;
  right: 8px;
  background: var(--green);
  color: #052012;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: 1px;
}
