:root {
  color-scheme: light;
  --paper: #f8f2e2;
  --ink: #29271f;
  --quiet: #595449;
  --red: #a83525;
  --red-dark: #81271c;
  --rule: #b7ab94;
  --sage: #e8ead8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--sans); }
a { color: inherit; text-decoration: none; }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: clamp(2.25rem, 5vw, 4.55rem); line-height: 1.02; letter-spacing: -.052em; }
h3 { font-size: clamp(1.55rem, 2.7vw, 2.05rem); line-height: 1.14; letter-spacing: -.025em; }
img { display: block; width: 100%; height: auto; }

.wrap { width: min(100% - clamp(2rem, 9vw, 9rem), 78rem); margin-inline: auto; }
.skip { position: fixed; z-index: 5; inset: .5rem auto auto .5rem; padding: .7rem; translate: 0 -150%; color: white; background: var(--red-dark); }
.skip:focus { translate: 0; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5rem; }
.site-header { border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font: bold 1.31rem/1 var(--serif); white-space: nowrap; }
.die { position: relative; width: 1.25rem; height: 1.25rem; flex: none; rotate: -11deg; border-radius: .24rem; background: var(--red); }
.die::after { position: absolute; inset: 50% auto auto 50%; width: .18rem; height: .18rem; translate: -50% -50%; border-radius: 50%; background: var(--paper); box-shadow: -.26rem -.26rem var(--paper), .26rem .26rem var(--paper); content: ""; }
nav { display: flex; gap: clamp(.9rem, 3vw, 2.6rem); font-size: .95rem; }
nav a, .site-footer a { padding-block: .55rem; }
nav a:hover, .site-footer a:hover { color: var(--red); }

.hero { display: grid; grid-template-columns: 5fr 7fr; align-items: stretch; padding-block: clamp(1.7rem, 4vw, 3.65rem) clamp(3rem, 7vw, 6rem); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 1.1rem 1.6rem 1.75rem 0; }
.hero h1 { font-size: clamp(4.35rem, 9.7vw, 8.45rem); line-height: .82; letter-spacing: -.078em; }
.hero h1 em { color: var(--red); }
.hero h1 em span { font-style: normal; }
.hero p { max-width: 31ch; margin: 1.65rem 0 1.3rem; color: var(--quiet); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.hero-photo { min-width: 0; background: #dec39f; }
.hero-photo img { height: 100%; min-height: clamp(25rem, 39vw, 34.5rem); object-fit: cover; object-position: 50% 50%; }

.button { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: .35rem; padding: .62rem 1.02rem; border: 1px solid transparent; border-radius: .22rem; font-size: .92rem; font-weight: 640; transition: background .16s, color .16s, border-color .16s; }
.primary { color: #fffaf0; background: var(--red); }
.primary:hover { background: var(--red-dark); }
.secondary { border-color: #8c806d; background: transparent; }
.secondary:hover { border-color: var(--red); color: var(--red-dark); }
button:disabled { opacity: .55; cursor: default; }

.planner, .games { scroll-margin-top: 1.2rem; }
.planner { padding: clamp(1.45rem, 4vw, 3.4rem); background: var(--sage); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.05rem; }
.section-head p { max-width: 32ch; color: var(--quiet); }
.planner form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: clamp(.7rem, 2vw, 1.5rem); margin-top: 1.8rem; }
.planner label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 620; }
.planner select { width: 100%; min-height: 2.75rem; padding: .45rem .55rem; border: 1px solid #918976; border-radius: .2rem; background: #fbf9ef; font-weight: 400; }
.games { padding-block: clamp(3.2rem, 7vw, 6.25rem); }
.games-head { margin-bottom: 1.55rem; }
.games-head p { margin-top: .4rem; }
.game-actions, .timer-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.game-list { border-top: 1px solid var(--rule); }
.game-row { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 3fr) auto; align-items: center; gap: 1rem 1.65rem; padding: 1.08rem 0; border-bottom: 1px solid var(--rule); }
.category { margin-bottom: .2rem; color: var(--red-dark); font-size: .78rem; font-weight: 700; letter-spacing: .095em; text-transform: uppercase; }
.game-row .description { max-width: 52ch; color: var(--quiet); }
.game-row .metadata { margin-top: .25rem; color: var(--quiet); font-size: .84rem; }
.empty { padding-block: 1.1rem; color: var(--quiet); }
.site-footer { min-height: 5.5rem; border-top: 1px solid var(--rule); }

dialog { width: min(100% - 2rem, 39rem); max-height: 88dvh; padding: 0; border: 1px solid #8c806d; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(28, 25, 19, .67); }
.dialog-content { padding: clamp(1.25rem, 4vw, 2.5rem); }
.dialog-content form { display: flex; justify-content: flex-end; margin-bottom: .7rem; }
.dialog-content h2 { margin-block: .3rem .45rem; font-size: clamp(2rem, 6vw, 3.6rem); }
.dialog-meta { margin-bottom: 1rem; color: var(--quiet); }
.dialog-content ol { margin: .45rem 0 1.2rem; padding-inline-start: 1.3rem; }
.dialog-content li + li { margin-top: .35rem; }
.timer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .85rem; background: var(--sage); }
.timer-label { display: block; font-size: .85rem; }
#timer-readout { font-size: 1.65rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
#timer-status { flex-basis: 100%; color: var(--quiet); }
#timer-status:empty { display: none; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr 1.03fr; }
  .hero h1 { font-size: clamp(3.8rem, 11vw, 5.6rem); }
  .hero-photo img { min-height: 20rem; }
  .planner form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .site-header { align-items: flex-start; flex-direction: column; justify-content: center; gap: .2rem; padding-block: .75rem .35rem; }
  .hero { grid-template-columns: 1fr; padding-top: 1.6rem; }
  .hero-copy { padding: .15rem 0 1.45rem; }
  .hero h1 { font-size: clamp(4.35rem, 17vw, 5.95rem); }
  .hero p { margin: 1.1rem 0 .95rem; }
  .hero-photo img { min-height: 0; height: auto; aspect-ratio: 1.4; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .planner form { margin-top: 1rem; }
  .game-row { grid-template-columns: auto 1fr; gap: .45rem 1rem; }
  .game-row .name, .game-row .description { grid-column: 1 / -1; }
  .game-row > button { justify-self: start; }
}

@media (max-width: 350px) {
  .planner form { grid-template-columns: 1fr; }
}

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