/* Exceltior Live: design tokens and base components (company/brand-web-standards.md, adapted for app density).
   Type: Cormorant Garamond 500 for page titles and hero headings only (never below 20px or in tables), Inter for all
   interface text, JetBrains Mono for identifiers. Fonts are self-hosted: the app works offline and sends nothing to font
   CDNs. Cormorant Garamond could not be downloaded in the build environment: it is used when installed on the device,
   otherwise headings fall back to Georgia. To ship it, add CormorantGaramond-Medium.woff2 and -SemiBold.woff2 (Latin
   and Latin Extended, for Polish) to /public/fonts/ and a url() to the two @font-face rules below. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: local("Inter Regular"), local("Inter-Regular"), url("/fonts/Inter-Regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: local("Inter Italic"), local("Inter-Italic"), url("/fonts/Inter-Italic.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: local("Inter Medium"), local("Inter-Medium"), url("/fonts/Inter-Medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: local("Inter SemiBold"), local("Inter-SemiBold"), url("/fonts/Inter-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700 900; font-display: swap; src: local("Inter Bold"), local("Inter-Bold"), url("/fonts/Inter-Bold.woff") format("woff"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: local("Cormorant Garamond Medium"), local("CormorantGaramond-Medium"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: local("Cormorant Garamond SemiBold"), local("CormorantGaramond-SemiBold"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: local("Cormorant Garamond Medium Italic"), local("CormorantGaramond-MediumItalic"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: local("JetBrains Mono"), local("JetBrainsMono-Regular"), url("/fonts/JetBrainsMono-Regular.woff") format("woff"); }

:root {
  /* brand */
  --obsidian: #0B0816; --purple: #3B1F73; --night: #15102A; --violet: #6D28D9; --lilac: #D9CCFF; --lavender: #D9CCFF; --paper: #FAF9F7;
  --on-dark-muted: #B9B1D1; --line-dark: #2D2547;
  --grad-depth: linear-gradient(160deg, #0B0816 0%, #3B1F73 100%);  /* one gradient moment per screen: hero and sign-in panels */
  --grad-light: linear-gradient(180deg, #0B0816 0%, #FFFFFF 100%);
  --grad-sheen: linear-gradient(120deg, #6D28D9 0%, #D9CCFF 100%);
  /* roles (names kept for older pages) */
  --purple-2: #5B2DB8; --deep: #15102A; --accent: #6D28D9;
  --tint: #F4F1FA; --tint-2: #ECE6F7; --surface: #FAF9F7; --raised: #fff;
  --ink: #15102A; --muted: #5B5470; --line: #E4DFEC; --line-strong: #8A82A0; --white: #fff;
  --ok: #1C7547; --ok-bg: #E5F3EA; --bad: #B42318; --bad-bg: #FCE9E7; --warn: #A34A06; --warn-bg: #FCEFDF;
  --radius: 16px; --radius-s: 10px; --radius-l: 22px; --pill: 999px;
  --shadow: 0 1px 2px rgba(21,16,42,.05), 0 8px 28px rgba(21,16,42,.07);
  --shadow-lift: 0 2px 4px rgba(21,16,42,.06), 0 16px 40px rgba(21,16,42,.12);
  --shadow-dialog: 0 24px 64px rgba(21,16,42,.22);
  --ease: cubic-bezier(.2,.7,.2,1);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --head: var(--sans); --serif: var(--sans); /* interface headings, numbers and labels (the old headline font role) stay Inter */
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--surface); line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
/* page titles in the serif (at least 20px); section titles stay Inter */
h1 { font-family: var(--display); font-weight: 500; font-size: 2.15rem; line-height: 1.12; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; } h4 { font-size: 1rem; }
.serif { font-family: var(--display); font-weight: 500; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-underline-offset: 3px; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--lilac); color: var(--night); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.kicker { font-family: var(--sans); font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); line-height: 1.35; }
.wordmark { display: inline-flex; align-items: center; } /* older pages: filled with the lockup */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Live lockup: Live mark + LIVE (Cormorant Garamond 600 capitals) + POWERED BY EXCELTIOR (Inter 600 capitals) */
.lockup { display: inline-flex; align-items: center; gap: .6rem; color: var(--purple); text-decoration: none; white-space: nowrap; position: relative; }
.lockup .cl-mark { width: 30px; height: 30px; flex: none; }
.lockup .lk { display: inline-flex; flex-direction: column; justify-content: center; gap: .18rem; line-height: 1; }
.lockup .lk b { font-family: var(--display); font-weight: 600; font-size: 1.22rem; letter-spacing: .24em; color: var(--night); }
.lockup .lk small { font-family: var(--sans); font-weight: 600; font-size: .52rem; letter-spacing: .2em; color: var(--muted); }
.on-dark .lockup, .lockup.on-dark { color: var(--lilac); } .on-dark .lockup .lk b, .lockup.on-dark .lk b { color: #fff; } .on-dark .lockup .lk small, .lockup.on-dark .lk small { color: var(--on-dark-muted); }
.x-mark { width: 28px; height: 28px; flex: none; }
.hero-x { position: absolute; right: -18%; top: -22%; width: 78%; max-width: 560px; opacity: .55; pointer-events: none; }
/* the one gradient moment: participant hero, sign-in panels */
.depth { background: var(--grad-depth); color: #fff; position: relative; overflow: hidden; }
.depth h1, .depth h2 { color: #fff; } .depth .kicker { color: var(--lilac); } .depth .muted { color: var(--on-dark-muted); }
.depth a { color: var(--lilac); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.25rem; border-radius: var(--pill); border: 1.5px solid var(--purple); background: var(--purple); color: #fff; font-weight: 600; font-size: .94rem; line-height: 1.2; letter-spacing: .005em; cursor: pointer; text-decoration: none; transition: background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .06s; white-space: nowrap; }
.btn:hover { background: var(--night); border-color: var(--night); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--purple); }
.btn.quiet:hover { background: var(--tint-2); }
.btn.danger { background: #fff; color: var(--bad); border-color: #EDBDB7; }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { min-height: 36px; padding: .35rem .9rem; font-size: .86rem; }
.btn.block { width: 100%; white-space: normal; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 44px; height: 44px; padding: 0; }

.field { display: block; margin-bottom: 1.05rem; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.input, textarea.input, select.input { width: 100%; min-height: 46px; padding: .65rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input:hover { border-color: #CFC7DE; }
.input::placeholder { color: #8F88A3; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(109,40,217,.14); }
.btn:focus-visible, .opt:focus-visible, .tab:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.on-dark :focus-visible, .depth :focus-visible, header.top :focus-visible, .dark :focus-visible { outline-color: var(--lilac); }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.5; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.card + .card { margin-top: 1rem; }
@media (max-width: 520px) { .card { padding: 1.15rem 1.1rem; } }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: var(--pill); font-size: .76rem; font-weight: 600; background: var(--tint-2); color: var(--purple); line-height: 1.4; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #E0244E; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: #fff; padding: .8rem 1.2rem; border-radius: 14px; box-shadow: var(--shadow-dialog); z-index: 100; max-width: calc(100% - 32px); font-size: .94rem; animation: toastin .25s var(--ease); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* options (poll/quiz) */
.opts { display: grid; gap: .6rem; }
.opt { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; min-height: 54px; padding: .75rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease); line-height: 1.4; background: #fff; cursor: pointer; font-weight: 500; position: relative; overflow: hidden; }
.opt:hover:not(:disabled) { border-color: var(--purple-2); box-shadow: 0 2px 10px rgba(59,31,115,.08); }
.opt:disabled { cursor: default; }
.opt .letter { flex: none; width: 30px; height: 30px; border-radius: 50%; font-family: var(--head); display: grid; place-items: center; background: var(--tint-2); color: var(--purple); font-weight: 700; font-size: .85rem; }
.opt.chosen { border-color: var(--purple); background: var(--tint); }
.opt.chosen .letter { background: var(--purple); color: #fff; }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.correct .letter { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(75,42,153,.10); z-index: 0; transition: width .4s; }
.opt > *:not(.bar) { position: relative; z-index: 1; }
.opt .pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--purple); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.scale .opt { justify-content: center; font-size: 1.25rem; font-weight: 700; min-height: 60px; }
.scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .35rem; gap: 1rem; }

/* bars (results) */
.bars { display: grid; gap: .55rem; }
.barrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; }
.barrow .lbl { font-weight: 500; }
.barrow .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--purple); }
.barrow .track { grid-column: 1 / -1; height: 12px; background: var(--tint-2); border-radius: 6px; overflow: hidden; }
.barrow .fill { height: 100%; background: var(--purple-2); border-radius: 6px; transition: width .5s; }
.barrow.correct .fill { background: var(--ok); } .barrow.correct .lbl { color: var(--ok); font-weight: 700; }

.cloud { display: flex; flex-wrap: wrap; gap: .3rem .9rem; justify-content: center; align-items: center; padding: 1rem; }
.cloud span { color: var(--purple); font-weight: 700; line-height: 1.1; }
.cloud span:nth-child(3n) { color: var(--purple-2); } .cloud span:nth-child(4n) { color: #6C4BC0; } .cloud span:nth-child(5n) { color: var(--deep); }

/* checkbox with its label: box aligned with the first line of text, text wraps beside it */
.check { display: flex; align-items: flex-start; gap: .6rem; flex-wrap: nowrap; cursor: pointer; line-height: 1.45; }
.check input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: calc((1.45em - 18px) / 2) 0 0; accent-color: var(--purple); cursor: pointer; }
.check > span { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .depth { background: Canvas; color: CanvasText; } .lockup .lk b, .lockup .lk small { color: CanvasText; } }
/* sign-in panels: a Depth head on the card (the screen's one gradient moment) */
.signhead { margin: -1.4rem -1.5rem 1.2rem; padding: 1.3rem 1.5rem 1.5rem; border-radius: var(--radius) var(--radius) 0 0; }
.signhead .lockup, .signhead h1 { position: relative; } .signhead h1 { margin: 1.4rem 0 0; font-size: 2.1rem; }
.signhead .hero-x { width: 70%; right: -14%; top: -40%; }
