





@font-face { font-family: 'IM Fell English'; src: url('../assets/fonts/im-fell-english-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IM Fell English'; font-style: italic; src: url('../assets/fonts/im-fell-english-latin-400-italic.woff2') format('woff2'); font-display: swap; }

:root {
  --paper: #efe4c8;
  --chalk: #fbf6e6;
  --ink: #2b1c10;
  --ink-soft: #5b4731;
  --red: #b0170f;
  --wash: #c8321d;       
  --wash-ink: #fff8e6;
  --sun: #f2bd1d;
  --pink: #ec6f9c;
  --sky: #6fa8e6;
  --leaf: #7cc06f;
  --edge: 2.5px;
  --lift: 5px;
  --stipple: radial-gradient(circle, rgba(43, 28, 16, .5) .8px, transparent 1.2px);
  --hatch: repeating-linear-gradient(-45deg, var(--ink) 0 1.4px, var(--chalk) 1.4px 4.5px);
  --serif: 'IM Fell English', 'Hoefler Text', Georgia, 'Noto Serif', serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--serif);
  color: var(--ink);
  background-color: var(--paper);
  


  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(255, 250, 232, .55), rgba(255, 250, 232, 0) 62%),
    radial-gradient(ellipse at 50% 50%, rgba(120, 88, 40, 0) 60%, rgba(120, 88, 40, .2) 100%),
    linear-gradient(rgba(239, 228, 200, .5), rgba(239, 228, 200, .5)),
    url("../assets/paper/texture.webp");
  background-size: auto, auto, auto, 512px 512px;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
}
[hidden] { display: none !important; }
h1, h2, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

#plate { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: 0; }
#plate.off { visibility: hidden; }

:focus-visible { outline: 3px dashed var(--red); outline-offset: 7px; }


.cartouche, .back-tab, .tool, .lever, .theme-cube, .sound-switch, .spec-label, .drawer-face {
  position: relative;
  isolation: isolate;
  background-color: var(--chalk);
  background-image: var(--stipple);
  background-size: 9px 9px;
  border: var(--edge) solid var(--ink);
  transition: transform .09s ease-out, background-color .12s, color .12s;
  

  font-weight: 700;
  -webkit-text-stroke: .35px currentColor;
}

.cartouche::before, .back-tab::before, .tool::before, .lever::before, .theme-cube::before, .sound-switch::before, .spec-label::before, .drawer-face::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: calc(var(--lift) - var(--edge));
  left: calc(var(--lift) - var(--edge));
  width: 100%; height: 100%;
  background: var(--hatch);
  border: var(--edge) solid var(--ink);
  transition: top .09s ease-out, left .09s ease-out;
}



.cartouche::after, .back-tab::after, .tool::after, .lever::after, .theme-cube::after, .sound-switch::after, .spec-label::after, .drawer-face::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: calc(0px - var(--edge));
  background: inherit;
  border: var(--edge) solid var(--ink);
}
.cartouche:active,.back-tab:active, .tool:active, .lever:active, .theme-cube:active, .sound-switch:active, button.spec-label:active, .drawer-face:active:not(:disabled) { transform: translate(var(--lift), var(--lift)); }
.cartouche:active::before, .back-tab:active::before, .tool:active::before, .lever:active::before, .theme-cube:active::before, .sound-switch:active::before, button.spec-label:active::before, .drawer-face:active:not(:disabled)::before { top: calc(0px - var(--edge)); left: calc(0px - var(--edge)); }

.cartouche {
  min-height: 52px;
  padding: 11px 26px 12px;
  font-size: 1.2rem;
  color: var(--wash-ink);
  background-color: var(--wash);
  background-image: radial-gradient(circle, rgba(60, 0, 0, .3) .8px, transparent 1.2px);
}
.cartouche:hover { background-color: #a92713; }
.cartouche.quiet { min-height: 44px; padding: 8px 14px 9px; font-size: 1rem; color: var(--ink); background-color: var(--chalk); background-image: var(--stipple); }
.cartouche.quiet:hover { background-color: #f5dc8a; }


.sheet { position: fixed; inset: 0; display: flex; padding: 16px; overflow: auto; pointer-events: none; }
.plate-mark {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(160px, 1fr) auto auto;
  gap: 20px;
}
.frontis { min-height: 0; }
.title-block { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: auto; }

.title-block h1 { display: flex; justify-content: center; gap: 4px; font-size: 1.9rem; line-height: 1; text-transform: uppercase; padding-right: 4px; }
.letter {
  display: grid; place-items: center;
  width: 2.8rem; max-width: calc((100vw - 64px) / var(--letters, 7) - 4px); aspect-ratio: 1;
  padding-bottom: .08em;
  border: var(--edge) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background-color: var(--tint, var(--chalk));
  background-image: var(--stipple);
  background-size: 7px 7px;
}
.letter:nth-child(4n + 1) { --tint: var(--sun); }
.letter:nth-child(4n + 2) { --tint: var(--pink); }
.letter:nth-child(4n + 3) { --tint: var(--sky); }
.letter:nth-child(4n + 4) { --tint: var(--leaf); }
.letter:last-child { transform: translate(1px, 5px) rotate(11deg); }
.title-block .sub { font-style: italic; font-size: 1.12rem; }
.rule-orn { display: none; }
.title-block .blurb { max-width: 34em; font-size: .98rem; line-height: 1.34; }


.title-block #t-open { align-self: stretch; margin: 8px var(--lift) 10px 0; min-height: 96px; padding: 16px; font-size: 2.2rem; line-height: 1.05; }
.imprint { font-size: .8rem; font-style: italic; color: var(--ink-soft); }


.lobby { justify-content: center; align-items: flex-start; }
.lobby-slab {
  pointer-events: auto;
  width: 100%; max-width: 560px;
  margin-right: var(--lift);
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px 16px;
  background-color: var(--chalk);
  border: var(--edge) solid var(--ink);
  box-shadow: var(--lift) var(--lift) 0 var(--ink);
}
.lobby-slab > * { flex: none; }
.lobby-slab h2 { font-size: 1.9rem; line-height: 1.08; }
.l-line { font-size: 1.05rem; line-height: 1.28; }
.l-line:empty, .l-note:empty { display: none; }
.l-note { font-style: italic; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.l-code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.l-code { font-size: .95rem; line-height: 1.2; }
.l-code b { display: block; font-size: 1.7rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.l-you { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; line-height: 1.2; }
.l-you canvas, .seat-icon { width: 32px; height: 32px; flex: none; image-rendering: pixelated; background: var(--paper); border: 2px solid var(--ink); }
.l-seats { display: flex; flex-wrap: wrap; gap: 8px; }
.l-seats:empty { display: none; }
.lobby #l-start { align-self: stretch; margin: 4px var(--lift) 8px 0; min-height: 96px; padding: 16px; font-size: 2.2rem; line-height: 1.05; }
#l-join-label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 1rem; font-weight: 700; cursor: pointer; list-style: none; }
#l-join-label::-webkit-details-marker { display: none; }
#l-join-label::before { content: '+'; width: 1em; text-align: center; font-size: 1.3rem; line-height: 1; }
.l-join-fold[open] #l-join-label::before { content: '\2212'; }
.l-join { margin-top: 8px; }
.l-join-row { display: flex; gap: 12px; margin-right: var(--lift); }
.l-join input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 8px 12px;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--chalk); border: var(--edge) solid var(--ink); appearance: none;
}
#l-leave { align-self: flex-start; }

@media (min-width: 900px) {
  .sheet { padding: 40px 56px; }
  .plate-mark { grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr auto; column-gap: 48px; align-items: center; }
  .frontis { grid-column: 1; grid-row: 1; height: 100%; }
  .title-block { grid-column: 2; grid-row: 1 / span 2; gap: 14px; }
  .title-block h1 { font-size: 2.6rem; gap: 6px; }
  .letter { width: 3.9rem; max-width: none; box-shadow: 4px 4px 0 var(--ink); }
  .title-block .blurb { font-size: 1.14rem; }
  .title-block #t-open { min-height: 128px; font-size: 3rem; }
}


.cabinet-room {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  gap: 16px;
  padding: 16px 21px 21px 16px;
  overflow: auto;
  max-width: 980px;
  margin: 0 auto;
}
.cab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex: none; }
.cab-head h2 { font-size: 1.9rem; line-height: 1.05; }
.cab-head p { font-size: .98rem; margin-top: 4px; font-style: italic; color: var(--ink-soft); }
.home-mark { flex: none; font-size: .82rem; color: var(--ink-soft); padding: 6px 0 6px 6px; }
.cab-marks { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

.sound-switch { min-height: 36px; padding: 4px 10px; font: 700 .9rem/1.1 var(--serif); --lift: 3px; }


.lever-text > :not(b), .card-holder > :not(b), .spec-label .st, .tool i { font-weight: 400; -webkit-text-stroke: 0; }


.tool > span, .lever-text { background-color: inherit; }
.sound-switch:hover { background-color: #f5dc8a; }
.sound-switch[data-muted="1"] { text-decoration: line-through; }
.stage > .sound-switch { position: absolute; top: 8px; left: 8px; z-index: 2; pointer-events: auto; }

.themes { display: flex; gap: 14px; flex: none; }
.theme-cube { flex: 1; min-height: 48px; max-width: 240px; padding: 8px 12px; font-size: 1.05rem; }
.theme-cube:hover { background-color: #f5dc8a; }
.theme-cube[aria-checked='true'] { background-color: var(--wash); color: var(--wash-ink); background-image: radial-gradient(circle, rgba(60, 0, 0, .3) .8px, transparent 1.2px); }

.cabinet { display: flex; flex-direction: column; gap: 16px; flex: none; }
.drawer { display: flex; flex-direction: column; }
.drawer-face {
  width: 100%;
  min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px;
  text-align: left;
  background-color: var(--rock, var(--chalk));
  background-image: var(--strata, var(--stipple));
  background-size: var(--strata-size, 9px 9px);
}
.drawer[data-drawer='chalk'] { --rock: #f7f1de; }
.drawer[data-drawer='limestone'] {
  --rock: #ead9ae;
  --strata: linear-gradient(rgba(43,28,16,.3) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(43,28,16,.3) 1.5px, transparent 1.5px);
  --strata-size: 100% 13px, 26px 100%;
}
.drawer[data-drawer='slate'] {
  --rock: #c9cdd0;
  --strata: repeating-linear-gradient(170deg, rgba(43,28,16,.32) 0 1.2px, transparent 1.2px 8px);
  --strata-size: auto;
}
.drawer[data-drawer='survey'] {
  --rock: #d9c7dd;
  --strata: repeating-linear-gradient(45deg, rgba(43,28,16,.2) 0 1.2px, transparent 1.2px 7px), repeating-linear-gradient(-45deg, rgba(43,28,16,.2) 0 1.2px, transparent 1.2px 7px);
  --strata-size: auto;
}
.drawer-face:hover:not(:disabled) { filter: brightness(1.05); }
.drawer-face:disabled { cursor: default; filter: saturate(.5); opacity: .72; }
.card-holder {
  flex: 1; min-width: 0;
  padding: 3px 10px 5px;
  background: var(--chalk);
  border: 2px solid var(--ink);
  max-width: 460px;
}
.card-holder b { display: block; font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.card-holder i { display: block; font-size: .76rem; line-height: 1.14; color: var(--ink-soft); }
.drawer-tally { flex: none; padding: 3px 7px 4px; background: var(--chalk); border: 2px solid var(--ink); font-size: .9rem; font-variant-numeric: lining-nums; }
.pull { display: none; }

.drawer-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s cubic-bezier(.2, .9, .3, 1); }
.drawer.open .drawer-body { grid-template-rows: 1fr; }
.drawer-tray { overflow: hidden; min-height: 0; }
.specimens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; gap: 16px; padding: 20px 5px 12px 0; }

.spec-wrap { width: min(100%, 176px); }
.spec-wrap > .spec-label { width: 100%; }
.spec-label {
  padding: 10px 6px 10px;
  text-align: center;
  min-height: 118px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
button.spec-label:hover { background-color: #f5dc8a; }
.spec-label canvas { width: 100%; max-width: 62px; aspect-ratio: 1; display: block; image-rendering: pixelated; }
.spec-label .nm { font-size: .98rem; line-height: 1.05; }
.spec-label .st { font-size: .74rem; font-style: italic; color: var(--ink-soft); line-height: 1.1; }
.spec-label.blank { color: var(--ink-soft); cursor: default; background-color: #e7dcc0; }
.spec-stamp {
  position: absolute; right: 2px; top: 8px;
  padding: 1px 5px 2px;
  border: 2px solid currentColor; color: var(--red);
  font-size: .78rem; letter-spacing: .02em;
  transform: rotate(-11deg);
  background: var(--chalk);
}
.spec-stamp.mint { color: #145c47; }
.spec-stamp.fine { color: #1f3c8f; }
.spec-stamp.worn { color: #7a4516; }



.goal-line { font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--ink); margin-top: 12px; }
.cab-head .goal-line { font-style: normal; color: var(--ink); margin-top: 8px; }
.cab-tally { font-variant-numeric: lining-nums; }
.prize-row { padding: 16px; background: var(--chalk); border: var(--edge) solid var(--ink); }
.prize-row { flex: none; }
.prize-row h3 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; margin: 0; }
.prize-row ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin-top: 12px; }
.prize {
  padding: 6px 8px 7px; border: 2px dashed var(--ink-soft); color: var(--ink-soft);
  font-size: .9rem; line-height: 1.15; text-align: center; opacity: .7;
}
.prize.won { border: 2px solid currentColor; color: #145c47; opacity: 1; transform: rotate(-2deg); font-weight: 700; }
.m-help { font-size: .95rem; line-height: 1.25; margin-top: 8px; padding-right: 76px; }
.m-prize { display: inline-block; margin-top: 8px; padding: 2px 8px 3px; border: 2px solid currentColor; color: #145c47; font-weight: 700; transform: rotate(-2deg); }

@media (min-width: 900px) {
  .cabinet-room { padding: 28px; gap: 20px; }
  .cab-head h2 { font-size: 2.7rem; }
  .specimens { gap: 28px; padding: 26px 40px 20px; }
  .spec-label { min-height: 190px; padding: 14px 10px 14px; }
  .spec-label canvas { max-width: 124px; }
  .spec-label .nm { font-size: 1.2rem; }
  .spec-label .st { font-size: .88rem; }
  .spec-stamp { font-size: 1rem; right: 8px; }
  .drawer-face { padding: 12px 20px; min-height: 70px; }
  .card-holder { padding: 6px 14px 7px; }
  .card-holder b { font-size: 1.35rem; }
  .card-holder i { font-size: .95rem; }
}


.bench {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'back tag' 'stage stage' 'seismo seismo' 'tools tools';
  gap: 16px;
  padding: 12px 21px calc(17px + env(safe-area-inset-bottom)) 16px;
  pointer-events: none;
}
.bench > button, .bench .tools > *, .museum { pointer-events: auto; }




.bench.in-room {
  grid-template-columns: auto 1fr 84px;
  grid-template-areas: 'back tag tag' 'stage stage rivals' 'seismo seismo seismo' 'tools tools tools';
}
.rivals {
  grid-area: rivals;
  align-self: start;
  min-height: 0; max-height: 100%;
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px;
  overflow: hidden;
  background-color: var(--chalk);
  border: var(--edge) solid var(--ink);
  pointer-events: none;
}
.rival { flex: 0 1 22px; min-height: 0; display: flex; align-items: center; gap: 3px; }

.rival canvas { width: 14px; height: 14px; max-height: 100%; flex: none; image-rendering: pixelated; background: var(--chalk); }
.rival .nm { display: none; }
.rival-bar { position: relative; flex: 1 1 auto; min-width: 0; height: 10px; max-height: 100%; background: var(--chalk); border: 1.5px solid var(--ink); }
.rival-bar i { display: block; height: 100%; background: var(--ink); }
.rival-mark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.rival-mark svg { display: block; width: 100%; height: 100%; }
.rival[data-state='freed'] .rival-bar { color: #145c47; }
.rival[data-state='fallen'] .rival-bar { color: var(--red); background: var(--hatch); }
.rival.me { background-color: var(--sun); box-shadow: 0 0 0 2px var(--sun); }
.rival.stale { opacity: .45; }
.rivals-note { font-size: .7rem; font-style: italic; line-height: 1.05; margin-top: 4px; overflow-wrap: anywhere; }

.back-tab { grid-area: back; align-self: start; min-height: 44px; padding: 8px 14px 9px; font-size: 1rem; }
.back-tab:hover { background-color: #f5dc8a; }

.tag {
  grid-area: tag; justify-self: end;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px;
  background-color: rgba(251, 246, 230, .9);
  border: 2px solid var(--ink);
  min-width: 0;
}
.tag-text { min-width: 0; }
.tag-plate { font-size: .74rem; line-height: 1.05; color: var(--ink-soft); }
.tag h2 { font-size: 1.14rem; line-height: 1.1; white-space: nowrap; }
.tag-left { font-size: .74rem; font-style: italic; line-height: 1.1; color: var(--ink-soft); white-space: nowrap; }
.seals { display: flex; gap: 4px; flex: none; }


.seal {
  position: relative; display: block; width: 20px; height: 20px;
  background-color: var(--wash);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.seal.broken {
  background-color: #cfc3a8;
  box-shadow: none;
  clip-path: polygon(0 0, 46% 0, 58% 34%, 40% 58%, 54% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 66% 100%, 52% 58%, 70% 34%, 56% 0);
  animation: seal-split .36s ease-out;
}
@keyframes seal-split { 0% { transform: scale(1.5) rotate(-12deg); } 45% { transform: scale(.82) rotate(6deg); } 100% { transform: none; } }

.stage { grid-area: stage; position: relative; min-height: 0; }
.caption {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: max-content; max-width: 100%;
  padding: 3px 10px 4px;
  background: rgba(251, 246, 230, .9);
  font-style: italic; font-size: .9rem; line-height: 1.2; text-align: center;
  transition: opacity .4s;
}
.caption:empty { opacity: 0; }


.seismo { grid-area: seismo; position: relative; height: 46px; background: var(--chalk); border: var(--edge) solid var(--ink); }
.seismo canvas { width: 100%; height: 100%; display: block; }
.seismo-note { position: absolute; left: 7px; top: 3px; font-size: .74rem; font-style: italic; color: var(--ink-soft); }


.tools { grid-area: tools; display: flex; gap: 16px; align-items: stretch; min-height: 62px; }




.roll { flex: 1 1 auto; display: flex; gap: 14px; }
.tool {
  flex: 1 1 auto; min-height: 60px;
  display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 2px 6px;
  padding: 16px;
  text-align: left;
}
.tool svg { width: 22px; height: 22px; flex: none; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.tool b { display: block; font-weight: 700; font-size: .95rem; line-height: 1.05; }
.tool i { display: none; font-size: .78rem; line-height: 1.1; }
.tool:hover { background-color: #f5dc8a; }
.tool[aria-checked='true'] { background-color: var(--sun); }
.tool[aria-checked='true'] svg { transform: translateY(-2px) rotate(-12deg) scale(1.08); }
.tool.absent { display: none; }


.lever { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 16px; min-height: 60px; }
.lever:hover { background-color: #f5dc8a; }
.lever-slot { position: relative; width: 20px; height: 44px; background: var(--hatch); border: 2px solid var(--ink); }
.lever-arm {
  position: absolute; left: 1px; top: 1px;
  width: 14px; height: 14px;
  background: var(--chalk);
  border: 2px solid var(--ink);
  transition: top .22s cubic-bezier(.3, 1.5, .5, 1), background-color .12s;
}
.lever[aria-pressed='true'] .lever-arm { top: 25px; background: var(--wash); }
.lever[aria-pressed='true'] { background-color: var(--sun); }
.lever-text b { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.05; }
.lever-text i { display: block; font-size: .74rem; line-height: 1.1; color: var(--ink-soft); }


.museum {
  grid-column: 1 / -1; grid-row: 3 / span 2;
  position: relative;
  padding: 14px 16px 18px;
  background-color: var(--chalk);
  background-image: var(--stipple);
  background-size: 9px 9px;
  border: var(--edge) solid var(--ink);
  box-shadow: var(--lift) var(--lift) 0 var(--ink);
  animation: label-in .36s ease-out;
}
@keyframes label-in { from { transform: translateY(14px); opacity: 0; } }
.m-kicker { font-size: .8rem; color: var(--ink-soft); }
.museum h2 { font-size: 1.7rem; line-height: 1.08; padding-right: 96px; }
.m-line { font-size: 1rem; line-height: 1.25; margin-top: 4px; padding-right: 76px; }
.m-stats { font-style: italic; font-size: .88rem; line-height: 1.2; color: var(--ink-soft); margin-top: 4px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; align-items: center; }
.m-actions .cartouche { flex: 0 1 auto; }
.stamp {
  position: absolute; right: 14px; top: 12px;
  padding: 3px 10px 5px;
  border: 3px solid currentColor;
  font-size: 1.32rem;
  color: var(--red);
  background: var(--chalk);
  transform: rotate(-9deg);
  animation: thud .42s cubic-bezier(.2, 1.5, .4, 1) .55s both;
}
.stamp.mint { color: #145c47; }
.stamp.fine { color: #1f3c8f; }
.stamp.worn { color: #7a4516; }
@keyframes thud { 0% { transform: rotate(-22deg) scale(3); opacity: 0; } 62% { transform: rotate(-9deg) scale(.92); opacity: 1; } 100% { transform: rotate(-9deg) scale(1); opacity: 1; } }

.bench.ended .tools, .bench.ended .seismo, .bench.ended .caption { display: none; }
.bench.ended { grid-template-rows: auto minmax(0, 1fr) auto auto; }


@media (min-width: 900px) {
  .bench {
    grid-template-columns: 228px minmax(0, 1fr) 280px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'back stage tag'
      'tools stage .'
      'tools seismo .';
    gap: 20px 24px;
    padding: 24px;
  }
  
  .bench.in-room {
    grid-template-columns: 228px minmax(0, 1fr) 280px;
    grid-template-areas: 'back stage tag' 'tools stage rivals' 'tools seismo rivals';
  }
  .bench.in-room .museum { grid-column: 1; grid-row: 2 / span 2; }
  .rivals { gap: 4px; }
  .rival { flex: 0 1 28px; gap: 8px; }
  .rival canvas { width: 20px; height: 20px; }
  .rival .nm { display: block; flex: 0 0 96px; font-size: .92rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rivals-note { font-size: .9rem; }
  .back-tab { justify-self: start; }
  .tag { justify-self: stretch; align-self: start; flex-direction: column; align-items: flex-start; padding: 14px 16px; gap: 10px; }
  .tag h2 { font-size: 1.7rem; }
  .tag-plate { font-size: .9rem; }
  .tag-left { font-size: .94rem; white-space: normal; }
  .seal { width: 26px; height: 26px; }
  .seals { gap: 8px; }
  .tools { flex-direction: column; align-self: end; gap: 18px; }
  .roll { flex-direction: column; flex: none; gap: 18px; }
  .tool { min-height: 72px; padding: 11px 16px; flex: none; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; }
  .tool svg { width: 50px; height: 50px; }
  .tool b { font-size: 1.2rem; }
  .tool i { display: block; }
  .lever { padding: 10px 16px; }
  .lever-slot { height: 54px; }
  .lever[aria-pressed='true'] .lever-arm { top: 35px; }
  .lever-text { text-align: left; }
  .lever-text b { font-size: 1.2rem; }
  .lever-text i { font-size: .86rem; }
  .seismo { height: 64px; max-width: 640px; width: 100%; justify-self: center; }
  .caption { font-size: 1.04rem; bottom: 6px; }
  .museum { grid-column: 3; grid-row: 2 / span 2; align-self: end; padding: 20px 20px 22px; }
  .museum h2 { font-size: 2.1rem; padding-right: 0; margin-top: 54px; }
  .m-line { padding-right: 0; font-size: 1.08rem; }
  .m-actions { flex-direction: column; align-items: stretch; }
  .stamp { font-size: 1.5rem; top: 18px; right: 20px; }
}


@media (max-width: 359px) {
  .lever-text i { display: none; }
}


@media (max-height: 640px) and (max-width: 899px) {
  .imprint { display: none; }
  .museum h2 { font-size: 1.4rem; }
  .title-block .blurb { font-size: .9rem; }
}




@media (max-height: 480px) {
  .rivals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 2px 8px; height: 100%; }
  .rival { gap: 3px; }
  .rival canvas { width: 14px; height: 14px; }
  .rival .nm { display: none; }
  .rivals-note { grid-column: 1 / -1; margin-top: 0; white-space: nowrap; }
}
@media (max-height: 480px) and (max-width: 899px) {
  .bench.in-room { grid-template-columns: auto 1fr 212px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer-body, .drawer-face, .stamp, .museum, .seal.broken { transition: none; animation: none; }
}
