/* Gambit — app styles. Mobile-first, dark, single stylesheet. */

:root {
  --bg: #120b26;
  --bg-2: #180f30;
  --surface: #201542;
  --surface-2: #281a52;
  --surface-3: #31215f;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);

  --text: #f1ecff;
  --muted: #b6a9de;
  --muted-2: #8f81bd;

  --violet: #9a5cff;
  --violet-ink: #6b3ff0;
  --gold: #ffcf4d;
  --gold-ink: #e0a92a;
  --blue: #5f6bd0;
  --good: #4de0c0;
  --bad: #ff6b8a;

  --tier-small: #5f6bd0;
  --tier-medium: #9a5cff;
  --tier-jackpot: #ffcf4d;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  --header-h: 76px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a1857 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  line-height: 1.4;
}

h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */

.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding-top: var(--safe-top);
  background: rgba(18, 11, 38, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-main {
  padding: calc(var(--header-h) + var(--safe-top) + 8px) 16px
           calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  max-width: 640px; margin: 0 auto;
}
body.onboarding-active .app-header,
body.onboarding-active .tabbar { display: none; }
body.onboarding-active .app-main {
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 24px);
}

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(18, 11, 38, 0.9);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: 0; background: none;
  color: var(--muted-2); font-size: 0.7rem; font-weight: 600;
  padding: 8px 0; transition: color 0.15s;
}
.tab-btn .tab-icon { font-size: 1.25rem; filter: grayscale(0.4) opacity(0.8); }
.tab-btn.active { color: var(--text); }
.tab-btn.active .tab-icon { filter: none; transform: translateY(-1px); }

/* ---------- Header content ---------- */

.app-header-inner {
  max-width: 640px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background:
    conic-gradient(from -45deg, var(--tier-small), var(--tier-medium), var(--gold), var(--tier-small));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-version {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; align-self: flex-start;
}
.level-wrap { flex: 1; min-width: 0; }
.level-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.level-badge {
  font-weight: 800; font-size: 0.82rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.points-count { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.level-bar {
  height: 8px; border-radius: 999px; margin: 5px 0 3px;
  background: rgba(255, 255, 255, 0.09); overflow: hidden;
}
.level-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  transition: width 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.level-sub { font-size: 0.68rem; color: var(--muted-2); }

/* ---------- Generic bits ---------- */

.section-title { font-size: 1rem; margin: 22px 2px 10px; color: var(--text); }
.section-hint { font-size: 0.82rem; color: var(--muted); margin: 0 2px 12px; line-height: 1.5; }
.empty-note {
  padding: 20px; border: 1px dashed var(--line-2); border-radius: var(--radius);
  color: var(--muted); font-size: 0.9rem; text-align: center; background: rgba(255, 255, 255, 0.02);
}
.empty-note.small { padding: 12px; font-size: 0.82rem; }

.btn {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  padding: 11px 16px; border-radius: 12px; font-weight: 650; font-size: 0.92rem;
  transition: transform 0.08s, filter 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 8px 12px; font-size: 0.84rem; border-radius: 10px; }
.btn.big { padding: 15px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn.primary {
  background: linear-gradient(180deg, var(--violet), var(--violet-ink));
  border-color: transparent; box-shadow: 0 6px 18px rgba(122, 63, 240, 0.35);
}
.btn.primary:disabled { box-shadow: none; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 138, 0.4); background: rgba(255, 107, 138, 0.08); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 1.05rem;
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { transform: scale(0.94); }

.text-input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2);
  color: var(--text); outline: none;
}
.text-input::placeholder { color: var(--muted-2); }
.text-input:focus { border-color: var(--violet); background: rgba(255, 255, 255, 0.08); }

.field-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 16px 0 7px; }
.field-hint { font-size: 0.74rem; color: var(--muted-2); margin: 3px 0 0; line-height: 1.45; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }

/* Tier dots */
.tier-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.tier-dot.tier-small { background: var(--tier-small); }
.tier-dot.tier-medium { background: var(--tier-medium); }
.tier-dot.tier-jackpot { background: var(--tier-jackpot); box-shadow: 0 0 8px rgba(255, 207, 77, 0.6); }

/* ---------- Day view ---------- */

.day-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 14px; }
.day-title { font-size: 1.5rem; }
.day-date { color: var(--muted); font-size: 0.9rem; }

.wheel-panel {
  border-radius: var(--radius); padding: 18px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.wheel-panel.unlocked {
  background: linear-gradient(180deg, rgba(154, 92, 255, 0.22), rgba(255, 207, 77, 0.1));
  border-color: rgba(255, 207, 77, 0.35);
}
.wheel-status { margin-bottom: 12px; }
.wheel-status-text { font-size: 0.95rem; font-weight: 650; color: var(--text); }
.wheel-panel.locked .wheel-status-text { color: var(--muted); }
.wheel-btn {
  width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 1.1rem;
  font-weight: 800; color: #2a1440; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #ffe08a, var(--gold)); box-shadow: 0 8px 22px rgba(255, 207, 77, 0.4);
  transition: transform 0.08s, filter 0.15s;
}
.wheel-btn:active { transform: scale(0.98); }
.wheel-btn:disabled {
  background: var(--surface-2); color: var(--muted-2); box-shadow: none; cursor: not-allowed;
}
.wheel-btn-icon { font-size: 1.3rem; }
.wheel-panel.unlocked .wheel-btn { animation: pulse-gold 1.8s ease-in-out infinite; }
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 8px 22px rgba(255, 207, 77, 0.35); }
  50% { box-shadow: 0 8px 30px rgba(255, 207, 77, 0.65); }
}
.wheel-lastwin {
  margin-top: 12px; font-size: 0.85rem; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}

.habit-list { display: flex; flex-direction: column; gap: 10px; }
.habit-row {
  display: flex; align-items: stretch; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color 0.2s, background 0.2s;
}
.habit-row.done { background: rgba(77, 224, 192, 0.07); border-color: rgba(77, 224, 192, 0.28); }
.habit-row.locked { opacity: 0.55; }
.habit-main {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
  border: 0; background: none; color: var(--text); text-align: left; padding: 14px;
}
.check {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  border: 2px solid var(--line-2); display: grid; place-items: center;
  font-size: 0.9rem; color: transparent; transition: all 0.15s;
}
.check.checked { background: var(--good); border-color: var(--good); color: #06231d; font-weight: 900; }
.habit-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.habit-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done .habit-title { text-decoration: line-through; text-decoration-color: rgba(77, 224, 192, 0.6); color: var(--muted); }
.habit-count { font-size: 0.78rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.streak { font-size: 0.8rem; font-weight: 700; color: var(--gold); flex: none; }
.streak.streak-zero { color: var(--muted-2); }

.stack-controls { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 0; }
.stepper {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-size: 1.15rem; font-weight: 700;
  display: grid; place-items: center;
}
.stepper:active { transform: scale(0.92); }
.stepper:disabled { opacity: 0.35; }
.stepper.plus { background: var(--violet-ink); border-color: transparent; }

.carried { margin-top: 8px; }
.carried-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.carried-date { font-size: 0.72rem; color: var(--muted-2); padding-left: 4px; }

/* ---------- Tab views (Habits / Rewards) ---------- */

.tab-view { display: block; }
.tab-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.tab-head h1 { font-size: 1.5rem; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.habit-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.habit-card.archived { opacity: 0.7; }
.habit-card-main { flex: 1; min-width: 0; }
.habit-card-title { font-weight: 700; font-size: 1rem; }
.habit-card-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.habit-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-mini {
  font-size: 0.72rem; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--line);
}
.chip-mini.streak-mini { color: var(--gold); border-color: rgba(255, 207, 77, 0.3); }
.habit-card-actions { display: flex; gap: 6px; flex: none; }

.archived-block, .backup-block { margin-top: 22px; }
.archived-block summary, .backup-block summary {
  cursor: pointer; font-weight: 700; color: var(--muted); padding: 10px 0; font-size: 0.9rem;
}

/* ---------- Sheet / modal (habit editor) ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end;
  justify-content: center; background: rgba(8, 4, 20, 0.6);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.22s;
  padding: 0;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  transform: translateY(24px); transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 92vh; display: flex; flex-direction: column;
}
.modal-overlay.show .modal { transform: translateY(0); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 6px;
}
.sheet-head h2 { font-size: 1.2rem; }
.sheet-body { padding: 4px 18px 10px; overflow-y: auto; }
.sheet-foot {
  display: flex; gap: 10px; padding: 14px 18px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
}
.sheet-foot .btn { flex: 1; }

.seg-control {
  display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, 0.05);
  border-radius: 12px; border: 1px solid var(--line);
}
.seg-btn {
  flex: 1; border: 0; background: none; color: var(--muted); padding: 9px; border-radius: 9px;
  font-weight: 650; font-size: 0.88rem; transition: all 0.15s;
}
.seg-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

.weekday-picker { display: flex; gap: 6px; margin-top: 10px; }
.wd-btn {
  flex: 1; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  padding: 10px 0; border-radius: 10px; font-size: 0.78rem; font-weight: 650;
}
.wd-btn.active { background: var(--violet-ink); border-color: transparent; color: #fff; }

.dates-picker { margin-top: 10px; }
.date-add-row { display: flex; gap: 8px; }
.date-add-row .text-input { flex: 1; }
.date-chips, .ob-added, .ob-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem;
}
.chip-x {
  border: 0; background: rgba(255, 255, 255, 0.1); color: var(--text);
  width: 20px; height: 20px; border-radius: 50%; font-size: 0.9rem; line-height: 1; display: grid; place-items: center;
}

.num-stepper { display: flex; align-items: center; gap: 12px; }
.num-val { min-width: 24px; text-align: center; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.switch {
  width: 52px; height: 30px; border-radius: 999px; border: 0; padding: 3px; flex: none;
  background: rgba(255, 255, 255, 0.14); transition: background 0.2s; position: relative;
}
.switch.on { background: var(--good); }
.switch-knob {
  display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform 0.2s; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.switch.on .switch-knob { transform: translateX(22px); }

/* ---------- Rewards ---------- */

.tier-section { margin-bottom: 20px; }
.tier-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.tier-head h2, .tier-head h3 { font-size: 1.05rem; }
.tier-odds {
  margin-left: auto; font-size: 0.74rem; font-weight: 700; color: var(--muted);
  background: rgba(255, 255, 255, 0.06); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.reward-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.reward-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.reward-row.claimed { opacity: 0.5; }
.reward-row.claimed .reward-text > span:first-child { text-decoration: line-through; }
.reward-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reward-text > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.claimed-tag { font-size: 0.68rem; color: var(--muted-2); }
.reward-row-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.type-toggle {
  font-size: 0.7rem; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); color: var(--muted);
}
.type-toggle.oneOff { color: var(--gold); border-color: rgba(255, 207, 77, 0.4); background: rgba(255, 207, 77, 0.08); }

.reward-add { margin-bottom: 6px; }
.reward-add-row { display: flex; gap: 8px; }
.reward-add-row .text-input { flex: 1; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.suggest-chip {
  font-size: 0.78rem; padding: 7px 12px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  transition: all 0.12s;
}
.suggest-chip:active { transform: scale(0.95); }
.suggest-chip:hover { color: var(--text); border-color: var(--violet); }

/* Winnings (won rewards you can tick off as used) */
.winnings-section { margin-top: 24px; }
.winnings-head { display: flex; align-items: center; gap: 10px; }
.winnings-badge {
  font-size: 0.72rem; font-weight: 800; color: #2a1440;
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  padding: 3px 10px; border-radius: 999px;
}
.enjoy { margin-top: 6px; margin-bottom: 8px; }
.enjoy-head { display: flex; align-items: center; gap: 10px; margin: 20px 2px 8px; }
.enjoy-head .section-title { margin: 0; }

.win-list { display: flex; flex-direction: column; gap: 8px; }
.win-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.win-check {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-2); background: transparent; color: transparent;
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 900; transition: all 0.15s;
}
.win-check:active { transform: scale(0.9); }
.win-check.on { background: var(--good); border-color: var(--good); color: #06231d; }
.win-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.win-date { font-size: 0.72rem; color: var(--muted-2); flex: none; }
.win-row.redeemed { opacity: 0.55; }
.win-row.redeemed .win-text { text-decoration: line-through; text-decoration-color: rgba(77, 224, 192, 0.6); color: var(--muted); }

.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hidden-file { display: none; }

/* ---------- Onboarding ---------- */

.onboarding { max-width: 520px; margin: 0 auto; min-height: 80vh; display: flex; flex-direction: column; }
.ob-progress { display: flex; gap: 8px; justify-content: center; padding: 8px 0 24px; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); transition: all 0.2s; }
.ob-dot.active { background: var(--gold); width: 22px; border-radius: 999px; }
.ob-dot.done { background: var(--violet); }
.ob-step { flex: 1; display: flex; flex-direction: column; }
.ob-hero { text-align: center; padding: 24px 0 12px; }
.ob-mark {
  font-size: 3.4rem; width: 92px; height: 92px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.ob-hero h1 { font-size: 2.4rem; letter-spacing: -0.03em; }
.ob-tag { color: var(--gold); font-weight: 700; margin-top: 4px; letter-spacing: 0.02em; }
.ob-version {
  margin-top: 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted-2);
}
.ob-loop { margin: 18px auto; max-width: 400px; display: flex; flex-direction: column; gap: 12px; }
.ob-loop p { color: var(--muted); font-size: 1rem; line-height: 1.55; }
.ob-loop strong { color: var(--text); }
.ob-fine { font-size: 0.82rem !important; color: var(--muted-2) !important; }
.ob-h { font-size: 1.6rem; margin-bottom: 6px; }
.ob-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; line-height: 1.5; }
.ob-actions { margin-top: auto; padding-top: 24px; display: flex; gap: 10px; }
.ob-actions .btn { flex: 1; }
.ob-tier { margin-bottom: 22px; }
.ob-tier .tier-head h3 { font-size: 1rem; }
.ob-tier-ok { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--muted-2); }
.ob-tier-ok.ok { color: var(--good); font-size: 1rem; }
.ob-tier .reward-add-row { margin-top: 10px; }

/* ---------- Wheel modal ---------- */

.wheel-overlay { align-items: center; padding: 20px; }
.wheel-overlay .modal.wheel-modal {
  border-radius: 24px; border-bottom: 1px solid var(--line-2);
  transform: scale(0.94); padding: 24px 20px calc(22px + var(--safe-bottom));
  text-align: center; max-height: none;
}
.wheel-overlay.show .modal.wheel-modal { transform: scale(1); }
.wheel-heading { font-size: 1.3rem; margin-bottom: 18px; }
.wheel-stage { position: relative; width: min(74vw, 300px); margin: 0 auto 22px; aspect-ratio: 1; }
.wheel-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.5)); }
.wheel-rotor { transform-origin: 100px 100px; }
.wheel-label {
  font-size: 8px; font-weight: 800; fill: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.5px; pointer-events: none;
}
.wheel-label-jackpot { fill: #3a2200; font-size: 7px; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid var(--gold); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.wheel-actions { display: flex; flex-direction: column; gap: 10px; }
.wheel-actions .spin-go { width: 100%; }
.wheel-actions .btn.ghost { width: 100%; }

.wheel-empty { padding: 8px 4px; }
.wheel-empty-icon { font-size: 2.6rem; }
.wheel-empty h3 { font-size: 1.15rem; margin: 8px 0; }
.wheel-empty p { color: var(--muted); font-size: 0.88rem; margin-bottom: 16px; line-height: 1.5; }
.wheel-empty-form { display: flex; flex-direction: column; gap: 10px; }

.wheel-result { padding: 10px 4px; animation: pop-in 0.4s cubic-bezier(0.2, 1.2, 0.4, 1); }
@keyframes pop-in { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-tier {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.result-emoji { font-size: 3.4rem; margin: 6px 0; }
.result-reward { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.wheel-result.jackpot .result-reward {
  background: linear-gradient(90deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.result-note { color: var(--gold); font-size: 0.82rem; margin-bottom: 4px; }
.result-hint { color: var(--muted); font-size: 0.78rem; margin-top: 8px; }
.wheel-result .btn { width: 100%; margin-top: 14px; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 80; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall 2.4s linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}

/* ---------- Toast ---------- */

.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--surface-3); color: var(--text); padding: 11px 18px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: all 0.28s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-good { border-color: rgba(77, 224, 192, 0.5); }
.toast-gold { border-color: rgba(255, 207, 77, 0.6); color: var(--gold); }
.toast-bad { border-color: rgba(255, 107, 138, 0.5); color: var(--bad); }

/* ---------- Install chip ---------- */

.install-chip {
  position: fixed; right: 14px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 40; border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 0.84rem;
  background: linear-gradient(180deg, #ffe08a, var(--gold)); color: #2a1440;
  box-shadow: 0 8px 22px rgba(255, 207, 77, 0.4);
}

/* ---------- Motion / a11y ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.05ms !important; }
}

@media (min-width: 480px) {
  .day-title, .tab-head h1 { font-size: 1.7rem; }
}
