@font-face {
  font-family: "Destruction Manual";
  src: url("./assets/fonts/DestructionManual.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/Outfit-Variable.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07090a;
  --panel: #0d1011;
  --panel-soft: #121515;
  --stone: #22231f;
  --stone-light: #323128;
  --ink: #eee5d2;
  --muted: #aaa08d;
  --faint: #6d675b;
  --gold: #b9985e;
  --gold-bright: #e3c47f;
  --red: #8b3038;
  --green: #718d67;
  --blue: #628ba4;
  --line: rgba(205, 176, 116, 0.22);
  --line-soft: rgba(205, 176, 116, 0.1);
  --cell: 132px;
  --tile-gap: 3px;
  --display: "Destruction Manual", "Arial Black", sans-serif;
  --title: "Outfit", "Segoe UI", Arial, sans-serif;
  --body: "Outfit", "Segoe UI", Arial, sans-serif;
  --font-ui: "Outfit", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 88%, rgba(113, 63, 31, 0.16), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(96, 28, 35, 0.12), transparent 24%),
    #07090a;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(255,255,255,0.018) 30px),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(255,255,255,0.015) 30px);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(227, 196, 127, 0.82);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2,
h3 {
  font-family: var(--title);
  font-weight: 700;
}

.svg-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.asset-image {
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.asset-mask {
  background: currentColor;
  -webkit-mask-image: var(--icon-source);
  mask-image: var(--icon-source);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.is-hidden,
[hidden] {
  display: none !important;
}

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

/* Header */
.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(420px, 1.25fr) auto;
  align-items: center;
  gap: 38px;
  height: 82px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 11, 0.97);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
}

.brand-lockup {
  min-width: 0;
  padding-left: 2px;
}

.brand-lockup h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #d6b46f;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 400;
  line-height: 0.9;
  text-shadow: none;
}

.brand-lockup h1::after {
  display: none;
}

.brand-lockup p {
  margin: 8px 0 0;
  color: #99805a;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.corruption-track {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  padding-inline: 12px;
}

.track-title {
  color: #c5aa73;
  font-family: var(--title);
  font-size: 11px;
}

.corruption-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--corruption-steps, 6), 36px);
  gap: clamp(8px, 1vw, 17px);
  align-items: center;
  max-width: 100%;
  white-space: nowrap;
}

.corruption-nodes::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(104, 145, 91, 0.55), rgba(185, 152, 94, 0.35), rgba(133, 38, 48, 0.65));
}

.corruption-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: auto;
  border: 1px solid rgba(185, 152, 94, 0.3);
  border-radius: 50%;
  color: #817866;
  font-family: var(--body);
  font-weight: 800;
  font-size: 12px;
  background: #101212;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.72);
}

.corruption-node.active {
  color: #fff8ed;
  border-color: rgba(185, 66, 76, 0.78);
  background: #76212a;
  box-shadow: inset 0 0 10px rgba(45, 5, 11, 0.52);
}

.corruption-node.active:first-child {
  color: #e4ca93;
  border-color: rgba(199, 171, 112, 0.62);
  background: #171715;
}

.corruption-node.current {
  border-color: #db6971;
  box-shadow: 0 0 0 4px rgba(151, 42, 51, 0.12), 0 0 14px rgba(151, 42, 51, 0.28), inset 0 0 12px rgba(45, 5, 11, 0.42);
  animation: corruptionCurrentPulse 1800ms ease-in-out infinite;
}

.corruption-node.current:first-child {
  box-shadow: 0 0 0 4px rgba(185, 152, 94, 0.08), inset 0 0 12px rgba(185, 152, 94, 0.12);
  animation: none;
}

body[data-corruption="1"] .corruption-node.current,
body[data-corruption="2"] .corruption-node.current {
  border-color: #a88c58;
}

body[data-corruption="3"] .corruption-node.current,
body[data-corruption="4"] .corruption-node.current {
  color: #fff;
  border-color: #e07078;
  background: #8d222d;
}

.corruption-node.final {
  color: #fff;
  border-color: #bd4852;
  background: #a01f2b;
  animation: corruptionPulse 1600ms ease-in-out infinite;
}

@keyframes corruptionCurrentPulse {
  0%, 100% { filter: brightness(0.96); }
  50% { filter: brightness(1.16); }
}

.world-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.status-line {
  min-width: 68px;
  padding-left: 20px;
  border-left: 1px solid var(--line-soft);
  text-align: center;
}

.status-line span {
  display: block;
  color: #9d865e;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-line strong {
  display: block;
  margin-top: 4px;
  color: #81a9bd;
  font-family: var(--title);
  font-size: 14px;
}

body.boss-awake .status-line:first-child strong {
  color: #c75b63;
}

.new-game {
  min-width: 156px;
  height: 42px;
  border: 1px solid rgba(185, 152, 94, 0.58);
  border-radius: 3px;
  color: #dfc58d;
  font-family: var(--title);
  font-size: 12px;
  background: #181713;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.new-game:hover {
  color: #f0dca8;
  border-color: #d0ad68;
  background: #211d16;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #99805a;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  color: #e0c487;
  background: rgba(185, 152, 94, 0.08);
}

.settings-button span,
.sound-glyph {
  position: relative;
  width: 16px;
  height: 16px;
}

.settings-button span::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px dotted currentColor;
  border-radius: 50%;
}

.sound-glyph::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  width: 9px;
  height: 9px;
  clip-path: polygon(0 32%, 38% 32%, 100% 0, 100% 100%, 38% 68%, 0 68%);
  background: currentColor;
}

.sound-glyph::after {
  content: "";
  position: absolute;
  right: 0;
  top: 3px;
  width: 7px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-radius: 50%;
}

.sound-toggle.muted .sound-glyph::after {
  right: -1px;
  top: 7px;
  width: 9px;
  height: 2px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  transform: rotate(-45deg);
}

/* Los controles de audio permanecen juntos y accesibles desde cualquier pantalla. */
.global-audio-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-sound-toggle,
.global-sfx-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(203, 169, 102, 0.34);
  border-radius: 50%;
  color: #cdb170;
  background: rgba(8, 11, 11, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.global-sfx-toggle {
  font-family: "Outfit", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.global-sound-toggle:hover,
.global-sfx-toggle:hover {
  color: #f0d38b;
  border-color: rgba(229, 195, 123, 0.68);
  background: rgba(16, 19, 18, 0.96);
  transform: translateY(-1px);
}

.global-sound-toggle:focus-visible,
.global-sfx-toggle:focus-visible {
  outline: 2px solid rgba(224, 190, 118, 0.72);
  outline-offset: 3px;
}

.global-sound-toggle svg {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.global-sound-toggle .speaker-body {
  fill: currentColor;
  stroke: none;
}

.global-sound-toggle .speaker-wave,
.global-sound-toggle .speaker-mute {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.global-sound-toggle .speaker-mute {
  display: none;
}

.global-sound-toggle.muted,
.global-sfx-toggle.muted {
  color: #91877a;
  border-color: rgba(145, 135, 122, 0.28);
}

.global-sfx-toggle.muted::after {
  position: absolute;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  content: "";
  transform: rotate(-42deg);
}

.global-sound-toggle.muted .speaker-wave {
  display: none;
}

.global-sound-toggle.muted .speaker-mute {
  display: block;
}

@media (max-width: 700px) {
  .global-audio-controls { gap: 6px; }

  .global-sound-toggle,
  .global-sfx-toggle {
    width: 38px;
    height: 38px;
  }

  .global-sfx-toggle {
    font-size: 9px;
  }
}

/* El tablero escala como una sola pieza: ningún SVG conserva medidas fijas al hacer zoom. */
.board-frame .cell .cell-icon {
  width: 72%;
  height: 72%;
}

.board-frame .cell .cell-icon > .asset-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.board-frame .cell.has-obstacle .cell-icon {
  width: 76%;
  height: 76%;
}

.board-frame .room-event[class*="event-"] .cell-icon {
  width: 74%;
  height: 74%;
}

.board-frame .room-eucari .cell-icon {
  width: 82%;
  height: 82%;
}

.board-frame .room-boss .cell-icon {
  width: 78%;
  height: 78%;
}

.board-frame .room-path .cell-icon {
  opacity: 0.75;
}

.board-frame .room-path:hover .cell-icon,
.board-frame .room-path.selected .cell-icon {
  opacity: 0.88;
}

/* Las acciones siempre ocupan una sola franja; si no caben, se recorren dentro de ella. */
.game-sidebar .action-buttons {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(66px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 166, 99, 0.42) transparent;
}

.game-sidebar .action-buttons::-webkit-scrollbar {
  height: 4px;
}

.game-sidebar .action-buttons::-webkit-scrollbar-thumb {
  background: rgba(199, 166, 99, 0.42);
}

/* Suavizado mínimo: mantiene el carácter sobrio sin convertir la UI en tarjetas redondas. */
.modal,
.playtest-password-modal,
.pass-modal,
.room-lobby-modal,
.encounter-panel,
.dice-panel,
.events-panel,
.extra-popover,
.ai-panel,
.debug-panel {
  border-radius: 5px;
}

.encounter-visual {
  border-radius: 4px 0 0 4px;
}

@media (max-width: 720px) {
  .encounter-visual {
    border-radius: 4px 4px 0 0;
  }
}

@media (min-width: 1101px) {
  .game-sidebar .sheet-layout > .treasures-section .treasure-list {
    display: grid;
    align-items: center;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 100px;
    height: auto;
    padding: 6px 10px;
    overflow-y: visible;
  }
}

@media (min-width: 1101px) {
  .game-sidebar .sheet-layout {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .game-sidebar .sheet-layout > .treasures-section {
    align-self: end;
    min-height: 140px;
    max-height: 154px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 104px;
    height: 108px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (min-width: 1101px) and (max-height: 850px) {
  .game-sidebar .sheet-layout > .treasures-section {
    min-height: 88px;
    max-height: 104px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 68px;
    height: 72px;
  }
}

.game-sidebar .action-button {
  min-width: 0;
}

/* Primary composition */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 390px;
  grid-template-rows: minmax(0, 1fr) 50px 148px;
  column-gap: 18px;
  row-gap: 10px;
  height: calc(100vh - 82px);
  padding: 18px 22px 20px;
}

.board-section {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(185, 152, 94, 0.18);
  border-radius: 5px;
  background: #0b0e0e;
  box-shadow: 0 22px 56px rgba(0,0,0,0.42), inset 0 0 70px rgba(0,0,0,0.48);
}

.player-rail {
  position: relative;
  z-index: 3;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px 10px;
  border-right: 1px solid var(--line-soft);
  background: rgba(7, 8, 8, 0.52);
}

.rail-player {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 94px;
  padding: 9px 5px;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--player);
  background: transparent;
  cursor: default;
  opacity: 0.48;
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.rail-player.active {
  border-left-color: var(--player);
  background: linear-gradient(90deg, color-mix(in srgb, var(--player), transparent 86%), transparent);
  opacity: 1;
}

.rail-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--player), #d7bd83 28%);
  border-radius: 50%;
  background: rgba(0,0,0,0.32);
}

.rail-player.active .rail-avatar {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--player), transparent 88%);
}

.rail-name {
  color: #d9d0bd;
  font-family: var(--body);
  font-weight: 800;
  font-size: 11px;
}

.rail-player small {
  color: #81796b;
  font-size: 9px;
}

.rail-stats {
  display: none;
}

.board-stage {
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.board-toolbar {
  display: grid;
  grid-template-columns: 142px minmax(260px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(185, 152, 94, 0.08);
}

.board-toolbar strong {
  color: #c4ad7d;
  font-family: var(--title);
  font-size: 11px;
}

.board-toolbar > div > span {
  display: none;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #776f61;
  font-size: 9px;
  text-transform: uppercase;
}

.zoom-control input {
  width: 105px;
  accent-color: var(--gold);
}

.zoom-control output {
  min-width: 32px;
  color: #aaa08d;
}

.board-viewport {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 152, 94, 0.42) #090b0b;
}

.board-viewport::-webkit-scrollbar,
.character-sheet::-webkit-scrollbar,
.ai-steps::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.board-viewport::-webkit-scrollbar-track,
.character-sheet::-webkit-scrollbar-track,
.ai-steps::-webkit-scrollbar-track {
  background: #090b0b;
}

.board-viewport::-webkit-scrollbar-thumb,
.character-sheet::-webkit-scrollbar-thumb,
.ai-steps::-webkit-scrollbar-thumb {
  border: 2px solid #090b0b;
  border-radius: 8px;
  background: #65543a;
}

.board-frame {
  position: relative;
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: 24px auto;
  gap: 7px;
  width: max-content;
  min-width: max-content;
  margin: auto;
  padding: 16px 18px 18px 16px;
  border: 1px solid rgba(185, 152, 94, 0.17);
  background: #111311;
  box-shadow: 0 24px 60px rgba(0,0,0,0.58), inset 0 0 44px rgba(0,0,0,0.5);
}

.board-corner {
  grid-column: 1;
  grid-row: 1;
}

.column-ruler,
.row-ruler {
  color: rgba(205, 180, 126, 0.56);
  font-family: var(--title);
  font-size: 10px;
}

.column-ruler {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(var(--map-size, 9), var(--cell));
  gap: var(--tile-gap);
}

.row-ruler {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(var(--map-size, 9), var(--cell));
  gap: var(--tile-gap);
}

.column-ruler span,
.row-ruler span {
  display: grid;
  place-items: center;
}

.board-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(var(--map-size, 9), var(--cell));
  grid-template-rows: repeat(var(--map-size, 9), var(--cell));
  gap: var(--tile-gap);
  width: max-content;
  min-width: max-content;
  padding: 4px;
  border: 1px solid rgba(185, 152, 94, 0.2);
  background: #080a09;
  box-shadow: inset 0 0 28px rgba(0,0,0,0.72);
}

.cell {
  position: relative;
  isolation: isolate;
  grid-column: var(--grid-column);
  grid-row: var(--grid-row);
  width: var(--cell);
  height: var(--cell);
  overflow: hidden;
  border: 1px solid rgba(218, 198, 154, 0.16);
  border-radius: 2px;
  color: #a7a091;
  background:
    radial-gradient(circle at 48% 42%, rgba(255,255,255,0.04), transparent 38%),
    linear-gradient(145deg, #292923, #161816 72%);
  box-shadow: inset 0 1px rgba(255,255,255,0.05), inset 0 -18px 26px rgba(0,0,0,0.38);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, filter 150ms ease, transform 150ms ease;
}

.tile-depth {
  position: absolute;
  inset: 5px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.025);
  background:
    linear-gradient(125deg, rgba(255,255,255,0.025), transparent 35%),
    repeating-linear-gradient(24deg, transparent 0 13px, rgba(255,255,255,0.012) 14px);
}

.coord {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 5;
  color: rgba(224, 209, 174, 0.46);
  font-family: var(--title);
  font-size: 9px;
}

.mystery-mark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-items: center;
  color: rgba(194, 164, 104, 0.48);
  font-family: var(--title);
  font-size: 31px;
}

.cell.hidden {
  border-color: rgba(185, 152, 94, 0.1);
  color: rgba(185, 152, 94, 0.35);
  background: #171917;
}

.cell.hidden .mystery-mark {
  display: grid;
}

.cell.hidden .cell-icon,
.cell.hidden .room-label,
.cell.hidden .feature-marks {
  display: none;
}

.cell-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  opacity: 0.88;
  filter: drop-shadow(0 7px 9px rgba(0,0,0,0.45));
}

.room-label {
  display: none;
}

.cell:hover:not(:disabled) {
  z-index: 6;
  border-color: rgba(227, 196, 127, 0.5);
  filter: brightness(1.08);
}

.cell.selected {
  z-index: 7;
  border-color: #d1af6d;
  box-shadow: inset 0 0 0 2px rgba(209, 175, 109, 0.22), 0 0 18px rgba(185, 152, 94, 0.18);
}

.cell.current {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--player), transparent 46%), 0 0 19px color-mix(in srgb, var(--player), transparent 62%);
}

.cell.targetable {
  z-index: 5;
  border-color: rgba(227, 196, 127, 0.82);
  box-shadow: inset 0 0 24px rgba(227, 196, 127, 0.12), 0 0 15px rgba(185, 152, 94, 0.14);
  animation: targetBreathe 1500ms ease-in-out infinite;
}

.cell.danger-target {
  border-color: rgba(174, 65, 75, 0.88);
  box-shadow: inset 0 0 24px rgba(139, 48, 56, 0.2);
}

.cell.loot-target,
.cell.heal-target {
  border-color: rgba(113, 141, 103, 0.9);
  box-shadow: inset 0 0 24px rgba(113, 141, 103, 0.17);
}

.cell.ability-target {
  border-color: rgba(98, 139, 164, 0.9);
  box-shadow: inset 0 0 24px rgba(98, 139, 164, 0.17);
}

.cell.active-bonfire {
  border-color: rgba(195, 119, 62, 0.75);
}

.room-path { color: #9d9b8d; }
.room-chest { color: #c79f5d; background-color: #262016; }
.room-monster { color: #a4525d; background-color: #24191b; }
.room-monsterChest { color: #bd875d; background-color: #251b17; }
.room-sanctuary { color: #91a582; background-color: #19221b; }
.room-obstacle { color: #9d8a71; background-color: #211f1a; }
.room-event { color: #9282a5; background-color: #1e1924; }
.room-event.event-loseFaith { border-color: rgba(158, 89, 99, 0.58); background-color: #24191d; }
.room-event.event-revealAdjacent { border-color: rgba(113, 144, 154, 0.56); background-color: #172125; }
.room-event.event-gainFaith { border-color: rgba(199, 176, 109, 0.58); background-color: #242419; }
.room-event[class*="event-"] .cell-icon { width: 68px; height: 68px; opacity: 1; }
.room-bonfire { color: #d18754; background-color: #271b15; }
.room-boss { color: #a43845; background: radial-gradient(circle at center, rgba(131,38,47,0.28), transparent 58%), #170d10; }

.room-eucari {
  color: #ebcb80;
  border-color: rgba(227, 196, 127, 0.68);
  background: radial-gradient(circle at center, rgba(227, 196, 127, 0.22), transparent 56%), #211e15;
  box-shadow: inset 0 0 26px rgba(227,196,127,0.12), 0 0 17px rgba(185,152,94,0.12);
}

.room-eucari .cell-icon {
  width: 67px;
  height: 67px;
  animation: sacredPulse 2400ms ease-in-out infinite;
}

.cell.has-obstacle {
  border-color: rgba(184, 157, 111, 0.38);
  background:
    radial-gradient(circle at 50% 46%, rgba(185, 152, 94, 0.09), transparent 48%),
    linear-gradient(145deg, #29261f, #171817 72%);
}

.cell.has-monster {
  border-color: rgba(187, 92, 102, 0.42);
}

.cell.has-obstacle .cell-icon {
  width: 72px;
  height: 72px;
  color: #c0aa82;
  opacity: 1;
  filter: drop-shadow(0 8px 11px rgba(0,0,0,0.56));
}

/* Cada obstáculo conserva una silueta y un acento propios sin romper la paleta mate. */
.obstacle-symbol-abyss { color: #827d92; }
.obstacle-symbol-platform { color: #8797a2; }
.obstacle-symbol-lava { color: #b8654e; }
.obstacle-symbol-poison { color: #7f946c; }
.obstacle-symbol-water { color: #7193a2; }

.cell.has-obstacle.obstacle-abyss { border-color: rgba(132, 123, 148, 0.52); }
.cell.has-obstacle.obstacle-platform,
.cell.has-obstacle.obstacle-water { border-color: rgba(113, 147, 162, 0.52); }
.cell.has-obstacle.obstacle-lava { border-color: rgba(184, 101, 78, 0.58); }
.cell.has-obstacle.obstacle-poison { border-color: rgba(127, 148, 108, 0.56); }

.cell.resolved-primary {
  color: #8b9087;
  background: #1b1d1b;
}

.cell.resolved-primary .cell-icon {
  opacity: 0.48;
  filter: grayscale(1);
}

/* En una guarida saqueable, la amenaza resuelta pierde color sin apagar el cofre pendiente. */
.cell.resolved-primary-icon .cell-icon {
  color: #93988f;
  opacity: 0.48;
  filter: grayscale(1);
}

.feature-marks {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.feature-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 1px solid rgba(220, 199, 153, 0.22);
  border-radius: 50%;
  color: #d2b677;
  background: rgba(8,9,9,0.86);
}

.feature-mark.monster {
  color: #d56f79;
  border-color: rgba(213, 111, 121, 0.62);
  background: rgba(31, 11, 15, 0.94);
  box-shadow: 0 0 0 2px rgba(109, 36, 44, 0.2), 0 4px 10px rgba(0, 0, 0, 0.46);
}
.feature-mark.obstacle { color: #a9987f; }
.feature-mark.corrupt { color: #b53d48; }

.feature-mark.resolved {
  color: #9a9f96;
  border-color: rgba(154, 159, 150, 0.34);
  background: rgba(24, 27, 25, 0.94);
  opacity: 0.84;
  filter: grayscale(1);
}

.tokens {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, 29px);
  gap: 3px;
}

.board-token {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 5px;
  border: 2px solid var(--player);
  border-radius: 50%;
  color: var(--player);
  background: #101112;
  box-shadow: 0 4px 9px rgba(0,0,0,0.5);
}

.board-token.active {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--player), transparent 70%), 0 4px 9px rgba(0,0,0,0.5);
  cursor: grab;
}

.board-token.active:active,
.rail-player.active:active {
  cursor: grabbing;
}

body.dragging-token .board-token.active,
body.dragging-token .rail-player.active {
  opacity: 0.58;
}

.cell.drag-target {
  position: relative;
  border-color: rgba(227, 196, 127, 0.74);
  box-shadow: inset 0 0 34px rgba(227,196,127,0.13), 0 0 13px rgba(227,196,127,0.12);
}

.cell.drag-target::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 7;
  pointer-events: none;
  border: 1px dashed rgba(239, 209, 141, 0.6);
  background: rgba(227, 196, 127, 0.075);
}

body.dragging-token .cell.drag-invalid {
  filter: brightness(0.62) saturate(0.68);
}

.cell.drag-hover {
  z-index: 12;
  border-color: #efd18d;
  transform: scale(1.025);
  box-shadow: inset 0 0 28px rgba(227,196,127,0.18), 0 0 22px rgba(227,196,127,0.2);
}

.cell.drag-invalid-hover {
  z-index: 12;
  border-color: rgba(189, 63, 73, 0.9);
  filter: brightness(0.82) saturate(0.85);
  box-shadow: inset 0 0 30px rgba(139,48,56,0.28), 0 0 18px rgba(139,48,56,0.22);
}

.cell.drag-invalid-hover::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 8;
  pointer-events: none;
  border: 1px solid rgba(205, 75, 84, 0.62);
  background: rgba(139,48,56,0.1);
}

.newly-revealed {
  animation: tileReveal 360ms ease-out;
}

/* Compact room inspection over the board */
.room-inspector {
  position: static;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  width: auto;
  max-height: none;
  padding: 0 15px;
  border: 0;
  border-inline: 1px solid rgba(185, 152, 94, 0.1);
  background: transparent;
  box-shadow: none;
}

.room-inspector-heading {
  display: none;
}

.room-inspector-heading strong {
  color: #cbb17b;
  font-family: var(--body);
  font-weight: 800;
  font-size: 10px;
}

.room-inspector-body {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.inspection-visual {
  width: 34px;
  height: 34px;
  padding: 4px;
  color: #c6a866;
}

.room-inspector-body > div:last-child > span {
  display: block;
  color: #777063;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-inspector-body strong {
  display: block;
  margin-top: 2px;
  color: #e0c68f;
  font-family: var(--title);
  font-size: 11px;
}

.room-inspector-body em {
  display: none;
  margin-top: 3px;
  color: #ac8d60;
  font-size: 9px;
  font-style: normal;
}

.room-inspector-body p {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #aaa190;
  font-size: 8px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.room-inspector-body.danger .inspection-visual { color: #b44a55; }
.room-inspector-body.sacred .inspection-visual { color: #ebcb80; }
.room-inspector-body.treasure .inspection-visual { color: #d2a75b; }
.room-inspector-body.resolved .inspection-visual { color: #969b92; filter: grayscale(1); }

.inspection-tabs {
  display: flex;
  gap: 7px;
  margin: 0 0 0 10px;
  padding: 0;
  border: 0;
}

.inspection-tab {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 5px;
  border: 0;
  border-bottom: 1px solid transparent;
  color: #756e61;
  background: transparent;
  cursor: pointer;
}

.inspection-tab:hover,
.inspection-tab.active {
  color: #d8bb7e;
  border-bottom-color: #b9985e;
}

.errors {
  margin-top: 10px;
  color: #d8868d;
  font-size: 10px;
}

/* Character sheet */
.character-sheet {
  grid-column: 2;
  grid-row: 1 / 4;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: rgba(10, 12, 12, 0.68);
}

.sheet-panel {
  padding: 20px 23px 28px;
}

.sheet-hero {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  min-height: 78px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line-soft);
}

.portrait-ring {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--player), #d7bd83 25%);
  border-radius: 50%;
  color: var(--player);
  background: color-mix(in srgb, var(--player), transparent 90%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--player), transparent 94%);
}

.sheet-identity h2 {
  margin: 4px 0 3px;
  color: #ebd098;
  font-family: var(--title);
  font-size: 25px;
  line-height: 1;
}

.sheet-identity p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.sheet-identity p strong {
  color: #c9b486;
  font-size: 11px;
}

.sheet-identity p em {
  color: #8d836f;
  font-family: var(--body);
  font-weight: 800;
  font-size: 11px;
  font-style: normal;
}

.resource-rows {
  display: grid;
  gap: 0;
  margin-top: 15px;
}

.resource-rows > div,
.resource-rows > button {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 37px;
  border-bottom: 1px solid rgba(185, 152, 94, 0.07);
}

.resource-rows > div:last-child,
.resource-rows > button:last-child {
  border-bottom: 0;
}

.resource-rows > div > span:first-child,
.resource-rows > button > span:first-child {
  color: #95856a;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.resource-rows > div > strong,
.resource-rows > button > strong {
  color: #aaa18f;
  font-size: 9px;
  text-align: right;
}

.checkpoint-marker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bd8b5f;
}

.checkpoint-marker .svg-icon {
  width: 19px;
  height: 19px;
}

.checkpoint-marker b {
  color: #928675;
  font-size: 9px;
  font-weight: 700;
}

.resource-bonfire > strong {
  color: #d0a16f !important;
  font-size: 11px !important;
}

.pip-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pip-row i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid #48453d;
  border-radius: 50%;
  background: #111313;
}

.action-pips i {
  width: 14px;
  height: 14px;
  border-color: rgba(211, 180, 113, 0.45);
}

.action-pips i.filled {
  border-color: #e0c17e;
  background: radial-gradient(circle at 35% 30%, #f4dfad, #b78744 72%);
  box-shadow: 0 0 9px rgba(216, 181, 105, 0.28);
}

.faith-pips i {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
  background: #393832;
}

.faith-pips i.filled {
  background: #e0bf78;
  filter: drop-shadow(0 0 4px rgba(224,191,120,0.34));
}

.spirit-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.spirit-row i {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #46443c;
  border-radius: 50%;
  background: #111313;
  transform: rotate(45deg);
}

.spirit-row i::before,
.spirit-row i::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.34;
}

.spirit-row i::before {
  width: 1px;
  height: 23px;
}

.spirit-row i::after {
  width: 23px;
  height: 1px;
}

.spirit-row i b {
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  border: 1px solid #565248;
  border-radius: 50%;
  background: #181a19;
}

.spirit-row i.filled {
  color: #e1c27d;
  border-color: #c4a363;
  background: rgba(196, 163, 99, 0.09);
  box-shadow: 0 0 10px rgba(196,163,99,0.18);
}

.spirit-row i.filled b {
  border-color: #efd89f;
  background: #d9b56d;
}

.spiritual-goal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 13px 0 0;
  padding: 9px 0;
  color: #9f9177;
}

.spiritual-goal span {
  color: #786f61;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.spiritual-goal strong {
  color: #c5ae7c;
  font-size: 10px;
  text-align: right;
}

.spiritual-goal.confirmed strong {
  color: #9cb28d;
}

.player-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.player-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.player-section-title span,
.blessings-compact > span {
  color: #c1a66f;
  font-family: var(--title);
  font-size: 11px;
}

.player-section-title small {
  color: #776f61;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.artifact-strip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  min-height: 56px;
  padding: 2px 0;
}

.artifact-icon {
  width: 46px;
  height: 46px;
  color: #d2b269;
}

.artifact-strip strong {
  display: block;
  color: #dfc489;
  font-family: var(--title);
  font-size: 14px;
}

.artifact-strip p {
  margin: 4px 0 0;
  color: #9b9385;
  font-size: 9px;
  line-height: 1.4;
}

.wound-list {
  display: grid;
}

.wound {
  position: relative;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(185,152,94,0.07);
}

.wound:last-child {
  border-bottom: 0;
}

.wound-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #c8666a;
}

.wound-icon .wound-symbol {
  width: 100%;
  height: 100%;
}

.wound > div strong {
  display: block;
  color: #d6c5a3;
  font-family: var(--title);
  font-size: 11px;
}

.wound p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: #8f887b;
  font-size: 9px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wound em {
  max-width: 76px;
  color: #7d7567;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
}

.wound.ready em {
  color: #b9a269;
}

.wound.ready .wound-icon,
.wound.completed .wound-icon {
  color: #d9bc78;
}

.wound.healed {
  opacity: 0.58;
}

.wound.healed .wound-icon {
  color: #c9d678;
}

.wound.healed em {
  color: #829579;
}

.wound-heal {
  position: absolute;
  right: 0;
  bottom: 4px;
  padding: 3px 7px;
  border: 0;
  color: #d6bd81;
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  background: transparent;
  cursor: pointer;
}

.blessings-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line-soft);
}

.blessing-list {
  display: flex;
  gap: 7px;
}

.blessing-empty,
.blessing-talisman {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(185,152,94,0.18);
  border-radius: 50%;
  background: transparent;
}

.blessing-talisman {
  padding: 5px;
  color: #c9ab69;
  cursor: pointer;
}

.blessing-talisman:disabled {
  opacity: 0.35;
}

.treasure-list {
  min-height: 106px;
}

.target-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: -3px 0 9px;
  color: #766e61;
  font-size: 8px;
  text-transform: uppercase;
}

.target-options {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.target-option {
  flex: 1 1 0;
  min-width: 0;
  height: 29px;
  overflow: hidden;
  border: 1px solid rgba(185,152,94,0.16);
  border-bottom-color: color-mix(in srgb, var(--target-color), transparent 50%);
  color: #8b8374;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(12,14,14,0.72);
  cursor: pointer;
}

.target-option:hover,
.target-option.active {
  border-color: color-mix(in srgb, var(--target-color), #c6a867 38%);
  color: #e2d5bd;
  background: color-mix(in srgb, var(--target-color), transparent 90%);
}

.treasure-hand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 102px;
  padding: 4px 1px 8px;
}

.treasure-card {
  position: relative;
  display: grid;
  grid-template-rows: 34px auto auto;
  justify-items: center;
  width: 72px;
  height: 98px;
  padding: 9px 6px 7px;
  border: 1px solid rgba(196, 160, 91, 0.52);
  border-radius: 3px;
  color: #d0ae69;
  background: #1d1812;
  box-shadow: 0 5px 12px rgba(0,0,0,0.34), inset 0 0 0 3px #100e0b;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.treasure-card:hover {
  z-index: 20;
  border-color: #ddbd78;
  transform: translateY(-6px);
  box-shadow: 0 12px 22px rgba(0,0,0,0.52);
}

.card-sigil {
  width: 31px;
  height: 31px;
}

.treasure-card strong {
  align-self: end;
  max-width: 100%;
  overflow: hidden;
  color: #dfc58f;
  font-family: var(--title);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treasure-card small {
  max-width: 100%;
  overflow: hidden;
  color: #776d5d;
  font-size: 6px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.treasure-peek {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(218px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid rgba(185,152,94,0.3);
  color: #c2b8a4;
  font-size: 9px;
  line-height: 1.4;
  text-align: left;
  background: #0c0e0e;
  box-shadow: 0 12px 26px rgba(0,0,0,0.58);
}

.treasure-card:hover .treasure-peek {
  display: block;
}

.treasure-card:nth-child(n + 3) .treasure-peek {
  left: auto;
  right: 0;
}

.treasure-add {
  display: grid;
  place-items: center;
  width: 38px;
  height: 56px;
  margin-bottom: 20px;
  border: 1px solid rgba(185,152,94,0.16);
  color: #6e6658;
  background: transparent;
}

.empty {
  margin: 8px 0;
  color: #6f685d;
  font-size: 9px;
  font-style: italic;
}

/* Action bar */
.action-dock {
  position: relative;
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 82px 39px;
  column-gap: 9px;
  padding: 10px 12px 8px;
  border-top: 1px solid var(--line);
  background: rgba(9, 11, 11, 0.78);
}

.action-buttons {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  min-width: 0;
}

.action-button {
  position: relative;
  display: grid;
  grid-template-rows: 39px auto;
  place-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 6px 4px;
  border: 1px solid rgba(185,152,94,0.17);
  border-radius: 3px;
  color: #b69b67;
  background: rgba(22, 22, 19, 0.68);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.action-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 5px;
}

.action-button strong {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--body);
  font-weight: 800;
  font-size: 9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.action-button:hover:not(:disabled) {
  color: #e0c482;
  border-color: rgba(212, 179, 108, 0.48);
  transform: translateY(-2px);
}

.action-button.active:not(:disabled) {
  color: #efd598;
  border-color: #c2a15f;
  background: rgba(72, 57, 31, 0.42);
  box-shadow: inset 0 -3px #b9985e, 0 0 17px rgba(185,152,94,0.13);
}

.action-button:disabled {
  color: #4f4c44;
  border-color: rgba(185,152,94,0.06);
  background: rgba(14,15,15,0.4);
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.58;
}

.action-guidance {
  grid-column: 1 / 3;
  grid-row: 2;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 6px 4px 0 130px;
}

.guidance-mark {
  width: 22px;
  height: 22px;
  padding: 3px;
  color: #a98f5d;
}

.action-guidance strong,
.action-guidance small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-guidance strong {
  color: #c7b488;
  font-size: 10px;
}

.action-guidance small {
  margin-top: 2px;
  color: #7f786c;
  font-size: 8px;
}

.action-guidance.good .guidance-mark { color: #89a47f; }
.action-guidance.bad .guidance-mark { color: #b45760; }
.action-guidance.warning .guidance-mark { color: #c7a45f; }
.action-guidance.victory .guidance-mark { color: #e7c871; }

.action-side {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.faith-commit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  display: none;
  width: 68px;
  padding: 5px;
  border: 1px solid rgba(185,152,94,0.16);
  color: #897d68;
  font-size: 8px;
  text-transform: uppercase;
}

.faith-commit.is-visible {
  display: grid;
  justify-items: center;
}

.faith-commit input {
  width: 44px;
  height: 27px;
  border: 0;
  border-bottom: 1px solid rgba(185,152,94,0.38);
  color: #dfc17c;
  text-align: center;
  background: transparent;
}

.end-turn,
.extra-actions > summary {
  display: grid;
  place-items: center;
  width: 66px;
  height: 74px;
  border: 1px solid rgba(185,152,94,0.2);
  border-radius: 3px;
  color: #baa679;
  font-family: var(--body);
  font-weight: 800;
  font-size: 8px;
  background: transparent;
  cursor: pointer;
}

.end-turn:hover,
.extra-actions > summary:hover {
  border-color: rgba(211,178,108,0.48);
  color: #e0c482;
}

.end-turn:disabled {
  opacity: 0.35;
}

.extra-actions {
  position: relative;
}

.extra-actions > summary {
  grid-template-rows: 39px auto;
  list-style: none;
  text-transform: uppercase;
}

.end-turn span,
.extra-actions > summary span,
.extra-action-grid button span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 4px;
}

.end-turn strong,
.extra-actions > summary strong,
.extra-action-grid button strong {
  font-family: var(--body);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.extra-actions > summary::-webkit-details-marker {
  display: none;
}

.extra-actions[open] {
  z-index: 45;
}

.extra-popover {
  display: none;
}

.extra-actions[open] > .extra-popover {
  position: fixed;
  right: 18px;
  bottom: 112px;
  z-index: 95;
  display: grid;
  gap: 10px;
  width: 272px;
  padding: 12px;
  border: 1px solid rgba(185,152,94,0.28);
  background: #0c0e0e;
  box-shadow: 0 16px 36px rgba(0,0,0,0.58);
}

.extra-popover > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #8c816d;
  font-size: 8px;
}

.extra-actions label select {
  float: right;
  min-height: 25px;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  background: #111313;
}

.extra-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.extra-action-grid button {
  display: grid;
  grid-template-rows: 32px auto;
  place-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 5px 2px;
  border: 1px solid var(--line-soft);
  color: #b6a586;
  background: #131515;
}

/* Floating utilities */
.events-toggle,
.ai-toggle,
.debug-toggle {
  position: fixed;
  z-index: 80;
  bottom: 13px;
  min-height: 36px;
  border: 1px solid rgba(185,152,94,0.3);
  border-radius: 3px;
  color: #bca777;
  font-family: var(--body);
  font-weight: 800;
  font-size: 9px;
  background: rgba(10,12,12,0.96);
  cursor: pointer;
}

.events-toggle {
  left: 18px;
  min-width: 118px;
}

.events-toggle span {
  margin-left: 8px;
  color: #716859;
}

.events-toggle i {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 9px;
  height: 9px;
  border: 2px solid #090b0b;
  border-radius: 50%;
  background: #a84650;
  box-shadow: 0 0 9px rgba(168,70,80,0.5);
}

.ai-toggle {
  right: 105px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
}

.ai-toggle > span {
  width: 13px;
  height: 13px;
  border: 1px solid #7795a3;
  border-radius: 50%;
}

.ai-toggle.active {
  color: #a8c3d0;
  border-color: rgba(98,139,164,0.6);
}

.debug-toggle {
  right: 18px;
  min-width: 76px;
  color: #796f5f;
}

.events-panel,
.ai-panel,
.debug-panel {
  position: fixed;
  z-index: 75;
  border: 1px solid rgba(185,152,94,0.28);
  border-radius: 4px;
  background: rgba(10,12,12,0.98);
  box-shadow: 0 22px 52px rgba(0,0,0,0.68);
}

.events-panel {
  left: 18px;
  bottom: 58px;
  width: 370px;
  max-height: 320px;
  padding: 18px;
}

.events-header,
.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.events-header h2,
.ai-header h2 {
  margin: 0;
  color: #d1b678;
  font-family: var(--title);
  font-size: 13px;
}

.mini-ghost,
.panel-close,
.ai-run-toggle {
  min-height: 27px;
  border: 0;
  color: #8f816b;
  font-size: 8px;
  background: transparent;
  cursor: pointer;
}

.log-list,
.ai-steps {
  display: grid;
  gap: 0;
  max-height: 235px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.log-list li,
.ai-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(185,152,94,0.07);
}

.log-list li > span,
.ai-steps li > span {
  color: #917b55;
  font-family: var(--body);
  font-weight: 800;
  font-size: 8px;
}

.log-list p,
.ai-steps p {
  margin: 0;
  color: #aba291;
  font-size: 9px;
  line-height: 1.4;
}

.ai-panel {
  right: 18px;
  bottom: 58px;
  width: 410px;
  padding: 18px;
}

.ai-header span {
  display: block;
  margin-top: 4px;
  color: #6f8390;
  font-size: 8px;
  text-transform: uppercase;
}

.ai-header-actions {
  display: flex;
  gap: 8px;
}

#aiCurrentStep {
  margin: 0 0 11px;
  color: #c5b89e;
  font-size: 10px;
  line-height: 1.45;
}

.debug-panel {
  right: 18px;
  bottom: 58px;
  width: 430px;
  max-height: 480px;
  padding: 18px;
  overflow-y: auto;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.debug-grid button {
  min-height: 36px;
  border: 1px solid rgba(185,152,94,0.12);
  color: #8e8577;
  font-size: 11px;
  background: #111313;
}

.debug-note {
  margin: 12px 0 0;
  color: #6f685d;
  font-size: 10px;
}

/* Setup and privacy */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(4,6,7,0.84);
  backdrop-filter: blur(6px);
}

.turn-transition {
  position: fixed;
  inset: 0;
  z-index: 119;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #eee7da;
  background: rgba(5, 7, 8, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.turn-transition.is-visible { opacity: 1; }

.turn-transition-token {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--turn-color, #c7a667);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--turn-color, #c7a667), transparent 82%);
}

.turn-transition p {
  margin: 0;
  color: #a99e8c;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.turn-transition strong {
  color: color-mix(in srgb, var(--turn-color, #c7a667), #f5ead4 56%);
  font-family: var(--title);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

.boss-rules-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.boss-rules-summary p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.boss-rules-summary ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.boss-rules-summary li {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(212, 174, 95, 0.22);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.boss-rules-summary li span {
  color: var(--ink-soft);
}

@media (max-width: 620px) {
  .boss-rules-summary ul { grid-template-columns: 1fr; }
}

.modal {
  width: min(960px, 92vw);
  max-height: 88vh;
  padding: 36px;
  overflow-y: auto;
  border: 1px solid rgba(185,152,94,0.34);
  background: #0d1010;
  box-shadow: 0 30px 90px rgba(0,0,0,0.72);
}

.modal-header {
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #8f7b59;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal h2 {
  margin-bottom: 0;
  color: #e0c78f;
  font-family: var(--title);
  font-size: 28px;
}

.modal-intro {
  margin: 9px 0 0;
  color: #91897c;
  font-size: 13px;
  line-height: 1.5;
}

.registration-modal {
  display: grid;
  gap: 24px;
  width: min(760px, 94vw);
  max-height: none;
  padding: 8px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.start-playtest-access {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(185, 152, 94, 0.18);
  color: #81796d;
  font-size: 10px;
  background: rgba(8, 11, 11, 0.78);
}

.start-playtest-access:hover,
.playtest-access-enabled .start-playtest-access {
  border-color: rgba(185, 152, 94, 0.55);
  color: #d6b46f;
}

.playtest-password-backdrop {
  z-index: 120;
}

.playtest-password-modal {
  width: min(410px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid rgba(185, 152, 94, 0.34);
  background: #0b0e0e;
}

.playtest-password-modal h2 {
  margin: 8px 0 10px;
}

.playtest-password-modal > p:not(.eyebrow):not(.online-form-status) {
  margin: 0 0 22px;
  color: #a59b8b;
  line-height: 1.5;
}

.playtest-password-modal .online-form-status {
  min-height: 20px;
  margin: 8px 0 0;
}

.registration-brand {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 4px 20px 0;
  text-align: center;
}

.registration-brand strong {
  color: #d6b46f;
  font-family: var(--display);
  font-size: clamp(54px, 6vw, 78px);
  font-weight: 400;
  line-height: 0.85;
  text-shadow: none;
}

.registration-brand span {
  max-width: 610px;
  color: #a59b8b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
}

.registration-form {
  padding: 26px 30px 28px;
  border: 1px solid rgba(185, 152, 94, 0.22);
  background: rgba(10, 13, 13, 0.94);
}

.registration-form .modal-header {
  margin-bottom: 22px;
}

.registration-form .modal-header h2 {
  font-size: 24px;
}

.player-count-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
  color: #c7b995;
  font-weight: 700;
}

.player-count-field select {
  min-width: 164px;
  padding: 10px 34px 10px 12px;
  border: 1px solid rgba(185, 152, 94, 0.3);
  color: #e5dccb;
  background: #111414;
}

.registration-rows {
  display: grid;
  gap: 7px;
}

.registration-player {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 6px 12px;
  border-left: 2px solid color-mix(in srgb, var(--player) 70%, #7f725a);
  background: rgba(255, 255, 255, 0.018);
}

.registration-token,
.registration-artifact {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--player);
}

.registration-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.registration-copy input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(185, 152, 94, 0.22);
  color: #f0e7d6;
  font-size: 14px;
  font-weight: 700;
  background: #0a0d0d;
}

.registration-copy small {
  color: #81796d;
  font-size: 12px;
}

.registration-form .modal-actions {
  margin-top: 24px;
}

.start-mode-tabs,
.online-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 24px;
  padding: 5px;
  border: 1px solid rgba(185, 152, 94, 0.18);
  background: #090c0c;
}

.start-mode-tabs button,
.online-mode-tabs button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  color: #8e887e;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
}

.start-mode-tabs button:hover,
.online-mode-tabs button:hover {
  color: #d7c49b;
  background: rgba(185, 152, 94, 0.05);
}

.start-mode-tabs button.active,
.online-mode-tabs button.active {
  border-color: rgba(203, 169, 102, 0.42);
  color: #ead49f;
  background: rgba(185, 152, 94, 0.11);
}

.online-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.start-mode-panel {
  min-height: 255px;
}

.mode-summary {
  margin: 0 0 22px;
  padding: 0 2px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: #928a7e;
  font-size: 14px;
  line-height: 1.55;
}

.mode-summary strong {
  color: #d7c59d;
  font-weight: 700;
}

.lobby-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.lobby-fields .wide {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.lobby-field {
  display: grid;
  gap: 8px;
  color: #b9ab89;
  font-size: 13px;
  font-weight: 700;
}

.lobby-field input,
.lobby-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 152, 94, 0.28);
  color: #eee4d2;
  font: 400 14px var(--body);
  background: #090c0c;
  outline: 0;
}

.lobby-field input:focus,
.lobby-field select:focus {
  border-color: rgba(217, 181, 109, 0.7);
  box-shadow: 0 0 0 2px rgba(185, 152, 94, 0.08);
}

#soloSetupPanel .lobby-field {
  margin-bottom: 16px;
}

.rules-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(185, 152, 94, 0.5);
  color: #b9aa88;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.rules-download:hover {
  color: #ead49f;
  border-bottom-color: #d6b46f;
}

.registration-form .modal-actions,
.room-lobby-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.modal-actions.compact {
  margin-top: 18px;
}

.online-form-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: #8f887e;
  font-size: 13px;
  line-height: 1.5;
}

.online-form-status.bad { color: #d27a78; }
.online-form-status.good { color: #9fbd91; }

.room-lobby-modal {
  width: min(720px, 94vw);
  padding: 34px 38px 38px;
  overflow: visible;
}

.room-lobby-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 4px 0 12px;
}

.room-lobby-heading h2 {
  margin: 0 0 7px;
}

.room-lobby-heading p,
.room-lobby-intro {
  margin: 0;
  color: #8f887d;
  font-size: 14px;
  line-height: 1.55;
}

.room-lobby-heading p strong {
  margin-left: 7px;
  color: #e4c982;
  letter-spacing: 0.12em;
}

.room-lobby-heading > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(185, 152, 94, 0.28);
  color: #c6b384;
  font-size: 13px;
}

.room-lobby-intro {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.room-lobby-access {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.room-lobby-access > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 10px 9px 14px;
  border: 1px solid rgba(185, 152, 94, 0.2);
  background: rgba(255, 255, 255, 0.015);
}

.room-lobby-access > div:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
}

.room-lobby-access span {
  grid-column: 1 / -1;
  color: #837c71;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.room-lobby-access strong {
  min-width: 0;
  overflow: hidden;
  color: #e4c982;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-lobby-access button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 11px;
}

.room-lobby-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 8px;
}

.room-lobby-player {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 8px 14px 8px 10px;
  border-left: 2px solid color-mix(in srgb, var(--player) 72%, #7f725a);
  background: rgba(255, 255, 255, 0.018);
}

.room-lobby-player > span {
  width: 34px;
  height: 40px;
  color: var(--player);
}

.room-lobby-player strong {
  color: #e7dcc8;
  font-size: 15px;
}

.room-lobby-player small {
  color: #8d8579;
  font-size: 12px;
}

.room-lobby-player.vacant,
.room-lobby-player.closed {
  border-left-color: rgba(185, 152, 94, 0.16);
}

.room-lobby-player.vacant strong {
  color: #a59b8a;
}

.room-lobby-player.closed {
  opacity: 0.42;
}

.room-lobby-player.disconnected {
  opacity: 0.62;
}

.room-lobby-slot-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(185, 152, 94, 0.2);
  color: #7f7668;
  font-size: 11px;
  font-weight: 700;
}

.online-status {
  max-width: 155px;
  overflow: hidden;
  color: #9fc0bd;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-waiting {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 56px 24px;
  text-align: center;
}

.setup-waiting-mark {
  width: 48px;
  height: 48px;
  color: #b9985e;
}

.setup-waiting h3 {
  margin: 0;
  color: #dfc78f;
  font-family: var(--title);
  font-size: 24px;
}

.setup-waiting p {
  max-width: 460px;
  margin: 0;
  color: #928a7e;
  font-size: 14px;
  line-height: 1.55;
}

.registration-artifact {
  color: #b9985e;
}

.setup-player {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.setup-token {
  width: 50px;
  height: 50px;
  padding: 10px;
  color: var(--player);
}

.setup-player h3 {
  margin: 0 0 4px;
  color: #dcc18a;
  font-family: var(--title);
  font-size: 19px;
}

.setup-player p {
  margin: 0;
  color: #91897c;
  font-size: 12px;
  line-height: 1.45;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.draft-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 156px;
  padding: 20px;
  border: 1px solid rgba(185,152,94,0.14);
  cursor: pointer;
}

.draft-card .draft-wound-icon {
  display: block;
  width: 42px;
  height: 42px;
  color: #c8666a;
}

.draft-card:has(input:checked) {
  border-color: rgba(200,166,99,0.62);
  background: rgba(75,57,30,0.24);
}

.draft-card input {
  position: absolute;
  right: 12px;
  top: 12px;
  accent-color: var(--gold);
}

.draft-card strong {
  color: #d7be88;
  font-family: var(--title);
  font-size: 16px;
}

.draft-card span,
.draft-card em {
  color: #948c7e;
  font-size: 12px;
  line-height: 1.45;
}

.draft-card em {
  color: #8da083;
  font-size: 11px;
  font-style: normal;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.primary,
.ghost {
  min-height: 46px;
  padding: 0 21px;
  border: 1px solid rgba(185,152,94,0.42);
  color: #d8bd82;
  font-family: var(--body);
  font-weight: 800;
  font-size: 12px;
  background: #181713;
}

.ghost {
  color: #8e8472;
  background: transparent;
}

.wide {
  width: 100%;
}

.pass-modal {
  width: min(480px, 92vw);
  text-align: center;
}

.pass-modal p:not(.eyebrow) {
  color: #978f81;
  font-size: 14px;
  line-height: 1.5;
}

@keyframes tileReveal {
  0% { opacity: 0.25; filter: brightness(0.72) saturate(0.72); }
  55% { opacity: 1; filter: brightness(1.18) saturate(1.06); }
  100% { opacity: 1; filter: brightness(1) saturate(1); }
}

@keyframes sacredPulse {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(227,196,127,0.25)); }
  50% { filter: drop-shadow(0 0 11px rgba(227,196,127,0.42)); }
}

@keyframes corruptionPulse {
  0%, 100% { box-shadow: 0 0 9px rgba(189,72,82,0.26); }
  50% { box-shadow: 0 0 20px rgba(189,72,82,0.5); }
}

@keyframes targetBreathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1500px) {
  :root {
    --cell: 124px;
  }

  .topbar {
    grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1fr) auto;
    gap: 24px;
    padding-inline: 22px;
  }

  .app-shell {
    grid-template-columns: minmax(680px, 1fr) 350px;
    gap: 14px;
    padding: 14px 16px 16px;
  }

  .board-section {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .player-rail {
    padding-inline: 7px;
  }

  .rail-player {
    min-height: 86px;
  }

  .sheet-panel {
    padding-inline: 18px;
  }

  .action-dock {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .action-buttons {
    gap: 6px;
  }
}

@media (max-width: 1366px) {
  :root {
    --cell: 118px;
  }

  .topbar {
    height: 78px;
    grid-template-columns: 220px minmax(330px, 1fr) auto;
    gap: 18px;
    padding: 10px 16px;
  }

  .brand-lockup h1 {
    font-size: 29px;
  }

  .corruption-nodes {
    grid-template-columns: repeat(var(--corruption-steps, 6), 30px);
    gap: 10px;
  }

  .corruption-node {
    width: 29px;
    height: 29px;
  }

  .world-status {
    gap: 11px;
  }

  .status-line {
    min-width: 55px;
    padding-left: 11px;
  }

  .new-game {
    min-width: 138px;
  }

  .world-status .icon-button:not(.sound-toggle) {
    display: none;
  }

  .app-shell {
    grid-template-columns: minmax(650px, 1fr) 330px;
    grid-template-rows: minmax(0, 1fr) 50px 142px;
    height: calc(100vh - 78px);
    gap: 12px;
    padding: 10px 12px 12px;
  }

  .board-section {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .player-rail {
    gap: 10px;
    padding-block: 14px;
  }

  .rail-player {
    min-height: 76px;
    padding-block: 5px;
  }

  .rail-avatar {
    width: 43px;
    height: 43px;
  }

  .room-inspector {
    padding-inline: 10px;
  }

  .sheet-panel {
    padding: 13px 16px 52px;
  }

  .sheet-hero {
    grid-template-columns: 58px minmax(0,1fr);
    min-height: 66px;
    padding-bottom: 12px;
  }

  .portrait-ring {
    width: 56px;
    height: 56px;
    padding: 12px;
  }

  .resource-rows > div,
  .resource-rows > button {
    grid-template-columns: 104px minmax(0,1fr) 31px;
    min-height: 30px;
  }

  .resource-rows {
    margin-top: 10px;
  }

  .spiritual-goal {
    margin-top: 7px;
    padding-block: 6px;
  }

  .player-section {
    margin-top: 10px;
    padding-top: 10px;
  }

  .player-section-title {
    margin-bottom: 7px;
  }

  .artifact-strip {
    grid-template-columns: 42px minmax(0,1fr);
    min-height: 48px;
  }

  .artifact-icon {
    width: 39px;
    height: 39px;
  }

  .wound {
    min-height: 45px;
    padding-block: 5px;
  }

  .wound p {
    -webkit-line-clamp: 1;
  }

  .blessings-compact {
    margin-top: 8px;
    padding-top: 8px;
  }

  .treasure-list,
  .treasure-hand {
    min-height: 88px;
  }

  .treasure-card {
    width: 68px;
    height: 86px;
    grid-template-rows: 29px auto auto;
  }

  .card-sigil {
    width: 27px;
    height: 27px;
  }

  .action-dock {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-rows: 84px 38px;
    column-gap: 10px;
    padding: 8px 9px 7px;
  }

  .action-button {
    min-height: 75px;
  }

  .action-button span {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr auto;
    row-gap: 16px;
    padding: 16px 18px;
  }

  .corruption-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .world-status {
    grid-column: 2;
    grid-row: 1;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 700px auto auto auto;
    height: auto;
  }

  .board-section {
    grid-column: 1;
    grid-row: 1;
  }

  .character-sheet {
    grid-column: 1;
    grid-row: 3;
    overflow: visible;
  }

  .action-dock {
    grid-column: 1;
    grid-row: 4;
    min-height: 148px;
  }
}

@media (max-height: 950px) and (min-width: 1101px) {
  .sheet-panel {
    padding: 10px 14px 48px;
  }

  .sheet-hero {
    grid-template-columns: 49px minmax(0, 1fr);
    gap: 13px;
    min-height: 53px;
    padding-bottom: 8px;
  }

  .portrait-ring {
    width: 47px;
    height: 47px;
    padding: 10px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--player), transparent 94%);
  }

  .sheet-identity h2 {
    margin-block: 3px 1px;
    font-size: 20px;
  }

  .sheet-identity p strong,
  .sheet-identity p em {
    font-size: 9px;
  }

  .resource-rows {
    margin-top: 6px;
  }

  .resource-rows > div,
  .resource-rows > button {
    grid-template-columns: 105px minmax(0, 1fr) 30px;
    min-height: 26px;
  }

  .resource-rows > div > span:first-child,
  .resource-rows > div > strong,
  .resource-rows > button > span:first-child,
  .resource-rows > button > strong {
    font-size: 7px;
  }

  .spirit-row i {
    width: 15px;
    height: 15px;
  }

  .spirit-row i::before {
    height: 19px;
  }

  .spirit-row i::after {
    width: 19px;
  }

  .spiritual-goal {
    margin-top: 4px;
    padding-block: 4px;
  }

  .player-section {
    margin-top: 6px;
    padding-top: 7px;
  }

  .player-section-title {
    margin-bottom: 4px;
  }

  .player-section-title span,
  .blessings-compact > span {
    font-size: 10px;
  }

  .artifact-strip {
    grid-template-columns: 35px minmax(0,1fr);
    gap: 10px;
    min-height: 38px;
  }

  .artifact-icon {
    width: 33px;
    height: 33px;
  }

  .artifact-strip strong {
    font-size: 12px;
  }

  .artifact-strip p {
    display: -webkit-box;
    margin-top: 2px;
    overflow: hidden;
    font-size: 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .wound {
    grid-template-columns: 25px minmax(0, 1fr) 66px;
    gap: 8px;
    min-height: 38px;
    padding-block: 3px;
  }

  .wound-icon {
    width: 23px;
    height: 23px;
  }

  .wound > div strong {
    font-size: 10px;
  }

  .wound p {
    margin-top: 1px;
    font-size: 8px;
  }

  .wound em {
    font-size: 6px;
  }

  .blessings-compact {
    margin-top: 4px;
    padding-top: 6px;
  }

  .blessing-empty,
  .blessing-talisman {
    width: 23px;
    height: 23px;
  }

  .treasure-list,
  .treasure-hand {
    min-height: 71px;
  }

  .target-select {
    margin: -4px 0 3px;
  }

  .treasure-hand {
    gap: 8px;
    padding-block: 1px 4px;
  }

  .treasure-card {
    width: 62px;
    height: 70px;
    grid-template-rows: 24px auto auto;
    padding: 6px 5px 5px;
  }

  .card-sigil {
    width: 22px;
    height: 22px;
  }

  .treasure-add {
    height: 48px;
    margin-bottom: 11px;
  }
}

@media (max-width: 700px) {
  :root {
    --cell: 108px;
  }

  .brand-lockup h1 {
    font-size: 25px;
  }

  .brand-lockup p,
  .world-status .status-line {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .new-game {
    min-width: 122px;
  }

  .corruption-nodes {
    gap: 5px;
  }

  .registration-player {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 10px;
    padding-inline: 10px;
  }

  .app-shell {
    padding-inline: 7px;
  }

  .board-section {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .rail-name {
    font-size: 9px;
  }

  .rail-player small {
    display: none;
  }

  .board-viewport {
    padding: 12px 18px 18px 12px;
  }

  .room-inspector {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 50px;
  }

  .action-dock {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 260px;
  }

  .action-buttons {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
  }

  .action-guidance {
    grid-column: 1;
    grid-row: 2;
  }

  .action-side {
    display: grid;
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 38px;
  }

  .draft-grid {
    grid-template-columns: 1fr;
  }

  .events-panel,
  .ai-panel,
  .debug-panel {
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* Legibility pass: use the available height instead of compressing the sheet. */
@media (min-width: 1101px) {
  .brand-lockup p,
  .status-line span {
    font-size: 11px;
  }

  .track-title {
    font-size: 12px;
  }

  .rail-name {
    font-size: 13px;
  }

  .rail-player small {
    font-size: 11px;
  }

  .board-toolbar strong {
    font-size: 13px;
  }

  .zoom-control {
    font-size: 11px;
  }

  .coord {
    font-size: 10px;
  }

  .room-inspector-body {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .inspection-visual {
    width: 39px;
    height: 39px;
  }

  .room-inspector-body > div:last-child > span {
    font-size: 10px;
  }

  .room-inspector-body strong {
    font-size: 13px;
  }

  .room-inspector-body p {
    font-size: 11px;
    line-height: 1.35;
  }

  .sheet-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 16px 18px 42px;
  }

  .sheet-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 15px;
    min-height: 68px;
    padding-bottom: 12px;
  }

  .portrait-ring {
    width: 56px;
    height: 56px;
    padding: 12px;
  }

  .sheet-identity h2 {
    font-size: 24px;
  }

  .sheet-identity p strong,
  .sheet-identity p em {
    font-size: 12px;
  }

  .resource-rows {
    margin-top: 10px;
  }

  .resource-rows > div,
  .resource-rows > button {
    grid-template-columns: 104px minmax(0, 1fr) 40px;
    column-gap: 8px;
    min-height: 34px;
  }

  .resource-rows > div > span:first-child,
  .resource-rows > button > span:first-child {
    font-size: 11px;
  }

  .resource-rows > div > strong,
  .resource-rows > button > strong {
    font-size: 10px;
  }

  .spiritual-goal {
    margin-top: 9px;
    padding-block: 8px;
  }

  .spiritual-goal span {
    font-size: 10px;
  }

  .spiritual-goal strong {
    font-size: 12px;
    line-height: 1.35;
  }

  .player-section {
    margin-top: 12px;
    padding-top: 11px;
  }

  .player-section-title {
    margin-bottom: 8px;
  }

  .player-section-title span,
  .blessings-compact > span {
    font-size: 13px;
  }

  .player-section-title small {
    font-size: 10px;
  }

  .artifact-strip {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    min-height: 50px;
  }

  .artifact-icon {
    width: 40px;
    height: 40px;
  }

  .artifact-strip strong {
    font-size: 15px;
  }

  .artifact-strip p {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .wound {
    grid-template-columns: 27px minmax(0, 1fr) 72px;
    gap: 10px;
    min-height: 52px;
    padding-block: 6px;
  }

  .wound > div strong {
    font-size: 12px;
  }

  .wound p {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.35;
  }

  .wound em,
  .wound-heal {
    font-size: 9px;
  }

  .blessings-compact {
    margin-top: 11px;
    padding-top: 10px;
  }

  .target-select,
  .target-option {
    font-size: 10px;
  }

  .treasures-section {
    flex: 1 0 auto;
    min-height: 136px;
  }

  .treasure-list,
  .treasure-hand {
    min-height: 96px;
  }

  .treasure-card {
    width: 70px;
    height: 88px;
    grid-template-rows: 30px auto auto;
    padding: 8px 6px 6px;
  }

  .card-sigil {
    width: 28px;
    height: 28px;
  }

  .treasure-card strong {
    font-size: 10px;
  }

  .treasure-card small {
    font-size: 8px;
  }

  .treasure-peek {
    font-size: 11px;
  }

  .action-button strong,
  .end-turn,
  .extra-actions > summary,
  .end-turn strong,
  .extra-actions > summary strong,
  .extra-action-grid button strong {
    font-size: 11px;
  }

  .action-guidance strong {
    font-size: 12px;
  }

  .action-guidance small {
    font-size: 10px;
  }
}

@media (max-width: 1366px) and (min-width: 1101px) {
  .app-shell {
    grid-template-columns: minmax(620px, 1fr) 350px;
  }

  .board-section {
    grid-template-columns: 94px minmax(0, 1fr);
  }
}

/* Physical dice moment */
.dice-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 5, 0.72);
  backdrop-filter: blur(2px);
  transition: opacity 180ms ease;
}

.dice-overlay.is-hidden {
  display: none;
}

.dice-panel {
  width: min(520px, calc(100vw - 32px));
  padding: 26px 28px 22px;
  border: 1px solid rgba(185, 152, 94, 0.5);
  background: #0c0f0f;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
  text-align: center;
}

.dice-panel h2 {
  margin: 5px 0 8px;
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
}

.dice-panel > p:not(.eyebrow) {
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dice-throw-zone {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 150px;
  padding: 18px 22px;
  border: 1px dashed rgba(185, 152, 94, 0.35);
  background: #080a0a;
}

.dice-throw-zone.is-over {
  border-color: var(--gold-bright);
  background: #11130f;
}

.visual-die {
  position: relative;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 104px;
  height: 104px;
  padding: 15px;
  border: 2px solid #d4bd8c;
  border-radius: 12px;
  color: #17130e;
  background: #d8c49b;
  box-shadow: 0 10px 0 #7c6741, 0 18px 28px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transform: rotate(-4deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.visual-die:hover {
  transform: translateY(-4px) rotate(2deg);
  box-shadow: 0 14px 0 #7c6741, 0 24px 34px rgba(0, 0, 0, 0.58);
}

.visual-die.is-selected {
  outline: 3px solid rgba(228, 199, 132, 0.5);
  outline-offset: 5px;
  transform: translateY(-5px) rotate(2deg) scale(1.03);
}

.visual-die:active,
.visual-die.is-dragging {
  cursor: grabbing;
  transform: scale(1.04) rotate(8deg);
}

.visual-die.is-rolling {
  animation: diceTumble 950ms cubic-bezier(.2, .8, .2, 1);
}

.visual-die.is-landed,
.visual-die.is-landed:hover,
.visual-die.is-landed:active {
  z-index: 2;
  cursor: default;
  transform: translate(175px, 0) rotate(360deg) scale(1);
  box-shadow: 0 10px 0 #7c6741, 0 20px 34px rgba(0, 0, 0, 0.62);
}

.die-dot {
  align-self: center;
  justify-self: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #231d14;
  opacity: 0;
}

.visual-die[data-face="1"] [data-dot="5"],
.visual-die[data-face="2"] [data-dot="1"],
.visual-die[data-face="2"] [data-dot="9"],
.visual-die[data-face="3"] [data-dot="1"],
.visual-die[data-face="3"] [data-dot="5"],
.visual-die[data-face="3"] [data-dot="9"],
.visual-die[data-face="4"] [data-dot="1"],
.visual-die[data-face="4"] [data-dot="3"],
.visual-die[data-face="4"] [data-dot="7"],
.visual-die[data-face="4"] [data-dot="9"],
.visual-die[data-face="5"] [data-dot="1"],
.visual-die[data-face="5"] [data-dot="3"],
.visual-die[data-face="5"] [data-dot="5"],
.visual-die[data-face="5"] [data-dot="7"],
.visual-die[data-face="5"] [data-dot="9"],
.visual-die[data-face="6"] [data-dot="1"],
.visual-die[data-face="6"] [data-dot="3"],
.visual-die[data-face="6"] [data-dot="4"],
.visual-die[data-face="6"] [data-dot="6"],
.visual-die[data-face="6"] [data-dot="7"],
.visual-die[data-face="6"] [data-dot="9"] {
  opacity: 1;
}

.dice-landing {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid rgba(185, 152, 94, 0.18);
  color: rgba(227, 196, 127, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.dice-result {
  display: block;
  min-height: 31px;
  margin-top: 17px;
  color: var(--gold-bright);
  font-size: 20px;
}

.dice-panel.has-result .dice-result {
  display: block;
  padding-right: 26px;
  text-align: right;
  animation: diceResult 520ms ease both;
}

@keyframes diceTumble {
  0% { transform: translate(0, 0) rotate(-4deg) scale(1); }
  35% { transform: translate(78px, -24px) rotate(165deg) scale(1.08); }
  70% { transform: translate(155px, 7px) rotate(310deg) scale(0.96); }
  100% { transform: translate(175px, 0) rotate(360deg) scale(1); }
}

@keyframes diceResult {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .dice-panel { padding: 22px 18px 18px; }
  .dice-throw-zone { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 15px; }
  .visual-die { width: 88px; height: 88px; padding: 13px; }
  .visual-die.is-landed,
  .visual-die.is-landed:hover,
  .visual-die.is-landed:active {
    transform: translate(112px, 0) rotate(360deg) scale(1);
  }
  .dice-panel.has-result .dice-result { padding-right: 18px; }
  @keyframes diceTumble {
    0% { transform: translate(0, 0) rotate(-4deg) scale(1); }
    50% { transform: translate(62px, -18px) rotate(180deg) scale(1.06); }
    100% { transform: translate(112px, 0) rotate(360deg) scale(1); }
  }
}

/* Staged encounters and interactions */
.encounter-overlay {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 5, 0.74);
  backdrop-filter: blur(2px);
}

.encounter-overlay.is-hidden {
  display: none;
}

.encounter-panel {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(780px, calc(100vw - 40px));
  min-height: 350px;
  border: 1px solid rgba(185, 152, 94, 0.48);
  background: #0b0e0e;
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.74);
}

.encounter-visual {
  display: grid;
  place-items: center;
  min-height: 350px;
  padding: 24px;
  border-right: 1px solid rgba(185, 152, 94, 0.2);
  color: var(--gold-bright);
  background: radial-gradient(circle at center, rgba(185, 152, 94, 0.12), transparent 58%), #080a0a;
}

.encounter-visual svg {
  width: 128px;
  height: 128px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55));
}

.encounter-visual .wound-symbol {
  width: 128px;
  height: 128px;
}

.encounter-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 42px 44px 34px;
}

.encounter-copy h2 {
  margin: 8px 0 14px;
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.16;
}

.encounter-description {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.encounter-changes {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.encounter-changes.is-hidden {
  display: none;
}

.encounter-changes > span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.encounter-change-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid rgba(185, 152, 94, 0.2);
}

.encounter-change {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-areas: "icon copy values";
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(185, 152, 94, 0.14);
  background: rgba(255, 255, 255, 0.012);
}

.encounter-change:nth-child(odd) {
  border-right: 0;
}

.encounter-change-icon {
  grid-area: icon;
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--gold-bright);
  opacity: 0.82;
}

.encounter-change-icon img,
.encounter-change-icon svg,
.encounter-change-icon .asset-mask {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.encounter-change-copy {
  grid-area: copy;
  min-width: 0;
}

.encounter-change-copy strong,
.encounter-change-copy small {
  display: block;
}

.encounter-change-copy strong {
  overflow: hidden;
  color: var(--ivory);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.encounter-change-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-wrap: pretty;
}

.encounter-change-values {
  grid-area: values;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.encounter-change-values b:last-child {
  color: var(--ivory);
}

.encounter-change-values i {
  color: var(--gold);
  font-style: normal;
}

.encounter-change.good .encounter-change-icon,
.encounter-change.good .encounter-change-values b:last-child {
  color: #a9c992;
}

.encounter-change.bad .encounter-change-icon,
.encounter-change.bad .encounter-change-values b:last-child {
  color: #d36b73;
}

.encounter-change.spent .encounter-change-values b:first-child {
  color: var(--ivory);
}

.encounter-change.spent .encounter-change-values b:last-child {
  color: #b7a98d;
}

.encounter-rule {
  margin-top: 24px;
  padding: 15px 0;
  border-top: 1px solid rgba(185, 152, 94, 0.2);
  border-bottom: 1px solid rgba(185, 152, 94, 0.2);
}

.encounter-rule span {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.encounter-rule strong {
  display: block;
  color: var(--ivory);
  font-size: 14px;
  line-height: 1.45;
}

.encounter-options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.player-summary-token {
  display: grid;
  place-items: center;
  width: min(152px, 62%);
  aspect-ratio: 1;
  color: var(--player);
}

.player-summary-token .player-symbol {
  width: 74%;
  height: 74%;
  color: var(--player);
  background: var(--player);
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.52));
}

.player-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(185, 152, 94, 0.18);
  border-radius: 4px;
  background: rgba(185, 152, 94, 0.15);
}

.player-summary-stats > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  background: #0b0e0e;
}

.player-summary-stats small,
.player-summary-heading span {
  color: var(--muted);
  font-size: 11px;
}

.player-summary-stats strong {
  overflow: hidden;
  color: var(--ivory);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-summary-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  color: var(--gold-bright);
}

.player-summary-wounds {
  display: grid;
  border-top: 1px solid rgba(185, 152, 94, 0.18);
}

.player-summary-wound {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(185, 152, 94, 0.12);
}

.player-summary-wound > span,
.player-summary-wound > span img,
.player-summary-wound > span svg,
.player-summary-wound > span .asset-mask {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.player-summary-wound > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player-summary-wound strong {
  color: var(--ivory);
  font-size: 13px;
}

.player-summary-wound small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-summary-wound > b {
  color: #8e8778;
  font-size: 10px;
  text-transform: uppercase;
}

.player-summary-wound.ready > b {
  color: var(--gold-bright);
}

.player-summary-wound.healed > b {
  color: #91bd7b;
}

@media (max-width: 620px) {
  .player-summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-summary-wound {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .player-summary-wound > b {
    grid-column: 2;
    justify-self: start;
  }

  .player-summary-wound small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .encounter-change {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas:
      "icon copy"
      ". values";
    gap: 6px 10px;
  }

  .encounter-change-values {
    justify-self: start;
  }
}

.encounter-option-label {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.encounter-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.encounter-choice {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 152, 94, 0.2);
  color: #bcb29f;
  text-align: left;
  background: rgba(20, 22, 21, 0.72);
  cursor: pointer;
}

.encounter-choice strong {
  color: #ddd1b9;
  font-size: 13px;
}

.encounter-choice small {
  color: #857c6c;
  font-size: 10px;
  line-height: 1.35;
}

.encounter-choice:hover:not(:disabled),
.encounter-choice.active {
  border-color: rgba(227, 196, 127, 0.68);
  color: #ead49c;
  background: rgba(72, 57, 31, 0.36);
}

.encounter-choice:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.encounter-benefit {
  margin: 0;
  padding-left: 11px;
  border-left: 2px solid rgba(185, 152, 94, 0.42);
  color: #aaa08d;
  font-size: 12px;
  line-height: 1.45;
}

.encounter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: 26px;
}

.encounter-actions button {
  min-height: 44px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
}

.encounter-cancel {
  border: 1px solid rgba(185, 152, 94, 0.2);
  color: var(--muted);
  background: transparent;
}

.encounter-next {
  border: 1px solid var(--gold);
  color: #16110b;
  background: var(--gold-bright);
}

.encounter-panel.good .encounter-visual {
  color: #9fbd8f;
  background: radial-gradient(circle at center, rgba(107, 145, 91, 0.18), transparent 58%), #080a0a;
}

.encounter-panel.good .wound-symbol {
  color: #c9d678;
}

.encounter-panel.bad .encounter-visual,
.encounter-panel.danger .encounter-visual {
  color: #c75c66;
  background: radial-gradient(circle at center, rgba(150, 45, 56, 0.18), transparent 58%), #080a0a;
}

.encounter-panel.sacred .encounter-visual {
  color: #e3c47f;
  background: radial-gradient(circle at center, rgba(227, 196, 127, 0.2), transparent 58%), #080a0a;
}

.encounter-panel.milestone {
  border-color: rgba(227, 196, 127, 0.72);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(227, 196, 127, 0.08);
}

.encounter-panel.milestone .encounter-visual {
  position: relative;
}

.encounter-panel.milestone .encounter-visual::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border: 1px solid currentColor;
  opacity: 0.16;
  transform: rotate(45deg);
  animation: milestoneSeal 5s linear infinite;
}

.encounter-panel.milestone-faith .encounter-visual,
.encounter-panel.milestone-healing .encounter-visual {
  color: #dfe98b;
  background: radial-gradient(circle at center, rgba(215, 225, 114, 0.18), transparent 60%), #080a0a;
}

.encounter-panel.milestone-boss {
  border-color: rgba(185, 58, 68, 0.78);
}

.encounter-panel.milestone-boss .encounter-visual {
  color: #df5964;
  background: radial-gradient(circle at center, rgba(150, 34, 45, 0.25), transparent 62%), #08090a;
}

.encounter-panel.milestone-return .encounter-visual {
  color: #d18b57;
}

@keyframes milestoneSeal {
  to { transform: rotate(405deg); }
}

@media (max-width: 700px) {
  .registration-form {
    padding: 22px 20px 24px;
  }

  .start-mode-tabs {
    gap: 4px;
  }

  .start-mode-tabs button,
  .online-mode-tabs button {
    padding-inline: 8px;
    font-size: 13px;
  }

  .lobby-fields {
    grid-template-columns: 1fr;
  }

  .room-lobby-modal {
    padding: 28px 22px 30px;
  }

  .room-lobby-access,
  .room-lobby-players {
    grid-template-columns: 1fr;
  }

  .room-lobby-player {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .room-lobby-player small {
    grid-column: 2;
  }
}

.wound[data-wound] {
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.wound[data-wound]:hover,
.wound[data-wound]:focus-visible {
  background: rgba(185, 152, 94, 0.08);
  outline: 1px solid rgba(185, 152, 94, 0.3);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .encounter-panel { grid-template-columns: 1fr; min-height: 0; }
  .encounter-visual { min-height: 150px; padding: 20px; border-right: 0; border-bottom: 1px solid rgba(185, 152, 94, 0.2); }
  .encounter-visual svg { width: 82px; height: 82px; }
  .encounter-visual .wound-symbol { width: 82px; height: 82px; }
  .encounter-copy { padding: 26px 24px 22px; }
  .encounter-copy h2 { font-size: 24px; }
  .encounter-change-list { grid-template-columns: 1fr; }
  .encounter-change:nth-child(odd) { border-right: 0; }
}

/* Playtest simplification: clear turn ownership and explicit test wagers. */
.rail-player:not(.active) {
  opacity: 0.25;
  filter: saturate(0.45) brightness(0.66);
}

.rail-player.active {
  animation: activeRailGlow 2.4s ease-in-out infinite;
}

.rail-player.active .rail-avatar {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--player), transparent 78%), 0 0 22px color-mix(in srgb, var(--player), transparent 66%);
}

.board-token:not(.active) {
  opacity: 0.32;
  filter: saturate(0.4) brightness(0.68);
}

.board-token.active {
  z-index: 3;
}

@keyframes activeRailGlow {
  0%, 100% { background-color: color-mix(in srgb, var(--player), transparent 94%); }
  50% { background-color: color-mix(in srgb, var(--player), transparent 86%); }
}

.resource-explainer {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: help;
}

.resource-explainer:hover,
.resource-explainer:focus-visible {
  background: rgba(139, 48, 56, 0.08);
  outline: 1px solid rgba(185, 80, 88, 0.22);
  outline-offset: 2px;
}

.resource-explainer > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resource-explainer > span:first-child i {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(185, 152, 94, 0.35);
  border-radius: 50%;
  color: #b59c69;
  font-size: 9px;
  font-style: normal;
}

.faith-wager {
  display: grid;
  gap: 12px;
}

.faith-wager > div:first-child {
  display: grid;
  gap: 5px;
}

.faith-wager > div:first-child > span {
  color: #a69b87;
  font-size: 13px;
  line-height: 1.45;
}

.faith-wager-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
}

.faith-wager-choice {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(185, 152, 94, 0.22);
  color: #aa9d85;
  background: rgba(18, 20, 19, 0.72);
  cursor: pointer;
}

.faith-wager-choice strong {
  color: #dfc27f;
  font-size: 22px;
}

.faith-wager-choice small {
  font-size: 10px;
  text-transform: uppercase;
}

.faith-wager-choice:hover:not(:disabled),
.faith-wager-choice.active {
  border-color: #d8b96f;
  background: rgba(91, 70, 35, 0.34);
  box-shadow: inset 0 0 18px rgba(227, 196, 127, 0.08);
}

.faith-wager-choice:disabled,
.encounter-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.treasure-list {
  min-width: 0;
  overflow: hidden;
}

.treasure-hand {
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.treasure-card {
  flex: 1 1 52px;
  min-width: 50px;
  max-width: 68px;
}

.treasure-add {
  flex: 0 0 32px;
  width: 32px;
}

@media (prefers-reduced-motion: reduce) {
  .rail-player.active,
  .board-token.active {
    animation: none;
  }
}

@media (max-width: 700px) {
  .faith-wager-choices { grid-template-columns: repeat(2, minmax(74px, 1fr)); }
}

/* Premium board pass: a continuous carved map with clearer visual hierarchy. */
.board-frame {
  padding: 18px 20px 20px 18px;
  border-color: rgba(205, 176, 116, 0.26);
  background:
    linear-gradient(115deg, rgba(255,255,255,0.025), transparent 30%),
    repeating-linear-gradient(28deg, #151713 0 18px, #131511 19px 36px);
  box-shadow: 0 28px 70px rgba(0,0,0,0.64), inset 0 0 0 3px rgba(185,152,94,0.035), inset 0 0 54px rgba(0,0,0,0.58);
}

.board-grid {
  gap: var(--tile-gap);
  padding: 6px;
  border-color: rgba(205, 176, 116, 0.28);
  background: #090a08;
  box-shadow: inset 0 0 0 2px rgba(185,152,94,0.045), inset 0 0 34px rgba(0,0,0,0.76);
}

.column-ruler,
.row-ruler {
  color: rgba(224, 198, 140, 0.66);
  font-size: 11px;
}

.cell {
  border-color: rgba(218, 198, 154, 0.2);
  background:
    radial-gradient(circle at 45% 38%, rgba(255,255,255,0.05), transparent 36%),
    linear-gradient(145deg, #2d2d26, #171916 72%);
  box-shadow: inset 0 1px rgba(255,255,255,0.07), inset 0 -24px 32px rgba(0,0,0,0.42), 0 2px 0 rgba(0,0,0,0.52);
}

.tile-depth {
  inset: 6px;
  border-color: rgba(231, 214, 177, 0.04);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.034), transparent 26%),
    repeating-linear-gradient(24deg, transparent 0 15px, rgba(255,255,255,0.014) 16px),
    repeating-linear-gradient(112deg, transparent 0 22px, rgba(0,0,0,0.045) 23px);
}

.cell.hidden {
  border-color: rgba(185, 152, 94, 0.13);
  background:
    radial-gradient(circle at center, rgba(185,152,94,0.035), transparent 44%),
    linear-gradient(145deg, #1d201c, #111411 76%);
}

.mystery-mark {
  color: rgba(218, 182, 112, 0.57);
  font-size: 36px;
  text-shadow: 0 5px 12px rgba(0,0,0,0.65);
}

.cell-icon {
  width: 66px;
  height: 66px;
  opacity: 0.94;
  filter: drop-shadow(0 9px 11px rgba(0,0,0,0.52));
  transition: opacity 150ms ease, filter 150ms ease, transform 150ms ease;
}

.cell:hover:not(:disabled) .cell-icon {
  opacity: 1;
  filter: drop-shadow(0 11px 13px rgba(0,0,0,0.6));
  transform: translate(-50%, -52%);
}

.room-path {
  color: #aaa99a;
  background: radial-gradient(circle at center, rgba(170,169,154,0.05), transparent 48%), linear-gradient(145deg, #2d2e29, #181a18 72%);
}

.room-chest {
  color: #d0a45b;
  background: radial-gradient(circle at center, rgba(196,148,65,0.11), transparent 48%), linear-gradient(145deg, #302719, #191712 74%);
}

.room-monster,
.room-monsterChest {
  background: radial-gradient(circle at center, rgba(145,54,64,0.13), transparent 48%), linear-gradient(145deg, #2b2021, #171315 74%);
}

.room-monster .cell-icon,
.room-monsterChest .cell-icon,
.feature-mark.monster .monster-symbol {
  filter: brightness(1.34) contrast(1.1) saturate(0.94);
}

.room-monster:hover .cell-icon,
.room-monsterChest:hover .cell-icon {
  filter: brightness(1.44) contrast(1.12) saturate(0.98);
}

.room-sanctuary {
  color: #9eb78e;
  background: radial-gradient(circle at center, rgba(119,154,104,0.13), transparent 50%), linear-gradient(145deg, #202a21, #141814 74%);
}

.room-event {
  color: #aa91bd;
  background: radial-gradient(circle at center, rgba(130,102,151,0.14), transparent 50%), linear-gradient(145deg, #25202b, #151318 74%);
}

.room-bonfire {
  color: #dc8e54;
  background: radial-gradient(circle at center, rgba(202,105,47,0.16), transparent 50%), linear-gradient(145deg, #302118, #191411 74%);
}

.room-eucari .cell-icon {
  width: 78px;
  height: 78px;
}

.room-boss .cell-icon {
  width: 72px;
  height: 72px;
}

.feature-mark {
  width: 32px;
  height: 32px;
  border-color: rgba(220, 199, 153, 0.3);
  box-shadow: 0 5px 12px rgba(0,0,0,0.46);
}

.sheet-panel {
  padding-inline: 26px;
}

.resource-rows > div,
.resource-rows > button {
  min-height: 40px;
}

.resource-rows > div > span:first-child,
.resource-rows > button > span:first-child {
  font-size: 10px;
}

.player-section {
  margin-top: 17px;
  padding-top: 15px;
}

.action-button {
  border-color: rgba(185,152,94,0.2);
  background: linear-gradient(180deg, rgba(31,31,26,0.8), rgba(17,18,16,0.86));
  box-shadow: inset 0 1px rgba(255,255,255,0.025);
}

.action-button span {
  width: 38px;
  height: 38px;
}

.action-button strong,
.end-turn strong {
  font-size: 10px;
}

/* Fichas físicas: peones libres, sin aro ni envolvente circular. */
.tokens {
  left: 6px;
  right: 6px;
  top: 5px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 0;
  pointer-events: none;
  perspective: 240px;
}

.board-token + .board-token {
  margin-left: -24px;
}

.board-token {
  position: relative;
  isolation: isolate;
  width: 42px;
  height: 55px;
  padding: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  color: var(--player);
  background: transparent !important;
  box-shadow: none !important;
  font-style: normal;
  transform: translateY(-7px) rotateX(3deg);
  transform-origin: 50% 92%;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
  pointer-events: auto;
}

.board-token::before {
  display: none;
}

.board-token::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5px;
  z-index: -1;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  filter: blur(3px);
  transform: rotateX(68deg);
  pointer-events: none;
}

.board-token .player-symbol {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  outline: 0;
  background:
    linear-gradient(
      104deg,
      color-mix(in srgb, var(--player), #fff 44%) 0%,
      color-mix(in srgb, var(--player), #fff 18%) 22%,
      var(--player) 48%,
      color-mix(in srgb, var(--player), #090b0b 52%) 100%
    );
  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.2))
    drop-shadow(0 3px 0 color-mix(in srgb, var(--player), #050606 72%))
    drop-shadow(0 8px 5px rgba(0,0,0,0.58));
}

.board-token:not(.active) {
  opacity: 1;
  filter: none;
  transform: translateY(-4px) rotateX(3deg) scale(0.9);
}

.board-token:not(.active) .player-symbol {
  opacity: 0.52;
  filter:
    saturate(0.52)
    brightness(0.68)
    drop-shadow(0 3px 0 color-mix(in srgb, var(--player), #050606 72%))
    drop-shadow(0 7px 4px rgba(0,0,0,0.52));
}

.board-token.active {
  z-index: 4;
  cursor: grab;
  animation: none;
  filter:
    brightness(1.08)
    drop-shadow(0 0 6px color-mix(in srgb, var(--player), transparent 50%));
}

body.turn-ending .board-token.active {
  opacity: 0;
  animation: none;
  pointer-events: none;
  transform: translateY(-2px) rotateX(3deg) scale(0.82);
  transition-duration: 260ms;
}

.board-token.active:hover {
  filter: brightness(1.12) saturate(1.08);
  transform: translateY(-12px) rotateX(0deg) scale(1.07);
}

.board-token.active:active {
  cursor: grabbing;
  transform: translateY(-15px) rotate(-2deg) scale(1.09);
}

body.dragging-token .board-token.active {
  opacity: 0.46;
  animation: none;
  transform: translateY(-15px) rotate(-3deg) scale(1.08);
}

body.cpu-token-moving .board-token.active:not(.cpu-token-ghost) {
  opacity: 0;
  animation: none;
}

.cpu-token-ghost {
  z-index: 110;
  pointer-events: none !important;
  animation: none !important;
  transition: none !important;
  will-change: transform, opacity;
}

/* El destino final permanece latente hasta que la Corrupción despierta al Jefe. */
body:not(.boss-awake) .board-frame .cell.room-boss {
  color: #7d817e;
  border-color: rgba(156, 161, 157, 0.3);
  background: radial-gradient(circle at center, rgba(139, 145, 141, 0.12), transparent 58%), #151817;
  box-shadow: inset 0 0 22px rgba(122, 128, 124, 0.08), 0 2px 0 rgba(0, 0, 0, 0.52);
}

body:not(.boss-awake) .board-frame .cell.room-boss .room-symbol-boss {
  opacity: 0.72;
  filter: grayscale(1) brightness(0.88) contrast(0.92);
}

body.boss-awake .board-frame .cell.room-boss {
  color: #a43845;
  border-color: rgba(183, 54, 68, 0.62);
  background: radial-gradient(circle at center, rgba(131, 38, 47, 0.28), transparent 58%), #170d10;
}

body.boss-awake .board-frame .cell.room-boss .room-symbol-boss {
  opacity: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .board-token.active {
    animation: none;
  }

  body.turn-ending .board-token.active {
    transform: translateY(-4px) rotateX(3deg) scale(0.9);
    transition-duration: 80ms;
  }
}

/* Inspección ligera: el clic consulta; solo arrastrar la ficha mueve. */
.tile-hover-label {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 14;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid rgba(206, 174, 111, 0.3);
  color: rgba(246, 231, 196, 0.92);
  background: rgba(7, 9, 8, 0.9);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.48);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.cell.revealed:hover .tile-hover-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.dragging-token .tile-hover-label {
  opacity: 0;
}

/* Chess-table composition: full square board at left, compact play console at right. */
.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(420px, 31vw, 520px);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  height: 100vh;
  padding: 14px;
}

.board-section {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  display: block;
  width: min(100%, calc(100vh - 28px));
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border-color: rgba(205, 176, 116, 0.3);
  background: #090b0a;
}

.board-stage,
.board-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.board-stage {
  display: block;
}

.board-viewport {
  display: block;
  overflow: auto;
  padding: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  cursor: default;
  user-select: none;
}

.board-viewport.can-pan {
  cursor: grab;
}

.board-viewport.is-panning {
  cursor: grabbing;
  scroll-behavior: auto;
}

.board-viewport.is-panning .board-frame {
  pointer-events: none;
}

.board-frame {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: 18px minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: auto;
  padding: 10px;
  transform-origin: top left;
}

.column-ruler {
  grid-template-columns: repeat(var(--map-size, 9), minmax(0, 1fr));
}

.row-ruler {
  grid-template-rows: repeat(var(--map-size, 9), minmax(0, 1fr));
}

.board-grid {
  grid-template-columns: repeat(var(--map-size, 9), minmax(0, 1fr));
  grid-template-rows: repeat(var(--map-size, 9), minmax(0, 1fr));
  width: 100%;
  height: 100%;
  min-width: 0;
  gap: 2px;
  padding: 4px;
}

.cell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.cell-icon {
  width: 72%;
  height: 72%;
}

.room-eucari .cell-icon {
  width: 82%;
  height: 82%;
}

.room-boss .cell-icon {
  width: 78%;
  height: 78%;
}

.game-sidebar {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(205, 176, 116, 0.2);
  background: rgba(8, 10, 10, 0.93);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
}

.game-sidebar .topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, 0.65fr) minmax(0, 1.85fr);
  grid-template-areas:
    "brand status"
    "corruption corruption";
  align-items: center;
  gap: 9px 12px;
  width: 100%;
  height: auto;
  padding: 11px 13px 10px;
  border-bottom: 1px solid var(--line);
  background: #090b0b;
  box-shadow: none;
}

.game-sidebar .brand-lockup {
  grid-area: brand;
  padding: 0;
}

.game-sidebar .brand-lockup h1 {
  font-size: 29px;
}

.game-sidebar .brand-lockup p {
  margin-top: 5px;
  font-size: 8px;
}

.game-sidebar .world-status {
  grid-area: status;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.game-sidebar .status-line {
  min-width: 43px;
  padding-left: 6px;
}

.game-sidebar .status-line span {
  font-size: 8px;
}

.game-sidebar .status-line strong {
  margin-top: 2px;
  font-size: 11px;
}

.game-sidebar .new-game {
  min-width: 92px;
  height: 32px;
  padding-inline: 8px;
  font-size: 9px;
}

.game-sidebar .icon-button {
  width: 27px;
  height: 27px;
}

.game-sidebar .corruption-track {
  grid-area: corruption;
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: stretch;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.game-sidebar .track-title {
  font-size: 9px;
  white-space: nowrap;
}

.game-sidebar .corruption-nodes {
  grid-template-columns: repeat(var(--corruption-steps, 6), minmax(23px, 1fr));
  gap: 4px;
  width: 100%;
}

.game-sidebar .corruption-node {
  width: 23px;
  height: 23px;
  font-size: 9px;
}

.game-sidebar .corruption-nodes::before {
  left: 12px;
  right: 12px;
}

.game-sidebar .player-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 4px;
  padding: 7px 9px;
  border-right: 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 8, 8, 0.46);
}

.game-sidebar .rail-player {
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  justify-items: start;
  align-items: center;
  gap: 1px 7px;
  min-height: 44px;
  padding: 5px 6px;
  border-left-width: 2px;
}

.game-sidebar .rail-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 31px;
  height: 31px;
  padding: 6px;
}

.game-sidebar .rail-name,
.game-sidebar .rail-player small {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-sidebar .rail-name {
  align-self: end;
  font-size: 10px;
}

.game-sidebar .rail-player small {
  align-self: start;
  font-size: 8px;
}

.game-sidebar .board-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title zoom"
    "room room";
  gap: 5px 12px;
  padding: 7px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.board-toolbar-title {
  grid-area: title;
  min-width: 0;
}

.game-sidebar .board-toolbar-title strong {
  font-size: 9px;
  text-transform: uppercase;
}

.game-sidebar .board-toolbar-title span {
  display: none;
}

.game-sidebar .room-inspector {
  grid-area: room;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border-left: 0;
}

.game-sidebar .room-inspector-heading {
  display: none;
}

.game-sidebar .room-inspector-body {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 5px 0 0;
}

.game-sidebar .inspection-visual {
  width: 33px;
  height: 33px;
}

.game-sidebar .room-inspector-body strong {
  font-size: 11px;
}

.game-sidebar .room-inspector-body p {
  font-size: 9px;
  -webkit-line-clamp: 1;
}

.game-sidebar .zoom-control {
  grid-area: zoom;
  gap: 6px;
  font-size: 8px;
}

.game-sidebar .zoom-control input {
  width: 70px;
}

.game-sidebar .character-sheet {
  grid-column: 1;
  grid-row: auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 0;
  border-bottom: 1px solid var(--line-soft);
}

.game-sidebar .sheet-panel {
  min-height: 0;
  padding: 10px 14px 16px;
}

.game-sidebar .sheet-hero {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  min-height: 48px;
  padding-bottom: 8px;
}

.game-sidebar .portrait-ring {
  width: 44px;
  height: 44px;
  padding: 9px;
}

.game-sidebar .sheet-identity h2 {
  font-size: 20px;
}

.game-sidebar .resource-rows {
  margin-top: 6px;
}

.game-sidebar .resource-rows > div,
.game-sidebar .resource-rows > button {
  grid-template-columns: 96px minmax(0, 1fr) 34px;
  min-height: 28px;
}

.game-sidebar .spiritual-goal {
  margin-top: 6px;
  padding-block: 5px;
}

.game-sidebar .player-section {
  margin-top: 8px;
  padding-top: 8px;
}

.game-sidebar .player-section-title {
  margin-bottom: 6px;
}

.game-sidebar .wound {
  min-height: 44px;
  padding-block: 4px;
}

.game-sidebar .wound p {
  -webkit-line-clamp: 1;
}

.game-sidebar .wound.locked {
  opacity: 0.68;
}

.game-sidebar .wound.locked .wound-icon {
  color: #6f6d66;
}

.game-sidebar .wound.locked em {
  color: #a99265;
}

.game-sidebar .blessings-compact {
  margin-top: 7px;
  padding-top: 7px;
}

.game-sidebar .treasures-section,
.game-sidebar .treasure-list,
.game-sidebar .treasure-hand {
  min-height: 72px;
}

.game-sidebar .treasure-card {
  width: 58px;
  height: 72px;
  grid-template-rows: 25px auto auto;
  padding: 6px 4px;
}

.game-sidebar .card-sigil {
  width: 24px;
  height: 24px;
}

.game-sidebar .action-dock {
  position: relative;
  grid-column: 1;
  grid-row: auto;
  grid-template-columns: minmax(0, 1fr) 54px;
  grid-template-rows: 59px auto;
  gap: 5px;
  min-width: 0;
  padding: 7px 9px 6px;
  border-top: 0;
  border-bottom: 1px solid var(--line-soft);
}

.game-sidebar .action-buttons {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 4px;
}

.game-sidebar .action-button {
  grid-template-rows: 28px auto;
  min-height: 56px;
  padding: 4px 3px;
}

.game-sidebar .action-button span,
.game-sidebar .end-turn span {
  width: 27px;
  height: 27px;
  padding: 4px;
}

.game-sidebar .action-button strong,
.game-sidebar .end-turn strong {
  font-size: 8px;
}

.game-sidebar .action-side,
.game-sidebar .end-turn {
  width: 54px;
  height: 56px;
}

.game-sidebar .action-guidance {
  grid-column: 1 / 3;
  grid-row: 2;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 2px 1px 0;
}

.game-sidebar .guidance-mark {
  width: 18px;
  height: 18px;
}

.game-sidebar .action-guidance strong {
  font-size: 9px;
}

.game-sidebar .action-guidance small {
  font-size: 8px;
}

.utility-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  padding: 6px 9px 8px;
}

.utility-strip .events-toggle,
.utility-strip .ai-toggle,
.utility-strip .debug-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  font-size: 8px;
}

.utility-strip .events-toggle i {
  top: 2px;
  right: 2px;
}

.events-panel,
.ai-panel,
.debug-panel {
  right: 14px;
  left: auto;
  bottom: 56px;
  width: min(490px, calc(100vw - 28px));
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100vh;
    padding: 10px;
  }

  .board-section {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, calc(100vh - 20px));
  }

  .game-sidebar {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    overflow: visible;
  }

  .game-sidebar .character-sheet {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 6px;
    gap: 8px;
  }

  .board-section {
    width: 100%;
  }

  .board-frame {
    grid-template-columns: 13px minmax(0, 1fr);
    grid-template-rows: 13px minmax(0, 1fr);
    gap: 2px;
    padding: 5px;
  }

  .game-sidebar .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "status"
      "corruption";
  }

  .game-sidebar .world-status {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .game-sidebar .player-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Balanced board-game composition: global state, players, board and sheet each
   get a dedicated region instead of competing inside one narrow sidebar. */
@media (min-width: 1101px) {
  .app-shell {
    display: grid;
    grid-template-columns: clamp(120px, 8.5vw, 158px) minmax(500px, min(56vw, calc(100vh - 100px))) minmax(340px, 1fr);
    grid-template-rows: 68px minmax(0, 1fr);
    gap: 8px 12px;
    width: 100%;
    height: 100vh;
    padding: 8px 12px;
    overflow: hidden;
  }

  .game-sidebar {
    display: contents;
  }

  .game-sidebar .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(420px, 1.35fr) minmax(430px, 1fr);
    grid-template-areas: "brand corruption status";
    min-width: 0;
    height: 68px;
    padding: 8px 18px;
    border: 1px solid var(--line-soft);
    background: rgba(6, 9, 9, 0.96);
  }

  .game-sidebar .brand-lockup {
    align-self: center;
  }

  .game-sidebar .brand-lockup h1 {
    font-size: 27px;
  }

  .game-sidebar .brand-lockup p {
    margin-top: 3px;
    font-size: 9px;
  }

  .game-sidebar .corruption-track {
    width: min(100%, 570px);
    align-self: center;
    justify-self: center;
  }

  .game-sidebar .world-status {
    align-self: center;
    justify-self: end;
    gap: 14px;
  }

  .game-sidebar .world-status .status-line {
    min-width: 64px;
  }

  .game-sidebar .new-game {
    min-height: 38px;
    padding-inline: 18px;
  }

  .game-sidebar .player-rail {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    min-width: 0;
    min-height: 0;
    padding: 8px 0;
    border: 0;
    background: transparent;
    overflow-y: auto;
  }

  .game-sidebar .rail-player {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    min-height: 70px;
    padding: 10px 9px;
    border: 1px solid transparent;
    background: rgba(8, 11, 11, 0.72);
  }

  .game-sidebar .rail-player.is-current {
    border-color: rgba(211, 170, 91, 0.44);
    background: rgba(56, 27, 25, 0.42);
  }

  .game-sidebar .rail-player .rail-token {
    grid-row: 1 / 3;
    width: 44px;
    height: 54px;
  }

  .game-sidebar .rail-player strong {
    align-self: end;
    font-size: 12px;
  }

  .game-sidebar .rail-stats {
    align-self: start;
    font-size: 9px;
  }

  .board-section {
    grid-column: 2;
    grid-row: 2;
    width: min(100%, calc(100vh - 100px));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1;
    align-self: center;
    justify-self: center;
    min-width: 0;
    min-height: 0;
  }

  .board-stage,
  .board-viewport {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  .right-panel {
    grid-column: 3;
    grid-row: 2;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line-soft);
    background: rgba(6, 9, 9, 0.92);
    overflow: hidden;
  }

  .game-sidebar .board-toolbar {
    display: grid;
    grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 86px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(10, 13, 13, 0.74);
  }

  .game-sidebar .board-toolbar-title strong {
    font-size: 10px;
  }

  .game-sidebar .board-toolbar-title span {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.35;
  }

  .game-sidebar .room-inspector {
    min-width: 0;
  }

  .game-sidebar .zoom-control {
    min-width: 150px;
    justify-content: flex-end;
  }

  .game-sidebar .character-sheet {
    min-width: 0;
    min-height: 0;
    max-height: none;
    padding: 14px 18px 20px;
    border: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .game-sidebar .sheet-panel {
    padding: 0;
  }

  .game-sidebar .sheet-identity {
    padding-bottom: 12px;
  }

  .game-sidebar .portrait-ring {
    width: 56px;
    height: 56px;
    padding: 11px;
  }

  .game-sidebar .sheet-identity h2 {
    font-size: 25px;
  }

  .game-sidebar .resource-rows {
    margin-top: 10px;
  }

  .game-sidebar .resource-rows > div,
  .game-sidebar .resource-rows > button {
    grid-template-columns: 124px minmax(0, 1fr) 44px;
    min-height: 34px;
  }

  .game-sidebar .spiritual-goal {
    margin-top: 10px;
    padding-block: 9px;
  }

  .game-sidebar .player-section {
    margin-top: 14px;
    padding-top: 12px;
  }

  .game-sidebar .player-section-title {
    margin-bottom: 9px;
  }

  .game-sidebar .wound {
    min-height: 54px;
    padding-block: 7px;
  }

  .game-sidebar .wound p {
    -webkit-line-clamp: 2;
    font-size: 10px;
    line-height: 1.35;
  }

  .game-sidebar .treasure-card {
    width: 68px;
    height: 86px;
    grid-template-rows: 30px auto auto;
    padding: 7px 5px;
  }

  .game-sidebar .card-sigil {
    width: 29px;
    height: 29px;
  }

  .game-sidebar .action-dock {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    grid-template-rows: 62px minmax(0, 1fr);
    gap: 5px;
    min-width: 0;
    min-height: 0;
    padding: 8px 12px 5px;
    border: 0;
    border-top: 1px solid var(--line-soft);
    background: rgba(7, 10, 10, 0.9);
  }

  .game-sidebar .action-buttons {
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 7px;
  }

  .game-sidebar .action-button {
    grid-template-rows: 32px auto;
    min-height: 60px;
    padding: 6px 4px;
  }

  .game-sidebar .action-button span,
  .game-sidebar .end-turn span {
    width: 32px;
    height: 32px;
    padding: 5px;
  }

  .game-sidebar .action-button strong,
  .game-sidebar .end-turn strong {
    font-size: 9px;
  }

  .game-sidebar .action-side,
  .game-sidebar .end-turn {
    width: 64px;
    height: 60px;
  }

  .game-sidebar .action-guidance {
    grid-column: 1 / 3;
    gap: 8px;
    min-height: 0;
    padding: 0;
  }

  .game-sidebar .action-guidance strong {
    font-size: 10px;
  }

  .game-sidebar .action-guidance small {
    font-size: 9px;
  }

  .utility-strip {
    grid-column: 1;
    grid-row: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 6px;
    padding: 7px 12px 10px;
    border-top: 1px solid var(--line-soft);
  }

  .utility-strip .events-toggle,
  .utility-strip .ai-toggle,
  .utility-strip .debug-toggle {
    inset: auto;
    left: auto;
    right: auto;
    width: 100%;
    min-height: 31px;
    font-size: 9px;
    border: 1px solid var(--line-soft);
    background: rgba(7, 10, 10, 0.86);
  }

  .events-panel,
  .ai-panel,
  .debug-panel {
    right: 18px;
    bottom: 48px;
    width: min(520px, calc(100vw - 36px));
  }
}

@media (max-width: 1100px) {
  .game-sidebar .right-panel {
    display: contents;
  }

  .game-sidebar .board-toolbar {
    grid-row: auto;
  }
}

/* Editorial character sheet: clearer hierarchy, readable type and deliberate
   vertical rhythm without adding more nested cards. */
@media (min-width: 1101px) {
  .right-panel {
    grid-template-rows: 122px minmax(0, 1fr) auto auto auto;
  }

  .game-sidebar .board-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(48px, auto);
    grid-template-areas:
      "title zoom"
      "room zoom";
    align-items: center;
    column-gap: 24px;
    row-gap: 8px;
    min-height: 122px;
    padding: 16px 20px;
  }

  .game-sidebar .board-toolbar-title {
    grid-area: title;
  }

  .game-sidebar .board-toolbar-title strong {
    display: block;
    color: #bda56f;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .game-sidebar .board-toolbar-title span {
    max-width: 440px;
    margin-top: 6px;
    color: #8f887b;
    font-size: 11px;
    line-height: 1.4;
  }

  .game-sidebar .room-inspector {
    grid-area: room;
    min-height: 48px;
  }

  .game-sidebar .room-inspector-body {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding-top: 0;
  }

  .game-sidebar .inspection-visual {
    width: 40px;
    height: 40px;
  }

  .game-sidebar .room-inspector-body strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .game-sidebar .room-inspector-body p {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .game-sidebar .zoom-control {
    grid-area: zoom;
    align-self: center;
    min-width: 176px;
    gap: 10px;
    font-size: 9px;
  }

  .game-sidebar .zoom-control input {
    width: 92px;
  }

  .game-sidebar .character-sheet {
    padding: 20px 24px 28px;
  }

  .game-sidebar .sheet-hero {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 16px;
    min-height: 80px;
    padding-bottom: 17px;
  }

  .game-sidebar .portrait-ring {
    width: 58px;
    height: 58px;
    padding: 12px;
  }

  .game-sidebar .sheet-identity {
    min-width: 0;
    padding-bottom: 0;
  }

  .game-sidebar .sheet-identity h2 {
    margin: 5px 0 4px;
    font-size: 29px;
    line-height: 0.95;
  }

  .game-sidebar .sheet-identity p strong,
  .game-sidebar .sheet-identity p em {
    font-size: 12px;
  }

  .game-sidebar .resource-rows {
    margin-top: 14px;
  }

  .game-sidebar .resource-rows > div,
  .game-sidebar .resource-rows > button {
    grid-template-columns: 132px minmax(0, 1fr) 48px;
    min-height: 43px;
  }

  .game-sidebar .resource-rows > div > span:first-child,
  .game-sidebar .resource-rows > button > span:first-child {
    font-size: 10px;
    line-height: 1.2;
  }

  .game-sidebar .resource-rows > div > strong,
  .game-sidebar .resource-rows > button > strong {
    font-size: 11px;
  }

  .game-sidebar .checkpoint-marker b {
    font-size: 10px;
  }

  .game-sidebar .pip-row {
    gap: 9px;
  }

  .game-sidebar .spiritual-goal {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    padding: 14px 0;
    border-top: 1px solid rgba(185, 152, 94, 0.09);
    border-bottom: 1px solid rgba(185, 152, 94, 0.09);
  }

  .game-sidebar .spiritual-goal span {
    font-size: 10px;
  }

  .game-sidebar .spiritual-goal strong {
    font-size: 12px;
    line-height: 1.4;
  }

  .game-sidebar .player-section {
    margin-top: 20px;
    padding-top: 17px;
  }

  .game-sidebar .player-section-title {
    margin-bottom: 12px;
  }

  .game-sidebar .player-section-title span,
  .game-sidebar .blessings-compact > span {
    font-size: 13px;
  }

  .game-sidebar .player-section-title small {
    font-size: 9px;
    line-height: 1.3;
  }

  .game-sidebar .wound {
    grid-template-columns: 32px minmax(0, 1fr) minmax(78px, 98px);
    gap: 14px;
    min-height: 66px;
    padding: 10px 0;
  }

  .game-sidebar .wound-icon {
    width: 29px;
    height: 29px;
  }

  .game-sidebar .wound > div {
    min-width: 0;
  }

  .game-sidebar .wound > div strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .game-sidebar .wound p {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }

  .game-sidebar .wound em {
    max-width: 98px;
    font-size: 8px;
    line-height: 1.4;
  }

  .game-sidebar .blessings-compact {
    min-height: 52px;
    margin-top: 18px;
    padding-top: 15px;
  }

  .game-sidebar .blessing-list {
    gap: 9px;
  }

  .game-sidebar .blessing-empty,
  .game-sidebar .blessing-talisman {
    width: 30px;
    height: 30px;
  }

  .game-sidebar .treasures-section,
  .game-sidebar .treasure-list,
  .game-sidebar .treasure-hand {
    min-height: 100px;
  }

  .game-sidebar .treasure-card {
    width: 72px;
    height: 92px;
    grid-template-rows: 31px auto auto;
    padding: 8px 6px;
  }

  .game-sidebar .treasure-card strong {
    font-size: 9px;
    line-height: 1.2;
  }

  .game-sidebar .action-dock {
    grid-template-columns: minmax(0, 1fr) 68px;
    grid-template-rows: 66px 34px;
    gap: 8px;
    padding: 11px 14px 9px;
    background: #090c0c;
  }

  .game-sidebar .action-buttons {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px;
  }

  .game-sidebar .action-button {
    grid-template-rows: 34px auto;
    min-height: 66px;
    padding: 7px 5px;
  }

  .game-sidebar .action-button span,
  .game-sidebar .end-turn span {
    width: 34px;
    height: 34px;
  }

  .game-sidebar .action-button strong,
  .game-sidebar .end-turn strong {
    font-size: 10px;
    line-height: 1.15;
  }

  .game-sidebar .action-side,
  .game-sidebar .end-turn {
    width: 68px;
    height: 66px;
  }

  .game-sidebar .action-guidance {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    height: 34px;
    user-select: none;
  }

  .game-sidebar .action-guidance > div {
    min-width: 0;
  }

  .game-sidebar .action-guidance strong,
  .game-sidebar .action-guidance small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-sidebar .action-guidance strong {
    font-size: 10px;
    line-height: 1.25;
  }

  .game-sidebar .action-guidance small {
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.2;
  }

  .game-sidebar .guidance-mark {
    width: 22px;
    height: 22px;
  }

  .utility-strip {
    gap: 8px;
    padding: 9px 14px 11px;
  }

  .utility-strip .events-toggle,
  .utility-strip .ai-toggle,
  .utility-strip .debug-toggle {
    min-height: 34px;
    font-size: 9px;
  }
}

/* Board pieces live above the printed tiles. Tile content may cross an inner
   edge, while the board viewport still clips at the physical board boundary. */
.cell {
  overflow: visible;
}

.cell:has(.tokens) {
  z-index: 30;
}

.tokens {
  z-index: 40;
}

.board-token {
  z-index: 41;
}

.board-token.active {
  z-index: 42;
}

.board-token.faith-confirmed::before {
  content: "";
  position: absolute;
  inset: -8px -11px -5px;
  z-index: 1;
  display: block;
  border: 1px solid rgba(222, 232, 128, 0.42);
  border-radius: 48% 48% 44% 44%;
  background: radial-gradient(circle at 50% 46%, rgba(224, 235, 135, 0.3), rgba(206, 216, 105, 0.08) 52%, transparent 72%);
  box-shadow: 0 0 13px rgba(216, 229, 119, 0.34);
  opacity: 0.68;
  transform: scale(1);
  filter: blur(1.5px);
  pointer-events: none;
  animation: none;
}

/* Applying a filter to the whole tile creates a compositing layer that clips
   an elevated piece at the tile edge. Keep the hover treatment on the board
   art instead, so meeples can rise naturally above adjacent tiles. */
.board-grid .cell:has(.tokens):hover:not(:disabled) {
  z-index: 50;
  overflow: visible;
  filter: none;
}

.board-grid .cell:has(.tokens):hover:not(:disabled) .tile-depth {
  filter: brightness(1.08);
}

/* Desktop character sheet: primary resources and cards remain visible beside
   the spiritual progression instead of forming one long scrolling column. */
.sheet-layout,
.sheet-primary,
.sheet-spiritual {
  min-width: 0;
}

@media (min-width: 1101px) {
  .game-sidebar .board-toolbar {
    grid-template-areas:
      "title zoom"
      "room room";
  }

  .game-sidebar .board-toolbar-title span {
    display: none;
  }

  .game-sidebar .room-inspector {
    width: 100%;
    overflow: hidden;
  }

  .game-sidebar .room-inspector-body {
    width: 100%;
    min-width: 0;
  }

  .game-sidebar .room-inspector-body > div:last-child {
    min-width: 0;
    overflow: hidden;
  }

  .game-sidebar .room-inspector-body > div:last-child > span,
  .game-sidebar .room-inspector-body strong,
  .game-sidebar .room-inspector-body em {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-sidebar .room-inspector-body p {
    max-width: 100%;
    overflow: hidden;
  }

  .game-sidebar .inspection-tabs {
    flex: 0 0 auto;
    min-width: 0;
  }

  .game-sidebar .character-sheet {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 16px 18px 18px;
  }

  .game-sidebar .sheet-layout {
    display: grid;
    grid-template-columns: minmax(205px, 0.88fr) minmax(255px, 1.12fr);
    grid-template-rows: auto minmax(112px, 1fr);
    align-items: start;
    gap: 22px;
    height: 100%;
    min-height: 100%;
  }

  .game-sidebar .sheet-spiritual {
    padding-left: 22px;
    border-left: 1px solid rgba(185, 152, 94, 0.13);
  }

  .game-sidebar .sheet-primary .sheet-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
    min-height: 66px;
    padding-bottom: 12px;
  }

  .game-sidebar .sheet-primary .portrait-ring {
    width: 50px;
    height: 50px;
    padding: 10px;
  }

  .game-sidebar .sheet-primary .sheet-identity h2 {
    margin: 4px 0 3px;
    font-size: 25px;
  }

  .game-sidebar .sheet-primary .resource-rows {
    margin-top: 8px;
  }

  .game-sidebar .sheet-primary .resource-rows > div,
  .game-sidebar .sheet-primary .resource-rows > button {
    grid-template-columns: 78px minmax(0, 1fr) 34px;
    gap: 6px;
    min-height: 35px;
  }

  .game-sidebar .sheet-primary .resource-rows > div > span:first-child,
  .game-sidebar .sheet-primary .resource-rows > button > span:first-child {
    font-size: 9px;
  }

  .game-sidebar .sheet-primary .pip-row {
    gap: 4px;
  }

  .game-sidebar .sheet-primary .faith-pips i {
    width: 10px;
    height: 10px;
  }

  .game-sidebar .sheet-primary .action-pips i {
    width: 12px;
    height: 12px;
  }

  .game-sidebar .sheet-primary .spirit-row {
    gap: 6px;
  }

  .game-sidebar .sheet-primary .spirit-row i {
    width: 15px;
    height: 15px;
  }

  .game-sidebar .sheet-primary .spirit-row i::before {
    height: 19px;
  }

  .game-sidebar .sheet-primary .spirit-row i::after {
    width: 19px;
  }

  .game-sidebar .sheet-primary .checkpoint-marker {
    gap: 5px;
  }

  .game-sidebar .sheet-primary .checkpoint-marker b {
    display: none;
  }

  .game-sidebar .sheet-primary .spiritual-goal {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    margin-top: 9px;
    padding: 10px 0;
  }

  .game-sidebar .sheet-primary .spiritual-goal strong {
    font-size: 10px;
    line-height: 1.35;
  }

  .game-sidebar .sheet-layout > .treasures-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-self: stretch;
    min-height: 0;
    margin-top: -2px;
    padding-top: 11px;
  }

  .game-sidebar .sheet-layout > .treasures-section .player-section-title {
    margin-bottom: 8px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    width: 100%;
    min-height: 0;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    align-items: center;
    justify-content: center;
    align-content: center;
    gap: 12px;
    height: 100%;
    padding: 14px 10px 16px;
    flex-wrap: nowrap;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-card {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    height: 92px;
    grid-template-rows: 31px auto auto;
    padding: 8px 6px;
  }

  .game-sidebar .sheet-layout > .treasures-section .card-sigil {
    width: 30px;
    height: 30px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-card strong {
    font-size: 9px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-add {
    align-self: center;
    width: 44px;
    min-width: 44px;
    height: 74px;
    margin-bottom: 0;
  }

  .game-sidebar .sheet-spiritual .wounds-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .game-sidebar .sheet-spiritual .wound {
    grid-template-columns: 28px minmax(0, 1fr) minmax(56px, 74px);
    gap: 10px;
    min-height: 58px;
    padding: 8px 0;
  }

  .game-sidebar .sheet-spiritual .wound-icon {
    width: 26px;
    height: 26px;
  }

  .game-sidebar .sheet-spiritual .wound p {
    margin-top: 4px;
    font-size: 9px;
    line-height: 1.35;
  }

  .game-sidebar .sheet-spiritual .wound em {
    max-width: 74px;
    font-size: 7px;
  }

  .game-sidebar .sheet-spiritual .blessings-compact {
    min-height: 44px;
    margin-top: 12px;
    padding-top: 12px;
  }
}

@media (min-width: 1101px) and (max-width: 1370px) {
  .game-sidebar .sheet-layout {
    grid-template-columns: minmax(198px, 0.82fr) minmax(248px, 1.18fr);
    gap: 16px;
  }

  .game-sidebar .sheet-spiritual {
    padding-left: 16px;
  }

  .game-sidebar .sheet-primary .resource-rows > div,
  .game-sidebar .sheet-primary .resource-rows > button {
    grid-template-columns: 70px minmax(0, 1fr) 30px;
    gap: 4px;
  }
}

@media (min-width: 1101px) and (max-height: 850px) {
  .game-sidebar .character-sheet {
    padding: 8px 16px 6px;
  }

  .game-sidebar .sheet-layout {
    column-gap: 16px;
    row-gap: 7px;
    grid-template-rows: auto minmax(86px, 1fr);
  }

  .game-sidebar .sheet-spiritual {
    padding-left: 16px;
  }

  .game-sidebar .sheet-primary .sheet-hero {
    min-height: 58px;
    padding-bottom: 8px;
  }

  .game-sidebar .sheet-primary .portrait-ring {
    width: 46px;
    height: 46px;
    padding: 9px;
  }

  .game-sidebar .sheet-primary .resource-rows {
    margin-top: 5px;
  }

  .game-sidebar .sheet-primary .resource-rows > div,
  .game-sidebar .sheet-primary .resource-rows > button {
    min-height: 30px;
  }

  .game-sidebar .sheet-primary .spiritual-goal {
    margin-top: 6px;
    padding: 7px 0;
  }

  .game-sidebar .sheet-spiritual .wound {
    min-height: 52px;
    padding: 6px 0;
  }

  .game-sidebar .sheet-spiritual .blessings-compact {
    min-height: 38px;
    margin-top: 8px;
    padding-top: 8px;
  }

  .game-sidebar .sheet-layout > .treasures-section {
    margin-top: 0;
    padding-top: 8px;
  }

  .game-sidebar .sheet-layout > .treasures-section .player-section-title {
    margin-bottom: 5px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 0;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-card {
    flex-basis: 68px;
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    height: 64px;
    grid-template-rows: 23px auto auto;
    padding: 4px 5px;
  }

  .game-sidebar .sheet-layout > .treasures-section .card-sigil {
    width: 26px;
    height: 26px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-add {
    width: 42px;
    min-width: 42px;
    height: 54px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    gap: 10px;
    padding: 4px 8px;
  }
}

/* Normalización final: el zoom escala el tablero completo, no cada arte por separado. */
.board-frame .cell .cell-icon {
  width: 72%;
  height: 72%;
  max-width: none;
  max-height: none;
}

.board-frame .cell .cell-icon > .asset-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.board-frame .cell.room-obstacle .cell-icon {
  width: 76%;
  height: 76%;
}

.board-frame .cell.room-event .cell-icon {
  width: 74%;
  height: 74%;
}

.board-frame .cell.room-eucari .cell-icon {
  width: 82%;
  height: 82%;
}

.room-symbol-eucari.asset-image {
  filter: grayscale(1) brightness(3.15) contrast(0.78);
}

.board-frame .room-eucari .room-symbol-eucari.asset-image {
  filter: grayscale(1) brightness(3.15) contrast(0.78)
    drop-shadow(0 0 5px rgba(244, 240, 226, 0.38));
}

.board-frame .cell.room-boss .cell-icon {
  width: 78%;
  height: 78%;
}

.board-frame .room-path .cell-icon {
  opacity: 0.64;
}

.board-frame .room-path:hover .cell-icon,
.board-frame .room-path.selected .cell-icon {
  opacity: 0.78;
}

/* El tablero cuenta primero lo que ocurrió; la ventana explicativa entra después. */
body.board-effect-playing .board-grid .cell:not(.board-effect-focus) {
  filter: brightness(0.72) saturate(0.72);
}

body.board-effect-playing .action-buttons,
body.board-effect-playing .board-grid {
  pointer-events: none;
}

.board-grid .cell.board-effect-focus {
  --board-effect-color: var(--player, #d9bb79);
  z-index: 30;
  filter: brightness(1.08) saturate(1.06);
  animation: boardEffectTile 620ms cubic-bezier(.2,.7,.2,1) both;
}

.board-grid .cell.board-effect-focus::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 5px;
  border: 2px solid color-mix(in srgb, var(--board-effect-color) 78%, white 22%);
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(6, 8, 7, 0.82), 0 0 20px color-mix(in srgb, var(--board-effect-color) 42%, transparent);
  pointer-events: none;
  animation: boardEffectRing 620ms ease-out both;
}

.board-grid .cell.board-effect-focus .cell-icon {
  animation: boardEffectIcon 620ms cubic-bezier(.2,.7,.2,1) both;
}

.board-grid .cell.board-effect-event { --board-effect-color: #ad79c7; }
.board-grid .cell.board-effect-eucari { --board-effect-color: #f4f0e2; }
.board-grid .cell.board-effect-boss { --board-effect-color: #d74a50; }
.board-grid .cell.board-effect-bonfire { --board-effect-color: #e6a45f; }
.board-grid .cell.board-effect-monster { --board-effect-color: #ad67c7; }
.board-grid .cell.board-effect-obstacle { --board-effect-color: #d7c395; }
.board-grid .cell.board-effect-reveal { --board-effect-color: #ccb071; }

@keyframes boardEffectTile {
  0% { filter: brightness(0.88) saturate(0.82); }
  34% { filter: brightness(1.18) saturate(1.08); }
  100% { filter: brightness(1.08) saturate(1.06); }
}

@keyframes boardEffectRing {
  0% { opacity: 0; }
  32% { opacity: 1; }
  100% { opacity: 0.2; }
}

@keyframes boardEffectIcon {
  0% { transform: translate(-50%, -50%); opacity: 0.72; filter: brightness(0.82); }
  38% { transform: translate(-50%, -50%); opacity: 1; filter: brightness(1.28); }
  100% { transform: translate(-50%, -50%); opacity: 1; filter: brightness(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .board-grid .cell.board-effect-focus,
  .board-grid .cell.board-effect-focus::after,
  .board-grid .cell.board-effect-focus .cell-icon {
    animation: none;
  }
}

/* Una sola franja de acciones evita que las opciones contextuales invadan la guía. */
.game-sidebar .action-buttons {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 166, 99, 0.42) transparent;
}

.game-sidebar .action-buttons::-webkit-scrollbar {
  height: 4px;
}

.game-sidebar .action-buttons::-webkit-scrollbar-thumb {
  background: rgba(199, 166, 99, 0.42);
}

/* La bandeja conserva aire y evita un scroll vertical interno en escritorio. */
@media (min-width: 1101px) {
  .game-sidebar .sheet-layout > .treasures-section .treasure-list {
    display: grid;
    align-items: center;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 100px;
    height: auto;
    padding: 6px 10px;
    overflow-y: visible;
  }
}

/* En escritorio medio la ficha conserva sus dos columnas, pero reduce sus
   mínimos al ancho real de la consola para evitar recortes y mantener cartas visibles. */
@media (min-width: 1101px) and (max-width: 1699px) {
  .game-sidebar .character-sheet {
    padding: 14px 16px 16px;
  }

  .game-sidebar .sheet-layout {
    grid-template-columns: minmax(142px, 0.82fr) minmax(194px, 1.18fr);
    grid-template-rows: auto minmax(104px, 1fr);
    column-gap: 14px;
    row-gap: 10px;
    height: 100%;
    min-height: 100%;
  }

  .game-sidebar .sheet-primary .sheet-hero {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    min-height: 56px;
    padding-bottom: 10px;
  }

  .game-sidebar .sheet-primary .portrait-ring {
    width: 42px;
    height: 42px;
    padding: 9px;
  }

  .game-sidebar .sheet-primary .sheet-identity h2 {
    font-size: 22px;
    line-height: 1;
  }

  .game-sidebar .sheet-primary .resource-rows {
    margin-top: 8px;
  }

  .game-sidebar .sheet-primary .resource-rows > div,
  .game-sidebar .sheet-primary .resource-rows > button {
    grid-template-columns: 68px minmax(0, 1fr) 27px;
    min-height: 34px;
  }

  .game-sidebar .sheet-primary .spiritual-goal {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
    padding: 9px 0;
  }

  .game-sidebar .sheet-spiritual {
    margin-top: 0;
    padding: 0 0 0 14px;
    border-top: 0;
    border-left: 1px solid rgba(185, 152, 94, 0.13);
  }

  .game-sidebar .sheet-spiritual .wound {
    grid-template-columns: 25px minmax(0, 1fr) minmax(48px, 58px);
    gap: 7px;
    min-height: 54px;
    padding: 7px 0;
  }

  .game-sidebar .sheet-spiritual .wound-icon {
    width: 23px;
    height: 23px;
  }

  .game-sidebar .sheet-spiritual .wound em {
    max-width: 58px;
    font-size: 7px;
  }

  .game-sidebar .sheet-layout > .treasures-section {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: stretch;
    min-height: 104px;
    max-height: 128px;
    margin-top: 0;
    padding-top: 9px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 82px;
    height: 86px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 60px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-card {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: 74px;
    grid-template-rows: 25px auto auto;
    padding: 5px 4px;
  }

  .game-sidebar .sheet-layout > .treasures-section .card-sigil {
    width: 26px;
    height: 26px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-add {
    height: 62px;
  }
}

/* La ficha puede seguir desplazándose con la rueda en alturas reducidas, pero
   su barra no invade visualmente la bandeja de Tesoros en escritorio. */
@media (min-width: 1101px) {
  .game-sidebar .character-sheet {
    scrollbar-width: none;
  }

  .game-sidebar .character-sheet::-webkit-scrollbar {
    display: none;
  }
}

/* En pantallas de escritorio bajas, toda la ficha permanece disponible sin
   enviar las cartas fuera del área visible. */
@media (min-width: 1101px) and (max-height: 850px) {
  .game-sidebar .character-sheet {
    padding: 8px 14px;
  }

  .game-sidebar .sheet-layout {
    grid-template-rows: minmax(0, 1fr) 76px;
    row-gap: 6px;
  }

  .game-sidebar .sheet-hero {
    min-height: 48px;
    padding-bottom: 6px;
  }

  .game-sidebar .portrait-ring {
    width: 46px;
    height: 46px;
  }

  .game-sidebar .sheet-primary .resource-rows {
    margin-top: 4px;
  }

  .game-sidebar .sheet-primary .resource-rows > div,
  .game-sidebar .sheet-primary .resource-rows > button {
    min-height: 28px;
    height: 28px;
  }

  .game-sidebar .sheet-primary .spiritual-goal {
    min-height: 36px;
    margin-top: 5px;
    padding: 5px 0;
  }

  .game-sidebar .sheet-spiritual .player-section-title {
    margin-bottom: 5px;
  }

  .game-sidebar .sheet-spiritual .wound {
    min-height: 43px;
    height: 43px;
    padding: 4px 0;
  }

  .game-sidebar .sheet-spiritual .wound p {
    margin-top: 2px;
    -webkit-line-clamp: 1;
  }

  .game-sidebar .sheet-spiritual .blessings-compact {
    min-height: 32px;
    margin-top: 5px;
    padding-top: 5px;
  }

  .game-sidebar .sheet-layout > .treasures-section {
    min-height: 76px;
    max-height: 76px;
    padding-top: 5px;
  }

  .game-sidebar .sheet-layout > .treasures-section .player-section-title {
    margin-bottom: 3px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-list,
  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    min-height: 56px;
    height: 56px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-hand {
    padding: 2px 8px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-card {
    height: 52px;
    grid-template-rows: 20px auto auto;
    padding: 3px 4px;
  }

  .game-sidebar .sheet-layout > .treasures-section .card-sigil {
    width: 22px;
    height: 22px;
  }

  .game-sidebar .sheet-layout > .treasures-section .treasure-add {
    height: 46px;
  }
}

/* La ficha espiritual concentra su espacio en las Heridas. Las Bendiciones se
   consultan y activan desde la propia Herida sanada. */
@media (min-width: 1101px) {
  .game-sidebar .sheet-spiritual {
    display: grid;
    align-content: center;
  }

  .game-sidebar .sheet-spiritual .wounds-section {
    width: 100%;
  }

  .game-sidebar .sheet-spiritual .player-section-title {
    margin-bottom: 10px;
  }

  .game-sidebar .sheet-spiritual .wound {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 3px;
    min-height: 64px;
    height: auto;
    padding: 9px 0;
  }

  .game-sidebar .sheet-spiritual .wound-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
  }

  .game-sidebar .sheet-spiritual .wound > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .game-sidebar .sheet-spiritual .wound > div strong {
    font-size: 12px;
  }

  .game-sidebar .sheet-spiritual .wound p {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }

  .game-sidebar .sheet-spiritual .wound em {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    max-width: none;
    font-size: 8px;
    line-height: 1.35;
    text-align: left;
  }

  .game-sidebar .sheet-spiritual .wound.blessing-ready {
    opacity: 1;
  }

  .game-sidebar .sheet-spiritual .wound.blessing-ready em {
    color: #c9d678;
  }
}

/* Tesoros sagrados: recompensas blancas del Eucari, separadas visualmente del
   mazo normal y de su límite de cinco cartas. */
.encounter-choice.sacred-treasure-choice {
  border-color: rgba(240, 240, 226, 0.52);
  background: rgba(238, 239, 226, 0.055);
  color: #f1f1e8;
}

.encounter-choice.sacred-treasure-choice strong,
.encounter-choice.sacred-treasure-choice small {
  color: #f1f1e8;
}

.encounter-choice.sacred-treasure-choice.active {
  border-color: #ffffff;
  background: rgba(248, 248, 237, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.wound.healed.sacred-reward-ready {
  border-color: rgba(240, 240, 226, 0.34);
}

@media (min-width: 1101px) and (max-height: 850px) {
  .game-sidebar .sheet-spiritual .wound {
    min-height: 54px;
    padding: 6px 0;
  }

  .game-sidebar .sheet-spiritual .wound p {
    font-size: 9px;
    -webkit-line-clamp: 2;
  }
}
