/* 0210 - black/purple pixel theme */

@font-face {
  font-family: "Press Start 2P";
  src: url("../vendor/press-start-2p.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #07030d;
  --bg2: #0d0716;
  --panel: #0e0817;
  --panel2: #140b22;
  --line: #2b1a4a;
  --purple: #8b5cf6;
  --purple-deep: #4c1d95;
  --purple-hot: #c084fc;
  --text: #f2ecff;
  --dim: #8a7fa8;
  --win: #4ade80;
  --err: #f87171;
  --px: "Press Start 2P", monospace;
  --mono: Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background:
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px);
}

a { color: var(--purple-hot); text-decoration: none; }
a:hover { text-decoration: underline; }
.dim { color: var(--dim); }
code { color: var(--purple-hot); }

/* ---------------- header ---------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(7, 3, 13, 0.97);
  z-index: 50;
}

.brand {
  font-family: var(--px);
  font-size: 20px;
  color: var(--purple-hot);
  text-shadow: 3px 3px 0 var(--purple-deep);
  letter-spacing: 2px;
}

.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.header-right { display: flex; gap: 12px; align-items: center; }

.net-badge {
  font-family: var(--px);
  font-size: 8px;
  color: var(--dim);
  border: 2px solid var(--line);
  padding: 6px 8px;
  background: var(--panel);
}

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--px);
  font-size: 10px;
  color: var(--text);
  background: var(--panel2);
  border: 2px solid var(--purple);
  box-shadow: 3px 3px 0 var(--purple-deep);
  padding: 10px 14px;
  cursor: pointer;
  display: inline-block;
  transition: none;
  user-select: none;
}
.btn:hover { background: var(--purple); color: #0a0512; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--purple-deep); }
.btn.primary { background: var(--purple); color: #0a0512; }
.btn.primary:hover { background: var(--purple-hot); border-color: var(--purple-hot); }
.btn.big { font-size: 12px; padding: 14px 20px; }
.btn.wide { width: 100%; text-align: center; }
.btn.small { font-size: 8px; padding: 7px 9px; box-shadow: 2px 2px 0 var(--purple-deep); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 3px 3px 0 var(--purple-deep);
}
.btn:disabled:hover { background: var(--panel2); color: var(--text); }
.btn.connected { border-color: var(--win); box-shadow: 3px 3px 0 #14532d; }

/* ---------------- demo banner ---------------- */
.demo-banner {
  font-family: var(--px);
  font-size: 9px;
  line-height: 1.9;
  text-align: center;
  padding: 10px 16px;
  background: var(--purple-deep);
  color: var(--text);
  border-bottom: 2px solid var(--purple);
}

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  height: 520px;
  border-bottom: 2px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, #150b26 0%, var(--bg) 70%);
  overflow: hidden;
}

#voxel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  image-rendering: pixelated;
}
#voxel-canvas:active { cursor: grabbing; }

.hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  text-align: center;
  pointer-events: none;
}
.hero-overlay .btn, .hero-overlay a { pointer-events: auto; }

.tagline {
  font-family: var(--px);
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 18px;
  text-shadow: 2px 2px 0 #000;
}

.hero-cta { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }

.fair-pill {
  font-size: 12px;
  color: var(--dim);
}
.fair-pill::before { content: "[\2713] "; color: var(--win); }

/* ---------------- ticker ---------------- */
.ticker {
  overflow: hidden;
  border-bottom: 2px solid var(--line);
  background: var(--bg2);
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  animation: ticker 30s linear infinite;
  font-family: var(--px);
  font-size: 9px;
  color: var(--purple);
  padding: 9px 0;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------------- game layout ---------------- */
.game-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  max-width: 1100px;
  margin: 26px auto 40px;
  padding: 0 18px;
}
.game-left, .game-right { display: flex; flex-direction: column; gap: 18px; }

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 16px;
}

.panel-title {
  font-family: var(--px);
  font-size: 10px;
  color: var(--purple-hot);
  margin-bottom: 14px;
  letter-spacing: 1px;
}

/* round bar */
.round-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--panel2);
}
.round-cell { display: flex; flex-direction: column; gap: 6px; }
.round-cell.center { align-items: center; }
.round-cell.right { align-items: flex-end; }

.label {
  font-family: var(--px);
  font-size: 8px;
  color: var(--dim);
}
.value { font-family: var(--px); font-size: 14px; }
.value.pot { color: var(--purple-hot); }

.badge {
  font-family: var(--px);
  font-size: 8px;
  padding: 5px 8px;
  border: 2px solid;
}
.badge.live { color: var(--win); border-color: var(--win); animation: pulse 1.6s infinite; }
.badge.revealing { color: var(--purple-hot); border-color: var(--purple-hot); animation: pulse 0.7s infinite; }
.badge.settled { color: var(--text); border-color: var(--purple); background: var(--purple-deep); }
.badge.waiting { color: var(--dim); border-color: var(--line); }
.badge.err { color: var(--err); border-color: var(--err); }
@keyframes pulse { 50% { opacity: 0.45; } }

.countdown {
  font-family: var(--px);
  font-size: 44px;
  color: var(--text);
  text-shadow: 4px 4px 0 var(--purple-deep);
  line-height: 1;
}
.countdown.urgent { color: var(--err); animation: pulse 0.5s infinite; }
.countdown.revealing { color: var(--purple-hot); }
.countdown.result { color: var(--win); }

/* number tiles */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.tile {
  font-family: var(--mono);
  background: var(--panel2);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 #000;
  color: var(--text);
  padding: 10px 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 96px;
}
.tile:hover { border-color: var(--purple); }
.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.tile.selected {
  border-color: var(--purple-hot);
  background: var(--purple-deep);
  box-shadow: 3px 3px 0 var(--purple);
}
.tile.win {
  border-color: var(--win);
  background: #0d2818;
  animation: winflash 0.5s steps(2) 6;
}
.tile.rolled { outline: 2px dashed var(--win); outline-offset: 2px; }
@keyframes winflash { 50% { background: var(--win); color: #04120a; } }

.tile-num {
  font-family: var(--px);
  font-size: 18px;
  color: inherit;
}
.tile-mult { font-size: 11px; color: var(--purple-hot); }
.tile-stake { font-size: 12px; color: var(--dim); }
.tile-stake::after { content: " E"; color: var(--line); }
.tile-mine { font-size: 10px; color: var(--win); min-height: 13px; }

.tiles-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11px;
  color: var(--dim);
}
.sw { display: inline-block; width: 9px; height: 9px; margin-right: 5px; }
.sw.stake { background: var(--dim); }
.sw.mult { background: var(--purple-hot); }
.sw.mine { background: var(--win); }

/* history */
.history-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.roll-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--line);
  background: var(--panel2);
  padding: 6px 9px;
  min-width: 44px;
}
.roll-chip .roll-num { font-family: var(--px); font-size: 14px; color: var(--purple-hot); }
.roll-chip .roll-pot { font-size: 10px; color: var(--dim); }

/* bet panel */
.bet-panel { background: var(--panel2); border-color: var(--purple-deep); }

.bet-target {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bet-selected {
  font-family: var(--px);
  font-size: 30px;
  color: var(--purple-hot);
  text-shadow: 3px 3px 0 var(--purple-deep);
}

.bet-amount-row {
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  background: var(--bg);
  margin-bottom: 10px;
}
#bet-amount {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--px);
  font-size: 14px;
  padding: 12px;
  width: 100%;
}
#bet-amount::-webkit-outer-spin-button,
#bet-amount::-webkit-inner-spin-button { -webkit-appearance: none; }
#bet-amount[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.unit { font-family: var(--px); font-size: 10px; color: var(--dim); padding-right: 12px; }

.presets { display: flex; gap: 8px; margin-bottom: 14px; }
.preset {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 0;
  background: var(--panel);
  color: var(--dim);
  border: 2px solid var(--line);
  cursor: pointer;
}
.preset:hover { border-color: var(--purple); color: var(--text); }
.preset.active { border-color: var(--purple-hot); color: var(--purple-hot); background: var(--bg); }

.bet-note { font-size: 11px; color: var(--dim); margin-top: 10px; text-align: center; }

/* my bets + claims */
.mybet-row, .claim-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.mybet-row:last-child, .claim-row:last-child { border-bottom: none; }
.claim-row span { font-size: 12px; }

.rules-mini pre {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.9;
  white-space: pre-wrap;
}

/* ---------------- how ---------------- */
.how { max-width: 1100px; margin: 0 auto 50px; padding: 0 18px; }

.section-title {
  font-family: var(--px);
  font-size: 18px;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--purple-deep);
  margin-bottom: 22px;
}

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.how-card h3 {
  font-family: var(--px);
  font-size: 13px;
  color: var(--purple-hot);
  margin-bottom: 10px;
}
.how-card p { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.how-step {
  font-family: var(--px);
  font-size: 9px;
  color: var(--bg);
  background: var(--purple);
  display: inline-block;
  padding: 4px 7px;
  margin-bottom: 12px;
}
.formula {
  font-family: var(--mono);
  color: var(--win) !important;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px !important;
  overflow-x: auto;
}

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 2px solid var(--line);
  padding: 22px 18px 30px;
  text-align: center;
  font-size: 12px;
}
.footer-row { margin-bottom: 10px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.footer-row a { font-family: var(--px); font-size: 9px; }

/* ---------------- toasts ---------------- */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  max-width: 340px;
}
.toast {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--panel2);
  border: 2px solid var(--purple);
  box-shadow: 4px 4px 0 #000;
  padding: 12px 14px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.win { border-color: var(--win); color: var(--win); }
.toast.error { border-color: var(--err); color: var(--err); }
.toast a { margin-left: 6px; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .game-wrap { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .hero { height: 400px; }
  .countdown { font-size: 34px; }
  .hero-cta { flex-direction: column; align-items: center; gap: 10px; }
  .tagline { font-size: 9px; padding: 0 10px; margin-bottom: 12px; }
  .hero-overlay { bottom: 16px; }
  .btn.big { font-size: 10px; padding: 12px 18px; }
}

@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .btn { font-size: 9px; padding: 9px 11px; }
  .net-badge { display: none; }
  .site-header { padding: 12px 14px; }
  .game-wrap { padding: 0 12px; margin-top: 18px; }
  .panel { padding: 13px; }
  .fair-pill { font-size: 10px; padding: 0 12px; }
  .value { font-size: 12px; }
  .toast-stack { left: 12px; right: 12px; max-width: none; }
}
