:where(.game-board[class*="board-cat-"]) {
  --cat-ink: #322555;
  --cat-paper: #fbf2ff;
  --cat-edge: #dfc9ee;
  --cat-tile: #fffefa;
  --cat-glow: #f1e3f8;
}
.game-board[class*="board-cat-"] {
  width: min(100%, 38rem);
  min-width: 0;
  margin: 12px 0 15px;
  padding: clamp(7px, 2.1vw, 14px);
  border: 1px solid var(--cat-edge);
  border-radius: 15px;
  color: var(--cat-ink);
  background: var(--cat-paper);
  box-shadow: 0 2px 0 var(--cat-glow);
}

.game-board[class*="board-cat-"] .board-surface { min-width: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #cab4e0 transparent; }
.game-board[class*="board-cat-"] .board-tiles {
  display: grid; grid-template-columns: repeat(var(--board-columns, 2), minmax(44px, 1fr)); gap: 7px;
  min-width: 0; margin: 0; padding: 3px 3px 5px;
}
.game-board[class*="board-cat-"]:not([data-phase="answer"]) .board-tiles,
.demo-scene .game-board[class*="board-cat-"] .board-tiles { grid-template-columns: repeat(var(--board-columns, 2), minmax(0, 1fr)); }
.game-board[class*="board-cat-"] .board-tile {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 4px;
  width: 100%; min-width: 0; min-height: 52px; margin: 0; padding: 7px 6px;
  border: 1px solid var(--cat-edge); border-radius: 10px; color: var(--cat-ink); background: var(--cat-tile);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--cat-glow);
  font-size: .95rem; line-height: 1.3; text-align: center; white-space: pre-line; overflow-wrap: anywhere;
}
.game-board[class*="board-cat-"] .board-tile::before,
.game-board[class*="board-cat-"] .board-tile::after { pointer-events: none; }
.game-board[class*="board-cat-"] .board-tile > i {
  position: absolute; z-index: 1; top: 2px; right: 2px; min-width: 14px; padding: 1px 4px;
  border-radius: 8px; color: #fff; background: #6843b3; font-size: .64rem; font-style: normal; line-height: 1.18;
}
.game-board[class*="board-cat-"] .board-tile:is([aria-pressed="true"], .is-selected, .is-flash) {
  outline: 2px solid #8657da; outline-offset: -2px; background: #eadcff; color: #3a236f;
}
.game-board[class*="board-cat-"] .board-tile.is-flash { outline-color: #ad7219; background: #ffedbd; }
.game-board[class*="board-cat-"] .board-tile:is(:disabled, .is-disabled) { background: #f4eaf0; color: #775965; box-shadow: none; }
.game-board[class*="board-cat-"] .board-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.game-board[class*="board-cat-"] .board-pre { margin: 0 0 9px; }
.game-board[class*="board-cat-"] .board-pre:last-child { margin-bottom: 0; }
.demo-scene .game-board[class*="board-cat-"] { padding: 6px; margin-block: 9px 4px; box-shadow: none; }
.demo-scene .game-board[class*="board-cat-"] .board-tile { min-height: 35px; padding: 4px; font-size: .82rem; }

.board-cat-archive, .board-cat-parcel {
  --cat-ink: #603e26; --cat-paper: #f9e9d6; --cat-edge: #e6cbad; --cat-tile: #fff9ee; --cat-glow: #edd6be;
}
.game-board.board-cat-parcel .board-tile { border-style: dashed; }
.cat-parcel {
  --parcel-color: #deb684;
  position: relative; display: inline-block; width: 27px; height: 22px; border-radius: 4px;
  border: 1px solid #57435052; background: linear-gradient(145deg, #ffffff55, transparent 70%), var(--parcel-color);
  box-shadow: inset -4px -3px 0 #49322820, 0 2px 0 #57313425;
  transform: rotate(-6deg);
}
.cat-parcel::before { content: ''; position: absolute; top: -1px; bottom: -1px; left: 42%; width: 5px; background: #fff7d6a0; }
.cat-parcel-red { --parcel-color: #f49499; }
.cat-parcel-orange { --parcel-color: #f6b674; }
.cat-parcel-yellow { --parcel-color: #f2d573; }
.cat-parcel-green { --parcel-color: #92d3b4; }
.cat-parcel-blue { --parcel-color: #91c6eb; }
.cat-parcel-purple { --parcel-color: #bda9eb; }
.cat-parcel-empty { background: transparent; border-style: dashed; box-shadow: none; }
.cat-parcel-empty::before { display: none; }
.cat-post-address { display: grid; gap: 3px; justify-items: center; }
.cat-post-address span { font-size: .76rem; }
.cat-post-address strong { padding: 0 5px; border-radius: 4px; background: #f4dfc3; font: 850 1rem/1.4 ui-monospace, monospace; }

.board-cat-timetable {
  --cat-ink: #244354; --cat-paper: #e3eff2; --cat-edge: #abcdd4; --cat-tile: #f8feff; --cat-glow: #cfe3e8;
}
.game-board.board-cat-timetable {
  background-image: linear-gradient(0deg, transparent 75%, #abd1d622 75%);
  background-size: 100% 12px;
}
.cat-time-display, .cat-departure strong {
  padding: 4px 7px; color: #123b48; border-radius: 6px; background: #d1e8eb; box-shadow: inset 0 1px 3px #49717f28;
  font-family: ui-monospace, monospace; font-size: 1.03rem; font-weight: 850; font-variant-numeric: tabular-nums;
}
.cat-departure, .cat-sensor { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; }
.cat-departure > span, .cat-sensor > span { display: grid; justify-items: start; gap: 2px; font-size: .8rem; }
.cat-departure > span span b, .cat-sensor > span span b { font-variant-numeric: tabular-nums; }

.board-cat-letters, .board-cat-sentences {
  --cat-ink: #432960; --cat-paper: #fff3f3; --cat-edge: #ecd0da; --cat-tile: #fffdfc; --cat-glow: #f0dce5;
}
.cat-word-row, .cat-letter-row { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.cat-letter {
  min-width: 1.55em; padding: .2em .29em; color: #432756; border: 1px solid #e3b8cb; border-radius: .35em;
  background: #f8dce7; box-shadow: inset 0 1px 0 #fff8, 0 2px 0 #dfbbce;
  font-size: 1.15em; font-weight: 900; line-height: 1.2;
}
.cat-letter:nth-child(3n + 2) { background: #d9f1e7; border-color: #b3d9ca; box-shadow: inset 0 1px 0 #fff8, 0 2px 0 #b4d5c8; }
.cat-letter:nth-child(3n) { background: #efe2ff; border-color: #d9c0ed; box-shadow: inset 0 1px 0 #fff8, 0 2px 0 #d2bbe4; }
.cat-letter.cat-letter-blank { background: #fff8ed; border-style: dashed; }
.game-board.board-cat-sentences .board-tile { justify-items: start; place-content: center start; text-align: left; padding-inline: 12px; }
.cat-word-row { justify-content: start; }
.cat-word-row > span { padding: 2px 5px; border-radius: 4px; background: #f0e7fc; color: #4d3068; }
.cat-sentence { padding-block: 2px; border-bottom: 2px solid #e4d4ef; line-height: 1.52; }

.board-cat-casefile, .board-cat-dispatch, .board-cat-observe {
  --cat-ink: #544020; --cat-paper: #f7efde; --cat-edge: #ebd6a9; --cat-tile: #fffcee; --cat-glow: #eddfc3;
}
.game-board:is(.board-cat-casefile, .board-cat-dispatch, .board-cat-observe) .board-tile {
  border-radius: 5px 10px 10px 5px; box-shadow: inset 3px 0 0 #e8cc93, 0 2px 0 var(--cat-glow);
}
.cat-file-note { padding-inline: 6px; text-align: left; }
.cat-room { display: block; width: 23px; height: 17px; border: 2px solid #99734b; border-radius: 3px; background: #f2d9ae; }
.cat-room-door { width: 16px; height: 21px; border-radius: 4px 4px 0 0; }
.cat-room-roof { border: 0; height: 19px; background: #caa1de; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.cat-room-garden { border-color: #659a75; border-radius: 70% 30% 70% 30%; background: #b9dcb2; transform: rotate(-15deg); }

.board-cat-envelopes {
  --cat-ink: #553468; --cat-paper: #f2e7f6; --cat-edge: #dfc5e8; --cat-tile: #fffafa; --cat-glow: #e8d5ef;
}
.cat-envelope {
  display: block; position: relative; width: 29px; height: 19px; background: #e2c5f4;
  border: 1px solid #c1a1d8; border-radius: 3px; box-shadow: 0 2px 0 #eadcf2;
}
.cat-envelope::before { content: ''; position: absolute; inset: 0 1px 2px; background: #f4e2fe; clip-path: polygon(0 0, 100% 0, 50% 76%); }
.cat-envelope-equal { padding: 0 7px; border-radius: 5px; color: #644087; background: #eadcf5; font: 900 1.1rem/1.2 ui-monospace, monospace; }
.cat-coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.cat-coins i { width: 9px; height: 9px; border: 1px solid #ae8073; border-radius: 50%; background: #f1ce9e; }
.cat-coins .cat-red-coin { border-color: #ad5a6e; background: #ed94a4; }

.board-cat-keypad, .board-cat-gauge {
  --cat-ink: #23443d; --cat-paper: #e6f2ed; --cat-edge: #bdd8ce; --cat-tile: #fbfffd; --cat-glow: #d5e7de;
}
.cat-number { font: 900 1.2em/1.2 ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.cat-number small { font: 800 .69em/1.2 system-ui, sans-serif; margin-inline-start: 2px; }
.cat-number-unknown { color: #7251ac; }
.cat-dial { display: grid; justify-items: center; grid-template-columns: minmax(0, 1fr); width: min(100%, 80px); gap: 5px; }
.cat-gauge-track { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 9px; background: #d8e8e0; }
.cat-gauge-track i { display: block; width: var(--reading); height: 100%; background: #5d9e87; border-radius: 9px; }
.cat-sensor > strong { align-self: stretch; padding: 3px 6px; border-radius: 6px; color: #22564a; background: #bbdfd3; font: 900 1.16rem/1.4 ui-monospace, monospace; }

.board-cat-receipt {
  --cat-ink: #50384c; --cat-paper: #f5ece1; --cat-edge: #e0caba; --cat-tile: #fffefa; --cat-glow: #ead9cc;
}
.game-board.board-cat-receipt .board-tile { border-style: solid dashed; border-radius: 6px; padding-inline: 7px; }
.cat-receipt-number { letter-spacing: .02em; }
.cat-equation { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: baseline; font: 850 .9rem/1.32 ui-monospace, monospace; }
.cat-op { color: #915f79; }

.board-cat-balance, .board-cat-fraction {
  --cat-ink: #4c3a62; --cat-paper: #f2eafa; --cat-edge: #dbc9e9; --cat-tile: #fffcff; --cat-glow: #eadcf3;
}
.cat-weight { display: grid; place-content: center; min-width: 39px; min-height: 32px; padding: 4px; border: 1px solid #cab5e0; border-radius: 5px 5px 8px 8px; background: #f2e7fc; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e0d1eb; }
.cat-scale {
  display: grid; grid-template-columns: 1fr 37px 1fr; align-items: center; gap: 6px;
  width: min(100%, 240px); margin: auto; padding: 7px 10px 12px; border-radius: 10px; background: #f9f2ff;
}
.cat-scale > span { text-align: center; padding: 5px; border-bottom: 3px solid #9b78bc; border-radius: 7px; background: #eadbf7; font: 900 1.12rem/1.2 ui-monospace, monospace; }
.cat-scale small { font: 800 .72em/1.2 system-ui, sans-serif; }
.cat-scale > i { justify-self: center; align-self: end; width: 26px; height: 17px; background: #a57cc6; clip-path: polygon(50% 0,100% 100%,0 100%); }
.cat-fraction { width: clamp(66px, 24vw, 108px); display: flex; justify-content: space-between; gap: 2px; }
.cat-fraction i { flex: 1; height: 15px; border: 1px solid #cfb6e7; border-radius: 3px; background: #f7edf9; }
.cat-fraction .cat-filled { border-color: #a077c9; background: #c7adee; }
.cat-fraction-label { font-weight: 900; font-variant-numeric: tabular-nums; }

.board-cat-mosaic, .board-cat-links {
  --cat-ink: #35495c; --cat-paper: #eaf0fb; --cat-edge: #c6d3e9; --cat-tile: #fcfdff; --cat-glow: #dce5f3;
}
.game-board.board-cat-mosaic { background-image: repeating-linear-gradient(45deg, #f9fcff66 0 8px, transparent 8px 16px); }
.cat-shape-pair, .cat-run { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-items: center; }
.cat-run > span { display: inline-flex; align-items: center; gap: 2px; font-size: .9rem; }
.cat-run small { font: 800 .8em/1.2 ui-monospace, monospace; }
.cat-shape {
  display: inline-grid; place-items: center; min-width: 22px; min-height: 23px; padding: 1px 3px;
  color: #413373; border-radius: 5px; background: #ede7fc; font: 900 1.02rem/1.2 system-ui, sans-serif;
}
.cat-circle, .cat-target, .cat-ring { background: #d8efeb; color: #226756; }
.cat-star, .cat-spark { background: #fff0bd; color: #755516; }
.cat-square, .cat-outline, .cat-hatch { background: #e0ebfd; color: #285d8e; }
.cat-triangle, .cat-hex { background: #f8e1d1; color: #8b4e35; }
.cat-flower { background: #f7dced; color: #88416d; }
.cat-mark { background: #f7e1ea; color: #903e62; }
.cat-arrow-key { font: 900 1.35em/1.2 system-ui, sans-serif; }
.cat-section { display: block; width: 25px; height: 19px; border: 1px solid #87abba; background: #b8dce6; }
.cat-section-round { width: 21px; height: 21px; border-radius: 50%; }
.cat-section-tri { border: 0; clip-path: polygon(50% 0,100% 100%,0 100%); background: #a4c9e5; }
.cat-section-square { width: 20px; height: 20px; }
.cat-link { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; }
.cat-link > span:nth-child(odd) { padding: 2px 5px; border-radius: 5px; border: 1px solid #cad8ef; background: #e5edfc; }

.board-cat-signal, .board-cat-switchboard, .board-cat-turns {
  --cat-ink: #473661; --cat-paper: #f3eaf7; --cat-edge: #dccbe9; --cat-tile: #fffcff; --cat-glow: #e8d9f1;
}
.cat-signal {
  --signal: #b993dc;
  display: inline-flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; padding-inline: 4px;
  border-block-end: 3px solid var(--signal); border-radius: 5px; line-height: 1.4;
}
.cat-signal.cat-red { --signal: #ed989a; }
.cat-signal.cat-orange { --signal: #f2ad82; }
.cat-signal.cat-yellow { --signal: #e8cb70; }
.cat-signal.cat-green { --signal: #8bc5a8; }
.cat-signal.cat-blue { --signal: #96c6e8; }
.cat-turn-tag { padding: 1px 4px; border: 1px solid #dac8ed; border-radius: 4px; background: #efe6f9; font-size: .76rem; }

.board-cat-tank, .board-cat-ruler, .board-cat-terrain {
  --cat-ink: #285459; --cat-paper: #e4f4f8; --cat-edge: #b9dde6; --cat-tile: #f7fffe; --cat-glow: #d3eaf0;
}
.board-cat-tank[data-phase="clue"] {
  background-image: repeating-linear-gradient(0deg, #b4dfed55 0 4px, #e4f6f9 4px 30px);
}
.cat-fish {
  --fish: #f1aa71;
  position: relative; display: block; width: 24px; height: 14px; margin-inline-end: 6px;
  border-radius: 42% 55% 58% 42%; background: var(--fish); box-shadow: inset 0 2px 2px #ffffff55;
}
.cat-fish::before { content: ''; position: absolute; width: 11px; height: 14px; right: -8px; background: var(--fish); clip-path: polygon(0 50%,100% 0,100% 100%); }
.cat-fish::after { content: ''; position: absolute; left: 5px; top: 5px; width: 3px; height: 3px; border-radius: 50%; background: #3d4051; }
.cat-fish-blue { --fish: #8ebbe7; }
.cat-fish-label { font-size: .74rem; }
.cat-ruler-tick { width: 100%; padding: 9px 2px 0; border-top: 4px solid #73a083; font: 850 .84rem/1.25 ui-monospace, monospace; }
.cat-land { display: block; width: 36px; height: 19px; border-radius: 5px; border: 1px solid #c5d6de; background: #e6f5f7; }
.cat-land-water { background: repeating-linear-gradient(0deg, #b2e4ef 0 4px, #80c8db 4px 7px); }
.cat-land-snow { background: radial-gradient(circle, #b9d5ed 1px, #f6faff 2px) 0 0 / 7px 7px; }
.cat-land-road { background: linear-gradient(0deg, #889c9e 0 44%, #e3eec0 44% 54%, #889c9e 54% 100%); }
.cat-land-rail { background: linear-gradient(0deg, transparent 25%, #786e72 25% 32%, transparent 32% 68%, #786e72 68% 75%, transparent 75%), repeating-linear-gradient(90deg, #b8a7a2 0 4px, #e3d4c8 4px 7px); }

.cat-memory-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 7px; }
.cat-memory-card {
  min-width: 42px; min-height: 40px; display: inline-grid; gap: 3px; justify-items: center; place-content: center;
  padding: 7px; border-radius: 9px; border: 1px solid var(--cat-edge); background: var(--cat-tile);
  box-shadow: 0 2px 0 var(--cat-glow); font-size: .89rem; font-weight: 850;
}

@media (max-width: 450px) {
  .game-board[class*="board-cat-"] .board-tiles { gap: 5px; }
  .game-board[class*="board-cat-"] .board-tile { min-height: 48px; padding-inline: 3px; }
  .game-board.board-cat-sentences .board-tile { padding-inline: 8px; }
  .cat-letter-row { gap: 3px; }
  .cat-letter { min-width: 1.25em; padding-inline: .2em; }
  .cat-shape { min-width: 17px; min-height: 19px; padding: 0 2px; font-size: .91rem; }
}
