:root {
  /* TimeTurtle: lagoon and sea-turtle greens, warm sand cards */
  --bg: #E9F6EE;
  --bg-2: #CDEFDC;
  --card: #FFFFFF;
  --ink: #17324A;
  --ink-soft: #4F6A7A;
  --line: #D5EADF;
  --primary: #12A17A;
  --primary-dark: #0B7A5C;
  --primary-soft: #E1F5EC;
  --blue: #3B6BFF;
  --easy: #3CB95A;
  --medium: #F5A524;
  --hard: #EF4560;
  --era-rome: #F7A35C;
  --era-medieval: #B79CF0;
  --era-explore: #5FCFC0;
  --era-industrial: #EBC686;
  --era-modern: #6FB6FF;
  --shadow: 0 6px 0 rgba(31, 35, 64, 0.08), 0 14px 30px rgba(31, 35, 64, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #FFFFFF 0, transparent 40%),
    radial-gradient(circle at 90% 80%, var(--bg-2) 0, transparent 45%),
    var(--bg);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
/* Stop double-tap-to-zoom when tapping buttons quickly (e.g. + and −). */
html, button, input, select, .slider-wrap { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 520px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.brand-icon { font-size: 28px; display: inline-block; transform: rotate(-10deg); }
.brand-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -0.3px; }
.brand-name b { color: var(--primary); font-weight: 700; }

.scorebox {
  display: flex; flex-direction: column; align-items: center;
  background: var(--ink); color: #fff;
  border-radius: 14px; padding: 6px 14px 4px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.18);
  min-width: 104px;
}
.scorebox-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; opacity: 0.7; }
.scorebox-value { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.scorebox.bump { animation: bump 0.45s ease; }
@keyframes bump { 30% { transform: scale(1.15); background: var(--primary); } }

/* ---------- Layout ---------- */
main { max-width: 520px; margin: 0 auto; padding: 4px 16px calc(32px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 14px; animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
}
.card-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; margin: 0 0 12px; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; cursor: pointer; border-radius: 16px;
  font-weight: 800; transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(3px); }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 5px 0 var(--primary-dark);
}
.btn-primary:active { box-shadow: 0 2px 0 var(--primary-dark); }
.btn-big { width: 100%; padding: 16px 18px; font-size: 18px; font-family: "Fredoka", sans-serif; font-weight: 600; letter-spacing: 0.2px; }
.btn-round {
  width: 48px; height: 48px; flex: none;
  background: #F6F1E8; color: var(--ink); font-size: 26px; line-height: 1;
  box-shadow: 0 4px 0 #E3D8C5;
}
.btn-round:active { box-shadow: 0 1px 0 #E3D8C5; }

/* ---------- Start ---------- */
.hero { text-align: center; padding: 26px 20px 22px; }
.hero-badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  padding: 6px 12px; border-radius: 999px;
}
.hero-title { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 38px; line-height: 1.05; margin: 14px 0 10px; letter-spacing: -0.5px; }
.hero-sub { color: var(--ink-soft); margin: 0 auto 18px; max-width: 34ch; line-height: 1.45; }
.hero-date { color: var(--ink-soft); font-size: 13px; margin: 12px 0 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.stat { background: #FBF7F0; border-radius: 14px; padding: 10px 4px 8px; text-align: center; }
.stat b { display: block; font-family: "Fredoka", sans-serif; font-size: 22px; font-weight: 600; }
.stat span { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; }
#resultStats { margin-bottom: 0; }

.howto summary { cursor: pointer; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; list-style: none; }
.howto summary::after { content: "＋"; float: right; color: var(--ink-soft); }
.howto[open] summary::after { content: "－"; }
.howto ol { padding-left: 20px; line-height: 1.55; margin: 12px 0 8px; }
.howto-note { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.45; }

/* ---------- Play ---------- */
.rounds { display: flex; gap: 8px; justify-content: center; padding-top: 2px; }
.dot {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px;
  background: #fff; border: 2px solid var(--line); color: var(--ink-soft);
}
.dot.current { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); box-shadow: 0 4px 0 rgba(31,35,64,0.12); }
.dot.done { background: var(--ink); color: #fff; border-color: var(--ink); font-size: 13px; }

.event-card { padding: 18px 20px 20px; }
.event-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pill { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #fff; padding: 5px 10px; border-radius: 999px; }
.pill.easy { background: var(--easy); }
.pill.medium { background: var(--medium); }
.pill.hard { background: var(--hard); }
.pill.practice { background: var(--blue); }
.round-label { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.event-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 25px; line-height: 1.2; margin: 0; letter-spacing: -0.2px; }

.guess-card { padding: 16px 16px 20px; position: relative; }
/* Year controls: the year on its own row (it is the typing box); − and + sit on either side of the timeline (Nov 21, 2026). */
.guess-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.guess-caption { display: block; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-soft); margin: 2px 0 2px; cursor: text; }
.guess-row.locked + .guess-caption { visibility: hidden; }
.guess-display {
  flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 2px;
  padding: 2px 4px 4px; border-radius: 14px; cursor: text; position: relative;
}
.guess-main {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 42px; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums; line-height: 1.1; text-align: center;
  width: 2.5em; min-width: 0.8em; padding: 0; margin: 0; border: 0; background: transparent; color: var(--ink);
  border-bottom: 3px dashed #B9D9C9; border-radius: 0; caret-color: var(--primary);
}
.guess-main:focus { outline: none; border-bottom: 3px solid var(--primary); }
.guess-display:focus-within { background: var(--primary-soft); }
.guess-unit { font-weight: 800; font-size: 16px; color: var(--ink-soft); }
.guess-unit:empty { display: none; }
.guess-main:disabled { border-bottom-color: transparent; opacity: 1; -webkit-text-fill-color: var(--ink); }
.guess-row.invalid .guess-main { color: var(--hard); -webkit-text-fill-color: var(--hard); border-bottom: 3px solid var(--hard); caret-color: var(--hard); }
.guess-row.invalid .guess-display, .guess-row.invalid .guess-display:focus-within { background: #FDE7EB; }
.guess-caption.error { color: var(--hard); }
.guess-row.invalid ~ #lockBtn:disabled { opacity: 0.45; filter: grayscale(0.5); }
.guess-row.shake .guess-display { animation: yearShake 0.35s; }
@keyframes yearShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* − [timeline] +. The buttons line up with the middle of the track (37px down the slider area). */
.timeline-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; }
.timeline-row .slider-wrap { flex: 1; min-width: 0; }
.timeline-row .btn-round { width: 46px; height: 46px; margin-top: 14px; }
.timeline-row.locked .btn-round { visibility: hidden; }

/* First-play hint (once per device): a bubble plus a glow on whatever it's showing. */
.hint-bubble {
  position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%); z-index: 5;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap;
  padding: 8px 14px; border-radius: 12px; pointer-events: none; animation: rise 0.25s ease;
}
.hint-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink);
}
.hint-glow { box-shadow: 0 0 0 4px rgba(18, 161, 122, 0.35), 0 0 0 9px rgba(18, 161, 122, 0.15) !important; transition: box-shadow 0.2s ease; }
.hint-press { transform: translateY(3px); box-shadow: 0 1px 0 #E3D8C5 !important; }
.hint-finger {
  position: absolute; z-index: 4; font-size: 30px; pointer-events: none; top: 44px;
  transform: translateX(-30%); transition: left 0.08s linear; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}

/* Slider */
.slider-wrap { position: relative; padding: 18px 0 14px; }
/* The turtle is the slider handle: the real thumb is invisible and the 🐢 sits on top of it. */
.slider-turtle {
  position: absolute; top: 37px; left: 50%; z-index: 2; pointer-events: none;
  font-size: 34px; line-height: 1; transform: translate(-50%, -54%) scaleX(-1);
  filter: drop-shadow(0 3px 4px rgba(23, 50, 74, 0.28));
  transition: transform 0.15s ease;
}
.slider-wrap:active .slider-turtle { transform: translate(-50%, -60%) scaleX(-1) scale(1.12); }
.slider-track {
  position: absolute; left: 0; right: 0; top: 30px; height: 14px; border-radius: 999px;
  background: linear-gradient(90deg,
    var(--era-rome) 0 20%, var(--era-medieval) 20% 40%, var(--era-explore) 40% 65%,
    var(--era-industrial) 65% 85%, var(--era-modern) 85% 100%);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.08);
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  position: relative; width: 100%; height: 38px; margin: 0; background: transparent; cursor: pointer;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 38px; background: transparent; }
input[type=range]::-moz-range-track { height: 38px; background: transparent; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 40px; height: 40px; margin-top: -1px; border-radius: 50%;
  background: transparent; border: 0; box-shadow: none;
}
input[type=range]::-moz-range-thumb {
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 0; box-shadow: none;
}
input[type=range]:disabled { cursor: default; }
input[type=range]:disabled::-webkit-slider-thumb { border-color: var(--ink); }
input[type=range]:disabled::-moz-range-thumb { border-color: var(--ink); }


.marker { position: absolute; top: -26px; transform: translateX(-50%); pointer-events: none; }
.marker span {
  display: block; background: var(--easy); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 8px; white-space: nowrap; position: relative;
}
.marker::after {
  content: ""; position: absolute; left: 50%; top: 18px; width: 4px; height: 30px; margin-left: -2px;
  background: var(--easy); border-radius: 2px;
}

.fine { display: flex; align-items: center; gap: 10px; margin: 14px 0 18px; }
.typed {
  flex: 1; display: flex; align-items: stretch; min-width: 0;
  border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #FFFCF7;
}
.typed:focus-within { border-color: var(--blue); }
.typed input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px;
  font-weight: 800; font-size: 18px; text-align: center;
}
.typed input:focus { outline: none; }
.typed-tag {
  display: flex; align-items: center; padding: 0 12px; background: #F6F1E8;
  border-right: 2px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink-soft);
}

/* Reveal */
.reveal { text-align: center; animation: rise 0.3s ease; }
.reveal-points { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 56px; color: var(--primary); line-height: 1; margin: 4px 0 10px; }
.reveal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.reveal-row > div { background: #FBF7F0; border-radius: 14px; padding: 10px 6px; }
.reveal-label { display: block; font-size: 11px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px; }
.reveal-answer { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; color: var(--easy); }
.reveal-guess { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; }
.reveal-bonus { display: inline-block; background: #FFF4CC; color: #8A5A00; font-weight: 800; font-size: 14px; border-radius: 999px; padding: 4px 12px; margin: -4px 0 10px; }
.bonus-tag { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 12px; color: #B7791F; margin-left: 2px; }
.reveal-miss { font-weight: 800; color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; }
.reveal-fact {
  text-align: left; background: #EEF3FF; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px;
  line-height: 1.45; font-size: 15px;
}
.reveal-fact::before { content: "📜 "; }

/* ---------- Results ---------- */
.results-hero { text-align: center; }
.results-total { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 72px; line-height: 1; margin: 14px 0 4px; letter-spacing: -1px; }
.results-total small { font-size: 26px; color: var(--ink-soft); margin-left: 4px; }
.results-rank { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 20px; color: var(--primary-dark); }
.results-streak {
  display: inline-block; margin-top: 10px; background: #FFF1E0; color: #B4530A;
  font-weight: 800; font-size: 15px; border-radius: 999px; padding: 6px 14px;
}
.results-beat { margin-top: 4px; font-size: 15px; font-weight: 800; color: var(--primary); }
.results-emoji { display: flex; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.chip {
  flex: 1; max-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #FBF7F0; border-radius: 14px; padding: 8px 0 6px;
}
.chip-emoji { font-size: 24px; line-height: 1; }
.chip b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.countdown { margin-top: 14px; font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.countdown b { color: var(--ink); font-variant-numeric: tabular-nums; }

.breakdown { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.breakdown li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: #FBF7F0; border-radius: 14px; }
.bd-emoji { font-size: 20px; line-height: 1.3; }
.bd-body { flex: 1; min-width: 0; }
.bd-title { font-weight: 800; line-height: 1.3; }
.bd-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.bd-pts { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-weight: 800; padding: 12px 18px; border-radius: 14px;
  transition: all 0.25s ease; z-index: 40; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .hero-title { font-size: 32px; }
  .event-title { font-size: 22px; }
  .guess-main { font-size: 38px; }
  .timeline-row { gap: 6px; }
  .timeline-row .btn-round { width: 42px; height: 42px; margin-top: 16px; font-size: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Secondary buttons ---------- */
.btn-secondary {
  background: #FFFFFF; color: var(--ink); border: 2px solid var(--line);
  box-shadow: 0 5px 0 #E8DCC8;
}
.actions { display: flex; flex-direction: column; gap: 16px; }
.btn-secondary:active { box-shadow: 0 2px 0 #E8DCC8; }
.btn-small {
  padding: 8px 12px; font-size: 14px; background: #F6F1E8; color: var(--ink);
  box-shadow: 0 3px 0 #E3D8C5;
}
.btn-small:active { box-shadow: 0 1px 0 #E3D8C5; }
.btn-danger { background: #FFE9EC; color: #C42540; box-shadow: 0 3px 0 #F5C7CF; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-title { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 26px; margin: 0; }
.cal-sub { color: var(--ink-soft); margin: 6px 0 16px; font-size: 15px; }
.cal-month + .cal-month { margin-top: 22px; }
.cal-month h3 { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; margin: 0 0 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-soft); padding-bottom: 2px; }
.cal-cell {
  aspect-ratio: 1 / 1.1; border-radius: 12px; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cal-cell.blank { background: transparent; }
.cal-cell.off { background: transparent; color: #CFC6B8; }
.cal-cell.open {
  background: #FBF7F0; border: 2px solid var(--line); cursor: pointer;
  box-shadow: 0 3px 0 #EDE3D2;
}
.cal-cell.open:active { transform: translateY(2px); box-shadow: 0 1px 0 #EDE3D2; }
.cal-num { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; line-height: 1; }
.cal-pts { font-size: 11px; font-weight: 800; color: var(--ink-soft); line-height: 1; }
.cal-cell.future { opacity: 0.75; border-style: dashed; }
.cal-cell.partial { background: #FFF6DC; border-color: #F5D98A; }
.cal-cell.played { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 3px 0 #0E1028; opacity: 1; }
.cal-cell.played .cal-pts { color: #FFD3C6; font-size: 12px; }
.cal-cell.today { border-color: var(--primary); border-style: solid; box-shadow: 0 3px 0 var(--primary-dark); opacity: 1; }
.cal-cell.today .cal-num { color: var(--primary); }
.cal-cell.today.played .cal-num { color: #fff; }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.lg-today { border: 2px solid var(--primary); }
.lg-played { background: var(--ink); }
.lg-open { background: #FBF7F0; border: 2px solid var(--line); }

.preview-card { background: #FFFBEA; border-color: #F5E2A0; }
.preview-card p { margin: 6px 0 12px; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.preview-card code { background: #fff; padding: 1px 5px; border-radius: 5px; font-size: 13px; }

/* ---------- Practice ---------- */
.practice-list { display: flex; flex-direction: column; gap: 12px; }
.practice-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: #FBF7F0; border: 2px solid var(--line); border-radius: 18px; padding: 14px;
  box-shadow: 0 4px 0 #EDE3D2; cursor: pointer;
}
.practice-item:active { transform: translateY(2px); box-shadow: 0 2px 0 #EDE3D2; }
.pr-icon { font-size: 34px; line-height: 1; }
.pr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pr-body b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; }
.pr-body small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pr-play { background: var(--primary); color: #fff; font-weight: 800; font-size: 14px; padding: 8px 12px; border-radius: 12px; box-shadow: 0 3px 0 var(--primary-dark); white-space: nowrap; }
.pr-score { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; white-space: nowrap; }

/* ---------- Difficulty rating ---------- */
.rate { background: #FBF7F0; border-radius: 16px; padding: 12px; margin: 0 0 16px; }
.rate-q { font-weight: 800; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.rate-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 4px;
  font-size: 22px; cursor: pointer; box-shadow: 0 3px 0 #EDE3D2;
}
.rate-btn span { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.rate-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #EDE3D2; }
.rate-btn.selected { border-color: var(--blue); background: #EEF3FF; box-shadow: 0 3px 0 #C9D6FF; }
.rate-btn.selected span { color: var(--blue); }
.rate-comment { display: flex; gap: 8px; margin-top: 10px; }
.rate-comment input {
  flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 12px; padding: 9px 10px;
  font-size: 16px; background: #fff;
}
.rate-comment input:focus { outline: none; border-color: var(--blue); }
.rate-thanks { margin-top: 10px; font-weight: 800; font-size: 14px; color: var(--easy); }

.site-footer { text-align: center; padding: 6px 0 4px; font-size: 13px; font-weight: 700; }
.site-footer a { color: var(--ink-soft); }
.site-footer .about-tt { margin: 0 auto 6px; max-width: 34em; font-weight: 500; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.listed-on { margin-top: 10px; }
.listed-on img { display: inline-block; vertical-align: middle; opacity: .85; }
/* Daily Smarts badge (Nov 20, 2026): sized like the 36px directory badges beside it */
.ds-badge {
  display: inline-flex; flex-direction: column; justify-content: center; vertical-align: middle; box-sizing: border-box;
  height: 36px; padding: 0 10px; border-radius: 7px; border: 1.5px solid #17324A; background: #fff;
  color: var(--ink) !important; text-decoration: none; line-height: 1.05; text-align: left; opacity: .85;
}
.ds-badge small { font-size: 8px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-soft); }
.ds-badge b { font-size: 13px; font-weight: 800; white-space: nowrap; }
.btn:disabled { opacity: 0.7; }

/* ---------- TimeTurtle touches ---------- */
.hero-turtle { display: flex; flex-direction: row-reverse; justify-content: center; align-items: center; gap: 4px; margin: -4px 0 8px; }
.ht-turtle { font-size: 58px; line-height: 1; display: inline-block; transform: scaleX(-1); animation: swim 3.2s ease-in-out infinite; }
.ht-trail { font-size: 26px; opacity: 0.55; animation: trail 3.2s ease-in-out infinite; }
@keyframes swim { 0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(0deg); } 50% { transform: scaleX(-1) translate(-6px, -6px) rotate(-4deg); } }
@keyframes trail { 0%, 100% { opacity: 0.55; transform: translateY(0); } 50% { opacity: 0.25; transform: translateY(3px); } }
.event-kicker { font-size: 13px; font-weight: 800; color: var(--primary-dark); letter-spacing: 0.3px; margin-bottom: 4px; }
.results-turtle { font-size: 52px; line-height: 1; margin: 0 auto 8px; display: block; width: max-content; transform: scaleX(-1); animation: hop 1.1s ease-out 1; }
@keyframes hop { 0% { transform: scaleX(-1) translateY(18px) scale(0.6); opacity: 0; } 60% { transform: scaleX(-1) translateY(-8px) scale(1.08); opacity: 1; } 100% { transform: scaleX(-1) translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .ht-turtle, .ht-trail, .results-turtle { animation: none; } }

/* Shown only on the private test link (ALLOW_FUTURE=true) */
.test-ribbon {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 50;
  background: #FFE9A8; color: #6B4B00; border: 1px solid #F0C64A; border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap;
}

/* Challenge links: a friend's score rides in the share link */
.challenge {
  margin: 12px 0 4px; padding: 12px 14px; border-radius: 16px;
  background: #FFF4D6; border: 2px solid #F3D27A; text-align: center;
}
.challenge p { margin: 0 0 10px; font-weight: 700; font-size: 16px; line-height: 1.35; }
.challenge .btn { width: 100%; padding: 12px 16px; font-size: 17px; }
.challenge-result {
  margin: 10px auto 2px; padding: 8px 14px; border-radius: 999px; display: inline-block;
  background: #FFF4D6; border: 2px solid #F3D27A; font-weight: 800; font-size: 15px;
}
.home-tip { position: relative; background: var(--primary-soft); }
.home-tip p { margin: 6px 0 0; font-size: 15px; line-height: 1.4; }
.home-tip-x {
  position: absolute; top: 8px; right: 8px; border: 0; background: transparent; font-size: 16px;
  width: 36px; height: 36px; cursor: pointer; touch-action: manipulation; color: inherit; opacity: .6;
}

/* Follow TimeTurtle (home + results) */
.follow-sub { margin: -4px 0 12px; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
.follow-links { display: flex; flex-wrap: wrap; gap: 8px; }
.follow-links a {
  flex: 1 1 auto; text-align: center; padding: 11px 12px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: var(--primary-soft); color: var(--primary-dark); text-decoration: none; touch-action: manipulation;
}
.follow-links a:active { transform: translateY(1px); }

/* Daily Smarts card on results (Nov 20, 2026) */
.ds-card { background: linear-gradient(180deg, #FFFFFF 0%, #FFF8EC 100%); border-color: #F1E2C4; }
.ds-head { display: flex; gap: 12px; align-items: flex-start; }
.ds-icon { font-size: 34px; line-height: 1; flex: none; margin-top: 2px; }
.ds-head .card-title { margin-bottom: 4px; }
.ds-sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
.ds-link {
  display: block; text-align: center; padding: 13px 14px; border-radius: 16px; font-weight: 800; font-size: 16px;
  background: #F6F1E8; color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 #E3D8C5; touch-action: manipulation;
}
.ds-link:active { transform: translateY(3px); box-shadow: 0 1px 0 #E3D8C5; }

/* Home buttons (Nov 5, 2026) */
.play-top { display: flex; align-items: center; gap: 10px; }
.play-top .rounds { flex: 1; margin: 0; }
.actions .home-link { align-self: center; }
.head-btns { display: flex; gap: 6px; flex-shrink: 0; }
.head-btns .btn { white-space: nowrap; }

/* First-visit landing (Nov 18, 2026): new players start on stop 1, with this short welcome above it. */
.welcome { background: var(--primary-soft, #dff3ea); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 3px; font-size: 15px; line-height: 1.35; }
.welcome > b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; }
.welcome small { color: var(--ink-soft); font-weight: 700; font-size: 13px; }

/* Streak shields (Nov 18, 2026): the note under the share button on results. */
.shield-note { margin: 0; padding: 10px 12px; background: var(--primary-soft, #dff3ea); border-radius: 12px;
  font-size: 14px; line-height: 1.4; text-align: left; }

/* Friend levels (Nov 21, 2026): level, progress to the next one, under Share and on the home screen. */
.friend-level { display: grid; gap: 7px; }
.fl-head { display: flex; align-items: center; gap: 10px; }
.fl-icon { font-size: 30px; line-height: 1; }
.fl-name b { display: block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.fl-name small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.fl-bar { height: 10px; border-radius: 999px; background: rgba(23, 50, 74, 0.1); overflow: hidden; }
.fl-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.6s ease; }
.fl-next { font-size: 14px; }
.fl-shield { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(23, 50, 74, 0.18); font-size: 13px; color: var(--ink-soft); }
/* Nov 21, 2026 (Tyson): gold, so it stands apart from the stats tiles above it. */
.start-level { margin: -6px 0 18px; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: linear-gradient(135deg, #FFF9E6 0%, #FFF0C2 100%); border: 2px solid #F3C74F;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.18), 0 4px 12px rgba(224, 162, 27, 0.18); }
.start-level .fl-bar { background: rgba(224, 162, 27, 0.18); }

/* Thread share (Nov 20, 2026): players who came from a community post (e.g. Lemmy dailygames) get a
   "copy for the thread" card above the normal share button. */
.thread-share { padding: 12px 14px; border-radius: 16px; background: #FFF4D6; border: 2px solid #F3D27A;
  display: grid; gap: 8px; text-align: center; }
.thread-share > b { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.thread-share p { margin: 0; font-size: 15px; line-height: 1.4; }
.thread-share .btn { width: 100%; }
.thread-link { font-weight: 800; font-size: 15px; color: var(--primary-dark); padding: 6px; touch-action: manipulation; }
.thread-share.copied .thread-link { background: var(--primary-soft); border-radius: 999px; padding: 10px; }
.thread-share .thread-link.alt, .thread-share.copied .thread-link.alt { background: none; padding: 2px 6px; font-weight: 700; font-size: 14px; }


/* ---------- What Came First? (Nov 20, 2026) ---------- */
.btn-wcf { background: #FFF4DC; color: #8A4B00; border: 2px solid #F5D08A; box-shadow: 0 5px 0 #EBC27A; }
.btn-wcf:active { box-shadow: 0 2px 0 #EBC27A; }
.new-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; background: var(--hard); color: #fff; font: 800 11px/1 "Nunito", sans-serif; letter-spacing: 1px; padding: 4px 7px; border-radius: 999px; }
.wcf-promo { background: linear-gradient(180deg, #FFFFFF 0%, #FFF7E6 100%); border-color: #F5D08A; }
.wcf-promo .ds-sub { margin: 0 0 14px; }
.wcf-card { display: flex; flex-direction: column; gap: 10px; }
.wcf-head { display: flex; justify-content: space-between; align-items: baseline; font-family: "Fredoka", sans-serif; }
.wcf-head b { font-weight: 600; font-size: 19px; }
.wcf-head span { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.wcf-timer { display: flex; align-items: center; gap: 10px; }
.wcf-track { flex: 1; height: 12px; border-radius: 999px; background: #EEF3F0; overflow: hidden; }
.wcf-bar { height: 100%; width: 100%; border-radius: 999px; background: var(--primary); transform-origin: left center; }
.wcf-bar.low { background: var(--hard); }
.wcf-timer span { width: 28px; text-align: right; font: 600 20px "Fredoka", sans-serif; font-variant-numeric: tabular-nums; }
/* Daily What Came First? opens on a short how-to-play card; the clock waits for Start (Nov 20, 2026). */
.wcf-intro-lead { margin: 4px 0 0; font-size: 16px; line-height: 1.45; font-weight: 700; }
.wcf-rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; color: var(--ink-soft); }
.wcf-ask { margin: 2px 0 0; text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.wcf-opt {
  position: relative; width: 100%; min-height: 104px; padding: 18px 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: var(--ink); border: 3px solid var(--line); border-radius: 18px;
  box-shadow: 0 5px 0 #E3EDE7; font: 600 19px/1.25 "Fredoka", sans-serif; text-align: center;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.wcf-opt:active { transform: translateY(3px); box-shadow: 0 2px 0 #E3EDE7; }
.wcf-opt:disabled { cursor: default; transform: none; }
.wcf-opt-year { display: none; font-size: 26px; font-weight: 700; }
.wcf-badge { display: none; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font: 800 11px/1 "Nunito", sans-serif; letter-spacing: 1px; padding: 5px 9px; border-radius: 999px; }
.wcf-opt.shown .wcf-opt-year { display: block; }
.wcf-opt.first { border-color: var(--primary); background: var(--primary-soft); }
.wcf-opt.first .wcf-badge { display: block; }
.wcf-opt.first .wcf-opt-year { color: var(--primary-dark); }
.wcf-opt.wrong { border-color: var(--hard); background: #FDEBEF; }
.wcf-opt.wrong .wcf-opt-year { color: #B42343; }
.wcf-or { text-align: center; font: 600 15px "Fredoka", sans-serif; color: var(--ink-soft); margin: -2px 0; }
.wcf-reveal { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.wcf-verdict { margin: 0; text-align: center; font: 600 22px "Fredoka", sans-serif; }
.wcf-fact { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.wcf-time { font: 600 18px "Fredoka", sans-serif; color: var(--ink-soft); }
.wcf-list { list-style: none; padding: 0; margin: 16px 0 18px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.wcf-list li { display: flex; gap: 10px; align-items: flex-start; background: #FBF7F0; border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.wcf-list li > span:first-child { font-size: 18px; line-height: 1.1; }
.wcf-list b { font-weight: 800; }
.wcf-list small { color: var(--ink-soft); display: block; margin-top: 2px; }
.dot.ok { background: var(--easy); border-color: var(--easy); color: #fff; }
.dot.miss { background: var(--hard); border-color: var(--hard); color: #fff; }
@media (max-width: 380px) { .wcf-opt { min-height: 92px; font-size: 17px; } }
.on-wcf .scorebox { visibility: hidden; }

/* Discord card on results (Nov 20, 2026): Discord blue button. */
.dc-card { background: linear-gradient(180deg, #FFFFFF 0%, #F3F4FF 100%); border-color: #C9CDFB; }
.btn-discord { display: block; text-align: center; text-decoration: none; background: #5865F2; color: #fff;
  box-shadow: 0 5px 0 #3C45A5; touch-action: manipulation; box-sizing: border-box; }
.btn-discord:active { box-shadow: 0 2px 0 #3C45A5; }

/* ---------- Daily streak screen (Nov 21, 2026) ---------- */
/* A 🔥 chip in the top bar on every screen, and a big streak screen on the first visit of each day
   and right after today's trip. Turtle style: the number sits on a sand-colored shell. */
.top-right { display: flex; align-items: center; gap: 8px; }
.streak-chip {
  display: flex; align-items: center; gap: 3px; cursor: pointer;
  background: #FFFFFF; border: 2px solid var(--line); border-radius: 999px; padding: 5px 11px 5px 8px;
  font-family: "Fredoka", sans-serif; font-size: 20px; line-height: 1; color: var(--ink-soft);
  box-shadow: 0 3px 0 rgba(31, 35, 64, 0.08);
}
.streak-chip .sc-flame { filter: grayscale(1); opacity: 0.55; font-size: 18px; }
.streak-chip b { font-weight: 700; }
.streak-chip.lit { background: #FFF1E0; border-color: #FFD3A3; color: #B4530A; }
.streak-chip.lit .sc-flame { filter: none; opacity: 1; }
.streak-chip.pop { animation: chipPop 0.6s ease; }
@keyframes chipPop { 40% { transform: scale(1.25) rotate(-6deg); } }
.on-wcf .streak-chip { visibility: hidden; }

.streak-overlay {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 30%, rgba(255, 222, 170, 0.55), transparent 60%), rgba(23, 50, 74, 0.55);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.streak-sheet {
  width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; text-align: center;
  background: linear-gradient(#FFFDF8, #FFF6E8); border-radius: 28px; padding: 24px 20px 14px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.12), 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: sheetUp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes sheetUp { from { transform: translateY(40px) scale(0.92); opacity: 0; } }
.streak-kicker { font-weight: 800; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary-dark); }
.streak-shell {
  position: relative; width: 168px; height: 150px; margin: 14px auto 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* a turtle shell: sand dome with darker plates */
  background:
    radial-gradient(circle at 50% 30%, #F5C77E 0 16%, transparent 17%),
    radial-gradient(circle at 24% 62%, #F5C77E 0 14%, transparent 15%),
    radial-gradient(circle at 76% 62%, #F5C77E 0 14%, transparent 15%),
    radial-gradient(circle at 50% 84%, #F5C77E 0 12%, transparent 13%),
    #EBC686;
  border: 6px solid var(--primary); border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  box-shadow: 0 8px 0 var(--primary-dark), inset 0 -10px 0 rgba(0, 0, 0, 0.06);
}
.streak-flame { font-size: 44px; line-height: 1; margin-top: -6px; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.streak-num {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 64px; line-height: 0.95; color: #B4530A;
  font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #FFF6E8;
}
.streak-num.bump { animation: numBump 0.7s ease; }
@keyframes numBump { 0% { transform: scale(0.6); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
.streak-badge {
  position: absolute; right: -14px; top: -8px; font-size: 34px;
  animation: hop2 0.6s 0.3s both cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes hop2 { from { transform: translateY(16px) scale(0.4); opacity: 0; } }
.streak-shell.cold { filter: grayscale(0.85); }
.streak-shell.cold .streak-flame { animation: none; opacity: 0.5; }
.streak-head { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 28px; margin: 10px 0 2px; }
.streak-sub { margin: 0 auto; max-width: 320px; font-size: 16px; font-weight: 700; color: var(--ink-soft); line-height: 1.4; }
.streak-sub b { color: var(--ink); }

.streak-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 16px 0 6px; }
.sw-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.sw-dot {
  width: 38px; height: 38px; max-width: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: #F3EBDD; border: 2px solid transparent;
}
.sw-day.played .sw-dot { background: #FFE2BF; border-color: #FFB877; }
.sw-day.shield .sw-dot { background: var(--primary-soft); border-color: var(--primary); }
.sw-day.pending .sw-dot { background: #FFFFFF; border: 2px dashed var(--primary); }
.sw-day.today { color: var(--ink); }
.sw-day.today .sw-dot { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--ink); }
.sw-day.lighting .sw-dot { animation: numBump 0.7s 0.35s both ease; }

.streak-extra { min-height: 1em; margin: 8px 0 14px; font-size: 14px; font-weight: 800; color: var(--primary-dark); }
.streak-extra:empty { display: none; }
.streak-sheet .btn-big { margin-top: 6px; }
.streak-later {
  display: block; margin: 6px auto 0; padding: 10px 16px; background: none; border: 0; cursor: pointer;
  font-weight: 800; font-size: 15px; color: var(--ink-soft);
}
@media (prefers-reduced-motion: reduce) {
  .streak-overlay, .streak-sheet, .streak-flame, .streak-num.bump, .streak-badge, .sw-day.lighting .sw-dot, .streak-chip.pop { animation: none; }
}
@media (max-width: 360px) {
  .scorebox { min-width: 86px; padding: 6px 10px 4px; }
  .brand-name { font-size: 19px; }
}
/* Home screen (Nov 21, 2026): one big "start today's trip" button right under the intro, so it's the obvious
   next tap. Everything else sits below the stats under "More to play", smaller and quieter. */
.start-main { margin: 0 0 20px; }
.btn-start { padding: 20px 18px; font-size: 22px; font-weight: 700; border-radius: 18px;
  box-shadow: 0 6px 0 var(--primary-dark), 0 10px 22px rgba(18, 161, 122, 0.28); animation: startGlow 2.4s ease-in-out infinite; }
.btn-start:active { box-shadow: 0 2px 0 var(--primary-dark); }
@keyframes startGlow {
  0%, 100% { box-shadow: 0 6px 0 var(--primary-dark), 0 10px 22px rgba(18, 161, 122, 0.28), 0 0 0 0 rgba(18, 161, 122, 0.35); }
  50% { box-shadow: 0 6px 0 var(--primary-dark), 0 10px 22px rgba(18, 161, 122, 0.28), 0 0 0 8px rgba(18, 161, 122, 0); }
}
@media (prefers-reduced-motion: reduce) { .btn-start { animation: none; } }
.more-play { display: flex; flex-direction: column; gap: 12px; }
.more-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); }
.more-play .btn-big { padding: 12px 14px; font-size: 16px; }
.more-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-row .btn-big { padding: 11px 8px; font-size: 15px; }

/* Friend level sheet (Nov 21, 2026, Tyson's ask): tap the level card to see your turtle and every level. */
.fl-tap { cursor: pointer; border-radius: 12px; transition: transform 0.12s ease; }
.fl-tap:active { transform: scale(0.98); }
.fl-tap:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.fl-head { position: relative; }
.fl-name { flex: 1; min-width: 0; }
.fl-more { flex: none; font-size: 13px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
body.lv-open { overflow: hidden; }
.lv-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.lv-sheet.hidden { display: none; }
.lv-backdrop { position: absolute; inset: 0; background: rgba(23, 50, 74, 0.45); animation: lvFade 0.2s ease; }
.lv-panel { position: relative; width: 100%; max-width: 460px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(23, 50, 74, 0.25);
  text-align: center; animation: lvUp 0.28s cubic-bezier(.2, .9, .3, 1.15); }
@media (min-width: 520px) { .lv-sheet { align-items: center; } .lv-panel { border-radius: 26px; } }
.lv-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 2px 6px rgba(23, 50, 74, 0.12); }
.lv-avatar { position: relative; width: 190px; height: 190px; margin: 4px auto 6px; }
.lv-avatar svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(23, 50, 74, 0.12)); }
.lv-avatar.locked svg { filter: grayscale(1) brightness(0.25) opacity(0.35); }
.lv-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; }
.lv-title { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 24px; }
.lv-sub { margin: 2px 0 12px; color: var(--ink-soft); font-size: 15px; }
.lv-progress { text-align: left; background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 4px; }
.lv-progress:has(.lv-back) { background: none; padding: 0; text-align: center; }
.lv-ladder-title { margin: 16px 0 8px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; text-align: left; }
.lv-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lv-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; text-align: left; cursor: pointer; transition: transform 0.12s ease; }
.lv-row:active { transform: scale(0.98); }
.lv-row.current { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(18, 161, 122, 0.15); }
.lv-row.locked { background: #F4F7F5; }
.lv-row.locked .lv-name b { color: var(--ink-soft); }
.lv-row.peek { outline: 3px dashed #F3C74F; outline-offset: 2px; }
.lv-ico { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px;
  background: var(--bg); border-radius: 50%; }
.lv-row.locked .lv-ico { filter: grayscale(1); opacity: 0.55; }
.lv-ico i { position: absolute; right: -4px; bottom: -4px; font-size: 14px; font-style: normal; }
.lv-name { flex: 1; min-width: 0; }
.lv-name b { display: block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; }
.lv-name small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.lv-tag { flex: none; font-size: 12px; font-weight: 800; color: #fff; background: var(--primary); border-radius: 999px; padding: 4px 9px; }
.lv-done { flex: none; font-size: 18px; font-weight: 800; color: var(--primary); }
.lv-left { flex: none; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.lv-foot { margin: 14px 4px 0; font-size: 13px; color: var(--ink-soft); }
.lv-back { margin: 2px auto 0; }
@keyframes lvUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lvFade { from { opacity: 0; } to { opacity: 1; } }
/* Avatar animations */
.lv-avatar .av-body { animation: avBob 3.2s ease-in-out infinite; }
.lv-avatar .av-surf { animation: avSurf 2.4s ease-in-out infinite; }
.lv-avatar .av-eye { transform-box: fill-box; transform-origin: center; animation: avBlink 4.6s infinite; }
.lv-avatar .av-flip { transform-box: fill-box; transform-origin: 15% 50%; animation: avPaddle 1.7s ease-in-out infinite; }
.lv-avatar .av-tail { transform-box: fill-box; transform-origin: 100% 50%; animation: avWag 1.4s ease-in-out infinite; }
.lv-avatar .av-egg { transform-box: fill-box; transform-origin: 50% 100%; animation: avWobble 2.6s ease-in-out infinite; }
.lv-avatar .av-bubble { animation: avRise 3.6s ease-in infinite; }
.lv-avatar .av-wave { animation: avWave 3s linear infinite; }
.lv-avatar .av-needle { transform-box: fill-box; transform-origin: center; animation: avNeedle 3s ease-in-out infinite; }
.lv-avatar .av-hourglass { transform-box: fill-box; transform-origin: center; animation: avFlip 5s ease-in-out infinite; }
.lv-avatar .av-spark { transform-box: fill-box; transform-origin: center; animation: avTwinkle 2.2s ease-in-out infinite; }
.lv-avatar .av-baby { animation: avBob 2.2s ease-in-out infinite; }
@keyframes avBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes avSurf { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes avBlink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.1); } }
@keyframes avPaddle { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(16deg); } }
@keyframes avWag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes avWobble { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-7deg); } 76% { transform: rotate(6deg); } 84% { transform: rotate(-4deg); } 92% { transform: rotate(2deg); } }
@keyframes avRise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.8; } 100% { transform: translateY(-110px); opacity: 0; } }
@keyframes avWave { from { transform: translateX(0); } to { transform: translateX(-120px); } }
@keyframes avNeedle { 0%, 100% { transform: rotate(-35deg); } 50% { transform: rotate(40deg); } }
@keyframes avFlip { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@keyframes avTwinkle { 0%, 100% { transform: scale(0.4); opacity: 0.3; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lv-avatar *, .lv-panel, .lv-backdrop { animation: none !important; }
  .lv-avatar .av-bubble { opacity: 0; }
}
/* Share my score on the end-of-trip streak card (Nov 21, 2026): a little room between Share and Keep going. */
#streakShare + #streakGo, .streak-thread + #streakShare { margin-top: 14px; }
/* Lemmy players: copy for the post, then a link to open it (Nov 21, 2026). */
.streak-thread { display: grid; gap: 4px; justify-items: center; }
.streak-thread .btn { width: 100%; }
.streak-thread.copied .thread-link { background: var(--primary-soft); border-radius: 999px; padding: 10px 14px; }

/* Friend XP screen (Nov 21, 2026, Tyson's ask): a big reward when friends played from your link. Reuses the
   streak screen's overlay and card. */
.xp-sheet { background: linear-gradient(#FFFDF4, #FFF3CC); }
.xp-avatar { position: relative; width: 156px; height: 156px; margin: 10px auto 2px; animation: xpPop 0.6s 0.15s both cubic-bezier(0.2, 1.5, 0.4, 1); }
.xp-avatar svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(23, 50, 74, 0.15)); }
.xp-plus { position: absolute; right: -18px; top: 4px; padding: 6px 11px; border-radius: 999px; background: #FFC93C; color: #6B4300;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 20px; box-shadow: 0 3px 0 #E0A21B; transform: rotate(8deg);
  animation: xpBadge 0.6s 0.6s both cubic-bezier(0.2, 1.8, 0.4, 1); }
.xp-head { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 32px; line-height: 1.1; margin: 10px 0 6px; color: var(--primary-dark); }
.xp-level { margin: 14px 0 4px; padding: 12px; border-radius: 16px; background: #FFFFFF; border: 2px solid #F3C74F; text-align: left;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.18); }
.xp-lv-row { display: flex; align-items: center; gap: 10px; }
.xp-lv-icon { font-size: 30px; line-height: 1; }
.xp-lv-name { flex: 1; min-width: 0; }
.xp-lv-name b { display: block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.xp-lv-name small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.xp-lv-next { font-size: 26px; line-height: 1; filter: grayscale(1); opacity: 0.55; }
.xp-bar { height: 16px; margin: 10px 0 8px; border-radius: 999px; background: rgba(224, 162, 27, 0.18); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #3CCB98);
  transition: width 1.2s cubic-bezier(0.3, 1, 0.4, 1); }
.xp-left { font-size: 15px; }
.xp-shield { margin: 8px 0 12px; font-size: 14px; font-weight: 800; color: var(--primary-dark); }
.xp-shield:empty { display: none; }
.xp-sheet .streak-later { padding: 8px 16px; }
@keyframes xpPop { from { transform: scale(0.4); opacity: 0; } }
@keyframes xpBadge { from { transform: translateY(14px) scale(0.3) rotate(8deg); opacity: 0; } }
.xp-avatar .av-body { animation: avBob 3.2s ease-in-out infinite; }
.xp-avatar .av-eye { transform-box: fill-box; transform-origin: center; animation: avBlink 4.6s infinite; }
.xp-avatar .av-flip { transform-box: fill-box; transform-origin: 15% 50%; animation: avPaddle 1.7s ease-in-out infinite; }
.xp-avatar .av-egg { transform-box: fill-box; transform-origin: 50% 100%; animation: avWobble 2.6s ease-in-out infinite; }
.xp-avatar .av-wave { animation: avWave 3s linear infinite; }
.xp-avatar .av-surf { animation: avSurf 2.4s ease-in-out infinite; }
.xp-avatar .av-spark { transform-box: fill-box; transform-origin: center; animation: avTwinkle 2.2s ease-in-out infinite; }
.xp-avatar .av-baby { animation: avBob 2.2s ease-in-out infinite; }
.xp-avatar .av-needle { transform-box: fill-box; transform-origin: center; animation: avNeedle 3s ease-in-out infinite; }
.xp-avatar .av-hourglass { transform-box: fill-box; transform-origin: center; animation: avFlip 5s ease-in-out infinite; }
.xp-avatar .av-bubble { animation: avRise 3.6s ease-in infinite; }
@media (prefers-reduced-motion: reduce) {
  .xp-avatar, .xp-avatar *, .xp-plus { animation: none !important; }
  .xp-avatar .av-bubble { opacity: 0; }
  .xp-bar i { transition: none; }
}
/* relaydle rail (Nov 21, 2026): relaydle draws the cards; this only spaces it and hides it while empty. */
/* relaydle draws into a shadow root, so :empty can't hide it (that hid it for good). The gap is added only once cards show. */
.rd-rail { display: block; }
.rd-rail.has-rail { margin: 0 0 16px; }
