/* Daily Past — Pop: chunky cards on bright violet, every year a sticker in its era's colour */
:root {
  --bg: #573eec;                   /* brand violet, from the logo */
  --bg-ink: #ffffff;               /* text placed straight on the background */
  --bg-muted: rgba(255, 255, 255, 0.8);
  --card: #ffffff;
  --soft: #f1edff;
  --ink: #15121f;
  --muted: #6b6880;
  --line: #15121f;
  --shadow: #15121f;
  --sun: #f8d45d;                  /* the logo's front page */
  --ok: #139e5c;
  --ok-fill: #22c77a;
  --bad: #ff4d4d;
  --bad-text: #e02e2e;
  --accent: #573eec;               /* violet text on cards */
  --sticker-ink: #15121f;          /* stickers are always light, so their text stays dark */
  --focus-bg: #ffffff;
  --focus-card: #573eec;
  --overlay: rgba(21, 19, 28, 0.55);

  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-ui: "Figtree", system-ui, sans-serif;
  --border: 2.5px solid var(--line);

  --thumb: 58px;
  --gap-h: 42px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-pop: cubic-bezier(0.2, 1.5, 0.4, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1338;
    --bg-ink: #f5f2ff;
    --bg-muted: rgba(245, 242, 255, 0.72);
    --card: #2b2357;
    --soft: #382e70;
    --ink: #f5f2ff;
    --muted: #b6addb;
    --line: #07050f;
    --shadow: #07050f;
    --ok: #4be39a;
    --bad-text: #ff8080;
    --accent: #b9a8ff;
    --focus-bg: #ffd23f;
    --focus-card: #ffd23f;
    --overlay: rgba(4, 2, 12, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus-bg); outline-offset: 3px; }
.dock :focus-visible, .sheet :focus-visible { outline-color: var(--focus-card); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Masthead ─────────────────────────────────────────── */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 4px;
}
.mast-title { min-width: 0; }
.brand { margin: 0; line-height: 1; }
.brand button { display: block; padding: 0; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.dp-wordmark { display: block; height: 58px; width: auto; overflow: visible; }
.dp-daily { fill: var(--bg-ink); }

/* Logo: the calendar pages riffle on hover, keyboard focus or a tap (.flutter is set from JS) */
.dp-logo .dp-front, .dp-logo .dp-s2, .dp-logo .dp-s3, .dp-logo .dp-shadow { transform-box: fill-box; transform-origin: 50% 0; }
.dp-logo:is(:hover, :focus-visible, .flutter) .dp-front { animation: dp-flutter 0.9s cubic-bezier(0.3, 0.7, 0.4, 1); }
.dp-logo:is(:hover, :focus-visible, .flutter) .dp-s2 { animation: dp-flutter2 0.9s 0.06s cubic-bezier(0.3, 0.7, 0.4, 1); }
.dp-logo:is(:hover, :focus-visible, .flutter) :is(.dp-s3, .dp-shadow) { animation: dp-flutter3 0.9s 0.12s cubic-bezier(0.3, 0.7, 0.4, 1); }
@keyframes dp-flutter {
  0% { transform: none; }
  18% { transform: rotate(-4deg) skewX(3deg) scaleY(0.96); }
  40% { transform: rotate(3deg) skewX(-2deg) scaleY(0.98); }
  62% { transform: rotate(-1.6deg) skewX(1deg); }
  82% { transform: rotate(0.6deg); }
  100% { transform: none; }
}
@keyframes dp-flutter2 { 0% { transform: none; } 22% { transform: rotate(-2.6deg) skewX(2deg); } 46% { transform: rotate(2deg); } 70% { transform: rotate(-0.8deg); } 100% { transform: none; } }
@keyframes dp-flutter3 { 0% { transform: none; } 25% { transform: rotate(-1.4deg); } 50% { transform: rotate(1deg); } 75% { transform: rotate(-0.4deg); } 100% { transform: none; } }
.edition { margin: 4px 0 0; font-weight: 700; font-size: 0.88rem; color: var(--bg-muted); }
.tools { display: flex; gap: 8px; flex-shrink: 0; }
.tool {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 50%; box-shadow: 2px 2px 0 var(--shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tool:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.tool:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#btn-mute .cross { display: none; }
#btn-mute[aria-pressed="true"] .wave { display: none; }
#btn-mute[aria-pressed="true"] .cross { display: inline; }

/* ── Status chips ─────────────────────────────────────── */
.status {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: stretch; gap: 8px;
  padding: 12px 16px 14px;
  background: var(--bg);
}
.lives, .status .pips, .streak {
  height: 42px; display: flex; align-items: center;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 14px; box-shadow: 3px 3px 0 var(--shadow);
}
.lives { gap: 2px; padding: 0 8px; }
.life { width: 22px; height: 22px; }
.life path { fill: var(--bad); stroke: var(--line); stroke-width: 2.2; stroke-linejoin: round; transition: fill 0.3s; }
.life.lost path { fill: var(--soft); }
.life.just-lost { animation: life-out 0.5s var(--ease-out); }
@keyframes life-out { 30% { transform: scale(1.4) rotate(-12deg); } }
.pips { display: flex; margin: 0; padding: 0; list-style: none; }
.status .pips { flex: 1; min-width: 0; gap: 4px; padding: 0 10px; }
.pip {
  flex: 1; height: 16px;
  background: var(--card);
  border: 2px solid var(--line); border-radius: 5px;
  transition: background-color 0.25s;
}
.pip.ok { background: var(--ok-fill); }
.pip.bad { background: var(--bad); }
.pip.skip { background: repeating-linear-gradient(45deg, var(--soft) 0 3px, var(--card) 3px 6px); }
.pip.now { background: var(--sun); animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 50% { background: var(--card); } }
.streak {
  margin: 0; gap: 3px; padding: 0 10px;
  font-family: var(--f-display); font-weight: 900; font-size: 0.95rem;
}
.streak svg { width: 18px; height: 18px; fill: #ff7a30; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }

/* ── Drawer & timeline ────────────────────────────────── */
.drawer { flex: 1; padding: 4px 16px 24px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > .entry:first-child { margin-top: 14px; } /* room for the sticker under the sticky status */
.drawer-foot { margin: 18px 0 0; text-align: center; font-weight: 700; font-size: 0.88rem; color: var(--bg-muted); }
.drawer-foot:empty { display: none; }

.card {
  position: relative;
  display: grid; grid-template-columns: var(--thumb) minmax(0, 1fr); column-gap: 12px; align-items: center;
  min-height: 80px;
  padding: 10px 12px 10px 10px;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 18px; box-shadow: 4px 4px 0 var(--shadow);
  text-align: left;
}
.card-img {
  width: var(--thumb); height: var(--thumb);
  object-fit: cover; display: block;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--soft);
}
.card-text { display: block; min-width: 0; padding-right: 36px; }
.card-class {
  display: block;
  font-weight: 800; font-size: 0.7rem; line-height: 1.1; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-class em { font-style: normal; }
.entry.ok .card-class em { color: var(--ok); }
.entry.bad .card-class em { color: var(--bad-text); }
.entry.anchor .card-class em { color: var(--accent); }
.card-title {
  margin-top: 5px;
  font-weight: 800; font-size: 1rem; line-height: 1.22;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}

/* The year sticker, coloured by era (--era is set per card) */
.sticker {
  position: absolute; top: -13px; right: -8px; z-index: 1;
  padding: 7px 10px 8px;
  font-family: var(--f-display); font-weight: 900; font-size: 0.8rem; line-height: 1; white-space: nowrap;
  color: var(--sticker-ink); background: var(--era, var(--sun));
  border: var(--border); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow);
  transform: rotate(var(--tilt, 4deg));
  pointer-events: none;
}
.entry.bad .sticker { background: var(--bad); color: #fff; }
.entry.skip .sticker { background: var(--soft); color: var(--muted); border-style: dashed; box-shadow: none; }
.entry.skip .card { opacity: 0.75; }
.sticker.blank { background: var(--card); color: var(--ink); border-style: dashed; }
.sticker.pressed { animation: slap 0.55s var(--ease-pop) both; }
.entry.solemn .sticker.pressed { animation: settle 0.6s ease-out both; }
@keyframes settle { from { opacity: 0; transform: rotate(var(--tilt, 4deg)) scale(0.9); } }
@keyframes slap {
  0% { opacity: 0; transform: scale(2.4) rotate(calc(var(--tilt, 4deg) - 30deg)); }
  50% { opacity: 1; transform: scale(0.86) rotate(var(--tilt, 4deg)); }
  100% { transform: scale(1) rotate(var(--tilt, 4deg)); }
}

/* Placed cards open their detail sheet */
.entry { position: relative; scroll-margin: 80px 0 260px; }
.entry .card { width: 100%; cursor: pointer; transition: transform 0.15s var(--ease-out), box-shadow 0.15s; }
.entry .card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.entry .card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.entry.misplaced .card { animation: shake 0.42s ease both; border-color: var(--bad); box-shadow: 4px 4px 0 var(--bad); }
@keyframes shake {
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(7px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* Confetti from a sticker that landed right */
.burst {
  position: absolute; right: 34px; top: 0; z-index: 3;
  width: 10px; height: 10px;
  border: 2px solid var(--line); border-radius: 50%;
  pointer-events: none;
  animation: fly 0.75s 0.3s cubic-bezier(0.1, 0.7, 0.3, 1) both;
}
@keyframes fly {
  0% { opacity: 0; transform: scale(0.3); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.5); }
}

/* Gap: a "+" between cards; hover or drag shows the span, a tap turns it into a drop slot */
.gap { position: relative; }
.gap-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: var(--gap-h);
  padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--ink);
}
.gap-btn::before {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px;
  border-left: 2.5px dashed var(--bg-muted); opacity: 0.55;
}
.gap-tab {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3em;
  min-width: 30px; height: 30px; padding: 0 8px;
  background: var(--card);
  border: var(--border); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow);
  font-family: var(--f-display); font-weight: 900; font-size: 1rem; line-height: 1;
  transition: background-color 0.15s, transform 0.2s var(--ease-pop);
}
.gap-words, .gap-lead { display: none; font-family: var(--f-ui); font-weight: 800; font-size: 0.85rem; }
.gap.target .gap-tab { background: var(--sun); color: var(--sticker-ink); transform: scale(1.08); padding: 0 12px; }
.gap.target .gap-plus { display: none; }
.gap.target .gap-words { display: inline; }
@media (hover: hover) {
  .gap-btn:not(:disabled):hover .gap-tab { background: var(--sun); color: var(--sticker-ink); transform: scale(1.08); padding: 0 12px; }
  .gap-btn:not(:disabled):hover .gap-plus { display: none; }
  .gap-btn:not(:disabled):hover .gap-words { display: inline; }
}
.gap.selected .gap-btn { height: auto; padding: 12px 0; }
.gap.selected .gap-btn::before { display: none; }
.gap.selected .gap-tab {
  width: 100%; height: 54px;
  background: var(--sun); color: var(--sticker-ink);
  border-style: dashed; border-radius: 16px; box-shadow: none;
  animation: wiggle 1.6s ease-in-out infinite;
}
.gap.selected .gap-plus { display: none; }
.gap.selected .gap-lead, .gap.selected .gap-words { display: inline; font-size: 0.95rem; }
@keyframes wiggle { 50% { transform: scale(1.02); } }
.gap-btn:disabled { cursor: default; }
.gap-btn:disabled .gap-tab { opacity: 0.5; }
.timeline.dragging .gap-btn { cursor: grabbing; }
.timeline.nudge .gap-tab { animation: nudge 0.6s var(--ease-pop); }
@keyframes nudge { 40% { transform: scale(1.3) rotate(-8deg); background: var(--sun); color: var(--sticker-ink); } }

/* Interval between finished entries: the time that passed */
.interval {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 36px;
}
.interval::before {
  content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px;
  border-left: 2.5px dashed var(--bg-muted); opacity: 0.55;
}
.interval span {
  position: relative; padding: 2px 8px;
  background: var(--bg); color: var(--bg-ink);
  font-weight: 800; font-size: 0.78rem;
}

/* ── Footer: social icons and small links under the timeline ── */
.site-foot { padding: 4px 16px 28px; text-align: center; }
.foot-social { display: flex; justify-content: center; gap: 12px; }
.foot-links { margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-weight: 700; font-size: 0.88rem; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--bg-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bg-muted); }
.foot-links svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Dock: the card in your hand ──────────────────────── */
.dock {
  position: sticky; bottom: 0; z-index: 8;
  padding: 14px 16px calc(14px + var(--safe-b));
  background: var(--card); color: var(--ink);
  border: var(--border); border-bottom: 0; border-radius: 28px 28px 0 0;
}
.dock-label {
  margin: 0 0 16px;
  font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.hand { touch-action: none; }
.hand-card {
  margin: 0 4px;
  background: var(--soft);
  cursor: grab;
  transform: rotate(-1.5deg);
  user-select: none; -webkit-user-select: none;
  animation: deal-in 0.45s var(--ease-pop) both;
}
.hand-card { --thumb: 72px; }
.hand-card .card-title { font-size: 1.06rem; -webkit-line-clamp: 3; }
.hand-card.lifted { opacity: 0.35; }
.hand-card .card-img, .hand-card .zoom-badge { grid-row: 1; grid-column: 1; }
.hand-card .card-img { cursor: zoom-in; }
.zoom-badge {
  align-self: end; justify-self: end; margin: 0 -6px -6px 0; z-index: 1;
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: 50%; box-shadow: 1px 1px 0 var(--shadow);
  cursor: zoom-in;
}
.zoom-badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.zoom-title { font-size: 1.1rem !important; }
.zoom-img {
  display: block; width: 100%; max-height: 68dvh; object-fit: contain;
  margin: 8px 0 12px; background: var(--soft);
  border: var(--border); border-radius: 18px;
}
@keyframes deal-in { from { opacity: 0; transform: translateY(30px) rotate(5deg); } }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 50;
  margin: 0;
  pointer-events: none; cursor: grabbing;
  animation: none;
  box-shadow: 8px 8px 0 var(--shadow);
}
.dock-actions { margin-top: 16px; min-height: 48px; display: flex; align-items: center; }
.dock-actions .btn { width: 100%; }
.dock-hint { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--muted); line-height: 1.35; }
.btn:not([hidden]) ~ .dock-hint { display: none; }
.dock-score { margin: 0; font-weight: 700; color: var(--muted); }
.dock-score b { font-family: var(--f-display); font-weight: 900; font-size: 2.2rem; color: var(--ink); margin-right: 6px; }
.dock-next { margin: 6px 0 0; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.dock-next span { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  appearance: none; cursor: pointer;
  min-height: 48px; padding: 10px 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-weight: 800; font-size: 0.98rem;
  text-align: center; text-decoration: none;
  color: var(--ink); background: var(--card);
  border: var(--border); border-radius: 14px; box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow); }
.btn.primary {
  min-height: 54px;
  background: var(--sun); color: var(--sticker-ink);
  font-family: var(--f-display); font-weight: 900; font-size: 0.9rem; letter-spacing: -0.01em;
  box-shadow: 4px 4px 0 var(--shadow);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn-row .btn { flex: 1 1 auto; }

/* ── Sheets ───────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.2s;
}
.overlay.open { opacity: 1; }
.sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90dvh, 860px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--card); color: var(--ink);
  border: var(--border); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 24px 20px calc(24px + var(--safe-b));
  transform: translateY(40px);
  transition: transform 0.32s var(--ease-pop);
}
.overlay.open .sheet { transform: none; }
.sheet:focus { outline: none; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 50%; box-shadow: 2px 2px 0 var(--shadow);
  cursor: pointer; font-size: 1.4rem; font-weight: 800; line-height: 1;
}
.sheet h2 {
  margin: 0 48px 8px 0;
  font-family: var(--f-display); font-weight: 900; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.02em;
}
.sheet p { line-height: 1.55; margin: 0 0 12px; }
.sheet .lede { color: var(--muted); font-weight: 600; }
.eyebrow {
  margin: 0 0 10px;
  font-weight: 800; font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
}

/* Detail */
.detail-img {
  display: block; width: 100%; max-height: 46dvh; aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--border); border-radius: 18px;
  background: var(--soft);
  margin-bottom: 18px;
}
.detail-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-meta .sticker { position: static; display: inline-block; font-size: 1rem; padding: 8px 12px 9px; }
.detail-body { font-size: 1.04rem; }
.credit {
  margin-top: 18px; padding-top: 12px; border-top: 2px dashed var(--soft);
  font-size: 0.78rem; line-height: 1.5; color: var(--muted);
}
.credit a, .sheet a { color: inherit; text-underline-offset: 2px; }

/* Help */
.how { list-style: none; padding: 0; margin: 18px 0 0; counter-reset: how; }
.how li {
  counter-increment: how;
  display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start;
  margin-bottom: 14px; line-height: 1.45;
}
.how li::before {
  content: counter(how);
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--sun); color: var(--sticker-ink);
  border: var(--border); border-radius: 50%;
  font-family: var(--f-display); font-weight: 900; font-size: 0.8rem;
  transform: rotate(-6deg);
}
.legend { display: flex; flex-wrap: wrap; gap: 10px 8px; margin: 4px 0 8px; }
.legend span {
  display: inline-block; padding: 5px 9px 6px;
  font-family: var(--f-display); font-weight: 900; font-size: 0.68rem; line-height: 1;
  color: var(--sticker-ink); background: var(--era, var(--sun));
  border: var(--border); border-radius: 999px;
}
.legend span:nth-child(odd) { transform: rotate(-3deg); }
.legend span:nth-child(even) { transform: rotate(3deg); }
.legend .bad { background: var(--bad); color: #fff; }
.legend .skip { background: var(--soft); color: var(--muted); border-style: dashed; }

.coffee {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; padding: 10px 14px;
  background: var(--soft); color: var(--ink);
  border: 2px dashed var(--line); border-radius: 14px;
  font-weight: 800; font-size: 0.9rem; text-decoration: none;
}
.coffee:hover { background: var(--sun); color: var(--sticker-ink); border-style: solid; }
.coffee svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.social { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.social-label { flex: 1; font-weight: 800; font-size: 0.85rem; color: var(--muted); }
.social .tool { text-decoration: none; }
.privacy { margin-top: 22px; padding-top: 14px; border-top: 2px dashed var(--soft); font-size: 0.85rem; color: var(--muted); }
.privacy p { line-height: 1.5; }
.text-btn { padding: 0; background: none; border: 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Cookie consent banner (only when GA_MEASUREMENT_ID is set) */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 45;
  max-width: 520px; margin: 0 auto; padding: 16px;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 18px; box-shadow: 5px 5px 0 var(--shadow);
  animation: deal-in 0.45s var(--ease-pop) both;
}
.consent p { margin: 0 0 12px; font-size: 0.92rem; line-height: 1.45; }
.consent a { color: inherit; font-weight: 800; text-underline-offset: 3px; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .btn { flex: 1; }
.consent :focus-visible { outline-color: var(--focus-card); }

/* Result */
.score { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.score b { font-family: var(--f-display); font-weight: 900; font-size: 3rem; line-height: 1; letter-spacing: -0.03em; }
.score-label { font-weight: 700; color: var(--muted); }
.result-sticker {
  --tilt: -8deg;
  margin-left: auto;
  padding: 9px 14px 10px;
  font-family: var(--f-display); font-weight: 900; font-size: 0.85rem; text-transform: uppercase;
  color: var(--sticker-ink); background: var(--ok-fill);
  border: var(--border); border-radius: 999px; box-shadow: 3px 3px 0 var(--shadow);
  transform: rotate(var(--tilt));
}
.result-sticker.perfect { background: var(--sun); }
.result-sticker.bad { background: var(--bad); color: #fff; }
.result-sticker.pressed { animation: slap 0.55s 0.15s var(--ease-pop) both; }
.result-pips { gap: 6px; margin: 6px 0 20px; }
.result-pips .pip { flex: 0 0 26px; height: 26px; border-width: 2.5px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 20px; }
.stats div {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; text-align: center;
  background: var(--soft); border: var(--border); border-radius: 14px;
}
.stats b { font-family: var(--f-display); font-weight: 900; font-size: 1.3rem; }
.stats span { font-size: 0.72rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.dist { margin: 0 0 20px; display: grid; gap: 8px; }
.dist-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.dist-bar {
  height: 26px; min-width: 30px; width: var(--w);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 8px;
  background: var(--soft); color: var(--ink);
  border: 2px solid var(--line); border-radius: 8px;
  font-family: var(--f-display); font-weight: 900; font-size: 0.75rem;
}
.dist-row.today .dist-bar { background: var(--sun); color: var(--sticker-ink); }
.dist-row.today.lost .dist-bar { background: var(--bad); color: #fff; }
.next {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px;
  background: var(--soft); border: var(--border); border-radius: 14px;
  font-weight: 700; font-size: 0.9rem; color: var(--muted);
}
.countdown { font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }


/* ── Small phones ─────────────────────────────────────── */
@media (max-width: 380px) {
  .masthead, .status, .drawer { padding-left: 12px; padding-right: 12px; }
  .dp-wordmark { height: 48px; }
  .tools { gap: 6px; }
  .tool { width: 36px; height: 36px; }
  .status { gap: 6px; }
}

/* ── Wide screens: drawer left, hand on the right ─────── */
@media (min-width: 920px) {
  :root { --thumb: 64px; }
  #app {
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "mast mast" "status dock" "drawer dock" "foot dock";
    grid-template-rows: auto auto 1fr auto;
    column-gap: 48px;
    padding: 0 24px;
  }
  .masthead { grid-area: mast; padding: 32px 0 12px; }
  .dp-wordmark { height: 72px; }
  .status { grid-area: status; padding: 14px 0 18px; }
  .drawer { grid-area: drawer; padding: 4px 8px 24px 0; }
  .site-foot { grid-area: foot; padding: 0 8px 40px 0; }
  .dock {
    grid-area: dock; align-self: start;
    position: sticky; top: 24px; bottom: auto;
    margin-top: 14px;
    padding: 20px;
    border-bottom: var(--border); border-radius: 24px;
    box-shadow: 6px 6px 0 var(--shadow);
  }
  .card-title { font-size: 1.04rem; }
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-bottom: var(--border); border-radius: 24px; padding: 28px; box-shadow: 8px 8px 0 var(--shadow); }
}

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