:root {
  --bg0: #2b0000;
  --bg1: #650907;
  --bg2: #8f120f;
  --gold: #f6c84e;
  --gold-2: #ffdd76;
  --panel: #151313;
  --muted: #b4a9a9;
  --cell-bg: #2a1f1f;
  --cell-border: #5a4747;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #f5f5f5;
  background:
    radial-gradient(circle at 50% 0%, #ff2626 0%, transparent 34%),
    linear-gradient(135deg, var(--bg0), var(--bg1) 45%, var(--bg2) 100%);
}

.layout {
  width: min(1080px, 96vw);
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 80, 60, 0.08), rgba(0, 0, 0, 0.22));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

h1 {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(255, 212, 90, 0.45);
}

.meta {
  display: flex;
  gap: 0.5rem;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: rgba(0, 0, 0, 0.28);
}

.coin-top {
  margin-top: 0.8rem;
}

.brand-hero {
  position: relative;
  text-align: center;
  margin-bottom: 0.5rem;
}

.brand-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  text-shadow:
    0 2px 0 #6f2900,
    0 0 15px rgba(255, 208, 102, 0.35);
}

.hero-coins {
  margin: 0 auto 0.25rem;
  width: min(360px, 80vw);
  height: 32px;
  position: relative;
}

.hero-coins .pile-coin {
  width: 30px;
  height: 30px;
}

.coin-pile-wrap {
  position: relative;
  min-height: 86px;
  border-radius: 14px;
  background: transparent;
  border: 0;
  display: grid;
  justify-items: center;
  align-items: center;
  overflow: hidden;
}

.coin-pile-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 222, 120, 0.26), transparent 60%);
  pointer-events: none;
}

.coin-pile {
  position: relative;
  width: min(460px, 90vw);
  height: 56px;
}

.pile-coin {
  position: absolute;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45));
}

.coin-meter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  text-align: right;
}

.coin-meter span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.coin-meter strong {
  font-size: 1rem;
  color: var(--gold);
}

.coin-rule {
  margin: 0.45rem 0 0;
  color: #d7cfcf;
  font-size: 0.9rem;
}

.coin-fly {
  position: fixed;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 30;
}

.stage {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
}

.jackpots {
  display: grid;
  gap: 0.7rem;
  align-content: center;
}

.tier {
  border-radius: 12px;
  padding: 0.65rem 0.6rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.tier strong {
  display: block;
  font-size: 1.1rem;
}

.ultra { background: linear-gradient(90deg, #8c0000, #cc0000); }
.max { background: linear-gradient(90deg, #5d1060, #9f24a4); }
.mid { background: linear-gradient(90deg, #11458f, #2175f4); }
.min { background: linear-gradient(90deg, #146113, #20ab1d); }

.slot-frame {
  background: linear-gradient(180deg, rgba(16, 12, 12, 0.95), rgba(10, 8, 8, 0.98));
  border: 5px solid var(--gold);
  border-radius: 16px;
  padding: 0.7rem;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.62),
    0 0 16px rgba(255, 193, 86, 0.25);
}

.reels-wrap {
  overflow: hidden;
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.reel-col {
  height: 276px;
  overflow: hidden;
  border-radius: 12px;
  border: 0;
  background: transparent;
}

.reel-strip {
  will-change: transform, filter;
  transform-origin: 50% 50%;
}

.reel-strip.spinning {
  filter: blur(3px) saturate(1.1);
}

.cell {
  height: 92px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin: 4px;
  background: transparent;
  border: 0;
}

.cell img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}

.cell.win {
  animation: pulse 560ms ease-in-out 2;
}

.controls {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.6rem;
}

.control-block {
  background: rgba(0, 0, 0, 0.36);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}

.control-block label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.control-block input,
.control-block select {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem;
  color: #f1f1f1;
  background: #2a2020;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.spin {
  background: linear-gradient(180deg, #2e2e2e, #1d1d1d);
  color: var(--gold-2);
  border: 1px solid rgba(255, 222, 124, 0.45);
}

.alt {
  background: #323232;
  color: #ddd;
}

.results {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.results div {
  background: rgba(0, 0, 0, 0.38);
  border-radius: 10px;
  padding: 0.55rem;
}

.results span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.results strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.panels {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bonus-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  place-items: center;
  z-index: 40;
}

.bonus-modal.open {
  display: grid;
}

.bonus-card {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, #3a0b0b, #160909);
  border: 1px solid rgba(255, 216, 128, 0.45);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0 22px rgba(255, 201, 88, 0.22);
}

.bonus-card h2 {
  color: var(--gold);
  margin: 0;
}

.bonus-sub {
  color: #d7cfcf;
}

.bonus-amount {
  font-size: 2rem;
  color: var(--gold-2);
  margin: 0.35rem 0 0.9rem;
}

.panel h2 {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-size: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  font-size: 0.85rem;
}

.pay-symbol {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pay-symbol img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

ul {
  margin: 0;
  padding-left: 1rem;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 127, 0.3); }
  50% { transform: scale(1.04); box-shadow: 0 0 16px rgba(255, 214, 127, 0.65); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 127, 0.3); }
}

/* ---- profit-practices additions (presentation only) ---- */
button.toggle.active { color: var(--gold-2); border: 1px solid var(--gold); box-shadow: 0 0 10px rgba(255, 212, 91, 0.35); }
.bet-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin-top: 0.5rem; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(0, 0, 0, 0.36);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
}
.chip.active { color: var(--gold-2); border-color: var(--gold); }
.chip.anchor { border-color: #ff5252; color: var(--gold-2); box-shadow: 0 0 10px rgba(255, 82, 82, 0.4); font-size: 0.82rem; }
.tap-hint { text-align: center; color: var(--muted); font-size: 0.7rem; margin: 0.3rem 0 0; }
.win-banner, .near-banner {
  margin-top: 0.6rem;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.1em;
  border-radius: 12px;
  padding: 0.6rem;
}
.win-banner { color: #401103; background: linear-gradient(180deg, var(--gold-2), var(--gold)); font-size: 1.1rem; }
.near-banner { color: var(--gold-2); background: rgba(0, 0, 0, 0.45); border: 1px solid var(--gold); font-size: 0.95rem; }
.win-banner[hidden], .near-banner[hidden] { display: none; }
.cell.near { animation: pulse 420ms ease-in-out 3; box-shadow: 0 0 16px rgba(255, 214, 127, 0.8); }
.cell.anticipate { animation: pulse 380ms ease-in-out infinite; box-shadow: 0 0 18px rgba(255, 214, 127, 0.85); }
.social-strip { margin-top: 0.7rem; }
.recent-wins, .recent-results { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; min-height: 1.4rem; }
.social-win {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.36);
}
.social-win.mine { color: var(--gold-2); border-color: var(--gold); }
.result-chip {
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.result-chip.win { color: var(--gold-2); }
.result-chip.bonus { color: #401103; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }

@media (prefers-reduced-motion: reduce) {
  .cell.win { animation: none; }
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .jackpots { grid-template-columns: repeat(4, 1fr); }
  .controls { grid-template-columns: 1fr 1fr; }
  .results, .panels { grid-template-columns: 1fr; }
  .coin-pile {
    width: min(300px, 90vw);
  }
}

.lang-toggle {
  cursor: pointer;
  border: 1px solid rgba(255, 210, 106, 0.45);
  background: rgba(32, 18, 64, 0.85);
  color: #ffd66b;
  font-weight: 700;
}

.player-chip {
  color: #f6e7b8;
  font-weight: 700;
  font-size: 0.95rem;
}

.tier-label {
  color: #ffd66b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  margin-bottom: 0.4rem;
}
