:root {
  --bg: #120816;
  --bg2: #1c0d22;
  --card: #261433;
  --line: rgba(255, 214, 140, 0.22);
  --gold: #f2c14e;
  --gold2: #ffdf8a;
  --rose: #ff5d8f;
  --mint: #3ee0b0;
  --ink: #fff6ea;
  --muted: #c9b3c6;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", "DejaVu Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 93, 143, 0.28), transparent 55%),
    radial-gradient(900px 480px at 110% 0%, rgba(242, 193, 78, 0.22), transparent 50%),
    linear-gradient(180deg, var(--bg2), var(--bg) 40%);
  color: var(--ink);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(92px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.brand {
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--gold2);
}
.who { font-size: 18px; font-weight: 700; margin-top: 2px; }
.purse {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #3a2144, #24142c);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 35%, #fff1bf, var(--gold) 45%, #b8860b);
  color: transparent;
  box-shadow: inset 0 0 0 2px rgba(120, 70, 0, 0.35);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow);
  min-height: 132px;
}
.card b { display: block; font-size: 18px; margin: 8px 0 4px; }
.card span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(242, 193, 78, 0.15);
  font-size: 18px;
}
.wide { grid-column: 1 / -1; }

.panel {
  background: rgba(18, 8, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.back {
  background: transparent;
  border: 0;
  color: var(--gold2);
  padding: 0 0 10px;
}
h1 { font-size: 26px; margin: 0 0 6px; }
.hint { color: var(--muted); margin: 0 0 14px; line-height: 1.4; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stake {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
}
.stake input {
  width: 120px;
  background: #140915;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.chip, .go, .ghost {
  border: 1px solid var(--line);
  background: #2a1733;
  border-radius: 999px;
  padding: 8px 12px;
}
.chip.on, .go {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #3a2508;
  border-color: transparent;
  font-weight: 800;
}
.go { padding: 12px 16px; }
.go:disabled, .ghost:disabled { opacity: 0.45; }
.ghost { background: transparent; }

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
}
.cell {
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #1a0d20;
  font-size: 34px;
  font-weight: 800;
}
.cell.x { color: var(--gold2); }
.cell.o { color: var(--rose); }
.cell:disabled { opacity: 1; }

.mines {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}
.mine {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1a0d20;
  font-size: 16px;
}
.mine.safe { background: rgba(62, 224, 176, 0.18); }
.mine.boom { background: rgba(255, 93, 143, 0.35); }
.mult { font-size: 28px; font-weight: 800; color: var(--mint); }

.coin-face, .dice-face {
  font-size: 72px;
  text-align: center;
  margin: 8px 0;
  min-height: 88px;
}
.spin .coin-face { animation: flip 0.6s linear infinite; }
@keyframes flip {
  50% { transform: rotateY(180deg) scale(0.8); }
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}
.window {
  height: 88px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #140915;
  box-shadow: inset 0 14px 16px rgba(0, 0, 0, 0.35), inset 0 -14px 16px rgba(0, 0, 0, 0.35);
}
.sym {
  height: 88px;
  display: grid;
  place-items: center;
  font-size: 42px;
}
.reward { margin-bottom: 12px; }
.reward b { display: block; }
.reward .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.day {
  background: #140915;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  padding: 6px 2px;
}
.day span { display: block; color: var(--muted); font-size: 11px; }
.day b { font-size: 11px; }
.day.done { background: rgba(62, 224, 176, 0.16); }
.day.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

.banner {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid var(--line);
}
.banner.bad { background: rgba(255, 93, 143, 0.14); }
.banner.good { background: rgba(62, 224, 176, 0.14); }

.lead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 214, 140, 0.12);
}
.lead:last-child { border-bottom: 0; }
.place {
  width: 36px;
  text-align: center;
  font-weight: 800;
  color: var(--gold2);
}
.lead .meta { color: var(--muted); font-size: 12px; }
.lead .name { font-weight: 700; }
.lead .score { margin-left: auto; font-weight: 800; }
.me { background: rgba(242, 193, 78, 0.08); border-radius: 14px; }

.dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(488px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(22, 10, 26, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.dock button {
  border: 0;
  background: transparent;
  border-radius: 16px;
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
}
.dock button.on {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #3a2508;
}

.empty { color: var(--muted); text-align: center; padding: 24px 8px; }
