.masthead {
  height: 58px;
  min-height: 58px;
  padding: 5px 18px;
}
.connection {
  font-size: 0.8rem;
}
.header-audio {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
}
.header-audio label {
  display: grid;
  grid-template-columns: 1fr 35px;
  gap: 0 4px;
  font-size: 0.75rem;
  width: 130px;
  align-items: center;
}
.header-audio label span {
  grid-column: 1/-1;
}
.header-audio input {
  min-height: 26px;
  height: 26px;
  width: 90px;
}
.header-audio output {
  font-size: 0.72rem;
}
.table {
  padding: 0 18px 20px;
  max-width: 1800px;
}
.table-top {
  min-height: 60px;
}
.players {
  gap: 12px;
}
.player {
  padding: 3px 12px 3px 3px;
}
.player img {
  height: 46px;
  width: 39px;
}
.player strong {
  font-size: 1rem;
}
.player span {
  font-size: 0.8rem;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  grid-template-rows: auto auto auto;
  gap: 10px 20px;
  align-items: start;
}
.board-column {
  display: contents;
}
.board-heading {
  grid-column: 1;
  grid-row: 1;
  min-height: 48px;
  gap: 12px;
}
.board-heading #turn-guidance {
  font-size: 1.05rem;
  line-height: 1.3;
  max-width: 70%;
}
.clock svg {
  width: 43px;
  height: 43px;
}
.clock strong {
  font-size: 1.4rem;
}
.clock span {
  font-size: 0.8rem;
  max-width: 160px;
}
.castle-area {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.map-tools {
  position: static;
  align-self: flex-start;
  display: flex;
  gap: 6px;
  z-index: auto;
  flex-wrap: wrap;
}
.map-tools button {
  min-height: 44px;
  min-width: 44px;
  padding: 7px 13px;
  font-size: 0.92rem;
  background: #fff4d9;
}
.map-tools #undo {
  margin-left: 7px;
  max-width: none;
  font-size: 0.9rem;
}
.map-viewport {
  width: min(100%, calc((100dvh - 236px) * 1.41436));
  min-width: 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: 8192/5792;
  border-radius: 8px;
}
.room-label {
  font-size: clamp(0.78rem, 1.1vw, 1rem);
  padding: 4px 6px;
  line-height: 1.2;
}
.room-state {
  top: 38%;
  right: 1%;
}
.room-target {
  border-radius: 20% 18% 8% 8%;
}
.room-target.legal {
  box-shadow:
    inset 0 0 0 1px #31573a,
    0 0 0 1px #31573a;
  background: #fff7b805;
}
.room-target:hover {
  background: #fff2c416;
}
.room-state img {
  width: 28px;
  height: 31px;
}
.room-state .lock-mark {
  font-size: 0.69rem;
}
.animal {
  width: 7.5%;
  height: 10%;
  animation: animal-breathe 7s ease-in-out infinite;
}
.animal-stable,
.animal-dungeons,
.animal-chapel {
  width: 8.5%;
  height: 11%;
  transform: none;
}
.animal-dungeons {
  visibility: hidden;
}
.ghost {
  width: 6.5%;
  height: 11%;
  filter: drop-shadow(0 3px 2px #3c485a55);
}
.piece-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.piece-layer canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.pawn {
  width: 50px;
  height: 72px;
  min-height: 72px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: translate(-50%, -94%);
  padding: 0;
}
.pawn img {
  height: 68px;
  width: auto;
  max-width: 50px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  object-position: bottom;
  filter: drop-shadow(0 2px 2px #372a1b77);
}
.pawn.color-1 img,
.pawn.color-2 img,
.pawn.color-3 img {
  border: 0;
}
.pawn.my-pawn img {
  box-shadow: none;
  outline: none;
}
.pawn.my-pawn {
  z-index: 7;
}
.has-3d-pieces .pawn:not(.pawn-follower) img {
  opacity: 0;
}
.pawn-follower {
  width: 50px !important;
  height: 72px !important;
  min-height: 72px !important;
  z-index: 1000 !important;
}
.pawn-follower img {
  opacity: 1 !important;
}
.pawn:focus-visible {
  outline: 3px solid #fff4c7;
  outline-offset: 2px;
}
.move-preview {
  font-size: 0.92rem;
  max-width: 225px;
  min-width: 165px;
  padding: 9px;
  background: #fff5dc;
}
.move-preview .confirm {
  font-size: 1rem;
  min-height: 46px;
  padding: 8px 12px;
}
.move-preview .small {
  min-width: 44px;
  min-height: 46px;
}
.suspect-tray {
  grid-column: 1;
  grid-row: 3;
  padding: 9px 3px 0;
  min-width: 0;
}
.suspect-heading {
  padding: 0;
  margin: 2px 0 10px;
  border: 0;
}
.suspect-heading h2 {
  font-size: 1.28rem;
}
.suspect-heading > span {
  font-size: 0.9rem;
}
.suspects {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}
.suspect > img {
  height: auto;
  max-height: 115px;
  width: 100%;
  aspect-ratio: 531/768;
  filter: drop-shadow(0 2px 2px #5c422c66);
}
.suspect > span {
  font-size: 0.82rem;
  min-height: 32px;
  line-height: 1.15;
  padding-top: 6px;
}
.cleared-stamp {
  font-size: 0.72rem;
  top: 38%;
  padding: 4px 1px;
}
.companion {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 0;
  padding: 17px 16px 14px;
  background: #fff4dc;
  border-top: 3px solid #9c7950;
  border-radius: 6px 11px 6px 4px;
  box-shadow: 0 3px 7px #41301d22;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.command-zone {
  min-width: 0;
}
.action-shelf {
  padding: 0;
  margin: 0;
  min-height: 0;
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.action-title {
  max-width: none;
}
.action-title h2 {
  font-size: 1.45rem;
  line-height: 1.2;
}
.action-title p {
  font-size: 1rem;
  line-height: 1.45;
  margin-top: 8px;
}
.action-title small {
  font-size: 0.9rem;
  line-height: 1.45;
}
.action-shelf > .primary,
.action-shelf > .secondary {
  width: 100%;
  margin-top: 13px;
  font-size: 1.05rem;
  min-height: 49px;
}
.action-shelf .die-wrap,
.action-shelf > .die-art {
  display: none;
}
.action-shelf .action-animal {
  width: 70px;
  height: 78px;
  float: right;
  margin-left: 12px;
}
.action-room {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  text-align: left;
  margin-bottom: 14px;
}
.action-room > img {
  width: 63px;
  height: 70px;
}
.action-room h2 {
  font-size: 1.45rem;
}
.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
  min-width: 0;
}
.action-choice > button {
  display: flex;
  flex-direction: row;
  min-height: 55px;
  padding: 7px 9px;
  font-size: 1rem;
  gap: 8px;
}
.action-choice img {
  width: 31px;
  height: 34px;
}
.action-choice small {
  font-size: 0.83rem;
  line-height: 1.35;
  margin-top: 6px;
  color: #554831;
}
.feed-buttons {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}
.feed-buttons .primary {
  font-size: 1rem;
  min-height: 51px;
  justify-content: center;
}
.feed-buttons .text-button {
  font-size: 0.92rem;
  min-height: 44px;
}
.compact-inventory {
  display: none !important;
}
#dice-dock {
  margin: -9px -9px 13px;
  position: relative;
}
#dice-stage {
  height: 142px;
  width: 100%;
  position: relative;
  touch-action: none;
  border-radius: 9px;
  background: radial-gradient(
    ellipse at center,
    #edddbd 0%,
    #f7eacd 64%,
    #fff4dc 100%
  );
}
#dice-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#dice-stage.can-roll {
  cursor: grab;
}
#dice-stage.grabbed {
  cursor: grabbing;
}
.dice-hint {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  margin-top: -5px;
  position: relative;
  padding: 0 8px;
}
.cat-supplies {
  border-top: 1px solid #bba47d;
  padding-top: 13px;
  clear: both;
}
.cat-header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cat-header > img {
  width: 59px;
  height: 59px;
  object-fit: contain;
  border-radius: 5px;
  background: transparent;
}
.cat-header h2 {
  font-size: 1.2rem;
}
.cat-header p {
  font-size: 0.87rem;
  line-height: 1.3;
  margin-top: 3px;
}
.inventory {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 10px 0 0;
}
.food-slot {
  width: 66px;
  height: 66px;
}
.food-slot img {
  width: 55px;
  height: 55px;
}
.food-slot span {
  font-size: 0.72rem;
  line-height: 1.2;
  max-width: 54px;
}
.keys {
  grid-template-columns: 30px 30px;
  gap: 0 4px;
}
.keys strong {
  font-size: 1.65rem;
}
.keys span {
  font-size: 0.85rem;
}
.pantry-link {
  font-size: 0.9rem;
  min-height: 44px;
  margin: 2px auto 0;
  padding: 7px 0;
}
.narration {
  margin: 0;
  padding: 15px 0 0;
  border-top: 1px solid #bba47d;
  display: block;
  min-height: 0;
}
.narration-heading {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 10px;
}
.narration-heading > img {
  width: 52px;
  height: 58px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.narration-heading h2 {
  font-size: 1.2rem;
}
.narration > p {
  font-size: 1.04rem;
  line-height: 1.55;
  max-height: 220px;
  overflow: auto;
  padding-right: 3px;
}
.narration-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}
.narration-controls > button {
  min-height: 46px;
  font-size: 0.97rem;
  line-height: 1.2;
  padding: 8px 7px;
}
.narration-controls .clue-book {
  border: 1px solid #8c7454;
  grid-column: auto;
  grid-row: auto;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  font:
    600 0.97rem "Segoe UI",
    Arial,
    sans-serif;
  padding: 8px 6px;
  background: transparent;
}
.clue-book strong {
  width: 25px;
  height: 25px;
  font-size: 0.85rem;
}
.narration-controls .quiet {
  border: 1px solid #8c7454;
}
.turn-cue {
  position: fixed;
  bottom: auto;
  top: 76px;
  left: 220px;
  max-width: min(420px, calc(100vw - 30px));
  padding: 14px 12px 14px 74px;
  font-size: 1rem;
  line-height: 1.4;
  z-index: 25;
}
.turn-cue > img {
  width: 54px;
  height: 57px;
  object-fit: contain;
  left: 9px;
  top: 10px;
  bottom: auto;
  border-radius: 3px;
}
.turn-cue button {
  min-width: 44px;
  min-height: 44px;
}
.toast {
  bottom: auto;
  top: 72px;
  max-width: min(650px, 90vw);
  font-size: 1rem;
  padding: 14px 20px;
  z-index: 2200;
}
.lobby-art img {
  border-radius: 8px;
  object-fit: contain;
}
.fly-token {
  position: fixed;
  width: 48px;
  height: 48px;
  object-fit: contain;
  z-index: 30;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px #372b1e66);
}
@media (min-width: 1600px) {
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 12px 24px;
  }
  .companion {
    padding: 18px 20px;
  }
  .map-viewport {
    width: min(100%, calc((100dvh - 236px) * 1.41436));
  }
  .narration > p {
    font-size: 1.08rem;
  }
}
@media (max-width: 1120px) {
  .header-audio {
    gap: 10px;
  }
  .header-audio label {
    width: 105px;
  }
  .header-audio input {
    width: 70px;
  }
  .header-audio label span {
    font-size: 0.7rem;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 315px;
    gap: 10px 14px;
  }
  .companion {
    padding: 13px 13px 14px;
    gap: 15px;
  }
  .action-choice > button {
    font-size: 0.93rem;
    padding: 7px 5px;
    gap: 5px;
  }
  .action-choice small {
    font-size: 0.81rem;
  }
  .action-title h2,
  .action-room h2 {
    font-size: 1.28rem;
  }
  .map-viewport {
    width: min(100%, calc((100dvh - 236px) * 1.41436));
  }
  .room-label {
    font-size: 0.79rem;
    padding: 3px 4px;
  }
  .suspects {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px 8px;
  }
  .suspect > img {
    max-height: 125px;
  }
  .suspect > span {
    font-size: 0.83rem;
  }
  .cat-header h2,
  .narration-heading h2 {
    font-size: 1.16rem;
  }
  .cat-header p {
    font-size: 0.82rem;
  }
  .narration > p {
    font-size: 1rem;
  }
  .food-slot {
    width: 60px;
    height: 60px;
  }
  .food-slot img {
    width: 50px;
    height: 50px;
  }
  .inventory {
    gap: 17px;
  }
}
@media (max-width: 860px) {
  .masthead {
    height: auto;
    min-height: 58px;
    padding: 5px 10px;
  }
  .header-audio {
    display: none;
  }
  .table {
    padding: 0 10px 20px;
  }
  .table-top {
    min-height: 60px;
  }
  .player strong {
    font-size: 0.9rem;
  }
  .player span {
    font-size: 0.75rem;
  }
  .table-tools {
    display: flex;
  }
  .table-tools button {
    font-size: 0.85rem;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    gap: 10px;
  }
  .board-heading {
    grid-column: 1;
    grid-row: 1;
  }
  .castle-area {
    grid-column: 1;
    grid-row: 2;
  }
  .map-viewport {
    width: 100%;
    max-height: none;
    min-width: 0;
  }
  .companion {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }
  .command-zone {
    grid-column: 1;
  }
  .cat-supplies {
    grid-column: 2;
    grid-row: 1;
    border: 0;
    padding-top: 0;
  }
  .narration {
    grid-column: 1/-1;
    grid-row: 2;
    padding-top: 15px;
  }
  .narration-heading {
    margin-bottom: 9px;
  }
  .narration > p {
    font-size: 1.05rem;
    max-height: none;
  }
  .narration-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }
  .narration-controls > button,
  .narration-controls .clue-book {
    font-size: 0.95rem;
  }
  .suspect-tray {
    grid-column: 1;
    grid-row: 4;
    padding-top: 5px;
  }
  .suspects {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
  }
  .suspect > img {
    max-height: 115px;
  }
  .suspect > span {
    font-size: 0.77rem;
  }
  .room-label {
    font-size: clamp(0.78rem, 1.9vw, 1rem);
  }
  .pawn {
    width: 44px;
    height: 64px;
    min-height: 64px;
  }
  .pawn img {
    height: 59px;
    width: auto;
    max-width: 44px;
  }
  #dice-stage {
    height: 130px;
  }
  .map-tools {
    gap: 6px;
  }
  .map-tools button {
    font-size: 0.9rem;
    min-height: 44px;
  }
  .map-tools #undo {
    font-size: 0.9rem;
  }
  .turn-cue {
    top: 110px;
    left: 15px;
  }
  .toast {
    top: 65px;
  }
}
@media (max-width: 560px) {
  .masthead {
    min-height: 59px;
    padding: 5px 8px;
  }
  .utilities .quiet {
    font-size: 0.77rem;
    max-width: 78px;
  }
  .wordmark {
    font-size: 1.3rem;
  }
  .table {
    padding-inline: 8px;
  }
  .table-top {
    min-height: 58px;
  }
  .players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
  }
  .player {
    gap: 7px;
    padding: 2px 4px 3px;
  }
  .player img {
    width: 34px;
    height: 38px;
  }
  .player strong {
    font-size: 0.84rem;
  }
  .player span {
    font-size: 0.73rem;
  }
  .table-tools {
    display: none;
  }
  .board-heading {
    min-height: 60px;
    gap: 8px;
  }
  .board-heading #turn-guidance {
    font-size: 0.98rem;
    max-width: 65%;
  }
  .clock svg {
    width: 33px;
    height: 33px;
  }
  .clock strong {
    font-size: 1.25rem;
  }
  .clock span {
    font-size: 0.7rem;
    max-width: 100px;
  }
  .castle-area {
    gap: 7px;
  }
  .map-tools {
    width: 100%;
    gap: 5px;
  }
  .map-tools button {
    min-width: 44px;
    min-height: 44px;
    padding: 7px 9px;
    font-size: 0.86rem;
  }
  .map-tools #undo {
    font-size: 0.83rem;
    line-height: 1.2;
    padding: 7px 8px;
    margin-left: 1px;
    max-width: 158px;
  }
  .map-viewport {
    width: 100%;
    border-radius: 6px;
  }
  .room-label {
    font-size: 0.75rem;
    line-height: 1.12;
    padding: 3px 2px;
    max-width: 98%;
  }
  .room-state {
    top: 42%;
  }
  .room-state img {
    width: 20px;
    height: 24px;
  }
  .room-state .lock-mark {
    font-size: 0.56rem;
    padding: 2px 3px;
  }
  .animal {
    width: 8%;
    height: 10%;
  }
  .animal-stable,
  .animal-dungeons,
  .animal-chapel {
    width: 8.8%;
    height: 11%;
    transform: none;
  }
  .ghost {
    width: 7.5%;
    height: 12%;
  }
  .pawn {
    width: 44px;
    height: 50px;
    min-height: 50px;
  }
  .pawn img {
    width: auto;
    height: 46px;
    max-width: 39px;
  }
  .move-preview {
    font-size: 0.85rem;
    min-width: 150px;
    max-width: 185px;
    padding: 7px;
  }
  .move-preview .confirm {
    font-size: 0.9rem;
    min-height: 46px;
    padding: 8px;
  }
  .companion {
    display: flex;
    gap: 17px;
    padding: 17px 14px;
    min-width: 0;
  }
  .command-zone {
    order: 0;
    width: 100%;
  }
  .action-title {
    max-width: none;
  }
  .action-title h2 {
    font-size: 1.4rem;
  }
  .action-title p {
    font-size: 1rem;
    line-height: 1.5;
  }
  .action-title small {
    font-size: 0.92rem;
  }
  .action-shelf {
    padding: 0;
    min-height: 0;
    display: block;
  }
  .action-room {
    width: auto;
    margin-bottom: 12px;
    padding: 0;
  }
  .action-room > img {
    width: 58px;
    height: 65px;
  }
  .action-room h2 {
    font-size: 1.38rem;
  }
  .action-buttons {
    gap: 13px 10px;
  }
  .action-choice > button {
    min-height: 54px;
    font-size: 1rem;
    padding: 8px 6px;
    gap: 7px;
  }
  .action-choice img {
    width: 29px;
    height: 31px;
  }
  .action-choice small {
    font-size: 0.87rem;
    line-height: 1.35;
    margin-top: 6px;
  }
  .action-shelf > .primary:not(.feed-buttons .primary) {
    font-size: 1.05rem;
    min-height: 49px;
    margin-top: 14px;
  }
  .action-shelf > .secondary {
    font-size: 1rem;
    min-height: 46px;
  }
  .action-shelf .action-animal {
    width: 61px;
    height: 77px;
  }
  .feed-buttons .primary {
    font-size: 1rem;
    min-height: 53px;
  }
  .feed-buttons .text-button {
    font-size: 0.96rem;
    min-height: 46px;
  }
  #dice-dock {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin: -5px 0 9px;
  }
  #dice-stage {
    height: 120px;
  }
  .dice-hint {
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: left;
    margin: 0;
    padding: 0 5px;
  }
  .cat-supplies {
    order: 1;
    border-top: 1px solid #bba47d;
    padding-top: 13px;
    width: 100%;
  }
  .cat-header {
    display: flex;
    gap: 12px;
  }
  .cat-header > img {
    display: block;
    object-fit: contain;
    border-radius: 0;
    width: 60px;
    height: 60px;
  }
  .cat-header h2 {
    font-size: 1.24rem;
  }
  .cat-header p {
    font-size: 0.9rem;
  }
  .inventory {
    justify-content: center;
    gap: 24px;
    margin: 9px 0 0;
  }
  .food-slot {
    width: 65px;
    height: 65px;
  }
  .food-slot img {
    width: 54px;
    height: 54px;
  }
  .food-slot span {
    font-size: 0.75rem;
    line-height: 1.25;
    max-width: 55px;
  }
  .keys strong {
    font-size: 1.65rem;
  }
  .keys span {
    font-size: 0.9rem;
  }
  .pantry-link {
    font-size: 1rem;
    min-height: 46px;
    margin: 4px auto 0;
  }
  .narration {
    order: 2;
    width: 100%;
    padding-top: 14px;
    min-height: 0;
    display: block;
  }
  .narration-heading {
    gap: 12px;
    margin-bottom: 10px;
  }
  .narration-heading > img {
    width: 58px;
    height: 65px;
    object-fit: contain;
  }
  .narration-heading h2 {
    font-size: 1.3rem;
  }
  .narration > p {
    font-size: 1.05rem;
    line-height: 1.55;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .narration-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
  }
  .narration-controls > button,
  .narration-controls .clue-book {
    font-size: 1rem;
    min-height: 49px;
    padding: 9px 7px;
  }
  .suspect-tray {
    padding: 6px 2px 0;
  }
  .suspect-heading h2 {
    font-size: 1.35rem;
  }
  .suspect-heading > span {
    font-size: 0.9rem;
  }
  .suspects {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px 9px;
  }
  .suspect > img {
    max-height: none;
  }
  .suspect > span {
    font-size: 0.8rem;
    line-height: 1.2;
    min-height: 36px;
  }
  .cleared-stamp {
    font-size: 0.66rem;
  }
  .turn-cue {
    top: 116px;
    left: 10px;
    padding: 13px 10px 13px 67px;
    max-width: calc(100vw - 20px);
    font-size: 1rem;
  }
  .turn-cue > img {
    width: 50px;
    height: 54px;
    object-fit: contain;
    top: 11px;
    left: 8px;
    bottom: auto;
  }
  .toast {
    font-size: 1rem;
    top: 70px;
    bottom: auto;
    padding: 13px 16px;
  }
  .modal .text-button {
    font-size: 1rem;
  }
}
@media (max-height: 720px) and (min-width: 861px) {
  .table-top {
    min-height: 55px;
  }
  .board-heading {
    min-height: 44px;
  }
  .map-viewport {
    width: min(100%, calc((100dvh - 216px) * 1.41436));
  }
  .companion {
    gap: 14px;
    padding-top: 12px;
  }
  #dice-stage {
    height: 110px;
  }
  .narration > p {
    max-height: 180px;
  }
  .action-room > img {
    height: 56px;
  }
  .action-choice > button {
    min-height: 50px;
  }
}

/* Voice controls stay available while the castle is being explored. */
.table > .narration-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
  margin: 0 0 8px;
  padding: 6px;
  background: #e9dfc9;
  border-bottom: 1px solid #bba47d;
}
.table > .narration-controls button {
  min-height: 46px;
  font-size: 1rem;
  margin: 0;
}
.table > .narration-controls .clue-book { grid-column: auto; grid-row: auto; }
.command-zone { order: 0; }
.narration { order: 1; }
.cat-supplies { order: 2; }
.map-viewport { width: min(100%, calc((100dvh - 296px) * 1.41436)); }
.board-heading .turn-cue {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  max-width: 70%;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  transform: none;
  z-index: auto;
  font-size: 1rem;
  line-height: 1.3;
}
.board-heading .turn-cue > img { position: static; width: 36px; height: 40px; flex-shrink: 0; }
.board-heading .turn-cue > button { position: static; flex-shrink: 0; }
.board-heading:has(.turn-cue:not([hidden])) #turn-guidance { display: none; }
.player > div { min-width: 0; overflow-wrap: anywhere; }
.player img { flex-shrink: 0; }
.clock strong { white-space: nowrap; }
.clock span { overflow-wrap: anywhere; }
.food-slot { height: auto; min-height: 66px; flex-shrink: 0; }
.food-slot span { max-width: none; padding: 8px 5px; overflow-wrap: anywhere; }
.inventory { flex-wrap: wrap; align-items: center; }
.cat-header > div { min-width: 0; }
.cat-header > img { flex-shrink: 0; }
@media (max-width: 860px) {
  .masthead { flex-wrap: wrap; height: auto; }
  .players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .player { min-width: 0; max-width: none; }
  .map-viewport { width: 100%; }
  .narration { grid-row: 2; }
  .cat-supplies { grid-row: 3; grid-column: 1/-1; }
  .command-zone { grid-column: 1/-1; }
  .board-heading #turn-guidance { max-width: 60%; }
  .clock { flex-shrink: 1; min-width: 0; }
  .clock > div { min-width: 0; }
}
@media (max-width: 560px) {
  .table > .narration-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 5px 0; }
  .table > .narration-controls button { padding: 7px 5px; font-size: .93rem; }
  .narration { order: 1; }
  .cat-supplies { order: 2; }
  #dice-dock { grid-template-columns: 108px minmax(0,1fr); }
  #dice-stage { height: 108px; }
  .board-heading .turn-cue { max-width: 63%; font-size: .95rem; gap: 4px; }
  .board-heading .turn-cue > img { display: none; }
  .board-heading .turn-cue > button { padding: 7px; }
  .utilities { flex-wrap: wrap; min-width: 0; gap: 3px; }
  .utilities .quiet { max-width: none; flex: 1 1 70px; }
  .masthead { gap: 4px; }
  .wordmark { font-size: 1.3rem; }
  .food-slot { min-height: 65px; }
  .food-slot span { font-size: .8rem; }
  .clock svg { flex-shrink: 0; width: 28px; height: 28px; }
  .board-heading { align-items: center; }
  .clock strong { font-size: 1.1rem; }
}

.suspect-heading { flex-wrap: wrap; gap: 6px 12px; }
.suspect-heading h2 { min-width: 0; flex: 1 1 170px; }
.suspect-heading > span { white-space: normal; }

.cat-header h2, .narration-heading h2, .action-title h2 { overflow-wrap: anywhere; }
.food-slot { width: max(65px, 3.5rem); }
.food-slots { flex-wrap: wrap; justify-content: center; }
@media (max-width: 560px) {
 .suspects { grid-template-columns: repeat(auto-fit,minmax(min(100%,4.1rem),1fr)); }
}
.keys { grid-template-columns: 30px max-content; }
@media (max-width: 560px) {
 .board-heading #turn-guidance { flex: 1; min-width: 0; max-width: none; }
 .clock { flex-shrink: 0; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 40%; }
 .clock svg { display: none; }
 .clock > div { min-width: max-content; }
 .clock span { min-width: 0; max-width: 108px; }
 .map-tools #undo { max-width: 100%; overflow-wrap: anywhere; }
 .room-label { font-size: clamp(12px,1.9vw,16px); overflow-wrap: anywhere; }
}

@media(max-width:560px){ .suspect-heading h2 { flex-basis:100%; } }


.map { will-change: auto; }
.pawn { width: 44px; height: 52px; min-height: 52px; }
.pawn img { height: 46px; max-width: 34px; }
.pawn-follower { width: 44px !important; height: 52px !important; min-height:52px !important; }
@media(max-width:560px) { .pawn { height:44px;min-height:44px; } .pawn img { height:32px;max-width:26px; } }

.action-room > div { min-width:0; }
.animal-status { font-size:1rem; line-height:1.4; margin-top:5px; }
.feeding-ready { display:flex; align-items:center; gap:12px; padding:10px 0 14px; color:#284d3d; }
.feeding-ready img { width:52px; height:52px; flex-shrink:0; }
.feeding-ready p, .feeding-help { font-size:1rem;line-height:1.45; }
.feeding-help { margin:0 0 14px; }
.action-choice.feed-choice > button { min-height:62px; }
.action-choice.feed-choice > button img { width:37px;height:39px; }

.castle-event { width:100%; padding:12px 15px; background:#fff4dc; border-left:5px solid #9c5a28; display:flex; gap:14px; align-items:center; justify-content:space-between; }
.castle-event strong { font:700 1.3rem Georgia,serif; }
.castle-event p { font-size:1rem;line-height:1.4;margin-top:4px; }
.castle-event-controls { display:flex;gap:6px;flex-shrink:0; }
.castle-event button { min-height:46px; }
.event-visuals { position:absolute;inset:0;z-index:9;pointer-events:none; }
.event-figure { position:absolute;height:11%;width:auto;max-width:8%;object-fit:contain;transform:translate(-50%,-100%);filter:drop-shadow(0 3px 2px #30291e77); }
.event-hidden-pawn { visibility:hidden; }
.trap-opening,.passage-opening { position:absolute;width:9%;height:7%;transform:translate(-50%,-50%);border:3px solid #70502c;border-radius:14%;background:#211a12;box-shadow:0 0 0 4px #f8dc8b80;perspective:120px;overflow:visible; }
.trap-opening i { position:absolute;inset:0 50% 0 0;background:repeating-linear-gradient(90deg,#93643e 0 14%,#6e472a 15% 18%);border:2px solid #d4b77c;transform-origin:left center;animation:trap-left 1400ms 400ms both ease-in-out; }
.trap-opening i+i { inset:0 0 0 50%;transform-origin:right center;animation-name:trap-right; }
.event-landing { position:absolute;width:10%;height:9%;transform:translate(-50%,-50%);border:3px solid #31573a;border-radius:50%;box-shadow:0 0 0 4px #fff4dc99;animation:landing-ring 2200ms 1800ms both ease-out; }
.passage-opening { border-color:#31573a;background:#fff4dc88; }
@keyframes trap-left { from{transform:rotateY(0)}to{transform:rotateY(-105deg)} }
@keyframes trap-right { from{transform:rotateY(0)}to{transform:rotateY(105deg)} }
@keyframes landing-ring { from{opacity:0;scale:.6}40%,to{opacity:1;scale:1} }
.calm .trap-opening i { animation:none;transform:rotateY(-100deg); }
.calm .trap-opening i+i { transform:rotateY(100deg); }
.calm .event-landing { animation:none; }
@media(prefers-reduced-motion:reduce){ .trap-opening i,.event-landing { animation:none; } }
@media(max-width:560px){ .castle-event {flex-direction:column;align-items:stretch;padding:11px;} .castle-event-controls {flex-wrap:wrap;} .castle-event strong {font-size:1.15rem;} }

.action-choice.feed-choice > button.primary { background:#284d3d; color:#fff9e9; border-color:#183c2c; }
.action-choice.feed-choice > button.primary:disabled { background:#b4bead;color:#34402f; }

.room-target.legal { box-shadow:inset 0 0 0 2px #31573a,0 0 0 1px #fff4dc; }
.pawn:focus-visible { outline:3px solid #284d3d;box-shadow:0 0 0 6px #fff4dc; }

.action-buttons { grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr)); }
.action-choice > button span { min-width:0;overflow-wrap:anywhere; }
.castle-event > div:first-child { min-width:0;overflow-wrap:anywhere; }
.feeding-ready p,.feeding-help { overflow-wrap:anywhere; }

.play-layout { grid-template-columns:minmax(0,1fr) 308px; gap:10px 16px; }
.command-zone { padding:12px; }
#dice-dock { display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;margin:0;gap:6px; }
#dice-stage { height:108px; }
.dice-hint { margin:0;padding:0;text-align:left;font-size:1rem;line-height:1.4; }
.dice-hint:empty { display:none; }
.roll-control { margin-top:4px;min-height:46px; }
.cat-supplies { display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 10px;align-items:center; }
.cat-header { gap:6px; }
.cat-header > img { width:42px;height:54px; }
.cat-header h2 { max-width:6rem;font-size:1.05rem; }
.cat-supplies .inventory { margin:0;gap:7px;justify-content:flex-end; }
.cat-supplies .food-slot { width:48px;min-height:48px;height:48px; }
.cat-supplies .food-slot img { max-width:42px;max-height:42px; }
.cat-supplies .food-slots { gap:4px; }
.cat-supplies .keys { grid-template-columns:24px max-content;gap:2px 4px; }
.cat-supplies .keys img { width:24px;height:35px; }
.cat-supplies .keys span { font-size:.85rem; }
.cat-supplies .pantry-link { grid-column:1/-1;margin:0;min-height:44px; }
.narration-heading img { border-radius:0;object-fit:contain;width:64px;height:72px;background:transparent; }
.narration-heading h2 { font-size:1.15rem; }
.deduction-note { display:flex;align-items:center;flex-wrap:wrap;gap:5px 12px;font-size:1rem;line-height:1.4;padding:8px 0 10px;color:#284d3d; }
.deduction-note > span { flex:1 1 220px; }
.deduction-note button { min-height:44px; }
.suspect.evidence-highlight { opacity:1;box-shadow:0 0 0 3px #31573a; }
.suspect.evidence-highlight img { filter:none; }
.evidence-portraits { display:flex;flex-wrap:wrap;gap:8px;margin-top:10px; }
.evidence-portraits button { display:flex;align-items:center;gap:8px;min-height:52px;padding:5px 10px; }
.evidence-portraits img { height:55px;width:42px;object-fit:contain; }
.suspect-inspect blockquote,.room-inspect blockquote { margin:12px 0;padding:10px 12px;border-left:3px solid #31573a;background:#f3e5c8;font-size:1rem;line-height:1.45; }
.suspect-inspect blockquote p,.room-inspect blockquote p { margin:5px 0 0; }
.room-target.evidence-room { box-shadow:inset 0 0 0 3px #93630c,0 0 0 2px #fff4dc; }
.event-room-marker { position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;flex-direction:column;gap:2px;max-width:23%;padding:4px 7px;background:#fff4dcf5;border:2px solid #8c5f1c;border-radius:6px;color:#30291e;box-shadow:0 3px 6px #30291e44; }
.event-room-marker img { width:30px;height:30px;object-fit:contain; }
.event-room-marker span { font:700 clamp(10px,1.2vw,16px)/1.2 system-ui,sans-serif;text-align:center; }
.animal { transform-origin:center 85%; }
.animal.notices-food { filter:drop-shadow(0 0 3px #fff4dc);animation:animal-notice 650ms ease-out both; }
.animal.eating-food { animation:animal-eat 650ms ease-in-out 3; }
.animal.giving-clue { animation:animal-clue 900ms ease-in-out; }
@keyframes animal-notice { 0%{rotate:0deg}50%{rotate:-7deg;translate:0 -5%}100%{rotate:-3deg} }
@keyframes animal-eat { 0%,100%{rotate:0deg}50%{rotate:6deg;scale:1.04 .96} }
@keyframes animal-clue { 0%,100%{translate:0 0}40%{translate:0 -9%} }
.calm .animal.notices-food,.calm .animal.eating-food,.calm .animal.giving-clue { animation:none;outline:2px solid #31573a;outline-offset:4px; }
@media(prefers-reduced-motion:reduce){.animal.notices-food,.animal.eating-food,.animal.giving-clue {animation:none;outline:2px solid #31573a;outline-offset:4px;}}
@media(max-width:1080px){.play-layout {grid-template-columns:minmax(0,1fr) 280px;}.cat-supplies{grid-template-columns:1fr}.cat-header h2{max-width:none}.cat-supplies .inventory{justify-content:flex-start}}
@media(max-width:860px){.play-layout{grid-template-columns:minmax(0,1fr)}.cat-supplies{grid-template-columns:auto minmax(0,1fr)}.cat-supplies .inventory{justify-content:flex-end}}
@media(max-width:560px){.command-zone{padding:10px}#dice-dock{grid-template-columns:100px minmax(0,1fr)}#dice-stage{height:100px}.cat-supplies{grid-template-columns:1fr}.cat-header h2{max-width:none}.cat-supplies .inventory{justify-content:flex-start}.event-room-marker{padding:2px 4px}.event-room-marker img{width:23px;height:23px}}
@media(max-width:1100px){.masthead{height:auto;flex-wrap:wrap}.utilities{min-width:0;flex-wrap:wrap}.header-audio{flex-wrap:wrap;max-width:100%}}
.suspect-inspect,.room-inspect { min-width:0; }
.suspect-inspect > div,.room-inspect > div { min-width:0;overflow-wrap:anywhere; }
.innocent-label { overflow-wrap:anywhere;max-width:100%; }
@media(max-width:600px){.suspect-inspect,.room-inspect{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.suspect-inspect .large-suspect,.room-inspect>img{width:auto;max-width:100%;height:160px;object-fit:contain}.suspect-inspect>div,.room-inspect>div{width:100%}}

.event-evidence {display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
.event-evidence:empty{display:none}
.event-evidence .event-cleared-portrait {width:48px;min-height:64px;padding:2px;background:#fff4dc;border:2px solid #31573a}
.event-cleared-portrait img {width:40px;height:57px;object-fit:contain}
.event-room-marker span {overflow-wrap:anywhere}
.suspects {grid-template-columns:repeat(auto-fit,minmax(min(100%,4.1rem),1fr))}
.cleared-stamp {max-width:100%;white-space:normal;overflow-wrap:anywhere}
.header-audio label {grid-template-columns:minmax(0,1fr) max-content;width:142px}
.header-audio output {min-width:3.3em;text-align:right}
