

:root {
  --ink: #16182f;
  --paper: #fdfcf7;
  --brand: #070a1f;        
  --go: #2f7d4f;
  --quiet: #e4e7f5;
  --warn: #b4561c;
  --line: #c4c9e4;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--brand);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#app { max-width: 1200px; margin: 0 auto; padding: 16px; }


body[data-screen="s-pad"] #pwa-update-bar,
body[data-screen="s-how"] #pwa-update-bar,
body[data-screen="s-board"] #pwa-update-bar,
body[data-screen="s-launch"] #pwa-update-bar {
  bottom: auto !important;
  top: calc(14px + env(safe-area-inset-top, 0px)) !important;
}


body[data-screen="s-pad"] #app,
body[data-screen="s-how"] #app,
body[data-screen="s-board"] #app,
body[data-screen="s-launch"] #app {
  padding-top: calc(16px + var(--pwa-bar-h, 0px));
}


.screen { display: none; }
.screen.is-on { display: block; }

.title { color: var(--paper); font-size: clamp(28px, 5vw, 46px); margin: 8px 0 2px; }
.sub { color: #9aa6d8; margin: 0 0 18px; font-size: clamp(15px, 2.4vw, 19px); }
.hint { color: #5a6080; font-size: 15px; margin: 6px 0; }

.card { background: var(--paper); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card h2 { margin: 0 0 4px; font-size: 19px; }

.btn {
  display: block; width: 100%; min-height: 56px; padding: 14px 18px;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 650; font-size: 18px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-go { background: var(--go); color: #fff; margin-top: 10px; }
.btn-quiet { background: var(--quiet); color: var(--ink); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.choice {
  flex: 1 1 200px; min-height: 52px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
  font: inherit; cursor: pointer;
}
.choice[aria-pressed="true"] { border-color: var(--go); background: #e9f2ec; font-weight: 650; }

.players { display: grid; gap: 8px; margin: 10px 0; }
.player-row { display: flex; gap: 8px; align-items: center; }
.player-row input {
  flex: 1 1 auto; min-height: 48px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 10px; font: inherit;
}
.player-row .drop {
  flex: 0 0 auto; width: 48px; height: 48px; border: 0; border-radius: 10px;
  background: var(--quiet); font-size: 20px; line-height: 1; cursor: pointer;
}
.msg { min-height: 22px; margin: 6px 0 0; font-size: 15px; color: var(--warn); font-weight: 600; }



















.how { background: var(--paper); border-radius: var(--radius); padding: 12px 16px; margin-top: 14px; }
.how summary { font-weight: 650; cursor: pointer; min-height: 32px; }






@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


.btn-teach {
  background: #ffd37a; color: #3a2a06; margin: 0 0 16px;
  font-weight: 750; min-height: 62px; font-size: 19px;
}

.mt { margin-top: 14px; }


.demo-card { min-height: 280px; }
.demo-text { font-size: clamp(17px, 2.6vw, 22px); margin: 0 0 14px; }
.demo-show { display: grid; gap: 6px; }
.demo-letter {
  font-size: clamp(54px, 12vw, 96px); font-weight: 800; text-align: center;
  line-height: 1; color: var(--brand);
}
.demo-cat {
  text-align: center; font-size: clamp(18px, 3vw, 26px); font-weight: 700;
  background: var(--quiet); border-radius: 10px; padding: 10px;
}
.demo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: var(--quiet);
  font-size: clamp(16px, 2.4vw, 20px);
}
.demo-row span { min-width: 3.5em; color: #65596e; }
.demo-row b { flex: 1 1 auto; }
.demo-row em { font-style: normal; font-weight: 800; color: var(--go); }

.demo-row.struck b { text-decoration: line-through; color: #8d8398; }
.demo-row.struck em { color: #b4561c; }


.round-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.round-label { color: #9aa6d8; margin: 0; font-size: clamp(15px, 2.2vw, 19px); font-weight: 600; }
.clock {
  color: var(--paper); margin: 0; font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 3.6vw, 32px);
}
.clock.warn { color: #ffd37a; }
.clock.out  { color: #ff9b7a; }
.letter-lead { color: #9aa6d8; text-align: center; margin: 10px 0 0; font-size: 16px; }

.the-letter {
  color: var(--paper); text-align: center; font-weight: 800; line-height: 1;
  font-size: clamp(90px, 22vw, 190px); margin: 0 0 10px;
}
.cats { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: c; }
.cats li {
  background: var(--paper); border-radius: var(--radius); padding: 12px 14px 12px 48px;
  font-size: clamp(17px, 2.8vw, 24px); font-weight: 650; position: relative;
}
.cats li::before {
  counter-increment: c; content: counter(c);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--quiet); color: #65596e;
  font-size: 14px; font-weight: 800; display: grid; place-items: center;
}


.score-cat {
  color: var(--paper); font-weight: 800; margin: 4px 0 10px;
  font-size: clamp(24px, 5vw, 44px); line-height: 1.15;
}

.rule-restated {
  background: #ffd37a; color: #3a2a06; border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 14px; font-size: clamp(15px, 2.2vw, 18px);
}
.ticks { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 60px; padding: 10px 14px; border: 3px solid var(--line);
  border-radius: var(--radius); background: var(--paper);
  font: inherit; font-size: 18px; font-weight: 650; cursor: pointer; text-align: left;
}
.tick .tick-mark { color: transparent; font-size: 22px; font-weight: 900; }
.tick.on { border-color: var(--go); background: #e9f2ec; }
.tick.on .tick-mark { color: var(--go); }


.totals { display: grid; gap: 8px; margin: 10px 0 16px; }
.total-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border-radius: var(--radius); padding: 12px 16px;
  font-size: clamp(17px, 2.6vw, 22px);
}
.total-row.leading { outline: 3px solid #ffd37a; }
.total-name { flex: 1 1 auto; font-weight: 700; }
.total-got { color: var(--go); font-weight: 700; }
.total-score { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }


.flypast[hidden] { display: none !important; }
.flypast { margin: 0 0 18px; }
.flypast-head {
  color: #9aa6d8; margin: 0 0 2px; font-size: clamp(15px, 2.2vw, 18px); text-align: center;
}

.flypast-round {
  color: var(--paper); margin: 0 0 8px; text-align: center; font-weight: 700;
  font-size: clamp(16px, 2.4vw, 20px); min-height: 1.4em;
}
.fly-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.fly-cell { position: relative; }
.fly-cell canvas {
  display: block; width: 100%; height: min(30vh, 260px);
  border-radius: var(--radius); background: #070a1f;
}
.fly-name {
  position: absolute; left: 8px; right: 8px; bottom: 6px;
  display: flex; align-items: baseline; gap: 6px;
  font-size: clamp(13px, 2vw, 16px); font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.fly-name .fly-who { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fly-name .fly-n { font-weight: 800; font-variant-numeric: tabular-nums; }
.fly-cell.fly-best canvas { outline: 3px solid #ffd37a; }


@media (min-width: 700px) {
  .fly-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 820px) {
  .ticks { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}


.best-note { color: #9aa6d8; margin: 4px 0 0; font-size: 16px; min-height: 1.4em; }


.board-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.whose { color: var(--paper); font-weight: 800; margin: 0; font-size: clamp(22px, 4vw, 38px); }
.count { color: #9aa6d8; margin: 0; font-size: clamp(14px, 2.2vw, 18px); }


.gauge {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: #121735; border-radius: var(--radius); padding: 10px 14px; margin: 10px 0;
}
.gauge-label { color: #7f8ab8; font-size: 14px; }
.gauge-now {
  color: var(--paper); font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 5vw, 44px); line-height: 1;
}
.gauge-target { color: #9aa6d8; font-size: 15px; margin-left: auto; }
.gauge-target b { color: var(--paper); }
.board-hint { color: #9aa6d8; margin: 0 0 10px; font-size: 15px; min-height: 1.4em; }

.buckets {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.bucket {
  background: var(--paper); border-radius: var(--radius); padding: 8px;
  border: 3px solid transparent; text-align: center; position: relative;
}
.bucket.picked { border-color: #ffd37a; }
.bucket-num {
  display: block; width: 100%; min-height: 56px; border: 0; border-radius: 10px;
  background: var(--quiet); color: var(--ink);
  font: inherit; font-size: clamp(22px, 4vw, 30px); font-weight: 800; cursor: pointer;
}
.bucket-info { margin-top: 6px; font-size: 14px; min-height: 1.5em; }
.bucket-info .unknown { color: #9096b8; font-weight: 800; font-size: 18px; }
.bucket-info .gave { color: #3a4170; font-variant-numeric: tabular-nums; }
.bucket-info .gave b { font-size: 16px; }
.bucket-info .rule { color: var(--go); font-weight: 700; }
.bucket-peek {
  margin-top: 4px; border: 0; border-radius: 8px; padding: 4px 10px; min-height: 32px;
  background: #ffd37a; color: #3a2a06; font: inherit; font-weight: 700; cursor: pointer;
}
.buckets.revealed .bucket-num { cursor: default; }

.btn-launch { min-height: 76px; font-size: 24px; }



.sky {
  display: block; width: 100%; height: min(62vh, 620px);
  border-radius: var(--radius); background: #070a1f;
}
.launch-result {
  color: var(--paper); text-align: center; margin: 12px 0 0;
  font-size: clamp(19px, 3.4vw, 28px); font-weight: 700; min-height: 2.6em;
}
.launch-result .blurb {
  display: block; color: #9aa6d8; font-weight: 400; font-size: clamp(15px, 2.2vw, 18px);
  margin-top: 4px;
}


.name-memory { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.name-memory .btn { flex: 1 1 auto; min-width: 8rem; min-height: 44px; }



@media (hover: hover) and (pointer: fine) {

    
    button,
    select,
    summary,
    [role="button"] {
        transition: filter 0.12s ease;
    }

    button:not(:disabled):hover,
    select:not(:disabled):hover,
    summary:hover,
    [role="button"]:not([aria-disabled="true"]):hover {
        filter: brightness(1.25);
        cursor: pointer;
    }

    
    button:not(:disabled):active,
    select:not(:disabled):active,
    [role="button"]:not([aria-disabled="true"]):active {
        filter: brightness(0.95);
    }
}

