/* Fermi.tr — günlük tahmin oyunu */

:root {
  --bg: #ECE6DC;          /* ayran */
  --paper: #FBF8F2;
  --ink: #1C1A17;
  --ink-2: #4A453F;
  --muted: #8C857B;
  --line: #DDD6CB;
  --red: #E0503A;         /* nar */
  --blue: #2B4DB3;        /* İznik */
  --yellow: #F2C744;      /* safran */
  --turq: #2AB3A3;        /* turkuaz */
  --hand: #FFD95C;
  --navy: #1E2A6E;
  --chalk: #2D4337;
  --wood: #8A5B39;
  --radius-card: 28px;
  --shadow-card: 0 34px 60px -32px rgba(70, 45, 20, .45), 0 2px 6px rgba(70, 45, 20, .06);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --hand-font: 'Caveat Brush', 'Comic Sans MS', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; pointer-events: none;
}
.topbar-left { display: flex; gap: 8px; }
.topbar > *, .topbar-left > * { pointer-events: auto; }
.round-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 0; color: var(--ink); text-decoration: none;
  box-shadow: 0 6px 14px -6px rgba(60, 40, 20, .35);
  transition: transform .15s ease;
}
.round-btn:hover { transform: translateY(-1px); }
.round-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round-btn--accent { background: var(--red); color: #fff; }

main { padding: 64px 16px 64px; outline: none; }
main:focus-visible { outline: none; }

/* ---------- cards ---------- */

.card {
  position: relative;
  max-width: 540px; margin: 0 auto;
  border-radius: var(--radius-card);
  padding: 26px 34px 30px;
  box-shadow: var(--shadow-card);
  animation: card-in .35s cubic-bezier(.2, .8, .2, 1);
}
.card--red { background: var(--red); color: #fff; }
.card--blue { background: var(--blue); color: #fff; }
.card--yellow { background: var(--yellow); color: var(--ink); }
.card--paper { background: var(--paper); color: var(--ink); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-weight: 700; font-size: 14px; letter-spacing: -.01em;
}
.card-head .brand { text-decoration: none; }
.brand-dot { color: var(--hand); }
.card--yellow .brand-dot { color: var(--red); }

.qdots { display: flex; gap: 14px; }
.qdot {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  opacity: .55; background: none; border: 0; padding: 2px; color: inherit;
}
.qdot svg { width: 17px; height: 17px; }
.qdot.is-current { opacity: 1; }
.qdot.is-done { opacity: .85; }
.qdot[disabled] { cursor: default; }

.icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}

/* ---------- home ---------- */

.hero { padding-bottom: 48px; text-align: center; }
.hero .card-head { text-align: left; }
.hero-title {
  margin: 58px 0 2.25em;
  font-size: clamp(40px, 9vw, 60px); font-weight: 900; line-height: 1; letter-spacing: -.035em;
}
.caret-slot { position: relative; display: inline-block; width: 0; left: -.14em; }
.caret-slot .caret {
  position: absolute; left: 50%; top: .72em; transform: translateX(-50%);
  font-family: var(--hand-font); font-weight: 400; color: var(--hand); font-size: .62em; line-height: 1;
}
.caret-slot .inserted {
  position: absolute; left: 50%; top: 1.02em; transform: translateX(-14%) rotate(-3deg); transform-origin: left center;
  font-family: var(--hand-font); font-weight: 400; color: var(--hand);
  font-size: .98em; letter-spacing: .01em; white-space: nowrap; line-height: 1;
}
.hero-date { font-size: 12px; font-weight: 700; letter-spacing: .1em; margin: 0 0 10px; }
.hero-icons { display: flex; justify-content: center; gap: 22px; margin-bottom: 34px; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.hero-icons span { display: flex; align-items: center; gap: 6px; opacity: .85; }
.hero-icons svg { width: 18px; height: 18px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 2px solid transparent;
  padding: 13px 26px; min-height: 46px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.pill:hover:not([disabled]) { transform: translateY(-1px); }
.pill:active:not([disabled]) { transform: translateY(1px); }
.pill--white { background: #fff; color: var(--red); box-shadow: 0 12px 24px -10px rgba(80, 20, 0, .45); }
.card--blue .pill--white { color: var(--blue); }
.pill--ghost { background: transparent; border-color: rgba(255, 255, 255, .55); color: rgba(255, 255, 255, .7); }
.pill--ink { background: var(--ink); color: #fff; }
.pill--outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.pill--red { background: var(--red); color: #fff; }
.pill--block { width: 100%; }
.pill[disabled] { cursor: not-allowed; }

.section { max-width: 860px; margin: 96px auto 0; }
.section-title {
  text-align: center; font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 48px;
}
.marker {
  background: linear-gradient(transparent 58%, var(--hand) 58%, var(--hand) 92%, transparent 92%);
  padding: 0 .12em;
}
.how-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 72px; }
.how-row h3 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin: 0 0 14px; }
.how-row p { color: var(--ink-2); font-size: 14.5px; margin: 0; max-width: 330px; }
.how-row--flip .how-copy { order: 2; }
.demo { pointer-events: none; user-select: none; }
.demo .card { max-width: 320px; padding: 16px 18px 18px; border-radius: 20px; animation: none; font-size: 12px; }
.demo-tilt-r { transform: rotate(3deg); }
.demo-tilt-l { transform: rotate(-3deg); }

.explainer {
  background: var(--navy); color: #fff; border-radius: var(--radius-card); padding: 34px 38px;
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.explainer::after {
  content: ''; position: absolute; inset: 0; opacity: .09; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.5'%3E%3Cpath d='M40 4c8 12 8 24 0 36-8-12-8-24 0-36zM40 76c-8-12-8-24 0-36 8 12 8 24 0 36zM4 40c12-8 24-8 36 0-12 8-24 8-36 0zM76 40c-12 8-24 8-36 0 12-8 24-8 36 0z'/%3E%3Ccircle cx='40' cy='40' r='5'/%3E%3Ccircle cx='0' cy='0' r='10'/%3E%3Ccircle cx='80' cy='0' r='10'/%3E%3Ccircle cx='0' cy='80' r='10'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3C/g%3E%3C/svg%3E");
}
.explainer p { position: relative; z-index: 1; font-size: 16.5px; line-height: 1.75; margin: 0 0 14px; max-width: 620px; }
.explainer p:last-child { margin-bottom: 0; }
.explainer .hand { font-family: var(--hand-font); color: var(--hand); font-size: 1.25em; }

.left-title { text-align: left; margin-bottom: 18px; }
.chalkboard {
  background: var(--chalk); color: #F4F1EA; border: 12px solid var(--wood); border-radius: 18px;
  padding: 28px 32px 26px; box-shadow: var(--shadow-card), inset 0 0 40px rgba(0, 0, 0, .35);
  font-family: var(--hand-font); font-size: 22px; line-height: 1.35;
}
.chalkboard p { margin: 0 0 18px; }
.chalkboard small { display: block; text-align: right; font-size: .82em; opacity: .75; }
.chalk-sub { font-size: 14.5px; color: var(--ink-2); margin: -8px 0 18px; }
.center { text-align: center; }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 2px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 500; font-size: 22px; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 10px 0 0; font-size: 15px; }

.footer { text-align: center; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; margin: 80px 0 0; }
.footer a { text-decoration: none; }
.footer-logo { margin: 0 auto 6px; }
.brand--logo { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- play: question ---------- */

.q-card { min-height: 380px; display: flex; flex-direction: column; }
.q-text {
  margin: 20px 0 28px;
  font-size: clamp(25px, 5.6vw, 36px); font-weight: 700; line-height: 1.12; letter-spacing: -.022em;
  text-wrap: balance;
}
.guess-box {
  display: flex; align-items: baseline; gap: 12px;
  background: rgba(255, 255, 255, .17); border-radius: 18px; padding: 12px 20px 12px;
  transition: background-color .15s ease;
}
.guess-box:focus-within { background: rgba(255, 255, 255, .24); }
.guess-input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; outline: none;
  font-size: clamp(28px, 7vw, 40px); font-weight: 800; letter-spacing: -.02em; padding: 4px 0;
  caret-color: var(--hand);
}
.guess-input::placeholder { color: rgba(255, 255, 255, .5); font-weight: 600; }
.guess-unit { font-size: 12px; font-weight: 700; letter-spacing: .07em; opacity: .9; white-space: nowrap; }
.guess-hint { min-height: 22px; margin: 8px 4px 0; font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.mul-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 0; }
.mul-chip {
  border: 0; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .16); color: #fff; transition: background-color .15s ease;
}
.mul-chip:hover { background: rgba(255, 255, 255, .28); }
.q-actions { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 16px; gap: 12px; }
.circle-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 2px solid rgba(255, 255, 255, .6); color: #fff;
}
.circle-btn svg { width: 20px; height: 20px; }
.lock-btn.is-ready { background: #fff; color: var(--red); border-color: #fff; }

/* ---------- play: reveal ---------- */

.reveal-grid { display: grid; gap: 10px; margin: 18px 0 14px; }
.stat-box { border-radius: 14px; padding: 10px 16px 12px; }
.stat-box--you { background: rgba(255, 255, 255, .13); }
.stat-box--answer { background: var(--paper); color: var(--ink); border: 3px solid var(--hand); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-unit { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.answer-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.landed { margin: 6px 0 2px; }
.landed-value { font-size: clamp(30px, 7vw, 38px); font-weight: 900; color: var(--hand); letter-spacing: -.03em; line-height: 1.05; }
.landed-sub { font-size: 13px; color: rgba(255, 255, 255, .85); }
.verdict { font-family: var(--hand-font); font-size: 22px; color: var(--hand); margin-left: 6px; font-weight: 400; letter-spacing: 0; }

.hist-wrap { margin: 18px 0 8px; }
.hist { position: relative; height: 96px; display: flex; align-items: flex-end; gap: 3px; margin-top: 30px; }
.hist .bar {
  flex: 1; min-height: 3px; border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, .32);
  transform-origin: bottom; animation: bar-grow .6s cubic-bezier(.2, .8, .2, 1) both;
}
.hist .bar.is-you { background: var(--hand); }
@keyframes bar-grow { from { transform: scaleY(0); } }
.hist-answer { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 2px dashed rgba(255, 255, 255, .85); }
.hist-you {
  position: absolute; top: -30px; transform: translateX(-50%);
  background: var(--hand); color: var(--ink); border-radius: 6px; padding: 2px 7px;
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.hist-you::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--hand); border-bottom: 0;
}
.hist-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 700; opacity: .85; }
.hist-axis span:nth-child(2) { text-align: center; }
.hist-axis small { display: block; font-size: 9px; letter-spacing: .12em; opacity: .8; }
.card--yellow .hist .bar { background: rgba(28, 26, 23, .22); }
.card--yellow .hist .bar.is-you { background: var(--ink); }
.card--yellow .hist-you { background: var(--ink); color: #fff; }
.card--yellow .hist-you::after { border-top-color: var(--ink); }

.napkin { margin-top: 14px; background: rgba(0, 0, 0, .14); border-radius: 14px; }
.napkin summary {
  list-style: none; cursor: pointer; padding: 13px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.napkin summary::-webkit-details-marker { display: none; }
.napkin summary::after { content: '⌃'; transform: rotate(180deg); transition: transform .2s ease; font-weight: 700; }
.napkin[open] summary::after { transform: rotate(0); }
.napkin-body { padding: 0 16px 16px; font-size: 14px; }
.napkin ol { margin: 0 0 12px; padding-left: 20px; }
.napkin li { margin-bottom: 4px; }
.napkin .fact { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.napkin .source { font-size: 12px; opacity: .85; margin: 0; }
.next-btn { margin-top: 14px; }

/* ---------- play: summary ---------- */

.summary-head { font-size: 13.5px; font-weight: 700; }
.summary-head span { font-weight: 500; }
.score-big { font-size: clamp(72px, 19vw, 104px); font-weight: 900; letter-spacing: -.055em; line-height: .95; margin: 2px 0 10px; }
.score-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag { display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.rating { font-family: var(--hand-font); font-size: 24px; line-height: 1; }
.q-list { margin: 8px 0 18px; padding: 0; list-style: none; }
.q-list li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1.5px solid rgba(28, 26, 23, .18); font-size: 13px; font-weight: 600; }
.q-list b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-row .pill { padding: 10px 18px; min-height: 40px; font-size: 11px; }

.after { max-width: 540px; margin: 28px auto 0; display: grid; gap: 14px; }
.panel { background: var(--paper); border-radius: 22px; padding: 20px 22px; box-shadow: 0 16px 34px -26px rgba(70, 45, 20, .5); }
.panel h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.panel p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.countdown { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 900; letter-spacing: -.02em; }
.inline-form { display: flex; gap: 8px; }
.text-input {
  flex: 1; min-width: 0; border: 2px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 14px; font-size: 15px; outline: none;
}
.text-input:focus { border-color: var(--turq); }
textarea.text-input { resize: vertical; min-height: 110px; line-height: 1.5; }
.form-error { color: #B3261E; font-size: 13px; font-weight: 600; margin-top: 8px; min-height: 18px; }

/* ---------- accounts ---------- */

.avatar { font-weight: 800; font-size: 15px; line-height: 1; color: var(--ink); }
.auth-panel .google-btn { min-height: 44px; margin: 4px 0 2px; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.code-sent { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.code-input { font-size: 22px; font-weight: 800; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.auth-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.turnstile-slot { margin-top: 10px; }
.turnstile-slot:empty { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: #B5452F; }

/* ---------- leaderboard ---------- */

.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.lb li:last-child { border-bottom: 0; }
.lb .rank { color: var(--muted); font-weight: 700; font-size: 12px; }
.lb .nick { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .val { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb li.is-me { background: #FFF3C4; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.muted { color: var(--muted); }
.note { background: #EFEAE1; border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- pages ---------- */

.page { max-width: 640px; margin: 0 auto; }
.page h1 { font-size: clamp(30px, 6vw, 40px); font-weight: 900; letter-spacing: -.03em; margin: 12px 0 8px; }
.page .lede { color: var(--ink-2); margin: 0 0 28px; }
.page .panel + .panel { margin-top: 14px; }
.page-text p, .page-text li { color: var(--ink-2); font-size: 15.5px; }
.page-text h2 { font-size: 19px; margin: 28px 0 8px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-tile { background: #fff; border-radius: 16px; padding: 14px 12px; text-align: center; }
.stat-tile b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.03em; }
.stat-tile span { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.archive-item {
  display: block; text-decoration: none; background: var(--paper); border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 12px 26px -22px rgba(70, 45, 20, .6); transition: transform .15s ease;
}
.archive-item:hover { transform: translateY(-2px); }
.archive-item .no { font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.archive-item .date { font-size: 12px; color: var(--muted); font-weight: 600; }
.archive-item .icons { display: flex; gap: 6px; margin: 10px 0; color: var(--ink-2); }
.archive-item .icons svg { width: 16px; height: 16px; }
.archive-item .status { font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.archive-item.is-today { outline: 3px solid var(--red); }

/* score colours */
.s-great { --sc: var(--turq); }
.s-good { --sc: #8BC34A; }
.s-ok { --sc: var(--yellow); }
.s-meh { --sc: #F28C38; }
.s-bad { --sc: var(--red); }
.archive-item .status.has-score { color: var(--ink); }
.archive-item .status.has-score::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sc); margin-right: 6px; }

/* ---------- menu ---------- */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(28, 26, 23, .12); }
.menu {
  position: fixed; z-index: 50; top: 14px; left: 14px;
  width: min(384px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto;
  background: #F3EFE8; border-radius: 26px; padding: 14px 18px 22px;
  box-shadow: 0 30px 70px -20px rgba(40, 25, 10, .45);
  transform-origin: 18px 18px; transform: scale(.08); opacity: 0; visibility: hidden;
  transition: transform .32s cubic-bezier(.2, .9, .2, 1), opacity .2s ease, visibility 0s linear .32s;
}
.menu.is-open { transform: none; opacity: 1; visibility: visible; transition: transform .32s cubic-bezier(.2, .9, .2, 1), opacity .2s ease; }
.menu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.menu-head .brand { font-weight: 800; color: var(--ink-2); text-decoration: none; }
.menu-card { background: #fff; border-radius: 20px; padding: 16px 18px; margin-bottom: 12px; }
.menu-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.menu-card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0; font-weight: 800; }
.menu-card-head h2 svg { width: 20px; height: 20px; }
.menu-card-head a { font-size: 11.5px; font-weight: 700; color: #B5452F; text-decoration: none; white-space: nowrap; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mini-grid a, .mini-grid span { aspect-ratio: 2.2 / 1; border-radius: 4px; background: #E7E3DC; display: block; }
.mini-grid a.played { background: var(--sc); }
.mini-grid .is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.mini-grid .future { background: #F2EFEA; }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.progress .track { flex: 1; height: 6px; background: #ECE8E1; border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--turq); border-radius: inherit; }
.menu-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.menu-tile { background: #fff; border-radius: 20px; padding: 16px; text-decoration: none; display: grid; gap: 22px; }
.menu-tile svg { width: 22px; height: 22px; }
.menu-tile b { font-size: 14px; }
.menu-links { display: flex; gap: 18px; padding: 6px 4px; font-size: 13px; font-weight: 600; }
.menu-links a { text-decoration: none; color: var(--ink-2); }
.menu-foot { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--muted); padding: 10px 4px 0; }

/* ---------- calculator ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(28, 26, 23, .45); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.calc {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr;
  background: #fff; border-radius: 26px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
  animation: card-in .25s cubic-bezier(.2, .8, .2, 1);
}
.scratch { background: #FFFDF6; border-right: 1px solid #EEE9DF; display: flex; flex-direction: column; min-height: 300px; }
.scratch-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px; border-bottom: 1px solid #EEE9DF; }
.scratch-head button { background: none; border: 0; color: var(--muted); padding: 4px; }
.scratch-head svg { width: 15px; height: 15px; }
.scratch textarea {
  flex: 1; border: 0; outline: none; resize: none; padding: 8px 14px; font-size: 14px; color: var(--ink-2);
  background: repeating-linear-gradient(#FFFDF6 0 21px, #E8E3D8 21px 22px); line-height: 22px; background-attachment: local;
}
.keys { padding: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; align-content: start; }
.calc-display {
  grid-column: 1 / -1; background: var(--blue); color: #fff; border-radius: 18px; padding: 8px 14px 6px;
  text-align: right; overflow: hidden; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25);
}
.calc-expr { font-size: 12px; opacity: .8; min-height: 18px; white-space: nowrap; overflow: hidden; direction: rtl; }
.calc-expr span { direction: ltr; unicode-bidi: isolate; }
.calc-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key { height: 46px; border-radius: 999px; border: 0; background: #EFF0F5; color: var(--ink); font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.key:active { transform: scale(.95); }
.key--c { background: var(--ink); color: #fff; }
.key--div { background: #A35BF0; color: #fff; }
.key--mul { background: var(--red); color: #fff; }
.key--sub { background: #4F6BEE; color: #fff; }
.key--add { background: #4DB67A; color: #fff; }
.key--eq { background: var(--yellow); color: var(--ink); }
.key svg { width: 20px; height: 20px; }
.calc-use { grid-column: 1 / -1; margin-top: 4px; }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 140%);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  transition: transform .3s cubic-bezier(.2, .9, .2, 1), visibility 0s linear .3s; pointer-events: none; max-width: calc(100vw - 32px);
  visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .3s cubic-bezier(.2, .9, .2, 1); }

.spinner { width: 28px; height: 28px; margin: 120px auto; border: 3px solid rgba(28, 26, 23, .15); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { text-align: center; padding: 120px 20px; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .how-row { grid-template-columns: 1fr; gap: 26px; margin-bottom: 56px; }
  .how-row--flip .how-copy { order: 0; }
  .how-row p { max-width: none; }
  .demo .card { margin: 0 auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  main { padding: 62px 12px 48px; }
  .card { padding: 20px 20px 22px; border-radius: 24px; }
  .hero-title { margin: 44px 0 2.3em; }
  .qdots { gap: 8px; }
  .qdot .qn { display: none; }
  .explainer { padding: 24px 22px; }
  .chalkboard { padding: 20px; font-size: 19px; border-width: 9px; }
  .calc { grid-template-columns: 1fr; }
  .scratch { order: 2; min-height: 150px; border-right: 0; border-top: 1px solid #EEE9DF; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
