
:root {
  --bg: #f6f6f3; --card: #ffffff; --text: #1c1c1e; --muted: #6b6b70; --line: #e3e3de;
  --accent: #0a66d8; --accent-text: #ffffff; --good: #1f7a3f; --warn-bg: #fff6e0; --warn-line: #f0d48a;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1c1c1f; --text: #f2f2f4; --muted: #a0a0a8; --line: #2e2e33;
    --accent: #3b8cff; --good: #5fd08a; --warn-bg: #2b2412; --warn-line: #5c4a1c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
.wrap { max-width: 560px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }

.notice.page { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 20px 0; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.notice.page { background: var(--card); }
.notice p { margin: 0; }
.notice.page p { margin: 8px 0 0; }
.label { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--muted); }
.claim { display: grid; gap: 12px; }
.claim label { display: grid; gap: 4px; }
.claim input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 50px; padding: 0 20px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); width: 100%; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 0; }
.code { font: 600 1.7rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; text-align: center;
  padding: 16px 8px; margin: 8px 0 16px; border: 2px dashed var(--line); border-radius: 12px; word-break: break-all;
  user-select: all; -webkit-user-select: all; }
.actions { display: grid; gap: 10px; margin-bottom: 14px; }

/* ---- public pages: "Glow" ----
   A dark page lit by the app's own icon, blurred (the <img> in .glow-bg).
   Scoped to .glow so the admin console keeps its own styles. */
html.glow { background: #110c1f; color-scheme: dark; }
.glow { --ink: #110c1f; --fg: #fff; --fg2: rgba(255,255,255,.66); --fg3: rgba(255,255,255,.45);
  --glass: rgba(255,255,255,.07); --glass-line: rgba(255,255,255,.13); --warm: #ffd28a;
  background: var(--ink); color: var(--fg); position: relative; min-height: 100vh; overflow-x: hidden;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
.glow-bg { position: absolute; z-index: 0; inset: 0 0 auto; height: 820px; overflow: hidden; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 18%, #3b2a66 0%, transparent 70%); }
.glow-bg img { position: absolute; left: 50%; top: -240px; width: 780px; height: 780px; max-width: none; transform: translateX(-50%);
  border-radius: 50%; object-fit: cover; filter: blur(100px) saturate(1.5); opacity: .85; }
.glow-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(17,12,31,.2), rgba(17,12,31,.6) 55%, var(--ink) 96%); }
.glow .wrap { position: relative; z-index: 1; max-width: 460px; padding: max(72px, calc(env(safe-area-inset-top) + 48px)) 24px 8px; }
.glow a { color: var(--fg); }
.glow h1 { font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; text-wrap: balance; }
.glow h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }

.glow .hero { text-align: center; padding-bottom: 36px; }
.glow .icon { display: block; width: 136px; height: 136px; margin: 0 auto 22px; border-radius: 22.5%; object-fit: cover;
  background: var(--glass); box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px var(--glass-line); }
.glow .hero.small { padding-bottom: 24px; }
.glow .hero.small .icon { width: 84px; height: 84px; margin-bottom: 14px; }
.glow .hero.small h1 { font-size: 1.5rem; }
.glow .dev { margin: 0 0 20px; color: var(--fg2); }
.glow .price { margin: 0 0 24px; display: flex; justify-content: center; align-items: baseline; gap: 10px; }
.glow .price b { font-size: 1.6rem; font-weight: 800; }
.glow .price s { color: var(--fg3); font-size: 1.05rem; }
.glow .warn { margin: -8px 0 18px; color: var(--warm); font-size: .9rem; }
.glow .notice { margin: 0 0 16px; padding: 18px 20px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line); text-align: center; }
.glow .notice h2 { font-size: 1.2rem; margin-bottom: 4px; }
.glow .notice p { margin: 0; color: var(--fg2); }
.glow .claim { display: grid; gap: 14px; }
.glow .age { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--glass-line); font-weight: 600; cursor: pointer; }
.glow .age input { flex: none; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; accent-color: #fff; }
.glow .claim:has(.age input:not(:checked)) .btn.primary { opacity: .45; box-shadow: none; }
.glow .cf-turnstile { display: flex; justify-content: center; min-height: 65px; }
.glow .btn { display: flex; width: 100%; min-height: 58px; border-radius: 999px; font-size: 1.1rem; font-weight: 700;
  border: 1px solid var(--glass-line); background: transparent; color: var(--fg); font-family: inherit; }
.glow .btn.primary { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 10px 40px rgba(255,255,255,.16); }
.glow .btn.primary:active { transform: scale(.985); }
.glow .btn.ghost { min-height: 52px; font-size: 1rem; font-weight: 600; margin-top: 10px; }
.glow .btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.glow .note { margin: 0; font-size: .82rem; color: var(--fg3); }
.glow .hint { margin-top: 12px; }
.glow .label { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg2); }

.glow .details { padding-bottom: 8px; }
.glow .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 22px; }
.glow .chip { padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); font-size: .82rem; font-weight: 600; }
.glow .chip small { color: var(--fg3); font-size: inherit; font-weight: 500; }
.glow .banner { display: block; width: 100%; border-radius: 22px; margin: 0 0 22px; }
.glow .pitch { margin: 0 0 22px; font-size: 1.05rem; line-height: 1.5; color: rgba(255,255,255,.86); }
.glow .shots { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px; margin: 0 -24px 22px; padding: 0 24px 4px; scrollbar-width: none; }
.glow .shots::-webkit-scrollbar { display: none; }
.glow .shots img { height: 300px; width: auto; flex: none; scroll-snap-align: start; border-radius: 20px; background: var(--glass); border: 1px solid rgba(255,255,255,.08); }
.glow .panel { margin: 0 0 22px; padding: 16px 18px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line); font-size: .92rem; color: rgba(255,255,255,.8); }
.glow .panel summary { cursor: pointer; color: var(--fg); font-weight: 700; }
.glow .desc { white-space: pre-line; margin-top: 10px; }
.glow .store { text-align: center; margin: 0; }
.glow .store a { font-weight: 600; text-decoration: none; opacity: .85; }

.glow .codebox { text-align: center; margin-bottom: 28px; }
.glow .code { font: 700 1.85rem/1.15 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; margin: 0 0 14px; padding: 22px 10px;
  border-radius: 24px; background: var(--glass); border: 1px dashed rgba(255,255,255,.35); word-break: break-all;
  user-select: all; -webkit-user-select: all; }
.glow .codebox .btn.primary { margin-bottom: 0; }
.glow .codebox .note { margin-top: 14px; line-height: 1.6; }
.glow .terms h2 { font-size: 1rem; }
.glow .terms-text { white-space: pre-line; font-size: .85rem; max-height: 320px; overflow: auto; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass-line); }

.glow .message { padding-top: 48px; }
.glow .lede { color: var(--fg2); margin: 8px 0 24px; }
.glow .field { display: grid; gap: 6px; text-align: left; font-weight: 600; }
.glow .field input { font: inherit; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--fg); }
.glow .prose { padding-bottom: 16px; color: rgba(255,255,255,.82); }
.glow .prose h1 { margin-bottom: 16px; }
.glow .prose h2 { margin: 28px 0 8px; color: var(--fg); }
.glow .prose li { margin-bottom: 8px; }
.glow .foot { position: relative; z-index: 1; text-align: center; padding: 28px 24px max(32px, env(safe-area-inset-bottom)); font-size: .78rem; color: var(--fg3); }
.glow .foot p { margin: 0 0 8px; }
.glow .foot a { color: var(--fg3); }
@media (min-width: 700px) {
  .glow .wrap { padding-top: 96px; }
  .glow .shots { justify-content: safe center; }
}
@media (prefers-reduced-motion: reduce) { .glow .btn.primary:active { transform: none; } }
.glow .preview-bar { position: sticky; top: 0; z-index: 10; padding: 10px 16px; text-align: center; font: 600 .82rem/1.4 -apple-system, system-ui, sans-serif;
  background: #ffd84d; color: #1c1600; }
.glow .preview-bar a { color: #1c1600; }
.actions-row select { font: inherit; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); max-width: 100%; }

/* ---- admin ---- */
.admin .topnav { display: flex; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--card); position: sticky; top: 0; z-index: 1; flex-wrap: wrap; }
.admin .topnav a { text-decoration: none; }
.admin .topnav .brand { font-weight: 700; color: var(--text); margin-right: auto; }
.wide { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head p { margin: 4px 0 0; }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; width: auto; }
.btn.danger { color: #c0392b; border-color: currentColor; }
.actions-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flash { background: #e8f5ec; border: 1px solid #a8d5b5; color: #17502a; padding: 10px 14px; border-radius: 10px; }
.flash.error { background: #fdecea; border-color: #f2b8b2; color: #7d1d14; }
.flash.warn-flash { background: #fff4d6; border-color: #f0cf73; color: #5a4300; }
@media (prefers-color-scheme: dark) {
  .flash { background: #12301d; border-color: #24563a; color: #b8ecc9; }
  .flash.error { background: #3a1512; border-color: #6e2a23; color: #f6c2bb; }
  .flash.warn-flash { background: #33290c; border-color: #6b5518; color: #f5dc9a; }
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.warn, .stat.warn span { color: #c26a00; font-weight: 700; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--line); }
.badge.live { color: var(--good); border-color: var(--good); }
.badge.paused, .badge.warn { color: #c26a00; border-color: #c26a00; }
.badge.ended { color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--muted); font-size: 0.85rem; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.bars-axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin: 4px 0 12px; }
.admin-form { display: grid; gap: 14px; }
.admin-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; margin: 0; }
.admin-form legend { font-weight: 700; padding: 0 6px; }
.admin-form label { display: grid; gap: 4px; }
.admin-form label > span { font-weight: 600; font-size: 0.9rem; }
.admin-form small { color: var(--muted); font-size: 0.8rem; }
.admin-form input, .admin-form select, .admin-form textarea { font: inherit; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
.admin-form textarea { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.admin-form .btn.primary { width: auto; justify-self: start; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.terms-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
@media (max-width: 600px) { .terms-row { grid-template-columns: 1fr; } }
.facts { padding-left: 18px; }
.code.small { font-size: 0.9rem; letter-spacing: 0; }
.terms-preview { white-space: pre-line; font-size: 0.85rem; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
code.revealed { background: var(--warn-bg); padding: 2px 6px; border-radius: 6px; }
