/* ============================================================================
   COSMIC CITY — theme aligned to the cosmic_banking "blade" UI.
   Flat ink surfaces · faint grid · subtle ice-blue glows · cut-corner panels ·
   parallelogram buttons · Inter · NO blur. Tokens mirror banking's tailwind.
   ============================================================================ */
:root {
  /* brand ice-blue */
  --brand-300: #7ec8f0; --brand-400: #4fa8d8; --brand-500: #2f7fc4;
  --brand-700: #1c528a; --brand-900: #0c2848; --brand-950: #061628;
  --ice: #7ec8f0; --steel: #2f7fc4; --chrome: #a8c8e0;  /* nebula */
  --emerald: #10b981;

  /* ink surfaces */
  --ink-900: #060a10; --ink-800: #080e18; --ink-700: #0d1522; --ink-600: #131c2c;
  --bg: #080e18;
  --surface: rgba(126,200,240,0.04);
  --surface-2: rgba(126,200,240,0.06);
  --line: rgba(126,200,240,0.10);
  --line-strong: rgba(126,200,240,0.18);

  --text: #eef6ff; --muted: #bcd9ee; --muted-2: #8fb3cf;
  --bg-2: #06121f; --bg-1: #0d1522;  /* dark inks for text-on-bright (admin badges) */

  --galaxy: linear-gradient(135deg, #143d6b 0%, #2f7fc4 100%);
  --galaxy-bright: linear-gradient(135deg, #2f7fc4 0%, #7ec8f0 100%);
  --glow-brand: 0 10px 40px -10px rgba(47,127,196,0.35);
  --glow-soft: 0 0 30px -6px rgba(47,127,196,0.25);
  --inner-glow: inset 0 1px 0 0 rgba(126,200,240,0.06);

  /* blade shapes (from banking) */
  --cut: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  --cut-sm: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  --para: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  --para-sm: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);

  --sans: 'Bookman Old Style', 'URW Bookman', 'Bookman', Georgia, 'Times New Roman', serif;
  --serif: 'Bookman Old Style', 'URW Bookman', 'Bookman', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  /* flat ink + faint technical grid + a soft brand glow up top */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(47,127,196,0.12), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><path d='M 40 0 L 0 0 0 40' fill='none' stroke='rgba(126,200,240,0.035)' stroke-width='1'/></svg>"),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh; overflow-x: hidden; line-height: 1.6;
}
a { color: var(--ice); text-decoration: none; }
::selection { background: var(--brand-500); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2f7fc4, #7ec8f0); border-radius: 2px; }

.page { position: relative; z-index: 1; }
h1, h2, h3 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }

/* ── nav ─────────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: rgba(6,10,16,0.86); border-bottom-color: var(--line);
  padding: 10px 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(126,200,240,.45)); }
.brand .name { font-weight: 800; letter-spacing: 2px; font-size: 16px; }
.brand .name span { color: var(--ice); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted); padding: 8px 16px; font-size: 12.5px; letter-spacing: 1px;
  text-transform: uppercase; font-weight: 600; transition: color .2s, background .2s;
  clip-path: var(--para-sm);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: #fff; background: linear-gradient(135deg, rgba(47,127,196,0.85), rgba(79,168,216,0.85));
  box-shadow: 0 4px 16px -4px rgba(47,127,196,0.35);
}
/* the right cluster (admin link + user chip) must flex-align with the nav links */
#auth-slot { display: inline-flex; align-items: center; gap: 10px; }
.nav-admin {
  color: var(--ice) !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  font-size: 12.5px; padding: 8px 16px; clip-path: var(--para-sm); transition: color .2s, background .2s;
}
.nav-admin:hover { color: #fff !important; background: var(--surface-2); }
.nav-admin.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(47,127,196,0.85), rgba(79,168,216,0.85));
  box-shadow: 0 4px 16px -4px rgba(47,127,196,0.35);
}
.user-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); }
.user-chip span { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px);
  background: rgba(6,10,16,0.96); border: 1px solid var(--line); color: var(--text);
  padding: 12px 20px; clip-path: var(--cut-sm); font-size: 13px; z-index: 100;
  opacity: 0; transition: opacity .3s, transform .3s; box-shadow: var(--glow-brand);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── buttons (parallelogram) ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; font-weight: 700;
  text-transform: uppercase; color: #fff; border: none; padding: 13px 28px;
  clip-path: var(--para); background: var(--galaxy);
  box-shadow: 0 8px 24px -6px rgba(47,127,196,.45), var(--inner-glow);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(47,127,196,.55); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ice); }
.btn.discord { background: linear-gradient(135deg, #5865F2, #4752c4); }
.btn.crimson { background: var(--galaxy-bright); color: #06121f; }
.btn.sm { padding: 9px 16px; font-size: 11px; clip-path: var(--para-sm); }

/* the specialised "Enter the City" button */
.btn-enter {
  position: relative; display: inline-flex; align-items: center; gap: 16px;
  padding: 16px 28px; overflow: hidden; cursor: pointer; color: var(--text);
  background: linear-gradient(135deg, rgba(47,127,196,.22), rgba(8,14,24,.7));
  border: 1px solid var(--line-strong); clip-path: var(--para);
  box-shadow: var(--glow-brand), var(--inner-glow);
  transition: transform .18s ease, box-shadow .25s, border-color .25s;
}
.btn-enter:hover { transform: translateY(-3px); box-shadow: 0 16px 44px -10px rgba(47,127,196,.6); border-color: var(--ice); }
.btn-enter.disabled { opacity: .6; pointer-events: none; }
.ew-glyph { font-size: 28px; line-height: 1; color: var(--ice); filter: drop-shadow(0 0 10px rgba(126,200,240,.5)); }
.ew-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.ew-text b { font-size: 16px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; }
.ew-text small { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin-top: 2px; }
.ew-arrow { color: var(--ice); transition: transform .2s; flex: 0 0 auto; }
.btn-enter:hover .ew-arrow { transform: translateX(4px); }

/* ── layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.section { padding: 100px 0; position: relative; }
.eyebrow {
  display: inline-block; color: var(--ice); letter-spacing: 4px; font-size: 12px;
  text-transform: uppercase; font-weight: 700; margin-bottom: 14px;
}
.eyebrow::before { content: '◆  '; color: var(--brand-400); }
.section h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 18px; }
.lead { color: var(--muted); font-size: 17px; max-width: 720px; }

/* cut-corner panel — flat ink surface + soft glow (banking .glass + .blade-panel) */
.panel {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  clip-path: var(--cut); padding: 26px;
  box-shadow: var(--glow-soft), var(--inner-glow);
}
.panel::before {  /* ice accent bar */
  content: ''; position: absolute; left: 0; top: 16px; width: 3px; height: 38px;
  background: linear-gradient(180deg, var(--ice), var(--brand-500));
  box-shadow: 0 0 12px rgba(126,200,240,.5);
}

.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.feature h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.feature .ic {
  width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 14px;
  color: var(--ice); background: var(--galaxy); clip-path: var(--cut-sm); font-size: 22px;
  box-shadow: var(--glow-soft);
}
.feature p { color: var(--muted); font-size: 15px; }

/* "coming soon" badge (store page) */
.store-soon {
  display: inline-block; margin-top: 14px; padding: 5px 13px; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; font-weight: 700; color: var(--ice);
  background: var(--surface-2); border: 1px solid var(--line-strong); clip-path: var(--para-sm);
}

/* ── rules page ──────────────────────────────────────────────────────────── */
.rules-toolbar { display: flex; flex-direction: column; gap: 16px; }
#rules-search {
  width: 100%; background: rgba(6,10,16,0.8); color: var(--text); border: 1px solid var(--line);
  padding: 14px 18px; font-size: 15px; border-radius: 4px; font-family: var(--sans);
}
#rules-search:focus { outline: none; border-color: rgba(126,200,240,.55); box-shadow: 0 0 0 3px rgba(47,127,196,.18); }
.rules-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  cursor: pointer; background: var(--surface); color: var(--muted); border: 1px solid var(--line);
  padding: 8px 15px; font-size: 12px; letter-spacing: .5px; font-weight: 600; clip-path: var(--para-sm);
  transition: all .2s; font-family: var(--sans);
}
.chip em { color: var(--ice); font-style: normal; opacity: .8; }
.chip:hover { color: var(--text); border-color: var(--ice); }
.chip.active {
  background: linear-gradient(135deg, rgba(47,127,196,0.9), rgba(79,168,216,0.9)); color: #fff;
  border-color: transparent; box-shadow: 0 4px 16px -4px rgba(47,127,196,.4);
}
.chip.active em { color: #eaf6ff; }

.rule-group { margin-bottom: 48px; }
.group-title { font-size: 24px; display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--text); }
.group-title .g-ic { font-size: 22px; }
.group-title .g-count { font-size: 13px; color: var(--ice); border: 1px solid var(--line); padding: 2px 10px; clip-path: var(--para-sm); }
.rule-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .rule-list { grid-template-columns: 1fr; } }
.rule { display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: start; }
.rule .rule-n {
  font-family: var(--sans); font-size: 26px; font-weight: 800; color: transparent;
  background: var(--galaxy-bright); -webkit-background-clip: text; background-clip: text;
  line-height: 1; padding-top: 2px;
}
.rule-body h3 { font-family: var(--sans); font-size: 16px; color: var(--text); margin-bottom: 7px; }
.rule-body p { color: var(--muted); font-size: 14px; line-height: 1.55; }
mark { background: rgba(47,127,196,.4); color: #fff; padding: 0 2px; border-radius: 2px; }

/* ── apply / forms ───────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field .req { color: var(--brand-300); }
.field input[type=text], .field textarea, .field select {
  width: 100%; background: rgba(6,10,16,.85); color: var(--text); border: 1px solid var(--line);
  padding: 11px 13px; font-size: 14px; border-radius: 4px; font-family: var(--sans);
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: rgba(126,200,240,.55); box-shadow: 0 0 0 3px rgba(47,127,196,.18);
}
.field.check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 4px; }
.field.check input { width: 18px; height: 18px; accent-color: var(--brand-500); }
.field.check span { color: var(--text); font-size: 14px; }
.fnote { display: block; color: var(--muted-2); font-size: 12px; margin-top: 5px; }

.quiz-q { padding: 14px 0; border-top: 1px solid var(--line); }
.quiz-q:first-child { border-top: none; padding-top: 4px; }
.q-text { font-size: 14px; color: var(--text); margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.q-n { color: var(--ice); font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .q-opts { grid-template-columns: 1fr; } }
.q-opt {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); clip-path: var(--cut-sm);
  font-size: 13px; color: var(--muted); transition: all .15s;
}
.q-opt input { accent-color: var(--brand-500); }
.q-opt:hover { color: var(--text); border-color: var(--ice); }
.q-opt.sel { color: #fff; background: rgba(47,127,196,.18); border-color: var(--ice); }

.form-errors {
  margin-top: 18px; padding: 14px 18px; border: 1px solid rgba(231,68,59,.4);
  background: rgba(231,68,59,.08); clip-path: var(--cut-sm); color: #ffd9d6; font-size: 13px;
}
.form-errors ul { margin: 8px 0 0 18px; }
.st-icon { font-size: 38px; margin-bottom: 8px; }
#wl-status h3, #wl-gate h3 { font-size: 22px; }
#wl-status .muted { color: var(--muted); font-size: 13px; }

/* timed quiz stage */
.quiz-stage { margin-top: 24px; }
.quiz-card { max-width: 720px; margin: 0 auto; padding: 30px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.quiz-timer-wrap b { color: var(--ice); font-size: 18px; }
.quiz-bar { height: 6px; background: rgba(126,200,240,.12); margin: 12px 0 22px; clip-path: var(--cut-sm); overflow: hidden; }
#quiz-bar-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--ice), var(--steel)); }
#quiz-bar-fill.low { background: linear-gradient(90deg, #ff8a7e, var(--sev-5)); }
.quiz-question { font-size: 20px; color: var(--text); line-height: 1.4; margin-bottom: 22px; min-height: 56px; font-weight: 700; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .quiz-options { grid-template-columns: 1fr; } }
.quiz-opt {
  text-align: left; cursor: pointer; padding: 16px 18px; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); clip-path: var(--cut-sm); font-family: var(--sans); transition: all .12s;
}
.quiz-opt:hover { background: rgba(47,127,196,.18); border-color: var(--ice); transform: translateY(-2px); }

/* ── footer ──────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 40px 0 60px; margin-top: 40px; color: var(--muted); font-size: 13px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer .brand .name { font-size: 14px; }

/* ── utilities ───────────────────────────────────────────────────────────── */
.center { text-align: center; }
.mt-s { margin-top: 14px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 48px; }
.hidden { display: none !important; }
.metal-text {
  background: var(--galaxy-bright); -webkit-background-clip: text; background-clip: text; color: transparent;
}
