/* ============================================================
   JACKPOT — jackpot.jclabs.dev
   Midnight casino felt + champagne gold, art-deco details.
   Type: Fraunces (display) · Instrument Sans (UI) · Fragment Mono (data)
   ============================================================ */

:root {
  --felt-950: #03100C;
  --felt-900: #06201A;
  --felt-850: #082822;
  --felt-800: #0B312A;
  --felt-700: #11473C;

  --gold-100: #F7ECCB;
  --gold-200: #F0DCA8;
  --gold-300: #E6C887;
  --gold-400: #DDBC72;
  --gold-500: #C9A050;
  --gold-600: #A87F33;

  --ivory: #F4EEDF;
  --muted: #93AC9F;
  --faint: #5E7A6D;

  --red-400: #E25A33;
  --red-500: #C8401F;
  --red-700: #7E2410;

  --line: rgba(221, 188, 114, 0.18);
  --line-soft: rgba(221, 188, 114, 0.09);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-mono: "Fragment Mono", "Menlo", monospace;

  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-card: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 800px at 75% -10%, rgba(17, 71, 60, 0.55), transparent 60%),
    radial-gradient(900px 700px at 8% 110%, rgba(17, 71, 60, 0.4), transparent 55%),
    var(--felt-950);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* film grain over everything, very quiet */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  letter-spacing: 0.01em;
  margin: 0;
}

a { color: var(--gold-300); text-decoration: none; }
a:hover { color: var(--gold-100); }

::selection { background: var(--gold-500); color: var(--felt-950); }

/* ---------- shared atoms ---------- */

.eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.hairline {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
  margin: 0;
}

label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.15rem 0 0.45rem;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font: 400 1rem var(--font-body);
  color: var(--ivory);
  background: rgba(3, 16, 12, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus, select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 160, 80, 0.18);
}

input::placeholder { color: var(--faint); }

select { appearance: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--felt-950);
  background: linear-gradient(170deg, var(--gold-200), var(--gold-500) 70%, var(--gold-600));
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s var(--ease-pop), box-shadow 0.18s;
  box-shadow: 0 6px 18px -8px rgba(201, 160, 80, 0.6);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(221, 188, 114, 0.55);
}

.btn:active { transform: translateY(0) scale(0.99); }

.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn.block { width: 100%; }

.btn.ghost {
  background: transparent;
  color: var(--gold-300);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--gold-500);
  color: var(--gold-100);
  background: rgba(221, 188, 114, 0.06);
}

.btn.danger {
  background: transparent;
  color: var(--red-400);
  border: 1px solid rgba(200, 64, 31, 0.4);
  box-shadow: none;
}

.btn.danger:hover { background: rgba(200, 64, 31, 0.12); }

.btn.small { padding: 0.45rem 0.9rem; font-size: 0.66rem; letter-spacing: 0.18em; }

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--faint);
}

.form-error {
  min-height: 1.2rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--red-400);
  text-align: center;
}

.shake { animation: shake 0.4s; }

@keyframes shake {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  90% { transform: translateX(2px); }
}

/* staggered entrance used on every page */
.rise {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   SIGN-IN / SETUP — split brand panel + form
   ============================================================ */

.split {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.2rem 3.4rem;
  background: linear-gradient(200deg, var(--felt-800), var(--felt-900) 55%, var(--felt-950));
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}

/* art-deco sunburst, drawn with a repeating conic gradient */
.brand-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -42vh;
  width: 130vh;
  height: 130vh;
  transform: translateX(-50%);
  background: repeating-conic-gradient(
    from -90deg,
    rgba(221, 188, 114, 0.10) 0deg 1.1deg,
    transparent 1.1deg 9deg
  );
  -webkit-mask-image: radial-gradient(closest-side, black 30%, transparent 72%);
  mask-image: radial-gradient(closest-side, black 30%, transparent 72%);
  pointer-events: none;
}

.lockup { position: relative; }

.lockup .mark { width: 72px; height: 72px; }

.wordmark {
  font-size: clamp(3.2rem, 6vw, 4.6rem);
  font-weight: 620;
  font-variation-settings: "opsz" 144;
  line-height: 1.04;
  margin-top: 1.4rem;
  background: linear-gradient(165deg, var(--gold-100), var(--gold-400) 60%, var(--gold-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.9rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 420;
  font-size: 1.25rem;
  color: var(--muted);
}

.brand-points {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.brand-points li {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--muted);
}

.brand-points li::before {
  content: "✦";
  color: var(--gold-500);
  font-size: 0.75rem;
}

.brand-foot {
  position: relative;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.card {
  width: min(420px, 100%);
  padding: 2.6rem 2.4rem 2.2rem;
  background: linear-gradient(180deg, rgba(11, 49, 42, 0.45), rgba(6, 32, 26, 0.45));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
}

.card > h2 {
  font-size: 1.7rem;
  margin-bottom: 0.2rem;
}

.card .sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* six-box OTP input */
.otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.otp-row input {
  padding: 0;
  height: 3.1rem;
  text-align: center;
  font: 400 1.35rem var(--font-mono);
  color: var(--gold-200);
  caret-color: var(--gold-400);
}

.form-actions { margin-top: 1.7rem; }

/* ============================================================
   APP CHROME — top nav on signed-in pages
   ============================================================ */

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem clamp(1.2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(3, 16, 12, 0.5);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav .mark { width: 34px; height: 34px; }

.nav-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gold-300);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  margin-left: 1.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-links a { color: var(--muted); padding-bottom: 2px; }
.nav-links a:hover { color: var(--ivory); }
.nav-links a.active {
  color: var(--gold-300);
  border-bottom: 1px solid var(--gold-500);
}

.nav-spacer { flex: 1; }

.nav-user {
  font: 400 0.8rem var(--font-mono);
  color: var(--muted);
}

main.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.2rem, 4vw, 2rem) 4rem;
}

/* ============================================================
   PREDICTION PAGE
   ============================================================ */

.predict-hero { text-align: center; }

.predict-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-variation-settings: "opsz" 144;
  margin-top: 0.5rem;
}

.draw-date {
  margin: 0.6rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
}

.balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(0.7rem, 2.4vw, 1.3rem);
  margin: 3rem 0 1rem;
}

.ball {
  width: clamp(64px, 11vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 400 clamp(1.5rem, 3.4vw, 2.1rem) var(--font-mono);
  color: var(--felt-950);
  background: radial-gradient(circle at 32% 28%, #FFFDF4, #EAE0C6 55%, #B7A987);
  box-shadow:
    inset -6px -10px 18px rgba(80, 65, 30, 0.35),
    inset 4px 6px 10px rgba(255, 255, 255, 0.7),
    0 18px 30px -14px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform: scale(0.4);
}

.ball.shown {
  animation: ballPop 0.55s var(--ease-pop) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes ballPop {
  from { opacity: 0; transform: scale(0.4) translateY(20px); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}

.ball.power {
  color: var(--ivory);
  background: radial-gradient(circle at 32% 28%, #F08A60, var(--red-500) 58%, var(--red-700));
  box-shadow:
    inset -6px -10px 18px rgba(60, 10, 0, 0.5),
    inset 4px 6px 10px rgba(255, 200, 170, 0.45),
    0 18px 38px -14px rgba(200, 64, 31, 0.55);
}

.balls .plus {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--faint);
}

.predict-actions {
  display: flex;
  justify-content: center;
  margin-top: 2.4rem;
}

.disclaimer {
  margin-top: 3.2rem;
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
  font-style: italic;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.page-head h1 { font-size: 2.1rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 2.6rem;
}

.stat {
  padding: 1.3rem 1.4rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(11, 49, 42, 0.35), rgba(6, 32, 26, 0.2));
}

.stat .num {
  display: block;
  font: 400 2.2rem var(--font-mono);
  color: var(--gold-200);
  line-height: 1.1;
}

.stat .lbl {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat.bad .num { color: var(--red-400); }

section.panel { margin-bottom: 3rem; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-head h2 { font-size: 1.35rem; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  background: rgba(3, 16, 12, 0.35);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  padding: 0.75rem 1.1rem;
  text-align: left;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(221, 188, 114, 0.04); }

td.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

.pill {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 99px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pill.ok { color: #9CD3A8; background: rgba(80, 160, 100, 0.14); border: 1px solid rgba(120, 200, 140, 0.25); }
.pill.fail { color: var(--red-400); background: rgba(200, 64, 31, 0.12); border: 1px solid rgba(200, 64, 31, 0.3); }
.pill.gold { color: var(--gold-300); background: rgba(221, 188, 114, 0.1); border: 1px solid var(--line); }
.pill.dim { color: var(--muted); background: rgba(147, 172, 159, 0.08); border: 1px solid rgba(147, 172, 159, 0.2); }

.row-actions { display: flex; gap: 0.45rem; }

.empty {
  padding: 2.2rem;
  text-align: center;
  color: var(--faint);
  font-style: italic;
}

/* ============================================================
   DIALOGS (create user / enrollment QR)
   ============================================================ */

dialog {
  width: min(440px, calc(100vw - 2rem));
  padding: 2rem 2rem 1.7rem;
  color: var(--ivory);
  background: linear-gradient(180deg, var(--felt-850), var(--felt-900));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

dialog::backdrop {
  background: rgba(2, 10, 8, 0.75);
  backdrop-filter: blur(3px);
}

dialog h2 { font-size: 1.45rem; margin-bottom: 0.3rem; }

.qr-box {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  margin: 1.3rem 0;
  text-align: center;
}

.qr-box img {
  width: 196px;
  height: 196px;
  border-radius: 10px;
  border: 6px solid var(--ivory);
  background: var(--ivory);
}

.secret {
  font: 400 0.78rem var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--gold-300);
  word-break: break-all;
  background: rgba(3, 16, 12, 0.55);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

/* setup wizard steps */
.step { display: none; }
.step.active { display: block; }

.steps-dots {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.steps-dots span {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

.steps-dots span.on { background: var(--gold-500); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .brand-panel {
    min-height: 38vh;
    padding: 2.4rem 1.8rem;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .brand-points { display: none; }
  .nav-links { margin-left: 0.3rem; gap: 0.9rem; }
  .nav-user { display: none; }
}
