/* FLORAL TRIBUTES styles. Code: 0BSD. */
@font-face { font-family: "IM Fell English SC"; src: url("../fonts/IMFeENsc28P.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root { --bg: #1f1520; --bg2: #2a1d2c; --paper: #f6efe0; --ink: #2a241d; --faint: #6f6352; --plum: #6c3f8e; --sage: #4f7d4a; --brass: #b8933f; --red: #a3231b; --top: 48px;
  --fell: "IM Fell English SC", Georgia, "Times New Roman", serif; --mono: "Courier Prime", ui-monospace, Menlo, Consolas, monospace; --fs: 16px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: #1f1520; }
body { background: radial-gradient(ellipse at 50% 0%, #3a2840, var(--bg) 70%) fixed; color: var(--paper); font: var(--fs)/1.45 var(--mono); -webkit-text-size-adjust: 100%; }
body.big { --fs: 19px; }
body.contrast { --paper: #ffffff; --ink: #000000; --faint: #333333; --bg: #000; }
button, input, select { font: inherit; }
a { color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 4px; background: var(--paper); color: var(--ink); padding: 6px 10px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #ffd36b; outline-offset: 2px; }
#main:focus { outline: none; }
[hidden] { display: none !important; }

.topbar { height: var(--top); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); background: #150e16; border-bottom: 2px solid #3d2a40; }
.logo { background: none; border: 0; color: var(--paper); font: 24px/1 var(--fell); cursor: pointer; padding: 4px 0; white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav button { background: none; border: 1px solid transparent; color: #d8cbb2; padding: 6px 9px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.nav button:hover, .nav button[aria-current="page"] { border-color: #5a4260; color: #fff; }
main { min-height: calc(100% - var(--top)); }
.screen { padding: 18px 14px 40px; max-width: 880px; margin: 0 auto; }
.card { color-scheme: light; background: var(--paper); color: var(--ink); border-radius: 4px; padding: 22px 22px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45); position: relative; }
.card a { color: var(--plum); }
.card h1, .card h2 { font-family: var(--fell); font-weight: 400; margin: 0 0 .4em; }
.card h1 { font-size: 2.1em; } .card h2 { font-size: 1.45em; margin-top: 1em; }
.intro { text-align: center; padding: 34px 22px 26px; border-top: 10px solid var(--plum); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--faint); margin: 0 0 10px; }
.title { font: 400 clamp(46px, 11vw, 84px)/1 var(--fell) !important; margin: 0 !important; }
.firm { font-family: var(--fell); font-size: 1.25em; color: var(--plum); margin: 8px 0 18px; }
.lede { max-width: 34em; margin: 0 auto 20px; }
.home-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.best { color: var(--faint); margin: 16px 0 0; }
.fine { font-size: .86em; color: #c9bba3; text-align: center; max-width: 40em; margin: 18px auto 0; }
.card .fine { color: var(--faint); text-align: left; margin: 8px 0; }
.btn { background: #ece2cc; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 9px 16px; cursor: pointer; font-weight: 700; box-shadow: 0 3px 0 var(--ink); touch-action: manipulation; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--plum); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: .9em; }
.btn.big { font-size: 1.15em; padding: 12px 24px; }
.btn.warn { background: var(--red); color: #fff; }
.linkish { background: none; border: 0; color: var(--plum); text-decoration: underline; cursor: pointer; padding: 0; }
.text .card { max-width: 760px; margin: 0 auto; }
.steps li, .plain li { margin: 0 0 .6em; }
.plain { padding-left: 1.2em; }
.set-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--plum); }
.row input[type="range"] { flex: 1 1 120px; min-width: 0; max-width: 100%; accent-color: var(--plum); }
.row select { flex: 1 1 200px; min-width: 0; max-width: 100%; padding: 4px; }
.cat { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat li { border: 1px dashed #b5a88f; border-radius: 4px; padding: 8px; text-align: center; font-size: .9em; }
.cat canvas { width: 96px; height: 96px; display: block; margin: 0 auto 6px; }
.cat .nm { font-weight: 700; display: block; }
.cat .pr { color: var(--faint); }
.cat li.locked { color: var(--faint); }

/* ---- the workshop */
.screen.game { max-width: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: calc(100dvh - var(--top)); min-height: 0; }
.stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
#cv { display: block; touch-action: none; cursor: crosshair; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.coach { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); width: min(86%, 380px); background: rgba(246,239,224,.95); color: var(--ink); padding: 10px 14px; border-radius: 6px; text-align: center; pointer-events: none; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.side { padding: 14px; overflow: auto; background: #170f18; border-left: 2px solid #3d2a40; }
.slip { color-scheme: light; background: var(--paper); color: var(--ink); padding: 10px 12px 6px; border-radius: 3px; border-top: 6px solid var(--plum); }
.slip h2 { font: 400 1.3em var(--fell); margin: 0 0 4px; }
.who { font-weight: 700; margin: 0; } .req { color: var(--faint); margin: 2px 0 6px; font-size: .9em; }
.order { list-style: none; padding: 0; margin: 0 0 6px; }
.order li { padding: 2px 0; }
.order li::before { content: "\2610  "; }
.order li.got::before { content: "\2611  "; color: var(--sage); }
.order li.got { color: var(--sage); font-weight: 700; }
.tally p { display: flex; justify-content: space-between; margin: 10px 0; }
.tally .val { font-weight: 700; }
.tilt-warn { color: #ff8f8f; font-weight: 700; justify-content: center !important; animation: blink .5s steps(2) infinite; }
body.calm .tilt-warn { animation: none; }
@keyframes blink { 50% { opacity: .35; } }
.side-btns { display: grid; gap: 10px; }
.keys { font-size: .8em; color: #a99c86; }
.armed .long { display: none; }
.btn.armed { background: var(--red); }
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .screen.game { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .side { order: -1; border: 0; border-bottom: 2px solid #3d2a40; padding: 6px 8px 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; position: relative; overflow: visible; }
  .slip { flex: 1 1 100%; padding: 4px 8px; border-top-width: 3px; }
  .slip h2, .req, .keys, .who { display: none; }
  .order { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0; font-size: .8em; }
  .order li { padding: 1px 0; }
  .tally { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
  .tally p { margin: 0; gap: 8px; font-size: .8em; justify-content: flex-start; }
  .tally .lbl { color: #a99c86; }
  .tilt-warn { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: #a3231b; color: #fff !important; padding: 2px 10px; border-radius: 4px; z-index: 5; white-space: nowrap; }
  .side-btns { display: flex; gap: 6px; margin: 0; }
  .side-btns .btn { padding: 6px 9px; font-size: .78em; }
  .long { display: none; }
  .topbar .nav button { padding: 5px 6px; font-size: 12px; }
  .logo { font-size: 19px; }
  .coach { top: 12%; font-size: .85em; }
}
@media (max-width: 420px) { .nav button[data-go="cat"] { display: none; } .logo { font-size: 18px; } }

/* ---- overlays */
.overlay { position: fixed; inset: 0; background: rgba(12,6,12,.72); display: flex; padding: 14px; z-index: 30; overflow: auto; }
.dialog { max-width: 520px; width: 100%; margin: auto; }
.dialog.wide { max-width: 640px; }
.inv-cv { max-width: 100%; max-height: calc(100dvh - 210px); min-height: 320px; width: auto; height: auto; display: block; margin: 8px auto; border-radius: 3px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .dialog.wide { max-width: 980px; display: grid; grid-template-columns: auto minmax(260px, 1fr); grid-template-rows: auto auto 1fr; column-gap: 22px; } .dialog.wide .inv-cv { grid-column: 1; grid-row: 1 / span 3; max-height: calc(100dvh - 70px); margin: 0; } .dialog.wide h2 { margin-top: 0; } .inv-btns { flex-direction: column; align-items: stretch; align-self: start; } }
@media (max-width: 760px) { .inv-cv { max-height: none; min-height: 0; width: 100%; } .dialog.wide { padding: 14px 12px; } .dialog.wide h2 { font-size: 1.2em; } .inv-sum { font-size: .85em; } }
.inv-sum { margin: 0; font-weight: 700; }
.inv-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.update { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: 6px; z-index: 40; display: flex; gap: 8px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.toast { position: fixed; left: 50%; top: calc(var(--top) + 10px); transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 6px; z-index: 45; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.5); max-width: 90vw; }
