/* Crew Combos. Matchbox-label print: flat inks slightly off register, a striped stall awning,
   Rockwell lettering and a humanist small print whose numerals stay readable. System fonts only. */

:root {
  --night: #1b1f73;
  --cobalt: #2a36b1;
  --ink: #1a1040;
  --paper: #fff4d6;
  --gold: #ffb81f;
  --tomato: #ff6f61;
  --mint: #63d8b4;
  --lilac: #c3a6ff;
  --bad: #ffd4cf;
  --display: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", Georgia, serif;
  --body: Seravek, "Avenir Next", "Segoe UI", Roboto, Calibri, "Trebuchet MS", sans-serif;
  --gutter: 16px;
  --stripe: 32px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--night);
  color: var(--paper);
  font: 400 1.0625rem/1.4 var(--body);
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.55rem, 5vw, 2.25rem); }
h3 { font-size: 1.15rem; }
h1, h2, h3, .pitch, .foot-note { text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[tabindex="-1"]:focus { outline: none; }

/* The stall awning runs across the top of every screen. */
.awning {
  height: 34px;
  background: repeating-linear-gradient(90deg, var(--tomato) 0 var(--stripe), var(--paper) var(--stripe) calc(var(--stripe) * 2));
  position: relative;
  border-bottom: 3px solid var(--ink);
}
.awning::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 16px;
  margin-top: 3px;
  background:
    radial-gradient(circle at 16px 0, var(--tomato) 15px, var(--ink) 15px 18px, transparent 18px) 0 0 / 64px 18px repeat-x,
    radial-gradient(circle at 48px 0, var(--paper) 15px, var(--ink) 15px 18px, transparent 18px) 0 0 / 64px 18px repeat-x;
  pointer-events: none;
  z-index: 1;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px var(--gutter) 40px;
}

/* Controls */
.btn {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: var(--gold);
  color: var(--ink);
  font: 700 1.05rem/1.1 var(--display);
  padding: 14px 18px 11px;
  min-height: 46px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.btn:hover { background: #ffc94f; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-quiet { background: var(--paper); }
.btn-quiet:hover { background: #fff; }
.btn-small { gap: 4px; font-size: .92rem; padding: 9px 7px 6px; min-height: 40px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.btn-big { font-size: 1.28rem; padding: 18px 28px 14px; min-height: 58px; }
.btn[disabled], .btn[aria-disabled="true"] { background: #b9b4c9; color: #3d3460; cursor: not-allowed; box-shadow: none; }
.btn[aria-pressed="true"] { background: var(--mint); }

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--ink);
  border-radius: 6px;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.tok { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.tok-shopper { height: 1.45em; }

/* Top bar during a run */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px var(--gutter) 0;
}
.bar[hidden] { display: none; }
.bar-score { flex: 1 1 220px; min-width: 0; }
.bar-score p { font-family: var(--display); font-size: 1rem; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.meter { position: relative; height: 16px; background: var(--ink); border: 2px solid var(--ink); border-radius: 3px; margin-top: 4px; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--gold); display: block; transition: width .3s; }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--paper); }
.bar-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.short-label { display: none; }
@media (max-width: 560px) {
  .long-label { display: none; }
  .short-label { display: inline; }
  .bar-tools { flex: 1 1 100%; }
  .bar-tools .btn { flex: 1; }
}

/* Start */
.start { display: grid; gap: 22px; justify-items: center; text-align: center; padding-top: 32px; }
.title {
  font-size: clamp(3.3rem, 15vw, 8.4rem);
  line-height: .9;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--tomato), 6px 6px 0 var(--ink);
}
.pitch { font-size: 1.22rem; max-width: 36em; }
.parade { display: flex; justify-content: center; align-items: flex-end; gap: clamp(0px, 1.4vw, 16px); width: min(760px, 100%); }
.parade .figure { flex: 1 1 0; max-width: 136px; animation: walk-in .55s cubic-bezier(.2, 1.3, .5, 1) backwards; }
.parade .figure:nth-child(2) { animation-delay: .08s; }
.parade .figure:nth-child(3) { animation-delay: .16s; }
.parade .figure:nth-child(4) { animation-delay: .24s; }
.parade .figure:nth-child(5) { animation-delay: .32s; }
@keyframes walk-in { from { transform: translateY(60px); opacity: 0; } }
.counter-top { width: min(800px, 100%); height: 16px; background: var(--paper); border: 3px solid var(--ink); margin-top: -26px; position: relative; box-shadow: 0 6px 0 var(--ink); }
.goal { font: 700 1.3rem/1.2 var(--display); color: var(--ink); background: var(--mint); border: 3px solid var(--ink); padding: 10px 18px; transform: rotate(-1.2deg); box-shadow: 3px 3px 0 var(--ink); }
.foot-note { font-size: .98rem; max-width: 34em; }
.start .row { justify-content: center; }

/* Screen heading */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 20px; margin-bottom: 18px; }
.head p { max-width: 42em; }

/* Role cards */
.card {
  --tag: var(--gold);
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  background: var(--tag);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 9px;
  padding: 14px;
  text-align: left;
  font: inherit;
  box-shadow: 4px 4px 0 var(--ink);
}
button.card { cursor: pointer; }
button.card:hover { transform: translate(-1px, -2px); box-shadow: 6px 7px 0 var(--ink); }
button.card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tag-make { --tag: var(--gold); }
.tag-sell { --tag: var(--tomato); }
.tag-crowd { --tag: var(--mint); }
.tag-help { --tag: var(--lilac); }
.card .portrait { width: min(136px, 62%); justify-self: center; display: block; }
.card-name { font: 700 1.3rem/1.05 var(--display); }
.card-role { font-size: .95rem; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.card-text { font-size: 1.02rem; line-height: 1.28; }

.pack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 720px) {
  .pack { grid-template-columns: 1fr; gap: 12px; }
  .pack .card { grid-template-columns: 86px 1fr; column-gap: 12px; }
  .pack .card .portrait { width: 86px; grid-row: 1 / span 3; align-self: center; }
}

.roster { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.roster li { border: 2px dashed rgba(255, 244, 214, .55); border-radius: 8px; min-height: 92px; display: grid; place-items: center; text-align: center; font-size: .9rem; padding: 4px; }
.roster li.full { border: 3px solid var(--ink); background: var(--tag); color: var(--ink); font-weight: 600; line-height: 1.1; }
.roster .portrait { width: 100%; max-width: 74px; display: block; }

/* Forecast */
.forecast {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 9px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 6px 22px;
  margin-bottom: 18px;
}
.line { margin-top: 22px; }
.forecast strong { font-family: var(--display); font-size: 1.12rem; }
.shifts { display: flex; gap: 8px; align-self: center; }
.shifts li { flex: 1; text-align: center; border: 2px solid var(--ink); border-radius: 6px; padding: 4px 2px; background: #fff; font-size: .95rem; line-height: 1.15; }
.shifts li b { display: block; font: 700 1.3rem/1.1 var(--display); }
@media (max-width: 720px) { .forecast { grid-template-columns: 1fr; } }

/* The work line */
.line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; counter-reset: place; margin-bottom: 16px; }
.slot { position: relative; display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 0; }
.slot .card { height: 100%; padding: 10px; padding-top: 12px; }
.slot .card .portrait { width: min(100%, 88px); }
.place {
  position: absolute;
  z-index: 1;
  top: -9px;
  right: -5px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font: 700 1.15rem/1 var(--display);
  border-radius: 50%;
  border: 2px solid var(--paper);
  pointer-events: none;
}
.joint {
  position: absolute;
  z-index: 2;
  top: 74px;
  right: -17px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  font: 700 1.05rem/1 var(--display);
  pointer-events: none;
}
.slot.picked .card { outline: 4px dashed var(--paper); outline-offset: 3px; }
.slot.replacing .card { outline: 3px dashed var(--ink); outline-offset: -8px; }
.slot-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot-tools .train { grid-column: 1 / -1; }
.arrow-v { display: none; }
@media (max-width: 720px) {
  .line { grid-template-columns: 1fr; gap: 12px; }
  .slot { grid-template-rows: auto; grid-template-columns: minmax(0, 1fr) 96px; }
  .slot .card { grid-template-columns: 62px minmax(0, 1fr); column-gap: 10px; padding: 8px 10px; }
  .slot .card .portrait { width: 62px; grid-row: 1 / span 3; align-self: center; }
  .card-name { font-size: 1.15rem; }
  .card-text { font-size: .97rem; }
  .slot-tools { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(40px, auto); align-content: start; }
  .place { left: -6px; right: auto; top: -7px; width: 28px; height: 28px; font-size: 1rem; }
  .joint { top: auto; bottom: -18px; right: auto; left: 34px; }
  .arrow-h { display: none; }
  .arrow-v { display: inline; }
}

.order-notes {
  border: 2px solid var(--paper);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.order-notes h3 { margin-bottom: 4px; }
.order-notes li { padding-left: 1.1em; text-indent: -1.1em; line-height: 1.25; margin-bottom: 4px; }
.order-notes li::before { content: "+ "; font-weight: 700; color: var(--mint); }
.order-notes .warn li::before { content: "! "; color: var(--gold); }

.status { margin-bottom: 14px; font-weight: 600; }
.status:empty { display: none; }

/* Improve */
.market-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.purse { font: 700 1.3rem/1 var(--display); color: var(--gold); }
.market { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.offer { display: grid; grid-template-rows: 1fr auto; gap: 6px; }
.offer .card { padding: 10px; }
.offer .card .portrait { width: min(92px, 58%); }
@media (max-width: 720px) {
  .market { grid-template-columns: 1fr; }
  .offer { grid-template-rows: auto; grid-template-columns: minmax(0, 1fr) 96px; }
  .offer .card { grid-template-columns: 62px minmax(0, 1fr); column-gap: 10px; padding: 8px 10px; }
  .offer .card .portrait { width: 62px; grid-row: 1 / span 3; align-self: center; }
  .offer .btn { height: 100%; }
}

.go-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  margin-bottom: -14px;
  background: linear-gradient(transparent, var(--night) 28%);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  pointer-events: none;
}
.go-bar .btn { pointer-events: auto; }
.go-bar .btn-big { flex: 0 1 460px; }
@media (max-width: 720px) { .go-bar .btn-big { flex: 1 1 100%; } }

/* The market-day stage */
.stage {
  --sky: #ffc9d6;
  --ground: #f09a5d;
  position: relative;
  overflow: hidden;
  background: var(--sky);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: background-color .9s;
  color: var(--ink);
}
.stage.shift-1 { --sky: #93dcf5; --ground: #ffd26a; }
.stage.shift-2 { --sky: #55348f; --ground: #2a1d66; }
.sun {
  position: absolute;
  top: 34px;
  left: 6%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--gold);
  transition: left 1.1s ease-in-out, top 1.1s ease-in-out, background-color 1.1s;
}
.shift-1 .sun { left: 48%; top: 31px; }
.shift-2 .sun { left: 88%; top: 38px; background: var(--paper); }
.stage-awning {
  position: relative;
  height: 26px;
  border-bottom: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--gold) 0 24px, var(--paper) 24px 48px);
}
.lanterns { position: absolute; inset: 29px 0 auto; height: 30px; display: flex; justify-content: space-around; opacity: 0; transition: opacity 1s; }
.shift-2 .lanterns { opacity: 1; }
.lanterns i { display: block; width: 13px; height: 18px; border-radius: 5px; background: var(--gold); border: 2px solid var(--ink); box-shadow: 0 0 18px 6px rgba(255, 184, 31, .55); }
.staff {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 66px 6px 0;
}
.worker { position: relative; text-align: center; min-width: 0; }
.worker .portrait { width: min(100%, 118px); display: block; margin: 0 auto -2px; }
.worker.acting .portrait { animation: hop .4s cubic-bezier(.3, 1.6, .5, 1); }
.worker.acting .plate { background: var(--gold); }
.worker.idle .portrait { animation: shrug .4s ease-in-out; }
@keyframes hop { 40% { transform: translateY(-16px); } }
@keyframes shrug { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.plate b { font-family: var(--display); }
.plate {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
  margin: 0 2px;
  padding: 1px 2px;
  font: 700 .86rem/1.15 var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arc { position: absolute; left: 6px; right: 6px; top: 26px; height: 44px; width: calc(100% - 12px); pointer-events: none; overflow: visible; }
.arc path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.shift-2 .arc path { stroke: var(--paper); }
.floater {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font: 700 1rem/1 var(--display);
  padding: 3px 7px;
  white-space: nowrap;
  z-index: 2;
  animation: rise 1s ease-out forwards;
  pointer-events: none;
}
@keyframes rise { to { transform: translate(-50%, -46px); opacity: 0; } }
.board { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.pile { padding: 6px 10px; min-width: 0; min-height: 66px; }
.pile + .pile { border-left: 3px solid var(--ink); }
.pile h3 { font: 700 .98rem/1.1 var(--display); display: flex; justify-content: space-between; }
.pile h3 b { font-size: 1.2rem; }
.tokens { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 3px; font-size: 1rem; align-items: flex-end; }
.tokens em { font-style: normal; font-size: .9rem; font-weight: 700; margin-left: 4px; }
.ground { background: var(--ground); transition: background-color .9s; height: 14px; }
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; text-align: center; line-height: 1.15; }
.tally b { display: block; font: 700 1.7rem/1.05 var(--display); color: var(--gold); }
.tally .bad b { color: var(--bad); }
.ticker {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 9px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px;
  min-height: 108px;
  margin-bottom: 12px;
}
.ticker-main { font: 700 1.22rem/1.2 var(--display); }
.ticker-why { margin-top: 3px; }
.badge {
  display: inline-block;
  font: 700 .92rem/1.1 var(--body);
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 2px 7px;
  margin-top: 6px;
  transform: rotate(-1deg);
}
.badge.new { background: var(--gold); }
.run-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.run-tools .btn { flex: 1 1 90px; }
.run-tools .primary { flex: 2 1 160px; }
.log-box summary { cursor: pointer; font-weight: 600; padding: 8px 2px; }
.log { display: grid; gap: 6px; padding: 8px 0 0; }
.log li { border-left: 5px solid var(--paper); padding-left: 10px; line-height: 1.25; }
.log li small { display: block; font-size: .95rem; opacity: .9; }
.log .tone-make { border-color: var(--gold); }
.log .tone-sell { border-color: var(--tomato); }
.log .tone-crowd { border-color: var(--mint); }
.log .tone-help { border-color: var(--lilac); }
.log .tone-idle { border-color: #8f8bb3; }
.log .tone-bad { border-color: #fff; border-left-style: dotted; }
.log .tone-day { font-family: var(--display); font-weight: 700; margin-top: 6px; }

.run-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.log-pane { max-height: 520px; overflow-y: auto; padding: 2px 6px 2px 2px; }
@media (max-width: 860px) {
  .run-grid { grid-template-columns: 1fr; }
  .log-pane { max-height: 260px; }
  .staff { padding-top: 58px; }
  .sun { width: 26px; height: 26px; top: 32px; }
  .shift-1 .sun { top: 30px; }
  .shift-2 .sun { top: 34px; }
}

/* Reports */
.report-top { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; margin-bottom: 14px; }
.big-num { font: 700 clamp(3.4rem, 15vw, 5.6rem)/.9 var(--display); color: var(--gold); text-shadow: 3px 3px 0 var(--ink); }
.advice { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 9px; padding: 10px 14px; box-shadow: 4px 4px 0 var(--ink); margin-bottom: 18px; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; margin-bottom: 18px; }
.crew-table { width: 100%; border-collapse: collapse; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); }
.crew-table th, .crew-table td { padding: 6px 8px; border-bottom: 2px solid var(--ink); text-align: right; white-space: nowrap; }
.crew-table thead th { font-family: var(--display); font-size: .92rem; }
.crew-table th[scope="row"], .crew-table thead th:first-child { text-align: left; }
.crew-table th[scope="row"] { font-weight: 700; }
.crew-table th[scope="row"] span { display: flex; gap: 8px; align-items: center; }
.crew-table .portrait { width: 34px; flex: none; }
.crew-table tr:last-child td, .crew-table tr:last-child th { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--mint); color: var(--ink); border: 2px solid var(--ink); border-radius: 4px; padding: 3px 8px; font-weight: 600; line-height: 1.15; }
.chips li.new { background: var(--gold); }
.found { display: grid; gap: 6px; }
.found li { line-height: 1.25; border-left: 5px solid var(--mint); padding-left: 10px; }
.found li.seen { border-left-color: var(--paper); }
.found b { font-family: var(--display); }
.section { margin-bottom: 20px; }
.section h3 { margin-bottom: 8px; }

/* Result */
.result-top { display: grid; gap: 12px; justify-items: start; margin-bottom: 18px; }
.stamp {
  font: 700 clamp(2.5rem, 10vw, 5rem)/.96 var(--display);
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--tomato), 5px 5px 0 var(--ink);
}
.stamp.miss { color: var(--paper); text-shadow: 3px 3px 0 var(--cobalt), 5px 5px 0 var(--ink); }
.stars { display: flex; gap: 6px; }
.stars svg { width: 42px; height: 42px; }
.days { display: grid; gap: 8px; }
.days li { display: grid; grid-template-columns: minmax(0, 8.4em) minmax(0, 1fr) 2.6em; gap: 8px; align-items: center; line-height: 1.1; }
.days i { display: block; height: 20px; background: var(--gold); border: 2px solid var(--ink); min-width: 4px; }
.days b { font-family: var(--display); text-align: right; font-size: 1.15rem; }
.final-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.final-line li { background: var(--tag); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; padding: 6px; text-align: center; font-weight: 700; line-height: 1.1; font-size: .94rem; box-shadow: 3px 3px 0 var(--ink); }
.final-line .portrait { width: 100%; max-width: 90px; display: block; margin: 0 auto; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 8px 28px; }
.result-actions { margin-top: 8px; }
.result-actions .btn { flex: 1 1 180px; }

/* Dialogs */
.sheet {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 0;
}
.sheet::backdrop { background: rgba(26, 16, 64, .72); }
.sheet-small { padding: 18px; width: min(420px, calc(100vw - 24px)); }
.sheet-small p { margin: 8px 0 14px; }
.sheet-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--paper); border-bottom: 3px solid var(--ink); z-index: 1; }
.sheet-body { padding: 14px 16px 20px; display: grid; gap: 14px; }
.sheet ol.steps { list-style: decimal; padding-left: 1.4em; display: grid; gap: 6px; }
.keys { display: grid; gap: 4px; }
kbd { font: 700 .88rem var(--body); border: 2px solid var(--ink); border-radius: 4px; padding: 0 5px; background: #fff; }
.book { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.book li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 8px; align-items: center; background: var(--tag); border: 2px solid var(--ink); border-radius: 7px; padding: 6px 8px; line-height: 1.18; font-size: .95rem; }
.book .portrait { width: 52px; grid-row: 1 / span 2; }
.book b { font-family: var(--display); }

.paused-note { background: var(--gold); color: var(--ink); font-weight: 700; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 4px; margin-bottom: 10px; }
.noscript { padding: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .floater { display: none; }
  .btn:active, button.card:hover, button.card:active { transform: none; }
}

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

/* Small action feedback; the board remains the focus. */
.badge small { display:block; font-size:12px; font-weight:normal; margin-top:4px; }
@media(prefers-reduced-motion:no-preference) { .badge.new { animation: combo-press .4s ease-out; } @keyframes combo-press { from { opacity:.3; transform:rotate(-4deg) scale(1.08); } to { opacity:1; transform:none; } } }
