/* Theme variables are injected at runtime from /api/config (see app.js).
   Defaults here just prevent a flash before config loads. */
:root {
  --bg: #06121f; --fg: #eef6fd; --muted: #9db8cc; --card: #0e1b2b;
  --border: #24425c; --primary: #38bdf8; --primary-fg: #04263a;
  --accent: #16304a; --ring: #7dd3fc;
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg-image: none; --bg-size: cover; --bg-opacity: 1; --bg-brightness: 1.0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; position: relative; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }

/* background glyph */
.bg-glyph, .bg-fade { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-glyph {
  background-image: var(--bg-image); background-repeat: no-repeat;
  background-position: center; background-size: var(--bg-size);
  opacity: var(--bg-opacity); filter: brightness(var(--bg-brightness));
}
.bg-fade { background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 40%, transparent), color-mix(in srgb, var(--bg) 70%, transparent), var(--bg)); }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }

/* header */
header { position: relative; }
.hdr { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; }
.hdr .brand { display: flex; align-items: center; gap: .75rem; font-family: var(--font-mono); font-size: .875rem; }
.hdr .brand img { height: 1.75rem; width: 1.75rem; object-fit: contain; }
.hdr .brand span { font-weight: 600; }
.hdr nav { display: flex; align-items: center; gap: .5rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap; font-family: var(--font-mono); font-weight: 500;
  cursor: pointer; border-radius: .375rem; border: 1px solid transparent;
  transition: background-color .15s, opacity .15s, border-color .15s;
  background: transparent; color: var(--fg);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .75rem; }
.btn-lg { height: 2.5rem; padding: 0 2rem; font-size: .875rem; }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.btn-primary:hover:not(:disabled) { opacity: .9; }
.btn-ghost:hover { background: var(--accent); }
.btn-outline { border-color: var(--border); background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.btn-outline:hover { background: var(--accent); }

/* hero */
.hero { padding: 6rem 0; }
.hero h1 { font-size: clamp(2.75rem, 8vw, 4.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.hero p { margin-top: 1.5rem; max-width: 36rem; font-size: 1.125rem; color: var(--muted); }
.hero p .em { color: var(--fg); font-family: var(--font-mono); }
.hero .cta { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.balance-pill {
  margin-top: 1.5rem; display: inline-flex; align-items: center; gap: .75rem;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 70%, transparent);
  border-radius: .5rem; padding: .75rem 1.25rem; transition: background-color .15s, border-color .15s;
}
.balance-pill:hover { background: var(--card); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.balance-pill .label { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.balance-pill .val { font-family: var(--font-mono); font-size: .875rem; font-weight: 600; }

/* steps grid */
.steps { display: grid; gap: 1px; overflow: hidden; border-radius: .5rem; border: 1px solid var(--border); background: var(--border); }
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { background: color-mix(in srgb, var(--bg) 88%, transparent); padding: 2rem; }
.step .n { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.step .t { margin-top: .5rem; font-size: 1.125rem; font-weight: 600; }
.step .b { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

/* rules card */
.card { margin-top: 4rem; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); border-radius: .5rem; padding: 2rem; }
.card h2 { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.rules { margin-top: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.rule { display: flex; gap: .75rem; font-size: .875rem; }
.rule .dot { margin-top: .5rem; height: .25rem; width: .25rem; flex-shrink: 0; border-radius: 999px; background: var(--primary); }

/* mints */
.mints { margin-top: 4rem; margin-bottom: 6rem; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; gap: .25rem; word-break: break-all; }
.mints .k { color: color-mix(in srgb, var(--fg) 60%, transparent); }

footer { border-top: 1px solid var(--border); }
footer .inner { padding: 1.5rem 0; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }

/* ---------- faucet page ---------- */
.faucet-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 1.5rem; }
.faucet-card { width: 100%; max-width: 30rem; border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 80%, transparent); border-radius: .75rem; padding: 2rem; }
.faucet-card .icon { display: block; height: 3rem; width: 3rem; margin: 0 auto 1rem; object-fit: contain; }
.faucet-card h1 { text-align: center; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.faucet-card .sub { text-align: center; margin-top: .5rem; font-size: .875rem; color: var(--muted); }
.field { margin-top: 1.5rem; }
.field label { display: block; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.input {
  width: 100%; height: 2.75rem; padding: 0 .875rem; border-radius: .5rem;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  font-family: var(--font-mono); font-size: .875rem;
}
.input:focus { outline: none; border-color: var(--ring); }
.captcha-row { display: flex; align-items: center; gap: .75rem; }
.captcha-q { font-family: var(--font-mono); font-size: 1rem; padding: 0 .5rem; white-space: nowrap; }
.captcha-row .input { width: 5rem; text-align: center; }
.captcha-refresh { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.claim-btn { width: 100%; margin-top: 1.5rem; height: 2.75rem; }
.msg { margin-top: 1rem; font-size: .875rem; text-align: center; min-height: 1.2rem; word-break: break-word; }
.msg.ok { color: #4ade80; }
.msg.err { color: #f87171; }
.msg a { text-decoration: underline; }
.faucet-balance-pill { display: inline-flex; align-items: center; gap: .5rem; margin-top: .85rem; padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(10, 22, 38, 0.5); transition: border-color .15s; }
.faucet-balance-pill:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.faucet-balance-pill .label { font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.faucet-balance-pill .val { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; }
.faucet-foot { margin-top: 1.5rem; text-align: center; }
.faucet-foot a { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.faucet-foot a:hover { color: var(--fg); }
.dryrun-banner { text-align: center; font-family: var(--font-mono); font-size: .7rem; color: #b45309; margin-bottom: 1rem; }

/* =====================================================================
   PATTYICE — icy blue revamp + payments/admin components
   ===================================================================== */

/* full-cover mascot wallpaper behind everything */
body { background: #06121f; }
.bg-glyph {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
}
/* dark scrim: readable at top/bottom, the art shows through the middle */
.bg-fade {
  background:
    linear-gradient(to bottom,
      rgba(4, 12, 22, 0.80) 0%,
      rgba(4, 12, 22, 0.40) 24%,
      rgba(4, 12, 22, 0.42) 54%,
      rgba(4, 12, 22, 0.90) 100%);
}

/* dark frosted glass on the panels */
.card, .faucet-card, .balance-pill, .pay-card, .step, .stat {
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.card, .faucet-card, .pay-card {
  background: rgba(10, 22, 38, 0.55);
  border-color: rgba(125, 211, 252, 0.18);
  box-shadow: 0 16px 44px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.step { background: rgba(10, 22, 38, 0.42); }
.balance-pill { background: rgba(10, 22, 38, 0.5); }

/* icy sheen on primary buttons */
.btn-primary {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%);
  color: var(--primary-fg);
  box-shadow: 0 6px 18px -6px rgba(56, 189, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); opacity: 1; }
.btn-ghost:hover { background: rgba(125, 211, 252, 0.16); }
.btn-outline { background: rgba(255, 255, 255, 0.06); }

.hero h1 { text-shadow: 0 2px 26px rgba(4, 12, 22, 0.65); }

/* nav can wrap on small screens */
.hdr nav { flex-wrap: wrap; justify-content: flex-end; }

/* =========================== payments page =========================== */
.pay-wrap { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.pay-head .brand { display: flex; align-items: center; gap: .75rem; font-family: var(--font-mono); }
.pay-head .brand img { height: 1.75rem; width: 1.75rem; }
.pay-title h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
.pay-title p { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: .75rem; overflow: hidden; margin-bottom: 2rem; }
.stat { background: rgba(10, 22, 38, 0.55); padding: 1.25rem 1.5rem; }
.stat .v { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; }
.stat .l { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: .25rem; }

.pay-card { border: 1px solid var(--border); border-radius: .75rem; padding: 0; overflow: hidden; margin-bottom: 2rem; }
.pay-card h2 { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.tbl-scroll { overflow-x: auto; }
table.pay { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.pay th, table.pay td { text-align: left; padding: .7rem 1.25rem; border-bottom: 1px solid rgba(125, 211, 252, 0.14); white-space: nowrap; }
table.pay th { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
table.pay td.addr { font-family: var(--font-mono); font-size: .8rem; }
table.pay td.num { font-family: var(--font-mono); text-align: right; }
table.pay tr:last-child td { border-bottom: none; }
table.pay a { color: #7dd3fc; text-decoration: underline; }
.pill-tag { display: inline-block; font-family: var(--font-mono); font-size: .62rem; padding: .1rem .4rem; border-radius: 999px; background: rgba(251, 191, 36, 0.18); color: #b45309; margin-left: .4rem; }
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--muted); font-size: .9rem; }
.backlink { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.backlink:hover { color: var(--fg); }

/* =========================== admin panel =========================== */
.admin-wrap { max-width: 60rem; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.login-box { max-width: 22rem; margin: 8vh auto 0; }
.admin-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.admin-h h1 { font-size: 1.5rem; font-weight: 700; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tab { font-family: var(--font-mono); font-size: .8rem; padding: .5rem .9rem; border-radius: .5rem; border: 1px solid var(--border); background: rgba(10, 22, 38, 0.5); color: var(--fg); cursor: pointer; }
.tab.active { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.panel { display: none; }
.panel.active { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.fg { display: flex; flex-direction: column; gap: .35rem; }
.fg.full { grid-column: 1 / -1; }
.fg label { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fg input, .fg textarea { width: 100%; padding: .55rem .7rem; border-radius: .5rem; border: 1px solid var(--border); background: rgba(6, 16, 28, 0.6); color: var(--fg); font-family: var(--font-mono); font-size: .8rem; }
.fg textarea { min-height: 7rem; resize: vertical; }
.fg .hint { font-size: .68rem; color: var(--muted); }
.section-title { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 1.75rem 0 .75rem; }
.save-bar { position: sticky; bottom: 0; margin-top: 1.5rem; padding: 1rem 0; background: linear-gradient(to top, #06121f 55%, transparent); display: flex; gap: .75rem; align-items: center; }
.swatch { width: 1.5rem; height: 1.5rem; border-radius: .4rem; border: 1px solid var(--border); flex-shrink: 0; }
.color-row { display: flex; align-items: center; gap: .5rem; }
.color-row input[type=color] { width: 2.2rem; height: 2.2rem; padding: 0; border: 1px solid var(--border); border-radius: .4rem; background: none; }
.admin-msg { font-family: var(--font-mono); font-size: .8rem; }
.admin-msg.ok { color: #059669; }
.admin-msg.err { color: #dc2626; }
.mono-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.mono-table th, .mono-table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid rgba(125, 211, 252, 0.14); white-space: nowrap; font-family: var(--font-mono); }
.mono-table th { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mono-table td.wrap { white-space: normal; word-break: break-word; max-width: 22rem; }
