:root {
  color-scheme: dark;
  --bg: #0f1115;
  --card: #171a21;
  --inset: #0f1216;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa3af;
  --accent: #66c0f4;
  --accent-strong: #1a9fff;
  --gold: #ffcf7a;
  --gold-border: #6b5527;
  --danger: #ffb4b4;
  --danger-border: #6b2b2b;
  --shame: #b6426e;
  --easy: #5fc98d;
  --medium: #e0b256;
  --hard: #e0636b;
  --radius: 8px;
}

* { box-sizing: border-box; }

/* Never let the page get wider than the screen, and stop iOS from
   enlarging text on rotation. */
html, body { overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { position: relative; }
main, header { overflow-x: clip; }

body {
  margin: 0;
  /* Keep content clear of the iPhone notch and home bar. */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

a { color: var(--accent); }
.hidden { display: none !important; }

header { padding: 2rem 1rem 1rem; text-align: center; }
.header-inner { position: relative; max-width: 760px; margin: 0 auto; padding: 0 2.75rem; }
header h1 { margin: 0; font-size: 2rem; letter-spacing: 0.02em; }
.tagline { color: var(--muted); margin: 0.4rem 0 0; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#appArea, .panel { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  min-width: 0;
}
.card h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }

label { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="number"], input[type="search"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  /* 16px minimum: smaller text makes iOS zoom in on focus and leaves the
     page zoomed (too wide, scrolls sideways). */
  font-size: 16px;
}

.hint { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0.5rem; }
.status { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }
.progress { margin: 0; }

/* ---------- buttons ---------- */
button, .backlog-actions a, .mark-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
}
button {
  background: var(--accent-strong);
  color: #fff;
  border: 1px solid transparent;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
}
button:hover, .backlog-actions a:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.secondary { background: transparent; border-color: var(--border); color: var(--text); }

.mark-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 999px;
}
.mark-btn:hover { color: var(--text); border-color: var(--accent); filter: none; }
.mark-btn.danger:hover { color: var(--danger); border-color: var(--danger-border); }
.mark-btn.play { color: var(--accent); border-color: var(--accent-strong); }

.small-btn {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}
.small-btn:hover { color: var(--text); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: underline;
  align-self: flex-start;
}



/* ---------- tabs ---------- */
.tab-bar { display: flex; gap: 0.5rem; }
.tab-btn {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.tab-btn.active { border-color: var(--accent-strong); color: var(--text); background: #1a9fff14; }

/* ---------- quiz ---------- */
.quiz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.quiz-head h2 { margin: 0; }
.quiz-head .hint { margin: 0; }

#questions { display: flex; flex-direction: column; gap: 0.75rem; }

/* Each question is a softly tinted block in its own colour (--q). */
.question {
  margin: 0;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--q) 22%, var(--border));
  border-left: 3px solid var(--q);
  border-radius: 10px;
  background: color-mix(in srgb, var(--q) 6%, var(--inset));
}
.question legend {
  float: left; /* keeps the legend inside the box instead of on its border */
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.question legend + * { clear: both; }
.q-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--q) 20%, transparent);
  font-size: 0.95rem;
}
.q-check { margin-left: auto; color: var(--q); font-weight: 700; opacity: 0; transition: opacity 0.15s; }
.question.answered .q-check { opacity: 1; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3rem;
  padding: 0.55rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  font-size: 0.88rem;
  transition: background 0.15s, border-color 0.15s;
}
.option-btn:hover { border-color: color-mix(in srgb, var(--q) 60%, var(--border)); filter: none; }
.opt-title { font-weight: 600; line-height: 1.25; }
.opt-sub { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.option-btn.selected {
  background: color-mix(in srgb, var(--q) 22%, var(--card));
  border-color: var(--q);
  box-shadow: inset 0 0 0 1px var(--q);
}
.option-btn.selected .opt-sub { color: var(--text); }

.quiz-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}
.toggle-row input { width: 1.1rem; height: 1.1rem; margin: 0; flex-shrink: 0; accent-color: var(--accent-strong); }
.toggle-row:has(input:checked) { border-color: var(--accent-strong); background: #1a9fff14; }
.find-btn { width: 100%; margin-top: 0.25rem; padding: 0.8rem; font-size: 1rem; font-weight: 600; border-radius: 10px; }

.lock-notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--gold-border);
  border-radius: var(--radius);
  background: #241d10;
}
.lock-notice .hint { margin: 0 0 0.6rem; }
.override-note { font-size: 0.8rem; color: var(--gold); margin: 0 0 0.8rem; }

/* ---------- result cards ---------- */
.game-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.7rem;
}
.game-card img { width: 140px; border-radius: 4px; flex-shrink: 0; }
.game-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.game-info h3 { margin: 0; font-size: 1rem; }
.game-info h3 a { text-decoration: none; }
.game-meta { font-size: 0.78rem; color: var(--muted); }
.game-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.2rem; }
.tag-chip {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin: 0 0.3rem 0.2rem 0;
}
.badge-locked, .badge-goto { align-self: flex-start; font-size: 0.7rem; border-radius: 999px; padding: 0.15rem 0.55rem; }
.badge-locked { background: #3a2f1c; color: var(--gold); border: 1px solid var(--gold-border); }
.badge-goto { background: #1c2f3a; color: #7ad1ff; border: 1px solid #275a6b; }

@media (max-width: 520px) {
  .game-card { flex-direction: column; }
  .game-card img { width: 100%; }
}

/* ---------- badges ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}
.badge.duration { color: var(--text); background: var(--inset); text-transform: none; }
.badge.diff-easy { color: var(--easy); border-color: var(--easy); }
.badge.diff-medium { color: var(--medium); border-color: var(--medium); }
.badge.diff-hard { color: var(--hard); border-color: var(--hard); }
.badge.acclaim { color: var(--gold); border-color: var(--gold-border); cursor: help; }

/* ---------- lists (slots, marked, search) ---------- */
.slot-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.slot-row:last-of-type { border-bottom: none; }
.slot-info { flex: 1; min-width: 0; }
.slot-current { font-size: 0.9rem; color: var(--accent); }
.slot-current.empty { color: var(--muted); }
.slot-actions { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }

.picker { margin-top: 0.75rem; }
#slotPicker { padding-top: 0.75rem; border-top: 1px solid var(--border); }
.picker input { margin-bottom: 0.6rem; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.list-row:last-child { border-bottom: none; }
.list-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { flex-shrink: 0; }
.status-badge {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  margin-left: 0.5rem;
}

/* ---------- backlog of shame ---------- */
.scoreboard {
  background: radial-gradient(120% 140% at 0% 0%, #b6426e22, transparent 60%), var(--inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  margin: 0.75rem 0 1rem;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.score-main { min-width: 140px; }
.score-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.score-num { font-weight: 700; font-size: 2.1rem; line-height: 1; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.score-num small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.score-hours { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
.meter-block { flex: 1; min-width: 180px; }
.meter-top { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
.meter-top b { color: var(--text); font-size: 1rem; }
.streak { font-size: 0.8rem; color: var(--muted); }

.top-offender {
  font-size: 0.85rem;
  color: var(--muted);
  background: #b6426e14;
  border: 1px dashed #6b2b4a;
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
}
.top-offender b { color: var(--text); }

.penance-btn { font-weight: 600; border-radius: var(--radius); }

/* Filters wrap onto new lines instead of scrolling sideways. */
.filters { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0 0.5rem; }
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.filter-group-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-rail { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
}
.chip.active { border-color: var(--accent); color: var(--accent); background: #66c0f41a; }

/* Cards need ~300px: 2 per row on computers and tablets, 1 on phones. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.9rem; }

.backlog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.backlog-card img { width: 100%; border-radius: 6px; display: block; aspect-ratio: 460 / 215; object-fit: cover; }
.backlog-card h3 { margin: 0; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backlog-card h3 a { color: var(--text); text-decoration: none; }
.backlog-card h3 a:hover { color: var(--accent); }
.tag-line { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.estimate-edit { display: flex; gap: 0.5rem; align-items: center; }
.estimate-edit input { width: 5.5rem; margin: 0; padding: 0.3rem 0.4rem; }

.backlog-meta { font-size: 0.74rem; color: var(--muted); }
.backlog-meta.started { color: var(--medium); }

.backlog-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: auto; }
.backlog-actions button, .backlog-actions a {
  flex: 1 1 auto;
  font-size: 0.72rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  text-align: center;
}
.backlog-actions a.primary { border-color: var(--accent-strong); color: var(--accent); font-weight: 600; }

.show-more { align-self: center; }

/* ---------- feedback ---------- */
.error {
  background: #3a1c1c;
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: #232833;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 6px 24px #0008;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- options menu ---------- */
.menu-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.menu-btn { position: absolute; right: 0; top: 0; }
.icon-btn { font-size: 1.5rem; line-height: 1; background: transparent; }

/* The layer clips the sliding drawer, so iOS never sees content beyond
   the right edge (which would make the whole page wider). */
.drawer-layer { position: fixed; inset: 0; overflow: hidden; z-index: 20; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: #000a;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 88vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 21;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer-backdrop { opacity: 1; }
body.drawer-open .drawer { transform: none; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 1.15rem; }
.drawer-section { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.drawer-section h3 { margin: 0; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.drawer-section label { margin-bottom: 0.25rem; }
.drawer-text { margin: 0; font-size: 0.85rem; color: var(--text); }
button.full { width: 100%; }
.menu-link {
  background: var(--inset);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
}
.menu-link::after { content: "›"; float: right; color: var(--muted); }
.drawer-footer { margin-top: auto; font-size: 0.75rem; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop { transition: none; }
}

/* ---------- clarity pass ---------- */
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }

.lock-notice { margin: 0 0 0.75rem; }
.lock-notice .hint { margin: 0; }

.done-choice {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.done-q { font-size: 0.82rem; color: var(--text); }
.done-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mark-btn.ghost { border-color: transparent; }

.badge-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.edit-length {
  background: none;
  border: none;
  padding: 0.15rem 0;
  color: var(--accent);
  font-size: 0.75rem;
}
.estimate-edit { flex-wrap: wrap; }

.acclaim-line { font-size: 0.74rem; color: var(--gold); }
.mix-hint { margin: 0; }

/* ---------- welcome ---------- */
.steps { margin: 0.75rem 0 1rem; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.88rem; line-height: 1.45; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.steps strong { display: block; }
.steps code { background: var(--inset); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.3rem; }
#setup .find-btn { margin-top: 0.25rem; }

/* ---------- web sign-in ---------- */
.steam-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #1f2a3a, #171d26);
  border: 1px solid #3d5470;
  color: #e8eaed;
  font-weight: 600;
  text-decoration: none;
}
.steam-btn::before { content: ""; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #66c0f4 30%, #1a9fff 31%, #1a9fff 55%, transparent 56%); }
.steam-btn:hover { border-color: var(--accent); }
.copy-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.copy-row code { flex: 1; min-width: 0; padding: 0.55rem 0.7rem; background: var(--inset); border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; overflow-wrap: anywhere; }
.me-row { display: flex; align-items: center; gap: 0.75rem; }
.avatar { width: 2.75rem; height: 2.75rem; border-radius: 8px; }

/* ---------- rating survey ---------- */
.sheet-layer { position: fixed; inset: 0; overflow: hidden; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: #000a; opacity: 0; transition: opacity 0.2s ease; }
.sheet {
  position: relative;
  width: min(30rem, 100%);
  max-height: 92%;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 1.1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}
@media (min-width: 600px) {
  .sheet-layer { align-items: center; }
  .sheet { border-radius: 16px; transform: translateY(1.5rem); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }
  body.sheet-open .sheet { opacity: 1; }
}
body.sheet-open { overflow: hidden; }
body.sheet-open .sheet-backdrop { opacity: 1; }
body.sheet-open .sheet { transform: none; }

.rate-game { margin: -0.5rem 0 0; font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.rate-block { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.optional { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.8; }
.rate-block textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}
.sheet-actions { display: flex; gap: 0.5rem; }
.sheet-actions .find-btn { flex: 1; margin: 0; }
#rateRemove { align-self: center; }
.row-actions { display: flex; gap: 0.35rem; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop { transition: none; }
}

/* ---------- reviews (Steam style) ---------- */
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.thumb {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem; border-radius: 10px; font-size: 1rem; font-weight: 600;
  background: var(--inset); border: 1px solid var(--border); color: var(--text);
}
.thumb span { font-size: 1.25rem; }
.thumb.up.on { background: #1a3a5c; border-color: #66c0f4; color: #cfe9fb; }
.thumb.down.on { background: #4a1f22; border-color: #e0636b; color: #ffd0d3; }
.review-foot { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.review-foot .hint { margin: 0; font-size: 0.72rem; }
.steam-export {
  display: flex; flex-direction: column; gap: 0.45rem;
  padding: 0.85rem; border-radius: 10px;
  background: #171d26; border: 1px solid #2a3f57;
}
.steam-export .hint { margin: 0; }
.hint.warn { color: var(--medium); }
.export-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.export-actions > * { flex: 1; text-align: center; }
.secondary-link {
  padding: 0.65rem 1rem; border-radius: 6px; border: 1px solid var(--border);
  color: var(--accent); text-decoration: none; font-size: 0.95rem;
}
.badge.your-review.up { color: #66c0f4; border-color: #2a3f57; }
.badge.your-review.down { color: var(--hard); border-color: var(--danger-border); }

/* ---------- library ---------- */
#libSearch { margin: 0.25rem 0 0; -webkit-appearance: none; appearance: none; }
.lib-card { padding: 0.25rem 1.25rem 1rem; }
.lib-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
.lib-row:last-of-type { border-bottom: none; }
.lib-head { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 0.75rem; }
.lib-thumb {
  flex-shrink: 0; width: 120px; height: 45px; object-fit: cover;
  border-radius: 4px; background: var(--inset); border: 1px solid var(--border);
}
.lib-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; opacity: 0.6; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.lib-name { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.lib-name:hover { color: var(--accent); }
.lib-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; font-size: 0.76rem; color: var(--muted); }
.lib-meta .status-badge { margin-left: 0; }
.review-pill { font-size: 0.72rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid; }
.review-pill.up { color: #66c0f4; border-color: #2a3f57; background: #171d26; }
.review-pill.down { color: var(--hard); border-color: var(--danger-border); background: #2a1719; }
.lib-review {
  margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line;
}
.lib-actions { display: flex; flex-direction: column; gap: 0.35rem; flex-shrink: 0; }
.small-btn.accent { border-color: var(--accent-strong); color: var(--accent); }
#libMoreBtn { display: block; margin: 0.75rem auto 0; }
@media (max-width: 420px) {
  .lib-row { flex-direction: column; }
  .lib-head { width: 100%; }
  .lib-thumb { width: 92px; height: 35px; }
  .lib-actions { flex-direction: row; }
}

/* ---------- I am weak! ---------- */
.weak-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #b6426e, #e0636b);
  color: #fff;
  box-shadow: 0 6px 20px #b6426e55;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.weak-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 24px #b6426e77; }
.weak-btn:active { transform: translateY(1px) scale(0.99); }
.weak-title { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.01em; }
.weak-sub { font-size: 0.78rem; opacity: 0.9; }
.weak-btn.in-results { margin-top: 0.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .weak-btn:not(:disabled) .weak-title span { display: inline-block; animation: weak-wobble 2.8s ease-in-out infinite; }
}
@keyframes weak-wobble {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-14deg); }
  90% { transform: rotate(12deg); }
  94% { transform: rotate(-6deg); }
}

/* ---------- welcome page (before signing in) ---------- */
.landing { display: flex; flex-direction: column; gap: 1.5rem; }
.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.5rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 0% 0%, #1a9fff2e, transparent 60%),
    radial-gradient(90% 70% at 100% 100%, #e0636b26, transparent 60%),
    var(--card);
  text-align: center;
}
.landing-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0636b;
}
.landing-title { margin: 0 0 0.9rem; font-size: clamp(1.45rem, 5vw, 2.1rem); line-height: 1.2; }
.mood-word {
  display: inline-block;
  color: var(--accent);
  border-bottom: 3px solid currentColor;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mood-word.swap { opacity: 0; transform: translateY(0.25em); }
.landing-lead { margin: 0 auto 1.25rem; max-width: 34rem; color: var(--muted); line-height: 1.5; }
.landing-cta {
  display: inline-flex;
  margin: 0 auto 0.75rem;
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
  background: linear-gradient(180deg, #2a6fb0, #1b4f86);
  border-color: #3d82c9;
  box-shadow: 0 6px 24px #1a9fff40;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.landing-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 30px #1a9fff59; }
.landing-trust { margin: 0; font-size: 0.78rem; color: var(--muted); }

.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; }
.feature {
  --f: var(--accent);
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--f) 30%, var(--border));
  background: color-mix(in srgb, var(--f) 7%, var(--card));
}
.f-decide { --f: #66c0f4; }
.f-shame { --f: #e0636b; }
.f-lock { --f: #f0a35e; }
.feature-icon { font-size: 1.6rem; display: block; margin-bottom: 0.4rem; }
.feature h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--f); }
.feature p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }

.landing-shame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px dashed #e0636b66;
  text-align: center;
}
.shame-meter { display: flex; flex-direction: column; align-items: center; }
.shame-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.shame-value {
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #f0a35e, #e0636b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.shame-sub { font-size: 0.78rem; color: var(--muted); }
.shame-quip { margin: 0; font-style: italic; color: var(--text); max-width: 16rem; }

.landing-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.landing-steps li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.landing-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}
.landing-steps strong { color: var(--text); }
.landing-help { font-size: 0.82rem; color: var(--muted); }
.landing-help summary { cursor: pointer; color: var(--accent); }
.landing-help p { margin: 0.5rem 0 0; }
.invite-card .landing-kicker { margin-bottom: 0.3rem; }

@media (prefers-reduced-motion: reduce) {
  .mood-word, .landing-cta { transition: none; }
}
