@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

/* Colours sampled from the game: the title plate's walnut, the paper cards, the felt tray, the lacquered frame */
:root {
  --walnut: #6B4A36;      /* title plate + icon */
  --walnut-dark: #3A2A20; /* title plate shadow */
  --night: #241A14;
  --cream: #FFF3D6;       /* title plate letters */
  --paper: #F9EEDD;       /* in-game paper cards */
  --paper-edge: #E2CFAF;
  --page: #F3E6CC;
  --pip: #2B2522;         /* dice pips */
  --die: #F6EFE1;
  --felt: #3F6A34;        /* dice tray felt */
  --felt-dark: #2A4A24;
  --cherry: #8A331B;      /* lacquered board frame */
  --red: #C23A2B;         /* FOR SALE bar */
  --lawn: #A8C25E;
  --road: #8E8A84;
  --gold: #F2B640;
  --muted: #6E5A4A;
  --sans: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --round: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--walnut-dark);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cherry); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid #F28C28; outline-offset: 3px; } /* the game's orange focus ring */

.skip { position: absolute; left: -999px; top: 0; background: var(--walnut-dark); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: max(18px, env(safe-area-inset-left)); }
.narrow { max-width: 780px; }
section { padding-block: clamp(3rem, 7vw, 5.5rem); }

h1, h2, h3 { font-family: var(--round); font-weight: 600; line-height: 1.15; margin: 0 0 .75rem; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
.kicker {
  font-family: var(--round); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cherry); margin-bottom: .5rem;
}
.kicker.light { color: var(--gold); }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.3rem); }
.sub { color: var(--muted); }

/* paper card: the game's menus are cream paper with a thin brown edge */
.card {
  background: var(--paper); border: 2px solid var(--paper-edge); border-radius: 14px;
  padding: clamp(1.4rem, 4vw, 2.4rem); box-shadow: 0 2px 0 var(--paper-edge), 0 18px 34px rgba(58,42,32,.16);
}

/* ---------- status pill (like the game's PLAY button) ---------- */
.status {
  display: inline-block; margin: 0; background: var(--cream); color: var(--walnut-dark);
  font-family: var(--round); font-weight: 600; font-size: 1.05rem; letter-spacing: .02em;
  padding: .7rem 1.5rem; border-radius: 12px; border: 3px solid #F28C28;
  box-shadow: 0 0 0 3px var(--walnut), 0 10px 22px rgba(0,0,0,.35);
}

/* ---------- hero: the table ---------- */
.hero {
  position: relative; display: grid; place-items: center; overflow: hidden; background: var(--walnut-dark);
  min-height: 600px; /* px, not vh: tall windows must not stretch it */
}
.hero picture, .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg { object-fit: cover; object-position: 50% 55%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(36,26,20,.15) 0%, rgba(36,26,20,.55) 70%),
              linear-gradient(180deg, rgba(36,26,20,.35) 0%, rgba(36,26,20,0) 35%, rgba(36,26,20,.75) 100%);
}
.hero-inner { position: relative; z-index: 1; text-align: center; padding: calc(3rem + env(safe-area-inset-top)) 18px 3rem; }
.hero h1 { margin: 0 auto 1rem; max-width: 640px; }
.hero h1 img { width: 100%; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); }
.tagline {
  font-family: var(--round); font-weight: 500; color: var(--cream);
  font-size: clamp(1.2rem, 3vw, 1.75rem); text-shadow: 0 2px 8px rgba(0,0,0,.8); margin: 0 auto 1.5rem; max-width: 30ch;
  background: rgba(36,26,20,.62); border-radius: 14px; padding: .45rem 1.1rem;
}

/* ---------- pitch on a wooden table ---------- */
.pitch {
  background:
    repeating-linear-gradient(93deg, rgba(90,50,20,.07) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.05) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, #D49A5C, #B97A42);
}
.pitch .card { text-align: center; }

/* ---------- one lap: the road on the felt ---------- */
.lap { background: radial-gradient(ellipse at 50% 30%, var(--felt) 0%, var(--felt-dark) 100%); color: var(--cream); border-block: 10px solid var(--cherry); }
.lap h2 { color: #fff; }
.road {
  list-style: none; margin: 2rem 0 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem;
}
/* the road itself: grey asphalt with a dashed centre line behind the signs */
.road::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 1.15rem; height: 22px; border-radius: 11px;
  background: var(--road);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.road::after {
  content: ""; position: absolute; left: 5%; right: 5%; top: calc(1.15rem + 10px); height: 2px;
  background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 26px); opacity: .85;
}
.road li { position: relative; z-index: 1; text-align: center; }
.sign {
  display: inline-block; font-family: var(--round); font-weight: 600; font-size: 1rem;
  background: var(--paper); color: #2F5A2A; border: 2px solid #CBB894; border-radius: 6px;
  padding: .25rem .8rem; box-shadow: 0 4px 0 rgba(0,0,0,.25); white-space: nowrap;
}
.sign.gold { background: var(--gold); color: var(--walnut-dark); border-color: #C98E1E; }
.road p { margin: 1rem 0 0; font-size: 1rem; color: #E9F1DA; }
.road-note { margin: 2rem 0 0; text-align: center; font-family: var(--round); font-size: 1.2rem; color: var(--gold); }

/* ---------- dice (CSS pips on a 3x3 grid) ---------- */
.die {
  --s: 56px;
  width: var(--s); height: var(--s); display: inline-grid; flex: none;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr); grid-template-areas: "a b c" "d e f" "g h i";
  padding: calc(var(--s) * .16); background: var(--die); border-radius: calc(var(--s) * .22);
  box-shadow: inset 0 -4px 0 #D9CDB8, 0 4px 0 var(--walnut-dark), 0 8px 14px rgba(0,0,0,.25);
}
.die i { width: 72%; height: 72%; place-self: center; border-radius: 50%; background: var(--pip); }
.d1 i { grid-area: e; }
.d2 i:nth-child(1) { grid-area: a; } .d2 i:nth-child(2) { grid-area: i; }
.d3 i:nth-child(1) { grid-area: a; } .d3 i:nth-child(2) { grid-area: e; } .d3 i:nth-child(3) { grid-area: i; }
.d4 i:nth-child(1), .d5 i:nth-child(1), .d6 i:nth-child(1) { grid-area: a; }
.d4 i:nth-child(2), .d5 i:nth-child(2), .d6 i:nth-child(2) { grid-area: c; }
.d4 i:nth-child(3), .d5 i:nth-child(3), .d6 i:nth-child(3) { grid-area: g; }
.d4 i:nth-child(4), .d5 i:nth-child(4), .d6 i:nth-child(4) { grid-area: i; }
.d5 i:nth-child(5) { grid-area: e; }
.d6 i:nth-child(5) { grid-area: d; } .d6 i:nth-child(6) { grid-area: f; }
.die.d1 i { width: 82%; height: 82%; background: var(--red); }

/* ---------- six features ---------- */
.faces { background: var(--page); }
.feature-grid { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  background: var(--paper); border: 2px solid var(--paper-edge); border-radius: 14px; padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 2px 0 var(--paper-edge);
}
.feature .die { margin-bottom: 1rem; }
.feature:nth-child(even) .die { transform: rotate(-6deg); }
.feature:nth-child(3n) .die { transform: rotate(5deg); }
.feature p { font-size: 1rem; margin: 0; color: #4A3A2E; }

/* ---------- gallery on the lacquered frame ---------- */
.photos { background: linear-gradient(180deg, var(--walnut) 0%, var(--walnut-dark) 100%); color: var(--cream); }
.photos h2 { color: #fff; }
.gallery { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery li:first-child { grid-column: span 2; grid-row: span 2; }
.gallery a {
  display: block; border-radius: 10px; overflow: hidden; background: var(--night); aspect-ratio: 16 / 9;
  border: 4px solid var(--cherry); box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.04); }

/* ---------- three boards as FOR SALE cards ---------- */
.boards { background: var(--page); }
.board-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.plot { background: var(--paper); border: 2px solid var(--paper-edge); border-radius: 12px; overflow: hidden; padding: 0 1.3rem 1.2rem; box-shadow: 0 2px 0 var(--paper-edge); }
.plot-tag {
  margin: 0 -1.3rem 1rem; background: var(--red); color: #fff; text-align: center;
  font-family: var(--round); font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; padding: .4rem;
}
.plot:nth-child(2) .plot-tag { background: #4C7A3C; }
.plot:nth-child(3) .plot-tag { background: #3B5F8C; }
.plot h3 { font-size: 1.6rem; margin-bottom: .2rem; }
.plot-time { font-weight: 800; color: var(--cherry); margin-bottom: .5rem; }
.plot p:last-child { margin: 0; }

/* ---------- the numbers ---------- */
.tally { background: var(--walnut-dark); padding-block: 2.5rem; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats li {
  background: var(--die); border-radius: 14px; padding: .9rem 1rem; text-align: center;
  box-shadow: inset 0 -4px 0 #D9CDB8;
}
.stats b { display: block; font-family: var(--round); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--cherry); }
.stats span { display: block; font-size: .92rem; line-height: 1.3; margin-top: .35rem; color: #4A3A2E; }

/* ---------- play together + comfort ---------- */
.table-talk {
  background:
    repeating-linear-gradient(93deg, rgba(90,50,20,.07) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #CF955A, #B4763F);
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.two h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 1.9rem; margin-bottom: .55rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 1.05rem; height: 1.05rem; border-radius: 4px;
  background: var(--die); box-shadow: inset 0 0 0 2px var(--walnut);
}
.ticks li::after {
  content: ""; position: absolute; left: .37rem; top: calc(.32em + .37rem); width: .32rem; height: .32rem; border-radius: 50%; background: var(--pip);
}

/* ---------- last roll ---------- */
.last-roll { background: radial-gradient(ellipse at 50% 30%, var(--felt) 0%, var(--felt-dark) 100%); color: #fff; text-align: center; border-top: 10px solid var(--cherry); }
.dice-pair { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.die.big { --s: 72px; }
.die.tilt { transform: rotate(14deg) translateY(6px); }

/* ---------- footer ---------- */
.foot { background: var(--night); color: #E2D6C2; padding-block: 3rem calc(3rem + env(safe-area-inset-bottom)); font-size: 1rem; }
.foot a { color: #fff; }
.studio-logo { width: 240px; margin-bottom: 1rem; }
.studio { font-family: var(--round); font-size: 1.4rem; color: #fff; margin-bottom: .4rem; }
.foot details { border-top: 1px solid #4A3A2E; padding: .8rem 0; }
.foot details:first-of-type { margin-top: 1.2rem; }
.foot summary { cursor: pointer; font-weight: 800; color: #fff; }
.foot details p { margin: .7rem 0 0; color: #D3C5AE; }
.fine { font-size: .875rem; color: #B3A38C; margin: 1rem 0 0; }

/* ---------- screenshot viewer ---------- */
dialog#viewer { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1600px); max-height: 92vh; overflow: visible; }
dialog#viewer::backdrop { background: rgba(20,14,10,.92); }
dialog#viewer img { max-height: 88vh; width: auto; border-radius: 8px; }
dialog#viewer .close {
  position: absolute; top: -18px; right: -12px; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--walnut); background: var(--cream); color: var(--walnut-dark); font-size: 1.8rem; line-height: 1; cursor: pointer; font-weight: 900;
}

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  /* the road turns and runs down the page */
  .road { grid-template-columns: 1fr; gap: 1.1rem; padding-left: 40px; }
  .road::before { left: 4px; right: auto; top: 0; bottom: 0; width: 18px; height: auto; }
  .road::after { left: calc(4px + 8px); right: auto; top: 6px; bottom: 6px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, #fff 0 12px, transparent 12px 22px); }
  .road li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .9rem; text-align: left; }
  .road .sign { min-width: 9.5rem; text-align: center; }
  .road p { margin: 0; }
}
@media (max-width: 700px) {
  body { font-size: 1.05rem; }
  .hero { min-height: 520px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery li:first-child { grid-column: span 2; grid-row: auto; }
  .gallery a { border-width: 3px; }
  .board-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats b { font-size: 1.9rem; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .road .sign { min-width: 8.2rem; font-size: .95rem; padding-inline: .5rem; }
  .status { font-size: .98rem; padding: .6rem 1.1rem; }
  .die.big { --s: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery img { transition: none; }
  .gallery a:hover img, .gallery a:focus-visible img { transform: none; }
}

/* ---------- 404 ---------- */
.p404 { background: var(--felt-dark); }
.page404 { min-height: max(640px, 100vh); display: grid; align-items: center; }
