/* SizeComparison.games — Premium Editorial theme.
   Mobile-first, system fonts only, no frameworks, no external assets.
   Colours and type are locked by the site design. */
:root{
  --paper:#FAF6EE;
  --ink:#17181C;
  --red:#E23A3A;
  --green:#1F9D63;
  --amber:#D97706;
  --muted:#6B6B66;
  --line:#E5DDD0;
  --card:#FFFFFF;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --radius:14px;
  --shadow:0 2px 10px rgba(23,24,28,.06);
}
*{box-sizing:border-box}
[hidden]{display:none!important} /* hidden must win over .figure/.btn display rules — otherwise ghost bars and pre-lock buttons leak visible */
html{scroll-behavior:smooth;overflow-x:clip}
body{overflow-x:clip} /* safety net at 360px: clip, not hidden, so the sticky header keeps working */
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:var(--font);font-size:17px;line-height:1.6;
  -webkit-text-size-adjust:100%;
}
img,svg,canvas{max-width:100%}
a{color:var(--ink)}
a:hover{color:var(--red)}
h1,h2,h3{line-height:1.12;letter-spacing:-.02em;margin:0 0 .5em}
h1{font-size:clamp(2rem,6vw,3.4rem);font-weight:800}
h2{font-size:clamp(1.5rem,4vw,2.1rem);font-weight:800;margin-top:2.2em}
h3{font-size:1.2rem;font-weight:750}
p{margin:0 0 1em}
.lede{font-size:clamp(1.05rem,2.5vw,1.3rem);color:#3d3d38}
.muted{color:var(--muted)}
.small{font-size:.9rem}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}
main{padding-bottom:48px}
section{margin-top:8px}
hr{border:0;border-top:1px solid var(--line);margin:32px 0}

/* ---------- Header ---------- */
.site-header{
  position:sticky;top:0;z-index:50;
  background:rgba(250,246,238,.97);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(4px);
}
.header-inner{
  max-width:1100px;margin:0 auto;padding:10px 16px;
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
}
.logo{
  font-weight:900;font-size:1.25rem;letter-spacing:-.03em;
  text-decoration:none;color:var(--ink);white-space:nowrap;
}
.logo span{color:var(--red)}
.main-nav{display:flex;gap:2px;flex-wrap:wrap;margin-left:auto}
.main-nav a{
  text-decoration:none;font-weight:650;font-size:.95rem;
  padding:7px 10px;border-radius:999px;color:var(--ink);
}
.main-nav a:hover{background:#efe8d8}
.main-nav a[aria-current="page"]{background:var(--ink);color:#fff}
.unit-toggle{
  display:flex;border:1px solid var(--line);border-radius:999px;
  overflow:hidden;background:var(--card);flex-shrink:0;
}
.unit-toggle button{
  border:0;background:transparent;padding:7px 12px;cursor:pointer;
  font:inherit;font-size:.88rem;font-weight:700;color:var(--muted);
}
.unit-toggle button[aria-pressed="true"]{background:var(--ink);color:#fff}
.unit-toggle button:focus-visible,.main-nav a:focus-visible,
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{
  outline:3px solid var(--amber);outline-offset:2px;
}

/* ---------- Hero / cards ---------- */
.hero{padding:20px 0 4px}
.hero .kicker{
  font-size:.85rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
  color:var(--red);margin:0 0 10px;
}
.card-grid{
  display:grid;grid-template-columns:1fr;gap:14px;margin:20px 0;
}
@media(min-width:640px){.card-grid{grid-template-columns:1fr 1fr}}
@media(min-width:900px){.card-grid{grid-template-columns:1fr 1fr 1fr}}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:20px;box-shadow:var(--shadow);text-decoration:none;color:var(--ink);
  display:block;
}
a.card:hover{border-color:var(--ink)}
.card h3{margin:0 0 6px}
.card p{margin:0;color:var(--muted);font-size:.97rem}
.card .go{font-weight:800;color:var(--red)}
.cat-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(min-width:640px){.cat-list{grid-template-columns:repeat(3,1fr)}}
.cat-list a{
  display:block;background:var(--card);border:1px solid var(--line);
  border-radius:12px;padding:14px 16px;text-decoration:none;font-weight:750;
}
.cat-list a:hover{border-color:var(--ink)}
.cat-list small{display:block;color:var(--muted);font-weight:500}

/* ---------- Buttons ---------- */
.btn{
  display:inline-block;border:0;border-radius:999px;cursor:pointer;
  background:var(--ink);color:#fff;font:inherit;font-weight:750;
  padding:12px 22px;text-decoration:none;text-align:center;
}
.btn:hover{background:var(--red);color:#fff}
.btn.secondary{background:#fff;color:var(--ink);border:1.5px solid var(--ink)}
.btn.secondary:hover{border-color:var(--red);color:var(--red);background:#fff}
.btn.ghost{background:transparent;color:var(--ink);border:1.5px solid var(--line)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:14px 0}
.step-btn{
  width:44px;height:44px;border-radius:50%;border:1.5px solid var(--ink);
  background:#fff;font:inherit;font-size:1.3rem;font-weight:800;cursor:pointer;
  flex-shrink:0;
}
.step-btn:hover{background:var(--ink);color:#fff}

/* ---------- Game shell ---------- */
.game{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:20px;margin:18px 0;
}
.game-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:baseline}
.game-head .game-title{margin:0;font-size:1.5rem;font-weight:800;line-height:1.12;letter-spacing:-.02em}
.score-line{font-size:1.05rem;font-weight:800}
.score-line .big{font-size:1.9rem;font-weight:900;letter-spacing:-.03em}
.notice{
  background:#FFF4E0;border:1px solid #F0D9A8;border-radius:10px;
  padding:10px 14px;font-size:.95rem;margin:0 0 14px;
}
.round-label{font-weight:800;letter-spacing:.06em;text-transform:uppercase;font-size:.85rem;color:var(--muted)}
.progress{display:flex;gap:6px;margin:10px 0 4px}
.progress i{flex:1;height:8px;border-radius:99px;background:#EDE6D6;display:block}
.progress i.done{background:var(--green)}
.progress i.now{background:var(--red)}

/* Size It Up stage: reference (fixed for the round) vs target, bottom-anchored. */
.stage{
  display:flex;align-items:flex-end;justify-content:center;gap:28px;
  min-height:320px;padding:16px 8px 0;margin-top:8px;
  border-bottom:3px solid var(--ink);overflow:hidden;
  background:linear-gradient(to bottom,transparent 96%,#f3ecdc 96%);
}
.figure{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0;flex:1;max-width:220px}
.figure .bar-wrap{display:flex;align-items:flex-end;justify-content:center;width:100%}
.figure svg{display:block;height:auto}
.figure .fig-label{text-align:center;font-weight:750;line-height:1.25;margin-top:8px}
.figure .fig-size{font-weight:800;font-size:1.05rem}
.figure .fig-tag{font-size:.8rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.figure.target .fig-tag{color:#2563EB} /* guess bar is blue, not red */
.figure.ghost .fig-tag{color:var(--red)}
.ghost-bar{opacity:.85}
.stage-note{font-size:.9rem;color:var(--muted);text-align:center;margin:6px 0 0}
.slider-row{display:flex;align-items:center;gap:12px;margin:12px 0 6px}
input[type="range"]{flex:1;min-width:0;accent-color:var(--red);height:32px}
.guess-readout{
  text-align:center;font-size:1.15rem;font-weight:800;margin:4px 0 10px;
}
.guess-readout .big{font-size:1.7rem;font-weight:900}
.feedback{
  border-radius:12px;padding:16px;margin:14px 0;
  background:#F6F1E4;border:1px solid var(--line);
}
.feedback.good{background:#E8F6EE;border-color:#BFE3CE}
.feedback.poor{background:#FDECEC;border-color:#F5C6C6}
.feedback .verdict{font-size:1.35rem;font-weight:900;margin:0 0 4px}
.feedback p{margin:0 0 6px}
.result-total{text-align:center;padding:8px 0}
.result-total .big{font-size:3.2rem;font-weight:900;letter-spacing:-.04em;line-height:1}
.share-box{
  width:100%;font:inherit;padding:10px;border:1px solid var(--line);
  border-radius:10px;background:var(--paper);margin:8px 0;
}

/* ---------- Quiz ---------- */
.timer-bar{height:10px;background:#EDE6D6;border-radius:99px;overflow:hidden;margin:10px 0}
.timer-bar i{display:block;height:100%;background:var(--green);width:100%}
.timer-bar.low i{background:var(--red)}
.quiz-choices{display:grid;grid-template-columns:1fr;gap:12px;margin:16px 0}
@media(min-width:640px){.quiz-choices{grid-template-columns:1fr 1fr}}
.choice{
  background:#fff;border:2px solid var(--line);border-radius:var(--radius);
  padding:18px;cursor:pointer;font:inherit;text-align:center;min-height:120px;
}
.choice:hover{border-color:var(--ink)}
.choice.correct{border-color:var(--green);background:#E8F6EE}
.choice.wrong{border-color:var(--red);background:#FDECEC}
.choice:disabled{cursor:default;opacity:.95}
.choice .choice-name{font-size:1.35rem;font-weight:900;line-height:1.2}
.choice .choice-cat{color:var(--muted);font-size:.9rem}
.choice svg{display:block;margin:10px auto 0}
.choice .choice-size{display:block;font-weight:800;margin-top:8px}
.streak{font-weight:800}
.streak .fire{color:var(--red)}

/* ---------- Compare ---------- */
.compare-layout{display:grid;grid-template-columns:1fr;gap:18px}
@media(min-width:900px){.compare-layout{grid-template-columns:320px 1fr}}
.compare-panel{border:1px solid var(--line);border-radius:12px;padding:16px;background:#fff}
.compare-panel h3{margin-top:0}
.search-input,.text-input,select{
  width:100%;font:inherit;padding:10px 12px;border:1.5px solid var(--line);
  border-radius:10px;background:#fff;margin:6px 0 10px;
}
.cat-group{margin:10px 0}
.cat-group>h4{margin:0 0 4px;font-size:.9rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.check-row{display:flex;gap:8px;align-items:flex-start;padding:5px 0;font-size:.97rem}
.check-row input{width:18px;height:18px;margin-top:2px;flex-shrink:0;accent-color:var(--red)}
.check-row .sz{margin-left:auto;color:var(--muted);font-size:.88rem;white-space:nowrap}
.compare-bars{
  display:flex;align-items:flex-end;justify-content:flex-start;gap:14px;
  min-height:320px;padding:12px 4px 0;border-bottom:3px solid var(--ink);
  overflow-x:auto;
}
.compare-bars .figure{flex:0 0 auto;min-width:64px;max-width:150px}
.scale-toggle{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.scale-toggle button{
  border:1.5px solid var(--line);background:#fff;border-radius:999px;
  padding:7px 14px;font:inherit;font-weight:700;cursor:pointer;
}
.scale-toggle button[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}
.you-form{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.you-form .full{grid-column:1/-1}

/* ---------- How Many Fit? / Sort the Order ---------- */
.fit-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}
.fit-item{background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:16px;text-align:center}
.fit-item .fig-tag{font-size:.8rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.sort-list{list-style:none;margin:16px 0;padding:0}
.sort-row{display:flex;gap:10px;align-items:center;background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;margin-bottom:8px}
.sort-row .sort-name{flex:1;font-weight:750}
.sort-row.correct{border-color:var(--green);background:#E8F6EE}
.sort-row.wrong{border-color:var(--red);background:#FDECEC}

/* ---------- Article / FAQ / footer ---------- */
.article{max-width:760px}
.article ul,.article ol{margin:0 0 1em;padding-left:22px}
.faq-item{margin:0 0 18px}
.faq-item h3{margin-bottom:4px}
.faq-item p{margin:0}
.site-footer{border-top:1px solid var(--line);margin-top:40px;padding:28px 0 40px}
.footer-inner{max-width:1100px;margin:0 auto;padding:0 16px}
.footer-links{display:flex;gap:6px 18px;flex-wrap:wrap;list-style:none;margin:0 0 14px;padding:0}
.footer-links a{text-decoration:none;font-weight:650}
.footer-links a:hover{text-decoration:underline}
@media(max-width:420px){
  body{font-size:16px}
  .header-inner{gap:8px}
  .main-nav a{padding:6px 8px;font-size:.9rem}
  .stage{gap:14px;min-height:280px}
  .game{padding:14px}
}

/* ---------- Hamburger menu (<=768px) ---------- */
.nav-toggle{
  display:none;border:1.5px solid var(--line);background:var(--card);
  border-radius:10px;padding:7px 12px;cursor:pointer;
  font:inherit;font-size:1.1rem;font-weight:800;color:var(--ink);
  line-height:1;flex-shrink:0;min-width:44px;min-height:40px;
}
@media(max-width:768px){
  /* One slim row: logo | Metric/Imperial toggle | hamburger button.
     The nav becomes a full-width dropdown panel below that row. */
  .header-inner{flex-wrap:wrap;gap:6px;padding:8px 10px}
  .logo{order:1;font-size:1.02rem}
  .unit-toggle{order:2;margin-left:auto}
  .unit-toggle button{padding:6px 8px;font-size:.82rem}
  .nav-toggle{order:3;display:inline-flex;align-items:center;justify-content:center;padding:6px 9px}
  .main-nav{
    order:4;display:none;width:100%;flex-direction:column;flex-wrap:nowrap;
    margin-left:0;gap:2px;border-top:1px solid var(--line);padding-top:6px;
  }
  .header-inner.nav-open .main-nav{display:flex}
  .main-nav a{display:flex;align-items:center;min-height:44px;padding:10px;border-radius:10px}
}

/* ---------- Zoom Scale ---------- */
.zoom-ladder{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.zoom-chip{
  border:1.5px solid var(--line);background:#fff;border-radius:999px;
  padding:7px 13px;font:inherit;font-weight:700;font-size:.9rem;cursor:pointer;
}
.zoom-chip:hover{border-color:var(--ink)}
.zoom-chip[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}
.zoom-items{
  display:flex;align-items:flex-end;justify-content:flex-start;gap:16px;
  min-height:280px;padding:12px 4px 0;border-bottom:3px solid var(--ink);
  overflow-x:auto;
}
.zoom-items .figure{flex:0 0 auto;min-width:64px;max-width:150px}

/* ---------- Quiz choices: flex column so revealed sizes can never sit
   under the shapes ---------- */
.choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.choice .choice-name,.choice .choice-cat,.choice-shape{display:block}
.choice-shape{line-height:0}
.choice .choice-size{display:block;margin-top:6px;position:relative;z-index:1}
.sort-list{list-style:none}

/* ---------- Phase 4: Daily drag-resize, zoom, fine adjust, streak ---------- */
/* The zoom wrap must NEVER clip: zoom now scales the bar heights, not
   the stage, so the labels and baseline stay in normal flow inside the
   card. overflow:hidden here used to cut the reference labels off the
   left edge at 125%+ zoom — keep it visible so nothing can be clipped. */
.stage-zoom-wrap{display:flex;align-items:flex-end;overflow:visible}
.drag-handle{cursor:grab;touch-action:none;min-height:40px}
.drag-handle.dragging{cursor:grabbing}
.zoom-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0 4px}
.zoom-btn{width:40px;height:40px}
.zoom-label{font-weight:800;min-width:52px;text-align:center}
.zoom-fit{padding:9px 16px}
.fine-row{display:flex;gap:10px;align-items:center;margin:2px 0 6px}
.fine-row label{font-size:.9rem;font-weight:700;color:var(--muted);white-space:nowrap}
.fine-row input[type="range"]{flex:1;min-width:0}
.fine-hint{font-size:.85rem;color:var(--muted);white-space:nowrap}
.streak-badge{
  display:inline-block;background:#fff;border:1.5px solid var(--red);
  border-radius:999px;padding:6px 14px;font-weight:800;font-size:.95rem;margin:6px 0;
}

/* ---------- Phase 5: item images (reveal-only in games; static on Vs/category pages) ---------- */
.reveal-photo{margin:12px 0 4px;text-align:center}
.reveal-photo img{display:block;margin:0 auto;border-radius:10px;max-height:320px;width:auto;max-width:100%}
.reveal-photo figcaption{font-size:.85rem;color:var(--muted);margin-top:6px}
.reveal-photo-name{font-weight:700;margin-top:6px}
/* Two reveal photos (reference + target) sit side by side when both exist. */
.reveal-photos{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;margin:12px 0 4px}
.reveal-photos .reveal-photo{flex:1 1 200px;max-width:340px;margin:0}
.vs-photo{margin:10px 0 0;text-align:center}
.vs-photo img{display:block;margin:0 auto;border-radius:10px;max-height:260px;width:auto;max-width:100%}
.vs-photo figcaption{font-size:.85rem;color:var(--muted);margin-top:6px}
.item-thumb{width:76px}
.item-thumb img{display:block;max-width:72px;max-height:96px;width:auto;height:auto;border-radius:8px}
@media(max-width:640px){.item-thumb{width:60px}.item-thumb img{max-width:56px;max-height:80px}}
