:root {
  --sky: #0ea5e9;
  --sky-dark: #0369a1;
  --sky-soft: #e0f2fe;
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-soft: #ecfdf5;
  --gold: #eab308;
  --gold-soft: #fef9c3;
  --white: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #ef4444;
  --touch: 48px;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-border: rgba(255, 255, 255, 0.65);
}

* { box-sizing: border-box; }

.icon-sprite { display: none; }

.ico {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex-shrink: 0;
}

.ico.tiny {
  width: 0.95rem;
  height: 0.95rem;
}

body.app-shell {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  background: #0c4a6e;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: 200% 200%;
  background-position: 0% 50%;
  animation: bgDrift 28s ease-in-out infinite alternate;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(34, 197, 94, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(234, 179, 8, 0.15) 0%, transparent 45%),
    linear-gradient(165deg, #0c4a6e 0%, #075985 35%, #0f766e 100%);
}

@keyframes bgDrift {
  0% { background-position: 0% 40%; }
  100% { background-position: 100% 60%; }
}

body[data-weekday="monday"] .app-bg {
  background:
    radial-gradient(ellipse 100% 70% at 20% 0%, rgba(59, 130, 246, 0.35) 0%, transparent 50%),
    linear-gradient(165deg, #0c4a6e 0%, #1e3a8a 45%, #0f766e 100%);
}

body[data-weekday="tuesday"] .app-bg {
  background:
    radial-gradient(ellipse 90% 60% at 80% 10%, rgba(34, 197, 94, 0.3) 0%, transparent 50%),
    linear-gradient(165deg, #064e3b 0%, #075985 40%, #0c4a6e 100%);
}

body[data-weekday="wednesday"] .app-bg {
  background:
    radial-gradient(ellipse 100% 70% at 50% 0%, rgba(168, 85, 247, 0.25) 0%, transparent 55%),
    linear-gradient(165deg, #312e81 0%, #0c4a6e 45%, #134e4a 100%);
}

body[data-weekday="thursday"] .app-bg {
  background:
    radial-gradient(ellipse 90% 65% at 10% 20%, rgba(234, 179, 8, 0.28) 0%, transparent 50%),
    linear-gradient(165deg, #78350f 0%, #0c4a6e 42%, #115e59 100%);
}

body[data-weekday="friday"] .app-bg {
  background:
    radial-gradient(ellipse 100% 75% at 70% 0%, rgba(244, 63, 94, 0.22) 0%, transparent 50%),
    linear-gradient(165deg, #881337 0%, #0c4a6e 40%, #0f766e 100%);
}

body[data-weekday="saturday"] .app-bg {
  background:
    radial-gradient(ellipse 110% 80% at 50% -10%, rgba(250, 204, 21, 0.35) 0%, transparent 55%),
    linear-gradient(165deg, #713f12 0%, #0369a1 38%, #047857 100%);
}

body[data-weekday="sunday"] .app-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(148, 163, 184, 0.25) 0%, transparent 55%),
    linear-gradient(165deg, #334155 0%, #0c4a6e 50%, #164e63 100%);
  animation-duration: 40s;
}

@media (prefers-reduced-motion: reduce) {
  .app-bg {
    animation: none;
    background-position: 50% 50%;
  }
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.app-header,
.app-main,
.bottom-nav {
  position: relative;
  z-index: 1;
}

.app-header {
  position: relative;
  padding: 0.85rem 0.75rem 0.5rem;
  text-align: center;
}

.greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 0;
  padding: 0 0.25rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.account-auth-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.account-auth-group[hidden] {
  display: none;
}

.account-auth-sep {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
}

.account-auth-link {
  flex-shrink: 0;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: rgba(253, 224, 71, 0.95);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-family: inherit;
}

.account-auth-link:hover {
  color: #fff;
}

.account-auth-link[hidden] {
  display: none;
}

.brand-plate {
  position: relative;
  margin: 0 auto;
  max-width: 22rem;
  padding: 1.05rem 1.15rem 0.95rem;
  border-radius: 22px;
  background:
    linear-gradient(
      165deg,
      rgba(109, 40, 217, 0.28) 0%,
      rgba(76, 29, 149, 0.22) 42%,
      rgba(30, 27, 75, 0.18) 100%
    );
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(196, 181, 253, 0.22);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(253, 224, 71, 0.12) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.brand-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(253, 224, 71, 0.55) 0%,
    rgba(196, 181, 253, 0.28) 35%,
    rgba(147, 197, 253, 0.15) 70%,
    rgba(255, 255, 255, 0.08) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.brand-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(250, 204, 21, 0.14) 0%, transparent 62%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(109, 40, 217, 0.2) 0%, transparent 55%);
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

.brand-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin: 0;
  line-height: 1;
}

.brand-core {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  letter-spacing: -0.04em;
}

.brand-igame {
  font-size: clamp(1.85rem, 7.8vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 20px rgba(0, 0, 0, 0.38);
}

.brand-360 {
  font-size: clamp(1.85rem, 7.8vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(
    180deg,
    #fffbeb 0%,
    #fde047 28%,
    #facc15 52%,
    #eab308 78%,
    #ca8a04 100%
  );
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(234, 179, 8, 0.5));
  animation: goldShimmer 7s ease-in-out infinite alternate;
}

@keyframes goldShimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

.brand-daily-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #14532d;
  background: linear-gradient(135deg, #d9f99d 0%, #86efac 40%, #4ade80 100%);
  box-shadow:
    0 0 18px rgba(74, 222, 128, 0.35),
    0 4px 14px rgba(74, 222, 128, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(21, 128, 61, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.brand-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.6rem 0 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.brand-tagline::before,
.brand-tagline::after {
  content: "";
  flex: 1;
  max-width: 3rem;
  height: 1px;
  opacity: 0.9;
}

.brand-tagline::before {
  background: linear-gradient(90deg, transparent, rgba(253, 224, 71, 0.75));
}

.brand-tagline::after {
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.75), transparent);
}

@media (prefers-reduced-motion: reduce) {
  .brand-360 {
    animation: none;
    background-position: 50% center;
  }
}

.greeting-personal {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-align: left;
  min-width: 0;
}

.app-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #38bdf8, #0ea5e9);
  color: #fff;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}

.brand-icon .ico {
  width: 1.5rem;
  height: 1.5rem;
}

.app-header h1 {
  margin: 0;
}

.greeting-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.app-main {
  padding: 0.5rem 0.75rem 1rem;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 0.65rem;
  width: 100%;
}

#play-tab-panel {
  display: grid;
  gap: 0.65rem;
}

#play-tab-panel.is-loading #buy-section,
#play-tab-panel.is-loading #generate-section,
#play-tab-panel.is-loading #progress-card,
#play-tab-panel.is-loading #game-status-card {
  display: none !important;
}

#play-tab-panel.sales-closed-view #game-status-card {
  order: -1;
}

#play-tab-panel.sales-closed-view #progress-card.is-empty-closed {
  display: none !important;
}

.surface-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1rem;
  border: 1px solid var(--surface-border);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  max-width: 100%;
  overflow: hidden;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12);
  max-width: 100%;
  overflow: hidden;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-title-row h2 {
  margin: 0;
  font-size: 1.05rem;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--sky-soft);
  color: var(--sky-dark);
}

.card-icon.gem,
.qty-tile-icon.gem,
.summary-icon.gem,
.howto-step-icon.gem {
  background: #dcfce7;
  color: #15803d;
}

.summary-icon.gold,
.howto-step-icon.gold {
  background: #fef3c7;
  color: #b45309;
}

.summary-icon.sky {
  background: var(--sky-soft);
  color: var(--sky-dark);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero {
  padding: 1.25rem 1rem 0.75rem;
  text-align: center;
}

.hero h1 {
  margin: 0.25rem 0;
  font-size: 1.6rem;
  color: var(--sky-dark);
}

.tagline { margin: 0; color: var(--muted); font-size: 0.95rem; }

.surface-card h2,
.card h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.card-title-row + .muted,
.card-title-row ~ .muted:first-of-type {
  margin-top: 0;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); font-size: 0.9rem; margin: 0.35rem 0 0; }

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.limit-note {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
}

.slots-remaining {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.schedule-chip {
  display: inline-block;
  margin: 0.5rem auto 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
}

.quick-menu-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: var(--touch);
  line-height: 1.2;
}

.quick-menu-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.22);
}

.game-status-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.game-status-card[hidden] {
  display: none !important;
}

.game-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.game-status-body {
  flex: 1;
  min-width: 0;
}

.game-status-body strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: 0.2rem;
}

.game-status-body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.game-status-countdown {
  margin-top: 0.45rem !important;
  font-size: 1.15rem !important;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.game-status-card.tone-urgent {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
  color: #1e3a8a;
}

.game-status-card.tone-urgent .game-status-icon {
  background: #fff;
  color: #2563eb;
}

.game-status-card.tone-closed {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fbbf24;
  color: #78350f;
}

.game-status-card.tone-closed .game-status-icon {
  background: #fff;
  color: #d97706;
}

.game-status-card.tone-draw {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: #818cf8;
  color: #312e81;
}

.game-status-card.tone-draw .game-status-icon {
  background: #fff;
  color: #4f46e5;
}

.game-status-card.tone-pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
  color: #92400e;
}

.game-status-card.tone-pending .game-status-icon {
  background: #fff;
  color: #d97706;
}

.game-status-card.tone-ready {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
  color: #14532d;
}

.game-status-card.tone-ready .game-status-icon {
  background: #fff;
  color: #16a34a;
}

.game-status-card.tone-win {
  background: linear-gradient(180deg, #fef9c3 0%, #fde047 55%, #facc15 100%);
  border-color: #eab308;
  color: #713f12;
}

.game-status-card.tone-win .game-status-icon {
  background: rgba(255, 255, 255, 0.85);
  color: #b45309;
}

.game-status-card.tone-calm {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #86efac;
  color: #14532d;
}

.game-status-card.tone-calm .game-status-icon {
  background: #fff;
  color: #16a34a;
}

.game-status-card.tone-paused {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-color: #94a3b8;
  color: #334155;
}

.game-status-card.tone-paused .game-status-icon {
  background: #fff;
  color: #64748b;
}

.game-status-card.tone-open {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #38bdf8;
  color: #0c4a6e;
}

.game-status-card.tone-open .game-status-icon {
  background: #fff;
  color: #0284c7;
}

.play-reminder {
  margin: 0.35rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.84rem;
  line-height: 1.4;
}

.play-reminder[hidden] {
  display: none !important;
}

.day-complete-banner[hidden],
.sales-closed-banner[hidden],
.sales-reminder-banner[hidden],
.forfeit-banner[hidden],
#buy-section[hidden],
#generate-section[hidden] {
  display: none !important;
}

.day-complete-banner,
.sales-closed-banner,
.sales-reminder-banner,
.forfeit-banner,
.status-strip {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-align: center;
}

.status-strip.sales-closed,
.sales-closed-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  color: #78350f;
}

.day-complete-banner,
.status-strip.day-complete {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 2px solid #86efac;
  color: #14532d;
}

.sales-reminder-banner,
.status-strip.sales-reminder {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 2px solid #60a5fa;
  color: #1e3a8a;
}

.forfeit-banner,
.status-strip.forfeit {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 2px solid #f87171;
  color: #7f1d1d;
}

.sales-reminder-banner strong,
.forfeit-banner strong {
  font-size: 1.05rem;
}

.sales-reminder-banner span,
.forfeit-banner span {
  font-size: 0.9rem;
}

.sales-closed-banner strong,
.status-strip.sales-closed strong {
  font-size: 1.05rem;
}

.sales-closed-banner span,
.status-strip.sales-closed span {
  font-size: 0.9rem;
}

.day-complete-banner strong {
  font-size: 1.05rem;
}

.day-complete-banner span {
  font-size: 0.9rem;
}

.progress-complete {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #86efac;
}

.progress-complete #progress-fill {
  background: linear-gradient(90deg, var(--green), #eab308);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--green));
  transition: width 0.25s ease;
}

.qty-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
}

input[type="number"] {
  min-height: var(--touch);
  width: 100%;
  max-width: 100%;
  border: 2px solid #bae6fd;
  border-radius: 12px;
  padding: 0 0.75rem;
  font-size: 1.1rem;
}

.total { font-weight: 700; color: var(--sky-dark); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  width: 100%;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.5rem;
}

.btn.primary {
  background: linear-gradient(180deg, var(--sky), var(--sky-dark));
  color: white;
}

.btn-diamond {
  background: linear-gradient(180deg, var(--green), var(--green-dark));
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  border: 2px solid #cbd5e1;
  color: var(--muted);
}

.btn-small {
  min-height: 40px;
  width: auto;
  padding: 0 1rem;
  margin: 0;
  font-size: 0.85rem;
}

.status-banner {
  text-align: center;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0;
  border: 1px solid #bbf7d0;
}

.status-banner.ok {
  background: #dcfce7;
  color: #166534;
}

.status-banner.err {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.status-banner .payment-help-link {
  color: #1d4ed8;
  font-weight: 700;
  margin-left: 0.35rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.bottom-nav.nav-winners-hidden {
  grid-template-columns: repeat(3, 1fr);
}

#nav-winners[hidden] {
  display: none !important;
}

.nav-item {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
}

.nav-item.active { color: var(--sky-dark); font-weight: 700; }

.nav-ico-svg .ico {
  width: 1.1rem;
  height: 1.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Pending generate cards */
#entitlement-list {
  display: grid;
  gap: 0.75rem;
}

.pending-ticket-card {
  border-radius: 14px;
  padding: 0.9rem;
  border: 2px solid transparent;
  max-width: 100%;
  overflow: hidden;
}

.pending-classic {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #7dd3fc;
}

.pending-diamond {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #86efac;
}

.pending-promo {
  border-style: dashed;
}

.pending-founding-promo {
  border-color: #f0abfc;
  box-shadow: inset 0 0 0 1px rgba(217, 70, 239, 0.25);
}

.play-ticket-promo-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #a21caf;
}

.card-promo .play-ticket-type::after {
  content: '';
}

.card-founding-promo {
  outline: 1px dashed rgba(217, 70, 239, 0.45);
  outline-offset: 2px;
}

.pending-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pending-type {
  font-weight: 800;
  font-size: 1rem;
}

.pending-classic .pending-type { color: var(--sky-dark); }
.pending-diamond .pending-type { color: var(--green-dark); }

.pending-price {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.pending-status {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.pending-generate-btn {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

/* Lucky number picker — compact stepper (mobile-first) */
.lucky-picker {
  margin-top: 0.25rem;
  width: 100%;
  max-width: 100%;
}

.lucky-picker-label {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-dark);
}

.lucky-stepper {
  display: grid;
  grid-template-columns: var(--touch) 1fr var(--touch);
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
}

.lucky-step-btn {
  min-height: var(--touch);
  border: 2px solid #86efac;
  border-radius: 14px;
  background: white;
  color: var(--green-dark);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lucky-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lucky-step-btn:active:not(:disabled) {
  background: #ecfdf5;
  transform: scale(0.97);
}

.lucky-stepper-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  border-radius: 14px;
  border: 2px solid #86efac;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lucky-picker.has-value .lucky-stepper-display {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fff 0%, #fef9c3 100%);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.15);
}

.lucky-stepper-input {
  width: 100%;
  min-height: var(--touch);
  border: none;
  background: transparent;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #a16207;
  padding: 0;
  -moz-appearance: textfield;
}

.lucky-stepper-input:focus {
  outline: none;
}

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

.lucky-stepper-input::placeholder {
  color: #cbd5e1;
  font-weight: 600;
}

.lucky-picker-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Wallet ticket cards */
#ticket-list {
  display: grid;
  gap: 0.75rem;
}

.play-ticket-card {
  border-radius: 14px;
  padding: 1rem;
  border: 2px solid transparent;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.play-ticket-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}

.card-classic {
  background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}

.card-classic::before { background: var(--sky); }

.card-diamond {
  background: linear-gradient(135deg, #ecfdf5 0%, #bbf7d0 55%, #fef9c3 100%);
  border-color: #86efac;
}

.card-diamond::before { background: var(--green); }

.play-ticket-card.state-lost::before {
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 55%, #dc2626 100%);
  width: 7px;
  box-shadow: 2px 0 10px rgba(239, 68, 68, 0.28);
}

.play-ticket-card.state-won::before {
  background: linear-gradient(180deg, #fde047 0%, #eab308 55%, #ca8a04 100%);
  width: 7px;
  box-shadow: 2px 0 10px rgba(234, 179, 8, 0.35);
}

.play-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.play-ticket-type {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-classic .play-ticket-type { color: var(--sky-dark); }
.card-diamond .play-ticket-type { color: var(--green-dark); }

.play-ticket-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  white-space: nowrap;
}

.play-ticket-code {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
  word-break: break-all;
}

.card-classic .play-ticket-code { color: #1e3a8a; }
.card-diamond .play-ticket-code { color: #14532d; }

.play-ticket-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.lucky-number-badge {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.2);
}

.lucky-number-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.lucky-number-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #a16207;
  min-width: 2ch;
  text-align: center;
}

.lucky-complete-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(22, 163, 74, 0.35);
}

/* Result states */
.state-won {
  box-shadow: 0 0 0 2px #fde047, 0 8px 24px rgba(234, 179, 8, 0.25);
}

.prize-won-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 0.5rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%);
  border: 2px solid #eab308;
}

.prize-won-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #854d0e;
}

.prize-won-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: #713f12;
}

.lucky-draw-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.draw-results-banner {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #dcfce7;
  color: #14532d;
  font-size: 0.88rem;
  line-height: 1.4;
}

.draw-results-banner.pending {
  background: #fef3c7;
  color: #92400e;
}

.draw-results-hero {
  margin: 0 0 1rem;
  padding: 1.1rem 1rem;
  border-radius: 14px;
  text-align: center;
  line-height: 1.45;
}

.draw-results-hero.won {
  background: linear-gradient(180deg, #fef9c3 0%, #fde047 55%, #facc15 100%);
  border: 2px solid #eab308;
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.25);
}

.draw-results-hero.lost {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.draw-results-hero.pending {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.draw-hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #854d0e;
}

.draw-hero-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #713f12;
}

.draw-results-hero.lost .draw-hero-title,
.draw-results-hero.lost .draw-hero-kicker {
  color: #14532d;
}

.draw-hero-prize {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: #713f12;
}

.draw-hero-meta {
  margin: 0;
  font-size: 0.82rem;
  color: #854d0e;
}

.draw-results-hero.lost .draw-hero-meta {
  color: #166534;
}

.state-won .play-ticket-badge {
  background: var(--gold);
  color: #713f12;
}

.state-lost .play-ticket-badge {
  background: rgba(254, 226, 226, 0.95);
  color: #991b1b;
}

.state-lost {
  opacity: 1;
}

.state-locked .play-ticket-badge {
  background: #fef3c7;
  color: #92400e;
}

/* —— Personalized header & dashboard —— */
.hero-personal {
  padding-bottom: 0.25rem;
}

.hero-personal h1 {
  font-size: 1.75rem;
  background: linear-gradient(135deg, #0284c7 0%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.schedule-chip {
  display: inline-block;
  margin: 0.5rem auto 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

/* —— Collapsible panels (prizes / how to play) —— */
.expand-panel {
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.expand-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.expand-summary::-webkit-details-marker { display: none; }

.summary-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.summary-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  text-align: left;
}

.summary-text strong {
  font-size: 0.95rem;
  color: var(--text);
}

.summary-text small {
  font-size: 0.75rem;
  color: var(--muted);
}

.summary-chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.summary-chevron .ico {
  width: 1.1rem;
  height: 1.1rem;
}

.expand-panel[open] .summary-chevron {
  transform: rotate(180deg);
}

.expand-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.prize-board-inner,
.winners-inner {
  padding-top: 0.85rem;
}

.winners-inner {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e2e8f0;
}

.section-head.compact {
  margin-bottom: 0.5rem;
}

.section-head.compact h3 {
  margin: 0;
  font-size: 0.95rem;
}

.howto-body {
  padding-top: 0.75rem;
}

.howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.howto-steps li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.howto-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--sky-soft);
  color: var(--sky-dark);
  flex-shrink: 0;
}

.howto-steps strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.howto-steps p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.ticket-journey {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: 12px;
  background: var(--sky-soft);
  border: 1px solid rgba(3, 105, 161, 0.12);
}

.ticket-journey h3 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--sky-dark);
}

.ticket-journey p {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
}

.ticket-journey p:last-child {
  margin-bottom: 0;
}

.ticket-journey-close {
  font-weight: 700;
  color: var(--sky-dark);
}

.diamond-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.diamond-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.climb-badge {
  display: inline-block;
  margin: 0.35rem 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.55);
  color: #92400e;
}

.climb-badge.fresh {
  background: rgba(255, 255, 255, 0.6);
  color: #166534;
}

.star-pot-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.star-pot-icon .ico {
  width: 1.75rem;
  height: 1.75rem;
  color: #b45309;
}

.prize-tier-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.prize-tier-icon {
  color: inherit;
  opacity: 0.85;
}

.prize-tier-icon .ico {
  width: 1rem;
  height: 1rem;
}

.prize-tier-diamond {
  font-size: 0.68rem;
  font-weight: 600;
  color: #15803d;
  margin-top: 0.1rem;
}

.bottom-nav .nav-ico {
  display: block;
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

/* —— Personalized header (legacy) —— */
.hero-personal {
  padding-bottom: 0.25rem;
}
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.pill-date,
.pill-today {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky-dark);
  white-space: nowrap;
}

.pill-today {
  background: #dcfce7;
  color: #166534;
}

.prize-board-card {
  background: linear-gradient(160deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
}

.star-pot-hero {
  margin-bottom: 0.85rem;
}

.star-pot-glow {
  text-align: center;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #fef9c3 0%, #fde68a 50%, #fcd34d 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.2);
}

.star-pot-glow.is-tonight {
  animation: starPulse 2.5s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 12px 36px rgba(245, 158, 11, 0.45); }
}

.star-pot-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
}

.star-pot-value {
  margin: 0.15rem 0;
  font-size: 2rem;
  font-weight: 900;
  color: #78350f;
  line-height: 1.1;
}

.star-pot-note {
  margin: 0;
  font-size: 0.82rem;
  color: #92400e;
}

.prize-tier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.prize-tier-card {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 0.15rem;
}

.prize-tier-card.is-highlight {
  border-color: #86efac;
  background: #f0fdf4;
}

.prize-tier-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prize-tier-amount {
  font-size: 1.05rem;
  font-weight: 800;
}

.prize-tier-count {
  font-size: 0.72rem;
  color: var(--muted);
}

.prize-tier-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #166534;
}

.tier-king .prize-tier-name { color: #1d4ed8; }
.tier-queen .prize-tier-name { color: #7c3aed; }
.tier-community .prize-tier-name { color: #0d9488; }
.tier-smile .prize-tier-name { color: #ea580c; }

.winners-card {
  border: 1px solid #e2e8f0;
}

.winners-meta {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.winners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.winners-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.winners-tier {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
}

.winners-item.tier-star .winners-tier { background: #fef3c7; color: #92400e; }
.winners-item.tier-king .winners-tier { background: #dbeafe; color: #1e40af; }
.winners-item.tier-queen .winners-tier { background: #ede9fe; color: #5b21b6; }
.winners-item.tier-community .winners-tier { background: #ccfbf1; color: #0f766e; }
.winners-item.tier-smile .winners-tier { background: #ffedd5; color: #c2410c; }

.winners-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.winners-amount {
  font-weight: 800;
  font-size: 0.88rem;
  color: #166534;
}

.winners-empty {
  padding: 0.5rem 0;
}

.wallet-today-card {
  border: 2px solid #7dd3fc;
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.15);
}

.action-card {
  border: 1px solid #e2e8f0;
}

.qty-tile {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
}

.qty-classic { border-color: #93c5fd; }
.qty-diamond { border-color: #86efac; background: #f0fdf4; }

.qty-tile-label {
  font-weight: 800;
  font-size: 0.85rem;
}

.qty-tile-price {
  font-size: 0.78rem;
  color: var(--muted);
}

.qty-tile input {
  width: 100%;
  margin-top: 0.25rem;
}

.history-body {
  padding-top: 0.25rem;
}

.history-intro {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.monthly-wins-summary {
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  color: #713f12;
}

.monthly-wins-summary.empty {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--muted);
}

.monthly-wins-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.monthly-wins-total {
  font-size: 0.82rem;
  font-weight: 700;
}

.monthly-wins-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.history-groups {
  display: grid;
  gap: 0.5rem;
}

.history-group {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.history-group-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #f1f5f9;
  cursor: pointer;
  list-style: none;
}

.history-group-summary::-webkit-details-marker {
  display: none;
}

.history-group-summary-main strong {
  display: block;
  font-size: 0.92rem;
}

.history-group[open] .history-group-summary {
  border-bottom: 1px solid #e2e8f0;
}

.history-date-raw {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}

.history-group-state {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.history-ticket-rows {
  display: grid;
}

.history-ticket-row {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.history-ticket-row:last-child {
  border-bottom: none;
}

.history-row-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-row-type {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sky-dark);
}

.history-row-code {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.history-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.history-row-prize {
  font-weight: 700;
  color: #166534;
}

.history-row-note {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

.history-ticket-row.state-lost {
  border-left: 4px solid #ef4444;
  padding-left: calc(0.75rem - 4px);
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.35) 0%, transparent 55%);
}

.history-ticket-row.state-lost .history-row-status {
  color: #b91c1c;
}

.card-icon.gold {
  background: #fef3c7;
  color: #b45309;
}

.winners-tab-panel {
  display: grid;
  gap: 0.65rem;
}

.winners-board-card {
  padding: 1rem 0.85rem;
}

.winners-board-head {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.winners-night-select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
}

.winners-night-select:disabled,
.winners-night-select.is-waiting {
  color: #475569;
  background: #f8fafc;
  cursor: default;
  opacity: 1;
}

.winners-board-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.winners-stat {
  text-align: center;
  padding: 0.55rem 0.35rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.winners-stat strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.winners-stat span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.winners-stat.trust {
  display: flex;
  align-items: center;
  justify-content: center;
}

.winners-board-meta {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.winners-board-meta.is-only-note {
  margin-bottom: 0;
}

.winners-board-list {
  display: grid;
  gap: 0.45rem;
}

.winners-board-list.is-unavailable,
.winners-board-list[hidden] {
  display: none;
}

.winners-board-empty {
  margin: 0;
  padding: 1rem 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.winners-board-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.9fr 0.85fr 0.85fr;
  gap: 0.35rem;
  align-items: center;
  padding: 0.6rem 0.55rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
}

.winners-board-headrow {
  background: #eef2ff;
  border-color: #c7d2fe;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding: 0.45rem 0.55rem;
}

.wb-name {
  font-weight: 700;
}

.wb-ticket {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.wb-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 700;
  font-size: 0.72rem;
}

.wb-amount {
  font-weight: 800;
}

.wb-paid {
  display: flex;
  justify-content: flex-end;
}

.paid-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.paid-badge.paid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.paid-badge.pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.paid-badge.failed {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.paid-dot {
  font-weight: 900;
}

.prize-won-badge .paid-badge {
  margin-top: 0.35rem;
}

.winners-trust-note {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
  color: rgba(248, 250, 252, 0.9);
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}

@media (max-width: 420px) {
  .winners-board-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "ticket ticket"
      "tier amount"
      "paid paid";
  }

  .winners-board-headrow {
    display: none;
  }

  .wb-name { grid-area: name; }
  .wb-ticket { grid-area: ticket; }
  .wb-tier { grid-area: tier; }
  .wb-amount { grid-area: amount; text-align: right; }
  .wb-paid { grid-area: paid; justify-content: flex-start; }
}

@media (max-width: 360px) {
  .card {
    padding: 0.85rem;
  }

  .lucky-stepper-input {
    font-size: 1.75rem;
  }

  .play-ticket-code {
    font-size: 1.15rem;
  }

  .pending-generate-btn {
    font-size: 0.9rem;
  }
}

.result-board-lead {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.result-board-date {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.result-board-list {
  display: grid;
  gap: 0.5rem;
}

.result-board-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.result-board-cat {
  font-weight: 700;
  font-size: 0.85rem;
}

.result-board-code {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.result-board-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-board-row.is-won {
  border-color: #86efac;
  background: #f0fdf4;
}

.result-board-row.is-won .result-board-status {
  color: #15803d;
}

.result-board-row.is-none {
  border-color: #fecaca;
  background: #fef2f2;
}

.result-board-row.is-none .result-board-status {
  color: #b91c1c;
}

.result-board-note {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
}
