:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #e9e3d2;
  background: #101410;
  --ink:#e9e3d2;
  --muted:#b6b6a2;
  --quiet:#8e947f;
  --gold:#d4b66d;
  --line:#4f5545;
  --line-bright:#78775c;
  --sans:"Segoe UI",Tahoma,sans-serif;
  --log-height:160px;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  min-width:320px;
  background:#101410;
}

button,input,select {
  font:inherit;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:not-allowed;
  opacity:.46;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid #ead294;
  outline-offset:2px;
}

button,a {
  -webkit-tap-highlight-color:transparent;
}

[hidden] {
  display:none!important;
}

.skip-link {
  position:fixed;
  top:8px;
  left:8px;
  z-index:30;
  padding:10px;
  background:var(--gold);
  color:#151a14;
  clip-path:inset(50%);
  opacity:0;
  pointer-events:none;
}

.skip-link:focus {
  clip-path:none;
  opacity:1;
  pointer-events:auto;
}

.app-frame {
  height:100dvh;
  display:flex;
  flex-direction:column;
  padding:0 16px;
  margin:auto;
}





.expedition-summary {
  display:flex;
  align-items:center;
  gap:20px;
  font:12px var(--sans);
  color:var(--muted);
}

.expedition-summary strong {
  color:var(--gold);
  font-weight:500;
}

.management-buttons {
  display:flex;
  gap:5px;
}

.management-button,.dialog-close {
  border:1px solid #74725a;
  border-radius:2px;
  color:var(--ink);
  background:linear-gradient(#343b2f,#22291f);
  box-shadow:inset 0 1px #4c5340;
  padding:8px 10px;
  font:12px var(--sans);
  min-height:34px;
}

.management-button:hover:not(:disabled),.dialog-close:hover {
  border-color:var(--gold);
  background:#414635;
}

.game-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) var(--log-height);
  gap:10px;
  min-height:0;
  flex:1;
  padding:10px 0;
}

.adventure-column {
  grid-column:1;
  grid-row:1;
  min-width:0;
  min-height:0;
}



.character-panel {
  margin:0;
}

.character-identity {
  display:grid;
  gap:8px;
}

.portrait-mark {
  width:44px;
  height:46px;
  display:grid;
  place-items:center;
  border:1px solid #767154;
  color:var(--gold);
  background:#1d251b;
}

.character-name {
  margin:0;
  overflow-wrap:anywhere;
  color:#ead9a6;
  font-size:18px;
}

.character-status {
  font:11px var(--sans);
  color:#bbc79d;
}

.character-status[data-status=DEAD],.character-terminal {
  color:#e4987e;
}

.character-terminal {
  font:12px/1.5 var(--sans);
}

.character-stats {
  display:grid;
  grid-template-columns:1fr 1fr;
  margin:12px 0;
  gap:12px;
}

.character-stat dt {
  font:10px var(--sans);
  text-transform:uppercase;
  color:#adb397;
}

.character-stat dd {
  margin:4px 0 0;
  font-size:14px;
  overflow-wrap:anywhere;
}

.character-empty {
  color:var(--muted);
  font-size:14px;
}

.adventure-content {
  display:grid;
  height:100%;
  min-height:0;
  grid-template-rows:auto auto minmax(0,1fr) auto auto auto;
  gap:7px;
  padding:10px 12px;
  background:linear-gradient(145deg,#1e281f,#141b15);
  border:1px solid #454e3d;
}

.stage-copy {
  grid-row:1;
}

.stage-copy[data-grid=true] {
  display:none;
}

.stage-eyebrow {
  margin:0 0 3px;
  font:10px var(--sans);
  color:#d9b47e;
  letter-spacing:.08em;
}

.stage-title {
  margin:0;
  font-size:22px;
  font-weight:400;
  color:#ead8a7;
}

.stage-description {
  margin:5px 0;
  font:12px/1.45 var(--sans);
  color:var(--muted);
}

.stage-copy .stage-description {
  display:none;
}

.level-up-notice {
  grid-row:2;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  background:#343c26;
  padding:5px 10px;
  border:1px solid #8e8655;
}

.level-up-notice p {
  margin:0;
  font:12px var(--sans);
}

.level-up-notice .management-button {
  min-height:28px;
  padding:4px 8px;
}

.encounter-panel {
  grid-row:3;
  min-height:0;
  min-width:0;
  overflow:auto;
  overscroll-behavior:contain;
}

.encounter-panel:has(.dungeon-grid) {
  display:flex;
  flex-direction:column;
  gap:5px;
  overflow:hidden;
}

.grid-turn {
  margin:0;
  font:11px/1.4 var(--sans);
  color:#c6c9a9;
}

.map-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 18px;
  justify-content:space-between;
  flex:none;
  padding:3px 0 6px;
}

.map-floor {
  margin:0;
  font-size:18px;
  font-weight:400;
  color:#ead8a7;
}

.map-status {
  font:11px var(--sans);
  color:#d9b47e;
}

.map-toolbar > * {
  white-space:nowrap;
}

.map-toolbar label {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  font:11px var(--sans);
}

.map-toolbar select {
  padding:4px;
  max-width:220px;
}

.inspection-row {
  grid-row:4;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px 16px;
  min-width:0;
}

.target-detail {
  flex:1;
  min-width:0;
}

.target-detail .stage-description {
  margin:0;
  font-size:11px;
}

.inspection-row .management-buttons {
  flex:none;
  gap:4px;
}

.inspection-row .management-button {
  min-height:30px;
  padding:5px 8px;
  font-size:11px;
}

.account-form,.feedback-form {
  display:grid;
  gap:12px;
}

.account-form label,.feedback-form label {
  display:grid;
  gap:5px;
  font:13px var(--sans);
}

.account-form input,.feedback-form textarea,.feedback-form select {
  width:100%;
  padding:8px;
  min-width:0;
}

.feedback-form textarea {
  min-height:140px;
  resize:vertical;
}

.account-form-actions {
  display:flex;
  gap:8px;
}

.account-error {
  color:#edaa90;
  font:12px var(--sans);
  margin:0;
}

.grid-scroll {
  position:relative;
  overflow:clip;
  min-height:70px;
  min-width:0;
  flex:1;
  background:#090e0a;
  border:1px solid #655c43;
  scrollbar-color:#7f7b57 #131a13;
}

.grid-scroll:has([data-descent-blocked=true]) {
  border:3px solid #db5a48;
  box-shadow:inset 0 0 0 1px #672b23;
}

.grid-scroll[data-fit=true] {
  overflow:clip;
}

.dungeon-grid {
  position:absolute;
  left:0;
  top:0;
  transform-origin:0 0;
  display:grid;
  gap:2px;
  width:100%;
  padding:7px;
  background:#090e0a;
}

.dungeon-grid[data-descent-blocked=true] {
  outline:2px solid #db5a48;
  outline-offset:-2px;
}

.dungeon-grid:focus-visible {
  outline:2px solid var(--gold);
  outline-offset:-2px;
}

.dungeon-tile {
  position:relative;
  aspect-ratio:1;
  min-width:0;
  min-height:0;
  padding:0;
  border:1px solid transparent;
  border-radius:1px;
}

.dungeon-tile:disabled {
  opacity:1;
  cursor:default;
}

.dungeon-tile.floor {
  background:#343b36 var(--terrain-texture,var(--floor-texture)) center/cover;
}

.dungeon-tile.wall {
  background:#53594e var(--terrain-texture,var(--wall-texture)) center/cover;
  color:transparent;
  font-size:0;
}

.dungeon-tile.unknown {
  background:#090e0a;
}

.dungeon-tile.dim {
  filter:brightness(.42) saturate(.5);
}

.dungeon-tile.reachable {
  border-color:#9ba88b;
}

.dungeon-tile.reachable:hover {
  filter:brightness(1.35);
}

.dungeon-tile.attack-range {
  box-shadow:inset 0 0 0 1px #ac9450;
}

.dungeon-grid[data-debug-vision=true] .dungeon-tile.threatened {
  border-bottom:2px solid #d16b50;
}

.dungeon-tile.player {
  background-color:#73633e;
}

.dungeon-tile.enemy {
  background-color:#6b3730;
}

.dungeon-tile.selected {
  outline:2px solid #f2d18b;
  z-index:1;
}

.tile-sprite {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

.chest-opened .tile-sprite {
  opacity:.4;
}

.facing-arrow {
  position:absolute;
  top:-2px;
  right:-2px;
  z-index:3;
  background:#191d15;
  color:#ffdb8b;
  font:11px/11px var(--sans);
}

.grid-enemy-health {
  position:absolute;
  top:-6px;
  left:0;
  right:0;
  color:white;
  border:1px solid #c8a578;
  z-index:4;
  font:8px/9px var(--sans);
}

.dungeon-tile.charging {
  outline:2px solid #ed9f58;
}

.boss-banner {
  flex:none;
  margin:0;
  padding:5px 8px;
  border-left:3px solid #cb9d61;
  background:#372d23;
  color:#e2c495;
  font:11px/1.4 var(--sans);
}

.encounter-panel > .stage-description {
  flex:none;
  margin:0;
  font-size:11px;
}

.encounter-panel > .stage-description:nth-last-child(2) {
  color:#c9d1b4;
}

.bottom-hud {
  grid-row:6;
  display:grid;
  grid-template-columns:180px minmax(0,1fr);
  gap:12px;
  flex:none;
  border-top:2px solid #747053;
  padding-top:8px;
  min-height:88px;
}

.vitals-panel {
  display:grid;
  gap:8px;
}

.vital-label {
  display:flex;
  justify-content:space-between;
  font:11px var(--sans);
  color:#d7d7bd;
}

.vital-track {
  height:7px;
  background:#101710;
  border:1px solid #343d2b;
}

.vital-fill {
  height:100%;
}

.vital-fill[data-vital=health] {
  background:#bc6953;
}

.vital-fill[data-vital=mana] {
  background:#6395be;
}

#conditions-copy {
  display:block;
  margin-top:6px;
  font:10px var(--sans);
  color:#d0c795;
}

.action-buttons {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:5px;
}

.action-button {
  height:54px;
  min-width:0;
  padding:5px;
  overflow:hidden;
  text-overflow:ellipsis;
  border:2px solid #787052;
  border-radius:3px;
  color:#e9dcab;
  background:linear-gradient(#424838,#252d22);
  box-shadow:inset 0 0 0 1px #151b13;
  font:12px/1.2 var(--sans);
  text-align:center;
  overflow-wrap:normal;
}

.action-button:hover:not(:disabled) {
  border-color:#e1bd71;
  background:#49513c;
}

.action-button:disabled {
  opacity:.5;
}

.action-feedback {
  margin:4px 0 0;
  font:11px/1.3 var(--sans);
  color:#ebbc8d;
  max-height:28px;
  overflow:auto;
}

.action-feedback:empty {
  margin:0;
}

/* Keep the map and action bar steady when useful feedback appears or clears. */
#action-feedback {
  height:2.6em;
  min-height:2.6em;
  max-height:2.6em;
  margin:4px 0 0;
}

.reward-panel {
  grid-row:5;
  max-height:90px;
  overflow:auto;
  padding:6px 10px;
  background:#303923;
  border:1px solid #8d8452;
}

.reward-panel h2 {
  margin:0;
  font-size:14px;
  color:#e9d18d;
}

.reward-panel p {
  margin:4px 0;
  font:11px var(--sans);
}

.reward-item {
  color:var(--rarity,var(--gold));
}

.reward-panel button {
  min-height:26px;
  padding:4px;
  font-size:10px;
}

.journal-rail {
  grid-column:1/-1;
  grid-row:2;
  display:flex;
  gap:16px;
  min-height:0;
  padding:10px 12px;
  border:2px solid #62654e;
  box-shadow:inset 0 0 0 1px #151b14;
  background:#242c21;
}

.journal-rail h2 {
  flex:none;
  margin:0;
  font-size:13px;
  color:var(--gold);
}

.journal-list {
  flex:1;
  list-style:none;
  margin:0;
  padding:0 8px 0 0;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-color:#7f7b57 #131a13;
}

.journal-entry {
  display:flex;
  gap:12px;
  padding:3px 0;
  border-bottom:1px solid #35402d;
  font:12px/1.35 var(--sans);
}

.journal-time {
  flex:none;
  color:#a5b08f;
  font-size:10px;
  padding-top:2px;
}

.journal-message {
  margin:0;
  color:#dedfc8;
}

.journal-entry[data-type=reward] .journal-message {
  color:#e6c77e;
}

.journal-entry[data-type=warning] .journal-message,.journal-entry[data-type=death] .journal-message {
  color:#f0a383;
}

.journal-entry[data-type=enemy-turn] .journal-message {
  color:#e1b09a;
}

.journal-empty {
  color:var(--muted);
  font:12px var(--sans);
}

.stats-dialog {
  width:min(540px,calc(100vw - 24px));
  padding:16px;
  max-height:calc(100dvh - 24px);
  overflow:auto;
  color:var(--ink);
  background:linear-gradient(140deg,#30382b,#1e261c);
  border:3px solid #827957;
  border-radius:3px;
  box-shadow:inset 0 0 0 1px #161b13,0 12px 50px #000a;
}

.stats-dialog::backdrop {
  background:#080d09bb;
}

.stats-dialog-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid #747354;
  padding-bottom:10px;
  margin-bottom:10px;
}

.stats-dialog-heading h2 {
  margin:0;
  color:#e7d29b;
  font-size:19px;
}

.dialog-close {
  width:30px;
  min-height:30px;
  padding:0;
  font-size:20px;
}

.stats-detail {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px 12px;
}

.stats-section-heading {
  grid-column:1/-1;
  color:#dfc88e;
  font:12px var(--sans);
  margin:12px 0 4px;
}

.stats-detail dl {
  margin:0;
  padding:6px 0;
  border-bottom:1px solid #48513d;
  font:12px/1.4 var(--sans);
  min-width:0;
}

.stats-detail dd {
  margin:4px 0 0;
  overflow-wrap:anywhere;
  color:#e0d3aa;
}

.stats-detail small {
  display:block;
  color:#b3bba2;
  margin-top:4px;
}

.stats-detail dd button {
  padding:4px 8px;
  margin:4px 4px 0 0;
  min-height:28px;
}

.allocation-note {
  grid-column:1/-1;
  font:12px/1.4 var(--sans);
  color:var(--muted);
  margin:6px 0;
}

.allocation-controls {
  grid-column:1/-1;
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  gap:6px;
  padding:8px 0;
  background:#2a3326;
}

.allocation-preview {
  color:var(--gold);
  margin:4px 0;
}

.inventory-layout { display:grid; grid-template-columns:minmax(0,1fr) 210px; gap:14px; align-items:start; }
.equipment-dialog[data-gear-open="false"] .inventory-layout { grid-template-columns:1fr; }
.paperdoll-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.equipment-cell { padding:8px 4px; min-height:58px; font:11px var(--sans); overflow-wrap:anywhere; border:1px solid #827957; background:#273123; color:var(--ink); }
.equipment-cell[data-empty="true"] { color:var(--muted); border-style:dashed; }
.equipment-cell[data-slot="head"],.equipment-cell[data-slot="body"],.equipment-cell[data-slot="legs"] { grid-column:1/-1; }
.inventory-gold { color:var(--gold); font-weight:bold; margin:6px 0; }
.tutorial-card { position:fixed; z-index:35; bottom:calc(var(--log-height) + 112px); left:14px; width:min(330px,calc(100vw - 28px)); background:#283323; border:1px solid var(--gold); padding:12px; box-shadow:0 6px 20px #0009; font:13px/1.45 var(--sans); }
.tutorial-card p { margin:8px 0; }
.tutorial-card { overflow:auto; }
.tutorial-highlight { outline:2px solid #dac17b!important; box-shadow:0 0 10px #d7b86588; }
.global-chat { position:fixed; z-index:34; right:12px; bottom:calc(var(--log-height) + 12px); width:min(370px,calc(100vw - 24px)); max-height:55dvh; padding:10px; background:#202a1e; border:2px solid #827957; font:12px var(--sans); }
.global-chat h3 { margin:0; }
.chat-messages { height:180px; max-height:30dvh; overflow:auto; list-style:none; padding:0; overflow-wrap:anywhere; }
.chat-messages li { padding:4px 0; border-bottom:1px solid #46513b; }
.chat-messages time { color:var(--muted); }
.global-chat form { display:flex; gap:6px; }
.global-chat input { width:0; min-width:0; flex:1; }
@media(min-width:1000px) { #equipment-dialog.side-panel[open] { width:min(690px,calc(100vw - 32px)); bottom:calc(var(--log-height) + 115px); height:auto; max-height:calc(100dvh - var(--log-height) - 130px); } }
@media(max-width:650px) {
  .inventory-layout { display:flex; flex-direction:column-reverse; }
  .inventory-layout>div,.inventory-layout>section { width:100%; }
  .paperdoll-grid { grid-template-columns:repeat(4,1fr); }
  .equipment-cell[data-slot] { grid-column:auto; min-height:48px; }
}

.progression-panel {
  grid-column:1/-1;
  padding:8px 0;
  font:11px/1.4 var(--sans);
  color:var(--muted);
}

.progression-panel p {
  margin:3px 0;
}

.progression-track {
  height:7px;
  background:#101710;
  border:1px solid #64694e;
}

.progression-track > div {
  height:100%;
  background:#c2a557;
}

select,input {
  max-width:100%;
  padding:7px;
  color:var(--ink);
  background:#1d261b;
  border:1px solid #939374;
  border-radius:2px;
  font:12px var(--sans);
}

.inventory-filter {
  display:flex;
  align-items:center;
  gap:8px;
  font:12px var(--sans);
  margin:8px 0;
}

.inventory-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  max-height:34dvh;
  overflow:auto;
  padding:3px;
  background:#1b2319;
  overscroll-behavior:contain;
}

.inventory-slot {
  position:relative;
  height:66px;
  min-width:0;
  border:1px solid #70745b;
  border-bottom:2px solid #464b37;
  color:#e2d4ad;
  background:linear-gradient(130deg,#3e4534,#2a3326);
  border-radius:2px;
  padding:4px;
}

.inventory-slot img {
  display:block;
  height:32px;
  width:100%;
  object-fit:contain;
}

.inventory-slot-name {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:10px var(--sans);
}

.stack-quantity {
  position:absolute;
  right:3px;
  bottom:1px;
  color:#f5dc75;
  background:#172011e8;
  font:bold 12px var(--sans);
}

.inventory-slot[data-selected=true] {
  outline:2px solid #d6c37c;
  outline-offset:-2px;
}

.inventory-slot:hover {
  border-color:#dbc785;
}

.equipped-badge {
  position:absolute;
  top:1px;
  left:3px;
  color:#d1dcba;
  font:10px var(--sans);
}

.empty-slot {
  opacity:.3;
}

.item-detail {
  margin-top:10px;
  padding:10px;
  border:1px solid #656b50;
  background:#20291d;
  font:12px/1.4 var(--sans);
}

.item-detail h3 {
  margin:0;
  color:var(--rarity,var(--gold));
  font-size:14px;
}

.item-detail p {
  margin:5px 0;
  color:#c4cbb3;
}

.item-detail button {
  margin:4px 6px 0 0;
}

.inventory-lock {
  color:#dec59b!important;
}

[data-rarity=COMMON] {
  --rarity:#d0cfb5;
}

[data-rarity=UNCOMMON] {
  --rarity:#b7d48b;
}

[data-rarity=RARE] {
  --rarity:#9dc4e8;
}

[data-rarity=EPIC] {
  --rarity:#d4a9e9;
}

[data-rarity=LEGENDARY] {
  --rarity:#efd27d;
}

.ability-card {
  margin:8px 0;
  padding:10px;
  border:1px solid #647051;
  background:#222c1e;
}

.ability-card h3 {
  margin:0;
  font-size:15px;
  color:var(--gold);
}

.ability-card p {
  font:12px/1.4 var(--sans);
  margin:5px 0;
  color:#cbd1b9;
}

.ability-card .ability-meta {
  color:#e1c992;
}

.refuge-art {
  display:block;
  width:100%;
  height:90px;
  object-fit:cover;
  object-position:center;
  border:1px solid #777153;
}

.hub-summary {
  font:12px/1.5 var(--sans);
  color:#dac78e;
  margin:8px 0;
}

.hub-launch {
  display:flex;
  gap:8px;
  align-items:center;
  margin:6px 0 10px;
}

.hub-launch label {
  display:flex;
  align-items:center;
  gap:10px;
  font:12px var(--sans);
}

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

.merchant-card {
  padding:8px;
  background:#2d3627;
  border:1px solid #596447;
  min-width:0;
}

.merchant-card h3 {
  margin:0;
  color:var(--gold);
  font-size:13px;
}

.merchant-card p {
  margin:4px 0;
  font:11px var(--sans);
}

.merchant-card input {
  width:48px;
  padding:5px;
}

.merchant-card .management-button {
  max-width:100%;
  margin-top:5px;
  font-size:10px;
}

.item-icon {
  float:right;
  width:25px;
  height:30px;
}

.encounter-panel > h2 {
  font-size:16px;
  margin:8px 0;
  color:#d1bb7c;
}

.trade-dialog p,#account-detail p {
  font:13px/1.5 var(--sans);
  overflow-wrap:anywhere;
}

.trade-dialog button,#account-detail button,#interactions-detail button {
  margin:5px;
}

.connection-indicator {
  font:11px var(--sans);
  color:#b5c99d;
  margin-top:10px;
}

.connection-indicator[data-state=offline] {
  color:#e8a384;
}

.connection-dot {
  display:inline-block;
  width:6px;
  height:6px;
  margin-right:6px;
  background:currentColor;
  border-radius:50%;
}

.creation-dialog form {
  display:grid;
  gap:10px;
}

.creation-dialog label {
  display:grid;
  gap:5px;
  font:13px var(--sans);
  color:#e4d5ac;
}

.creation-dialog input,.creation-dialog select {
  min-height:38px;
}

.name-error {
  color:#f0b39a;
  font:12px var(--sans);
  margin:0;
}

.name-error:empty {
  display:none;
}

.creation-dialog .stage-description {
  padding:9px;
  background:#202a1d;
  border:1px solid #596649;
  max-height:150px;
  overflow:auto;
}

.creation-dialog form > button {
  min-height:38px;
}

.encounter-card {
  padding:10px;
  border:1px solid #686c50;
  margin-bottom:8px;
}

.encounter-card h2 {
  margin:4px 0;
}

.health-track {
  height:6px;
  background:#281c16;
}

.health-fill {
  height:100%;
  background:#bc6953;
}

.health-copy {
  display:flex;
  justify-content:space-between;
  font:12px var(--sans);
}

.enemy-status,.encounter-kicker {
  font:11px var(--sans);
  color:var(--muted);
}

@media(min-width:1000px) {
  .side-panel[open] {
    position:fixed;
    top:10px;
    right:16px;
    bottom:calc(var(--log-height) + 20px);
    left:auto;
    width:304px;
    height:calc(100dvh - var(--log-height) - 30px);
    max-height:none;
    margin:0;
    padding:12px;
  }

  .side-panel .stats-detail {
    grid-template-columns:1fr;
  }

  .side-panel .stats-dialog-heading h2 {
    font-size:17px;
  }

  .side-panel .inventory-grid {
    max-height:30dvh;
  }

}

@media(max-width:1100px) {

  .expedition-summary {
    gap:8px;
  }


  .merchant-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .bottom-hud {
    grid-template-columns:135px minmax(0,1fr);
    gap:8px;
  }

  .action-button {
    font-size:11px;
  }

}

@media(max-width:999px) {
  :root {
    --log-height:130px;
  }

  .game-layout {
    gap:6px;
    padding:6px 0;
  }

  .journal-rail {
    gap:8px;
    padding:7px;
  }

  .journal-rail h2 {
    font-size:12px;
  }

  .side-panel {
    width:min(460px,calc(100vw - 20px));
  }

  .side-panel .inventory-grid {
    max-height:30dvh;
  }

}

@media(max-width:680px) {
  .app-frame {
    padding:0 7px;
  }




  .expedition-summary {
    font-size:10px;
    gap:6px;
  }

  .expedition-summary > strong {
    max-width:80px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }

  .management-buttons {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:4px;
  }

  .management-button {
    font-size:11px;
    min-height:34px;
    padding:6px;
  }

  .adventure-content {
    padding:6px;
    gap:5px;
  }

  .stage-title {
    font-size:17px;
  }

  .stage-eyebrow {
    font-size:9px;
  }

  .boss-banner {
    font-size:10px;
    padding:4px 6px;
  }

  .map-toolbar {
    gap:6px;
  }

  .map-toolbar label {
    font-size:10px;
  }

  .map-floor {
    font-size:16px;
  }

  .map-status,.grid-turn {
    font-size:10px;
  }

  .map-toolbar select {
    padding:4px;
    font-size:11px;
    max-width:190px;
  }

  .inspection-row {
    flex-wrap:wrap;
    gap:5px;
  }

  .target-detail {
    flex-basis:100%;
  }

  .inspection-row .management-buttons {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(45px,1fr));
    width:100%;
  }

  .inspection-row .management-button {
    padding:5px;
  }

  .bottom-hud {
    grid-template-columns:minmax(0,1fr);
    gap:5px;
    min-height:110px;
    padding-top:6px;
  }

  .vitals-region {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
  }

  .vitals-panel {
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .vital-label {
    font-size:10px;
  }

  #conditions-copy {
    max-width:110px;
    font-size:9px;
    margin:0;
  }

  .action-buttons {
    gap:3px;
  }

  .action-button {
    height:48px;
    padding:3px;
    border-width:1px;
    font-size:10px;
    line-height:1.2;
  }

  .journal-entry {
    gap:6px;
    font-size:10px;
  }

  .journal-time {
    font-size:9px;
  }

  .reward-panel {
    max-height:66px;
  }

  .reward-panel h2 {
    font-size:12px;
  }

  .reward-panel p {
    font-size:10px;
  }

  .level-up-notice p {
    font-size:10px;
  }

  .level-up-notice button {
    font-size:10px;
  }

  .stats-detail {
    grid-template-columns:1fr;
  }

  .stats-dialog {
    padding:12px;
  }

  .hub-summary {
    font-size:11px;
  }

  .hub-launch label {
    font-size:11px;
  }

  .hub-launch select {
    min-width:0;
    max-width:230px;
  }

  .refuge-art {
    height:68px;
  }

  .inventory-grid {
    max-height:28dvh;
  }

  .item-detail {
    font-size:11px;
  }

}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto!important;
    transition:none!important;
  }

}

/* Notifications overlay their own bounded layer; they never resize the map. */
.adventure-content { position:relative; }
.stage-notices { position:absolute; top:80px; right:18px; width:min(330px,calc(100% - 36px)); max-height:35%; overflow:auto; z-index:6; pointer-events:none; }
.stage-notices>* { pointer-events:auto; }
.stage-notices .boss-banner { margin:0 0 6px; max-height:72px; overflow:auto; }
.stage-notices .level-up-notice,.stage-notices .reward-panel { margin:0 0 6px; }
.equipment-cell[data-drop-state="valid"] { outline:2px solid #9dbb78; background:#354b2c; }
.equipment-cell[data-drop-state="invalid"] { outline:2px solid #ce6554; background:#4a2924; }
.inventory-slot[draggable="true"] { cursor:grab; }

.dungeon-tile.spikes { background:repeating-linear-gradient(135deg,#584b3b 0 4px,#2f2b25 4px 8px); }
.dungeon-tile.poison-pool { background:radial-gradient(ellipse at center,#6e963f,#294c28 70%); box-shadow:inset 0 0 8px #76a142; }
.hazard-marker { position:absolute; right:3px; bottom:2px; color:#e6bb85; font-size:clamp(8px,1.2vw,18px); z-index:2; }
.poison-pool .hazard-marker { color:#b4e67d; }
.dungeon-tile.hazard-spent { opacity:.7; filter:grayscale(.8); }

/* Original vector dungeon art: presentation only, over the existing redacted grid. */
.map-zoom-controls { display:inline-flex; gap:2px; margin-left:4px; vertical-align:middle; }
.map-zoom-controls button { min-width:24px; min-height:26px; padding:2px 4px; border:1px solid #817b58; background:#303a29; color:#e6d4a2; font:11px var(--sans); }
.map-zoom-controls button:disabled { opacity:.4; }
.dungeon-tile.wall-face { border-bottom:3px solid #1c281e; }
.tile-decoration { position:absolute; inset:0; width:100%; height:100%; opacity:.7; pointer-events:none; }
.tile-sprite { z-index:1; filter:drop-shadow(0 1px 1px #060b07); }
.dungeon-tile.player { box-shadow:inset 0 0 0 1px #d4be7e; }
.dungeon-tile.enemy { box-shadow:inset 0 0 0 1px #b9785e; }
.dungeon-tile.elite-enemy { outline:1px solid #c0a2d7; }
.dungeon-tile.boss-enemy { outline:2px solid #d0a14d; }
.enemy-rank { position:absolute; left:0; top:0; z-index:5; color:#f0c97c; text-shadow:0 1px 2px #000; font-size:clamp(8px,1vw,14px); line-height:1; }
.elite-enemy .enemy-rank { color:#dbc3ed; }
.fallen-marker { position:absolute; inset:12%; color:#b4a47e; opacity:.65; font-size:clamp(10px,1.4vw,24px); line-height:1.1; pointer-events:none; }
.damage-marker { position:absolute; top:0; left:50%; z-index:6; padding:1px 3px; background:#55251c; color:#fff0c6; font:bold 11px var(--sans); pointer-events:none; animation:damage-rise 1.2s ease-out forwards; }
.just-damaged .tile-sprite { animation:damage-flash .5s ease-out; }
@keyframes damage-flash { 0%,45% { filter:brightness(1.8) sepia(.7) saturate(2); } 100% { filter:drop-shadow(0 1px 1px #060b07); } }
@keyframes damage-rise { 0% { opacity:1; transform:translate(-50%,0); } 70% { opacity:1; } 100% { opacity:0; transform:translate(-50%,-12px); } }
@media(max-width:700px) {
  .vitals-region:has(#conditions-copy[data-multiple="true"]) { grid-template-columns:minmax(0,1fr); gap:4px; }
  #conditions-copy[data-multiple="true"] { max-width:none; font-size:10px; line-height:1.35; }
}
@media(prefers-reduced-motion:reduce) { .damage-marker,.just-damaged .tile-sprite { animation:none; } .damage-marker { display:none; } }

/* Camera world is translated once inside a fixed clipping viewport. */
.dungeon-tile.wall { border:1px solid #16251b; box-shadow:inset 0 2px 0 #9ca389,inset 0 -4px 0 #101d14; }
.dungeon-tile.wall-face { border-bottom:3px solid #111e15; }
.dungeon-tile.floor { border-color:#30392c; }
.awareness-marker { position:absolute; bottom:0; left:0; z-index:5; padding:0 2px; color:#e9cd85; background:#172219e8; font:bold clamp(8px,1vw,12px)/1.1 var(--sans); pointer-events:none; }
.awareness-marker[data-awareness="ENGAGED"],.awareness-marker[data-awareness="PURSUING"] { color:#ffb093; }
.awareness-marker[data-awareness="SEARCHING"] { color:#e4d5b1; }
.debug-vision-toggle { color:#d9b46d; }
  .vital-fill[data-vital="stamina"] { background:linear-gradient(90deg,#787039,#c6ba64); }
  .dungeon-tile.boss-danger { outline:2px solid #ff9764; outline-offset:-3px; background-color:#713826; box-shadow:inset 0 0 0 4px #d8794e88; }
  .dungeon-tile.ability-target { outline:2px solid #a0d6c0; outline-offset:-2px; cursor:crosshair; }
  .dungeon-tile.rooted::after { content:'⌁'; position:absolute; inset:auto 0 0; color:#b9dca2; background:#213b23c9; z-index:4; font:bold 16px/1 sans-serif; pointer-events:none; }
  .dungeon-tile.player-trap::before { content:'⌑'; position:absolute; inset:0; color:#d8c580; z-index:3; font:bold 18px/1.4 sans-serif; pointer-events:none; }
  .dungeon-tile.settlement-npc { background-color:#394c36; box-shadow:inset 0 0 0 1px #c9b56e; }
  .settlement-map .building-roof { background-image:repeating-linear-gradient(0deg,#694c38 0 5px,#392d24 5px 7px); border-top:3px solid #b39066; border-bottom:3px solid #221e19; }
  .settlement-service-dialog { width:min(950px,calc(100vw - 28px)); max-height:82dvh; overflow:auto; }
  .settlement-service-dialog .stats-dialog-heading { position:sticky; top:-1px; z-index:5; background:#2c3426; padding:8px 0; box-shadow:0 5px 0 #2c3426; }
  .settlement-service-dialog .merchant-grid { grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); }
  .settlement-service-dialog .merchant-card h4 { margin:4px 0; color:#e0c98c; }
  .settlement-service-dialog .merchant-card input { width:65px; margin-right:8px; }
  .shop-sale-row { padding:8px 0; border-top:1px solid #626345; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .shop-sale-row p { margin:0; flex:1; min-width:130px; }

/* Fixed console overlay never participates in map/camera layout. */
.developer-console { position:fixed; inset:12px 12px auto; margin:0 auto; width:min(980px,calc(100vw - 24px)); max-width:none; height:min(480px,70vh); max-height:70vh; box-sizing:border-box; padding:16px; color:var(--text); background:#20271c; border:2px solid #8e8253; box-shadow:0 12px 35px #000b; }
.developer-console[open] { display:flex; flex-direction:column; gap:10px; }
.developer-console::backdrop { background:#0005; }
.developer-console h2 { margin:0; color:#d4bf7f; font-size:1.15rem; }
.developer-console-output { flex:1; min-height:60px; overflow:auto; padding:8px; background:#10150f; border:1px solid #5a593e; }
.developer-console-output pre { margin:0 0 8px; white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.45 Consolas,monospace; color:#ddd8b8; }
.developer-console form { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.developer-console input { flex:1; min-width:120px; padding:8px; background:#151b12; color:#eee8cf; border:1px solid #8e8253; font:14px Consolas,monospace; }
.developer-console button { padding:7px 10px; background:#353b28; color:#eee8cf; border:1px solid #8e8253; cursor:pointer; }
.developer-console button:disabled { opacity:.55; cursor:default; }

/* Shared visitors stay inside the existing camera/tile coordinate system. */
.settlement-map .settlement-visitor{opacity:1;overflow:visible;cursor:default;isolation:auto}.settlement-visitor .tile-sprite{opacity:1}.visitor-name{position:absolute;bottom:85%;left:50%;transform:translateX(-50%);max-width:78px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;z-index:8;pointer-events:none;padding:1px 3px;border-radius:3px;background:#161510db;color:#f1dfb0;font:10px/1.25 sans-serif;text-shadow:0 1px #000}.settlement-visitor .visitor-name{bottom:calc(90% + var(--name-lane,0)*12px)}.settlement-controls{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;font-size:.8rem}.settlement-controls button{font-size:.75rem;padding:.25rem .4rem}

.visitor-appearance{position:absolute;inset:0;pointer-events:none;overflow:visible}

.trade-dialog{width:min(860px,94vw);max-height:90dvh;overflow:auto}.trade-columns{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.trade-columns section{min-width:0;border:1px solid #756747;background:#25231d;padding:.75rem}.trade-columns pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.72rem}.trade-editor{display:grid;gap:.5rem;margin:1rem 0}.trade-editor label{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.trade-editor input{max-width:7rem}.trade-dialog>.management-button{margin:.4rem}@media(max-width:520px){.trade-columns{grid-template-columns:1fr}.trade-dialog{padding:.75rem}.trade-editor input{max-width:5rem}}

.critical-health{outline:2px solid #e78367;outline-offset:2px;background:#411e19}.critical-health-warning{color:#ffd3b7;font-size:.78rem;grid-column:1/-1;letter-spacing:.04em}.action-button{overflow-wrap:anywhere}.ability-card label{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}#abilities-dialog[data-gameplay-panel]{max-height:55vh;bottom:auto;top:12%;right:1rem;left:auto}@media(max-width:600px){#abilities-dialog[data-gameplay-panel]{width:85vw;max-width:340px;max-height:45vh;right:.5rem;top:9%;margin:0}}

.item-frame{--material-accent:#a6ac9b;background:linear-gradient(135deg,#293027,#141d18);border-color:var(--rarity-accent,#57644d);box-shadow:inset 0 -2px var(--material-accent);border-radius:3px}.item-frame[data-rarity=UNCOMMON]{--rarity-accent:#829d67}.item-frame[data-rarity=RARE]{--rarity-accent:#7293ba}.item-frame[data-rarity=EPIC]{--rarity-accent:#a589bb}.item-frame[data-rarity=LEGENDARY]{--rarity-accent:#c8ab63}.item-icon{width:42px;height:42px;object-fit:contain;vertical-align:middle;flex-shrink:0}.equipment-cell .item-icon{display:block;margin:auto}.item-detail>.item-icon{width:64px;height:64px;float:right}.upgrade-badge{position:absolute;left:3px;top:2px;color:#f3d996;background:#172018;font-size:.72rem;padding:0 2px}.inventory-slot .stack-quantity{background:#172018d9;color:#eee1ad;padding:0 2px;z-index:2}.crafting-recipe{padding:.5rem;border-bottom:1px solid #68714e}.crafting-recipe button{margin:.2rem}.trade-dialog summary .item-icon,.reward-item .item-icon{width:32px;height:32px;margin-right:.3rem}

.touch-toggle{font-size:.7rem;padding:2px 6px;justify-self:end;background:#293326;color:#d6cca8;border:1px solid #7b805e}.touch-controls{display:grid;grid-template-columns:repeat(5,minmax(36px,1fr));gap:5px;max-width:360px;margin:4px auto;touch-action:none}.touch-controls[hidden]{display:none}.touch-controls button{min-height:40px;font-size:1.2rem;touch-action:none;background:#343c2d;color:#ece0b5;border:1px solid #8b8b66;border-radius:4px}.touch-controls .touch-interact{font-size:.75rem}.ore-deposit .tile-sprite{filter:drop-shadow(0 0 1px #c4b27b)}.ore-depleted .tile-sprite{opacity:.3;filter:grayscale(1)}

.item-tooltip{position:fixed;inset:auto;margin:0;padding:.6rem;max-width:min(280px,calc(100vw - 12px));background:#20291f;color:#e8ddba;border:1px solid #a39866;box-shadow:0 4px 14px #0009;pointer-events:none;z-index:10000;font-size:.8rem}.item-tooltip .item-icon{float:left;margin-right:.5rem}.item-tooltip p{margin:.2rem 0}.item-tooltip::backdrop{display:none}

.paperdoll-grid .equipment-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:78px;padding:5px;font-size:.68rem;line-height:1.15;overflow-wrap:normal;word-break:normal;text-align:center}.paperdoll-grid .equipment-cell .item-icon{width:30px;height:30px;margin:0}.inventory-slot .stack-quantity{top:3px;bottom:auto;right:3px}.inventory-slot .upgrade-badge{left:auto;right:3px;top:auto;bottom:17px}

/* A large body is one creature with connected solid tiles, all selectable. */
.dungeon-tile.large-body { outline:1px solid #b89b71; outline-offset:-2px; background-color:#443829; }
.dungeon-tile.large-body { overflow:hidden; }
.dungeon-tile.large-body .tile-sprite { opacity:1; transform:none; max-width:none; max-height:none; }
.dungeon-tile.large-body.selected { box-shadow:inset 0 0 0 2px #e5cc81; }
.ability-warning { border-color:#ed8a40; font-weight:600; flex-basis:100%; margin:0; }

/* Player feedback content: controls stay in document flow, away from HUD overlays. */
.touch-controls {grid-template-columns:1fr auto 1fr;width:100%;max-width:none;align-items:center;padding:4px max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left));box-sizing:border-box;gap:8px;}
.touch-horizontal {display:grid;grid-template-columns:repeat(2,minmax(44px,1fr));gap:6px;justify-self:start;}
.touch-vertical {display:grid;grid-template-columns:minmax(44px,1fr);gap:6px;justify-self:end;}
.touch-controls button {min-width:44px;min-height:44px;}
.allocation-summary {position:sticky;top:0;z-index:3;grid-column:1/-1;padding:8px;background:#27291f;border:1px solid #c1a366;box-shadow:0 2px 5px #0008;}
.allocation-summary p {margin:4px 0;font-size:12px;}.allocation-summary dl {display:flex;justify-content:space-between;gap:8px;}.allocation-summary dd {font-weight:bold;font-size:18px;}.apply-reason {color:#f3dc99;}.allocation-controls {display:flex;flex-wrap:wrap;gap:6px;}
.upgrade-comparison {padding:6px;border-left:3px solid #b3aa7d;}.upgrade-comparison p {margin:3px 0;font-variant-numeric:tabular-nums;}.upgrade-status {color:#e3cd8d;}
.dungeon-tile.discovered-stairs {box-shadow:inset 0 0 0 2px #bfa563;}.dungeon-tile.stairs-remembered {filter:brightness(.82) saturate(.75);}.stairs-remembered .tile-sprite {opacity:.9;}.stairs-visible {outline:1px solid #f6dfa0;outline-offset:-3px;}
.stair-indicator {position:absolute;z-index:8;display:flex;align-items:center;gap:3px;transform:translate(-50%,-50%);pointer-events:none;border:1px solid #baa263;border-radius:4px;background:#181c17eb;color:#f5dfa3;padding:3px;font:11px/1.2 sans-serif;}.stair-indicator[hidden] {display:none;}.stair-indicator>span:first-child {display:inline-block;font-size:20px;}
.creature-layer {position:absolute;inset:0;z-index:4;pointer-events:none;}.creature-overlay {position:absolute;pointer-events:none;}.creature-sprite {position:absolute;inset:0;width:100%;height:100%;filter:drop-shadow(0 1px 1px #000);}.creature-labels {position:absolute;}.creature-outline {position:absolute;inset:0;width:100%;height:100%;display:none;fill:none;stroke:#f0d795;stroke-width:2;pointer-events:none;}.creature-overlay.selected .creature-outline {display:block;}.creature-overlay.just-damaged .creature-sprite {animation:damage-flash .5s ease-out;}
@media(prefers-reduced-motion:reduce){.creature-overlay.just-damaged .creature-sprite {animation:none;}}
@media(max-height:450px){.touch-vertical {grid-template-columns:repeat(2,44px);}.touch-controls {margin:0;padding-top:2px;padding-bottom:max(2px,env(safe-area-inset-bottom));}.touch-controls button {min-height:38px;}.allocation-summary p {font-size:11px;}}

/* Landscape must reserve visible space for the dungeon as controls grow. */
@media(max-height:450px) and (min-width:681px){
 :root{--log-height:48px;}
 .adventure-content{padding:4px 6px;gap:2px;}
 .bottom-hud{min-height:0;padding-top:4px;grid-template-columns:125px minmax(0,1fr);gap:6px;}
 .action-button{height:40px;padding:3px;font-size:10px;}
 .inspection-row .management-button{min-height:28px;padding:4px 6px;font-size:10px;}
 .touch-controls button{min-height:44px;}
 #action-feedback{height:1.3em;min-height:1.3em;max-height:1.3em;}
 .journal-rail{padding:4px 6px;}
}

/* Ten-slot saved hotbar. One compact row; mobile scroll never changes map height. */
.action-buttons{grid-template-columns:repeat(10,minmax(0,1fr));}
.ability-book-group>h3{color:#e3cc89;border-bottom:1px solid #766545;padding-bottom:.25rem}.ability-card h4{margin:.25rem 0}.hotbar-editor{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.5rem}.hotbar-editor h3{grid-column:1/-1}.hotbar-editor label{display:flex;gap:.4rem;align-items:center}.hotbar-editor select{min-width:0;width:100%}
@media(max-width:800px){.action-buttons{display:flex;overflow-x:auto;overscroll-behavior:contain}.action-buttons .action-button{flex:0 0 94px;min-height:42px}}

.exploration-marker{position:absolute;inset:0;display:grid;place-items:center;font-size:1rem;color:#e0c988;text-shadow:0 1px 3px #000;pointer-events:none}

#abilities-dialog > .stats-dialog-heading{position:sticky;top:-1px;z-index:8;background:#2c3426;padding:8px 0;box-shadow:0 5px 0 #2c3426;}

/* Creator-approved visual families. Grid geometry and panel layout remain unchanged. */
.inventory-slot.item-frame,.equipment-cell.item-frame{background:var(--rarity-frame) center/100% 100% no-repeat #172128;border:0;border-radius:0;box-shadow:none}
.inventory-slot.item-frame:after,.equipment-cell.item-frame:after{content:'';position:absolute;bottom:6px;left:18px;right:18px;height:2px;background:var(--material-accent);opacity:.8;pointer-events:none}
.equipment-cell{position:relative}.inventory-slot.empty-slot{opacity:1;background:linear-gradient(135deg,#1e292e,#121d25);border:1px solid #65726d}
.inventory-slot-name{position:absolute;left:9px;right:9px;bottom:10px;font-size:9px;text-align:center}
.inventory-slot img{margin:3px 0 2px}.inventory-slot.item-frame:hover{filter:brightness(1.16)}
.inventory-slot .equipped-badge{background:#17251d;border:1px solid #a0b583;border-radius:2px;line-height:11px;top:4px;left:5px}
.inventory-slot .stack-quantity{right:6px;top:4px}.inventory-slot .upgrade-badge{bottom:23px;right:5px;font-size:10px}
.inventory-slot[data-unusable=true]:before{content:'';position:absolute;top:5px;left:5px;width:10px;height:12px;border:2px solid #cab58a;border-radius:5px 5px 1px 1px;background:#17232b;z-index:3;pointer-events:none}
.item-icon{box-sizing:border-box;padding:5px;background:var(--rarity-frame) center/100% 100% no-repeat}
.equipment-cell .item-icon{background:none;padding:0}
.equipment-cell[data-empty=true]{background:linear-gradient(135deg,#1e292e,#121d25);border:1px dashed #65726d}
.dungeon-tile .exploration-art,.dungeon-tile .hazard-art{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
.dungeon-tile .chest-risk-art{position:absolute;right:0;top:0;width:14px;height:14px;z-index:3;pointer-events:none}
.dungeon-tile.spikes,.dungeon-tile.poison-pool{background:#343b36 var(--terrain-texture,var(--floor-texture)) center/cover;box-shadow:none}
.dungeon-tile.hazard-spent{opacity:1;filter:none}.dungeon-tile.dim.hazard-spent{filter:brightness(.42) saturate(.5)}
.chest-opened .tile-sprite,.ore-depleted .tile-sprite{opacity:1;filter:drop-shadow(0 1px 1px #060b07)}
.dungeon-tile.rooted:after{content:'';inset:0;background:var(--rooted-texture) center/cover}
.dungeon-tile.player-trap:before{content:'';inset:0;background:var(--trap-texture) center/cover}
.fallen-marker{inset:0;background:var(--fallen-texture) center/cover;opacity:.65}

.inventory-slot[data-unusable=true]:before{border:0;border-radius:0;width:12px;height:14px;background:var(--locked-texture) center/contain no-repeat}

/* Creator review: transparent retained sprites share the new terrain beneath them. */
.chest-opened .tile-sprite{opacity:.4}
.awareness-marker[data-awareness="ENGAGED"]{inset:auto 1px 1px;height:2px;min-height:0;padding:0;border:0;border-radius:0;background:#e34b42;color:transparent;font-size:0;line-height:0}
.facing-arrow{height:11px;min-height:0;padding:0 1px;font-size:11px;line-height:10px}

.chest-risk{position:absolute;right:1px;top:0;color:#edc86e;font-weight:bold;text-shadow:0 1px 2px #000;z-index:3;pointer-events:none}

.player-health-bar{position:absolute;top:-7px;left:0;right:0;height:5px;border:1px solid #ded5af;box-shadow:0 1px 2px #000;z-index:6;pointer-events:none}
.display-options{margin:8px 0;padding:10px;border:1px solid #6f7055}.display-options legend{color:#e3d6ad}.display-options label{display:flex;align-items:center;gap:8px;min-height:36px;font-size:13px;line-height:1.4}.display-options input{flex:none;width:18px;height:18px;accent-color:#a8b86f}.display-options p{font-size:12px;line-height:1.4;color:#c4bfa9}

/* Show a local placeholder while loading; successful transparent subjects retain the actual terrain below. */
img[data-asset-state="loading"]{background-image:var(--asset-placeholder);background-position:center;background-size:contain;background-repeat:no-repeat}

/* Warrior conditions reuse compact text/outline feedback; no artwork changes. */
.dungeon-tile.stunned{outline:1px solid #dec987;outline-offset:-2px}
.enemy-condition{position:absolute;right:1px;bottom:1px;z-index:6;padding:0 2px;background:#172018e8;color:#f1d88c;font:bold 9px/1.15 sans-serif;pointer-events:none}

.dungeon-tile.ability-preview{box-shadow:inset 0 0 0 2px #eb8d35;background-color:#713a26;}

.dungeon-tile.slowed .enemy-condition{color:#a6e7f1;}

/* Sanctuary overlays terrain without replacing artwork or input. */
.sanctuary-overlay{position:absolute;inset:1px;z-index:2;pointer-events:none;background:rgba(184,204,135,.18);border:1px solid rgba(218,232,174,.7);box-shadow:inset 0 0 5px rgba(231,233,180,.2)}

/* Existing chest art; rare status is presentation only. */
.dungeon-tile.chest-rare{box-shadow:inset 0 0 0 2px #e0b34f;}
.dungeon-tile.chest-rare .tile-sprite{filter:sepia(.35) saturate(1.5) drop-shadow(0 0 2px #e3b84b);}

.player-status-badge{display:inline-block;padding:2px 5px;border:1px solid #bda665;margin:2px;font-weight:bold}.player-status-badge.stun{color:#ffd595;background:#4b3024}.player-status-badge.accuracy_down{color:#c8e9ff;background:#253d54}.dormant-art{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3}.shade-silhouette .tile-sprite{filter:brightness(0) drop-shadow(0 0 2px #79708c)}
.expedition-hud #conditions-copy:has(.player-status-badge){max-height:none;white-space:normal;overflow:visible}
