/* Joridiro design system, after the designer's Figma file: Catamaran, 7px corners, hairline
   borders, orange actions, purple for score contests and green for deadline contests.
   The landing page adds scenes.css on top. */

@font-face {
  font-family: 'Catamaran';
  src: url('/fonts/catamaran.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #ea3d09;
  --brand-ink: #ca3508;
  --brand-soft: #ffe9e9;
  --brand-line: #ffc9c9;
  --green: #4cbb25;
  --green-ink: #3a961b;
  --green-soft: #e5f9de;
  --purple: #841ba0;
  --purple-2: #b035d0;
  --purple-soft: #f5e7f8;
  --purple-line: #ecddf0;
  --amber: #a86b00;
  --amber-soft: #fff3d6;
  --ink: #000;
  --ink-2: #33303b;
  --muted: #6a7584;
  --line: #e6e6e9;
  --line-2: #cfcfcf;
  --soft: #f7f7f9;
  --band: #e6e6e9;
  --bg: #fff;
  --night: #05041c;
  --radius: 7px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .16);
  --header-h: 70px;
  --wrap: 1180px;
  --font: 'Catamaran', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.6 var(--font); color: var(--ink); background: var(--bg); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; }
.chip .ico { width: 16px; height: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: .45em 1.1em; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--soft); }
.btn-danger { background: #fff; border-color: var(--line); color: var(--brand); }
.btn-danger:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { min-height: 36px; padding: .25em .85em; font-size: .9rem; }
.btn-lg { min-height: 50px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius);
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { width: min(100% - 32px, 1380px); height: 100%; display: flex; align-items: center; gap: 48px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.logo img { height: 40px; width: auto; display: block; }
.nav { display: flex; gap: 30px; }
.nav a { text-decoration: none; font-weight: 500; font-size: 1.05rem; color: var(--ink); padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--brand); }
.header-actions { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.header-user { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.05rem; font-weight: 500; }
.header-user svg { width: 22px; height: 22px; color: var(--muted); }
.header-user:hover svg { color: var(--ink); }
.header-actions .btn svg { width: 18px; height: 18px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--purple-soft); color: var(--purple); font-weight: 700; text-decoration: none;
}
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px auto; border-radius: 2px; }
@media (max-width: 900px) {
  .site-header .wrap { gap: 24px; }
  .nav { gap: 18px; }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav, .header-actions { display: none; }
  .site-header.open { height: auto; }
  .site-header.open .wrap { flex-wrap: wrap; padding-block: 12px; gap: 12px; }
  .site-header.open .nav { display: flex; flex-direction: column; width: 100%; gap: 6px; order: 3; }
  .site-header.open .header-actions { display: flex; width: 100%; order: 4; margin: 0; justify-content: space-between; }
  .site-header.open .menu-toggle { order: 2; }
}

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 80px; text-align: center; }
.site-footer .wrap { display: grid; justify-items: center; gap: 22px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 1.05rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.site-footer .copy { color: var(--muted); font-size: .9rem; }

/* ---------- surfaces ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .1em .65em; border-radius: 999px;
  font-size: .82rem; font-weight: 600; background: var(--soft); color: var(--ink-2); white-space: nowrap;
}
.chip.live { background: var(--green-soft); color: var(--green-ink); }
.chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.chip.ended { background: var(--soft); color: var(--muted); }
.chip.draft { background: var(--amber-soft); color: var(--amber); }
.chip.score { background: var(--purple-soft); color: var(--purple); }
.chip.deadline { background: var(--green-soft); color: var(--green-ink); }
.chip.pending { background: var(--amber-soft); color: var(--amber); }
.chip.confirmed { background: var(--green-soft); color: var(--green-ink); }
.chip.countdown { background: var(--brand-soft); color: var(--brand); border-radius: var(--radius); padding: .3em .7em; font-size: .9rem; }
.tag { display: inline-block; padding: .3em .7em; border-radius: var(--radius); background: var(--soft); font-size: .92rem; font-weight: 500; }
@keyframes pulse { 50% { opacity: .35; } }

.flames { display: inline-flex; gap: 6px; vertical-align: middle; }
.flames svg { width: 22px; height: 22px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; margin-bottom: 22px; }
.field > label, .field > .label, .label-row { font-weight: 600; font-size: .95rem; }
.label-row { display: flex; justify-content: space-between; gap: 12px; }
.label-row .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.req::after { content: ' *'; color: var(--brand); }
.field .hint { font-size: .88rem; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: .55em 1em; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; transition: border-color .15s;
}
.input::placeholder { color: #8c95a1; }
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { outline: none; border-color: var(--muted); }
.field.has-error .input, .has-error > .input { border-color: var(--brand); }
.field-error { color: var(--brand-ink); font-size: .88rem; font-weight: 600; }
.form-error { background: var(--brand-soft); color: var(--brand-ink); padding: 10px 14px; border-radius: var(--radius); font-weight: 600; margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }

/* Radio cards: a round radio, a title and a line of text. Selected = purple. */
.radio-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.radio { position: relative; display: block; cursor: pointer; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio .face {
  display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; transition: border-color .15s, background-color .15s;
}
.radio .face::before {
  content: ''; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%;
  border: 1px solid var(--line-2); background: #fff; transition: box-shadow .15s, border-color .15s;
}
.radio input:checked + .face { border-color: var(--purple); background: var(--purple-soft); }
.radio input:checked + .face::before { border-color: var(--purple); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--purple); }
.radio input:focus-visible + .face { outline: 2px solid var(--purple); outline-offset: 2px; }
.radio strong { display: block; font-weight: 600; font-size: 1.05rem; }
.radio .sub { display: block; color: var(--ink-2); font-size: .95rem; }
.radio.compact .face { padding: 14px 16px; align-items: center; }
.radio.compact .face::before { margin: 0; }
@media (max-width: 520px) {
  .radio-grid { grid-template-columns: minmax(0, 1fr); }
  .radio-grid:has(.compact) { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .radio.compact .face { padding: 12px; gap: 10px; }
}

/* Toggle switch: a checkbox styled as the designer's orange pill. */
.switch { position: relative; flex: none; width: 60px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background-color .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s ease; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(28px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Upload box (dashed) and upload row (logo). */
.dropzone {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 32px 16px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--soft); cursor: pointer;
  position: relative; overflow: hidden; transition: border-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--muted); }
.dropzone strong { font-weight: 600; font-size: 1.05rem; }
.dropzone .muted { font-size: .92rem; }
.dropzone .btn { margin-top: 10px; pointer-events: none; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.has-image { padding: 0; aspect-ratio: 1680 / 400; border-style: solid; }
.dropzone.has-image img { width: 100%; height: 100%; object-fit: cover; }
.upload-row { display: flex; align-items: center; gap: 22px; }
.upload-row .thumb {
  flex: none; width: 70px; height: 70px; border-radius: var(--radius); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--brand); overflow: hidden; background: #fff;
}
.upload-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-row .thumb svg { width: 22px; height: 22px; }
.upload-row .text { flex: 1; min-width: 0; }
.upload-row .text strong { display: block; font-weight: 600; }
.upload-row .text span { color: var(--muted); font-size: .92rem; }
.upload-row label.btn { position: relative; overflow: hidden; }
.upload-row label.btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Tag input: chips plus a free text field inside one box. */
.taginput { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: text; }
.taginput:focus-within { border-color: var(--muted); }
.taginput .tag { display: inline-flex; align-items: center; gap: 6px; padding: .25em .4em .25em .75em; }
.taginput .tag button { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.taginput input { flex: 1; min-width: 140px; border: 0; outline: 0; padding: 4px; background: none; }

/* ---------- modal & toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 20, .55); display: grid; place-items: center;
  padding: 16px; animation: fade .15s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #fff;
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); animation: rise .2s ease;
}
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 12px; }
.modal-close { background: var(--soft); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; line-height: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.toast-host { position: fixed; z-index: 120; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: rise .2s ease; font-weight: 600; }
.toast.error { background: var(--brand-ink); }

/* ---------- contest cards ---------- */
.grid-cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ccard { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ccard .cover { aspect-ratio: 16 / 7; background: var(--night); position: relative; }
.ccard .cover > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ccard .body { padding: 16px 18px 18px; display: grid; gap: 10px; flex: 1; }
.ccard .top { display: flex; gap: 12px; align-items: center; }
.ccard h3 { margin: 0; font-size: 1.1rem; }
.ccard .company { font-size: .88rem; color: var(--muted); }
.ccard .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ccard .figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.figure .k { font-size: .9rem; color: var(--muted); font-weight: 500; }
.figure .v { font-weight: 600; font-size: 1.05rem; }
.logo-box { width: 44px; height: 44px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); flex: none; overflow: hidden; display: grid; place-items: center; font-weight: 700; color: var(--purple); }
.logo-box img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- page header (app pages) ---------- */
.page-head { padding: 40px 0 24px; }
.page-head p { color: var(--muted); max-width: 60ch; }
.page-band { background: var(--band); text-align: center; padding: 18px 16px; }
.page-band h1 { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35em 1em; font-weight: 600; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.banner-note { background: var(--amber-soft); color: #6b4700; border-radius: var(--radius); padding: 14px 16px; font-weight: 600; margin-bottom: 20px; }

/* ---------- contest page ---------- */
.contest-cover { height: clamp(170px, 27.8vw, 400px); background: var(--night); position: relative; overflow: hidden; }
.contest-cover > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contest-layout {
  width: min(100% - 32px, 1290px); margin: 0 auto; padding-top: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; align-items: start;
}
.contest-title { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 0 32px; align-items: start; }
.contest-title .logo-box { width: 70px; height: 70px; font-size: 1.5rem; }
.contest-title h1 { font-size: clamp(1.35rem, 2.2vw, 1.55rem); margin: 6px 0 4px; }
.contest-title .by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 1.05rem; color: var(--ink-2); }
.contest-title .by a { color: var(--brand); display: inline-flex; }
.contest-title .by svg { width: 20px; height: 20px; }
.contest-body { margin-left: 102px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 22px; }
.lead-text { font-size: 1.05rem; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 40px 0; }
.stats .figure .k { font-size: 1rem; margin-bottom: 8px; }
.stats .figure .v { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.section { margin-top: 56px; scroll-margin-top: calc(var(--header-h) + 16px); }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; font-weight: 600; margin: 0 0 22px; }
.section-title svg { width: 24px; height: 24px; }
.section-title .help { width: 20px; height: 20px; color: var(--muted); cursor: help; }

.prizes { display: grid; gap: 10px; }
.prize { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 6px 20px; align-items: center; padding: 10px 18px; }
.prize .pico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); }
.prize .pico svg { width: 22px; height: 22px; }
.score-type .prize .pico { background: var(--purple); }
.prize.lottery .pico, .score-type .prize.lottery .pico { background: var(--brand); }
.prize.done .pico { opacity: .45; }
.prize .what { font-size: .92rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prize .when { font-weight: 600; }
.prize .amount { font-weight: 600; font-size: 1.2rem; text-align: right; font-variant-numeric: tabular-nums; grid-column: 4; }
.prize .chip.countdown { grid-column: 3; }
.prize .winner { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .95rem; padding: 6px 0 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.prize .decide { display: flex; gap: 8px; margin-left: auto; }

.about { padding: 0 20px; }
.about > p { color: var(--ink-2); line-height: 1.7; }
.about-sub { border-left: 1px solid var(--line); padding: 4px 0 4px 20px; display: grid; gap: 28px; margin-top: 28px; }
.about-sub h3 { font-size: 1.1rem; margin-bottom: .5em; }
.about-sub p { margin: 0; color: var(--ink-2); line-height: 1.7; }

.methods { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.method { padding: 16px; text-align: center; display: grid; gap: 8px; justify-items: center; align-content: start; }
.method .coin { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); }
.method .coin svg { width: 22px; height: 22px; }
.method .pts { width: 100%; background: var(--soft); border-radius: var(--radius); padding: 6px; font-weight: 600; font-size: 1.1rem; display: flex; gap: 6px; justify-content: center; align-items: center; }
.method .pts svg { width: 18px; height: 18px; }
.method .per { font-weight: 600; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
.method .per .help { width: 18px; height: 18px; color: var(--muted); flex: none; }
.method .mine { width: 100%; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.deadline-type .method .coin { background: var(--green-soft); color: var(--green-ink); }

.items { display: grid; gap: 20px; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 16px; }
.item .iico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.item .iico svg { width: 22px; height: 22px; }
.item .t { font-size: .92rem; font-weight: 500; color: var(--ink-2); }
.item .x { font-weight: 500; font-size: 1.05rem; line-height: 1.55; }
.item .star { color: var(--brand); font-weight: 700; }
.item.rule { background: var(--soft); align-items: center; }
.item.rule .iico { background: var(--ink); color: #fff; font-weight: 700; font-size: 1.15rem; }

.ann { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 18px 18px 14px; }
.ann .bm { color: var(--green); padding-top: 2px; }
.ann .bm svg { width: 24px; height: 24px; margin-inline: auto; }
.ann p { margin: 0; font-weight: 500; }
.ann time { display: block; text-align: right; font-size: .92rem; color: var(--ink-2); margin-top: 10px; }
.ann .link { font-size: .88rem; }

.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.qa summary { cursor: pointer; font-weight: 500; font-size: 1.1rem; list-style: none; display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; gap: 20px; align-items: start; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .n { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: .9rem; font-weight: 600; }
.qa summary::after { content: '+'; font-size: 1.6rem; line-height: 1; font-weight: 300; padding-top: 6px; }
.qa details[open] summary::after { content: '–'; }
.qa summary > span:nth-child(2) { padding-top: 6px; }
.qa .answer { margin: 10px 0 0 60px; color: var(--ink-2); }
.ask { display: flex; gap: 20px; margin-top: 20px; align-items: flex-start; }
.ask .field { flex: 1; margin: 0; }

.survey { display: grid; gap: 16px; }
.survey .q { padding: 18px; }
.survey .q h3 { font-size: 1.02rem; font-weight: 600; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.survey .bar-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 32px; gap: 14px; align-items: center; padding: 4px 0; font-size: .95rem; }
.survey .bar-row .b { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.survey .bar-row .b i { display: block; height: 100%; background: var(--purple-2); border-radius: inherit; }
.survey .bar-row .c { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.board { width: 100%; border-collapse: collapse; font-size: .98rem; }
.board th { text-align: left; font-size: .95rem; font-weight: 500; color: var(--muted); padding: 10px 12px; white-space: nowrap; }
.board td { padding: 12px; border-top: 1px solid var(--line); }
.board td.num, .board th.num { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.me td { background: var(--brand-soft); font-weight: 600; }
.board .rank { width: 44px; font-weight: 600; color: var(--muted); }
.board tr:nth-child(-n+3) .rank { color: var(--brand); }

.side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 24px; }
.ring { position: relative; width: 210px; height: 210px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .center .k { font-size: 1rem; color: var(--muted); }
.ring .center .v { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ring .center .s { font-size: .85rem; color: var(--muted); }
.cta { display: grid; gap: 10px; }
.cta .note { font-size: .88rem; color: var(--muted); margin: 0; text-align: center; }
.myentry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; padding: 12px 0; border-block: 1px solid var(--line); }
.myentry .figure .k { font-size: .85rem; }
.toc { display: grid; gap: 4px; }
.toc a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 0; }
.toc a:hover, .toc a.active { color: var(--ink); }

@media (max-width: 1060px) {
  .contest-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .side { position: static; order: -1; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 24px; }
  .side .toc { display: none; }
  .contest-body { margin-left: 0; }
}
@media (max-width: 640px) {
  .contest-title { grid-template-columns: 56px minmax(0, 1fr); gap: 0 16px; }
  .contest-title .logo-box { width: 56px; height: 56px; }
  .contest-title [data-act="share"] { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 28px 0; }
  .prize { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 10px 12px; gap: 6px 12px; }
  .prize .pico { width: 36px; height: 36px; }
  .prize .amount { grid-column: 3; grid-row: 1; }
  .prize .chip.countdown { grid-column: 2 / -1; justify-self: start; }
  .about { padding: 0; }
  .item { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .item .star { display: none; }
  .ask { flex-direction: column; gap: 10px; }
  .ask .btn { width: 100%; }
  .qa summary { grid-template-columns: 34px minmax(0, 1fr) 20px; gap: 12px; font-size: 1rem; }
  .qa summary .n { width: 34px; height: 34px; }
  .qa .answer { margin-left: 46px; }
  .survey .bar-row { grid-template-columns: minmax(0, 1fr) 80px 28px; }
  .board .hide-sm { display: none; }
}

/* ---------- create ---------- */
.create { display: grid; grid-template-columns: 220px minmax(0, 700px); gap: 40px 60px; justify-content: center; padding-top: 48px; width: min(100% - 32px, 1060px); margin-inline: auto; }
.steps-nav { position: sticky; top: calc(var(--header-h) + 48px); display: grid; gap: 12px; align-self: start; margin: 0; padding: 0; list-style: none; }
.steps-nav a { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink-2); font-size: 1rem; }
.steps-nav .dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: #fff; }
.steps-nav .dot svg { width: 10px; height: 10px; color: #fff; display: none; }
.steps-nav li.done .dot { background: var(--green); border-color: var(--green); }
.steps-nav li.done .dot svg { display: block; }
.steps-nav li.current a { color: var(--ink); font-weight: 600; }
.steps-nav li.current .dot { width: 18px; height: 18px; border: 0; border-radius: 3px; background: var(--brand); transform: rotate(45deg); }
.steps-nav li.locked a { pointer-events: none; color: var(--muted); }
.cstep { scroll-margin-top: calc(var(--header-h) + 24px); }
.cstep + .cstep { margin-top: 64px; }
.cstep-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.cstep-head h2 { margin: 0; font-size: 1.45rem; font-weight: 600; }
.help-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: help; border-radius: 50%; }
.help-btn svg { width: 20px; height: 20px; }
.help-btn:hover, .help-btn:focus-visible { background: var(--soft); color: var(--ink); }
.help-btn .tip {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, 80vw);
  background: var(--ink); color: #fff; text-align: left; font-size: .9rem; line-height: 1.5; padding: 12px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.help-btn:hover .tip, .help-btn:focus .tip { display: block; }
.continue { margin-top: 32px; }
.sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.size .face { display: grid; justify-items: center; gap: 4px; padding: 16px 10px 14px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background-color .15s; height: 100%; }
.size { position: relative; display: block; }
.size input { position: absolute; opacity: 0; pointer-events: none; }
.size svg.rocket { width: 54px; height: 64px; }
.size strong { font-weight: 600; font-size: 1.05rem; }
.size .amt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1.1rem; }
.size .amt svg { width: 20px; height: 20px; }
.size input:checked + .face { border: 2px solid var(--purple); padding: 15px 9px 13px; }
.size input:checked + .face .amt { color: var(--purple); }
.size input:focus-visible + .face { outline: 2px solid var(--purple); outline-offset: 2px; }
.size-detail { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 24px; align-items: center; margin: 24px 0 8px; padding: 0 20px; }
.size-detail svg.rocket { width: 132px; height: 132px; }
.size-detail h3 { font-size: 1.25rem; margin-bottom: 4px; }
.size-detail p { margin: 0; color: var(--ink-2); }
.prize-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 24px; align-items: start; }
.facts { display: grid; gap: 16px; }
.fact { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: center; }
.fact .fi { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--purple); }
.fact .fi svg { width: 22px; height: 22px; }
.fact.off .fi { background: var(--line-2); }
.fact b { display: block; font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.fact span { font-size: .95rem; color: var(--ink-2); }
.bill { padding: 24px; }
.bill .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--muted); }
.bill .line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bill .line.total-pool { color: var(--ink); font-weight: 600; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.bill .pay { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.bill .pay b { font-size: 1.5rem; color: var(--ink); font-weight: 600; }
.bill .vat { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }

/* Saved entries (score methods, rules, requirements, questions) and their editor. */
.entries { display: grid; gap: 16px; margin-bottom: 16px; }
.entry { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px 16px 24px; }
.entry .eico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); }
.entry .eico svg { width: 20px; height: 20px; }
.entry.rule .eico { background: var(--ink); color: #fff; font-weight: 700; }
.entry.requirement .eico { background: var(--brand-soft); color: var(--brand); }
.entry .t { color: var(--muted); font-size: .95rem; }
.entry .x { font-weight: 600; font-size: 1.1rem; line-height: 1.4; }
.entry .n { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }
.entry ol { margin: 6px 0 0; padding-left: 1.2em; color: var(--ink-2); }
.entry .side-r { display: flex; align-items: center; gap: 8px; }
.entry .pts { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: var(--radius); padding: 2px 12px; font-weight: 600; white-space: nowrap; }
.entry .pts svg { width: 18px; height: 18px; }
.editor { background: var(--soft); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.editor .row { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.editor .row .wide { grid-column: span 2; }
.editor .field { margin-bottom: 18px; }
.editor .actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.editor .actions > div { display: flex; gap: 8px; }
.add-bar { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 0; border-radius: var(--radius); background: var(--band); font-weight: 600; cursor: pointer; }
.add-bar svg { width: 20px; height: 20px; color: var(--brand); }
.add-bar:hover { background: #dcdce0; }
.toggle-q { display: grid; gap: 14px; margin-bottom: 28px; }
.toggle-q .q { display: flex; justify-content: space-between; align-items: center; gap: 24px; font-weight: 500; }
.finish { margin-top: 28px; display: grid; gap: 18px; }
.finish .check a { color: var(--brand); }
@media (max-width: 900px) {
  .create { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .steps-nav { position: sticky; top: var(--header-h); z-index: 10; display: flex; gap: 18px; overflow-x: auto; background: #fff; padding: 12px 0; margin: 0 -16px; padding-inline: 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .steps-nav a { white-space: nowrap; font-size: .95rem; gap: 8px; }
  .cstep { scroll-margin-top: calc(var(--header-h) + 70px); }
}
@media (max-width: 640px) {
  .sizes { gap: 8px; }
  .size svg.rocket { width: 40px; height: 48px; }
  .size strong { font-size: .95rem; }
  .size-detail { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 0; }
  .size-detail svg.rocket { width: 72px; height: 72px; }
  .prize-split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .editor { padding: 16px; }
  .editor .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .entry .side-r { grid-column: 2; }
  .upload-row { flex-wrap: wrap; gap: 14px; }
  .upload-row .text { flex-basis: calc(100% - 90px); }
  .toggle-q .q { gap: 14px; }
}

/* ---------- dashboard ---------- */
.dash-banner { height: 180px; position: relative; overflow: hidden; background: linear-gradient(90deg, #6d1fd6 0%, #4510d6 45%, #2a0bd4 100%); }
.dash-banner svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dash { width: min(100% - 32px, 1380px); margin-inline: auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 70px; align-items: start; }
.dash-side { text-align: center; position: relative; }
.dash-side .big-avatar {
  width: 160px; height: 160px; border-radius: 50%; margin: -60px auto 22px; display: grid; place-items: center;
  background: #d9d4cb; border: 4px solid #fff; color: var(--purple); font-size: 3rem; font-weight: 700; overflow: hidden;
}
.dash-side .big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-side .name { font-size: 1.3rem; font-weight: 600; }
.dash-side .mail { font-size: 1.05rem; color: var(--ink-2); overflow-wrap: anywhere; }
.dash-nav { display: grid; gap: 8px; margin-top: 24px; text-align: left; }
.dash-nav a { display: flex; align-items: center; gap: 18px; text-decoration: none; padding: 10px 8px; border-radius: var(--radius); font-size: 1.05rem; }
.dash-nav a svg { width: 22px; height: 22px; color: var(--ink-2); }
.dash-nav a:hover { background: var(--soft); }
.dash-nav a[aria-current="page"] { background: var(--band); font-weight: 600; }
.dash-main { padding-top: 26px; min-width: 0; }
.dash-main > h1 { font-size: 1.6rem; margin-bottom: 26px; }
.dash-section + .dash-section { margin-top: 48px; }
.dash-section .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dash-section .head h2 { margin: 0; font-size: 1.15rem; font-weight: 500; color: var(--ink-2); }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 24px; background: var(--amber-soft); border-radius: var(--radius); font-weight: 600; color: #6b4700; }
.todo .btn { margin-left: auto; }
.table-wrap { overflow-x: auto; }
.table-wrap .board { min-width: 760px; }
.table-wrap .board th { font-size: 1.02rem; color: var(--ink-2); padding: 14px 12px; }
.table-wrap .board td { padding: 16px 12px; }
.table-wrap .board td a { font-weight: 600; text-decoration: none; }
.table-wrap .board td a:hover { color: var(--brand); }
.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; min-width: 110px; }
.bar i { display: block; height: 100%; border-radius: inherit; }
.bar.deadline i { background: var(--green); }
.bar.score i { background: var(--purple); }
.details-form .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 50px; }
.details-form .upload-row { margin-bottom: 26px; }
@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dash-side { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 18px; align-items: center; text-align: left; }
  .dash-side .big-avatar { width: 96px; height: 96px; margin: -36px 0 0; font-size: 2rem; grid-row: span 2; }
  .dash-side .name { align-self: end; }
  .dash-side .mail { align-self: start; font-size: .95rem; }
  .dash-nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
  .dash-nav a { padding: 8px 12px; gap: 8px; }
  .dash-banner { height: 110px; }
  .details-form .grid2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- auth ---------- */
.auth { min-height: calc(100dvh - var(--header-h)); display: grid; place-items: center; padding: 40px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent); }
.auth .card { width: min(440px, 100%); padding: 30px; box-shadow: var(--shadow-lg); border-radius: var(--radius-lg); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: var(--radius); padding: 4px; margin-bottom: 22px; }
.tabs button { border: 0; background: none; padding: 10px; border-radius: 5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.demo-hint { margin-top: 18px; font-size: .88rem; color: var(--muted); background: var(--soft); border-radius: var(--radius); padding: 10px 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
