:root {
  --bg-deep: #0A0E17;
  --bg-surface: #131824;
  --bg-card: #1A2030;
  --bg-card-elevated: #222A3D;
  --border-subtle: #2A3347;
  --border-accent: #3B4661;
  --gold: #F5B82E;
  --gold-dim: #B88B1A;
  --green: #00E676;
  --green-dim: #00A050;
  --red: #FF4D6D;
  --purple: #8B5CF6;
  --purple-dim: #6036C8;
  --text: #FFFFFF;
  --text-secondary: #A0A8BC;
  --text-muted: #5D6678;
  --radius: 16px;
  --radius-lg: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  overscroll-behavior-y: none;
}

.app {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

/* === Casino decorations === */

.decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.decor-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.decor-glow-gold {
  width: 500px;
  height: 500px;
  top: -220px;
  left: -120px;
  background: radial-gradient(circle, rgba(245,184,46,0.22) 0%, transparent 70%);
}

.decor-glow-purple {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -60px;
  background: radial-gradient(circle, rgba(139,92,246,0.28) 0%, transparent 70%);
}

.decor-icon {
  position: absolute;
  opacity: 0.5;
  color: #3A4562;
}

.decor-spade { width: 110px; height: 110px; top: 160px; right: -20px; transform: rotate(-15deg); color: #3A4562; opacity: 0.55; }
.decor-heart { width: 80px; height: 80px; top: 45%; left: -15px; transform: rotate(20deg); color: var(--red); opacity: 0.18; }
.decor-club  { width: 90px; height: 90px; bottom: 120px; right: -10px; transform: rotate(25deg); color: #3A4562; opacity: 0.55; }
.decor-diamond { width: 62px; height: 62px; top: 240px; left: -12px; transform: rotate(-10deg); color: var(--green); opacity: 0.22; }
.decor-dice { width: 70px; height: 70px; bottom: 40px; left: -20px; transform: rotate(-20deg); color: var(--gold); opacity: 0.35; }
.decor-coin { width: 56px; height: 56px; top: 380px; right: 15px; transform: rotate(10deg); color: var(--gold); opacity: 0.35; }

/* Decor variants per screen mood */
body[data-mood="success"] .decor-glow-gold,
body[data-mood="alldone"] .decor-glow-gold {
  background: radial-gradient(circle, rgba(0,230,118,0.25) 0%, transparent 70%);
}

/* === Layout === */

.header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
}

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

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  color: var(--bg-deep);
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
  color: var(--text);
}

.brand-sep {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-muted);
}

.brand-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 100px;
  background: var(--bg-card);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(0,230,118,0.6);
}

.status-text {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
}

.nav-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  gap: 10px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.back-btn:active {
  transform: scale(0.95);
  background: var(--bg-card-elevated);
}

.step-badge {
  padding: 6px 10px;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.progress {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 0 4px;
}

.progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 100px;
  background: var(--border-subtle);
  transition: background 0.25s;
}

.progress-dot.active {
  background: var(--gold);
}

/* === Screens === */

.screen {
  position: relative;
  z-index: 1;
  display: none;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  animation: fadeIn 0.22s ease;
}

.screen.active {
  display: flex;
}

.screen.center {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 8px;
}

.center-text {
  text-align: center;
  max-width: 320px;
  line-height: 1.55;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.spacer { flex: 1; min-height: 8px; }

/* === Typography === */

h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

p {
  margin: 0;
  line-height: 1.5;
}

.muted { color: var(--text-secondary); }

.title-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 4px 0;
}

.title-block.with-emoji {
  padding-top: 32px;
}

.emoji-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  box-shadow: 0 12px 32px rgba(245,184,46,0.25);
}

/* === Bonus cards === */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bonus-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s, border-color 0.15s, background 0.15s;
}

.bonus-card:active {
  transform: scale(0.985);
  background: var(--bg-card-elevated);
  border-color: var(--border-accent);
}

.bonus-card:disabled,
.bonus-card.is-done,
.bonus-card.is-refused {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.55;
}

.bonus-card.is-done .bonus-icon,
.bonus-card.is-refused .bonus-icon {
  filter: grayscale(1);
  box-shadow: none;
}

.bonus-card.is-done .bonus-title,
.bonus-card.is-refused .bonus-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.bonus-card.is-done .bonus-chevron,
.bonus-card.is-refused .bonus-chevron {
  opacity: 0;
}

.bonus-badge-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,230,118,0.18);
  color: var(--green);
}

.bonus-badge-refused {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,77,109,0.18);
  color: var(--red);
}

.bonus-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bonus-icon-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  box-shadow: 0 8px 20px rgba(245,184,46,0.25);
}

.bonus-icon-green {
  background: linear-gradient(135deg, var(--green), var(--green-dim));
  color: var(--bg-deep);
  box-shadow: 0 8px 20px rgba(0,230,118,0.25);
}

.bonus-icon-purple {
  background: linear-gradient(135deg, var(--purple), var(--purple-dim));
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(139,92,246,0.3);
}

.bonus-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bonus-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bonus-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.bonus-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.bonus-badge {
  padding: 3px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.bonus-badge-gold {
  background: rgba(245,184,46,0.18);
  color: var(--gold);
}

.bonus-badge-green {
  background: rgba(0,230,118,0.18);
  color: var(--green);
}

.bonus-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* === Buttons === */

.buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary,
.btn-ghost,
.btn-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform 0.06s, filter 0.15s, background 0.15s;
  width: 100%;
}

.btn-primary:active,
.btn-ghost:active {
  transform: scale(0.985);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #E09A0A 100%);
  color: var(--bg-deep);
  box-shadow: 0 12px 28px rgba(245,184,46,0.25);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  font-weight: 600;
  padding: 16px 18px;
}

.btn-ghost-sm {
  padding: 14px 16px;
  font-size: 14px;
}

.btn-ghost:hover {
  background: var(--bg-card-elevated);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 14px 16px;
  box-shadow: none;
}

/* === Inputs === */

.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(245,184,46,0.1);
  transition: box-shadow 0.2s;
}

.input-wrap:focus-within {
  box-shadow: 0 0 0 6px rgba(245,184,46,0.18);
}

.input-wrap-large input {
  font-size: 22px;
  font-weight: 600;
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  padding: 0;
  -moz-appearance: textfield;
}

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.input-icon {
  color: var(--gold);
  flex-shrink: 0;
}

.input-prefix {
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
}

.input-suffix {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.helper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

/* === Chips === */

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  flex: 1;
  padding: 10px 14px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.chip:active { transform: scale(0.95); }

.chip.active {
  background: rgba(245,184,46,0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

/* === Warn box === */

.warn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(245,184,46,0.12);
  border: 1px solid rgba(245,184,46,0.35);
}

.warn-icon { color: var(--gold); flex-shrink: 0; }

.warn-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.warn-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.warn-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.warn-success {
  background: rgba(0,230,118,0.12);
  border: 1px solid rgba(0,230,118,0.35);
}

.warn-icon-green { color: var(--green); flex-shrink: 0; }

.warn-title-green { color: var(--green); }

/* === Icon halos (status screens) === */

.icon-halo {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(245,184,46,0.1);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.icon-halo.icon-halo-triple {
  box-shadow:
    0 0 0 18px rgba(0,230,118,0.08),
    0 0 0 32px rgba(0,230,118,0.04);
}

.icon-halo-gold { background: rgba(245,184,46,0.15); }
.icon-halo-green { background: rgba(0,230,118,0.15); }
.icon-halo-red { background: rgba(255,77,109,0.15); }

.icon-halo-core {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 40px rgba(245,184,46,0.3);
}

.icon-halo-core-green {
  background: linear-gradient(135deg, var(--green), var(--green-dim));
  color: var(--bg-deep);
  box-shadow: 0 16px 40px rgba(0,230,118,0.3);
}

.icon-halo-red .icon-halo-core {
  background: linear-gradient(135deg, var(--red), #CC2E4A);
  color: #FFFFFF;
  box-shadow: 0 16px 40px rgba(255,77,109,0.3);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.shake {
  animation: shake 0.3s ease;
}

.input-wrap:has(.shake) {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255,77,109,0.18);
}

/* === Loader (spinning ring) === */

.loader-ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
}

.loader-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid rgba(245,184,46,0.15);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

.loader-core {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(245,184,46,0.35);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dots {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.2s ease infinite;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { opacity: 0.2; }
  40%      { opacity: 1; }
}

/* === Recap card === */

.recap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
}

.recap-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-card-elevated);
  display: grid;
  place-items: center;
  color: var(--green);
  flex-shrink: 0;
}

.recap-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.recap-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.recap-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.recap-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.recap-wager {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.recap-card {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recap-row .recap-label {
  font-size: 13px;
  color: var(--text-muted);
}

.recap-row .recap-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.recap-row .recap-value-gold {
  color: var(--gold);
}

.recap-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

/* === SVG icon sizing === */

svg[class^="icon-"],
svg[class*=" icon-"] {
  flex-shrink: 0;
  display: block;
}

.icon-12 { width: 12px; height: 12px; }
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-22 { width: 22px; height: 22px; }
.icon-24 { width: 24px; height: 24px; }
.icon-28 { width: 28px; height: 28px; }
.icon-40 { width: 44px; height: 44px; }
.icon-48 { width: 48px; height: 48px; }
