/* =========================================================
   Red Bird — stylesheet
   Palette: crimson + vermilion on warm cream, ink outlines.
   Type: condensed display face over the system UI stack.
   ========================================================= */

:root {
  --ink:      #140f0e;
  --ink-soft: #3b2b26;
  --muted:    #7c675c;
  --cream:    #f7edde;
  --cream-2:  #fbf6ec;
  --paper:    #ede0cb;
  --red:      #d92b1f;
  --red-deep: #a4160f;
  --vermil:   #ef5a2a;
  --amber:    #f0a830;
  --green:    #2f7d5c;

  --display: "Haettenschweiler", "Arial Narrow Bold", "Franklin Gothic Heavy",
             "Impact", "Liberation Sans Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --edge: 3px solid var(--ink);
  --hard: 6px 6px 0 var(--ink);
  --hard-sm: 4px 4px 0 var(--ink);
  --gut: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  background-image:
    repeating-linear-gradient(0deg, rgba(20,15,14,.028) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .012em;
  line-height: .95;
  text-transform: uppercase;
  margin: 0;
}

p { margin: 0 0 1rem; }
a { color: var(--red-deep); }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--cream); padding: .7rem 1.1rem;
  font-weight: 700; text-decoration: none;
}
.skip:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid var(--vermil); outline-offset: 3px; }

/* ---------------- masthead ---------------- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem var(--gut);
  background: var(--ink);
  border-bottom: 3px solid var(--red);
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__mark { width: 42px; height: 35px; overflow: visible; flex: none; }
.brand__word {
  font-family: var(--display); font-size: 1.75rem; text-transform: uppercase;
  color: var(--cream); letter-spacing: .02em; line-height: 1;
}
.brand__word em { font-style: normal; color: var(--vermil); }

.nav {
  display: flex; gap: .15rem; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #d9c9b6; text-decoration: none; white-space: nowrap;
  font-size: .82rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; padding: .55rem .7rem; border-radius: 2px;
}
.nav a:hover { color: #fff; background: #2b1e1a; }
.nav a[aria-current="true"] { color: var(--ink); background: var(--amber); }

/* ---------------- play / hero ---------------- */

.play {
  padding: clamp(1.75rem, 4vw, 3.25rem) var(--gut) clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(120% 80% at 8% 0%, #ffe7c9 0%, rgba(255,231,201,0) 60%),
    linear-gradient(180deg, #f9f0e2 0%, var(--cream) 55%, var(--paper) 100%);
  border-bottom: var(--edge);
}

.kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--red-deep); margin: 0 0 .75rem;
}

.play__intro { max-width: 62ch; }
.play h1 { font-size: clamp(2.9rem, 9vw, 5.6rem); margin-bottom: 1.1rem; }
.ink-red { color: var(--red); }
.lede { font-size: 1.06rem; max-width: 58ch; color: var(--ink-soft); }
.lede--small { font-size: .95rem; color: var(--muted); }
.lede--small strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.stage {
  display: grid; gap: clamp(1.25rem, 3vw, 2.25rem);
  grid-template-columns: minmax(0, 480px) minmax(260px, 1fr);
  align-items: start; margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
@media (max-width: 860px) { .stage { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- cabinet ---------------- */

.cabinet {
  background: linear-gradient(175deg, #c72418 0%, #9e130c 100%);
  border: var(--edge); box-shadow: var(--hard);
  padding: .85rem .85rem .5rem;
  max-width: 480px; width: 100%;
}

.cabinet__bezel {
  background: #2b1a16; border: 3px solid #140f0e; padding: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.07);
}

.screen {
  position: relative; width: 100%; aspect-ratio: 480 / 720;
  background: #cfe4e6; overflow: hidden;
}

#game {
  display: block; width: 100%; height: 100%;
  touch-action: none; cursor: pointer;
}

.overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem 1.25rem;
  background: rgba(20,15,14,.62);
  color: var(--cream-2);
}
.overlay[hidden] { display: none; }
.overlay--quiet { background: rgba(20,15,14,.78); }

.overlay__eyebrow {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--amber); margin: 0 0 .4rem;
}
.overlay__title {
  font-size: clamp(2.4rem, 9vw, 3.4rem); color: #fff; margin: 0 0 .5rem;
  text-shadow: 4px 4px 0 var(--red-deep);
}
.overlay__title--score {
  font-size: clamp(4rem, 18vw, 6rem); font-variant-numeric: tabular-nums;
}
.overlay__text { font-size: .95rem; max-width: 30ch; color: #e7d8c6; margin-bottom: 1.1rem; }
.overlay__hint {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: #b7a595; margin: .85rem 0 0;
}

.medal {
  display: inline-flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.1); border: 2px solid var(--amber);
  padding: .35rem .8rem; margin: 0 0 1.1rem;
  font-weight: 700; font-size: .9rem; color: #fff;
}
.medal[hidden] { display: none; }

.medal__disc {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--amber); color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--mono); font-size: .78rem; font-weight: 700; flex: none;
}
.medal__disc--bronze { background: #c98a4b; }
.medal__disc--silver { background: #cbcbcb; }
.medal__disc--gold   { background: #f0c330; }
.medal__disc--ruby   { background: var(--red); color: #fff; }

/* buttons */

.btn {
  font-family: var(--display); font-size: 1.35rem; text-transform: uppercase;
  letter-spacing: .04em; line-height: 1;
  padding: .7rem 1.6rem; cursor: pointer;
  border: var(--edge); background: var(--amber); color: var(--ink);
  box-shadow: var(--hard-sm); transition: transform .06s, box-shadow .06s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn--ghost {
  background: transparent; color: var(--ink); font-size: .78rem;
  font-family: var(--body); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: .55rem 1rem; box-shadow: var(--hard-sm);
}
.btn--ghost:hover { background: var(--red); color: #fff; }

/* deck under the screen */

.cabinet__deck {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .7rem .15rem .35rem;
}

.key {
  font-family: var(--display); font-size: 1.1rem; letter-spacing: .12em;
  padding: .55rem 1.4rem; cursor: pointer;
  background: var(--cream); color: var(--ink);
  border: 3px solid #140f0e; border-radius: 999px;
  box-shadow: 0 4px 0 #6b0d08;
}
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b0d08; }

.deck__meta { display: flex; flex-direction: column; line-height: 1.15; color: #ffd9c9; }
.deck__label {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; opacity: .72;
}
.deck__meta strong { font-size: .9rem; color: #fff; }

.toggle {
  margin-left: auto; cursor: pointer;
  background: rgba(0,0,0,.24); color: #ffe6d8;
  border: 2px solid rgba(255,255,255,.35); border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: .4rem .8rem;
}
.toggle[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }

/* ---------------- sidebar / modes ---------------- */

.sidebar { max-width: 30rem; }
.sidebar__h { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: .4rem; }
.sidebar__note { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }

.modes { display: grid; gap: .6rem; }

.mode {
  display: grid; gap: .2rem; text-align: left; cursor: pointer;
  background: var(--cream-2); border: var(--edge); padding: .8rem .95rem;
  box-shadow: var(--hard-sm); font: inherit; color: var(--ink);
  transition: transform .07s, box-shadow .07s, background .12s;
}
.mode:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.mode__name {
  font-family: var(--display); font-size: 1.4rem; text-transform: uppercase; line-height: 1;
}
.mode__spec {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
}
.mode__blurb { font-size: .85rem; color: var(--ink-soft); line-height: 1.45; }

.mode[aria-pressed="true"] {
  background: var(--red); color: #fff;
  box-shadow: 4px 4px 0 var(--ink), inset 0 0 0 3px rgba(255,255,255,.18);
}
.mode[aria-pressed="true"] .mode__spec { color: #ffd9c9; }
.mode[aria-pressed="true"] .mode__blurb { color: #ffeade; }

.readout {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin: 1.1rem 0 0; border: var(--edge); background: var(--ink);
}
.readout > div { background: var(--cream-2); padding: .7rem .8rem; }
.readout > div + div { border-left: 3px solid var(--ink); }
.readout dt {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.readout dd {
  margin: .15rem 0 0; font-family: var(--display); font-size: 1.9rem;
  line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---------------- generic bands ---------------- */

.band { padding: clamp(2.5rem, 6vw, 4.75rem) var(--gut); border-bottom: var(--edge); }
.wrap { max-width: 68rem; margin: 0 auto; }
.wrap--narrow { max-width: 50rem; }
.band h2 { font-size: clamp(2rem, 5.2vw, 3.1rem); margin-bottom: 1rem; max-width: 22ch; }
.section-lede { max-width: 58ch; color: var(--ink-soft); }
.section-lede--fine { font-size: .88rem; color: var(--muted); }

.band--how { background: var(--cream-2); }
.band--birds { background: linear-gradient(180deg, #2a1a16 0%, #1a1210 100%); color: #efe2d2; }
.band--birds h2 { color: #fff; }
.band--birds .kicker { color: var(--amber); }
.band--birds .section-lede { color: #c9b6a5; }
.band--scores { background: var(--paper); }
.band--about { background: var(--cream-2); }

/* ---------------- how to play ---------------- */

.how {
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  margin-top: 2rem;
}
@media (max-width: 780px) { .how { grid-template-columns: 1fr; } }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 1.35rem; }
.steps li { counter-increment: s; position: relative; padding-left: 3.4rem; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: -.15rem;
  font-family: var(--display); font-size: 2.1rem; color: var(--red);
  line-height: 1;
}
.steps h3 { font-size: 1.35rem; margin-bottom: .3rem; }
.steps p { font-size: .95rem; color: var(--ink-soft); margin: 0; }

.keycard {
  background: var(--ink); color: var(--cream); padding: 1.35rem 1.4rem;
  border: var(--edge); box-shadow: var(--hard); align-self: start;
}
.keycard h3 { font-size: 1.5rem; color: #fff; margin-bottom: .85rem; }
.keys { width: 100%; border-collapse: collapse; font-size: .9rem; }
.keys th, .keys td { text-align: left; padding: .5rem 0; vertical-align: top; border-bottom: 1px solid #372823; }
.keys th { width: 40%; font-weight: 400; padding-right: .6rem; }
.keys td { color: #cbb9a8; }
.keycard__foot { font-size: .82rem; color: #a08e80; margin: .9rem 0 0; }

kbd {
  font-family: var(--mono); font-size: .74rem;
  background: var(--cream); color: var(--ink);
  border: 2px solid #000; border-bottom-width: 3px;
  padding: .1rem .38rem; border-radius: 3px; white-space: nowrap;
}
.band--about kbd { border-color: var(--ink); }

.medals { margin-top: clamp(2rem, 4vw, 3rem); border-top: var(--edge); padding-top: 1.5rem; }
.medals__h { font-size: 1.5rem; margin-bottom: 1rem; }
.medal-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.medal-list li {
  display: grid; grid-template-columns: 2.4rem 1fr; gap: .1rem .7rem;
  align-items: center; background: var(--cream); border: var(--edge);
  padding: .75rem .85rem; box-shadow: var(--hard-sm);
}
.medal-list .medal__disc { grid-row: span 2; align-self: center; }
.medal-list strong { font-size: .98rem; }
.medal-list span:last-child { font-size: .82rem; color: var(--muted); line-height: 1.4; }

/* ---------------- birds ---------------- */

.birdlist {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.birdcard {
  display: flex; flex-direction: column; gap: .5rem; text-align: left; width: 100%;
  background: #2f1e19; border: 3px solid #4a332b; color: #efe2d2;
  padding: 1rem; font: inherit; cursor: pointer; height: 100%;
  transition: transform .08s, border-color .12s, background .12s;
}
.birdcard:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--amber); }
.birdcard:disabled { cursor: not-allowed; opacity: .58; }

.birdcard__art {
  width: 100%; height: 96px; display: grid; place-items: center;
  background: radial-gradient(60% 70% at 50% 45%, #46302a 0%, #241715 100%);
  border: 2px solid #140f0e;
}
.birdcard__art svg { width: 96px; height: 78px; overflow: visible; }
.birdcard__name { font-family: var(--display); font-size: 1.4rem; text-transform: uppercase; line-height: 1; }
.birdcard__blurb { font-size: .84rem; color: #bda897; line-height: 1.45; margin: 0; }
.birdcard__state {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber); margin-top: auto;
}
.birdcard[aria-pressed="true"] { background: var(--red); border-color: var(--amber); }
.birdcard[aria-pressed="true"] .birdcard__blurb { color: #ffe0d3; }
.birdcard[aria-pressed="true"] .birdcard__state { color: #fff; }
.birdcard[aria-pressed="true"] .birdcard__art { background: radial-gradient(60% 70% at 50% 45%, #8d1109 0%, #5d0a05 100%); }

.birdlist__note { margin-top: 1.25rem; font-size: .88rem; color: #b7a394; }

/* ---------------- scores ---------------- */

.board {
  width: 100%; border-collapse: collapse; margin-top: 1.75rem;
  background: var(--cream-2); border: var(--edge); box-shadow: var(--hard);
  font-variant-numeric: tabular-nums;
}
.board th, .board td { padding: .6rem .8rem; text-align: left; font-size: .9rem; }
.board thead th {
  background: var(--ink); color: var(--cream);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
}
.board tbody tr { border-top: 2px solid #dccbb2; }
.board tbody tr:nth-child(-n+3) td:nth-child(2) { font-weight: 700; color: var(--red-deep); }
.board td:first-child { font-family: var(--display); font-size: 1.15rem; width: 3rem; }
.board__empty td { color: var(--muted); font-style: italic; text-align: center; padding: 1.6rem .8rem; }
.board__tag {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; background: var(--ink); color: var(--cream);
  padding: .1rem .35rem; margin-left: .35rem;
}
.board__tag--gale { background: var(--red); }
.board__tag--drift { background: var(--green); }

.board__actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: 1.1rem; }
.board__warn { font-size: .85rem; color: var(--red-deep); font-weight: 600; }

/* ---------------- faq ---------------- */

.faq { margin-top: 1.75rem; border-top: var(--edge); }
.faq details { border-bottom: var(--edge); background: var(--cream); }
.faq summary {
  cursor: pointer; list-style: none; padding: .95rem 2.6rem .95rem 1rem;
  font-family: var(--display); font-size: 1.25rem; text-transform: uppercase;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 1.4rem; color: var(--red); line-height: 1;
}
.faq details[open] summary { background: var(--ink); color: var(--cream); }
.faq details[open] summary::after { content: "\2212"; color: var(--amber); }
.faq summary:hover { background: var(--paper); }
.faq details[open] summary:hover { background: var(--ink); }
.faq__body { padding: .1rem 1rem 1rem; }
.faq__body p { margin: .8rem 0 0; font-size: .95rem; color: var(--ink-soft); max-width: 62ch; }
.faq code { font-family: var(--mono); font-size: .85em; background: var(--paper); padding: .05rem .3rem; }

.colophon { margin-top: 2.25rem; padding: 1.25rem 1.35rem; background: var(--paper); border-left: 8px solid var(--red); }
.colophon h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.colophon p { font-size: .92rem; color: var(--ink-soft); margin: 0; max-width: 62ch; }

/* ---------------- footer ---------------- */

.foot { background: var(--ink); color: #cbb9a8; text-align: center; padding: 2.5rem var(--gut) 3rem; }
.foot__bird { margin: 0 0 .6rem; }
.foot__line { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; color: var(--cream); margin: 0 0 .35rem; }
.foot__small { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #877567; margin: 0; }

/* ---------------- narrow screens ---------------- */

@media (max-width: 620px) {
  body { font-size: 16px; }
  .masthead { padding: .5rem .9rem; }
  .brand__word { font-size: 1.4rem; }
  .cabinet { padding: .55rem .55rem .35rem; box-shadow: 4px 4px 0 var(--ink); }
  .toggle { margin-left: 0; }
  .readout dd { font-size: 1.5rem; }
  .board th, .board td { padding: .5rem .45rem; font-size: .82rem; }
  .steps li { padding-left: 2.8rem; }
}
