:root {
  --bg: #0d1511;
  --surface: #14201a;
  --cell: #f6efdf;
  --line: #26382e;
  --text: #ecf1ea;
  --muted: #8ea095;
  --gold: #e9b949;
  --win: #35c07f;
  --loss: #e5534b;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}

.notice {
  padding: 8px 16px;
  background: #18261f;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.game { max-width: 480px; margin: 0 auto; padding: 16px; }

.top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
h1 { margin: 0; font: 600 20px Georgia, "Times New Roman", serif; letter-spacing: 0.04em; color: var(--gold); }
.rtp { color: var(--muted); font-size: 13px; }
.rtp b { color: var(--text); font: 600 13px var(--mono); margin-left: 4px; }

.cabinet {
  padding: 12px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: var(--surface);
}

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

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cell);
  overflow: hidden;
  transition: box-shadow 0.2s, opacity 0.2s;
}
.cell svg { width: 72%; height: 72%; }
.cell.spinning svg { animation: roll 0.12s linear infinite; filter: blur(1.5px); }
.cell.landed svg { animation: land 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
.cell.dim { opacity: 0.35; }
.cell.empty { background: #1d2c24; }
.cell.locked { box-shadow: inset 0 0 0 3px var(--gold); }
.cell.hit { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(233, 185, 73, 0.5); }

@keyframes roll {
  from { transform: translateY(-60%); }
  to { transform: translateY(60%); }
}
@keyframes land {
  from { transform: translateY(-30%); }
  to { transform: translateY(0); }
}

.result {
  min-height: 48px;
  margin-top: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.result.win { color: var(--win); font: 600 18px var(--mono); }
.result.partial { color: var(--text); }

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.figure span { display: block; color: var(--muted); font-size: 12px; }
.figure b { font: 600 17px var(--mono); }

.bet { display: flex; align-items: center; gap: 10px; text-align: center; }
.bet button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}
.bet button:hover:not(:disabled) { border-color: var(--gold); }
.bet button:disabled { opacity: 0.4; cursor: default; }
.bet svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }

#spin {
  grid-column: 1 / -1;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #2a1c04;
  font: 600 16px inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s;
}
#spin:hover:not(:disabled) { filter: brightness(1.08); }
#spin:active:not(:disabled) { transform: translateY(1px); }
#spin:disabled { background: var(--line); color: var(--muted); cursor: default; }

.ghost {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.info { margin-top: 24px; }
h2 {
  margin: 20px 0 8px;
  color: var(--muted);
  font: 600 12px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.stats div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 0; font: 600 15px var(--mono); }
.stats dd.pos { color: var(--win); }
.stats dd.neg { color: var(--loss); }

.hint { margin: 0 0 8px; color: var(--muted); font-size: 13px; }

.paytable { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.paytable li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.paytable svg { width: 28px; height: 28px; flex: none; }
.paytable b { margin-left: auto; font: 600 13px var(--mono); }

@media (prefers-reduced-motion: reduce) {
  .cell.spinning svg, .cell.landed svg { animation: none; filter: none; }
}
