:root {
  --bg0: #1a0f0a;
  --bg1: #2c1810;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --ruby: #9b2c2c;
  --cream: #f3e6d0;
  --muted: #b8a48c;
  --panel: rgba(40, 22, 14, 0.82);
  --line: rgba(201, 162, 39, 0.35);
  --ok: #3d8b6e;
  --danger: #c45c4a;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--cream);
  background: radial-gradient(120% 80% at 50% 0%, #3a2216 0%, var(--bg0) 55%, #0d0705 100%);
}

body {
  padding: 12px 14px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.bg-pattern {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.12;
  background-image: url("/assets/banner.png");
  background-size: cover;
  background-position: center;
  filter: blur(2px) saturate(0.85);
  z-index: 0;
}

.topbar, .main, .foot { position: relative; z-index: 1; }

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

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #0a0604;
  border: 1px solid var(--line);
  padding: 0;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wallet-chip .star { color: var(--gold); }

.hero-story {
  margin-bottom: 14px;
}

.hero-img {
  width: 100%;
  max-height: 168px;
  object-fit: cover;
  object-position: center 40%;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.story {
  margin: 10px 2px 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.slot-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px 14px;
  margin-bottom: 14px;
}

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

.reel {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.12), transparent 40%),
    #120b08;
  border: 1px solid var(--line);
  overflow: hidden;
}

.reel .sym {
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-family: var(--font-display);
  color: var(--gold-soft);
  transition: transform 0.15s ease, opacity 0.15s ease;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.reel .sym-img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.reel .sym-img.daria {
  filter: drop-shadow(0 0 12px rgba(255, 120, 180, 0.55)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.reel.spinning .sym {
  animation: flicker 0.12s linear infinite;
}

@keyframes flicker {
  0% { transform: translateY(-6px); opacity: 0.55; }
  50% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(-2px); opacity: 0.7; }
}

.result {
  text-align: center;
  margin-top: 12px;
  min-height: 1.4em;
  font-weight: 600;
  color: var(--gold-soft);
}

.result.win { color: #7dcea0; }
.result.lose { color: var(--muted); }

.controls { display: grid; gap: 12px; }

.bet-row, .pack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #1c110c;
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(145deg, #6b4a1e, #3a2710);
  border-color: var(--gold);
  color: var(--gold-soft);
}

.chip:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-spin {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1008;
  background: linear-gradient(180deg, #e8d48b, #c9a227 55%, #8a6a16);
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.28);
  cursor: pointer;
}

.btn-spin:disabled {
  filter: grayscale(0.4) brightness(0.7);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-spin:not(:disabled):active {
  transform: translateY(1px);
}

.deposit-row {
  display: grid;
  gap: 8px;
}

.muted { color: var(--muted); font-size: 0.85rem; }

.status {
  min-height: 1.25em;
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

.user-line {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.foot {
  margin-top: 22px;
  font-size: 0.72rem;
  color: #7a6a58;
  text-align: center;
  line-height: 1.4;
}
