@import url("/fonts/fonts.css");

/* Paper notebook in light mode, chalkboard at night in dark mode.
   Theme: /theme.js always sets <html data-theme="light|dark"> (from the Görünüm setting or
   the OS preference), so the dark values live in exactly one block. */
:root {
  /* surfaces */
  --paper: #faf6ec;
  --paper-dot: #ece4d0;
  --card: #fffdf8;
  --card-2: #f3ede0;
  /* text */
  --ink: #1f1d1a;
  --muted: #5f584c;
  --accent-text: #b23c1c;
  /* lines & elevation */
  --line: #2a2722;
  --line-soft: #d8cfbb;
  --shadow-c: #2a2722;
  --shadow: 3px 3px 0 var(--shadow-c);
  --shadow-sm: 2px 2px 0 var(--shadow-c);
  /* brand fills (never text on their own) */
  --sun: #ffcf3a;        --on-accent: #1f1d1a;
  --sun-light: #fff3c7;  --on-sun-light: #1f1d1a;
  --tomato: #ef5f3c;
  --mint: #3bb273;
  --mint-strong: #1d7a48;
  --progress: #1d7a48;
  --sky: #4a9be0;
  --lilac: #b39ddb;
  --focus: #1b66c9;
  /* states */
  --good: #17693b;  --good-bg: #dcf1e3;
  --bad: #a8301a;   --bad-bg: #fbe3dc;
  --mark: #ffe38a;  --mark-text: #1f1d1a;

  /* shape */
  --sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius: 18px;
  /* type */
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.75rem, 5vw, 2.25rem);
  /* spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --tabbar: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #131816;
  --paper-dot: #202824;
  --card: #1e2622;
  --card-2: #27302c;
  --ink: #f2eee3;
  --muted: #aab5ad;
  --accent-text: #ff9478;
  --line: #7d8f85;
  --line-soft: #34403a;
  --shadow-c: #0a0d0c;
  --sun: #ffcf3a;        --on-accent: #1f1d1a;
  --sun-light: #40381f;  --on-sun-light: #f6ecc8;
  --tomato: #ff7a5a;
  --mint: #45c07f;
  --mint-strong: #1d7a48;
  --progress: #45c07f;
  --sky: #6cb4f0;
  --lilac: #c3b1e6;
  --focus: #7cc0ff;
  --good: #86e0a6;  --good-bg: #1d3a29;
  --bad: #ff9f8a;   --bad-bg: #3d2420;
  --mark: #4d4318;  --mark-text: #fff0b8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  font: var(--fs-md)/1.55 var(--body);
}
.wrap { max-width: 960px; margin: 0 auto; padding: var(--s2) var(--s4) calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s4)); }
.wrap.wide { max-width: 1120px; padding-bottom: var(--s6); }
body.in-round .wrap { padding-bottom: var(--s6); }
#app { max-width: 720px; margin: 0 auto; }
#app.wide { max-width: none; }
@media (min-width: 760px) { .wrap { padding: var(--s2) var(--s5) var(--s6); } }

a { color: inherit; text-decoration-color: var(--tomato); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 var(--s2); letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
[tabindex="-1"]:focus { outline: none; }
p { margin: 0 0 var(--s3); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.squiggle { display: block; width: 140px; height: 10px; margin: -2px 0 var(--s3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
header.top { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s1) 0 var(--s3); }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.4rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.logo .mascot { width: 36px; height: 36px; }
.logo span { color: var(--accent-text); }
.hud { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-sm) var(--display); min-height: 44px;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 0 var(--s3);
  text-decoration: none; color: var(--ink);
}
.hud-chip .ico { width: 20px; height: 20px; }
.hud-chip .sep { color: var(--muted); }
.xpbar { width: 44px; height: 8px; border-radius: 6px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line-soft); }
.xpbar > div { height: 100%; background: var(--progress); }
.icon-btn {
  background: var(--card); border: 2px solid var(--line); border-radius: 50%; width: 44px; height: 44px; min-height: 44px;
  padding: 0; font-size: 1.1rem; color: var(--ink);
}
.icon-btn .ico { width: 24px; height: 24px; }
.roundbar { display: none; align-items: center; gap: var(--s2); width: 100%; }
.roundbar .seg { margin-left: auto; }
body.in-round .logo, body.in-round .hud, body.in-round .tabs { display: none; }
body.in-round .roundbar { display: flex; }

/* ---------- tabs: bottom bar on phones, inline in the header on desktop ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 0 var(--s2) env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line-soft);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  font: 600 var(--fs-xs) var(--display); color: var(--muted); min-height: 44px;
}
.tabs a .ico { width: 24px; height: 24px; padding: 2px; box-sizing: content-box; border-radius: 999px; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] .ico { background: var(--sun); padding: 2px 14px; box-shadow: inset 0 0 0 1.5px var(--line); }
:root[data-theme="dark"] .tabs a[aria-current="page"] .ico { background: var(--sun-light); box-shadow: inset 0 0 0 1.5px var(--sun); }
@media (min-width: 760px) {
  .tabs { position: static; display: flex; gap: var(--s1); height: auto; padding: 0; background: none; border: 0; margin-left: var(--s3); }
  .tabs a { flex-direction: row; gap: 6px; padding: 0 var(--s3); border-radius: 999px; font-size: var(--fs-sm); }
  .tabs a .ico { padding: 0; }
  .tabs a[aria-current="page"] { background: var(--sun); color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--line); }
  .tabs a[aria-current="page"] .ico { background: none; padding: 0; box-shadow: none; }
  .tabs a:hover { background: var(--card-2); }
  .tabs a[aria-current="page"]:hover { background: var(--sun); }
  :root[data-theme="dark"] .tabs a[aria-current="page"],
  :root[data-theme="dark"] .tabs a[aria-current="page"]:hover { background: var(--sun-light); color: var(--on-sun-light); box-shadow: inset 0 0 0 1.5px var(--sun); }
  :root[data-theme="dark"] .tabs a[aria-current="page"] .ico { background: none; box-shadow: none; }
}

/* ---------- containers ---------- */
.card {
  background: var(--card); border: 2px solid var(--line-soft); border-radius: var(--radius);
  padding: var(--s4); margin-bottom: var(--s5); position: relative;
}
@media (min-width: 640px) { .card { padding: var(--s5); } }
.page-head { margin: var(--s2) 0 var(--s4); }
.page-head h1 { margin-bottom: var(--s1); }
.page-head p { margin: 0; }
.hero { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; }
.hero .ico { width: 64px; height: 64px; }
.bubble {
  position: relative; display: inline-block; background: var(--card-2); border: 2px solid var(--line-soft); border-radius: 18px;
  padding: 8px 14px; font-family: var(--hand); font-size: 1.2rem; line-height: 1.25;
}
.bubble::before {
  content: ""; position: absolute; left: -11px; top: 16px; width: 18px; height: 18px; background: var(--card-2);
  border-left: 2px solid var(--line-soft); border-bottom: 2px solid var(--line-soft); transform: rotate(45deg);
}
.say { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.say .mascot { flex-shrink: 0; }
.block-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s3); }
.block-title h2 { font-size: var(--fs-lg); margin: 0; }

/* ---------- buttons: one primary per screen ---------- */
button, .btn {
  font: 600 1rem var(--display); cursor: pointer; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: var(--sketch); padding: 8px 18px; min-height: 44px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s ease, box-shadow .06s ease, background-color .1s ease;
}
button:hover, .btn:hover { background-color: var(--card-2); }
button:active, .btn:active { transform: translate(1px, 1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.primary { background: var(--sun); color: var(--on-accent); box-shadow: var(--shadow); min-height: 48px; }
.primary:hover { background: var(--sun); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); }
.primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }
.go { background: var(--mint-strong); color: #fff; }
.go:hover { background: var(--mint-strong); }
.big { padding: 12px 22px; font-size: 1.15rem; width: 100%; min-height: 52px; }
.btn.sm, button.sm { position: relative; padding: 4px 12px; font-size: var(--fs-sm); min-height: 40px; }
.btn.sm::after, button.sm::after { content: ""; position: absolute; inset: -2px 0; }
.danger { color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
a.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
button.link, a.link {
  display: inline; border: 0; background: none; min-height: 0; padding: 11px 4px; color: var(--accent-text);
  text-decoration: underline; text-decoration-color: currentColor; font: 600 var(--fs-sm) var(--body); border-radius: 4px; cursor: pointer;
}
button.link:hover, a.link:hover { background: none; }
.links { display: flex; flex-wrap: wrap; gap: 0 var(--s3); margin-top: var(--s2); }

.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { border: 0; border-radius: 0; padding: 0 14px; min-height: 40px; background: transparent; font-size: var(--fs-sm); }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* dark: no cream slab; a dim amber fill with a sun underline marks the choice */
:root[data-theme="dark"] .seg button.on,
:root[data-theme="dark"] .seg button[aria-pressed="true"] {
  background: var(--sun-light); color: var(--on-sun-light); box-shadow: inset 0 -3px 0 var(--sun);
}

/* ---------- tiles: the tappable "stickers" ---------- */
.board { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin: 0 0 var(--s5); }
@media (min-width: 560px) { .board { grid-template-columns: repeat(2, 1fr); } }
.board.two { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .board.three { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left;
  padding: var(--s3) var(--s4); min-height: 72px; border: 2px solid var(--line); border-radius: var(--sketch); box-shadow: var(--shadow);
  background: var(--card); text-decoration: none; color: var(--ink); font-family: var(--body);
  transition: transform .06s ease, box-shadow .06s ease;
}
.tile:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); }
.tile:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }
.tile .ico { width: 40px; height: 40px; grid-row: span 2; }
.tile b { font-family: var(--display); font-size: var(--fs-md); font-weight: 600; line-height: 1.25; }
.tile span { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; }
.tile.sun { background: var(--sun-light); color: var(--on-sun-light); }
.tile.sun span { color: var(--muted); }
:root[data-theme="dark"] .tile.sun { border-color: var(--sun); }
.tile.stack { grid-template-columns: 1fr; align-content: start; }
.tile.stack .ico { grid-row: auto; margin-bottom: 4px; }
.tile.done::after {
  content: "✓"; position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--mint-strong); color: #fff; font: 700 .85rem/24px var(--body); text-align: center;
}

.rounds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .rounds { grid-template-columns: repeat(4, 1fr); } }
.round { border: 2px dashed var(--line-soft); border-radius: 14px; padding: 10px; text-align: center; font-size: var(--fs-sm); background: var(--card); }
.round .ico { width: 36px; height: 36px; display: block; margin: 0 auto 2px; }
.round b { display: block; font-family: var(--display); }
.round .tag { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }

.sticker {
  display: inline-block; font-family: var(--hand); font-size: .95rem; line-height: 1.4; padding: 0 8px; border: 1.5px solid var(--line);
  border-radius: 8px; background: var(--sun); color: var(--on-accent); transform: rotate(-3deg); white-space: nowrap;
}
.sticker.sky { background: var(--sky); } .sticker.mint { background: var(--mint-strong); color: #fff; }
.sticker.tomato { background: var(--tomato); color: var(--on-accent); } .sticker.lilac { background: var(--lilac); }
.pill { font-size: var(--fs-xs); padding: 2px 9px; border-radius: 999px; border: 1.5px solid var(--line-soft); background: var(--card-2); color: var(--ink); white-space: nowrap; font-weight: 700; }

.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.section-title .ico { width: 32px; height: 32px; }
.section-title h1, .section-title h2 { margin: 0; }

/* ---------- pack rows (library) ---------- */
.packs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 760px) { #app.wide .packs.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pack {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: var(--s3) var(--s4); border: 2px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; width: 100%;
  box-shadow: var(--shadow-sm); font-family: var(--body); font-weight: 400; color: var(--ink);
}
.pack-info { min-width: 0; flex: 1 1 200px; }
.pack-info b { font-family: var(--display); font-size: var(--fs-md); font-weight: 600; }
.pack .meta { font-size: var(--fs-sm); color: var(--muted); }
a.pack { flex-wrap: nowrap; min-height: 64px; padding: 10px 12px 10px var(--s4); text-decoration: none; transition: transform .06s ease, box-shadow .06s ease; }
a.pack .pack-info b { display: block; line-height: 1.3; }
a.pack:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-c); }
.weak-row { flex-wrap: nowrap; min-height: 64px; padding: 10px 12px 10px var(--s4); }
.weak-row .pack-info b { display: block; line-height: 1.3; }
.weak-row .btn { flex-shrink: 0; }
a.pack:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--shadow-c); }
a.pack .meta { line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.pack .chev { flex-shrink: 0; font: 700 1.3rem var(--display); color: var(--muted); }
.row-end { flex-shrink: 0; display: flex; align-items: center; gap: var(--s2); }
.row-end .mini { display: flex; align-items: center; gap: 6px; font: 700 var(--fs-xs) var(--body); color: var(--muted); }
.row-end .mastery { width: 40px; margin: 0; }
.mastery { height: 6px; border-radius: 6px; overflow: hidden; margin-top: 6px; background: var(--card-2); border: 1px solid var(--line-soft); max-width: 220px; }
.mastery > div, .mastery > span { display: block; height: 100%; background: var(--progress); }
.lib-tools { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.lib-count { margin: 0 0 var(--s3); }

/* ---------- play ---------- */
.qhead { display: flex; justify-content: space-between; gap: 8px; font: 600 var(--fs-sm) var(--body); color: var(--muted); margin-bottom: 8px; }
.timer { height: 10px; background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.timer > div { height: 100%; background: var(--bad); width: 100%; transition: width .25s linear; }
:root[data-theme="dark"] .timer > div { background: var(--tomato); }
.timer.calm > div, :root[data-theme="dark"] .timer.calm > div { background: var(--progress); }
.question { font-family: var(--display); font-size: clamp(1.3rem, 4.2vw, 1.6rem); font-weight: 600; margin: 6px 0 20px; line-height: 1.3; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .choices { grid-template-columns: 1fr; } }
.choices button {
  padding: 12px 14px; text-align: left; justify-content: flex-start; min-height: 56px; font: 700 var(--fs-md) var(--body);
  border-radius: 12px; box-shadow: none;
}
.choices button.picked { background: var(--sun); color: var(--on-accent); box-shadow: var(--shadow); }
.choices button.right { background: var(--good-bg); }
.choices button.wrong { background: var(--bad-bg); }
.choices button:disabled { opacity: 1; cursor: default; }
.hint { font-size: var(--fs-sm); color: var(--muted); margin: 14px 0 0; }

input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: 600 1.05rem var(--body); color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 10px 13px; min-height: 48px; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
input.handwrite, .sheet-paper input { font-family: var(--hand); font-size: 1.35rem; font-weight: 400; padding: 6px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; margin: 0; accent-color: var(--mint-strong); flex-shrink: 0; }
.answer-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .duo { grid-template-columns: 1fr; } }

.feedback { border: 2px solid var(--line-soft); border-left-width: 5px; border-radius: 14px; padding: 12px 16px; margin-top: 16px; background: var(--card); }
.feedback.ok { border-left-color: var(--good); }
.feedback.no { border-left-color: var(--bad); }
.feedback b { display: block; font-family: var(--display); margin-bottom: 2px; }

.score-big { font-family: var(--display); font-size: 3.25rem; font-weight: 700; line-height: 1; }
.score-big small { font-size: 1.5rem; color: var(--muted); }

/* answer sheet: one ruled line per answer (the input's own border) and a red margin */
.sheet-paper {
  background: var(--card); border-left: 3px solid color-mix(in srgb, var(--tomato) 70%, transparent);
  padding: 0 0 0 14px;
}
.sheet-paper label { display: grid; gap: 2px; padding: 10px 0; color: var(--ink); font-size: var(--fs-md); }
.sheet-paper label > span { font-weight: 700; }
.sheet-paper input, .sheet-paper select { background: transparent; border-width: 0 0 1.5px; border-color: var(--line); border-radius: 0; padding-left: 4px; }
.sheet-paper input, .sheet-paper select, .match-row select { scroll-margin-bottom: 96px; }
.sheet-paper input:focus, .sheet-paper select:focus { border-color: var(--focus); }
.sheet-note { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 var(--s3); }
.sticky-submit { margin-top: var(--s4); }
@media (max-width: 639px) {
  .sticky-submit {
    position: sticky; bottom: 0; z-index: 4; margin: var(--s4) calc(var(--s4) * -1) 0;
    padding: var(--s2) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--card);
    border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
  }
  /* soft fade so rows don't end in a hard cut above the bar */
  .sticky-submit::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 20px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--card));
  }
}
.fill-count { font-size: var(--fs-sm); color: var(--muted); text-align: center; margin: 0 0 6px; }

.review { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.review li { padding: 10px 14px; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--card); font-size: var(--fs-md); }
.review li.ok { border-left: 5px solid var(--good); }
.review li.no { border-left: 5px solid var(--bad); }
.review li.half { border-left: 5px solid var(--sun); }
.review li .mark { font: 700 1.2rem var(--display); float: right; margin-left: 8px; }
.review li.ok .mark { color: var(--good); }
.review li.no .mark { color: var(--bad); }
.review .ans { font-size: var(--fs-sm); margin-top: 2px; }
.review .ans .ok { color: var(--good); }
.review .ans .no { color: var(--bad); }
.review .ans button.sm { margin-left: 6px; }
.review .explain { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.review.night li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review.night li.cur { background: var(--sun-light); color: var(--on-sun-light); border-color: var(--line); }
:root[data-theme="dark"] .review.night li.cur { border-color: var(--sun); }

.match-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.match-row:last-of-type { border-bottom: 0; }
.match-row b { font-weight: 600; font-size: var(--fs-md); }
.match-row select { text-align: left; }
.match-row.ok { box-shadow: inset 4px 0 0 var(--good); padding-left: 10px; }
.match-row.no { box-shadow: inset 4px 0 0 var(--bad); padding-left: 10px; }
.match-row select:disabled { appearance: none; -webkit-appearance: none; opacity: 1; color: var(--ink); border-color: transparent; background: none; padding-left: 0; cursor: default; }
.match-row select:disabled:has(option[value=""]:checked) { color: var(--muted); font-style: italic; }
.match-row .fix { grid-column: 2; font-size: var(--fs-sm); font-weight: 700; color: var(--bad); }

/* ---------- learn: flash cards ---------- */
.flash {
  background: var(--card-2); border: 2px solid var(--line-soft); border-radius: var(--radius);
  padding: 28px 18px; min-height: 240px; cursor: pointer; text-align: center; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 10px; margin-bottom: 16px; user-select: none;
}
.flash.open { cursor: default; background: var(--card); }
.flash .question { margin: 0; }
.flash .back { font-family: var(--display); font-size: clamp(1.5rem, 5.5vw, 2.1rem); font-weight: 700; color: var(--accent-text); }
.flash .extra { font-size: var(--fs-sm); background: var(--sun-light); color: var(--on-sun-light); border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 10px 14px; text-align: left; max-width: 540px; }
.flash .src { font-size: var(--fs-sm); }
.flash .hint { margin: 0; }
.learn-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-btns button { padding: 14px; font-size: 1.05rem; min-height: 64px; }
.no-btn, .no-btn:hover { background: var(--bad-bg); }
.yes-btn, .yes-btn:hover { background: var(--good-bg); }
kbd { font: 600 .7rem var(--body); opacity: .75; border: 1.5px solid currentColor; border-radius: 5px; padding: 0 5px; }
@media (hover: none), (pointer: coarse) { kbd { display: none; } }

/* ---------- music ---------- */
.player { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.player .ico { width: 88px; height: 88px; flex-shrink: 0; }
.player.playing .ico { animation: spin 2.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player .bars { flex: 1; min-width: 0; }
.player .prog { height: 10px; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; background: var(--card-2); margin: 8px 0; }
.player .prog > div { height: 100%; background: var(--progress); width: 0; }
.modes { display: grid; gap: 10px; margin: var(--s4) 0; text-align: left; border: 0; padding: 0; }
.modes legend { font: 600 var(--fs-sm) var(--body); color: var(--muted); margin-bottom: 6px; padding: 0; }
.mode-card {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; min-height: 56px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; color: var(--ink); font-size: var(--fs-sm);
}
.mode-card input { grid-row: span 2; }
.mode-card b { font: 600 var(--fs-md) var(--display); }
.mode-card span { color: var(--muted); }
.mode-card:has(input:checked) { background: var(--sun-light); color: var(--on-sun-light); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .mode-card:has(input:checked) { border-color: var(--sun); }
.mode-line { font-size: var(--fs-sm); color: var(--muted); margin: -6px 0 10px; }
.mode-panel { margin: 0 0 var(--s4); }
.mode-panel .modes { margin: 0; }

/* ---------- estimate ---------- */
.ruler { position: relative; height: 46px; margin: 70px 14px 6px; border-bottom: 3px solid var(--line); }
.ruler .tick { position: absolute; bottom: -3px; width: 2px; height: 10px; background: var(--line); }
.ruler .pin { position: absolute; bottom: 0; transform: translateX(-50%); font-size: var(--fs-sm); text-align: center; white-space: nowrap; }
.ruler .pin::after { content: ""; display: block; margin: 2px auto 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.ruler .pin.truth::after { background: var(--mint); }
.ruler .pin.guess::after { background: var(--tomato); }

/* ---------- team ---------- */
.code-big { font-family: var(--display); font-size: 3rem; letter-spacing: .2em; font-weight: 700; background: var(--sun); color: var(--on-accent); display: inline-block; padding: 2px 16px; border: 2px solid var(--line); border-radius: var(--sketch); box-shadow: var(--shadow); transform: rotate(-2deg); }
.players { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.player-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border: 2px solid var(--line-soft); border-radius: 999px; background: var(--card); font-weight: 700; }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--display); font-size: .85rem; color: #1f1d1a; }
.byline { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }

/* ---------- stats / badges ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 12px 8px; border: 2px solid var(--line-soft); border-radius: 14px; background: var(--card); }
.badge .ico { width: 40px; height: 40px; }
.badge b { display: block; font-family: var(--display); font-size: var(--fs-sm); }
.badge span { font-size: var(--fs-xs); color: var(--muted); }
.badge.locked { border-style: dashed; background: transparent; }
.badge.locked b { color: var(--muted); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { border: 2px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; background: var(--card-2); }
.stat b { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: var(--fs-xs); color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 8px; }
.spark div { flex: 1; background: var(--progress); border-radius: 4px 4px 0 0; min-height: 4px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.history li:last-child { border-bottom: 0; }

/* ---------- cheat sheet ---------- */
ol.sheet { padding-left: 1.5rem; margin: 0; display: grid; gap: 10px; }
ol.sheet b { color: var(--accent-text); font-family: var(--display); font-weight: 600; }
.pairs { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.pairs td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; height: 40px; }
.pairs tr:last-child td { border-bottom: 0; }
.pairs td.arrow { width: 1.5em; color: var(--muted); text-align: center; }
.pairs td.r { color: var(--accent-text); font-weight: 700; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 28px 16px; }
.empty .mascot, .empty > .ico { margin: 0 auto 6px; display: block; }
.toast {
  position: fixed; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); left: 50%; transform: translateX(-50%) rotate(-1deg); z-index: 20;
  background: var(--sun); color: var(--on-accent); border: 2px solid var(--line); border-radius: var(--sketch); box-shadow: var(--shadow);
  padding: 10px 18px; font-family: var(--display); font-weight: 600; max-width: calc(100% - 32px); text-align: center;
}
body.in-round .toast { bottom: 18px; }
@media (min-width: 760px) { .toast { bottom: 18px; } }
.toast.update-toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; cursor: pointer; z-index: 25; min-height: 44px; }
body.in-round .toast.update-toast { bottom: auto; display: none; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
details summary { cursor: pointer; font-family: var(--display); font-weight: 600; min-height: 44px; display: flex; align-items: center; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "▾"; margin-left: auto; padding-left: var(--s3); color: var(--muted); font-size: 1.1em; }
details[open] summary::after { content: "▴"; }
details[open] summary { margin-bottom: var(--s3); }

/* ---------- home ---------- */
.week { display: grid; gap: var(--s3); }
.week.tonight { background: var(--sun-light); color: var(--on-sun-light); border-color: var(--line); }
:root[data-theme="dark"] .week.tonight { border-color: var(--sun); }
.week-head { display: flex; align-items: center; gap: var(--s3); }
.week-head .mascot { flex-shrink: 0; }
.week-head h1 { font-size: clamp(1.5rem, 5vw, 2rem); margin: 0; }
.week-head .squiggle { margin: 2px 0 0; }
.week .when { font: 600 var(--fs-sm) var(--body); color: var(--muted); }
.week .primary { flex-direction: column; gap: 0; line-height: 1.2; }
.week .primary small { font: 600 var(--fs-sm) var(--body); }
.readbar { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm); color: var(--muted); }
.readbar .mastery { flex: 1; max-width: none; margin: 0; height: 8px; }

/* ---------- Salı modu: "Son 5 dakika" ---------- */
.sali-head { display: grid; gap: var(--s4); }
.sali-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.sali-top .icon-btn { flex-shrink: 0; }
.sali-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.sali-steps button {
  width: 100%; min-height: 48px; padding: 4px 6px; border-radius: 12px; flex-direction: column; gap: 0; line-height: 1.15;
  font: 600 var(--fs-xs) var(--display); white-space: normal; text-align: center;
}
.sali-steps .num { font-size: var(--fs-md); }
.sali-steps button.done .num { color: var(--good); }
.sali-steps button[aria-current="step"] { background: var(--sun); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.sali-steps button[aria-current="step"] .num { color: inherit; }
:root[data-theme="dark"] .sali-steps button[aria-current="step"] { background: var(--sun-light); color: var(--on-sun-light); border-color: var(--sun); }
@media (min-width: 560px) { .sali-steps button { flex-direction: row; gap: 6px; font-size: var(--fs-sm); } }
.sali-body h2 { font-size: var(--fs-lg); margin-bottom: var(--s1); }
.sali-body h2.sub { margin-top: var(--s5); }
.sali-body > p { max-width: 65ch; }
.step-acts { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }
.step-acts .primary { margin-left: auto; }
.fact-sec { font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: var(--s4) 0 var(--s1); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; }
.facts li { padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); display: grid; gap: 4px; }
.facts li:last-child { border-bottom: 0; }
.facts b { font-family: var(--display); font-weight: 600; line-height: 1.3; }
.fact-marks { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: var(--fs-sm); }
.fact-marks mark { background: var(--mark); color: var(--mark-text); padding: 0 5px; border-radius: 4px; font-weight: 700; }
.sali-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px var(--s3); margin: 0 0 var(--s3); }
.sali-count b { font: 700 2rem/1.1 var(--display); }
.runsheet { list-style: none; padding: 0; margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); counter-reset: none; }
.runsheet li {
  display: grid; padding: 6px 12px; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--card); font-size: var(--fs-sm); line-height: 1.25;
}
.runsheet li b { font-family: var(--display); font-weight: 600; }
.runsheet li span { color: var(--muted); font-size: var(--fs-xs); }
.runsheet li.bonus { border-style: dashed; }
.runsheet li.break { background: var(--card-2); }
.sali-foot { text-align: center; margin: calc(var(--s3) * -1) 0 var(--s5); }

/* ---------- team names: suggester chips, room sticker, name on the sheet ---------- */
.tn-box { margin: var(--s2) 0 var(--s4); }
.tn-sugs { list-style: none; padding: 0; margin: 0 0 var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); }
.tn-sug {
  min-height: 44px; border-radius: 12px; padding: 6px 14px; font: 600 var(--fs-md) var(--body); text-align: left;
  flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.25;
}
.tn-sug small { font: 700 var(--fs-xs) var(--body); color: var(--accent-text); }
.tn-mine { margin: 0 0 var(--s3); font-size: var(--fs-sm); color: var(--muted); }
.team-line { margin: var(--s2) 0 0; }
.sticker.team-sticker { white-space: normal; max-width: 100%; overflow-wrap: anywhere; font-size: 1.2rem; padding: 2px 10px; transform: rotate(-2deg); }
.tn-form { margin-bottom: var(--s2); }
.sheet-team { margin: 0 0 var(--s2); padding: 6px 0; border-bottom: 1.5px solid var(--line); display: flex; align-items: baseline; gap: var(--s2); overflow-wrap: anywhere; }
.sheet-team span { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.sheet-team b { font: 400 1.35rem var(--hand); }

/* ---------- settings sheet ---------- */
dialog.sheet-dlg {
  border: 2px solid var(--line-soft); border-radius: var(--radius); background: var(--card); color: var(--ink);
  padding: var(--s5); width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px);
}
dialog.sheet-dlg::backdrop { background: rgb(10 13 12 / .5); }
dialog.sheet-dlg { box-shadow: 0 18px 48px -12px var(--shadow-c); }
:root[data-theme="dark"] dialog.sheet-dlg {
  background: var(--card-2); border-color: color-mix(in srgb, var(--line) 45%, var(--card-2));
  box-shadow: 0 24px 60px -10px #000;
}
:root[data-theme="dark"] dialog.sheet-dlg::backdrop { background: rgb(5 7 6 / .72); }
:root[data-theme="dark"] .sheet-dlg .set-row { border-bottom-color: color-mix(in srgb, var(--line) 30%, var(--card-2)); }
.sheet-dlg h2 { margin: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 52px; border-bottom: 1px solid var(--line-soft); font-weight: 600; }
.set-row:last-of-type { border-bottom: 0; }
label.set-row { display: flex; font-size: var(--fs-md); color: var(--ink); cursor: pointer; }
.set-row small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- admin (shares the look) ---------- */
.admin-grid { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .admin-grid { grid-template-columns: 1fr; } }
label { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
label > span { font-weight: 700; }
.form { display: grid; gap: 10px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .form-2 { grid-template-columns: 1fr; } }
textarea { min-height: 80px; resize: vertical; }
textarea.code { font: .85rem ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 140px; }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.items li { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.items li .txt { min-width: 0; overflow-wrap: anywhere; }
.items li .acts { display: flex; gap: 6px; flex-shrink: 0; }
.items li .acts button { padding: 4px 10px; font-size: .85rem; }
.pack.sel { background: var(--sun-light); color: var(--on-sun-light); }
.search-results { display: grid; gap: 6px; margin-top: 8px; }
.search-results button { justify-content: flex-start; text-align: left; font-family: var(--body); font-weight: 600; padding: 6px 10px; }
.search-results img { width: 36px; height: 36px; border-radius: 6px; border: 1.5px solid var(--line-soft); }

/* ---------- brief (pre-quiz cheatsheet) ---------- */
.brief-head { margin: var(--s2) 0 var(--s3); }
.brief-head h1 { margin-bottom: var(--s1); }
.brief-head p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.brief-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.brief-nav {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s2);
  margin: 0 calc(var(--s4) * -1) var(--s4); padding: 6px var(--s4) 7px; background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}
.brief-nav .chips { flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.brief-nav .count { font: 700 var(--fs-sm) var(--body); color: var(--muted); white-space: nowrap; }
.brief-nav .navbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--progress); transform-origin: left; }
@media (min-width: 760px) { .brief-nav { margin: 0 0 var(--s4); padding: 6px 0 7px; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 4px; margin: 0 -4px; scrollbar-width: none; }
@media (min-width: 760px) { .lib-tools .chips { flex-wrap: wrap; overflow: visible; } }
.chips::-webkit-scrollbar { display: none; }
.chip {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; text-decoration: none;
  font: 600 var(--fs-sm) var(--display); padding: 0 12px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); white-space: nowrap; cursor: pointer;
}
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip span { font-family: var(--body); color: var(--muted); font-size: var(--fs-xs); }
.chip[aria-pressed="true"], .chip.hot { background: var(--sun); color: var(--on-accent); }
.chip[aria-pressed="true"] span { color: var(--on-accent); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.brief-sec { scroll-margin-top: 64px; }
.brief-sec .sec-title { display: flex; align-items: center; gap: 10px; padding-bottom: var(--s2); border-bottom: 2px solid var(--line-soft); margin-bottom: var(--s1); }
.brief-sec .sec-title .ico { width: 28px; height: 28px; }
.brief-sec .sec-title h2 { margin: 0; font-size: var(--fs-lg); }
@media (max-width: 639px) {
  .brief-sec.card { background: none; border: 0; border-radius: 0; padding: 0; }
}
.brief-list { display: grid; }
.brief-item { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.brief-item:last-child { border-bottom: 0; }
.brief-item h3 { font-size: var(--fs-md); font-weight: 600; margin: 10px 0 4px; line-height: 1.3; }
.brief-item p { margin: 0 0 2px; line-height: 1.6; max-width: 65ch; hyphens: auto; -webkit-hyphens: auto; }
.brief-item mark { background: var(--mark); color: var(--mark-text); padding: 0 3px; border-radius: 4px; font-weight: 700; }
.brief-item.done h3, .brief-item.done p { color: var(--muted); }
.brief-item.done mark { background: transparent; color: var(--muted); }
.brief-item .tick {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: none; border-radius: 10px; display: grid; place-items: center;
}
.brief-item .tick:hover { background: none; }
.brief-item .tick span {
  width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center;
  font: 700 1rem var(--body); background: var(--card);
}
.brief-item.done .tick span { background: var(--mint-strong); border-color: var(--mint-strong); color: #fff; }
.brief-end { text-align: center; }
.next-unread {
  position: fixed; right: var(--s4); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); z-index: 12;
  border-radius: 999px; box-shadow: var(--shadow-sm); background: var(--card); font-size: var(--fs-sm);
}
@media (min-width: 760px) { .next-unread { bottom: 24px; } }

/* ---------- music video clips ---------- */
.clipwrap { position: relative; border: 2px solid var(--line-soft); border-radius: 14px; overflow: hidden; background: #000; }
.clip { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.clip iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clipwrap.blurred .clip iframe { filter: blur(22px) saturate(1.4); transform: scale(1.15); }
.clipwrap .reveal { position: absolute; right: 10px; bottom: 10px; z-index: 2; min-height: 44px; box-shadow: var(--shadow-sm); }
.clip-slot .clip { margin-top: 8px; border: 2px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.flash .clip-slot { width: 100%; max-width: 520px; }
#ythost { position: fixed; left: -10000px; bottom: 0; width: 200px; height: 113px; pointer-events: none; }
.bip { background: var(--sun-light); color: var(--on-sun-light); border-color: var(--line-soft); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pop, .player.playing .ico { animation: none; }
  .tile, .tile:hover, .tile:active, a.pack:hover, .primary:hover, button:active, .btn:active { transform: none; transition: none; }
  .flash, .timer > div, button, .btn { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- late additions ---------- */
dialog.sheet-dlg { padding: 0; }
.dlg-body { padding: var(--s5); }
.set-row { flex-wrap: wrap; padding: 6px 0; }
@media (max-width: 420px) { .hud-chip .xpbar { display: none; } }
.brief-end .mascot { display: block; margin: 0 auto 6px; }
.brief-end .primary { margin-top: 4px; }
.logo b { font-weight: 700; }
button.link, a.link { display: inline-flex; align-items: center; min-height: 44px; padding-top: 0; padding-bottom: 0; }
.seg button { min-height: 44px; }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 4px; }
.crumbs a { display: inline-block; padding: 12px 0; margin: -12px 0; text-decoration-color: var(--line-soft); }
.crumbs a:hover { text-decoration-color: var(--tomato); }
kbd { border-color: color-mix(in srgb, currentColor 55%, transparent); }

/* ---------- spoiler-free clip player (music round) ---------- */
.clipwrap .clip > div, .clipwrap .clip iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clip-shield { position: absolute; inset: 0; z-index: 2; }               /* keeps hover/clicks away from YouTube's UI */
.clip-topcover {
  position: absolute; top: 0; left: 0; right: 0; height: max(18%, 52px); z-index: 3;
  background: var(--card-2); color: var(--muted); font-size: .8rem; display: flex; align-items: center; padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
}
/* bottom band: where captions and the YouTube logo appear */
.clip-bottomcover { position: absolute; left: 0; right: 0; bottom: 0; height: max(24%, 48px); z-index: 3; background: var(--card-2); border-top: 1px solid var(--line-soft); }
.clip-cover { position: absolute; inset: 0; z-index: 4; background: var(--card-2); display: grid; place-items: center; color: var(--muted); text-align: center; padding: 12px; }
.clip-cover[hidden] { display: none; }
.clip-ctrls { margin-top: 10px; }
.clipwrap.blurred .clip iframe { filter: blur(22px) saturate(1.4); transform: scale(1.15); }

/* ---------- first run: name prompt + data banner ---------- */
.welcome .dlg-body { display: grid; gap: var(--s4); }
.welcome-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; }
.welcome-head .mascot { flex-shrink: 0; }
.welcome-head h2 { font-size: var(--fs-xl); margin: 0 0 var(--s1); }
.welcome-head p { margin: 0; }
.welcome-acts { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.welcome-acts .primary { flex: 1 1 160px; }
.consent {
  position: fixed; left: var(--s3); right: var(--s3); z-index: 16; margin: 0 auto; max-width: 640px;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s2));
  background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 30px -12px var(--shadow-c); padding: var(--s3) var(--s4);
  display: grid; gap: var(--s2); font-size: var(--fs-sm);
}
.consent p { margin: 0; line-height: 1.45; }
.consent .link { min-height: 32px; padding: 0 2px; position: relative; }
.consent .link::after { content: ""; position: absolute; inset: -12px -4px; } /* 44px+ tap area without growing the line */
.consent-acts { display: flex; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; }
.consent-acts button { min-width: 112px; }
:root[data-theme="dark"] .consent { background: var(--card-2); box-shadow: 0 16px 40px -10px #000; }
body.in-round .consent { display: none; }
.consent .cs-short { display: none; }
/* While the banner is up, the page reserves its height (--consent-h, set by showConsent) so nothing hides under it. */
body:has(#consent) .wrap { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s2) + var(--consent-h, 96px) + var(--s4)); }
body.in-round:has(#consent) .wrap { padding-bottom: var(--s6); }
body:has(#consent) .next-unread { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s2) + var(--consent-h, 96px) + 12px); }
@media (max-width: 759px) {
  /* compact: short copy beside two small buttons, about 80px tall instead of 150 */
  .consent {
    left: var(--s2); right: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: 14px;
    grid-template-columns: 1fr auto; align-items: center; gap: var(--s2); font-size: var(--fs-xs);
  }
  .consent .cs-long { display: none; }
  .consent .cs-short { display: inline; }
  .consent p { line-height: 1.35; }
  .consent .link { display: inline; min-height: 0; padding: 0; font-size: var(--fs-xs); }
  .consent-acts { flex-wrap: nowrap; gap: 6px; }
  .consent-acts button { min-width: 0; min-height: 40px; padding: 4px 12px; font-size: var(--fs-sm); box-shadow: none; }
  .consent-acts .primary { box-shadow: var(--shadow-sm); }
}
@media (min-width: 760px) {
  .consent { bottom: var(--s4); max-width: 880px; grid-template-columns: 1fr auto; align-items: center; gap: var(--s4); }
  body:has(#consent) .wrap { padding-bottom: calc(var(--consent-h, 80px) + var(--s4) + var(--s5)); }
  body:has(#consent) .next-unread { bottom: calc(var(--consent-h, 80px) + var(--s4) + 12px); }
}

/* settings: data block */
.set-head { font-size: var(--fs-md); margin: var(--s4) 0 0; padding-top: var(--s3); border-top: 2px solid var(--line-soft); }
.set-row > span:first-child { flex: 1 1 170px; min-width: 0; }
.set-row input[type=text] { width: auto; flex: 0 1 170px; min-height: 44px; padding: 6px 12px; }
.set-row .link { padding-left: 0; }

/* ---------- "Tüm geçmişin" (server-side self stats) ---------- */
.sub-head { font-size: var(--fs-md); margin: var(--s5) 0 var(--s2); }
.accs { display: grid; gap: var(--s2); }
.acc-row { display: grid; grid-template-columns: 6.5em 1fr 3.2em 5.5em; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.acc-row .mastery { margin: 0; height: 8px; max-width: none; }
.acc-row b { font-family: var(--display); text-align: right; }
.acc-row small { color: var(--muted); text-align: right; }
#allhist .statgrid { margin-top: var(--s2); }
#allhist .review li .mark { color: var(--bad); }

/* ---------- privacy page ---------- */
.prose h2 { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s2); }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s2); }
.prose p, .prose li { max-width: 65ch; }

/* ---------- admin: analytics ---------- */
.admin-nav { margin-left: auto; }
.admin-nav[hidden] + #logout { margin-left: auto; }
@media (max-width: 520px) {
  /* phone: İçerik | Analitik gets its own full-width row under logo + Çıkış */
  header.top:has(#anav) { flex-wrap: wrap; row-gap: var(--s2); }
  header.top:has(#anav) #logout { margin-left: auto; }
  .admin-nav { order: 3; flex: 1 0 100%; margin-left: 0; display: flex; }
  .admin-nav button { flex: 1; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.kpis .stat small { display: block; font-size: var(--fs-xs); color: var(--muted); }
.tbl-wrap { overflow-x: auto; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font: 700 var(--fs-xs) var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 2px solid var(--line-soft); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--card-2); }
.tbl .q { min-width: 220px; }
.tbl button.sm { min-height: 36px; }
.wrongs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.daybars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: var(--s2); border-bottom: 1px solid var(--line-soft); }
.daybars div { flex: 1; min-width: 2px; background: var(--progress); border-radius: 4px 4px 0 0; position: relative; }
.daybars div.zero { background: var(--line-soft); min-height: 2px; border-radius: 2px; }
.daybars div:hover { background: var(--sky); }
.daylegend { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.item-stat { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.item-stat b { color: var(--ink); }
.tbl .ok { color: var(--good); font-weight: 700; } .tbl .danger { font-weight: 700; } .tbl .half { color: var(--muted); font-weight: 700; }

/* informational toasts never swallow taps (the update toast is a button and stays clickable) */
.toast:not(.update-toast) { pointer-events: none; }

/* ---------- Sıralama (#/siralama, public/leaderboard.js) ---------- */
.lb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.lb-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--s2)); }
table.lb { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.lb th { font: 700 var(--fs-xs) var(--body); color: var(--muted); text-align: left; padding: 6px var(--s2); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.lb td { padding: 10px var(--s2); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.lb tr:last-child td { border-bottom: 0; }
table.lb .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lb .lb-rank { width: 2.5rem; padding-right: 0; }
table.lb .lb-pts { font: 700 var(--fs-lg) var(--display); }
.lb .rk { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 999px; font: 700 var(--fs-sm) var(--display); color: var(--muted); }
.lb .rk.t1, .lb .rk.t2, .lb .rk.t3 { border: 2px solid var(--line); }
.lb .rk.t1 { background: var(--sun); color: var(--on-accent); }
.lb .rk.t2 { background: var(--card-2); color: var(--ink); }
.lb .rk.t3 { background: var(--sun-light); color: var(--on-sun-light); }
.lb-who { min-width: 0; }
.lb-name { font-weight: 700; overflow-wrap: anywhere; }
.lb-meta { display: block; font-size: var(--fs-sm); color: var(--muted); }
.lb tr.me td { background: var(--sun-light); color: var(--on-sun-light); }
.lb tr.me td:first-child { border-radius: 12px 0 0 12px; }
.lb tr.me td:last-child { border-radius: 0 12px 12px 0; }
.lb tr.me .lb-meta { color: var(--muted); }
.lb-sen { vertical-align: 2px; }
.lb .lb-wide { display: none; }
@media (min-width: 560px) {
  .lb .lb-wide { display: table-cell; }
  .lb .lb-meta { display: none; }
}
.lb-note, .lb-status { margin: var(--s3) 0 0; }
.lb-status:empty { display: none; }
.lb-ask-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: start; }
.lb-ask-head .mascot { flex-shrink: 0; }
.lb-ask-head h2 { font-size: var(--fs-lg); margin: 0 0 var(--s1); }
.lb-ask-head p { margin: 0; }
.lb-ask-name { display: grid; gap: var(--s1); margin-top: var(--s3); font-weight: 600; }
.lb-ask-acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.lb-as { font-weight: 400; }
/* Arkadaş grupları (#/siralama/grup/CODE) */
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s4); }
.lb-bar .chips { flex: 1 1 240px; min-width: 0; }
.lb-bar-acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip[aria-current="page"] { background: var(--sun); color: var(--on-accent); }
.lb-form h2, .lb-group h2 { font-size: var(--fs-lg); margin: 0 0 var(--s1); }
.lb-form p { margin: var(--s2) 0 0; }
.lb-field { display: grid; gap: var(--s1); margin-top: var(--s3); font-weight: 600; }
.lb-consent { margin: var(--s3) 0 0; }
.lb-ghead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s2) var(--s3); }
.lb-ghead p { margin: 0; }
.lb-gtitle { min-width: 0; }
.lb-gtitle h2 { overflow-wrap: anywhere; }
.lb-rename { flex: 1 1 100%; }
.lb-invite {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  margin: var(--s3) 0; padding: var(--s3); border: 2px dashed var(--line-soft); border-radius: 12px; background: var(--card-2);
}
.lb-invite span { display: block; }
.lb-code { font: 700 var(--fs-xl) var(--display); letter-spacing: .12em; }
.lb-invite-acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.lb-members-box summary { display: flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; cursor: pointer; }
.lb-members { list-style: none; margin: 0; padding: 0; }
.lb-members li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; min-height: 44px; border-bottom: 1px solid var(--line-soft); }
.lb-members li:last-child { border-bottom: 0; }
.lb-mname { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.lb-rm { margin-left: auto; }
.lb-gfoot { display: flex; justify-content: flex-end; margin-top: var(--s3); }
.lb-codein { font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; }
.lb-codein::placeholder { letter-spacing: normal; text-transform: none; }

/* ---------- account (#/hesap, public/account.js) ---------- */
input[type=email] {
  font: 600 1.05rem var(--body); color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 10px 13px; min-height: 48px; width: 100%;
}
.acct-card { max-width: 520px; }
.acct-tabs { margin-bottom: var(--s4); }
.acct-form { gap: var(--s3); }
.acct-form .primary { justify-self: start; }
.acct-note { margin: 0; }
.acct-err { margin: 0; color: var(--bad); font-weight: 700; font-size: var(--fs-sm); }
.acct-err:empty { display: none; }
.acct-who { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; margin-bottom: var(--s2); }
.acct-who h2 { font-size: var(--fs-lg); margin: 0; overflow-wrap: anywhere; }
.acct-who p { margin: 0; }
.acct-email { overflow-wrap: anywhere; }
.acct-more { margin: var(--s2) 0; border-bottom: 1px solid var(--line-soft); padding-bottom: var(--s2); }
.acct-more .form, .acct-delf { gap: var(--s3); max-width: 420px; }
.acct-delf { margin-top: var(--s3); padding: var(--s3); border: 2px dashed var(--bad); border-radius: 12px; }
.acct-delf p { margin: 0; }
.acct-hint { margin: var(--s1) 0 0; }

/* ---------- team room: Hız modu (public/speed.js) ---------- */
.spd-pick { display: grid; }
.spd-pick .set-row { border-bottom: 0; min-height: 48px; }
.spd-mode { margin: var(--s2) 0; }
.spd-note { background: var(--card-2); border: 2px dashed var(--line-soft); border-radius: 12px; padding: var(--s3); margin: 0; }
.spd-status { min-height: 1.5em; margin: var(--s3) 0 0; font-weight: 600; }
.spd-who .players { margin-top: 4px; }
.spd-who .player-chip.wait { opacity: .6; border-style: dashed; }
.spd-who .player-chip.in { border-color: var(--good); }
.spd-answer { font-size: var(--fs-lg); margin: 0 0 var(--s2); }
.spd-answer b { color: var(--good); font-family: var(--display); }
.spd-you { display: inline-block; font: 700 var(--fs-md) var(--display); padding: 4px 12px; border-radius: 10px; margin: 0 0 var(--s3); }
.spd-you.ok { background: var(--good-bg); color: var(--good); }
.spd-you.no { background: var(--bad-bg); color: var(--bad); }
.spd-rows { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: 6px; }
.spd-rows li {
  display: grid; grid-template-columns: 2rem auto minmax(0, 1fr) auto; align-items: center; gap: var(--s2);
  padding: 6px 10px; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--card);
}
.spd-rows li.ok { border-left: 5px solid var(--good); }
.spd-rows li.no { border-left: 5px solid var(--bad); }
.spd-rows li.me { background: var(--sun-light); color: var(--on-sun-light); }
.spd-rank { font: 700 1.1rem var(--display); text-align: center; }
.spd-name { display: grid; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.spd-name .ok { color: var(--good); font-size: var(--fs-sm); }
.spd-name .no { color: var(--bad); font-size: var(--fs-sm); }
.spd-rows li.me .spd-name .ok, .spd-rows li.me .spd-name .no, .spd-rows li.me .muted { color: inherit; }
.spd-time { font-size: var(--fs-sm); white-space: nowrap; text-align: right; }
.spd-time b { color: var(--good); font-family: var(--display); font-size: var(--fs-md); }
.spd-rows li.me .spd-time b { color: inherit; }
.spd-h { font-size: var(--fs-lg); margin-top: var(--s2); }
.spd-board { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spd-board th { text-align: left; color: var(--muted); font-weight: 700; padding: 4px 6px; border-bottom: 2px solid var(--line-soft); }
.spd-board td { padding: 6px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.spd-board th:nth-child(n+3), .spd-board td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.spd-board tr.me td { background: var(--sun-light); color: var(--on-sun-light); }
.spd-board tr.me .muted { color: inherit; }
@media (max-width: 420px) { .spd-board th:nth-child(5), .spd-board td:nth-child(5) { display: none; } }
.spd-title { text-align: center; margin: var(--s2) 0 0; }
.spd-win { text-align: center; font-size: var(--fs-lg); margin: var(--s1) 0 var(--s3); }
.spd-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: var(--s2); max-width: 420px; margin: 0 auto var(--s3); }
.spd-step { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.spd-step b { font-family: var(--display); max-width: 100%; overflow-wrap: anywhere; line-height: 1.2; }
.spd-step > span { font-size: var(--fs-xs); color: var(--muted); }
.spd-step .avatar { width: 40px; height: 40px; font-size: 1.1rem; }
.spd-block {
  width: 100%; margin-top: 4px; display: grid; place-items: start center; padding-top: 6px; font-size: 1.6rem;
  background: var(--card-2); border: 2px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
}
.spd-step.s1 .spd-block { height: 96px; background: var(--sun); }
.spd-step.s2 .spd-block { height: 68px; }
.spd-step.s3 .spd-block { height: 48px; }
.spd-step.me b { color: var(--accent-text); }

/* ---------- cheatsheets on paper: "PDF / Yazdır" + #/yazdir/hafta (public/print.js) ---------- */
.print-only { display: none; }
.print-acts { margin-top: var(--s2); }
.page-head .row.spread p { margin: 0; }
@media screen { .brief-item.compact .bi-more { display: none; } }
.pv-sheet .pv-title small { display: block; font: 600 var(--fs-sm) var(--body); color: var(--muted); }
.pv-sec-title { font-size: var(--fs-lg); margin: var(--s4) 0 var(--s1); padding-bottom: var(--s1); border-bottom: 2px solid var(--line-soft); }
.pv-item { padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); }
.pv-item:last-child { border-bottom: 0; }
.pv-item h4 { font: 600 var(--fs-md)/1.3 var(--display); margin: 0 0 2px; }
.pv-item p { margin: 0; line-height: 1.55; max-width: 65ch; }
.pv-item mark { background: var(--mark); color: var(--mark-text); padding: 0 3px; border-radius: 4px; font-weight: 700; }

@media print {
  @page {
    size: A4;
    margin: 12mm 11mm 14mm;
    @bottom-right { content: "quizzer.melihafsar.com · " counter(page) " / " counter(pages); font: 7.5pt "Nunito", sans-serif; color: #6b655a; }
  }
  /* Always the light palette on paper, whatever the theme. */
  :root, :root[data-theme="dark"] {
    --paper: #fff; --card: #fff; --card-2: #f4f1ea; --ink: #1a1815; --muted: #555048; --accent-text: #a3361a;
    --line: #2a2722; --line-soft: #d6cfbf; --mark: #fff0a8; --mark-text: #1a1815; --good: #17693b; --bad: #a8301a;
    color-scheme: light;
  }
  html, body { background: #fff !important; background-image: none !important; color: var(--ink); }
  body { font-size: 8.6pt; line-height: 1.38; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.top, .tabs, #roundbar, .hud, .consent, .toast, .next-unread, .update-toast, dialog, .confetti,
  .brief-nav, .brief-end, .brief-meta .seg, .tick, .print-btn, .print-acts, .screen-only, .squiggle, .crumbs,
  .page-head + .card ~ .row, .brief-item a.link, ol.sheet a { display: none !important; }
  .print-only { display: block; }
  .wrap, .wrap.wide, #app, #app.wide { max-width: none; margin: 0; padding: 0; }
  /* Two columns on A4; headings, title and stamp span both. */
  #app { columns: 2; column-gap: 8mm; column-rule: .5pt solid #e2dccd; }
  .page-head, .brief-head, .pv-title, .print-stamp { column-span: all; }
  h1 { font-size: 15pt; margin: 0 0 2pt; }
  h2, .brief-sec .sec-title h2 { font-size: 10.5pt; }
  h3, h4 { font-size: 9pt; }
  .page-head, .brief-head { margin: 0 0 4pt; }
  .page-head p, .brief-head p { font-size: 8pt; color: var(--muted); }
  .print-stamp { margin: 0 0 6pt; padding-bottom: 4pt; border-bottom: 1pt solid var(--line); font-size: 8pt; color: var(--muted); }
  .print-stamp b { color: var(--ink); }
  .card, .brief-sec.card { background: none !important; border: 0 !important; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 6pt; }
  .brief-sec .sec-title { padding-bottom: 1pt; margin: 4pt 0 1pt; border-bottom-width: 1pt; break-after: avoid; }
  .brief-sec .sec-title .ico { display: none; }
  .brief-item { display: block; padding: 3pt 0; border-bottom: .5pt solid var(--line-soft); break-inside: avoid; }
  .brief-item h3 { font-size: 9pt; margin: 0 0 1pt; }
  .brief-item p, .pv-item p { max-width: none; line-height: 1.38; hyphens: auto; }
  .brief-item.done h3, .brief-item.done p { color: var(--ink); }
  .brief-item.done mark, .brief-item mark, .pv-item mark { background: var(--mark); color: var(--mark-text); padding: 0; border-radius: 1.5pt; }
  .pill { font-size: 7pt; padding: 0 4pt; border-width: .5pt; }
  .pv-sheet { margin-top: 8pt; }
  .pv-title { font-size: 12pt; margin: 2pt 0 3pt; padding: 2pt 0; border-bottom: 1.5pt solid var(--line); break-after: avoid; }
  .pv-title small { display: inline; font-size: 8pt; margin-left: 4pt; }
  .pv-sec-title { font-size: 9.5pt; margin: 5pt 0 1pt; padding-bottom: 1pt; border-bottom-width: 1pt; break-after: avoid; }
  .pv-item { padding: 3pt 0; border-bottom-width: .5pt; break-inside: avoid; }
  .pv-item h4 { font-size: 9pt; }
  ol.sheet { gap: 3pt; padding-left: 1.3em; }
  ol.sheet li { break-inside: avoid; }
  .pairs { font-size: 8.6pt; }
  .pairs td { height: auto; padding: 2pt 3pt; border-bottom-width: .5pt; }
  .pairs tr { break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
}

/* Google button (rendered by GIS in its own iframe) + "ya da e-postayla" divider, reset / notice texts */
.acct-google { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.acct-google[hidden], .acct-glink[hidden] { display: none; }
.acct-gbtn { min-height: 44px; max-width: 400px; color-scheme: normal; }
.acct-gbtn.sm { min-width: 200px; max-width: 260px; flex: 0 1 260px; }
.acct-or { display: flex; align-items: center; gap: var(--s2); margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.acct-or::before, .acct-or::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
.acct-ok { margin: 0; color: var(--good); font-weight: 700; font-size: var(--fs-sm); }
.acct-ok:empty { display: none; }
.acct-ok-pill { color: var(--good); background: var(--good-bg); border-color: transparent; vertical-align: 1px; }
.acct-flash { border-color: var(--sun); font-weight: 700; }

/* ---------- admin: Hatalar + D1 usage (public/admin-ops.js) ---------- */
.ops-banner { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border: 2px solid var(--bad); border-radius: 14px; background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: var(--fs-sm); }
.ops-banner a { color: inherit; }
.usebar-row { margin: var(--s3) 0; }
.usebar { height: 14px; margin-top: 4px; border-radius: 8px; overflow: hidden; background: var(--card-2); border: 1.5px solid var(--line-soft); }
.usebar i { display: block; height: 100%; background: var(--progress); border-radius: 6px; }
.usebar.mid i { background: var(--sun); }
.usebar.hi i { background: var(--tomato); }
.tbl.errs .q { min-width: 240px; max-width: 520px; overflow-wrap: anywhere; }
.err-sample { margin: 6px 0 0; padding: var(--s2); max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card-2); border-radius: 8px; font-size: var(--fs-xs); }
@media (max-width: 520px) { .tbl.errs .q { min-width: 190px; } }

/* Difficulty mix on the pack page (public/difficulty.js) */
.diffmix { margin: var(--s2) 0 0; }
.diffmix span::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; margin-right: .3em; vertical-align: .05em; border: 1px solid var(--line); }
.diffmix .d1::before { background: var(--mint); }
.diffmix .d2::before { background: var(--sun); }
.diffmix .d3::before { background: var(--tomato); }

/* ---------- question pool (#/ekle, public/pool.js; admin Topluluk, public/admin-pool.js) ---------- */
.pool-form { display: grid; gap: var(--s3); }
.pool-form .primary { justify-self: start; }
.pool-glabel small { font-weight: 400; }
#pool-rows { display: grid; gap: var(--s3); }
.pool-row { position: relative; display: grid; gap: var(--s3); min-width: 0; margin: 0; padding: var(--s3) var(--s4) var(--s4); border: 2px dashed var(--line-soft); border-radius: 14px; background: var(--card-2); }
.pool-row legend { font: 700 var(--fs-md) var(--display); padding: 0 var(--s1); color: var(--ink); }
.pool-row .pool-rm { position: absolute; top: -12px; right: var(--s3); min-height: 32px; padding: 2px 12px; background: var(--card); }
.pool-more summary { cursor: pointer; font-weight: 700; font-size: var(--fs-sm); min-height: 32px; }
.pool-more[open] { display: grid; gap: var(--s3); }
.pool-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.pool-err { margin: 0; color: var(--bad); font-weight: 700; font-size: var(--fs-sm); }
.pool-err:empty { display: none; }
.pool-mine { list-style: none; margin: 0; padding: 0; }
.pool-mine li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s1) var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); }
.pool-mine li:last-child { border-bottom: 0; }
.pool-mtxt { display: grid; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.pool-st.ok { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.pool-st.no { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.pool-cta { display: grid; gap: var(--s2); justify-items: start; margin: var(--s4) 0 0; padding: var(--s3) var(--s4); border: 2px dashed var(--line-soft); border-radius: 14px; }
.pool-cta p { margin: 0; }
.pool-gline p { margin: var(--s3) 0 0; }
.pa-round { font-size: var(--fs-md); margin: var(--s4) 0 var(--s2); }
.pa-note { font-style: italic; }
.pa-dupe { color: var(--accent-text); font-weight: 700; }
.pa-acts { flex-wrap: wrap; justify-content: flex-end; }
.items li.pa-rejected, .items li.pa-merged { opacity: .75; }
.items li:has(.pa-form) { display: block; }
.pa-inline { margin-top: var(--s2); }
@media (max-width: 560px) { .items li:has(.pa-acts) { flex-direction: column; } .pa-acts { justify-content: flex-start; } }

/* ---------- Günün 5 sorusu (#/gunluk, public/daily.js) ---------- */
.daily-intro-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; }
.daily-intro-head p { margin: 0; }
.daily-date { font: 700 var(--fs-lg) var(--display); }
.daily-streak { display: flex; align-items: center; gap: 6px; margin: var(--s3) 0 0; font-weight: 700; }
.daily-streak .ico { width: 24px; height: 24px; }
.daily-dots { display: flex; gap: 6px; margin: 0 0 var(--s2); }
.daily-dots span { flex: 1; height: 8px; border-radius: 999px; background: var(--card-2); border: 1.5px solid var(--line-soft); }
.daily-dots .ok { background: var(--good); border-color: var(--good); }
.daily-dots .no { background: var(--bad); border-color: var(--bad); }
.daily-dots .cur { background: var(--sun); border-color: var(--line); }
.daily-reveal { margin-top: var(--s3); padding: 10px 14px; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.daily-reveal.ok { border-left: 5px solid var(--good); background: var(--good-bg); }
.daily-reveal.no { border-left: 5px solid var(--bad); background: var(--bad-bg); }
.daily-reveal b { font-size: var(--fs-md); overflow-wrap: anywhere; }
.daily-reveal .explain { font-size: var(--fs-sm); color: var(--ink); margin-top: 6px; }
.daily-reveal div { margin-top: 2px; }
.daily-score { align-items: center; gap: 18px; }
.daily-grid { font-size: 1.75rem; letter-spacing: 2px; line-height: 1; }
.daily-share {
  margin: var(--s3) 0 0; padding: 10px 12px; border: 1.5px dashed var(--line-soft); border-radius: 12px; background: var(--card-2);
  font: 600 var(--fs-sm) var(--body); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.daily-chips { margin: var(--s2) -4px 0; }
.daily-board { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.daily-board li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; gap: var(--s2); align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.daily-board li:last-child { border-bottom: 0; }
.daily-board li.me { background: var(--sun-light); color: var(--on-sun-light); border-radius: 12px; }
.daily-board .rk { font: 700 var(--fs-sm) var(--display); color: var(--muted); text-align: center; }
.daily-board .nm { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.daily-board .gr { letter-spacing: 1px; white-space: nowrap; }
@media (max-width: 400px) { .daily-board .gr { font-size: .8rem; letter-spacing: 0; } }
.lb .lb-meta.lb-grid { display: block; letter-spacing: 1px; } /* the daily table has no wide columns: always shown */

/* ---------- visual rounds: flags, silhouettes, maps (public/visual.js) ---------- */
:root { --map-sea: #d6e7f2; --map-land: #efe7d4; --map-border: #a39a85; --map-hl: #e4572e; --map-hl-line: #8f2a10; }
:root[data-theme="dark"] { --map-sea: #14212b; --map-land: #3a4741; --map-border: #66776d; --map-hl: #ff7a5a; --map-hl-line: #ffd2c4; }
.qv { width: 100%; margin: 0 auto 18px; display: flex; justify-content: center; }
.qv img, .qv .qv-svg { display: block; }
.qv-svg svg { display: block; width: 100%; height: 100%; }
.qv-big.qv-flag img, .qv-big.qv-pic img {
  width: min(100%, 380px, 52vh); height: auto; border: 1.5px solid var(--line-soft); border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.qv-big.qv-shape .qv-svg { width: min(100%, 300px, 40vh); aspect-ratio: 1; }
.qv-big.qv-map .qv-svg {
  width: min(100%, 600px, 62vh); aspect-ratio: 4 / 3; border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--map-sea);
}
.qv .shape { fill: var(--ink); }
.qv .sea { fill: var(--map-sea); }
.qv .land { fill: var(--map-land); stroke: var(--map-border); }
.qv .hl { fill: var(--map-hl); stroke: var(--map-hl-line); }
.qv .ring { fill: none; stroke: var(--map-hl); }
.qv-err { display: grid; place-items: center; padding: 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); background: var(--card-2); border-radius: 12px; }
.qv-big .qv-err { border: 2px dashed var(--line-soft); min-height: 120px; width: min(100%, 380px); }
.qv-thumb { display: block; margin: 6px 0; }
.qv-thumb img { width: 72px; height: 54px; object-fit: contain; border: 1px solid var(--line-soft); border-radius: 4px; }
.qv-thumb.qv-shape .qv-svg { width: 60px; height: 60px; }
.qv-thumb.qv-map .qv-svg { width: 96px; height: 72px; border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; background: var(--map-sea); }
.qv-thumb .qv-err { font-size: var(--fs-xs); padding: 4px; }
.flash .qv { margin: 4px auto; }
@media print { .qv-thumb img, .qv-thumb .qv-svg { break-inside: avoid; } }

/* ---------- native app shell (mobile/, Capacitor): html.qp-native is set by native.js, never in browsers ----------
   The app draws edge to edge: keep content out of the status bar / notch / landscape cutouts and paint
   a theme-colored strip behind the status bar (sun in light, paper in dark, like theme-color). */
html.qp-native body { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
html.qp-native body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); z-index: 40; background: var(--sun);
}
html.qp-native[data-theme="dark"] body::before { background: var(--paper); }
html.qp-native .brief-nav { top: env(safe-area-inset-top); }

/* ---------- interface language (public/i18n.js): "TR" chip on Turkish content in the English UI, first-run picker ---------- */
.lang-tag { display: inline-block; font-weight: 700; font-size: 0.7rem; line-height: 1; letter-spacing: 0.04em; padding: 2px 5px; margin-inline-start: 6px; border: 1.5px solid currentColor; border-radius: 6px; opacity: 0.6; vertical-align: middle; }
.welcome-lang { display: flex; justify-content: center; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.welcome-lang [aria-pressed='true'] { font-weight: 800; text-decoration: none; }
