/*
  VOICE: tajemný, ale čitelný – jako ilustrovaný hermetický rukopis
  IDEA: noční obloha nad pergamenovými listy; karta Mága jako brána
  PICTURE: mág se čtyřmi živly na úvodu, ke každé otázce vlastní kresba okruhu
  COLOUR: hluboká noční zeleň, pergamen, rumělka (elektrické) a lapis (magnetické), zlato jako akcent
  TYPE: Cinzel pro nadpisy, Alegreya pro text, Alegreya Sans pro ovládání
*/
:root {
  --night: #0e2422;
  --night-2: #13302d;
  --paper: #f3ead6;
  --paper-2: #e9dcc0;
  --ink: #2b1f17;
  --muted: #6b5a48;
  --gold: #c9a13b;
  --gold-2: #e7c76a;
  --red: #c2412d;
  --blue: #2d5c9e;
  --ok: #3f7a4a;
  --bad: #b03a2a;
  --radius: 14px;
}

* { box-sizing: border-box; min-width: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, #1d4440 0%, transparent 60%),
    var(--night);
  color: var(--paper);
  font: 17px/1.6 "Alegreya", Georgia, serif;
  overflow-x: clip;
}

a { color: var(--gold-2); }

[hidden] { display: none !important; }

/* ---------- hlavička ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(5vw, 16px);
  border-bottom: 1px solid rgba(201, 161, 59, .25);
}
.brand {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .04em;
  color: var(--gold-2);
  text-decoration: none;
}
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a {
  font-family: "Alegreya Sans", system-ui, sans-serif;
  color: var(--paper);
  text-decoration: none;
  padding: 8px 2px;
}
.top nav a:hover { color: var(--gold-2); }

/* ---------- úvod ---------- */
.view { padding: clamp(24px, 4vw, 56px) max(5vw, 16px); max-width: 1240px; margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  min-height: min(78vh, 720px);
}

h1, h2, .section-title {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(38px, 6vw, 64px); margin: 0 0 16px; color: var(--gold-2); }
.lead { font-size: 19px; max-width: 34em; margin: 0 0 28px; color: #e6dcc6; }

.hero-art svg { width: 100%; height: auto; display: block; max-height: 640px; }
.hero-art .tw { animation: tw 3.2s ease-in-out infinite; }
.hero-art .tw:nth-child(2n) { animation-delay: -1.4s; }
@keyframes tw { 50% { opacity: .2; } }

.start {
  background: rgba(243, 234, 214, .06);
  border: 1px solid rgba(201, 161, 59, .35);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 560px;
}
.start label {
  display: block;
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-weight: 500;
  margin-bottom: 8px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row input { flex: 1 1 220px; }

input[type=text], input[type=password] {
  font: 16px "Alegreya Sans", system-ui, sans-serif;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--paper-2);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.hint { font-family: "Alegreya Sans", system-ui, sans-serif; font-size: 14px; color: #cfc4ad; margin: 10px 0 0; }
.error { color: #ffb4a6; font-family: "Alegreya Sans", system-ui, sans-serif; font-size: 15px; margin: 8px 0 0; min-height: 1em; }

/* ---------- tlačítka ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 10px;
  font: 600 16px "Alegreya Sans", system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform .12s ease, background .12s ease;
}
.btn:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.btn.primary { background: var(--gold); color: #1d150c; }
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ---------- kvíz ---------- */
.quiz-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: "Alegreya Sans", system-ui, sans-serif; }
.quiz-head p { margin: 0; }
.count { color: var(--gold-2); font-weight: 700; }
.bar { height: 6px; background: rgba(243, 234, 214, .15); border-radius: 6px; margin: 12px 0 20px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold), var(--blue)); transition: width .3s ease; }

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.qcard { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); overflow: hidden; }
.qart {
  margin: 0;
  background: var(--paper-2);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  border-right: 1px solid rgba(43, 31, 23, .12);
}
.qart svg.art { width: 100%; height: auto; display: block; }
.qart figcaption {
  font-family: "Cinzel", Georgia, serif;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
}
.qbody { padding: clamp(20px, 3vw, 36px); }
.qbody h2 { font-family: "Alegreya", Georgia, serif; font-weight: 600; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.3; margin: 0 0 20px; }

.options { display: grid; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid #d8c8a6;
  background: #fffaf0;
  color: var(--ink);
  font: 17px/1.35 "Alegreya", Georgia, serif;
  cursor: pointer;
}
.opt:hover { border-color: var(--gold); }
.opt:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.opt .mark {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 14px "Alegreya Sans", system-ui, sans-serif;
  background: var(--paper-2);
  color: var(--muted);
}
.opt[aria-checked=true] { border-color: var(--ink); background: #f6edd6; }
.opt[aria-checked=true] .mark { background: var(--ink); color: var(--paper); }

.qnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.qnav .btn.ghost { color: var(--ink); }
.qbody .error { color: var(--bad); }

.dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.dots button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(243, 234, 214, .4);
  background: transparent;
  color: var(--paper);
  font: 13px "Alegreya Sans", system-ui, sans-serif;
  cursor: pointer;
}
.dots button.done { background: rgba(201, 161, 59, .35); border-color: var(--gold); }
.dots button.current { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------- výsledek ---------- */
.score-card {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: clamp(20px, 3vw, 40px);
}
.score-art svg { width: 100%; height: auto; display: block; }
.kicker { font-family: "Cinzel", Georgia, serif; font-size: 22px; margin: 0; color: var(--muted); }
.score { font-family: "Cinzel", Georgia, serif; font-size: clamp(56px, 9vw, 96px); line-height: 1; margin: 8px 0 16px; color: var(--ink); }
.score small { font-size: .4em; color: var(--muted); }
.facts { display: flex; gap: 28px; margin: 0 0 22px; flex-wrap: wrap; }
.facts dt { font: 14px "Alegreya Sans", system-ui, sans-serif; color: var(--muted); }
.facts dd { margin: 0; font: 700 24px "Alegreya Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.score-card .actions .btn.ghost { color: var(--ink); }

.section-title { font-size: clamp(26px, 3.4vw, 36px); margin: 40px 0 14px; color: var(--gold-2); }

.review { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.review li {
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px 14px 56px;
  position: relative;
}
.review li::before {
  content: "";
  position: absolute;
  left: 16px; top: 16px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ok);
}
.review li.bad::before { background: var(--bad); }
.review li::after {
  content: "✓";
  position: absolute;
  left: 16px; top: 16px;
  width: 26px; line-height: 26px;
  text-align: center;
  color: #fff;
  font: 700 15px/26px "Alegreya Sans", system-ui, sans-serif;
}
.review li.bad::after { content: "✗"; }
.review .rq { font-weight: 600; margin: 0 0 4px; }
.review .ra { margin: 0; font-family: "Alegreya Sans", system-ui, sans-serif; font-size: 15px; color: var(--muted); }
.review .ra b { color: var(--ink); }

/* ---------- pořadí ---------- */
.board-band { background: var(--night-2); border-top: 1px solid rgba(201, 161, 59, .25); }
.board-inner { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 4vw, 56px) max(5vw, 16px); }
.board-band .section-title { margin-top: 0; }
.hint.light { margin: 0 0 16px; }
.scroll { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-family: "Alegreya Sans", system-ui, sans-serif; background: var(--paper); color: var(--ink); border-radius: 12px; overflow: hidden; }
.board th, .board td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e0d2b3; }
.board th { background: var(--paper-2); font-weight: 700; font-size: 14px; }
.board td.num, .board th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board tr:last-child td { border-bottom: 0; }
.board td.rank { font-weight: 700; width: 3em; }
.board tr.top1 td.rank { color: #a07a14; }
.board tr.me td { background: #fbeec2; }
.board td.empty { text-align: center; color: var(--muted); padding: 24px; }

.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px max(5vw, 16px);
  font: 14px "Alegreya Sans", system-ui, sans-serif;
  color: #b9ae96;
}
.foot p { margin: 0; max-width: 60em; }

/* ---------- úzké obrazovky ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: -1; max-width: 360px; margin: 0 auto; width: 100%; }
  .qcard { grid-template-columns: 1fr; }
  .qart { border-right: 0; border-bottom: 1px solid rgba(43, 31, 23, .12); padding: 14px; }
  .qart svg.art { max-height: 170px; }
  .score-card { grid-template-columns: 1fr; }
  .score-art { max-width: 200px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .board th:nth-child(5), .board td:nth-child(5) { display: none; }
  .board th, .board td { padding: 10px 8px; }
  .qnav .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art .tw { animation: none; }
  html { scroll-behavior: auto; }
  .bar span { transition: none; }
}

/* =====================================================================
   APP – everything below extends the quiz look to the whole site
   ===================================================================== */
:root {
  --el-ohen: #c2412d; --el-voda: #4f7a4a; --el-vzduch: #2d5c9e; --el-zeme: #b08a1e;
  --line: #e0d2b3;
  --sans: "Alegreya Sans", system-ui, sans-serif;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #1d150c; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.loading { padding: 80px 20px; text-align: center; font-family: var(--sans); color: #cfc4ad; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(14, 36, 34, .94); backdrop-filter: blur(6px); flex-wrap: wrap; }
.top-right { display: flex; align-items: center; gap: 10px; order: 3; }
.site-nav { order: 2; flex: 1; display: flex; justify-content: flex-end; }
#nav-links { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
#nav-links a { font-family: var(--sans); color: var(--paper); text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; }
#nav-links a:hover { color: var(--gold-2); }
#nav-links a.active { color: var(--gold-2); border-bottom-color: var(--gold); }
#nav-links a.btn { padding: 6px 14px; border: 0; color: #1d150c; }
#nav-links .user-link { border: 1px solid rgba(201, 161, 59, .45); border-radius: 999px; padding: 5px 12px; }
.lang-switch { display: inline-flex; border: 1px solid rgba(201, 161, 59, .45); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: transparent; color: var(--paper); border: 0; font: 600 13px var(--sans); padding: 6px 10px; min-height: 32px; cursor: pointer; }
.lang-switch button[aria-pressed=true] { background: var(--gold); color: #1d150c; }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid rgba(201, 161, 59, .45); border-radius: 10px; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--paper); }
.btn.small { min-height: 36px; font-size: 15px; }

@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .site-nav { order: 4; flex-basis: 100%; display: none; }
  .site-nav.open { display: block; }
  #nav-links { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
  #nav-links a { padding: 12px 4px; border-bottom: 1px solid rgba(201, 161, 59, .15); }
  #nav-links a.btn { margin-top: 10px; }
  #nav-links .user-link { border-radius: 10px; margin-top: 8px; }
}

/* ---------- general layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: clamp(22px, 4vw, 48px) max(5vw, 16px); display: grid; gap: 18px; align-content: start; }
.page.narrow { max-width: 520px; }
.page > * { margin-top: 0; margin-bottom: 0; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(32px, 5vw, 52px); }
.page-head .lead { margin: 0; }
.page-head a { color: var(--gold-2); text-decoration: none; }
.lead.small { font-size: 16px; color: #cfc4ad; font-family: var(--sans); }
.eyebrow { font: 600 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.card.pad { padding: clamp(18px, 3vw, 28px); }
.card h2, .card h3 { color: var(--ink); }
.ink { color: var(--ink) !important; margin-top: 0; }
h2.sub { font-size: 22px; margin: 0 0 14px; }
h3.mini { font: 700 16px var(--sans); margin: 16px 0 8px; }
.muted { color: var(--muted); }
.muted-light { color: #cfc4ad; font-family: var(--sans); }
.hint.ink-hint { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
.notice { background: rgba(243, 234, 214, .1); border: 1px solid rgba(201, 161, 59, .45); border-left-width: 5px; padding: 12px 16px; border-radius: 10px; font-family: var(--sans); margin: 0; }
.notice.ok { border-color: #6fae7b; }
.notice.bad { border-color: #e0806e; }
.card .notice { color: var(--ink); background: #fff7e4; }
.empty-state { text-align: center; color: var(--ink); }
.empty-state .btn { margin-top: 6px; }
.tag { display: inline-block; font: 600 12px var(--sans); padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.tag.gold { background: #f3dc97; color: #5b4207; }
.tag.ok { background: #cfe6cf; color: #24512d; }
.badge { font: 600 13px var(--sans); padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok); color: #fff; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.field > span, .field > legend { font: 600 15px var(--sans); color: var(--ink); }
.field small { font: 13px var(--sans); color: var(--muted); }
input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  font: 16px var(--sans); padding: 11px 14px; min-height: 48px; border-radius: 10px;
  border: 2px solid var(--paper-2); background: #fffaf0; color: var(--ink); width: 100%;
}
input[type=text], input[type=password] { background: #fffaf0; }
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.card input, .card select, .card textarea { border-color: #d8c8a6; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid #d8c8a6; border-radius: 10px; cursor: pointer; font-family: var(--sans); color: var(--ink); background: #fffaf0; }
.radio + .radio { margin-top: 8px; }
.radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.radio:has(input:checked) { border-color: var(--ink); }
.radio small { color: var(--muted); }
.row .field { flex: 1 1 180px; }
.error:empty { display: none; }
.card .error { color: var(--bad); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 56px; font-size: 18px; padding: 12px 28px; }
.btn.icon { width: 48px; padding: 0; font-size: 26px; line-height: 1; color: var(--paper); border-color: rgba(201, 161, 59, .5); }
.btn.ghost.ink, .card .btn.ghost { color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: #942e20; }
.btn.ghost:hover { background: rgba(201, 161, 59, .12); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.linkish.light { color: var(--gold-2); }
.auth-card h1 { font-size: 30px; margin: 0; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--sans); }
.auth-links a { color: var(--blue); }
.playing-as { margin: 0 0 12px; font-family: var(--sans); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(201, 161, 59, .35); overflow-x: auto; }
.tabs a { font: 600 16px var(--sans); color: #cfc4ad; text-decoration: none; padding: 10px 16px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--paper); }
.tabs a.active { color: var(--gold-2); border-bottom-color: var(--gold); }

/* ---------- stats tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: rgba(243, 234, 214, .08); border: 1px solid rgba(201, 161, 59, .35); border-radius: 12px; padding: 12px 16px; }
.stat span { display: block; font: 14px var(--sans); color: #cfc4ad; }
.stat strong { font: 700 28px var(--sans); font-variant-numeric: tabular-nums; color: var(--gold-2); }
.stat.ok strong { color: #9fd3a6; }
.stat.bad strong { color: #f0a493; }
.board td a { color: var(--blue); }
.nowrap { white-space: nowrap; }
.nowrap .btn + .btn { margin-left: 6px; }
.pbar { display: inline-block; width: 60px; height: 8px; border-radius: 8px; background: var(--paper-2); vertical-align: middle; overflow: hidden; margin-right: 4px; }
.pbar i { display: block; height: 100%; background: var(--ok); }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--paper); color: var(--ink); border-left: 5px solid var(--ok); padding: 12px 16px; border-radius: 10px; font-family: var(--sans); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: opacity .3s, transform .3s; }
.toast.error { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); }
.modal { position: fixed; inset: 0; background: rgba(5, 12, 11, .75); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal-box { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: clamp(18px, 3vw, 28px); }
.modal-box.wide { width: min(860px, 100%); }
.modal-box h2 { margin: 0; font-size: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal .review li { background: #fffaf0; border: 1px solid var(--line); }
.confirm-text { font-size: 18px; margin: 0 0 18px; color: var(--ink); }

/* ---------- home ---------- */
.hero-text .actions { margin-bottom: 8px; }
.features { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.feature { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 16px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.feature:hover { transform: translateY(-3px); }
.feature:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; }
.feature-art { background: var(--paper-2); border-radius: 10px; padding: 8px; display: grid; place-items: center; }
.feature-art svg { width: 100%; height: auto; }
.feature h2 { font-size: 21px; margin: 2px 0 6px; color: var(--ink); }
.feature p { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.band { background: var(--night-2); border-top: 1px solid rgba(201, 161, 59, .25); border-bottom: 1px solid rgba(201, 161, 59, .25); margin-top: 20px; }
.band-inner { max-width: 1240px; margin: 0 auto; padding: 32px max(5vw, 16px); text-align: center; }
.elements-row { display: flex; justify-content: center; gap: clamp(14px, 4vw, 48px); flex-wrap: wrap; }
.el-chip { display: grid; justify-items: center; gap: 4px; font-family: "Cinzel", Georgia, serif; color: var(--paper); }
.el-chip .el-ico { filter: drop-shadow(0 0 6px rgba(243, 210, 122, .25)); }
.band-quote { font-style: italic; color: #e6dcc6; margin: 20px 0 0; font-size: 19px; }
.el-ico { vertical-align: middle; flex: none; }

/* ---------- support ---------- */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.support-card { display: grid; gap: 12px; justify-items: center; text-align: center; color: var(--ink); }
.support-card h2, .support-card p { margin: 0; }
.qr { width: min(100%, 320px); height: auto; border-radius: 12px; background: #fff; padding: 10px; border: 1px solid var(--line); }
.support-art { width: min(100%, 260px); }
.support-art svg { width: 100%; height: auto; }
.thanks { text-align: center; font-family: "Cinzel", Georgia, serif; color: var(--gold-2); font-size: 22px; }

/* ---------- journal: day ---------- */
.day-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-title { text-align: center; display: grid; gap: 6px; justify-items: center; }
.day-title h2 { margin: 0; font-size: clamp(20px, 3vw, 28px); color: var(--paper); }
.day-title h2::first-letter { text-transform: uppercase; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; text-decoration: none; color: var(--paper); border: 1px solid rgba(201, 161, 59, .25); font-family: var(--sans); }
.wday span { font-size: 12px; text-transform: uppercase; color: #cfc4ad; }
.wday b { font-size: 18px; }
.wday i { width: 10px; height: 10px; border-radius: 50%; background: transparent; border: 1px solid rgba(243, 234, 214, .3); }
.wday.full i { background: #7cc489; border-color: #7cc489; }
.wday.part i { background: var(--gold); border-color: var(--gold); }
.wday.miss i { background: #d9694f; border-color: #d9694f; }
.wday.sel { background: rgba(201, 161, 59, .22); border-color: var(--gold); }
.wday.future { opacity: .55; }
.day-progress { display: flex; align-items: center; gap: 16px; font-family: var(--sans); }
.day-progress p { margin: 0; font-size: 18px; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(243, 234, 214, .15) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--night); display: grid; place-items: center; font: 700 16px var(--sans); }
.ex-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.ex-card { padding: 16px 18px; display: grid; gap: 10px; align-content: start; border-left: 6px solid var(--paper-2); }
.ex-card.done { border-left-color: var(--ok); }
.ex-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.ex-head h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.ex-note { margin: 0; font: 14px/1.4 var(--sans); color: var(--muted); display: block; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 10px; border: 2px solid #d8c8a6; background: #fffaf0; color: var(--ink); font: 600 15px var(--sans); cursor: pointer; padding: 6px; }
.slot .box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.slot.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.slot.on .box { border-color: #fff; background: #fff; }
.slot.on .box::after { content: "✓"; color: var(--ok); font-size: 14px; font-weight: 700; line-height: 1; }
.slot:focus-visible, .cbtn:focus-visible, .cval:focus-visible, .ch:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.counter { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; }
.cbtn { height: 56px; border-radius: 12px; border: 2px solid #d8c8a6; background: #fffaf0; color: var(--ink); font: 700 28px var(--sans); cursor: pointer; }
.cbtn.plus { background: var(--gold); border-color: var(--gold); color: #1d150c; }
.cbtn:active { transform: scale(.96); }
.cval { background: transparent; border: 0; cursor: pointer; color: var(--ink); font-family: var(--sans); display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.cval b { font-size: 34px; font-variant-numeric: tabular-nums; }
.cval small { font-size: 16px; color: var(--muted); }

/* ---------- journal: overview ---------- */
.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid rgba(201, 161, 59, .5); border-radius: 10px; overflow: hidden; }
.seg a { font: 600 15px var(--sans); color: var(--paper); text-decoration: none; padding: 10px 16px; }
.seg a.active { background: var(--gold); color: #1d150c; }
.period-nav { display: flex; align-items: center; gap: 12px; }
.period-nav h2 { margin: 0; font-size: 22px; color: var(--paper); min-width: 9em; text-align: center; text-transform: capitalize; }
.matrix { border-collapse: separate; border-spacing: 3px; font-family: var(--sans); color: var(--ink); width: 100%; }
.matrix th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 2px; }
.matrix th span { display: block; text-transform: uppercase; font-size: 10px; }
.matrix th.now { color: var(--ink); text-decoration: underline; }
.matrix th a { color: var(--blue); text-decoration: none; text-transform: capitalize; }
.matrix .mx-name { text-align: left; font-size: 14px; color: var(--ink); min-width: 130px; max-width: 200px; padding-right: 8px; }
.mx { height: 32px; min-width: 28px; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 700; background: #f1e6cd; color: var(--muted); }
.mx.ok { background: var(--ok); color: #fff; }
.mx.part { background: #ecd27f; color: #5b4207; }
.mx.miss { background: #f2c4b8; color: #8a2b1d; }
.mx.open { background: #fffaf0; border: 1px dashed #d8c8a6; }
.mx.na { background: transparent; }
.mx.fut { background: #f7f0df; }
.mx small { font-size: 11px; }
.matrix.week .mx { height: 40px; font-size: 15px; }
.mx-sum th, .mx-sum td { border-top: 2px solid var(--line); }
.hm { --h: 0; height: 38px; min-width: 52px; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--ok) calc(var(--h) * 1%), #f3e9d2); }
.hm.na { background: #f7f0df; color: var(--muted); }
.legend { font: 13px var(--sans); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 12px 0 0; }
.lg { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #f1e6cd; }
.lg.ok { background: var(--ok); color: #fff; }
.lg.part { background: #ecd27f; }
.lg.miss { background: #f2c4b8; color: #8a2b1d; }
.lg.na { background: transparent; border: 1px solid var(--line); }
.lg.negc { background: #7a3a2e; }
.lg.posc { background: var(--gold); }

/* ---------- journal: manage ---------- */
.manage-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.manage-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.mr-main { display: grid; gap: 3px; flex: 1 1 260px; }
.mr-main b { font-size: 18px; }
.mr-main small { font-family: var(--sans); }
.mr-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- introspection ---------- */
.intro-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; }
.how { color: var(--ink); display: grid; grid-template-columns: 1fr 150px; gap: 10px 16px; }
.how h2 { grid-column: 1 / -1; margin: 0; }
.steps-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 16px; }
.mirror-art svg { width: 100%; height: auto; }
.round-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.round { padding: 18px; color: var(--ink); text-decoration: none; display: grid; gap: 6px; align-content: start; }
.round:hover { box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 2px var(--gold); }
.round h3 { margin: 0; font-size: 21px; }
.round h3 a { color: var(--ink); text-decoration: none; }
.round p { margin: 0; }
.round-facts { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 0; font-family: var(--sans); }
.round-facts dt { font-size: 13px; color: var(--muted); }
.round-facts dd { margin: 0; font-weight: 700; font-size: 16px; }
.round-facts dd small { font-weight: 400; color: var(--muted); }
.mirror-intro { margin: 0; color: #e6dcc6; font-style: italic; max-width: 50em; }
.stepper { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.stepper li { display: flex; align-items: center; gap: 8px; font: 600 15px var(--sans); color: #a99f88; padding: 10px; border-radius: 10px; border: 1px solid rgba(201, 161, 59, .2); }
.stepper li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; flex: none; font-size: 14px; }
.stepper li.done { color: #9fd3a6; }
.stepper li.current { color: #1d150c; background: var(--gold); border-color: var(--gold); }
.trait-add .row input { flex: 1 1 240px; }
.trait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.trait { display: flex; align-items: center; gap: 12px; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 10px 14px; flex-wrap: wrap; }
.trait .tt { flex: 1 1 200px; font-size: 18px; }
.trait time { font: 13px var(--sans); color: var(--muted); }
.tr-act { display: flex; gap: 6px; }
.empty-li { padding: 10px 4px; color: #cfc4ad; }
.phase-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid rgba(201, 161, 59, .25); }
.phase-actions .btn.ghost { color: var(--paper); }
.assign-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.assign { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.assign .tt { font-size: 18px; flex: 1 1 200px; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.ch { --c: var(--ink); display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 6px 12px; border-radius: 10px; border: 2px solid #d8c8a6; background: #fffaf0; color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.ch:hover { border-color: var(--c); }
.ch.el.on { background: var(--c); border-color: var(--c); color: #fff; }
.ch.el.on .el-ico { stroke: #fff; }
.ch.grp.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.groups-help { color: var(--ink); }
.groups-def { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.el-head { --c: var(--gold); display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 22px; color: var(--paper); border-bottom: 2px solid var(--c); padding-bottom: 4px; }
.mirror-table { width: 100%; border-collapse: collapse; background: var(--paper); color: var(--ink); border-radius: 12px; overflow: hidden; min-width: 640px; }
.mirror-table th, .mirror-table td { border: 1px solid var(--line); padding: 10px; vertical-align: top; }
.mirror-table thead th { --c: var(--ink); font-family: "Cinzel", Georgia, serif; color: var(--c); background: var(--paper-2); }
.mirror-table tbody th { text-align: left; width: 22%; font-family: var(--sans); font-weight: 400; }
.mirror-table tbody th small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 4px; }
.mirror-table ul { margin: 0; padding-left: 1.1em; }
.pair-bars { display: grid; gap: 10px; }
.pb-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.pb-label { display: flex; align-items: center; gap: 6px; font: 600 15px var(--sans); color: var(--ink); }
.pb-bars { display: grid; gap: 3px; }
.pb { display: flex; align-items: center; gap: 6px; height: 16px; }
.pb i { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.pb.neg i { background: #7a3a2e; }
.pb.pos i { background: var(--gold); }
.pb span { font: 700 13px var(--sans); color: var(--ink); }
.stack-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; font-family: var(--sans); color: var(--ink); }
.sr-label { font-size: 14px; font-weight: 600; }
.stackbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.stackbar i { display: grid; place-items: center; color: #fff; font: 700 12px var(--sans); font-style: normal; }
.stackbar.empty { display: grid; place-items: center; color: var(--muted); }
.balance { display: grid; gap: 10px; }
.bal-row { display: grid; grid-template-columns: 110px 1fr 48px; gap: 10px; align-items: center; }
.bal-track { display: grid; grid-template-columns: 1fr 1fr; height: 18px; }
.bal-half { display: flex; }
.bal-half.l { justify-content: flex-end; border-right: 2px solid var(--ink); }
.bal-half.l i { background: #7a3a2e; border-radius: 4px 0 0 4px; }
.bal-half.r i { background: var(--gold); border-radius: 0 4px 4px 0; }
.bal-half i { display: block; height: 100%; }
.bal-val { font: 700 15px var(--sans); text-align: right; color: var(--muted); }
.bal-val.neg { color: #8a2b1d; }
.bal-val.pos { color: #6b4f0a; }
.grid-table th, .grid-table td { text-align: center; }
.grid-table tbody th { text-align: left; }
.compare-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.delta.up { color: #6b4f0a; font-weight: 700; }
.delta.down { color: #24512d; font-weight: 700; }
.diff-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; color: var(--ink); }
.diff-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.diff-list.gone li { text-decoration: line-through; text-decoration-color: rgba(43, 31, 23, .4); }
.gtag { font: 600 11px var(--sans); background: var(--paper-2); border-radius: 999px; padding: 1px 6px; margin-left: 4px; color: var(--muted); }

/* ---------- challenges ---------- */
.ch-card { padding: 18px; display: grid; gap: 8px; align-content: start; color: var(--ink); }
.ch-card.joined { box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 6px 0 0 var(--ok); }
.ch-card h3 { margin: 0; font-size: 21px; }
.ch-card h3 a { color: var(--ink); text-decoration: none; }
.ch-card p { margin: 0; }
.ch-top { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-desc { white-space: pre-line; font-size: 16px; }
.ch-desc.light { color: #e6dcc6; margin: 8px 0 0; }
.last7 { white-space: nowrap; }
.d7 { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 3px; background: #f1e6cd; border: 1px solid var(--line); }
.d7.ok { background: var(--ok); border-color: var(--ok); }
.d7.part { background: #ecd27f; border-color: #ecd27f; }
.d7.miss { background: #f2c4b8; border-color: #f2c4b8; }

/* ---------- admin ---------- */
.admin-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-tools input[type=search] { max-width: 340px; }
.check { display: inline-flex; align-items: center; gap: 8px; font: 15px var(--sans); min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.admin-table td { vertical-align: middle; }
.admin-table select { min-height: 38px; padding: 4px 8px; font-size: 14px; width: auto; }
.admin-table select.st-blocked { border-color: var(--bad); }
.admin-table select.st-pending { border-color: var(--gold); }
.pending { color: var(--muted); font-style: italic; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .feature { grid-template-columns: 84px 1fr; }
  .how { grid-template-columns: 1fr; }
  .mirror-art { max-width: 200px; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .slots { grid-template-columns: 1fr 1fr 1fr; }
  .slot { flex-direction: column; gap: 4px; font-size: 13px; }
  .pb-row, .bal-row { grid-template-columns: 86px 1fr; }
  .bal-val { grid-column: 2; text-align: left; }
  .period-nav h2 { min-width: 0; font-size: 18px; }
  .week-strip { gap: 3px; }
  .wday b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature, .toast { transition: none; }
}
