:root {
  --lp-radius: 0.75rem;
  --lp-digit-bg: #0d6efd;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fb;
}

main {
  flex: 1 0 auto;
}

.card {
  border-radius: var(--lp-radius);
}

/* ---------- Tampilan angka hasil ---------- */
.result-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.result-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.9rem;
  padding: 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--lp-digit-bg);
  border-radius: 0.5rem;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.result-digit-lg {
  min-width: 3rem;
  height: 3.6rem;
  font-size: 1.75rem;
}

.result-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 1.05rem;
}

.result-number-sm {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.375rem;
  padding: 0.1rem 0.45rem;
}

.result-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.25em;
  font-weight: 700;
}

/* ---------- Sistem tema per pasaran ----------
   Warna diinjeksi lewat variabel --thm-primary / --thm-accent pada elemen
   ber-class .theme-scope. Nilai bawaan dipakai bila tema tidak diset.        */
.theme-scope {
  --thm-primary: #00398f;
  --thm-accent: #e2231a;
}

.draw-panel-flag {
  font-size: 1.35rem;
  line-height: 1;
  flex: 0 0 auto;
}

/* Motif latar panel, dipilih lewat atribut data-pattern */
.draw-panel[data-pattern='dots'] .draw-panel-head {
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.6px);
  background-size: 14px 14px;
}

.draw-panel[data-pattern='stripes'] .draw-panel-head {
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12) 0 10px,
    transparent 10px 20px
  );
}

.draw-panel[data-pattern='diagonal'] .draw-panel-head {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.12) 0 8px,
    transparent 8px 16px
  );
}

.draw-panel[data-pattern='waves'] .draw-panel-head {
  background-image: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.2), transparent 60%);
}

.draw-panel[data-pattern='grid'] .draw-panel-head {
  background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Aksen tema pada kartu pasaran di beranda */
.market-card.theme-scope {
  border-top: 4px solid var(--thm-primary) !important;
}

.market-card.theme-scope .result-digit {
  background: var(--thm-primary);
}

/* ---------- Panel hasil resmi (halaman pasaran) ---------- */
.draw-panel {
  border-radius: var(--lp-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgba(16, 24, 40, 0.1);
}

.draw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, var(--thm-primary) 0%, color-mix(in srgb, var(--thm-primary) 65%, #ffffff) 100%);
  color: #fff;
}

.draw-panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.draw-panel-title h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-panel-code {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--thm-accent);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.draw-panel-no {
  flex: 0 0 auto;
  text-align: right;
  line-height: 1.2;
}

.draw-panel-no span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.draw-panel-no strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.draw-panel-body {
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--thm-primary) 6%, #ffffff) 0%, #fff 65%);
}

.draw-panel-date {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.draw-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.draw-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--thm-primary);
  background: #fff;
  border: 3px solid var(--thm-primary);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.18), inset 0 -3px 0 rgba(15, 23, 42, 0.1);
}

.draw-ball-empty {
  color: #94a3b8;
  border-color: #cbd5e1;
  box-shadow: none;
}

.draw-panel-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.draw-panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid #e5e9f0;
  background: #f8fafc;
  font-size: 0.8rem;
  color: #64748b;
}

.draw-panel-foot a {
  color: var(--thm-primary);
  text-decoration: none;
  margin-left: auto;
}

.draw-panel-foot a:hover {
  text-decoration: underline;
}

/* Tabel riwayat */
.draw-history thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e5e9f0;
}

.draw-history tbody tr:nth-child(even) {
  background: #fafcff;
}

.draw-history td {
  vertical-align: middle;
  font-size: 0.9rem;
}

.draw-history-number {
  display: inline-block;
  min-width: 5.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--thm-primary);
  background: color-mix(in srgb, var(--thm-primary) 8%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--thm-primary) 22%, #ffffff);
}

@media (max-width: 575.98px) {
  .draw-ball {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    border-width: 2px;
  }

  .draw-panel-title h1 {
    font-size: 1rem;
  }

  .draw-history-number {
    min-width: 4.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
  }
}

/* ---------- Kartu pasaran publik ---------- */
.market-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.25rem rgba(16, 24, 40, 0.12) !important;
}

/* ---------- Empty state ---------- */
.empty-state-icon {
  font-size: 2.5rem;
  color: #b6c0d1;
}

/* ---------- Halaman login ---------- */
.auth-body {
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 60%);
}

.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: #0d6efd;
}

/* ---------- Halaman error ---------- */
.error-code {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: #0d6efd;
}

/* ---------- Loading state tombol ---------- */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

/* ---------- Responsif ---------- */
@media (max-width: 575.98px) {
  .result-digit {
    min-width: 2rem;
    height: 2.5rem;
    font-size: 1.15rem;
  }

  .result-digit-lg {
    min-width: 2.5rem;
    height: 3rem;
    font-size: 1.4rem;
  }
}
