/* Jigsaw-specific styles. Theme, cards, timer and buttons come from the Quiz assets. */

.card.wide { max-width: 1080px; }
.card.wide-pick { max-width: 900px; text-align: center; }
.card.wide-pick .eyebrow { color: var(--red-600); font-weight: 700; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; }
.pick-title { font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 800; color: var(--red-800); line-height: 1.15; margin: .3rem 0 .4rem; }
.wide-pick .lead { color: var(--ink-2); max-width: 46ch; margin: 0 auto 1.6rem; }
.pick-foot { margin-top: 1.6rem; display: flex; justify-content: center; }

/* ---------- Right-hand logo: Together We Rise on the start card, Talvey on every screen after it ---------- */
.site-header .logo-talvey { display: none; height: clamp(44px, 5.6vw, 76px); }
body[data-screen="preview"] .site-header .logo-twr,
body[data-screen="play"] .site-header .logo-twr,
body[data-screen="result"] .site-header .logo-twr { display: none; }
body[data-screen="preview"] .site-header .logo-talvey,
body[data-screen="play"] .site-header .logo-talvey,
body[data-screen="result"] .site-header .logo-talvey { display: block; }
/* Talvey is shorter than the other logo: keep the header the same height so nothing moves between screens */
.site-header { min-height: calc(clamp(76px, 9.5vw, 132px) + 14px); } /* + the header's top padding */
@media (max-width: 760px) { .site-header { min-height: calc(clamp(76px, 9.5vw, 132px) + 10px); } }

/* ---------- Start screen ---------- */
/* The start screen is one picture (assets/jigsaw-start.jpg: logo, card, puzzle pieces, texts). It replaces the page background
   and fills the screen; only the Play button is added on top, right under the text "Puzzle".
   To change the picture, replace assets/jigsaw-start.jpg (keep it 16:9, and if the text moves, adjust --play-y below). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.site:not([data-screen="names"]):not([data-screen="preview"]):not([data-screen="play"]):not([data-screen="result"]) {
  background: #f3d7b8 url("jigsaw-start.jpg") center / cover no-repeat fixed;
}
body.site:not([data-screen="names"]):not([data-screen="preview"]):not([data-screen="play"]):not([data-screen="result"]) .site-header { display: none; }   /* the J&J logo is part of the picture */
.welcome {
  --iw: max(100vw, calc(100vh * 16 / 9));   /* size of the picture on screen (it is scaled to cover the window) */
  --play-y: .725;                            /* button centre: 72.5 % down the picture, just under "Puzzle" */
}
.welcome .error-text { position: fixed; left: 50vw; translate: -50% 0; top: calc(50vh + var(--iw) * 9 / 16 * (var(--play-y) - .5) + var(--iw) * .04); text-align: center; margin: 0; }
.btn-play {
  position: fixed; left: 50vw; top: calc(50vh + var(--iw) * 9 / 16 * (var(--play-y) - .5));
  translate: -50% -50%;   /* centring uses the separate "translate" property, so the shared .btn hover/press transform cannot knock it out of place */
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; overflow: hidden;
  height: calc(var(--iw) * .053); min-height: 40px; padding: 0 calc(var(--iw) * .077); font-size: max(calc(var(--iw) * .024), 20px); letter-spacing: .03em; white-space: nowrap;
  background: linear-gradient(180deg, #c8171f, #8a0c13); box-shadow: inset 0 0 0 2px #e0b04a, 0 6px 14px rgba(138, 12, 19, .4);
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.btn-play:hover:not(:disabled) { filter: brightness(1.1); }
.btn-play .tri { font-size: 1.2em; }
.btn-play::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)); transform: skewX(-20deg); animation: shine 3.4s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes pulse-glow { 0%, 100% { box-shadow: inset 0 0 0 2px #e0b04a, 0 6px 14px rgba(138, 12, 19, .4), 0 0 0 0 rgba(224, 176, 74, .6); } 50% { box-shadow: inset 0 0 0 2px #e0b04a, 0 6px 14px rgba(138, 12, 19, .4), 0 0 0 14px rgba(224, 176, 74, 0); } }
/* Tall (portrait) screens: show the whole picture across the width instead of cropping it, with Play as a normal-size button below it */
@media (max-aspect-ratio: 1/1) {
  body.site:not([data-screen="names"]):not([data-screen="preview"]):not([data-screen="play"]):not([data-screen="result"]) { background-size: 100% auto; background-position: center; background-color: #8a5a2a; }
  .welcome { --iw: 100vw; }
  .btn-play { top: calc(50vh + 100vw * 9 / 32 + 50px); height: 52px; padding: 0 2.2rem; font-size: 1.5rem; }
  .welcome .error-text { top: calc(50vh + 100vw * 9 / 32 + 100px); }
}
@media (prefers-reduced-motion: reduce) { .btn-play, .btn-play::after { animation: none; } }

.btn-big { font-size: 1.15rem; padding: 1rem 2.4rem; }   /* the Continue button on the preview */

/* ---------- Name screen: the whole window, no logos (same look as the Chess name screen) ---------- */
body[data-screen="names"] .site-header { display: none; }
body[data-screen="names"] .stage { padding: 0; place-items: stretch; }
.card.names { text-align: center; }
.card.names .eyebrow { color: var(--red-600); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.card.names h2 { font-weight: 800; color: var(--red-800); }
.card.names form { display: grid; }
.card.names .field label { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink-2); }
body[data-screen="names"] .card.names {
  max-width: none; width: 100%; min-height: 100vh; border-radius: 0; overflow: hidden; animation: none;
  display: grid; align-content: center; justify-items: center; padding: 4vh 6vw;
  background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 241, 228, .78));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
body[data-screen="names"] .card.names::before { height: 10px; }
body[data-screen="names"] .card.names > * { width: min(100%, 920px); }
body[data-screen="names"] .names .eyebrow { font-size: clamp(.9rem, 2.2vh, 1.2rem); }
body[data-screen="names"] .names h2 { font-size: clamp(2.2rem, 7vh, 4rem); margin: .3rem 0 clamp(1rem, 3.6vh, 2.4rem); }
body[data-screen="names"] .names form { gap: clamp(.9rem, 2.6vh, 1.7rem); }
body[data-screen="names"] .names .field { gap: clamp(.4rem, 1vh, .7rem); }
body[data-screen="names"] .names .field label { font-size: clamp(1.15rem, 3vh, 1.7rem); }
body[data-screen="names"] .names .input { font-size: clamp(1.3rem, 3.6vh, 2rem); padding: clamp(.9rem, 2.2vh, 1.4rem) 1.5rem; border-radius: 20px; }
body[data-screen="names"] .names .error-text { font-size: clamp(.9rem, 2.2vh, 1.15rem); min-height: 1.2em; }
body[data-screen="names"] .names .btn-block { font-size: clamp(1.25rem, 3.4vh, 1.8rem); padding: clamp(.9rem, 2.2vh, 1.4rem) 1.5rem; }
body[data-screen="names"] .names .btn-ghost { font-size: clamp(1.1rem, 2.8vh, 1.5rem); padding: clamp(.75rem, 1.8vh, 1.1rem) 1.5rem; }

/* ---------- Preview (shown before the clock starts) ---------- */
.card.preview { max-width: 560px; text-align: center; }
.card.preview .eyebrow { color: var(--red-600); font-weight: 700; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; }
.card.preview h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 800; color: var(--red-800); line-height: 1.15; margin: .3rem 0 1.1rem; }
.pv-img {
  width: min(100%, 380px, calc(100vh - 500px)); min-width: 220px; aspect-ratio: 1; margin: 0 auto 1.1rem;
  background: #fff center / cover no-repeat; border-radius: 10px; /* the centre square: exactly what the puzzle uses */
  box-shadow: 0 0 0 4px var(--red-200), 0 12px 30px rgba(95, 7, 13, .22);
}
.card.preview .lead { color: var(--ink-2); max-width: 40ch; margin: 0 auto 1.4rem; }

/* ---------- Preview screen: the whole window, no logos ---------- */
body[data-screen="preview"] .site-header { display: none; }
body[data-screen="preview"] .stage { padding: 0; place-items: stretch; }
body[data-screen="preview"] .card.preview {
  max-width: none; width: 100%; min-height: 100vh; border-radius: 0; animation: none; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 243, 232, .86));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  padding: 3vh 4vw; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
body[data-screen="preview"] .card.preview::before { height: 10px; }
body[data-screen="preview"] .pv-copy { display: contents; }   /* tall windows: eyebrow, title, picture, text, button stacked */
body[data-screen="preview"] .pv-copy .eyebrow { order: 1; font-size: 1rem; }
body[data-screen="preview"] .pv-copy h2 { order: 2; font-size: clamp(1.8rem, 4.6vh, 3rem); margin: .3rem 0 1rem; }
body[data-screen="preview"] .pv-img { order: 3; width: min(88vw, calc(100vh - 430px)); min-width: 220px; margin: 0 0 1.2rem; }
body[data-screen="preview"] .pv-copy .lead { order: 4; font-size: 1.15rem; max-width: 34ch; margin: 0 auto 1.4rem; }
body[data-screen="preview"] .pv-copy .btn { order: 5; font-size: 1.3rem; padding: 1.05rem 3rem; }
/* Wide windows: picture on the left, text and Continue on the right */
@media (min-aspect-ratio: 3/2) {
  body[data-screen="preview"] .card.preview { display: grid; grid-template-columns: auto minmax(0, 560px); justify-content: center; align-content: center; column-gap: clamp(32px, 6vw, 130px); }
  body[data-screen="preview"] .pv-img { order: 0; width: min(calc(100vh - 110px), 48vw); margin: 0; }
  body[data-screen="preview"] .pv-copy { display: block; text-align: left; }
  body[data-screen="preview"] .pv-copy .eyebrow { font-size: clamp(.95rem, 2.2vh, 1.3rem); }
  body[data-screen="preview"] .pv-copy h2 { font-size: clamp(2.2rem, 7vh, 4.4rem); margin: .4rem 0 1.4rem; }
  body[data-screen="preview"] .pv-copy .lead { font-size: clamp(1.15rem, 2.8vh, 1.7rem); max-width: none; margin: 0 0 clamp(1.4rem, 4vh, 2.6rem); }
  body[data-screen="preview"] .pv-copy .btn { font-size: clamp(1.3rem, 3.2vh, 1.9rem); padding: clamp(1rem, 2.2vh, 1.5rem) clamp(2.6rem, 4vw, 4.4rem); }
}

/* ---------- Picture picker (no longer used: the server picks the picture) ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; justify-content: center; }
.type-card {
  display: grid; gap: .6rem; padding: .65rem; text-align: center; cursor: pointer;
  border: 2px solid var(--line); border-radius: 18px; background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.type-card:hover { border-color: var(--red-500); box-shadow: 0 10px 26px rgba(176, 17, 25, .18); transform: translateY(-2px); }
.type-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: block; }
.type-card .t-name { font-weight: 700; color: var(--red-800); }
.type-card .t-go { font-size: .8rem; color: var(--ink-3); }
.type-grid:has(.type-card:only-child) { grid-template-columns: minmax(190px, 260px); }

/* ---------- Level steps (1 · 2 · 3) ---------- */
.level-steps { display: flex; align-items: center; justify-content: center; gap: .4rem; flex-wrap: wrap; margin: 0 auto 1.4rem; }
.lv-step { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); color: var(--ink-3); text-align: left; }
.lv-step b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-size: .85rem; color: var(--ink-3); }
.lv-step > span { display: grid; line-height: 1.15; font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.lv-step small { font-weight: 500; font-size: .7rem; color: var(--ink-3); }
.lv-step.now { border-color: var(--red-500); background: var(--red-50); }
.lv-step.now b { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.lv-step.done b { background: var(--green); border-color: var(--green); color: #fff; }
.lv-step.missed b { background: var(--red-100); border-color: var(--red-200); color: var(--red-700); }
.lv-sep { width: 18px; height: 2px; background: var(--line); border-radius: 2px; }

/* ---------- Puzzle ---------- */
.p-stat { margin-left: auto; margin-right: .4rem; text-align: right; font-size: .85rem; color: var(--ink-3); white-space: nowrap; }
.p-stat b { font-size: 1.5rem; color: var(--red-700); font-variant-numeric: tabular-nums; }
.play-foot { margin-top: 1rem; flex-wrap: wrap; }
.play-foot .hint { display: block; flex: 1 1 260px; }
.play-btns { display: flex; gap: .6rem; }

.table-wrap-js { width: 100%; }
.table { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }

.board {
  position: absolute; background: #fff; border-radius: 4px;
  box-shadow: 0 0 0 3px var(--red-200), 0 8px 24px rgba(95, 7, 13, .14);
  z-index: 0;
}
.board .ghost { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .16; transition: opacity .25s; }
.board.noguide .ghost { opacity: 0; }
.board .lines { position: absolute; inset: 0; pointer-events: none; } /* the jigsaw cut lines, drawn by JS as an SVG */
.board .lines svg { display: block; width: 100%; height: 100%; }
.board .lines path { fill: none; stroke: rgba(210, 32, 42, .42); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.tray {
  position: absolute; border: 2px dashed var(--red-200); border-radius: 18px;
  background: repeating-linear-gradient(135deg, var(--cream) 0 12px, #fff1ee 12px 24px);
  z-index: 0;
}

.piece {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; will-change: transform;
  filter: drop-shadow(0 2px 3px rgba(60, 5, 9, .38));
}
.piece canvas { display: block; width: 100%; height: 100%; }
.piece.snap { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.piece.drag { filter: drop-shadow(0 12px 14px rgba(60, 5, 9, .45)); }
.piece.locked { filter: none; }

.peek-layer {
  position: absolute; z-index: 400; background: center / cover no-repeat; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .3s; box-shadow: 0 0 0 3px var(--gold); z-index: 100000;
}
.peek-layer.on { opacity: 1; }

/* ---------- Puzzle screen: the whole window (no logos) ---------- */
body[data-screen="play"] .site-header { display: none; }
body[data-screen="play"] .stage { padding: 0; place-items: stretch; }
body[data-screen="play"] .card.wide {
  max-width: none; width: 100%; min-height: 100vh; border-radius: 0; animation: none; overflow: hidden;
  padding: clamp(14px, 2.4vh, 26px) clamp(18px, 2.4vw, 44px) clamp(14px, 2.4vh, 26px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 246, 238, .94));
}
body[data-screen="play"] .card.wide::before { height: 10px; }
body[data-screen="play"] .q-head { margin-bottom: .8rem; }
body[data-screen="play"] .q-count { font-size: clamp(1rem, 1.5vw, 1.4rem); }
body[data-screen="play"] .q-count b { font-size: clamp(1.3rem, 2vw, 2rem); }
body[data-screen="play"] .p-stat { font-size: clamp(.95rem, 1.2vw, 1.25rem); }
body[data-screen="play"] .p-stat b { font-size: clamp(1.7rem, 2.6vw, 2.6rem); }
body[data-screen="play"] .timer { width: clamp(64px, 6.5vw, 100px); height: clamp(64px, 6.5vw, 100px); }
body[data-screen="play"] .timer .secs { font-size: clamp(1.15rem, 2vw, 1.9rem); }
body[data-screen="play"] .progress { margin-bottom: 1rem; }
body[data-screen="play"] .table-wrap-js { flex: none; }
body[data-screen="play"] .play-foot { margin-top: 1rem; }
body[data-screen="play"] .play-foot .hint { font-size: clamp(.9rem, 1.1vw, 1.15rem); }
body[data-screen="play"] .play-btns .btn { font-size: clamp(1rem, 1.2vw, 1.25rem); padding: .75rem 1.6rem; }

/* ---------- Result screen: the whole window, no logos ---------- */
body[data-screen="result"] .site-header { display: none; }
body[data-screen="result"] .stage { padding: 0; place-items: stretch; }
body[data-screen="result"] .card.result {
  max-width: none; width: 100%; min-height: 100vh; border-radius: 0; animation: none; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 243, 232, .9));
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  padding: 4vh 6vw; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
body[data-screen="result"] .card.result::before { height: 10px; }
body[data-screen="result"] .result .badge { font-size: clamp(1rem, 2.4vh, 1.5rem); padding: .4rem 1.4rem; margin-bottom: clamp(.6rem, 2vh, 1.4rem); }
body[data-screen="result"] .result .stars { font-size: clamp(3rem, 10vh, 6rem); margin: .2rem 0 clamp(.4rem, 1.6vh, 1rem); }
body[data-screen="result"] .result h2 { font-size: clamp(2.4rem, 8vh, 5rem); }
body[data-screen="result"] .result .sub { font-size: clamp(1.15rem, 3vh, 1.9rem); margin: .5rem 0 clamp(1.4rem, 5vh, 3.4rem); }
body[data-screen="result"] .result .stats { width: min(100%, 1000px); gap: clamp(.8rem, 2vw, 1.6rem); margin-bottom: clamp(1.4rem, 5vh, 3.4rem); }
body[data-screen="result"] .result .stat { border-radius: 22px; padding: clamp(1rem, 3vh, 2rem) .6rem; }
body[data-screen="result"] .result .stat b { font-size: clamp(2rem, 6vh, 3.8rem); }
body[data-screen="result"] .result .stat span { font-size: clamp(.95rem, 2.2vh, 1.4rem); }
body[data-screen="result"] .result .actions { gap: 1.2rem; }
body[data-screen="result"] .result .actions .btn { font-size: clamp(1.2rem, 3vh, 1.8rem); padding: clamp(.9rem, 2.2vh, 1.4rem) clamp(2.4rem, 4vw, 4rem); }

/* ---------- Result ---------- */
/* ---------- Leaderboard (top 3 fastest players, on the result screen) ---------- */
.leaderboard {
  width: min(100%, 600px); margin: 0 auto 1.4rem; text-align: left;
  background: rgba(255, 255, 255, .94); border: 2px solid #e6c066; border-radius: 26px;
  padding: clamp(1rem, 2.6vh, 1.7rem) clamp(1rem, 2vw, 1.8rem); box-shadow: 0 14px 34px rgba(95, 30, 0, .16);
}
.leaderboard[hidden] { display: none; }
.leaderboard h3 { text-align: center; font-weight: 800; color: var(--red-800); margin: 0 0 clamp(.7rem, 1.8vh, 1.1rem); font-size: clamp(1.3rem, 3.4vh, 2.1rem); }
.leaderboard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(.45rem, 1.2vh, .8rem); }
.leaderboard li {
  display: grid; grid-template-columns: 2.3em minmax(0, 1fr) auto; align-items: center; gap: .8rem;
  padding: clamp(.6rem, 1.6vh, 1rem) 1rem; border-radius: 18px; background: var(--cream); border: 1px solid var(--line);
  font-size: clamp(1.05rem, 2.7vh, 1.65rem);
}
.leaderboard li:nth-child(1) { background: linear-gradient(90deg, #fff3cf, #fffaf0); border-color: #efd27d; }
.leaderboard li:nth-child(2) { background: linear-gradient(90deg, #eef1f5, #fafbfc); border-color: #d5dae2; }
.leaderboard li:nth-child(3) { background: linear-gradient(90deg, #fbe6d3, #fff7f0); border-color: #ecc7a4; }
.leaderboard li.me { box-shadow: 0 0 0 3px #1ABEB7; }
.leaderboard li.lb-gap { display: block; background: none; border: 0; padding: 0; text-align: center; color: var(--ink-3); line-height: .6; box-shadow: none; }
.lb-rank { font-size: 1.4em; text-align: center; font-weight: 800; color: var(--red-800); line-height: 1; }
.lb-name { font-weight: 700; color: var(--red-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font-style: normal; font-size: .6em; font-weight: 700; background: #1ABEB7; color: #04312f; padding: .12rem .6rem; border-radius: 99px; margin-left: .5rem; vertical-align: middle; }
.lb-time { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-note { text-align: center; color: var(--ink-3); margin: .8rem 0 0; font-size: clamp(.9rem, 2.2vh, 1.2rem); }
.lb-note:empty { display: none; }

/* Wide windows: the result on the left, the leaderboard on the right */
@media (min-aspect-ratio: 3/2) {
  body[data-screen="result"] .card.result { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: clamp(24px, 4vw, 80px); align-content: center; justify-items: center; }
  body[data-screen="result"] .result > :not(.leaderboard):not(.actions) { grid-column: 1; }
  body[data-screen="result"] .result .leaderboard { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0; width: 100%; }
  body[data-screen="result"] .result .actions { grid-column: 1 / -1; }
  body[data-screen="result"] .result h2 { font-size: clamp(2.2rem, 7vh, 4.4rem); }
  body[data-screen="result"] .result .stats { width: 100%; }
}

.ask { color: var(--ink-2); max-width: 46ch; margin: 0 auto 1.4rem; font-weight: 500; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.card.final { max-width: 760px; }
.r-table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.r-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.r-table th { background: var(--cream); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: .65rem .8rem; text-align: left; white-space: nowrap; }
.r-table td { padding: .65rem .8rem; border-top: 1px solid var(--line); vertical-align: middle; }
.r-table .num, .r-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-table small { display: block; color: var(--ink-3); font-size: .74rem; }
.r-table tfoot td { background: var(--cream); border-top: 2px solid var(--red-200); color: var(--red-800); }
.r-table tr.skipped td { color: var(--ink-3); }
.r-table .pill { display: inline-block; white-space: nowrap; padding: .12rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.r-table .pill.pass { background: var(--green-bg); color: var(--green); }
.r-table .pill.fail { background: var(--red-100); color: var(--red-700); }
.stars-cell { white-space: nowrap; color: var(--red-100); letter-spacing: .05em; }
.stars-cell .on { color: var(--gold-600); }
.stars { font-size: 2.4rem; letter-spacing: .15em; color: var(--red-100); line-height: 1; margin: .3rem 0 .6rem; }
.stars .on { color: var(--gold); text-shadow: 0 2px 8px rgba(217, 148, 18, .45); }
.badge.time { background: #fff7e0; color: #8a5a00; }

@media (max-width: 700px) {
  .p-stat { display: none; }
  .play-btns { width: 100%; }
  .play-btns .btn { flex: 1; }
  .stats.four { grid-template-columns: repeat(2, 1fr); }
  .lv-sep { display: none; }
  .r-table { font-size: .8rem; }
  .r-table td, .r-table th { padding: .55rem .4rem; }
  .r-table th { font-size: .62rem; letter-spacing: .02em; }
  .stars-cell { letter-spacing: 0; }
  .level-steps { gap: .5rem; }
}
