@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  color-scheme: light;
  /* Sage nursery palette: soft green ground, deep forest ink, the card's gold bow for "jij",
     a dusty clay for the real birth values so they stand apart from the guesses. */
  --bg: #e9efe6;
  --paper: #fbfcf8;
  --ink: #2e3a32;
  --ink-soft: #4e5e52;
  --muted: #7c8a7e;
  --sage: #7b9a7d;
  --sage-deep: #557458;
  --sage-soft: #d0ddcc;
  --sage-wash: #eaf1e7;
  --gold: #c49a54;
  --gold-deep: #96712f;
  --gold-soft: #f3e8d0;
  --real: #b8705f;
  --ok: #3f7d4f;
  --warn: #c1832a;
  --warn-wash: #fbf1de;
  --bad: #b1504a;
  --radius: 18px;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.5; }
a { color: var(--sage-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
h1, h2, h3 { font-weight: 500; font-style: italic; margin: 0; letter-spacing: 0.01em; }

/* arch header, echoing the card */
.arch { position: relative; margin: 46px 0 20px; padding: 64px 22px 26px; text-align: center; background: var(--paper);
  border: 1.5px solid var(--sage-deep); border-bottom: none; border-radius: 50% 50% 0 0 / 120px 120px 0 0; }
.arch .bow { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 92px; height: 64px; }
.arch h1 { font-size: clamp(30px, 8vw, 44px); color: var(--sage-deep); }
.arch .sub { margin: 6px 0 0; color: var(--ink-soft); font-style: italic; }
.progress { margin: 16px auto 0; max-width: 300px; }
.progress .track { height: 6px; background: var(--sage-wash); border-radius: 3px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--gold); border-radius: 3px; }
.progress small { display: block; margin-top: 6px; color: var(--muted); }

/* panels */
.panel { background: var(--paper); border: 1px solid var(--sage-soft); border-radius: var(--radius); padding: 18px 16px 16px; margin: 14px 0; }
.panel > header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.panel > header svg.icon { width: 30px; height: 30px; flex: none; stroke: var(--sage-deep); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.panel h2 { font-size: 22px; color: var(--ink); }
.panel .q { margin: 0 0 10px; color: var(--muted); font-size: 14px; font-style: italic; }

.findme { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--sage-soft); border-radius: 999px; padding: 6px 8px 6px 16px; position: sticky; top: 8px; z-index: 5; box-shadow: 0 4px 16px rgba(46,58,50,.06); }
.findme label { font-style: italic; color: var(--ink-soft); white-space: nowrap; font-size: 15px; }
.findme select { flex: 1; min-width: 0; border: none; background: var(--sage-wash); border-radius: 999px; padding: 8px 12px; }

/* strip plots */
svg.strip { display: block; overflow: visible; margin-top: 4px; }
svg.strip .axis { stroke: var(--sage-deep); stroke-width: 1.2; }
svg.strip .tick { stroke: var(--sage-deep); stroke-width: 1; }
svg.strip .tlabel { fill: var(--muted); font-size: 10.5px; font-family: var(--serif); }
svg.strip .dot { fill: var(--sage); fill-opacity: .85; stroke: var(--paper); stroke-width: 1.2; cursor: pointer; outline: none; transition: fill-opacity .15s; }
svg.strip .dot:hover, svg.strip .dot:focus { fill-opacity: 1; }
svg.strip .dot.me { fill: var(--gold); fill-opacity: 1; stroke: var(--ink); stroke-width: 1.6; }
svg.strip .me-label { fill: var(--gold-deep); font-size: 11px; font-weight: 600; font-style: italic; font-family: var(--serif); }
svg.strip .ref-median { stroke: var(--sage-deep); stroke-width: 1.4; stroke-dasharray: 4 3; }
svg.strip .ref-mean { stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 1.5 3; stroke-linecap: round; }
svg.strip .ref-due { stroke: var(--ink); stroke-width: 1.2; }
svg.strip .ref-due-label { fill: var(--ink); font-size: 10.5px; font-style: italic; font-family: var(--serif); }
svg.strip .ref-actual { stroke: var(--real); stroke-width: 2.4; }
svg.strip .ref-actual-label { fill: var(--real); font-size: 11px; font-weight: 600; font-style: italic; font-family: var(--serif); }

.stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 14px; }
.stats b { font-weight: 600; }
.sw { display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px dashed var(--sage-deep); }
.sw-mean { border-top: 3px dotted var(--gold); }
.you-line { margin: 6px 0 0; font-size: 14px; color: var(--gold-deep); font-style: italic; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { font-weight: 600; }

/* bars */
.bars { display: grid; gap: 8px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { display: flex; align-items: flex-start; gap: 8px; min-width: 0; line-height: 1.3; }
.bar-label .swatch { margin-top: 2px; }
.bar-label .raws { display: block; color: var(--muted); font-size: 12px; font-style: italic; }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid rgba(46,58,50,.25); }
.bar-track { height: 12px; background: var(--sage-wash); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; min-width: 2px; }
.bar-n { text-align: right; font-weight: 600; }
.bar-n small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1; }
.bar-row.actual .bar-label { font-weight: 600; }
em.you { font-size: 12px; color: var(--gold-deep); background: var(--gold-soft); border-radius: 999px; padding: 0 7px; font-style: italic; }
em.real { font-size: 12px; color: #fff; background: var(--real); border-radius: 999px; padding: 0 7px; }

/* names */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--sage-wash); border-radius: 999px; padding: 6px 12px; font-size: 15px; }
.chip.top { background: var(--sage-soft); }
.chip small { color: var(--muted); margin-left: 4px; }
.chip.mine { outline: 2px solid var(--gold); }

/* galleries */
.notes { columns: 2 220px; column-gap: 12px; }
.note { break-inside: avoid; background: var(--sage-wash); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.note p { margin: 0; font-style: italic; }
.note footer { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.note.mine { background: var(--gold-soft); }
.samen { display: flex; flex-wrap: wrap; gap: 8px; }
.samen .chip { font-style: italic; }
.samen .chip small { font-style: normal; }

details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--sage-deep); font-size: 15px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 10px; }
.creative li { margin: 4px 0; }
.creative { padding-left: 18px; margin: 4px 0 0; font-size: 15px; }

/* ranking */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin: 8px 0 14px; text-align: center; }
.podium div { background: var(--sage-wash); border-radius: 14px 14px 4px 4px; padding: 10px 6px; }
.podium .p1 { background: var(--gold-soft); padding-top: 20px; }
.podium b { display: block; font-size: 16px; }
.podium span { font-size: 13px; color: var(--ink-soft); }
.podium .medal { font-size: 22px; font-style: italic; color: var(--gold-deep); }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th { text-align: left; font-weight: 500; color: var(--muted); font-style: italic; border-bottom: 1px solid var(--sage-soft); padding: 4px 4px; }
table.rank td { padding: 6px 4px; border-bottom: 1px solid var(--sage-wash); vertical-align: top; }
table.rank td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rank .parts { font-size: 12px; color: var(--muted); margin-top: 2px; }
table.rank tr.mine td { background: var(--gold-soft); }
.reveal-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.fact { background: var(--sage-wash); border-radius: 12px; padding: 8px 12px; }
.fact small { display: block; color: var(--muted); font-style: italic; }
.fact b { font-weight: 600; }
details.rule { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }
details.rule summary { cursor: pointer; color: var(--sage-deep); }

footer.page { text-align: center; color: var(--muted); font-size: 14px; margin-top: 28px; }
footer.page a { margin: 0 8px; }

/* forms (login + admin) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 999px; padding: 12px 20px; background: var(--sage-deep); color: #fff; font-weight: 500; cursor: pointer; text-decoration: none; min-height: 46px; }
.btn:hover { background: #45624a; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: var(--gold-deep); }
.btn.ghost { background: transparent; color: var(--sage-deep); border: 1.5px solid var(--sage-deep); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--sage-soft); background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
textarea { resize: vertical; min-height: 64px; }
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 4px; font-style: italic; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.notice { background: var(--warn-wash); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }
.ok-text { color: var(--ok); }

.board-title { font-size: 18px; margin: 4px 0 6px; color: var(--ink); }
.notice a { color: var(--sage-deep); font-weight: 600; }
