/* Bundled fonts (SIL Open Font License, see assets/fonts/OFL-*.txt): the same lettering on every device. */
@font-face {
  font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/fredoka-600-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/fredoka-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/caveat-700-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Caveat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/caveat-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-1: #08131f;
  --bg-2: #10263a;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f6f1e7;
  --muted: #b9c3cf;
  --gold: #f2c14e;
  --gold-2: #e0a526;
  --red: #c8102e;
  --green: #2e8b57;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #1d3b57 0%, var(--bg-2) 35%, var(--bg-1) 100%) fixed;
  min-height: 100vh;
  min-height: 100dvh;
}
[hidden] { display: none !important; }

h1, h2, .festive { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0.01em; }
a { color: var(--gold); }

#snow {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

main {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  gap: 16px;
}

.card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card h1 { font-size: clamp(28px, 7vw, 40px); margin: 6px 0 10px; }
.card p { color: var(--muted); line-height: 1.5; margin: 8px 0; }
.emoji { font-size: 52px; line-height: 1; }
.hint { font-size: 13px; opacity: 0.8; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  font: 600 18px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #2a1a00;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  padding: 16px 26px; border-radius: 999px; margin-top: 14px;
  box-shadow: 0 8px 24px rgba(242, 193, 78, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(242, 193, 78, 0.45); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .link-btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #9ad0ff; outline-offset: 2px; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--card-border); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #e04848, #b52a2a); color: #fff; box-shadow: none; }
.btn.small { font-size: 14px; padding: 10px 16px; margin-top: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.link-btn {
  appearance: none; background: rgba(0, 0, 0, 0.35); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 999px;
  padding: 8px 14px; font: 500 14px/1 system-ui, sans-serif; cursor: pointer;
}

/* ---------- Reveal stage ---------- */
.stage { width: min(1100px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.frame {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: #000; box-shadow: var(--shadow);
}
.frame:fullscreen { border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto; display: flex; align-items: center; justify-content: center; }
.frame:fullscreen .zoomer { width: min(100vw, calc(100vh * 16 / 9)); height: auto; aspect-ratio: 16 / 9; position: relative; }
.zoomer {
  position: absolute; inset: 0;
  transform-origin: 50% 50%;
  transition: transform var(--zoom-ms, 1400ms) cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}
.zoomer video, .zoomer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.zoomer video { object-fit: fill; }
.zoomer canvas { pointer-events: none; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rotate-hint { display: none; color: var(--muted); font-size: 13px; margin: 0; }
@media (orientation: portrait) and (max-width: 700px) { .rotate-hint { display: block; } }
@media (orientation: landscape) and (max-height: 520px) {
  main { padding: 0; }
  .stage { width: min(100vw, calc(100dvh * 16 / 9)); gap: 0; }
  .frame { border-radius: 0; }
  .controls { position: fixed; right: 10px; bottom: 10px; z-index: 5; }
}

/* ---------- Result ---------- */
.result-wrap {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 18, 0.55);
  animation: fade-in 0.5s ease both;
}
.result-card { position: relative; overflow: hidden; }
.result-card .small { text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; color: var(--gold); }
.result-card h2 {
  font-size: clamp(38px, 11vw, 64px); margin: 8px 0 6px; line-height: 1.05;
  color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 0 30px rgba(242, 193, 78, 0.35);
  animation: pop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both 0.15s;
}
.tag-ribbon {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(200, 16, 46, 0.22); border: 1px solid rgba(200, 16, 46, 0.5);
  color: #ffd7dd; font-size: 14px;
}
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 11; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .zoomer { transition: none; }
  .result-wrap, .result-card h2 { animation: none; }
}

/* ---------- Admin ---------- */
.admin main { justify-content: flex-start; align-items: stretch; max-width: 1100px; margin: 0 auto; }
.admin header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin header h1 { margin: 0; font-size: 28px; }
.admin nav { display: flex; gap: 10px; flex-wrap: wrap; }
.panel {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 12px; font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 14px; }
.stat .v { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.check-ok { color: #7ee2a8; font-weight: 600; }
.check-bad { color: var(--danger); font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num { color: var(--muted); width: 36px; }
td input.link { width: 100%; min-width: 180px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border); color: var(--text); border-radius: 8px; padding: 7px 9px; font: 13px ui-monospace, Consolas, monospace; }
.seen { color: #7ee2a8; font-size: 13px; white-space: nowrap; }
.seg { display: inline-flex; align-items: center; gap: 2px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border); border-radius: 999px; padding: 2px; white-space: nowrap; }
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px 9px; border-radius: 999px; opacity: 0.45;
  filter: grayscale(0.6);
}
.seg button[aria-pressed="true"] { background: rgba(242, 193, 78, 0.25); opacity: 1; filter: none; box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.6); }
.seg button:hover { opacity: 0.85; }
.seg button:focus-visible { outline: 2px solid #9ad0ff; outline-offset: 1px; }
.seg-note { font-size: 12px; color: var(--danger); padding: 0 6px 0 2px; }
.unseen { color: var(--muted); font-size: 13px; }
textarea {
  width: 100%; min-height: 260px; resize: vertical;
  background: rgba(0, 0, 0, 0.3); color: var(--text); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 12px; font: 15px/1.5 system-ui, sans-serif;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0f2a1d; border: 1px solid #2e8b57; color: #d6ffe6;
  padding: 12px 18px; border-radius: 12px; z-index: 50; box-shadow: var(--shadow);
  animation: fade-in 0.2s ease both;
}
.toast.error { background: #2a0f12; border-color: #b52a2a; color: #ffd6d6; }
.muted { color: var(--muted); }
.login-card input[type=password] {
  width: 100%; margin-top: 12px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(0, 0, 0, 0.3); color: var(--text); font-size: 16px;
}
.error-text { color: var(--danger); min-height: 1.2em; }

/* ---------- Preview / calibrate ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
label.field input[type=text] {
  padding: 10px; border-radius: 10px; border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.3); color: var(--text); font-size: 15px;
}
input[type=range] { width: 100%; }
.timebar { display: flex; gap: 8px; align-items: center; }
.timebar output { font: 14px ui-monospace, Consolas, monospace; min-width: 70px; text-align: right; }

@media (max-width: 640px) {
  th.hide-sm, td.hide-sm { display: none; }
}

/* ======================================================= platform pages */
.site-header {
  position: relative; z-index: 2; width: min(1100px, 100%); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 0;
}
.site-header .brand { font: 700 20px Georgia, serif; color: var(--text); text-decoration: none; }
#snow + .page { padding-top: clamp(32px, 9vh, 88px); }   /* no header above (login): keep the card off the top edge */
.site-header nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.site-footer { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 32px; }
.site-footer a { color: var(--muted); }
/* team page: what participants get */
.field-hint { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.invite-preview { margin: 4px 0 14px; padding: 12px 14px; border: 1px dashed var(--card-border); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.invite-preview-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.invite-preview .team-info { margin-top: 0; }
.invite-preview .small { font-size: 13px; margin: 2px 0 0; }

/* RO · EN */
.lang-switch { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
.site-footer .lang-switch { margin-left: 10px; }
.lang-switch a { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.lang-switch a:hover { color: var(--text); border-color: var(--card-border); }
.lang-switch a[aria-current="page"] { color: var(--gold); border-color: var(--card-border); }
.page { position: relative; z-index: 1; width: min(1100px, 100%); margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px;
  align-items: stretch; justify-content: flex-start; min-height: auto; box-sizing: border-box; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 24px 0; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 0 0 12px; line-height: 1.1; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.6; }
.hero video { width: 100%; border-radius: 16px; box-shadow: var(--shadow); background: #000; aspect-ratio: 16 / 9; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; }
.step .n { font: 700 28px Georgia, serif; color: var(--gold); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.plan { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px; text-align: center; }
.plan-price { font: 700 28px Georgia, serif; color: var(--gold); }
.plan-max { color: var(--muted); font-size: 14px; margin-top: 4px; }
.plan.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.form-card { width: min(440px, 100%); margin: 24px auto; text-align: left; }
.form-card h1 { text-align: center; }
.field-row { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field-row label { color: var(--muted); font-size: 14px; }
.input, .field-row input, .field-row textarea, .field-row select {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.3); color: var(--text); font: 15px/1.4 system-ui, sans-serif;
}
.form-card .btn { width: 100%; }
.form-links { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-top: 14px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; background: rgba(242, 193, 78, 0.12); border: 1px solid rgba(242, 193, 78, 0.4); }
.notice.ok { background: rgba(46, 139, 87, 0.15); border-color: rgba(46, 139, 87, 0.5); }
.notice.bad { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.45); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.team-card { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; }
.team-card:hover { border-color: var(--gold); }
.team-card h3 { margin: 0 0 6px; font-family: Georgia, serif; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, 0.1); white-space: nowrap; }
.pill.ok { background: rgba(46, 139, 87, 0.3); color: #c9f7dc; }
.pill.wait { background: rgba(242, 193, 78, 0.2); color: #ffe7a8; }
.pill.bad { background: rgba(255, 107, 107, 0.25); color: #ffd6d6; }
.pill.run { background: rgba(154, 208, 255, 0.2); color: #d6ecff; }
.people-table input.input { padding: 8px 10px; font-size: 14px; }
.people-table td { padding: 6px 6px; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 12px 14px; }
.tile .v { font-size: 24px; font-weight: 700; }
.tile .l { color: var(--muted); font-size: 12px; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .ops-grid { grid-template-columns: 1fr; } }
.small-table { font-size: 13px; }
.small-table td, .small-table th { padding: 6px; }
.hint-line { color: var(--muted); font-size: 13px; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(4, 10, 18, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .panel { width: min(760px, 100%); max-height: 85vh; overflow: auto; background: #0f2133; }
.prose { line-height: 1.7; color: var(--text); }
.prose h2 { font-family: Georgia, serif; margin-top: 28px; }
.prose p, .prose li { color: var(--muted); }
.team-info { color: var(--muted); font-size: 14px; margin-top: 8px; }
.team-info div { margin: 2px 0; }
.team-info strong { color: var(--text); font-weight: 600; }
.team-message { white-space: pre-line; font-style: italic; margin: 10px 0 0; }
.reveal-brand { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--card-border); font-size: 12.5px; color: var(--muted); }
.reveal-brand a { color: var(--gold); text-decoration: none; font-weight: 600; }
.reveal-brand a:hover { text-decoration: underline; }