/* =====================================================================
   ESC Card Generator — design system ("Stage night")
   Colour code used everywhere:  gold = jury · cyan = televote · pink = action
   ===================================================================== */

:root {
  --ink: #120b2e;
  --ink-2: #180f3a;
  --panel: #1e1547;
  --panel-2: #261b58;
  --line: #3a2e73;
  --line-soft: rgba(255, 255, 255, .08);
  --text: #f5f1ff;
  --muted: #b3abd6;
  --faint: #8a82b3;
  --pink: #ff3d8b;
  --pink-2: #ff6aa8;
  --gold: #ffc83d;
  --cyan: #3dd6ff;
  --green: #3ddc97;
  --red: #ff5a6a;
  --orange: #ff9f43;

  --jury: var(--gold);
  --tele: var(--cyan);

  --font-display: "Unbounded", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-panel: 20px;
  --r-control: 12px;
  --shadow: 0 18px 50px -20px rgba(5, 2, 20, .8);
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 61, 139, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(61, 214, 255, .10), transparent 60%),
    var(--ink);
  background-attachment: fixed;
}
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 64ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #1b1530; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 860px; }
.section { padding-block: clamp(32px, 6vw, 72px); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: clamp(14px, 2vw, 24px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

/* ---------- brand mark: the "12 points" tile ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand__mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #ff8a3d); color: #2a1300;
  font: 800 15px/1 var(--font-display); transform: rotate(-6deg);
  box-shadow: 0 6px 18px -6px rgba(255, 200, 61, .7);
}
.brand__mark span { transform: rotate(6deg); }
.brand__mark--xl { width: 96px; height: 96px; border-radius: 26px; font-size: 40px; margin-bottom: 24px; }
.brand__name { font: 700 1rem/1 var(--font-display); letter-spacing: -.01em; }

/* ---------- header ---------- */
.site-banner { background: var(--orange); color: #261200; text-align: center; padding: 8px 16px; font-weight: 600; font-size: .92rem; }
.site-banner a { color: inherit; font-weight: 800; }
.site-banner--dev { background: var(--gold); }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18, 11, 46, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.site-header__inner { max-width: var(--container); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav-link:hover, .nav-item.is-active > .nav-link { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-link--dev { color: var(--gold); }
.nav-caret { display: none; background: none; border: 0; color: var(--muted); width: 32px; height: 32px; cursor: pointer; }
.nav-caret::before { content: ""; display: inline-block; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 10px; display: grid; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s ease;
}
.nav-menu::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; }
.has-menu:hover > .nav-menu, .has-menu:focus-within > .nav-menu, .has-menu.is-open > .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav-menu a:hover { background: rgba(255, 255, 255, .07); }
.nav-menu a small { display: block; color: var(--muted); font-size: .8rem; }
.nav-menu--wide { grid-template-columns: repeat(5, minmax(140px, 1fr)); min-width: 820px; gap: 8px; }
.nav-live { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--pink); vertical-align: middle; animation: pulse 1.6s infinite; }
.nav-menu__col { display: grid; align-content: start; gap: 2px; }
.nav-menu__title { font-family: var(--font-display); font-size: .82rem; color: var(--gold) !important; }
.nav-menu__empty { color: var(--faint); font-size: .85rem; padding: 6px 12px; }
.nav-menu--right { left: auto; right: 0; }
.nav-menu__hello { padding: 6px 12px 10px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.nav-menu__logout { width: 100%; text-align: left; background: none; border: 0; color: var(--red); font: inherit; font-weight: 600; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.nav-menu__logout:hover { background: rgba(255, 90, 106, .12); }
.nav-account { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.avatar-button { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-soft); color: var(--text); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font: inherit; font-weight: 600; }
.avatar-button img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.nav-toggle span:not(.sr-only) { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle span:nth-child(1) { top: 15px; } .nav-toggle span:nth-child(2) { top: 21px; } .nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ink); }
  .nav-toggle { display: block; }
  .site-nav { position: fixed; inset: 64px 0 0; background: var(--ink); flex-direction: column; align-items: stretch; padding: 16px var(--gutter) 40px; overflow-y: auto; display: none; gap: 6px; }
  .site-nav.is-open { display: flex; }
  .nav-item { flex-wrap: wrap; }
  .nav-link { flex: 1; font-size: 1.1rem; padding: 12px; }
  .nav-caret { display: block; }
  .nav-menu, .nav-menu--wide { position: static; opacity: 1; visibility: visible; transform: none; display: none; width: 100%; min-width: 0; grid-template-columns: 1fr; box-shadow: none; margin: 4px 0 8px; }
  .has-menu.is-open > .nav-menu { display: grid; }
  .has-menu:hover > .nav-menu { display: none; }
  .has-menu.is-open:hover > .nav-menu { display: grid; }
  .nav-account { margin: 12px 0 0; flex-wrap: wrap; }
  .nav-item--account { width: 100%; }
  .nav-item--account .nav-menu { display: grid; }
  .avatar-button { width: 100%; }
}

/* ---------- breadcrumbs & notices ---------- */
.crumbs { max-width: var(--container); margin: 18px auto 0; padding-inline: var(--gutter); font-size: .88rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: #fff; }
.flashes { max-width: var(--container); margin: 16px auto 0; padding-inline: var(--gutter); display: grid; gap: 8px; }
.notice { padding: 12px 16px; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--panel); }
.notice--success { border-color: rgba(61, 220, 151, .5); background: rgba(61, 220, 151, .1); }
.notice--error { border-color: rgba(255, 90, 106, .5); background: rgba(255, 90, 106, .1); }
.notice--warning { border-color: rgba(255, 159, 67, .5); background: rgba(255, 159, 67, .1); }
.notice--info { border-color: rgba(61, 214, 255, .4); background: rgba(61, 214, 255, .08); }

/* ---------- buttons ---------- */
.btn {
  --b-bg: rgba(255, 255, 255, .08); --b-fg: var(--text); --b-border: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: var(--r-control); border: 1px solid var(--b-border); background: var(--b-bg); color: var(--b-fg);
  font: 700 .95rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { color: var(--b-fg); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--primary { --b-bg: var(--pink); --b-fg: #fff; --b-border: var(--pink); box-shadow: 0 10px 26px -12px rgba(255, 61, 139, .9); }
.btn--primary:hover { --b-bg: var(--pink-2); --b-border: var(--pink-2); }
.btn--gold { --b-bg: var(--gold); --b-fg: #2a1a00; --b-border: var(--gold); }
.btn--cyan { --b-bg: var(--cyan); --b-fg: #002230; --b-border: var(--cyan); }
.btn--ghost { --b-bg: transparent; }
.btn--danger { --b-bg: rgba(255, 90, 106, .14); --b-fg: #ffb3bb; --b-border: rgba(255, 90, 106, .5); }
.btn--danger:hover { --b-bg: var(--red); --b-fg: #fff; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .88rem; border-radius: 10px; }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 1.05rem; border-radius: 14px; }
.btn--block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; }
.btn-icon:hover { border-color: var(--muted); }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.chip img { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; }
.chip--live { background: rgba(255, 61, 139, .16); border-color: rgba(255, 61, 139, .5); color: #ffd0e2; }
.chip--live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); animation: pulse 1.6s infinite; }
.chip--closed { background: rgba(255, 159, 67, .14); border-color: rgba(255, 159, 67, .45); color: #ffd6b0; }
.chip--done { background: rgba(61, 220, 151, .12); border-color: rgba(61, 220, 151, .4); color: #c2f5dd; }
.chip--draft { background: rgba(255, 255, 255, .05); border-style: dashed; color: var(--muted); }
.chip--jury { background: rgba(255, 200, 61, .14); border-color: rgba(255, 200, 61, .45); color: #ffe7a8; }
.chip--tele { background: rgba(61, 214, 255, .12); border-color: rgba(61, 214, 255, .4); color: #c6f3ff; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* the points tile (12, 10, 8 …) */
.pts { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; font: 800 .85rem/1 var(--font-display); background: rgba(255,255,255,.08); color: var(--text); }
.pts--12 { background: var(--gold); color: #2a1a00; }
.pts--10 { background: #ffe08a; color: #2a1a00; }
.pts--8 { background: #ffefc2; color: #2a1a00; }
.pts--jury { background: rgba(255, 200, 61, .18); color: #ffe7a8; }
.pts--tele { background: rgba(61, 214, 255, .16); color: #c6f3ff; }
.pts--zero { opacity: .35; }
.pts--self { background: transparent; color: var(--faint); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: clamp(18px, 3vw, 28px); }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel__head h2, .panel__head h3 { margin: 0; }
.panel + .panel { margin-top: 20px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 700; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .84rem; }
.input, .select, .textarea, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-control); border: 1px solid var(--line);
  background: var(--ink-2); color: var(--text); font: inherit; font-size: .97rem;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(61, 214, 255, .2); }
input[type=checkbox], input[type=radio] { accent-color: var(--pink); width: 18px; height: 18px; }
input[type=color] { width: 44px; height: 44px; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-2); cursor: pointer; }
input[type=range] { accent-color: var(--pink); width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* toggle switch */
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.switch input { position: absolute; opacity: 0; }
.switch__track { flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .switch__track { background: var(--pink); }
.switch input:checked + .switch__track::after { left: 23px; }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch__text strong { display: block; }
.switch__text span { color: var(--muted); font-size: .88rem; }

/* segmented control */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.segmented button, .segmented a, .segmented label { border: 0; background: transparent; color: var(--muted); font: 700 .9rem/1 var(--font-body); padding: 10px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented .is-active, .segmented button[aria-pressed="true"], .segmented input:checked + span { background: var(--text); color: var(--ink); }
.segmented label span { display: block; }
.segmented label:has(input:checked) { background: var(--text); color: var(--ink); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-soft); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 14px 16px; color: var(--muted); text-decoration: none; font-weight: 700; border: 0; background: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: .97rem; font-family: inherit; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"], .tab.is-active { color: #fff; border-bottom-color: var(--pink); }
.tab-panel[hidden] { display: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-size: .8rem; color: var(--muted); font-weight: 700; background: rgba(255, 255, 255, .03); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }

.flag { width: 30px; height: 22px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); vertical-align: middle; background: rgba(255,255,255,.08); }
.flag--lg { width: 48px; height: 36px; border-radius: 6px; }
.flag--xl { width: 72px; height: 54px; border-radius: 8px; }
.country { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }

/* ---------- page heads ---------- */
.page-head { padding: clamp(28px, 5vw, 56px) 0 clamp(18px, 3vw, 28px); }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { margin: 0; }
.page-head__row { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; }

/* ---------- empty states ---------- */
.empty-state { text-align: center; padding: 64px 20px; max-width: 560px; margin: 0 auto; }
.empty-state__mark { width: 76px; height: 76px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 22px; border: 2px dashed var(--line); font: 800 28px/1 var(--font-display); color: var(--faint); }
.empty-state p { color: var(--muted); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(8, 4, 24, .72); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal__box { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.modal__box--wide { width: min(1100px, 100%); }

/* ---------- toasts ---------- */
.toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { padding: 14px 18px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; animation: toast-in .25s ease; }
.toast--success { border-color: rgba(61, 220, 151, .6); }
.toast--error { border-color: rgba(255, 90, 106, .6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line-soft); background: rgba(10, 6, 28, .6); }
.site-footer__inner { max-width: var(--container); margin: 0 auto; padding: 44px var(--gutter) 28px; display: grid; gap: 32px; grid-template-columns: 1.6fr repeat(3, 1fr); }
.site-footer__brand p { color: var(--muted); max-width: 40ch; margin-top: 14px; font-size: .92rem; }
.site-footer__col { display: grid; align-content: start; gap: 8px; }
.site-footer__col h2 { font-size: .85rem; color: var(--gold); margin-bottom: 4px; font-family: var(--font-display); }
.site-footer__col a { color: var(--muted); text-decoration: none; font-size: .93rem; }
.site-footer__col a:hover { color: #fff; }
.site-footer__legal { max-width: var(--container); margin: 0 auto; padding: 16px var(--gutter) 28px; color: var(--faint); font-size: .85rem; border-top: 1px solid var(--line-soft); }
@media (max-width: 800px) { .site-footer__inner { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }

/* ---------- maintenance ---------- */
.page-maintenance main { display: grid; place-items: center; min-height: 100vh; }
.maintenance { text-align: center; max-width: 560px; padding: 40px 20px; }
.maintenance p { color: var(--muted); font-size: 1.1rem; }

/* ---------- misc ---------- */
.kbd { font-family: ui-monospace, monospace; font-size: .85em; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.08); }
.divider { height: 1px; background: var(--line-soft); margin: 24px 0; border: 0; }
.cover-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--panel-2), var(--ink-2)); color: var(--faint); font: 800 2rem/1 var(--font-display); }
.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 1.25rem; margin-top: 2em; }
.legal-content li { margin-bottom: .4em; color: var(--text); }
.legal-content p { color: #dcd6f5; }

/* ---------- legal pages ---------- */
.legal-layout { display: grid; gap: 28px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.legal-nav { position: sticky; top: 90px; display: grid; gap: 2px; }
.legal-nav a { padding: 10px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.legal-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.legal-nav a[aria-current] { color: #fff; background: var(--panel); box-shadow: inset 3px 0 0 var(--pink); }
.legal-content > :first-child { margin-top: 0; }
.legal-content h2:first-child { margin-top: 0; }
@media (max-width: 800px) { .legal-layout { grid-template-columns: 1fr; } .legal-nav { position: static; display: flex; flex-wrap: wrap; } }

/* ---------- video recording (tab capture of one element) ---------- */
html.is-recording, html.is-recording body { overflow: hidden !important; cursor: none; }
.rec-stage { position: fixed !important; inset: 0 !important; z-index: 2147483000 !important; width: 100vw !important; height: 100vh !important; max-width: none !important; margin: 0 !important; border-radius: 0 !important; }
.rec-badge { position: fixed; top: 12px; right: 12px; z-index: 2147483001; padding: 6px 12px; border-radius: 999px; background: #e11d48; color: #fff; font: 800 .8rem/1 var(--font-body); pointer-events: none; animation: pulse 1.4s infinite; }
.sys h3 { margin: 22px 0 8px; }
.sys h3:first-child { margin-top: 0; }
.sys-schemes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sys-scheme { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--ink-2); cursor: pointer; }
.sys-scheme:has(input:checked) { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }
.sys-scheme input { margin-top: 3px; flex: none; }
.sys-scheme strong { display: block; }
.sys-scheme small { color: var(--muted); line-height: 1.4; display: block; margin-top: 2px; }
.sys-split { display: flex; gap: 12px; flex-wrap: wrap; }
.sys-split label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.sys-pct { display: flex; align-items: center; gap: 6px; }
.sys-pct input { width: 90px; }
.sys-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--ink-2); margin: 12px 0 4px; max-width: 520px; }
.sys-bar [data-bar="jury"] { background: var(--gold); } .sys-bar [data-bar="demo"] { background: var(--green); } .sys-bar [data-bar="televote"] { background: var(--cyan); }

/* =====================================================================
   Light mode (general pages). Dark is the default; the choice is stored per browser.
   ===================================================================== */
:root[data-theme="light"] {
  --ink: #f4f1fb; --ink-2: #ffffff; --panel: #ffffff; --panel-2: #f3eefe; --line: #dcd3f3; --line-soft: rgba(30, 16, 80, .09);
  --text: #1b1238; --muted: #5b5480; --faint: #8b84aa; --cyan: #0b84b5; --green: #14a46b; --red: #d93448; --orange: #e5801d;
  --shadow: 0 18px 50px -24px rgba(40, 20, 100, .35);
  color-scheme: light;
}
:root[data-theme="light"] body { background: radial-gradient(1200px 600px at 85% -10%, rgba(255, 61, 139, .10), transparent 60%), radial-gradient(900px 500px at -10% 10%, rgba(61, 214, 255, .10), transparent 60%), var(--ink); }
:root[data-theme="light"] a:hover, :root[data-theme="light"] .crumbs a:hover, :root[data-theme="light"] .site-footer__col a:hover,
:root[data-theme="light"] .tab:hover, :root[data-theme="light"] .tab[aria-selected="true"], :root[data-theme="light"] .tab.is-active { color: var(--text); }
:root[data-theme="light"] .site-header { background: rgba(255, 255, 255, .86); }
:root[data-theme="light"] .nav-link:hover, :root[data-theme="light"] .nav-item.is-active > .nav-link { color: var(--text); background: rgba(30, 16, 80, .06); }
:root[data-theme="light"] .nav-link--dev { color: #b07800; }
:root[data-theme="light"] .nav-menu a:hover { background: rgba(30, 16, 80, .06); }
:root[data-theme="light"] .nav-menu__title { color: #b07800 !important; }
:root[data-theme="light"] .btn { --b-bg: rgba(30, 16, 80, .05); }
:root[data-theme="light"] .btn--primary { --b-bg: var(--pink); }
:root[data-theme="light"] .btn--gold { --b-bg: var(--gold); }
:root[data-theme="light"] .btn--cyan { --b-bg: var(--cyan); --b-fg: #fff; }
:root[data-theme="light"] .btn--ghost { --b-bg: transparent; }
:root[data-theme="light"] .btn--danger { --b-fg: #b3192b; }
:root[data-theme="light"] .chip, :root[data-theme="light"] .avatar-button, :root[data-theme="light"] .kbd, :root[data-theme="light"] .pts { background: rgba(30, 16, 80, .06); }
:root[data-theme="light"] .chip--live { color: #b0004a; } :root[data-theme="light"] .chip--closed { color: #8a4a00; }
:root[data-theme="light"] .chip--done { color: #0b6b44; } :root[data-theme="light"] .chip--jury { color: #7a5600; } :root[data-theme="light"] .chip--tele { color: #00668c; }
:root[data-theme="light"] .pts--jury { color: #7a5600; } :root[data-theme="light"] .pts--tele { color: #00668c; }
:root[data-theme="light"] .table th { background: rgba(30, 16, 80, .03); }
:root[data-theme="light"] .table tbody tr:hover { background: rgba(30, 16, 80, .025); }
:root[data-theme="light"] .site-footer { background: rgba(255, 255, 255, .6); }
:root[data-theme="light"] .legal-content p { color: #352d58; }
:root[data-theme="light"] .modal { background: rgba(40, 30, 80, .35); }
:root[data-theme="light"] .flag { box-shadow: 0 0 0 1px rgba(30, 16, 80, .12); }
:root[data-theme="light"] .nav-toggle span:not(.sr-only) { background: var(--text); }

/* ---------- header icons: theme toggle, bell, wallet ---------- */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(127, 127, 127, .08); color: var(--muted); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.theme-toggle span { width: 18px; height: 18px; border-radius: 50%; background: currentColor; box-shadow: inset -6px -4px 0 0 var(--ink); transition: box-shadow .3s; }
:root[data-theme="light"] .theme-toggle span { box-shadow: inset 0 0 0 0 var(--ink), 0 0 0 4px rgba(255, 200, 61, .35); background: var(--gold); }
.bell.has-unread { color: var(--text); }
.bell__count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--pink); color: #fff; font: 800 10px/18px var(--font-body); text-align: center; }
.coin { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3b0 0 18%, #ffd34d 40%, #e8a20c 100%); color: #6b3d00;
  font: 900 9px/1 var(--font-display); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), 0 2px 6px -2px rgba(232, 162, 12, .9); }
.coin--lg { width: 64px; height: 64px; font-size: 22px; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .5), 0 10px 26px -10px rgba(232, 162, 12, .9); }
.wallet-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 9px; border-radius: 999px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, rgba(255, 200, 61, .18), rgba(255, 138, 61, .10)); border: 1px solid rgba(255, 200, 61, .45); font-variant-numeric: tabular-nums; }
.wallet-chip strong { font: 800 .95rem/1 var(--font-display); }
.wallet-chip:hover { color: var(--text); border-color: var(--gold); }
.wallet-chip.bump { animation: wallet-bump .6s cubic-bezier(.3, 1.6, .5, 1); }
.wallet-chip__gift { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px var(--ink); animation: pulse 1.4s infinite; }
@keyframes wallet-bump { 40% { transform: scale(1.14); } }
.toast--gold { border-color: var(--gold); background: linear-gradient(135deg, rgba(255, 200, 61, .22), var(--panel-2)); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 900px) { .nav-account .wallet-chip { order: -1; } }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 24px; }
.tile { padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
a.tile:hover { border-color: var(--pink); color: var(--text); }
.tile strong { display: block; font: 800 1.9rem/1.1 var(--font-display); }
.tile span { color: var(--muted); font-size: .88rem; }
:root[data-theme="light"] .points-bar, :root[data-theme="light"] .auth__tiles span, :root[data-theme="light"] .password-wrap button, :root[data-theme="light"] .points-strip__tile { background: rgba(30, 16, 80, .07); }
:root[data-theme="light"] .search-hit:hover, :root[data-theme="light"] .search-hit.is-focus { background: rgba(30, 16, 80, .06); }
:root[data-theme="light"] .pts--zero { opacity: .5; }
.grid > .panel + .panel, .grid--2 > .panel + .panel { margin-top: 0; }

/* countdowns: fixed width so nothing moves while they tick (also under browser translation) */
.countdown { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 8.5ch; text-align: left; }
.help-list li { margin: 4px 0; }
