/* minutesgame.com — shared styles ("bold & playful": flat colours, ink outlines, hard shadows) */
:root {
  --bg: #fff6e5;
  --surface: #ffffff;
  --surface-2: #fff1d6;
  --text: #111111;
  --muted: #4a4a4a;
  --ink: #111111;            /* outlines + hard shadows */
  --border: #111111;
  --line: #e9dcc2;           /* soft dividers */
  --primary: #111111;
  --primary-hover: #000000;
  --primary-soft: #ffe3fa;
  --accent: #ffc900;
  --good: #15803d;
  --good-soft: #c9f7d4;
  --bad: #d92d20;
  --bad-soft: #ffd9d4;

  /* brand palette */
  --pink: #ff90e8;
  --yellow: #ffc900;
  --blue: #90a8ed;
  --green: #7dd87d;
  --orange: #ff8a65;
  --purple: #c9b6ff;
  --teal: #23a094;

  --grad: var(--pink);       /* kept for older rules: now a flat colour */
  --radius: 16px;
  --bw: 2px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --c1: var(--pink);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --surface: #222222;
    --surface-2: #2c2a25;
    --text: #fff6e5;
    --muted: #cfc6b4;
    --ink: #fff6e5;
    --border: #fff6e5;
    --line: #3a3833;
    --primary: #fff6e5;
    --primary-hover: #ffffff;
    --primary-soft: #3b2a38;
    --good: #6ee7a0;
    --good-soft: #1d3a27;
    --bad: #ff8a80;
    --bad-soft: #43201d;
    color-scheme: dark;
  }
}

/* Tool colours (tiles, heroes, icons) */
.c-pink   { --c1: var(--pink); }
.c-yellow { --c1: var(--yellow); }
.c-orange { --c1: var(--orange); }
.c-green  { --c1: var(--green); }
.c-blue   { --c1: var(--blue); }
.c-purple { --c1: var(--purple); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--text); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--text); text-decoration-color: var(--pink); }
h1, h2, h3 { line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.3em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1em; height: 1em; flex: none; }
mark, .grad {
  background: var(--yellow); color: #111; padding: 0 .18em; border: var(--bw) solid var(--ink);
  border-radius: .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Shared "sticker" mixin pieces ---------- */
.card, .tool-tile, .btn, .search-box, .search-results, .score, .step, .why > div, .chip, .pill,
.faq details, article.content, .mg-modal-box, .copy-btn, .th-icon, .stat, .pchart, .result-box {
  border: var(--bw) solid var(--border);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: var(--bw) solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.3rem; color: var(--text); text-decoration: none; letter-spacing: -.03em;
}
.brand:hover { color: var(--text); }
.brand b {
  background: var(--pink); color: #111; border: var(--bw) solid var(--ink); border-radius: 7px;
  padding: 0 6px; margin-left: 1px; font-weight: 800;
}
.brand svg { width: 36px; height: 36px; flex: none; }
.nav-links { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .98rem;
  padding: 7px 12px; border-radius: 10px; border: var(--bw) solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { border-color: var(--ink); background: var(--surface-2); }
.nav-links a.nav-cta {
  background: var(--pink); color: #111; border-color: var(--ink); margin-left: 8px; padding: 8px 16px;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.nav-links a.nav-cta:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: var(--pink); }
.nav-toggle {
  display: none; margin-left: auto; background: var(--yellow); border: var(--bw) solid var(--ink);
  color: #111; border-radius: 12px; width: 46px; height: 46px; font-size: 1.3rem; cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 66px;
    background: var(--surface); border-bottom: var(--bw) solid var(--border);
    flex-direction: column; align-items: stretch; padding: 10px 16px 18px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Tool page hero ---------- */
.tool-hero {
  position: relative; color: #111; background: var(--c1);
  border-bottom: var(--bw) solid var(--ink); padding: 18px 0 88px;
  background-image: radial-gradient(rgba(17, 17, 17, .13) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
}
.tool-hero .breadcrumb, .tool-hero .breadcrumb a { color: #111; }
.th-row { display: flex; gap: 18px; align-items: center; position: relative; }
.th-icon {
  flex: none; width: 70px; height: 70px; border-radius: 18px; display: grid; place-items: center;
  background: #fff; border-color: #111; box-shadow: 4px 4px 0 #111; transform: rotate(-4deg);
}
.th-icon svg { width: 36px; height: 36px; color: #111; }
.tool-hero h1 { margin: 0 0 6px; color: #111; }
.tool-hero .lead { margin: 0; color: #111; font-size: 1.08rem; max-width: 720px; font-weight: 500; }
@media (max-width: 560px) {
  .th-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .th-icon { width: 58px; height: 58px; border-radius: 15px; }
  .th-icon svg { width: 30px; height: 30px; }
}
.tool-hero + main > .tool:first-child { margin-top: -60px; position: relative; z-index: 2; }

/* Breadcrumb + plain page head (info pages) */
.breadcrumb { font-size: .88rem; color: var(--muted); margin: 18px 0 14px; font-weight: 600; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-head { margin: 8px 0 20px; }
.page-head .lead { color: var(--muted); font-size: 1.05rem; max-width: 720px; }

/* ---------- Cards / tool box ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.tool { margin-bottom: 32px; }
@media (min-width: 640px) { .card { padding: 30px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 1rem; line-height: 1.2;
  padding: 12px 22px; border-radius: 12px; cursor: pointer;
  background: var(--surface); color: var(--text); border-color: var(--ink);
  text-decoration: none; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); color: var(--text); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--pink); color: #111; }
.btn-primary:hover { background: var(--pink); color: #111; }
.btn-lg { padding: 15px 26px; font-size: 1.08rem; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.btn .icon { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.seg {
  display: inline-flex; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 12px;
  padding: 3px; gap: 3px; flex-wrap: wrap; box-shadow: 3px 3px 0 var(--ink);
}
.seg button {
  font: inherit; font-weight: 700; font-size: .95rem; border: 0; background: none; color: var(--text);
  padding: 7px 15px; border-radius: 8px; cursor: pointer;
}
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], textarea, select {
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 10px;
  padding: 10px 13px; width: 100%; transition: box-shadow .1s;
}
input:focus, textarea:focus, select:focus { outline: none; box-shadow: 3px 3px 0 var(--pink); }
input[type="range"] { width: 100%; accent-color: #111; height: 6px; }
@media (prefers-color-scheme: dark) { input[type="range"] { accent-color: var(--pink); } }
.inline-inputs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-inputs input { width: auto; flex: 1 1 110px; min-width: 0; }

.grid-2 { display: grid; gap: 18px; }
.grid-3 { display: grid; gap: 18px; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: 14px; padding: 14px; text-align: center; }
.stat .v { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .l { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-top: 2px; }
.stat.big { background: var(--yellow); color: #111; box-shadow: 3px 3px 0 var(--ink); }
.stat.big .v, .stat.big .l { color: #111; }

.result-box { background: var(--surface-2); border-radius: 14px; padding: 16px 20px; margin-top: 14px; font-size: 1.02rem; }
.result-box strong { color: var(--text); }

/* Ad slots: hidden until AdSense fills them */
.ad-slot { margin: 28px auto; text-align: center; min-height: 0; }
.ad-slot:empty { display: none; }

/* ---------- Article content ---------- */
article.content {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 20px; margin: 32px 0;
}
@media (min-width: 700px) { article.content { padding: 36px 44px; } }
.content { max-width: 860px; }
article.content > h2:first-child, article.content > h1:first-child { margin-top: 0; }
.content h2::before {
  content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; vertical-align: .08em;
  background: var(--yellow); border: var(--bw) solid var(--ink); border-radius: 3px; transform: rotate(45deg);
}
.content ul, .content ol { padding-left: 1.3em; margin: 0 0 1em; }
.content li { margin-bottom: .45em; }
.content li::marker { font-weight: 800; }
.content table {
  border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 1.2em; font-size: .96rem;
  border: var(--bw) solid var(--ink); border-radius: 12px; overflow: hidden;
}
.content th, .content td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.content tr:last-child td { border-bottom: 0; }
.content th { background: var(--yellow); color: #111; font-weight: 800; border-bottom: var(--bw) solid var(--ink); }
.content code { font-family: var(--mono); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: .92em; }

.faq details {
  background: var(--surface); border-radius: 12px; padding: 0 18px; margin-bottom: 12px;
  transition: box-shadow .1s, transform .1s;
}
.faq details[open] { box-shadow: var(--shadow); transform: translate(-2px, -2px); }
.faq summary { cursor: pointer; font-weight: 800; padding: 15px 36px 15px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--yellow); color: #111; border: var(--bw) solid var(--ink); font-weight: 800; line-height: 1;
}
.faq details[open] summary::after { content: "−"; background: var(--pink); }
.faq details p { color: var(--muted); margin-top: -4px; }

/* ---------- Tool tiles ---------- */
.tool-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--c1); color: #111; border-color: #111; border-radius: var(--radius);
  padding: 22px; text-decoration: none; box-shadow: 5px 5px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.tool-tile:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); color: #111; }
.tool-tile:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.tool-tile .ico {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; color: #111;
  background: #fff; border: var(--bw) solid #111; box-shadow: 3px 3px 0 #111;
}
.tool-tile .ico svg { width: 28px; height: 28px; }
.tool-tile h3 { margin: 6px 0 0; font-size: 1.25rem; }
.tool-tile p { margin: 0; color: #111; font-size: .95rem; opacity: .85; }
.tool-tile .go { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.tool-tile .go svg { width: 18px; height: 18px; transition: transform .15s; }
.tool-tile:hover .go svg { transform: translateX(4px); }
.tag {
  align-self: flex-start; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: #111; background: #fff; border: 1.5px solid #111; padding: 3px 9px; border-radius: 999px;
}
.tool-tile.feature { min-height: 260px; padding: 28px; }
.tool-tile.feature h3 { font-size: 1.8rem; }
.tool-tile.feature p { font-size: 1.05rem; max-width: 380px; }
.tool-tile.feature .bg-ico {
  position: absolute; right: -18px; bottom: -26px; width: 190px; height: 190px; color: #111; opacity: .12;
  transform: rotate(-12deg); transition: transform .3s;
}
.tool-tile.feature:hover .bg-ico { transform: rotate(-4deg) scale(1.05); }
.feature-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.badge {
  position: absolute; top: 16px; right: 16px; z-index: 1; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: #111; color: var(--yellow); padding: 5px 11px; border-radius: 8px; transform: rotate(4deg);
}

/* ---------- Sections ---------- */
.section { margin: 64px 0; }
.related { margin: 48px 0; }
.sec-head { margin-bottom: 22px; }
.sec-head h2 { margin: 8px 0 6px; }
.sec-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  background: var(--ink); color: var(--bg); padding: 4px 10px; border-radius: 6px;
}
.related h2 { margin-bottom: 20px; }

/* ---------- Home hero ---------- */
.home-hero { position: relative; padding: 56px 0 40px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 920px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700;
  background: var(--surface); border-radius: 999px; padding: 5px 14px 5px 5px;
  box-shadow: 3px 3px 0 var(--ink); color: var(--text); text-decoration: none; transition: transform .1s, box-shadow .1s;
}
.pill:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); color: var(--text); }
.pill b { background: var(--green); color: #111; border: 1.5px solid #111; border-radius: 999px; padding: 1px 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.home-hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -.045em; margin: 22px 0 20px; }
.home-hero h1 .grad { display: inline-block; transform: rotate(-1.5deg); padding: 0 .15em; margin-top: .08em; }
.home-hero .sub { color: var(--muted); font-size: 1.2rem; max-width: 540px; margin-bottom: 28px; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 34px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hero-stats span { color: var(--muted); font-size: .88rem; font-weight: 700; }

/* Hero ring (home mini game) */
.demo { position: relative; max-width: 430px; margin: 0 auto; width: 100%; aspect-ratio: 1; }
.demo-ring {
  position: absolute; inset: 12%; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); display: grid; place-items: center;
  transition: background .1s;
}
.demo-ring svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.demo-ring .track { stroke: var(--surface-2); }
.demo-ring .bar { stroke: var(--pink); transition: stroke .1s; }
.demo-center { text-align: center; position: relative; }
.demo-center .t { font-size: clamp(2.6rem, 9vw, 3.8rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.demo-center .l { color: var(--muted); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 10px; background: var(--surface);
  border-radius: 14px; padding: 8px 14px 8px 8px; box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800; font-size: .98rem; white-space: nowrap; text-decoration: none; color: var(--text);
}
.chip:hover { color: var(--text); }
.chip small { display: block; font-weight: 600; color: var(--muted); font-size: .74rem; line-height: 1.1; }
.chip .ci {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #111;
  background: var(--c1); border: var(--bw) solid #111;
}
.chip .ci svg { width: 18px; height: 18px; }
.chip.a { top: 3%; left: -3%; transform: rotate(-5deg); }
.chip.b { top: 13%; right: -5%; transform: rotate(4deg); }
.chip.c { bottom: 13%; left: -7%; transform: rotate(3deg); }
.chip.d { bottom: 1%; right: 1%; transform: rotate(-4deg); }
@media (max-width: 480px) { .chip { font-size: .84rem; padding: 6px 10px 6px 6px; } .chip .ci { width: 28px; height: 28px; } }

/* Why us */
.why { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.why > div { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.why .wi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #111; margin-bottom: 12px; border: var(--bw) solid #111; }
.why > div:nth-child(1) .wi { background: var(--yellow); }
.why > div:nth-child(2) .wi { background: var(--green); }
.why > div:nth-child(3) .wi { background: var(--blue); }
.why > div:nth-child(4) .wi { background: var(--pink); }
.why .wi svg { width: 22px; height: 22px; }
.why h3 { margin: 0 0 4px; }
.why p { margin: 0; color: var(--muted); font-size: .95rem; }

/* CTA band */
.cta-band {
  position: relative; border-radius: 24px; padding: 44px 28px; text-align: center; color: #111;
  background: var(--yellow); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  background-image: radial-gradient(rgba(17, 17, 17, .12) 1.2px, transparent 1.3px); background-size: 18px 18px;
}
.cta-band h2 { color: #111; margin: 0 0 8px; font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.cta-band p { color: #111; margin: 0 auto 24px; max-width: 520px; font-size: 1.08rem; }
.cta-band .btn { background: var(--pink); color: #111; border-color: #111; box-shadow: 3px 3px 0 #111; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px; background: #111; color: #d8cfbd; padding: 48px 0 28px; font-size: .95rem;
  border-top: 3px solid #111;
}
.footer-cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h4 { color: var(--yellow); margin: 0 0 12px; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #fff6e5; text-decoration: none; }
.site-footer a:hover { color: var(--pink); }
.copyright { margin-top: 32px; padding-top: 20px; border-top: 1px solid #333; font-size: .86rem; }

/* ---------- Home: search ---------- */
.search { position: relative; max-width: 540px; margin: 0 0 22px; }
.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border-radius: 14px; padding: 5px 8px 5px 16px; box-shadow: 4px 4px 0 var(--ink); transition: box-shadow .1s, transform .1s;
}
.search-box:focus-within { box-shadow: 5px 5px 0 var(--pink); transform: translate(-1px, -1px); }
.search-box > svg { width: 22px; height: 22px; color: var(--text); flex: none; }
.search-box input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 11px 0; font-size: 1.08rem; }
.search-box kbd {
  flex: none; font: 800 .8rem var(--font); color: var(--text); background: var(--surface-2);
  border: var(--bw) solid var(--ink); border-radius: 7px; padding: 2px 8px;
}
@media (max-width: 600px), (pointer: coarse) { .search-box kbd { display: none; } }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.search-results a { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results .si {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #111; flex: none;
  background: var(--c1); border: var(--bw) solid #111;
}
.search-results .si svg { width: 18px; height: 18px; }
.search-results small { display: block; color: var(--muted); font-size: .84rem; font-weight: 500; }
.search-results .empty { padding: 12px; color: var(--muted); }
.search-hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: .9rem; color: var(--muted); align-items: center; font-weight: 600; }
.search-hints a {
  color: var(--text); text-decoration: none; background: var(--surface); border: 1.5px solid var(--ink);
  padding: 3px 12px; border-radius: 999px; font-weight: 700;
}
.search-hints a:hover { background: var(--yellow); color: #111; }

/* ---------- Home: mini reaction game in the hero ring ---------- */
.mini-btn {
  position: absolute; inset: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; z-index: 2;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.demo-ring.is-wait .bar { stroke: #ff5a4f; }
.demo-ring.is-go { background: #3ddc84; }
.demo-ring.is-go .bar { stroke: #111; }
.demo-ring.is-go .demo-center, .demo-ring.is-go .demo-center .l { color: #111; }
.demo-ring.is-wait .demo-center .t { color: #e5372b; }
.demo-center .t.small { font-size: clamp(1.7rem, 5vw, 2.3rem); letter-spacing: -.03em; }
.demo-center .sub2 { color: var(--muted); font-size: .9rem; font-weight: 600; margin-top: 8px; max-width: 190px; margin-inline: auto; }
.demo-center .sub2 a { position: relative; z-index: 3; font-weight: 800; }

/* ---------- Home: filter tabs ---------- */
.sec-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.sec-row .sec-head { margin: 0; }
.tool-grid.all { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (min-width: 760px) { .tool-grid.all .tool-tile.feature { grid-column: span 2; } }
.tool-tile[hidden] { display: none; }

/* ---------- Home: scoreboard ---------- */
.scoreboard { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.score {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: transform .1s, box-shadow .1s;
}
.score:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); color: var(--text); }
.score .si {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; color: #111; flex: none;
  background: var(--c1); border: var(--bw) solid #111;
}
.score .si svg { width: 24px; height: 24px; }
.score b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.score span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.score.empty b { font-size: 1.08rem; letter-spacing: 0; }

/* ---------- Home: steps ---------- */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { position: relative; background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 12px;
  background: var(--pink); color: #111; border: var(--bw) solid #111; font-weight: 800; font-size: 1.2rem;
}
.step:nth-child(2)::before { background: var(--yellow); }
.step:nth-child(3)::before { background: var(--green); }
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Shared tool widgets (timers, pickers) ---------- */
.clock {
  font-size: clamp(3.6rem, 16vw, 8.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1;
  text-align: center; font-variant-numeric: tabular-nums; margin: 18px 0 14px;
}
.clock.done { animation: blink .6s steps(2) infinite; color: var(--bad); }
@keyframes blink { 50% { opacity: .25; } }
.bar-track { height: 16px; border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--surface); overflow: hidden; }
.bar-fill { height: 100%; width: 100%; background: var(--c1, var(--pink)); border-right: var(--bw) solid var(--ink); transition: width .2s linear; }
.btn-sm { padding: 7px 14px; font-size: .93rem; border-radius: 10px; }
.btn-row.center { justify-content: center; }
.btn.is-on { background: var(--ink); color: var(--bg); }
.mode-pill {
  display: inline-block; font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 12px; border-radius: 999px; border: var(--bw) solid #111; color: #111; background: var(--c1);
}
.tool:fullscreen { background: var(--bg); overflow: auto; display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.tool:fullscreen .clock { font-size: clamp(5rem, 22vw, 16rem); }
.tool:fullscreen .hide-fs { display: none; }
.two-col { display: grid; gap: 18px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }
.out-rows { margin-top: 6px; }
.out-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.out-rows div:last-child { border-bottom: 0; }
.out-rows b { font-variant-numeric: tabular-nums; }
.out-rows .total { font-size: 1.15rem; }
.big-result { text-align: center; padding: 18px; background: var(--surface-2); border: var(--bw) solid var(--ink); border-radius: 14px; }
.big-result .v { font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big-result .l { color: var(--muted); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  display: inline-grid; place-items: center; min-width: 34px; padding: 3px 9px; border-radius: 8px;
  border: 1.5px solid var(--ink); background: var(--surface); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
}
.check { display: flex; align-items: center; gap: 8px; font-size: .97rem; margin: 10px 0; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: #111; }

/* ---------- Guides ---------- */
.guide-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.guide-card {
  display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  background: var(--surface); color: var(--text); border: var(--bw) solid var(--ink); border-radius: var(--radius);
  padding: 0 20px 20px; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.guide-card::before { content: ""; display: block; height: 16px; margin: 0 -20px 12px; background: var(--c1); border-bottom: var(--bw) solid var(--ink); }
.guide-card:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); color: var(--text); }
.guide-card h3 { margin: 4px 0 0; font-size: 1.18rem; }
.guide-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.guide-card .tag { background: var(--c1); }
.guide-card .go { margin-top: auto; padding-top: 8px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.guide-card .go svg { width: 18px; height: 18px; }
.related .guide-grid { margin-bottom: 8px; }
.related h2 + .guide-grid, .related .tool-grid + h2 { margin-top: 28px; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-weight: 700; font-size: .92rem; color: #111; }
.byline span::before { content: "● "; font-size: .6em; vertical-align: .2em; }
.byline span:first-child::before { content: ""; }
.toc { background: var(--surface-2); border: var(--bw) solid var(--ink); border-radius: 12px; padding: 14px 20px; margin: 0 0 1.4em; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; }
.callout {
  background: var(--c1, var(--yellow)); color: #111; border: var(--bw) solid var(--ink); border-radius: 14px;
  padding: 16px 20px; margin: 1.4em 0; box-shadow: 3px 3px 0 var(--ink);
}
.callout p:last-child { margin-bottom: 0; }
.callout a:not(.btn) { color: #111; }
.callout .btn { margin-top: 6px; }
.note { border-left: 5px solid var(--ink); background: var(--surface-2); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 1.2em 0; }

/* ---------- Modal ---------- */
.mg-modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: rgba(17, 17, 17, .55); opacity: 0; transition: opacity .15s;
}
.mg-modal.open { opacity: 1; }
.mg-modal-box {
  position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-width: 3px; border-radius: 20px; padding: 24px; box-shadow: 8px 8px 0 var(--ink);
  transform: translateY(16px) rotate(-1deg); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.mg-modal.open .mg-modal-box { transform: none; }
.mg-modal-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: var(--bw) solid var(--ink);
  background: var(--yellow); color: #111; font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 1;
}
.mg-card-img { display: block; width: 100%; max-width: 300px; margin: 0 auto; border-radius: 16px; border: var(--bw) solid var(--ink); box-shadow: var(--shadow); }
.mg-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 300; }

/* ---------- Percentile chart ---------- */
.pchart { margin-top: 20px; background: var(--surface); border-radius: 16px; padding: 18px 18px 10px; text-align: left; box-shadow: var(--shadow); }
.pc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.pc-pct {
  flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: #111; border: var(--bw) solid #111; box-shadow: 3px 3px 0 var(--ink);
}
.pc-num { font-weight: 800; font-size: 1.4rem; letter-spacing: -.03em; }
.pc-text strong { display: block; font-size: 1.2rem; line-height: 1.25; }
.pc-text span { color: var(--muted); font-size: .92rem; }
.pc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pc-axis { stroke: var(--ink); stroke-width: 2; }
.pc-curve { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.pc-area { fill: var(--pink); stroke: none; }
.pc-avg { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pc-you-line { stroke: var(--ink); stroke-width: 3; }
.pc-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 3; }
.pc-bubble { fill: var(--ink); }
.pc-bubble-t { fill: var(--bg); font-weight: 800; font-size: 14px; font-family: var(--font); }
.pc-tick { fill: var(--muted); font-size: 13px; font-weight: 700; font-family: var(--font); }
.pc-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 4px 0 6px; }

/* ---------- Copy button ---------- */
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .88rem; font-weight: 800;
  padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.copy-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.copy-btn.copied { background: var(--green); color: #111; }
.copy-btn svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
