/*
  ART DIRECTION: Sunday afternoon on the good sofa, with a bit of mischief from the nephew.

  Palette (hex, job, text contrast on its background):
  --cream   #FFF6E8  page background                  ink on cream 15:1
  --linen   #F6E3C6  hero and tinted sections          ink on linen 13:1
  --chocolate #3B2418 main text, dark buttons outline  cream on chocolate 13:1
  --tan     #C98B4B  decorative accent, shapes, tags   (never body text)
  --tan-deep #6E4522 link and label text on cream      7.9:1 on cream, 6.2:1 on gold
  --ball    #B8E33A  tennis-ball green, main buttons   chocolate on ball 9.7:1
  --night   #1E130E  footer and game frame             cream on night 17:1

  Type: Fraunces (characterful soft serif, headlines, very large) with Nunito
  (rounded, friendly sans, body). Sizes are fluid with clamp().

  Motifs: paw prints, a dog-tag pill for labels, and a scalloped edge between sections.
*/

:root {
  --cream: #FFF6E8;
  --linen: #F6E3C6;
  --chocolate: #3B2418;
  --tan: #C98B4B;
  --tan-deep: #6E4522;
  --tan-light: #F0C48A;
  --ball: #B8E33A;
  --ball-deep: #7FA41F;
  --night: #1E130E;
  --paper: #FFFBF3;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --shadow-soft: 0 18px 40px -18px rgba(59, 36, 24, 0.45);
  --shadow-lift: 0 26px 50px -22px rgba(30, 19, 14, 0.6);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 96px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  color: var(--chocolate);
  background: var(--cream);
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  margin: 0 0 var(--space-2);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.4rem);
}

h2 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);
}

h3 {
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.7rem);
}

p {
  margin: 0 0 var(--space-2);
  max-width: 62ch;
}

a {
  color: var(--tan-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--chocolate);
}

:focus-visible {
  outline: 3px solid var(--chocolate);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(1160px, 100% - 2 * clamp(20px, 5vw, 40px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--chocolate);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tan-deep);
  margin-bottom: var(--space-2);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tan-deep);
  margin: 0 0 var(--space-2);
}

/* Paw motif */
.paw {
  fill: currentColor;
}

/* Dog-tag pill for labels */
.tag {
  position: relative;
  display: inline-block;
  padding: 0.5em 1.2em 0.5em 2.2em;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--chocolate);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag::before {
  content: "";
  position: absolute;
  left: 0.8em;
  top: 50%;
  width: 0.6em;
  height: 0.6em;
  margin-top: -0.3em;
  border-radius: 50%;
  border: 2px solid var(--chocolate);
  background: var(--cream);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 52px;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 2px solid var(--chocolate);
  background: var(--ball);
  color: var(--chocolate);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--chocolate);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.btn:hover {
  color: var(--chocolate);
  background: #C9EE58;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--chocolate);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--chocolate);
}

.btn:focus-visible {
  outline: 3px solid var(--chocolate);
  outline-offset: 4px;
}

.btn-ghost {
  background: transparent;
  color: var(--chocolate);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--paper);
  box-shadow: none;
  transform: translateY(-2px);
}

.btn-ghost:active {
  transform: translateY(2px);
}

.btn-small {
  min-height: 44px;
  padding: 0.55em 1.1em;
  font-size: 0.95rem;
  box-shadow: 0 4px 0 var(--chocolate);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* Photo slots */
.photo {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--linen);
}

[data-photo-slot] > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-photo-slot] > img {
  transition: transform 0.6s ease;
}

.photo:hover > img {
  transform: scale(1.03);
}

/* Announcement bar */
.announce {
  background: var(--chocolate);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 700;
}

.announce-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding-block: 8px;
  text-align: center;
  flex-wrap: wrap;
}

.announce .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tan-light);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 2px solid var(--chocolate);
  transition: padding 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 14px;
  flex-wrap: wrap;
  transition: padding 0.25s ease;
}

.site-header.is-scrolled .header-inner {
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chocolate);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
}

.brand:hover {
  color: var(--chocolate);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  fill: var(--tan-deep);
  transition: transform 0.4s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-12deg);
}

.brand em {
  font-style: italic;
  font-weight: 500;
  color: var(--tan-deep);
}

.site-header.is-scrolled .brand {
  font-size: 1.2rem;
}

.site-header.is-scrolled .brand-mark {
  width: 32px;
  height: 32px;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav a:not(.btn) {
  color: var(--chocolate);
  font-weight: 800;
  text-decoration: none;
  padding-block: 6px;
  background: linear-gradient(var(--tan), var(--tan)) no-repeat 0 100% / 0 3px;
  transition: background-size 0.25s ease;
}

.nav a:not(.btn):hover,
.nav a[aria-current="page"] {
  background-size: 100% 3px;
  color: var(--chocolate);
}

/* Hero */
.hero {
  position: relative;
  background: var(--linen);
  padding-bottom: var(--space-6);
}

.hero-photo {
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: 16 / 10;
  max-height: 86vh;
  width: 100%;
  margin: 0;
}

.hero-photo > img {
  object-position: 30% center;
}

.hero-card {
  position: relative;
  z-index: 2;
  background: var(--cream);
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
  margin: -56px 20px 0;
  box-shadow: 8px 8px 0 var(--chocolate);
}

.hero-card .lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  margin-bottom: var(--space-3);
}

@media (min-width: 900px) {
  .hero-photo {
    aspect-ratio: 3 / 2;
    max-height: none;
  }

  .hero-card {
    position: absolute;
    top: clamp(24px, 6vw, 72px);
    right: clamp(24px, 5vw, 72px);
    width: min(460px, 42%);
    margin: 0;
  }
}

/* Scalloped edge: each section with class "scallop" bumps up into the section above.
   Set --c on the section to its background colour. */
.scallop {
  position: relative;
}

.scallop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -15px;
  height: 16px;
  background: radial-gradient(circle at 50% 100%, var(--c, var(--cream)) 14px, transparent 15px) 0 0 / 32px 16px repeat-x;
  pointer-events: none;
}

/* Sections */
.section {
  padding-block: clamp(56px, 8vw, 110px);
  position: relative;
  --c: var(--cream);
  background: var(--c);
}

.section--linen {
  --c: var(--linen);
}

.section--gold {
  --c: #F6D9A8;
}

.section--night {
  --c: var(--night);
  color: var(--cream);
}

.section--night h2 {
  color: var(--cream);
}

.section--night .kicker {
  color: var(--tan-light);
}

.split {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--reverse > :first-child {
    order: 2;
  }
}

.meet-photo,
.odie-photo {
  aspect-ratio: 1 / 1;
  border-radius: 48% 52% 46% 54% / 52% 44% 56% 48%;
  border: 3px solid var(--chocolate);
}

.meet-photo > img,
.odie-photo > img {
  padding: 8%;
  background: var(--paper);
}

.odie-photo {
  background: #F9E7C0;
}

.meet-photo {
  background: var(--paper);
}

/* Dog-tag card with facts */
.tag-card {
  position: relative;
  margin-top: var(--space-4);
  max-width: 560px;
  background: var(--paper);
  border: 3px solid var(--chocolate);
  border-radius: 28px;
  padding: var(--space-3);
  box-shadow: 8px 8px 0 var(--tan);
}

.tag-card::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  border: 3px solid var(--chocolate);
  background: var(--cream);
}

.tag-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  margin: var(--space-3) 0 0;
}

.tag-card dt {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--tan-deep);
  padding-top: 0.2em;
}

.tag-card dd {
  margin: 0;
  font-weight: 700;
}

.placeholder {
  background: #F9E7C0;
  border-radius: 6px;
  padding: 0 0.3em;
  color: var(--chocolate);
  font-weight: 800;
}

/* Crimes list */
.crimes {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
  display: grid;
  gap: 12px;
}

.crimes li {
  position: relative;
  padding: 14px 18px 14px 56px;
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 2px solid var(--chocolate);
  max-width: 60ch;
}

.crimes li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  background: var(--ball);
  border: 2px solid var(--chocolate);
  border-radius: 50%;
}

.crimes li::after {
  content: "!";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 26px;
  margin-top: -13px;
  line-height: 22px;
  text-align: center;
  font-weight: 900;
  color: var(--chocolate);
}

/* House rules */
.rules-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .rules-grid {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
  }

  .rules-head {
    position: sticky;
    top: 120px;
  }
}

.rules-list {
  list-style: none;
  counter-reset: rule;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.rules-list li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px 16px 16px;
  background: var(--paper);
  border: 2px solid var(--chocolate);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform 0.25s ease;
}

.rules-list li:hover {
  transform: translateX(6px);
}

.rules-list li::before {
  content: counter(rule);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ball);
  border: 2px solid var(--chocolate);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--chocolate);
}

.rules-list li {
  max-width: none;
}

/* Call to action band */
.cta-band {
  --c: var(--chocolate);
  background: var(--chocolate);
  color: var(--cream);
  padding-block: clamp(64px, 9vw, 120px);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -15px;
  height: 16px;
  background: radial-gradient(circle at 50% 100%, var(--chocolate) 14px, transparent 15px) 0 0 / 32px 16px repeat-x;
}

.cta-inner {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  position: relative;
  z-index: 1;
}

.cta-band h2 {
  color: var(--cream);
  max-width: 18ch;
}

.cta-band p {
  color: #F3E4CC;
  font-size: 1.1rem;
}

.cta-band .btn {
  font-size: 1.1rem;
  min-height: 60px;
  padding: 0.9em 1.9em;
  border-color: var(--cream);
  box-shadow: 0 5px 0 var(--tan);
}

.cta-band .btn:hover {
  box-shadow: 0 7px 0 var(--tan);
}

.cta-band .btn:active {
  box-shadow: 0 1px 0 var(--tan);
}

.cta-band::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tan) 0 35%, transparent 36%) 0 0 / 40px 40px;
  opacity: 0.25;
  pointer-events: none;
}

/* Footer */
.site-footer {
  background: var(--night);
  color: var(--cream);
  padding-top: var(--space-8);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23C98B4B' fill-opacity='0.08'%3E%3Cellipse cx='24' cy='50' rx='8' ry='7'/%3E%3Ccircle cx='14' cy='36' r='3.5'/%3E%3Ccircle cx='22' cy='30' r='3.5'/%3E%3Ccircle cx='31' cy='31' r='3.5'/%3E%3Ccircle cx='37' cy='40' r='3.5'/%3E%3Cellipse cx='62' cy='72' rx='8' ry='7'/%3E%3Ccircle cx='52' cy='58' r='3.5'/%3E%3Ccircle cx='60' cy='52' r='3.5'/%3E%3Ccircle cx='69' cy='53' r='3.5'/%3E%3Ccircle cx='75' cy='62' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.footer-grid {
  position: relative;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.site-footer .brand {
  color: var(--cream);
}

.site-footer .brand:hover {
  color: var(--cream);
}

.site-footer .brand-mark {
  fill: var(--tan-light);
}

.site-footer p {
  color: #EADCC4;
}

.foot-h {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tan-light);
  margin-bottom: var(--space-2);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: var(--tan-light);
}

.site-footer a:hover {
  color: var(--tan-light);
}

.foot-legal {
  position: relative;
  margin-top: var(--space-6);
  padding-block: var(--space-3);
  border-top: 1px solid rgba(255, 246, 232, 0.2);
  font-size: 0.9rem;
}

.foot-legal p {
  margin: 0;
  color: #CDBBA2;
}

/* Scroll reveal (only when JS is running) */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Small screens */
@media (max-width: 639px) {
  .header-inner {
    justify-content: center;
    gap: 10px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav ul {
    gap: 16px;
  }

  .nav .btn-small {
    padding-inline: 1em;
  }

  .announce-inner .optional {
    display: none;
  }

  .tag-card dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tag-card dd {
    margin-bottom: 10px;
  }
}

/* ---------- Rolo's story page ---------- */
.page-hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(32px, 4vw, 56px);
  background: var(--linen);
  --c: var(--linen);
}

.page-hero h1 {
  max-width: 14ch;
}

.page-hero p {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  max-width: 52ch;
}

.tree {
  display: grid;
  gap: 48px;
  max-width: 820px;
  margin: 0 auto;
}

.tree-row {
  display: grid;
  gap: 24px;
}

.node {
  position: relative;
  margin: 0;
  background: var(--paper);
  border: 3px solid var(--chocolate);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 6px 6px 0 var(--chocolate);
}

.node--honorary {
  background: #F9E7C0;
  box-shadow: 6px 6px 0 var(--tan);
}

.node-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--linen);
  border: 2px solid var(--chocolate);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.node img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--linen);
  border: 2px solid var(--chocolate);
  padding: 6px;
  margin-bottom: 12px;
}

.node-role {
  font-weight: 800;
  color: var(--tan-deep);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.node h3 {
  margin-bottom: 8px;
}

.node p:last-child {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .tree {
    gap: 72px;
  }

  .tree-row {
    grid-template-columns: 1fr 1fr;
    column-gap: 72px;
  }

  .node::before {
    content: "";
    position: absolute;
    background: var(--chocolate);
  }

  .node--mum::before {
    left: -72px;
    top: 50%;
    width: 72px;
    height: 3px;
    margin-top: -1.5px;
  }

  .node--odie::before,
  .node--honorary::before {
    left: 50%;
    top: -72px;
    width: 3px;
    height: 72px;
    margin-left: -1.5px;
  }

  .node--honorary::before {
    background: none;
    border-left: 3px dotted var(--chocolate);
    width: 0;
  }
}

.diary-grid {
  display: grid;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 900px) {
  .diary-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }

  .diary:nth-child(2) {
    margin-top: 56px;
  }
}

.diary {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--chocolate);
  border-radius: 8px 28px 8px 28px;
  padding: clamp(24px, 3vw, 32px);
  box-shadow: 8px 8px 0 var(--linen);
  transform: rotate(-0.6deg);
  transition: transform 0.3s ease;
}

.diary:nth-child(2n) {
  transform: rotate(0.7deg);
}

.diary:hover {
  transform: rotate(0deg) translateY(-4px);
}

.diary-date {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chocolate);
  background: var(--tan-light);
  border: 2px solid var(--chocolate);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.diary h3 {
  margin-bottom: 12px;
}

.diary p {
  font-size: 1.02rem;
}

/* ---------- Play page ---------- */
.play-layout {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

@media (min-width: 960px) {
  .play-layout {
    grid-template-columns: minmax(0, 420px) 1fr;
  }
}

.game {
  background: var(--night);
  color: var(--cream);
  border-radius: 32px;
  padding: 18px;
  border: 3px solid var(--tan-deep);
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.hud-stats {
  display: flex;
  gap: 20px;
}

.hud-stat span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tan-light);
}

.hud-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.hud-btn {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--cream);
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.hud-btn:hover {
  background: var(--cream);
  color: var(--night);
}

.hud-btn:active {
  transform: translateY(2px);
}

.hud-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hud-btn:disabled:hover {
  background: transparent;
  color: var(--cream);
}

.dignity {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dignity > span {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tan-light);
}

.meter {
  height: 18px;
  background: #3A2A20;
  border: 2px solid var(--cream);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ball);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.meter-fill.is-low {
  background: #F29E7A;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: #2A1A12;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(30, 19, 14, 0.9);
  color: var(--cream);
}

.overlay[hidden] {
  display: none;
}

.overlay h2 {
  color: var(--cream);
  font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem);
  margin: 0;
}

.overlay p {
  color: #F3E4CC;
  margin: 0;
  max-width: 28ch;
}

.overlay .btn {
  margin-top: 8px;
}

.overlay .score-line {
  font-weight: 800;
  color: var(--tan-light);
}

.pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.pad-btn {
  min-height: 64px;
  border-radius: 22px;
  border: 2px solid var(--cream);
  background: var(--tan-light);
  color: var(--chocolate);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 5px 0 #6B4A2B;
}

.pad-btn:active,
.pad-btn.is-held {
  background: var(--ball);
  transform: translateY(3px);
  box-shadow: 0 2px 0 #6B4A2B;
}

.pad-btn:focus-visible {
  outline-color: var(--cream);
}

.rules-card {
  background: var(--paper);
  border: 3px solid var(--chocolate);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 8px 8px 0 var(--tan);
}

.rules-card ul {
  padding-left: 1.2em;
  margin: 0;
}

.rules-card li {
  margin-bottom: 10px;
}

.note {
  font-size: 0.95rem;
  color: #5A4032;
}

.overlay .note-light {
  font-size: 0.95rem;
  color: var(--tan-light);
}

.node-role + h3 {
  margin-top: 0;
}

.section--cream {
  --c: var(--cream);
}

@media (max-width: 359px) {
  .hud-stat strong {
    font-size: 1.5rem;
  }
}

