@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --void:        #07070c;
  --panel:       #12121c;
  --panel-2:     #191926;
  --line:        #262638;
  --primary:     #7c5cff;
  --secondary:   #00e5ff;
  --win:         #39ff88;
  --loss:        #ff3b6b;
  --text:        #e8e6f5;
  --text-muted:  #837f9c;
  --radius:      14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #10101c 0%, var(--void) 55%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: inherit; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- Header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 12px var(--secondary);
}

.wallet-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-buttons {
  display: flex;
  gap: 8px;
}
.wallet-buttons button {
  padding: 8px 14px;
  font-size: 13px;
}

.balance-chip {
  font-family: 'JetBrains Mono', monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--secondary);
}

button {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
button:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5a3df2);
  color: white;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 0 28px rgba(124, 92, 255, 0.55); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--primary); }

.btn-block { width: 100%; }

/* ---------- Hero ---------- */

.hero {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel) 0%, var(--void) 100%);
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,92,255,0.35), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 34px;
  margin: 0 0 8px;
  line-height: 1.15;
}
.hero p { color: var(--text-muted); max-width: 480px; margin: 0; }

/* ---------- Fairness Ledger (Signatur-Element) ---------- */
/* Ein live mitlaufendes Band aufgedeckter Seed-Hashes vergangener Runden -
   macht "provably fair" sichtbar statt nur behauptet. */

.ledger {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  overflow: hidden;
  white-space: nowrap;
}
.ledger-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ledger-track {
  display: flex;
  gap: 22px;
  font-size: 12px;
  color: var(--secondary);
  opacity: 0.85;
}
.ledger-track span { flex-shrink: 0; }
.ledger-track .win { color: var(--win); }
.ledger-track .loss { color: var(--loss); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 18px;
}
.tab.active {
  color: var(--void);
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
}

/* ---------- Panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.panel + .panel { margin-top: 20px; }

.panel h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  margin: 0 0 18px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input, .field select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--secondary);
}

.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.qr-box {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.qr-box #qrcode { background: white; padding: 10px; border-radius: 10px; }

.address-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
}

.status-pill {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-muted);
  margin-top: 10px;
}
.status-pill.ok { color: var(--win); }

/* ---------- Dice ---------- */

.dice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
@media (max-width: 720px) {
  .dice-layout { grid-template-columns: 1fr; }
}

.roll-display {
  text-align: center;
  padding: 30px 10px;
  background: var(--panel-2);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.roll-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 52px;
  font-weight: 700;
}
.roll-number.win { color: var(--win); text-shadow: 0 0 24px rgba(57,255,136,0.5); }
.roll-number.loss { color: var(--loss); text-shadow: 0 0 24px rgba(255,59,107,0.5); }

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--secondary);
}

.direction-toggle { display: flex; gap: 8px; }
.direction-toggle button { flex: 1; background: var(--panel-2); color: var(--text-muted); border: 1px solid var(--line); }
.direction-toggle button.active { background: var(--primary); color: white; border-color: var(--primary); }

.result-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.verify-block {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.6;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

/* ---------- Blackjack: echte Spielkarten ---------- */

.card-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 108px;
  align-items: center;
  padding: 10px 0;
}

.playing-card {
  width: 72px;
  height: 100px;
  border-radius: 8px;
  background: #f4f2ea;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transform: translateY(14px) scale(0.9) rotate(-4deg);
  opacity: 0;
  animation: dealCard 0.35s ease forwards;
  flex-shrink: 0;
}
.playing-card.red { color: #d8324a; }
.playing-card .rank-top { font-size: 16px; line-height: 1; }
.playing-card .suit-center { font-size: 30px; text-align: center; }
.playing-card .rank-bottom { font-size: 16px; line-height: 1; align-self: flex-end; transform: rotate(180deg); }
.playing-card.card-back {
  background: repeating-linear-gradient(135deg, var(--primary), var(--primary) 6px, #5a3df2 6px, #5a3df2 12px);
}

@keyframes dealCard {
  to { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

/* ---------- Roulette: drehendes Rad ---------- */

.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0 18px;
}
.wheel-pointer {
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid var(--secondary);
  filter: drop-shadow(0 0 6px rgba(0,229,255,0.6));
}
.wheel-outer {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid var(--line);
  box-shadow: 0 0 40px rgba(124,92,255,0.25), inset 0 0 20px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}
.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 3.2s cubic-bezier(0.17, 0.67, 0.16, 0.99);
}
.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  width: 34px; height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--line);
}

/* ---------- Plinko: Board mit Stäben und Ball ---------- */

.plinko-board {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 0.85;
}
.plinko-peg {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
  transform: translate(-50%, -50%);
}
.plinko-ball {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
  transform: translate(-50%, -50%);
  transition: top 0.28s ease-in, left 0.28s ease;
}
.plinko-buckets {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}
.plinko-bucket {
  flex: 1;
  text-align: center;
  font-size: 10px;
  padding: 4px 0;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text-muted);
}
.plinko-bucket.landed {
  background: var(--secondary);
  color: var(--void);
  font-weight: 700;
}
