/* ==========================================================================
   Habit Casino — Stylesheet (v2.1)
   Amber removed. New small-wheel result card. Real slot. Milestone overlay.
   ========================================================================== */

:root {
  --ink: #0b0f1d;
  --ink-2: #121831;
  --ink-3: #1b2342;
  --velvet: #3d0a14;
  --velvet-2: #5c1520;
  --gold: #d4af37;
  --gold-2: #f5d77a;
  --gold-deep: #a88722;
  --champagne: #f4e4bc;
  --cream: #ede0c8;
  --text: #efe6d1;
  --text-mute: #bfa976;
  --text-dim: #8a7a5a;
  --success: #5fa56b;
  --danger: #c94747;

  /* 4 chip colors — amber removed */
  --chip-crimson: #c1272d;
  --chip-sapphire: #2861a8;
  --chip-emerald: #2d7d4f;
  --chip-violet: #6a3f8c;
  --chip-gold: #f5d77a;

  --radius: 4px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(245, 215, 122, 0.1) inset;
  --shadow-gold: 0 0 32px rgba(212, 175, 55, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at top, #1a2043 0%, #0b0f1d 70%),
    var(--ink);
}

.bg-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(245,215,122,0.015) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.01) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.bg-spotlight {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 70vw; height: 60vh; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse, rgba(212,175,55,0.07) 0%, transparent 70%);
}

button { font-family: inherit; cursor: pointer; }

.btn-primary, .btn-ghost, .btn-danger {
  padding: 10px 22px;
  border: 1px solid var(--gold-deep);
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--ink);
  font-family: 'Bodoni Moda', serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-radius: var(--radius);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(212,175,55,0.4); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--gold); border-color: var(--gold-deep);
}
.btn-ghost:hover { background: rgba(212, 175, 55, 0.08); }
.btn-danger {
  background: transparent; color: var(--danger); border-color: var(--danger);
}
.btn-danger:hover { background: rgba(201, 71, 71, 0.1); }

input[type="text"], input[type="number"], input[type="color"], select, textarea {
  background: var(--ink-2);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text);
  padding: 10px 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  border-radius: var(--radius);
  width: 100%;
}
input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }

.hidden { display: none !important; }

/* ==========================================================================
   Marquee header
   ========================================================================== */
.marquee {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 32px 18px;
  gap: 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  background: linear-gradient(180deg, rgba(61, 10, 20, 0.3) 0%, transparent 100%);
  flex-wrap: wrap;
}
.marquee__title {
  font-family: 'Bodoni Moda', serif;
  font-weight: 900;
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  text-shadow: 0 0 24px rgba(245, 215, 122, 0.3);
}
.marquee__title span { font-style: italic; font-weight: 400; color: var(--gold); }
.marquee__ornament { color: var(--gold); font-size: 1.2rem; opacity: 0.6; }
.marquee__stats {
  display: flex; gap: 14px; align-items: center;
  margin-left: 18px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-mute);
}
.stat { display: flex; flex-direction: column; text-align: center; line-height: 1.1; }
.stat em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 0.7rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.15em;
}
.stat strong { font-size: 1.1rem; font-weight: 800; color: var(--gold-2); }
.stat-divider { color: rgba(212, 175, 55, 0.2); font-size: 1.3rem; }

.marquee__actions { display: flex; gap: 10px; margin-left: auto; }
.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  background: var(--ink-2);
  color: var(--gold);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}
.icon-btn__badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; font-weight: 800;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 24px;
  padding: 24px 32px 80px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 140px);
}

.panel {
  background: linear-gradient(180deg, rgba(18,24,49,0.8) 0%, rgba(11,15,29,0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.panel__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.panel__header h2 {
  margin: 0; font-family: 'Bodoni Moda', serif;
  font-size: 1.5rem; font-weight: 400; font-style: italic;
  color: var(--gold-2); letter-spacing: 0.05em;
}

/* ==========================================================================
   Jar tabs
   ========================================================================== */
.jar-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.jar-tabs:empty { display: none; }
.jar-tab {
  padding: 6px 14px;
  font-family: 'Bodoni Moda', serif;
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 20px;
  transition: all 0.15s;
}
.jar-tab:hover { color: var(--gold); border-color: var(--gold-deep); }
.jar-tab--active {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-color: var(--gold-deep);
}

/* ==========================================================================
   Habits list
   ========================================================================== */
.habits-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.habit-card {
  background: var(--ink-2);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
  transition: border-color 0.15s;
}
.habit-card:hover { border-color: rgba(212, 175, 55, 0.3); }
.habit-card--big-spin-ready {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.25);
}
.habit-card__main { flex: 1; min-width: 0; }
.habit-card__name {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--cream);
  margin-bottom: 2px;
}
.habit-card__desc {
  font-size: 0.9rem; font-style: italic;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.habit-card__desc:empty { display: none; }
.habit-card__rewards {
  display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap;
}
.chip-reward {
  font-size: 0.75rem;
  color: var(--text-mute);
  padding: 2px 6px;
  background: rgba(212, 175, 55, 0.06);
  border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px;
}
.chip-reward--t1 { border-left: 2px solid var(--gold); }
.chip-reward--t2 { border-left: 2px solid #8a4a1a; }
.chip-reward--t3 { border-left: 2px solid var(--chip-crimson); }

.habit-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
  min-height: 24px;
}
.habit-chips:empty { margin-top: 0; min-height: 0; }
.habit-chip {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 1px 2px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.habit-chip--golden {
  background: radial-gradient(circle at 30% 30%, var(--gold-2), var(--gold), var(--gold-deep));
  box-shadow: 0 0 8px rgba(245, 215, 122, 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  animation: shimmer 2.4s infinite;
}
@keyframes shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}
.habit-chip--crimson { background: radial-gradient(circle at 30% 30%, #e04048, var(--chip-crimson), #8a1a1f); }
.habit-chip--sapphire { background: radial-gradient(circle at 30% 30%, #4883d0, var(--chip-sapphire), #1a4278); }
.habit-chip--emerald { background: radial-gradient(circle at 30% 30%, #4ea070, var(--chip-emerald), #1f5836); }
.habit-chip--violet { background: radial-gradient(circle at 30% 30%, #9060b8, var(--chip-violet), #4a2966); }

.habit-card__actions { display: flex; flex-direction: column; gap: 6px; }
.btn-complete {
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--velvet-2), var(--velvet));
  color: var(--gold-2);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  font-family: 'Bodoni Moda', serif;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  text-transform: uppercase;
  transition: all 0.15s;
}
.btn-complete:hover {
  box-shadow: 0 0 14px rgba(201, 71, 71, 0.35);
}
.btn-big-spin {
  padding: 8px 14px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
  color: var(--ink);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  font-family: 'Bodoni Moda', serif;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  text-transform: uppercase;
  animation: bigSpinPulse 1.8s infinite;
}
@keyframes bigSpinPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(245,215,122, 0); }
  50% { box-shadow: 0 0 18px rgba(245, 215, 122, 0.6); }
}
.btn-edit {
  width: 32px; height: 32px;
  background: transparent; color: var(--text-dim);
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 0.9rem;
}
.btn-edit:hover { color: var(--gold); border-color: rgba(212, 175, 55, 0.2); }

/* ==========================================================================
   Wheel stage
   ========================================================================== */
.wheel-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  padding: 20px 0;
}
.wheel-frame {
  position: relative;
  width: 460px; height: 460px;
  display: flex; align-items: center; justify-content: center;
}
.wheel-pointer {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  color: var(--gold-2); font-size: 2.4rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  z-index: 3;
}
.wheel-bulbs {
  position: absolute; inset: -14px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg,
      rgba(245, 215, 122, 0.5) 0deg 3deg,
      transparent 3deg 15deg);
  filter: blur(1px);
  animation: rotateSlow 40s linear infinite;
  opacity: 0.5;
}
@keyframes rotateSlow { to { transform: rotate(360deg); } }
.wheel-container {
  position: relative;
  width: 440px; height: 440px;
  border-radius: 50%;
  padding: 10px;
  background:
    radial-gradient(circle, var(--ink-2) 0%, var(--ink) 80%),
    linear-gradient(135deg, var(--gold-deep), var(--gold));
  box-shadow:
    0 0 0 3px var(--gold-deep),
    0 0 0 5px var(--ink),
    0 12px 48px rgba(0,0,0,0.6),
    inset 0 0 40px rgba(0,0,0,0.5);
}
.wheel { width: 100%; height: 100%; transform-origin: center; }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border: 2px solid var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.wheel-hub__inner {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-deep);
}
.wheel-hub__label {
  font-family: 'Bodoni Moda', serif;
  font-weight: 900; font-size: 0.95rem;
  color: var(--gold-2); letter-spacing: 0.1em;
}

.wheel-caption {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-dim);
  max-width: 380px;
  line-height: 1.5;
}

.wheel-label, .small-wheel-label {
  font-family: 'Bodoni Moda', serif;
  fill: var(--ink);
  stroke: rgba(11, 15, 29, 0.3);
  stroke-width: 0.3;
  paint-order: stroke;
}

/* ==========================================================================
   Jars list
   ========================================================================== */
.jars-list { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.jar-card {
  background: var(--ink-2);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.jar-card__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.jar-card__name {
  margin: 0; font-family: 'Bodoni Moda', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--cream);
}

.jar-visual {
  display: flex; gap: 14px;
  align-items: center;
  padding: 22px 0 6px 0;
  position: relative;
}
.jar-visual__glass {
  position: relative;
  width: 60px; height: 120px;
  background: linear-gradient(180deg,
    rgba(212,175,55,0.08) 0%, rgba(212,175,55,0.02) 30%, rgba(11,15,29,0.4) 100%);
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 6px 6px 14px 14px;
  overflow: visible;
  flex-shrink: 0;
}
.jar-visual__glass::before {
  content: '';
  position: absolute; top: -5px; left: -5px; right: -5px;
  height: 10px;
  background: linear-gradient(180deg, var(--gold-deep), var(--gold));
  border-radius: 3px;
  border: 1px solid var(--ink);
}
.jar-visual__fill {
  position: absolute; bottom: 0; left: 2px; right: 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-radius: 0 0 12px 12px;
  transition: height 0.6s ease-out;
  overflow: hidden;
}
.jar-visual__fill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
}
.jar-visual__milestones {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  pointer-events: none;
}
.milestone-mark {
  position: absolute; left: -14px; right: -14px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}
.milestone-mark__label {
  position: absolute; right: -56px;
  top: -8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--gold);
  white-space: nowrap;
}
.jar-visual__count { font-family: 'JetBrains Mono', monospace; text-align: center; }
.jar-visual__num {
  display: block;
  font-size: 1.8rem; font-weight: 800; color: var(--gold-2);
  line-height: 1;
}
.jar-visual__label {
  font-size: 0.7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.15em;
}

.jar-card__milestones { display: flex; flex-direction: column; gap: 4px; }
.milestone-row-display {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 0.85rem; padding: 3px 6px;
  border-radius: 3px;
}
.milestone-row-display--hit {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-2);
}
.milestone-row-display strong {
  font-family: 'JetBrains Mono', monospace; color: var(--gold);
}

/* ==========================================================================
   Ticker
   ========================================================================== */
.ticker {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent, rgba(11,15,29,0.9));
  padding: 10px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  overflow: hidden;
  z-index: 2;
}
.ticker__inner {
  display: flex; gap: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  animation: tickerScroll 50s linear infinite;
}
.ticker__inner:hover { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}
.ticker-item { color: var(--text-mute); }
.ticker-item--jackpot { color: var(--gold-2); font-weight: 700; }
.ticker-item--bonus { color: var(--chip-emerald); }

/* ==========================================================================
   Modals (shared)
   ========================================================================== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
}
.modal__card {
  position: relative;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--shadow-gold);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal__card--wide { max-width: 680px; }
.modal__card h3 {
  margin: 0 0 18px;
  font-family: 'Bodoni Moda', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--gold-2);
  text-align: center;
  letter-spacing: 0.05em;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; }
.form label > span {
  font-family: 'Bodoni Moda', serif;
  font-size: 0.78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.form__actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(212,175,55,0.1);
}
.form__actions > :first-child { margin-right: auto; }

.tier-rewards { display: flex; flex-direction: column; gap: 14px; }
.tier-reward-block {
  background: rgba(11,15,29,0.5);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.tier-reward-block--jackpot { border-color: rgba(245, 215, 122, 0.35); }
.tier-reward-block__head {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem;
}
.tier-reward-block__head strong {
  font-family: 'Bodoni Moda', serif;
  color: var(--cream);
}
.tier-reward-block__head em {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: auto;
}

.tier-badge {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.tier-badge--1 { background: rgba(212, 175, 55, 0.2); color: var(--gold-2); border: 1px solid var(--gold-deep); }
.tier-badge--2 { background: rgba(138, 74, 26, 0.25); color: #d58a4a; border: 1px solid #8a4a1a; }
.tier-badge--3 { background: rgba(193, 39, 45, 0.2); color: #e04048; border: 1px solid var(--chip-crimson); }
.tier-badge--jackpot {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
  color: var(--ink);
  border: 1px solid var(--ink);
}

.tier-reward-type {
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
}
.radio {
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.8rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 20px;
  color: var(--text-mute);
  transition: all 0.15s;
}
.radio input { display: none; }
.radio:has(input:checked) {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-2);
  border-color: var(--gold);
}
.duration-input {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8rem;
  color: var(--text-mute);
}
.duration-input input {
  width: 60px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.milestones {
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.milestones legend {
  font-family: 'Bodoni Moda', serif;
  font-size: 0.78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0 6px;
}
.milestone-row {
  display: grid; grid-template-columns: 100px 1fr; gap: 8px;
  margin-bottom: 6px;
}

/* ==========================================================================
   Small wheel overlay
   ========================================================================== */
.small-wheel-overlay {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: center; justify-content: center;
}
.small-wheel-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
}
.small-wheel-overlay__card {
  position: relative;
  padding: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.small-wheel-container {
  position: relative;
  width: 260px; height: 260px;
  padding: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  box-shadow:
    0 0 0 2px var(--ink),
    0 0 40px rgba(212, 175, 55, 0.4);
}
.small-wheel-container svg { width: 100%; height: 100%; }
.small-wheel-pointer {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  color: var(--gold-2); font-size: 1.8rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  z-index: 3;
}

.small-wheel-result {
  min-width: 280px;
  min-height: 130px;
  padding: 20px 32px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  text-align: center;
}
.small-wheel-result:empty { display: none; }

.sw-result-icon {
  font-size: 3rem;
  color: var(--gold-2);
  text-shadow: 0 0 20px rgba(245, 215, 122, 0.8);
  line-height: 1;
}
.sw-result-big {
  font-family: 'Bodoni Moda', serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--gold-2);
  line-height: 1;
  text-shadow: 0 0 20px rgba(245, 215, 122, 0.4);
}
.sw-result-text {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cream);
}
.sw-result-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-mute);
  margin-top: 4px;
}

.small-wheel-result--golden {
  border-color: var(--gold-2);
  background: linear-gradient(180deg, #2a2340, #1a1530);
  box-shadow: 0 0 40px rgba(245, 215, 122, 0.5);
  animation: goldGlow 0.8s infinite alternate;
}
.small-wheel-result--golden .sw-result-text {
  color: var(--gold-2);
}
@keyframes goldGlow {
  from { box-shadow: 0 0 30px rgba(245, 215, 122, 0.4); }
  to { box-shadow: 0 0 55px rgba(245, 215, 122, 0.8); }
}

.small-wheel-result--nothing {
  border-color: var(--text-dim);
  background: var(--ink-2);
  box-shadow: none;
}
.small-wheel-result--nothing .sw-result-text {
  color: var(--text-dim);
  font-style: italic;
}

.small-wheel-result--chips {
  border-color: var(--success);
  box-shadow: 0 0 30px rgba(95, 165, 107, 0.3);
}
.small-wheel-result--chips .sw-result-big {
  color: #86d195;
  text-shadow: 0 0 20px rgba(95, 165, 107, 0.5);
}

/* ==========================================================================
   Slot machine (real reels with rolling strips)
   ========================================================================== */
.slot-overlay {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: center; justify-content: center;
}
.slot-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
}
.slot-overlay__card {
  position: relative;
  background: linear-gradient(180deg, var(--velvet-2), var(--velvet));
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 30px 40px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.7),
    0 0 40px rgba(212, 175, 55, 0.3),
    inset 0 2px 20px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  max-width: 90vw;
}

.slot-title {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px rgba(245, 215, 122, 0.6);
  animation: slotTitleFlicker 1.8s infinite;
}
@keyframes slotTitleFlicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.75; }
  96% { opacity: 1; }
  98% { opacity: 0.85; }
}

.slot-machine {
  position: relative;
  padding: 20px 26px;
  background:
    linear-gradient(180deg, #1a1030, #0a0818),
    var(--ink);
  border: 3px solid var(--gold-deep);
  border-radius: 8px;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.8),
    0 0 0 1px var(--ink),
    0 4px 16px rgba(0,0,0,0.5);
}

.slot-machine__light {
  position: absolute; top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff9e3a, #d4af37 50%, #7a5a1a);
  box-shadow: 0 0 12px rgba(245, 215, 122, 0.8);
  transform: translateY(-50%);
  animation: bulbFlicker 0.8s infinite alternate;
}
.slot-machine__light--left { left: -6px; }
.slot-machine__light--right { right: -6px; animation-delay: 0.4s; }
@keyframes bulbFlicker {
  from { opacity: 0.5; box-shadow: 0 0 6px rgba(245, 215, 122, 0.4); }
  to { opacity: 1; box-shadow: 0 0 18px rgba(245, 215, 122, 1); }
}

.slot-reels {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--ink);
  border: 2px solid var(--gold-deep);
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.slot-reel {
  width: 90px;
  background: #1a1030;
  border: 1px solid rgba(245, 215, 122, 0.2);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.7);
}
.slot-reel__window {
  height: 100px; /* single chip visible */
  position: relative;
  overflow: hidden;
}
.slot-reel__window::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.9), transparent);
  z-index: 2; pointer-events: none;
}
.slot-reel__window::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9), transparent);
  z-index: 2; pointer-events: none;
}
.slot-reel__strip {
  display: flex; flex-direction: column;
  will-change: transform;
}
.slot-chip {
  width: 90px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.slot-chip::before {
  content: '';
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.4);
  box-shadow:
    0 3px 8px rgba(0,0,0,0.6),
    inset 0 2px 4px rgba(255,255,255,0.2),
    inset 0 -2px 4px rgba(0,0,0,0.4);
}
.slot-chip--crimson::before { background: radial-gradient(circle at 30% 30%, #e04048, var(--chip-crimson), #8a1a1f); }
.slot-chip--sapphire::before { background: radial-gradient(circle at 30% 30%, #4883d0, var(--chip-sapphire), #1a4278); }
.slot-chip--emerald::before { background: radial-gradient(circle at 30% 30%, #4ea070, var(--chip-emerald), #1f5836); }
.slot-chip--violet::before { background: radial-gradient(circle at 30% 30%, #9060b8, var(--chip-violet), #4a2966); }

.slot-winline {
  position: absolute;
  left: 20px; right: 20px;
  top: calc(50% + 10px);
  height: 2px;
  background: linear-gradient(90deg,
    transparent, rgba(245, 215, 122, 0.8), transparent);
  pointer-events: none;
  z-index: 3;
  opacity: 0.4;
}

.slot-result {
  min-height: 70px;
  padding: 14px 24px;
  background: var(--ink-2);
  border: 2px solid var(--gold-deep);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  min-width: 260px;
  text-align: center;
}
.slot-result:empty { display: none; }
.slot-result > span {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-2);
}
.slot-result > small {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--cream);
  font-size: 1rem;
}
.slot-result--triple {
  border-color: var(--gold-2);
  background: linear-gradient(180deg, #2a2340, var(--ink-2));
  box-shadow: 0 0 30px rgba(245, 215, 122, 0.4);
}
.slot-result--triple > span {
  font-size: 1.7rem;
  animation: goldPulse 0.6s infinite alternate;
}
@keyframes goldPulse {
  from { text-shadow: 0 0 10px rgba(245, 215, 122, 0.4); }
  to { text-shadow: 0 0 25px rgba(245, 215, 122, 0.9); }
}

/* ==========================================================================
   Result overlay (Big Wheel wins)
   ========================================================================== */
.result-overlay {
  position: fixed; inset: 0; z-index: 105;
  display: flex; align-items: center; justify-content: center;
}
.result-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
}
.result-overlay__card {
  position: relative;
  min-width: 320px; max-width: 500px;
  padding: 30px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.4);
  text-align: center;
}
.result-overlay__card--jackpot {
  border-color: var(--gold-2);
  box-shadow: 0 0 80px rgba(245, 215, 122, 0.6);
  animation: jackpotGlow 0.4s infinite alternate;
}
@keyframes jackpotGlow {
  from { box-shadow: 0 0 50px rgba(245, 215, 122, 0.5); }
  to { box-shadow: 0 0 80px rgba(245, 215, 122, 0.8); }
}
.result-tier {
  font-family: 'Bodoni Moda', serif;
  font-size: 0.9rem;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.result-headline {
  font-family: 'Bodoni Moda', serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--gold-2);
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(245, 215, 122, 0.4);
}
.result-reward {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 18px;
}
.result-actions {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Milestone celebration
   ========================================================================== */
.milestone-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.milestone-overlay__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse, rgba(61, 10, 20, 0.85) 0%, rgba(0,0,0,0.9) 70%);
  backdrop-filter: blur(6px);
}

.milestone-confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -20px;
  width: 10px; height: 18px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
}

.milestone-card {
  position: relative;
  padding: 44px 56px;
  background: linear-gradient(180deg, var(--velvet-2), var(--velvet));
  border: 3px solid var(--gold-2);
  border-radius: 12px;
  box-shadow:
    0 0 80px rgba(245, 215, 122, 0.6),
    inset 0 2px 20px rgba(0,0,0,0.4);
  text-align: center;
  max-width: 500px;
  animation: milestonePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes milestonePop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.milestone-crown {
  font-size: 3.5rem;
  color: var(--gold-2);
  text-shadow: 0 0 30px rgba(245, 215, 122, 0.8);
  margin-bottom: 10px;
  animation: crownSpin 3s infinite linear;
}
@keyframes crownSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.milestone-eyebrow {
  font-family: 'Bodoni Moda', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 14px;
}
.milestone-jar {
  font-family: 'Bodoni Moda', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--cream);
  margin-bottom: 6px;
}
.milestone-count {
  font-family: 'Bodoni Moda', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--gold-2);
  line-height: 1;
  margin-bottom: 18px;
  text-shadow: 0 0 30px rgba(245, 215, 122, 0.5);
}
.milestone-reward {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--champagne);
  margin-bottom: 26px;
  padding: 10px 20px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius);
  border: 1px solid rgba(245, 215, 122, 0.25);
}

/* ==========================================================================
   Timer
   ========================================================================== */
.timer-overlay {
  position: fixed; inset: 0; z-index: 115;
  display: flex; align-items: center; justify-content: center;
}
.timer-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
}
.timer-overlay__card {
  position: relative;
  padding: 40px 50px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.3);
  text-align: center;
  min-width: 380px;
}
.timer-reward-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 14px;
}
.timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 5rem;
  font-weight: 800;
  color: var(--gold-2);
  margin-bottom: 24px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(245, 215, 122, 0.3);
}
.timer-display--ending {
  animation: timerShake 0.3s infinite;
  color: var(--danger);
}
@keyframes timerShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.timer-actions {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
}

.timer-pill {
  position: fixed; bottom: 30px; right: 30px;
  z-index: 90;
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  transition: transform 0.1s;
}
.timer-pill:hover { transform: translateY(-2px); }
.timer-pill__icon { font-size: 1rem; }
.timer-pill__display { font-size: 1rem; }

/* ==========================================================================
   Vault
   ========================================================================== */
.vault-lede {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 18px;
}
.vault-list { display: flex; flex-direction: column; gap: 10px; }
.vault-list:empty::before {
  content: 'Your vault is empty.';
  display: block; text-align: center;
  color: var(--text-dim); font-style: italic;
  padding: 30px;
}
.vault-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--ink-2);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.vault-item__main { flex: 1; min-width: 0; }
.vault-item__reward {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--cream);
  margin-bottom: 4px;
}
.vault-item__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.vault-item__habit { color: var(--text-mute); }
.vault-item__actions { display: flex; gap: 6px; }
.vault-item__actions button {
  padding: 6px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--ink-2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold-2);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 200;
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toast--success { border-color: var(--success); color: #86d195; }
.toast--danger { border-color: var(--danger); color: #e67676; }

/* ==========================================================================
   Onboarding
   ========================================================================== */
.onboarding {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.onboarding__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.9);
}
.onboarding__card {
  position: relative;
  max-width: 520px;
  padding: 36px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-gold);
}
.onboarding__card h2 {
  margin: 0 0 8px;
  font-family: 'Bodoni Moda', serif;
  font-size: 2rem;
  color: var(--gold-2);
  text-align: center;
}
.onboarding__lede {
  text-align: center; font-style: italic;
  color: var(--text-mute);
  margin-bottom: 22px;
}
.onboarding__steps {
  padding-left: 20px;
  margin-bottom: 24px;
  line-height: 1.6;
}
.onboarding__steps li { margin-bottom: 10px; color: var(--text); }
.onboarding__steps strong { color: var(--gold-2); }
.onboarding__card button { width: 100%; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .wheel-frame { width: 380px; height: 380px; }
  .wheel-container { width: 360px; height: 360px; }
}

@media (max-width: 700px) {
  .marquee { padding: 14px 16px; gap: 12px; }
  .marquee__title { font-size: 1.8rem; }
  .marquee__stats { margin-left: 0; }
  .marquee__actions { width: 100%; justify-content: center; margin-left: 0; }
  .layout { padding: 14px; gap: 14px; }
  .panel { padding: 14px; }
  .wheel-frame { width: 300px; height: 300px; }
  .wheel-container { width: 280px; height: 280px; }
  .timer-display { font-size: 3.5rem; }
  .tier-reward-block__head em { display: none; }
  .slot-reel, .slot-chip { width: 70px; }
  .slot-reel__window { height: 80px; }
  .slot-chip { height: 80px; }
  .slot-chip::before { width: 52px; height: 52px; }
}
