/* FutureIN brand styles, shared by the children's quiz and the admin dashboard.
   Look: light frosted top bar with the logo, then a midnight-purple stage with violet glow,
   yellow pills and buttons, violet highlights, gold frames. Single dark brand look by design.
   To use the company font: put the font files in /public/fonts and change --display / --body. */
:root {
  color-scheme: dark;
  --night: #0e002c; --surface: #160838; --surface-2: #1f0e4a; --line: #33225e; --line-2: #463478;
  --ink: #ffffff; --muted: #b7aecd; --faint: #776c96;
  --violet: #9b4dff; --violet-deep: #8734ca; --yellow: #ffc629; --gold: #d3a22a;
  --bar: #ecebf6; --bar-ink: #0e002c; --bar-muted: #4b4466;
  --good: #3ddc84; --warn: #ffc629; --bad: #ff7b6b; --silver: #a9b2c3; --bronze: #c9814a;
  --display: 'Lexend', 'Poppins', system-ui, sans-serif;
  --body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  background-image: radial-gradient(900px 500px at 100% 100%, rgba(122, 52, 202, .35), transparent 70%),
                    radial-gradient(700px 420px at 0% 0%, rgba(58, 19, 118, .45), transparent 70%);
  background-attachment: fixed; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bar); }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: rgba(236, 235, 246, .95); backdrop-filter: blur(10px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px; }
.topbar .in { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--bar-ink); font-family: var(--display); font-weight: 700; text-decoration: none; }
.logo img { height: 38px; width: auto; display: block; }
.logo .sep { width: 1px; height: 24px; background: #c9c5dc; }
.logo .label { font-size: 15px; color: var(--bar-muted); font-weight: 600; }
.bar-actions { display: flex; align-items: center; gap: 10px; color: var(--bar-muted); font-size: 14px; font-weight: 500; }
.btn-navy { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: var(--bar-ink); color: #fff; padding: 9px 18px; border-radius: 999px; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 48px; }

/* Type */
h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; font-size: clamp(28px, 5.5vw, 40px); line-height: 1.1; margin: 0 0 10px; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: 22px; line-height: 1.35; margin: 0 0 16px; text-wrap: balance; }
h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; font-size: 17px; margin: 0; }
.in-violet { color: var(--violet); }
.kicker { color: var(--yellow); font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 16px; line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Pieces */
.pill { justify-self: start; display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); color: var(--night); font-weight: 600; font-size: 15px; padding: 7px 16px; border-radius: 999px; }
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: 0 20px 60px rgba(5, 0, 20, .45); }
.card.framed { border: 3px solid var(--gold); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; min-width: 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 15px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--night); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 15px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; }
select option { background: var(--night); }
.primary { font: inherit; font-size: 16px; font-weight: 600; padding: 13px 22px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--night); cursor: pointer; }
.primary.wide { width: 100%; font-size: 17px; padding: 14px; }
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .35; cursor: not-allowed; }
.ghost { font: inherit; font-size: 15px; font-weight: 600; padding: 11px 18px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; }
.ghost:hover { border-color: var(--violet); }
.ghost.sm, .primary.sm { font-size: 14px; padding: 7px 14px; }
.ghost.danger { color: var(--bad); }
.iconbtn { font: inherit; font-size: 14px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { color: var(--ink); border-color: var(--violet); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.err { color: var(--bad); min-height: 22px; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.ok { color: var(--good); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.live { color: var(--good); border-color: rgba(61, 220, 132, .4); }
.chip.draft { color: var(--yellow); border-color: rgba(255, 198, 41, .4); }
.chip.empty { color: var(--faint); }
.seg { display: inline-flex; background: var(--night); border-radius: 999px; padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--violet-deep); color: #fff; }
.foot { text-align: center; color: var(--muted); font-size: 13px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
td.num { font-variant-numeric: tabular-nums; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--night); font-weight: 700; font-size: 13px; }
.tag { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.empty-note { text-align: center; color: var(--muted); padding: 24px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
