/* Chill Domains — renewal-run.css
   The /renewal-run page ("Jack's Renewal Run"): the game stage, its HUD,
   the card that holds the title / pause / results screens, and the touch
   buttons. Pairs with /assets/js/renewal-run.js. */

/* the game sits straight under the breadcrumb; heading and intro follow it */
.rr-top { padding-block: clamp(1rem, 2.5vw, 1.75rem) clamp(2rem, 4vw, 3.5rem); }
.rr-top .crumb { max-width: 1100px; margin: 0 auto var(--space-3); }
.rr-intro { max-width: 760px; margin: var(--space-7) auto 0; text-align: center; }
.rr-intro h1 { margin-bottom: var(--space-4); }
.rr-lede { color: var(--text-muted); font-size: var(--fs-xl); }
@media (max-width: 640px) { .rr-lede { font-size: var(--fs-lg); } }
.rr-wrap { max-width: 1100px; margin-inline: auto; position: relative; }
.rr-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  background: #cfe3e6; border-radius: var(--radius-lg); color: var(--color-ink);
  box-shadow: 0 24px 60px -24px rgba(31, 41, 55, 0.5);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
@media (max-width: 640px) { .rr-stage { aspect-ratio: 4 / 5; } }
.rr-stage:focus { outline: none; }
.rr-stage:focus-visible { outline: 3px solid var(--color-coral); outline-offset: 3px; }
.rr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.rr-wrap:fullscreen { max-width: none; background: #1f2937; display: flex; align-items: center; }
.rr-wrap:fullscreen .rr-stage { aspect-ratio: auto; height: 100%; border-radius: 0; box-shadow: none; }
.rr-wrap.is-pseudo-fs { position: fixed; inset: 0; z-index: 9999; max-width: none; background: #1f2937; }
.rr-wrap.is-pseudo-fs .rr-stage { aspect-ratio: auto; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
html.rr-lock, html.rr-lock body { overflow: hidden; }

/* HUD */
.rr-hud {
  position: absolute; z-index: 5; inset: 0 0 auto 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; pointer-events: none; font: 700 0.8rem/1.2 var(--font-sans);
}
.rr-hud__stats { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; flex: 1; min-width: 0; }
.rr-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px;
  background: rgba(251, 247, 238, 0.88); border: 1px solid rgba(44, 56, 72, 0.15); white-space: nowrap;
}
.rr-chip b { font-variant-numeric: tabular-nums; }
.rr-chip--bill b { color: var(--color-danger); }
.rr-lives { display: inline-flex; gap: 3px; }
.rr-paw { width: 12px; height: 12px; border-radius: 50%; background: var(--color-coral-2); box-shadow: inset 0 0 0 2px rgba(44, 56, 72, 0.25); }
.rr-paw.is-gone { background: transparent; box-shadow: inset 0 0 0 2px rgba(44, 56, 72, 0.3); }
.rr-prog { position: relative; flex: 1 1 120px; max-width: 220px; height: 8px; border-radius: 99px; background: rgba(44, 56, 72, 0.18); overflow: hidden; }
.rr-prog span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-sage-2); border-radius: 99px; }
.rr-hud__btns { display: flex; gap: 6px; margin-left: auto; pointer-events: auto; }
/* over a card, only the Pause / Sound / Full screen buttons stay on top */
.rr-stage.has-panel .rr-hud__stats { visibility: hidden; }
.rr-icon {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid rgba(44, 56, 72, 0.15); border-radius: 50%; background: rgba(251, 247, 238, 0.88);
  color: var(--color-ink); cursor: pointer;
}
.rr-icon:hover { background: #fff; }
.rr-icon:focus-visible { outline: 3px solid var(--color-coral); outline-offset: 1px; }
.rr-icon:disabled { opacity: 0.45; cursor: default; }
@media (pointer: coarse) { .rr-icon { width: 44px; height: 44px; } }
.rr-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rr-icon .rr-i-play, .rr-icon.is-paused .rr-i-pause { display: none; }
.rr-icon.is-paused .rr-i-play { display: block; }
.rr-icon .rr-slash { display: none; }
.rr-icon[aria-pressed="false"] .rr-slash { display: block; }
.rr-icon .rr-i-shrink, .rr-icon.is-fs .rr-i-grow { display: none; }
.rr-icon.is-fs .rr-i-shrink { display: block; }
@media (max-width: 640px) {
  .rr-hud { align-items: flex-start; font-size: 0.74rem; }
  .rr-chip { padding: 4px 8px; }
  .rr-hide-sm { display: none; }
}

/* the card: title, pause, stage clear, game over, win */
.rr-panel {
  position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 56px 12px 12px; background: rgba(44, 56, 72, 0.3);
}
.rr-panel[hidden] { display: none; }
.rr-card {
  width: 100%; max-width: 560px; max-height: 100%; overflow: auto; overscroll-behavior: contain;
  background: var(--color-cream-3); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -20px rgba(31, 41, 55, 0.55); padding: clamp(16px, 3.5cqw, 28px);
  touch-action: pan-y; user-select: text; -webkit-user-select: text;
}
.rr-stage { container-type: inline-size; }
.rr-card h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 4.2cqw, 2.1rem); line-height: 1.1; margin: 0 0 0.5rem; }
.rr-card p { margin: 0 0 0.7rem; font-size: 0.95rem; }
.rr-kicker { font: 700 0.72rem/1.2 var(--font-sans) !important; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-sage-2); margin-bottom: 0.35rem !important; }
.rr-small, .rr-receipt__fine { color: var(--color-muted); font-size: 0.82rem !important; }
.rr-stats, .rr-best { font-size: 0.9rem !important; }
.rr-controls { margin: 0 0 0.8rem; padding-left: 1.1rem; font-size: 0.9rem; }
.rr-controls li { margin-bottom: 0.25rem; }
.rr-controls kbd, .rr-keys kbd {
  display: inline-block; min-width: 1.6em; padding: 0.05em 0.4em; border: 1px solid var(--color-line); border-bottom-width: 2px;
  border-radius: 5px; background: #fff; font: 700 0.8em/1.4 var(--font-sans); text-align: center;
}
/* the buttons stay in view at the bottom of the card when the results scroll */
.rr-btns {
  position: sticky; bottom: calc(-1 * clamp(16px, 3.5cqw, 28px)); z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0.9rem calc(-1 * clamp(16px, 3.5cqw, 28px)) calc(-1 * clamp(16px, 3.5cqw, 28px));
  padding: 10px clamp(16px, 3.5cqw, 28px) clamp(12px, 3cqw, 22px); background: var(--color-cream-3);
  border-top: 1px solid var(--color-line-2);
}
.rr-btns .btn { min-height: 44px; }

.rr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0.6rem 0 0.8rem; }
@container (max-width: 520px) { .rr-compare { grid-template-columns: 1fr; } }
.rr-receipt, .rr-chill { border-radius: var(--radius); padding: 12px 12px 6px; font-size: 0.84rem; }
.rr-compare .rr-receipt { margin: 0; }
.rr-receipt { background: #fff; border: 1px dashed rgba(44, 56, 72, 0.35); margin: 0.6rem 0 0.8rem; }
.rr-chill { background: rgba(143, 179, 154, 0.2); border: 1px solid var(--color-sage); }
.rr-receipt__h { font: 800 0.72rem/1.3 var(--font-sans) !important; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.4rem !important; }
.rr-receipt table, .rr-chill table { width: 100%; border-collapse: collapse; }
.rr-receipt td, .rr-chill td { padding: 3px 0; vertical-align: top; border-bottom: 1px dotted rgba(44, 56, 72, 0.2); }
.rr-receipt td:last-child, .rr-chill td:last-child { text-align: right; padding-left: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-receipt td span { color: var(--color-muted); }
.rr-receipt tr.is-base td { color: var(--color-ink-2); }
.rr-receipt tfoot td, .rr-chill tfoot td { font-weight: 800; border-bottom: 0; padding-top: 6px; }
.rr-receipt tfoot td:last-child { color: var(--color-danger); }
.rr-chill tfoot td:last-child { color: var(--color-success); }

/* touch buttons */
.rr-touch { display: none; }
@media (pointer: coarse) {
  .rr-touch { position: absolute; z-index: 3; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 10px; pointer-events: none; }
  .rr-stage.has-panel .rr-touch { display: none; }
  .rr-touch button {
    pointer-events: auto; min-width: 84px; min-height: 56px; padding: 0 18px; border-radius: 28px;
    border: 2px solid rgba(44, 56, 72, 0.3); background: rgba(251, 247, 238, 0.82); color: var(--color-ink);
    font: 800 0.95rem/1 var(--font-sans); touch-action: none; -webkit-touch-callout: none;
  }
  .rr-touch button:active { background: var(--color-coral); }
}

/* below the stage */
.rr-under { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: var(--space-4); }
.rr-keys { margin: 0; font-size: var(--fs-sm); color: var(--color-ink-2); }
.rr-note { max-width: 760px; margin: var(--space-5) auto 0; text-align: center; font-size: var(--fs-sm); color: var(--color-muted); }
.rr-tricks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-4); margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.rr-tricks li { background: var(--bg-card); border: 1px solid var(--color-line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.rr-tricks h3 { font-size: var(--fs-md, 1.05rem); margin: 0 0 var(--space-2); }
.rr-tricks p { margin: 0 0 var(--space-2); font-size: var(--fs-sm); }
.rr-tricks p:last-child { margin-bottom: 0; }
.rr-tricks .rr-us { color: var(--color-sage-2); font-weight: 700; }
.rr-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); margin-top: var(--space-8); }
.rr-related a {
  display: block; padding: var(--space-5); text-decoration: none; color: var(--color-ink);
  background: var(--bg-card); border: 1px solid var(--color-line); border-radius: var(--radius);
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.rr-related a:hover { box-shadow: var(--shadow); transform: translateY(-1px); color: var(--color-ink); }
.rr-related strong { display: block; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--space-1); }
.rr-related span { font-size: var(--fs-sm); color: var(--color-ink-2); }
