/* Yearspot game styles. Builds on ../styles.css (tokens, header, footer, buttons). */

:root {
  /* closeness colors: text-safe (AA) on surface, used as ink on a light tint */
  --hot: #806000;
  --warm: #9a4d00;
  --cold: #526778;
  --win: #1f673e;
  --error: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --hot: #ffe176; --warm: #f5a54a; --cold: #a8bac9; --win: #87dca9; --error: #ff7b6e; }
}
:root[data-theme="dark"] { --hot: #ffe176; --warm: #f5a54a; --cold: #a8bac9; --win: #87dca9; --error: #ff7b6e; }

.ys {
  max-width: calc(640px + var(--gutter) * 2);
  padding-top: clamp(20px, 3vw, 36px);
  padding-bottom: clamp(56px, 7vw, 88px);
}

.ys-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.ys-back { margin-bottom: 0; }
.ys-tools { display: flex; gap: 4px; }

.ys-icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.ys-icon-btn:hover { background: var(--quiet); }
.ys-icon-btn svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ys-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.ys-title {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}
.ys-mode {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}
.ys-sub {
  margin-top: 10px;
  color: var(--muted);
}

/* ---------- card + board ---------- */

.ys-card {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: background-color .35s var(--ease);
}

.ys-board {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ys-clue {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--quiet);
}
.ys-k {
  flex: none;
  width: 92px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ys-v { font-weight: 600; line-height: 1.4; }
.ys-clue.is-locked {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.ys-clue.is-locked .ys-v { font-weight: 400; font-size: .9rem; color: var(--muted); }

.ys-guess {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 2px 0;
  font-size: .9rem;
  font-weight: 600;
}
.ys-year {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.ys-guess.is-win .ys-year { color: var(--text); }

.ys-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}
.ys-chip.is-hot { color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, var(--surface)); }
.ys-chip.is-warm { color: var(--warm); background: color-mix(in srgb, var(--warm) 12%, var(--surface)); }
.ys-chip.is-cold { color: var(--cold); background: color-mix(in srgb, var(--cold) 12%, var(--surface)); }
.ys-chip.is-win { color: var(--win); background: color-mix(in srgb, var(--win) 12%, var(--surface)); }

/* ---------- possible-year timeline ---------- */

.ys-timeline {
  margin-top: 18px;
  padding: 12px 16px 10px;
  border-radius: 12px;
  background: var(--quiet);
}
.ys-timeline-head, .ys-axis { display: flex; justify-content: space-between; gap: 12px; }
.ys-timeline-head { color: var(--muted); font-size: .8rem; font-weight: 600; }
.ys-timeline-head [data-range-label] { color: var(--text); font-variant-numeric: tabular-nums; }
.ys-track {
  position: relative;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 16%, var(--surface));
}
.ys-range {
  position: absolute;
  inset-block: 0;
  left: 0;
  right: 0;
  min-width: 8px;
  border-radius: inherit;
  background: var(--accent);
  transition: left .45s var(--ease), right .45s var(--ease);
}
.ys-dots { position: absolute; inset: 0; }
.ys-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--cold);
  transform: translate(-50%, -50%);
}
.ys-dot.is-warm { background: var(--warm); }
.ys-dot.is-hot { background: var(--hot); }
.ys-dot.is-win { background: var(--win); }
.ys-axis { margin-top: 7px; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }

/* ---------- guess form ---------- */

.ys-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.ys-form[hidden] { display: none; }

.ys-input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 22px;
  border: 2px solid var(--faint);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  transition: border-color .2s var(--ease);
}
.ys-input::placeholder { color: var(--faint); font-weight: 500; letter-spacing: 0; }
.ys-input:focus,
.ys-input:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.ys-input[aria-invalid="true"] { border-color: var(--error); }

.ys-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease);
}
.ys-btn svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ys-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -16px color-mix(in srgb, var(--accent) 90%, transparent);
}
.ys-btn:active { transform: none; }
.ys-btn-quiet { background: var(--quiet); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.ys-btn-quiet:hover { background: var(--line); box-shadow: inset 0 0 0 1.5px var(--line); }

.ys-hint, .ys-error {
  flex-basis: 100%;
  padding-left: 22px;
  font-size: .875rem;
}
.ys-hint { color: var(--muted); }
.ys-error { margin-top: -6px; color: var(--error); font-weight: 600; }
.ys-error:empty { display: none; }

/* ---------- result ---------- */

.ys-result {
  scroll-margin-bottom: 24px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.ys-result-k { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.ys-answer-label { margin-top: 12px; color: var(--muted); font-weight: 500; }
.ys-year-wrap { position: relative; display: inline-block; }
.ys-result-year {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 4.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.ys-result.is-won .ys-result-year { color: var(--win); }
.ys-confetti { position: absolute; inset: 0; pointer-events: none; }
.ys-confetti i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
}
.ys-confetti i:nth-child(3n + 2) { background: var(--text); }
.ys-confetti i:nth-child(3n) { background: var(--win); }
.ys-fact {
  max-width: 30rem;
  margin: 14px auto 0;
  color: var(--muted);
}
.ys-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.ys-next {
  margin-top: 18px;
  font-size: .875rem;
  color: var(--muted);
}
.ys-next .hp-clock { margin-left: 4px; }

/* the next daily, or a single recap when all of today's games are done */
.ys-day-flow { margin-top: 22px; }
.ys-day-flow[hidden] { display: none; }
.ys-flow-progress { margin-bottom: 10px; color: var(--muted); font-size: .9rem; }
.ys-flow-primary { min-width: min(100%, 260px); }
.ys-flow-primary svg { flex: none; }
.ys-flow-title { font-size: 1.55rem; }
.ys-flow-list { max-width: 520px; margin: 14px auto 18px; text-align: left; }
.ys-flow-list .day-row { flex-wrap: wrap; }
.ys-flow-list .day-result { justify-content: flex-end; }
.ys-flow-clock { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.ys-flow-clock time { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ys-flow-invite { margin-top: 22px; font-weight: 600; }
.ys-flow-archives { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.ys-flow-archives .ys-btn { height: 46px; padding: 0 20px; font-size: .9rem; }
.ys-day-flow .day-copy { max-width: 520px; margin: 12px auto 0; text-align: left; }

.ys-switch { margin-top: 18px; text-align: center; }
.ys-link {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- modals ---------- */

.ys-modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lift);
}
.ys-modal:focus-visible { outline: none; }
.ys-modal::backdrop {
  background: rgba(13, 13, 15, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ys-modal p, .ys-modal li { color: var(--muted); }
.ys-modal strong { color: var(--text); font-weight: 600; }
.ys-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -10px 14px 0;
}
.ys-modal h2 { font-size: 1.75rem; letter-spacing: -0.04em; }

.ys-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 1.25em;
}
.ys-legend {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0 0 0 1.25em;
  list-style: none;
}
.ys-legend li { display: flex; align-items: center; gap: 10px; }
.ys-legend .ys-chip { min-width: 64px; text-align: center; }
.ys-modal-note { margin-top: 16px; font-size: .9rem; }
.ys-modal-cta { width: 100%; margin-top: 20px; }

.ys-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  text-align: center;
}
.ys-stats div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  padding: 13px 4px;
  border-radius: 12px;
  background: var(--quiet);
}
.ys-stats dd {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1;
}
.ys-stats dt { font-size: .72rem; line-height: 1.25; color: var(--muted); }

.ys-dist-title {
  margin: 24px 0 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.ys-dist {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ys-dist li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 3px 6px;
  border-radius: 8px;
  cursor: default;
}
.ys-dist li:hover, .ys-dist li:focus-visible { background: var(--quiet); }
.ys-dist li:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.ys-dist-k { width: 94px; flex: none; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.ys-dist-bar { flex: 1; height: 14px; border-radius: 0 4px 4px 0; background: var(--quiet); }
.ys-dist-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--text); transition: width .35s var(--ease), opacity .2s; }
.ys-dist li:hover .ys-dist-bar span, .ys-dist li:focus-visible .ys-dist-bar span { opacity: .75; }
.ys-dist li.is-current .ys-dist-bar span { background: var(--accent); }
.ys-dist-end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; width: 69px; flex: none; }
.ys-dist-n { font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.ys-dist-today { padding: 2px 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-text); font-size: .62rem; font-weight: 600; }

.ys-stats-finished { display: grid; justify-items: center; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.ys-stats-finished[hidden] { display: none; }
.ys-stats-finished p { color: var(--muted); font-size: .85rem; }
.ys-stats-clock { margin-left: 4px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ys-stats-finished .ys-btn { width: 100%; height: 48px; font-size: .95rem; }

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

.ys-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.ys-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- header link, archive tag, end-screen links ---------- */

.ys-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s var(--ease);
}
.ys-tool-link:hover { background: var(--quiet); }
.ys-tool-link svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ys-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: .8rem;
  line-height: 1.5;
}
.ys-pill[hidden] { display: none; }
.ys-pill.is-hard { background: var(--text); color: var(--bg); }
.ys-pill.is-replay { background: var(--quiet); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- settings (hard mode switch) ---------- */

.ys-setting { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ys-setting-text label { display: block; color: var(--text); font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.ys-setting-text p { margin-top: 4px; font-size: .92rem; }
.ys-switch-btn {
  position: relative;
  flex: none;
  width: 52px; height: 32px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 22%, var(--surface));
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.ys-switch-btn span {
  position: absolute;
  top: 4px; left: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s var(--ease);
}
.ys-switch-btn[aria-checked="true"] { background: var(--accent); }
.ys-switch-btn[aria-checked="true"] span { transform: translateX(20px); }
.ys-switch-btn:disabled { cursor: not-allowed; opacity: .55; }

a.ys-btn { text-decoration: none; }
.ys-btn[hidden] { display: none; }
.ys-archive-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; margin-top: 6px; }
.ys-archive-row .ys-link[hidden] { display: none; }
.ys-timeline[hidden] { display: none; }

/* ---------- archive page ---------- */

.ar { max-width: calc(720px + var(--gutter) * 2); }

.ar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 0;
}
.ar-stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ar-stat dt { font-size: .75rem; line-height: 1.3; color: var(--muted); }
.ar-stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ar-stat-hint { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; background: var(--quiet); box-shadow: none; }
.ar-stat.ar-stat-hint dd { font-size: 1.15rem; font-weight: 600; color: var(--muted); }
.ar-stat-hint .ys-link { margin-top: 4px; padding-left: 0; }
.ar-note { margin-top: 18px; text-align: center; color: var(--muted); font-size: .95rem; }
.ar-note[hidden] { display: none; }
.ar-stat-sub { font-family: var(--font-sans); font-size: .85rem; font-weight: 500; color: var(--muted); }

.ar-card {
  margin-top: 20px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ar-cols, .ar-row {
  display: grid;
  grid-template-columns: 3.5rem 5rem minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  padding: 0 64px 0 16px; /* room for the replay icon */
}
.ar-cols {
  height: 40px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ar-cols span:nth-child(3), .ar-score { text-align: right; }

.ar-list { margin: 0; padding: 0; list-style: none; }
.ar-list li { position: relative; }
.ar-list li + li { margin-top: 1px; border-top: 1px solid var(--line); }
.ar-row {
  min-height: 56px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: background-color .2s var(--ease);
}
.ar-row:hover { background: var(--quiet); }
.ar-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.ar-row.is-today { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.ar-row.is-today:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.ar-list li:has(+ li .ar-row.is-today), .ar-list li:has(.ar-row.is-today) + li { border-top-color: transparent; }

.ar-replay {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background-color .2s var(--ease);
}
.ar-replay:hover { background: var(--quiet); }
.ar-replay.is-play { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.ar-replay.is-play:hover { background: var(--accent); filter: brightness(1.08); }
.ar-replay.is-play svg { fill: currentColor; stroke: none; margin-left: 2px; }
.ar-replay:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ar-replay svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ar-no, .ar-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ar-score { font-size: .9rem; line-height: 1.25; }
.ar-no { font-size: 1.05rem; letter-spacing: -0.01em; }
.ar-date { font-weight: 500; font-variant-numeric: tabular-nums; }
.ar-score.is-lost { color: var(--error); }

@media (min-width: 561px) {
  .ar-stat dd { font-size: 1.9rem; }
  .ar-stat-sub { font-size: 1rem; }
}
@media (max-width: 560px) {
  .ar-stats { gap: 8px; }
  .ar-stat { padding: 12px; }
  .ar-stat-sub { display: block; }
  .ar-dot { display: none; }
  .ar-card { padding: 4px; }
  .ar-cols, .ar-row { grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: 6px; padding: 0 54px 0 10px; }
  .ar-cols span:nth-child(3) { display: none; }
  .ar-row { min-height: 72px; grid-template-rows: auto auto; padding-block: 9px; }
  .ar-no { grid-row: 1 / 3; align-self: center; }
  .ar-score { grid-column: 2; text-align: left; font-size: .84rem; }
  .ar-replay { right: 8px; }
}

/* ---------- mobile guess dock ---------- */

@media (max-width: 640px) {
  body:has(.ys.has-input) .site-footer { display: none; }
  .ys.has-input { padding-bottom: calc(var(--ys-dock-height, 112px) + 12px); }
  .ys-form {
    position: fixed;
    z-index: 45;
    inset-inline: 0;
    bottom: 0;
    gap: 8px 10px;
    margin: 0;
    padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -12px 36px -28px rgba(0, 0, 0, .4);
  }
  .ys-hint, .ys-error { padding-left: 8px; }
  .ys-clue { scroll-margin-top: 84px; scroll-margin-bottom: calc(168px + env(safe-area-inset-bottom)); }
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .ys-card { padding: 16px; margin-top: 20px; }
  .ys-clue { flex-direction: column; gap: 2px; padding: 10px 14px; }
  .ys-k { width: auto; }
  .ys-btn { padding: 0 22px; }
  .ys-input { padding: 0 18px; }
  .ys-modal { padding: 22px; }
  .ys-stats dd { font-size: 1.75rem; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes ys-win-pop {
    0% { transform: scale(.82); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
  }
  @keyframes ys-confetti-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(0); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--turn)); }
  }
  @keyframes ys-rise {
    from { opacity: .75; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes ys-shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
  }
  .ys-board > .is-new { animation: ys-rise .4s var(--ease) backwards; }
  .ys-board > .is-new + .is-new { animation-delay: 80ms; }
  .ys-guess.is-win.is-new .ys-chip { animation: pop .5s var(--ease) 120ms backwards; }
  .ys-result:not([hidden]) { animation: settle .26s var(--ease) backwards; }
  .ys-result.is-won.is-celebrating .ys-result-year { animation: ys-win-pop .65s var(--ease); }
  .ys-result.is-lost.is-celebrating .ys-result-year { animation: ys-shake .45s var(--ease); }
  .ys-result.is-celebrating .ys-confetti i { animation: ys-confetti-burst .95s ease-out var(--delay) both; }
  .ys-input.is-shake { animation: ys-shake .3s var(--ease); }
  .ys-modal[open] { animation: ys-rise .25s var(--ease); }
}
