:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f1210;
  color: #e0d7c0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
  background: #080907;
}

.pixi-root {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #080907;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.pixi-root canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pixi-input-bridge {
  position: fixed;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(183, 143, 73, 0.78);
  border-radius: 7px;
  background: rgba(10, 12, 10, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}

.pixi-text-input {
  position: static;
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(183, 143, 73, 0.78);
  border-radius: 4px;
  background: rgba(10, 12, 10, 0.96);
  color: #f2e6c7;
  font-size: 16px;
  outline: none;
}

.pixi-input-bridge button {
  min-width: 64px;
  min-height: 44px;
  border-radius: 4px;
}

.phone-orientation-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
  background: radial-gradient(circle at 50% 35%, #19170f, #050605 72%);
  color: #f2e6c7;
  text-align: center;
}

.phone-orientation-card {
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid #a9854b;
  border-radius: 10px;
  background: rgba(14, 15, 12, 0.96);
}

.phone-orientation-card h1 {
  margin: 6px 0 10px;
  font-size: 24px;
}

.phone-orientation-card p {
  margin: 0;
  color: #cdbf9b;
  line-height: 1.45;
}

.phone-rotate-icon {
  font-size: 44px;
  color: #ffdf7a;
}

.hidden {
  display: none !important;
}

.legacy-dom-shell {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.pixi-fatal-error {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 30;
  max-width: min(620px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid #c45b45;
  border-radius: 6px;
  background: rgba(29, 12, 10, 0.96);
  color: #ffd8ce;
  font: 14px/1.4 Arial, Helvetica, sans-serif;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #6f5d3d;
  background: #221c16;
  color: #e0d7c0;
  padding: 8px 10px;
  cursor: pointer;
}

button:hover {
  background: #30261b;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

input,
select {
  border: 1px solid #6f5d3d;
  background: #171817;
  color: #e0d7c0;
  padding: 8px 10px;
  min-width: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.game-pane,
.side-pane {
  min-width: 0;
}

.game-pane {
  position: relative;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 15px;
  margin-bottom: 8px;
}

#status {
  margin-top: 4px;
  color: #a49779;
}

.map-status-panel {
  position: absolute;
  top: 92px;
  right: 18px;
  z-index: 6;
  display: grid;
  gap: 8px;
  width: min(240px, calc(100% - 36px));
  padding: 10px;
  border: 1px solid rgba(183, 143, 73, 0.56);
  background: rgba(9, 10, 9, 0.78);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(3px);
}

.map-status-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.map-status-portrait {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(223, 189, 116, 0.52);
  border-radius: 4px;
  background-image: url("/static/assets/character_profiles.png");
  background-position: 0 0;
  background-size: 600% 300%;
}

.map-status-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-status-title strong {
  overflow: hidden;
  color: #f2e6c7;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-status-title span {
  color: #b6a680;
  font-size: 12px;
}

.map-resource-list {
  display: grid;
  gap: 6px;
}

.map-resource {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 62px;
  gap: 7px;
  align-items: center;
  color: #d8cfb6;
  font-size: 12px;
}

.map-resource-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(4, 4, 4, 0.82);
  border-radius: 999px;
  background: rgba(45, 36, 30, 0.9);
}

.map-resource-fill {
  display: block;
  width: calc(var(--resource-ratio) * 100%);
  height: 100%;
  border-radius: inherit;
}

.map-resource-hp .map-resource-fill {
  background: linear-gradient(90deg, #2f9e4d, #85d56b);
}

.map-resource-mana .map-resource-fill {
  background: linear-gradient(90deg, #315bc2, #76a5ff);
}

.map-resource-stamina .map-resource-fill {
  background: linear-gradient(90deg, #c48a2d, #f2ce67);
}

.map-rest-button {
  min-height: 34px;
  border-color: rgba(208, 166, 83, 0.7);
  background: rgba(42, 31, 18, 0.92);
  color: #f4d58a;
  font-weight: 800;
}

.map-rest-button.resting {
  border-color: rgba(91, 180, 112, 0.82);
  background: rgba(18, 46, 28, 0.92);
  color: #9ff0a7;
}

.join-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  width: min(360px, 100%);
}

.language-picker {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #a49779;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-actions button {
  min-width: 92px;
}

#map {
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  aspect-ratio: 4 / 3;
  border: 2px solid #6f5d3d;
  background: #263923;
}

.side-pane {
  display: grid;
  align-content: start;
  gap: 14px;
}

.side-pane section {
  border: 1px solid #4d4537;
  background: #171817;
  padding: 12px;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.hidden {
  display: none;
}

.conversation-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 24, 20, 0.58);
  pointer-events: none;
}

.window-overlay,
.target-overlay,
.fight-screen {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 24, 20, 0.54);
}

.window-overlay {
  place-items: start center;
  padding: 14px;
}

.window-overlay.hidden,
.target-overlay.hidden,
.fight-screen.hidden {
  display: none;
}

.window-panel,
.target-window,
.fight-window {
  border: 2px solid #2d332b;
  background: #f4f1e8;
  box-shadow: 0 12px 36px rgba(20, 24, 20, 0.28);
}

.window-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  width: min(1400px, calc(100vw - 28px));
  height: calc(100vh - 124px);
  min-height: 360px;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  padding: 16px;
  margin-top: 76px;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.window-body {
  min-height: 360px;
  overflow: auto;
}

.target-window {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(520px, 100%);
  padding: 16px;
}

.target-name {
  font-weight: 700;
}

.target-detail {
  color: #5c625b;
  font-size: 13px;
  margin-top: 2px;
}

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

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fight-screen {
  z-index: 30;
  background: #20251f;
}

.fight-window {
  display: grid;
  gap: 14px;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
}

.fight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fight-timer {
  min-width: 62px;
  border: 1px solid #343a32;
  background: #20251f;
  color: #f7f5ed;
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
}

.fight-roster {
  min-height: 340px;
}

.fight-arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.75fr) minmax(190px, 1fr);
  gap: 18px;
  min-height: 340px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #6f6659;
  transform: perspective(900px) rotateX(6deg);
  background:
    radial-gradient(ellipse at 28% 70%, rgba(55, 79, 45, 0.24) 0 12%, transparent 13%),
    radial-gradient(ellipse at 78% 38%, rgba(92, 95, 98, 0.2) 0 8%, transparent 9%),
    linear-gradient(180deg, #b7d08d 0%, #8eb46a 48%, #658c52 100%);
}

.fight-arena::before,
.fight-arena::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.fight-arena::before {
  inset: auto 8% 12% 10%;
  height: 34px;
  background: rgba(53, 62, 45, 0.16);
  transform: skewX(-18deg);
}

.fight-arena::after {
  top: 18px;
  right: 18%;
  width: 54px;
  height: 90px;
  border-left: 8px solid rgba(73, 61, 48, 0.56);
  border-bottom: 16px solid rgba(73, 61, 48, 0.38);
}

.combat-side {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: repeat(5, minmax(58px, auto));
  align-content: center;
  gap: 12px;
}

.enemy-side {
  justify-items: end;
}

.conflict-space {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: center;
  min-height: 180px;
  color: #283025;
  font-weight: 700;
  text-align: center;
}

.combat-replay-banner {
  max-width: 320px;
  border: 2px solid #343a32;
  background: rgba(255, 253, 246, 0.92);
  padding: 10px 12px;
  animation: replay-pop 850ms ease-in-out both;
}

.replaying-arena::before {
  animation: replay-flash 850ms ease-in-out both;
}

.replay-player .combat-replay-banner {
  border-color: #2f6fed;
}

.replay-enemy .combat-replay-banner {
  border-color: #8c5144;
}

.replay-defense .combat-replay-banner {
  border-color: #43925b;
}

@keyframes replay-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  25%, 75% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@keyframes replay-flash {
  0%, 100% {
    opacity: 0.15;
  }
  40% {
    opacity: 0.55;
  }
}

.fighter {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: min(230px, 100%);
  border: 0;
  border-radius: 999px;
  padding: 10px;
  background: #f7f5ed;
  box-shadow: 0 10px 0 rgba(35, 49, 31, 0.18);
  text-align: left;
  min-height: 66px;
  transform: translateX(0);
}

.enemy-fighter {
  border-color: #8c5144;
}

.selected-fighter {
  outline: 3px solid #2f6fed;
  outline-offset: 2px;
}

.ally-target-fighter {
  box-shadow: 0 10px 0 rgba(35, 49, 31, 0.18), 0 0 0 4px rgba(67, 146, 91, 0.55);
}

.defeated-fighter {
  opacity: 0.56;
}

.fighter-portrait {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid #343a32;
  border-radius: 999px;
  background: #f0e15a;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-weight: 700;
}

.profile-portrait {
  background-image: url("/static/assets/character_profiles.png");
  background-size: 600% 300%;
  background-repeat: no-repeat;
  color: transparent;
}

.profile-knight {
  background-position: 0 0;
}

.enemy-fighter .fighter-portrait {
  background: #b95f4f;
  color: #fffdf6;
}

.enemy-fighter .fighter-portrait.icon-enemy {
  background-image: url("/static/assets/map-icons/enemy.png?v=map-icons-1");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: transparent;
}

.fighter-body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.fighter span,
.fight-log {
  color: #4e574d;
  font-size: 13px;
}

.fighter strong,
.plan-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-line {
  color: #20251f;
  font-weight: 700;
}

.resolving-arena .fighter[data-resolve-sphere="mental"] .fighter-portrait {
  animation: mental-pulse 850ms ease-in-out both;
}

.resolving-arena .fighter[data-resolve-sphere="ranged"] .fighter-portrait {
  animation: ranged-shot 850ms ease-in-out both;
}

.resolving-arena .party-side .fighter[data-resolve-sphere="melee"][data-resolve-role="attacker"] {
  animation: melee-dash-party 850ms ease-in-out both;
}

.resolving-arena .enemy-side .fighter[data-resolve-sphere="melee"][data-resolve-role="attacker"] {
  animation: melee-dash-enemy 850ms ease-in-out both;
}

.resolving-arena .fighter[data-impact-sphere] .fighter-portrait {
  animation: impact-pop 420ms ease-out both;
}

.resolving-arena .fighter[data-impact-sphere="ranged"]::after,
.resolving-arena .fighter[data-impact-sphere="mental"]::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  pointer-events: none;
  animation: impact-ring 680ms ease-out both;
}

.resolving-arena .fighter[data-impact-sphere="ranged"]::after {
  border: 3px solid rgba(47, 111, 237, 0.72);
}

.resolving-arena .fighter[data-impact-sphere="mental"]::after {
  border: 3px solid rgba(95, 75, 160, 0.72);
}

.floating-combat-number {
  position: absolute;
  top: -22px;
  right: 18px;
  z-index: 3;
  border: 2px solid #343a32;
  border-radius: 999px;
  background: #fffdf6;
  padding: 3px 8px;
  font-weight: 800;
  animation: float-combat-number 850ms ease-out both;
}

.floating-damage {
  color: #9d2c1f;
}

.floating-heal {
  color: #267a3f;
}

@keyframes mental-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(95, 75, 160, 0);
  }
  50% {
    box-shadow: 0 0 26px rgba(95, 75, 160, 0.9);
    transform: scale(1.16);
  }
}

@keyframes ranged-shot {
  0%, 100% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(18px) scale(1.08);
  }
}

@keyframes melee-dash-party {
  0%, 100% {
    transform: translateX(0);
  }
  35%, 58% {
    transform: translateX(105%) scale(1.06);
  }
}

@keyframes melee-dash-enemy {
  0%, 100% {
    transform: translateX(0);
  }
  35%, 58% {
    transform: translateX(-105%) scale(1.06);
  }
}

@keyframes impact-pop {
  0%, 100% {
    filter: brightness(1);
    transform: scale(1);
  }
  45% {
    filter: brightness(1.35);
    transform: scale(1.14);
  }
}

@keyframes impact-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.72);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes float-combat-number {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  20%, 75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(1.04);
  }
}

.fight-actions {
  display: grid;
  gap: 10px;
}

.slot-panel-title {
  font-weight: 700;
}

.slot-square-row,
.skill-icon-row,
.ap-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-square {
  display: grid;
  place-items: center;
  align-content: center;
  width: 78px;
  height: 78px;
  border: 2px solid #343a32;
  background: #fffdf6;
  padding: 4px;
}

.slot-square span {
  font-size: 11px;
  color: #5c625b;
}

.slot-square strong {
  font-size: 24px;
}

.empty-slot-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}

.slot-square small {
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-square em {
  max-width: 66px;
  overflow: hidden;
  color: #4e574d;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-slot {
  border-color: #2f6fed;
  background: #eef4ff;
}

.target-summary {
  color: #4e574d;
  font-size: 13px;
}

.ap-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ap-preset {
  display: grid;
  gap: 2px;
  min-width: 118px;
  border: 2px solid #343a32;
  background: #fffdf6;
  padding: 8px 10px;
  color: #4e574d;
  font-size: 13px;
  text-align: left;
}

.ap-preset strong {
  color: #20251f;
}

.ap-preset span {
  color: #4e574d;
  font-size: 12px;
}

.selected-ap-preset {
  border-color: #2f6fed;
  background: #eef4ff;
}

.combat-ready-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 10px;
}

.combat-ready-row span {
  color: #4e574d;
  font-weight: 700;
}

.enemy-intent-list,
.initiative-queue-list,
.combat-consequence-preview,
.combat-pile-summary,
.planned-cast-row,
.defense-slot-row,
.combat-card-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.initiative-queue-list {
  align-items: center;
}

.initiative-queue-list strong {
  color: #263324;
  margin-right: 4px;
}

.enemy-intent-list span {
  border: 1px solid #9aa092;
  background: #fff4dc;
  padding: 6px 8px;
  color: #4e3b20;
  font-size: 12px;
}

.initiative-queue-list span {
  border: 1px solid #9aa092;
  background: #eef4ff;
  padding: 6px 8px;
  color: #26324a;
  font-size: 12px;
}

.combat-consequence-preview span {
  border: 1px solid #b78f39;
  background: #fff9e8;
  padding: 6px 8px;
  color: #5a3c0d;
  font-size: 12px;
  font-weight: 700;
}

.combat-consequence-preview span small {
  display: block;
  margin-top: 3px;
  color: #6b5b3b;
  font-weight: 500;
}

.combat-consequence-preview .at-risk {
  border-color: #b95739;
  background: #fff0e8;
  color: #7a2a13;
}

.combat-consequence-preview .covered {
  border-color: #5f9a62;
  background: #edf8ed;
  color: #295c2c;
}

.combat-pile-summary span {
  border: 1px solid #9aa092;
  background: #f5f1e3;
  padding: 6px 8px;
  color: #4e574d;
  font-size: 12px;
  font-weight: 700;
}

.planned-cast-tile,
.unassigned-note {
  border: 1px solid #9aa092;
  background: #eef4ff;
  color: #26324a;
  padding: 6px 8px;
  min-width: 82px;
  min-height: 54px;
  text-align: left;
}

.planned-cast-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 6px;
  align-items: center;
}

.planned-cast-tile small {
  grid-column: 2 / 4;
  color: #4e574d;
}

.planned-cast-tile em,
.block-card-tile em {
  color: #8d2f1a;
  font-style: normal;
  font-weight: 800;
}

.selected-planned-cast {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}

.defense-slot,
.combat-card {
  border: 2px solid #343a32;
  background: #fffdf6;
  padding: 8px;
  text-align: left;
}

.defense-slot {
  min-width: 120px;
}

.defense-slot > span {
  display: block;
  color: #2f6fed;
  font-size: 20px;
  font-weight: 700;
}

.defense-slot .block-card-tile {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin: 5px 4px 0 0;
  border: 1px solid #9aa092;
  background: #f5f1e3;
  color: #263324;
  font-size: 11px;
  padding: 3px 5px;
}

.combat-card {
  display: grid;
  gap: 4px;
  width: 138px;
  min-height: 112px;
}

.combat-card span,
.combat-card small,
.combat-card em {
  color: #4e574d;
  font-size: 12px;
  font-style: normal;
}

.selected-combat-card {
  border-color: #2f6fed;
  background: #eef4ff;
}

.planned-combat-card {
  opacity: 0.72;
}

.combat-drop-target {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.2);
}

.skill-icon {
  display: grid;
  place-items: center;
  width: 104px;
  min-height: 116px;
  gap: 4px;
  align-content: start;
  padding: 8px;
}

.skill-art,
.slot-skill-art {
  display: grid;
  place-items: center;
  background-image: url("/static/assets/basic_character_skills.png");
  background-size: 300% 200%;
  background-repeat: no-repeat;
  color: transparent;
  overflow: hidden;
  border: 2px solid #211a10;
}

.skill-art {
  width: 82px;
  height: 58px;
  border-radius: 7px;
}

.slot-skill-art {
  width: 42px;
  height: 34px;
  border-radius: 5px;
}

.skill-strike {
  background-position: 0 0;
}

.skill-throw_rock {
  background-position: 50% 0;
}

.skill-intimidate {
  background-position: 100% 0;
}

.skill-bravery {
  background-position: 0 100%;
}

.skill-flee {
  background-position: 50% 100%;
}

.skill-defend {
  background-position: 100% 100%;
}

.skill-icon span {
  font-size: 12px;
  line-height: 1.15;
  min-height: 28px;
}

.fight-log {
  min-height: 120px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 10px;
  white-space: pre-wrap;
}

.fight-summary,
.fight-summary-enemies {
  border: 1px solid #6f6659;
  background: #fffdf6;
  padding: 14px;
}

.fight-summary {
  display: grid;
  gap: 10px;
}

.reward-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(70px, auto) minmax(160px, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid #c9c2b5;
  padding-top: 10px;
}

.reward-row span:first-child {
  display: grid;
  gap: 2px;
}

.reward-row small {
  color: #5c625b;
}

.reward-loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-loot {
  border: 1px solid #9aa092;
  background: #f4f1e8;
  padding: 3px 6px;
  font-size: 12px;
}

.reward-card {
  border: 1px solid #b78f39;
  background: #fff4dc;
  color: #5a3c0d;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
}

.quest-reward-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quest-reward-card {
  border: 1px solid #b78f39;
  background: #fff4dc;
  color: #5a3c0d;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
}

.conversation-overlay.hidden {
  display: none;
}

.conversation-window {
  width: min(680px, 100%);
  border: 2px solid #2d332b;
  background: #f4f1e8;
  padding: 18px;
  pointer-events: auto;
}

.npc-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.npc-portrait {
  width: 40px;
  height: 40px;
  border: 2px solid #343a32;
  border-radius: 50%;
  background: #f0e15a;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.npc-portrait.icon-npc {
  background-image: url("/static/assets/map-icons/npc.png?v=map-icons-1");
}

.npc-portrait.icon-guard {
  background-image: url("/static/assets/map-icons/guard.png?v=map-icons-1");
}

.npc-portrait.icon-merchant {
  background-image: url("/static/assets/map-icons/merchant.png?v=map-icons-1");
}

.npc-portrait.icon-quest_npc {
  background-image: url("/static/assets/map-icons/quest_npc.png?v=map-icons-1");
}

.npc-portrait.icon-chest {
  background-image: url("/static/assets/map-icons/chest.png?v=map-icons-1");
}

.npc-portrait.icon-crate {
  background-image: url("/static/assets/map-icons/crate.png?v=map-icons-1");
}

.npc-portrait.icon-herb {
  background-image: url("/static/assets/map-icons/herb.png?v=map-icons-1");
}

.npc-portrait.icon-trace {
  background-image: url("/static/assets/map-icons/trace.png?v=map-icons-1");
}

.npc-portrait.icon-notice {
  background-image: url("/static/assets/map-icons/notice.png?v=map-icons-1");
}

.npc-portrait.icon-cache {
  background-image: url("/static/assets/map-icons/cache.png?v=map-icons-1");
}

.npc-portrait.icon-cart {
  background-image: url("/static/assets/map-icons/cart.png?v=map-icons-1");
}

.npc-portrait.icon-document {
  background-image: url("/static/assets/map-icons/document.png?v=map-icons-1");
}

.npc-portrait.icon-camp {
  background-image: url("/static/assets/map-icons/camp.png?v=map-icons-1");
}

#npc-name {
  font-weight: 700;
}

#npc-kind {
  color: #5c625b;
  font-size: 13px;
  margin-top: 2px;
}

.dialogue-text {
  min-height: 62px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.conversation-options {
  display: grid;
  gap: 8px;
}

.conversation-options button {
  text-align: left;
}

.vote-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.vote-dot {
  width: 9px;
  height: 9px;
  border: 1px solid #20251f;
  border-radius: 999px;
  display: inline-block;
}

.conversation-options button.trade-conversation-option {
  border-color: #6f7fa6;
  background: #eef3ff;
  color: #22395f;
}

.conversation-options button.quest-conversation-option {
  border-color: #b88f2f;
  background: #fff4d5;
  color: #5f3f08;
}

.conversation-options button.errand-conversation-option {
  border-color: #4f7d9c;
  background: #e4f4ff;
  color: #20445c;
}

.conversation-options button.locked-conversation-option {
  border-color: #9da29a;
  background: #ecebe4;
  color: #75796f;
  cursor: not-allowed;
}

.conversation-options button.plain-conversation-option {
  border-color: #9aa092;
  background: #f7f2e6;
  color: #343830;
}

.shop-controls {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #9aa092;
}

.shop-gold,
.shop-empty {
  color: #4e574d;
  font-size: 13px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#objects {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.log {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.character-window,
.inventory-window,
.social-window,
.deck-window {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.character-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.character-tabs button {
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 8px 12px;
  font-weight: 700;
}

.character-tabs button.active-character-tab {
  background: #263324;
  color: #fffdf6;
}

.character-window.character-single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.embedded-deck-window {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.deck-readonly {
  grid-column: 1 / -1;
  border: 1px solid #b78f39;
  background: #fff4dc;
  color: #4e3b20;
  padding: 8px;
  font-weight: 700;
}

.deck-window section {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 12px;
}

.deck-card-list,
.active-deck-list {
  display: grid;
  gap: 8px;
}

.deck-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deck-tools label {
  display: grid;
  gap: 4px;
  color: #5c625b;
  font-size: 12px;
  font-weight: 700;
}

.deck-tools select,
.deck-tools input {
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 7px;
}

.deck-filter-summary {
  color: #5c625b;
  font-weight: 700;
}

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

.deck-card-row button,
.active-deck-card {
  display: grid;
  gap: 2px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 8px;
  text-align: left;
}

.deck-card-row small,
.active-deck-card small,
.deck-errors,
.deck-ok {
  color: #5c625b;
}

.deck-errors {
  color: #8d2d2d;
}

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

.social-window section {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 12px;
}

.social-window h3 {
  margin: 0;
  font-size: 15px;
}

.social-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  border-top: 1px solid #d4cbb8;
  padding-top: 8px;
}

.social-row span {
  display: grid;
  gap: 2px;
}

.social-row small,
.social-empty {
  color: #5c625b;
}

.selected-social-row {
  background: #eef4ff;
}

.party-list {
  margin: 0;
  padding-left: 18px;
}

.inspect-card {
  display: grid;
  gap: 8px;
}

.paper-doll {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 16px;
  min-height: 320px;
}

.equipment-layout {
  position: relative;
  width: 180px;
  min-height: 250px;
  display: grid;
  place-items: center;
}

.character-portrait {
  width: 112px;
  height: 112px;
  border: 2px solid #343a32;
  border-radius: 999px;
}

.equipment-layout .character-portrait {
  width: 104px;
  height: 160px;
  border-radius: 18px;
}

.equipment-slot {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 2px;
  width: 76px;
  min-height: 58px;
  border: 2px solid #6f6659;
  background: #efe6d1;
  padding: 6px;
  text-align: center;
}

.equipment-slot span {
  color: #5c625b;
  font-size: 11px;
  text-transform: uppercase;
}

.equipment-slot strong {
  font-size: 12px;
}

.equipment-slot[data-equipment-slot="weapon"] {
  left: 0;
  top: 86px;
}

.equipment-slot[data-equipment-slot="body"] {
  right: 0;
  top: 86px;
}

.equipment-slot[data-equipment-slot="trinket"] {
  left: 52px;
  bottom: 0;
}

.equipment-slot.drop-target {
  border-color: #2f6fed;
  background: #eef4ff;
}

.character-details {
  display: grid;
  align-content: start;
  gap: 12px;
}

.equipment-list {
  display: grid;
  gap: 6px;
  color: #4e574d;
  font-size: 13px;
}

.character-line {
  color: #4e574d;
}

.xp-bar {
  height: 10px;
  border: 1px solid #343a32;
  background: #fffdf6;
}

.xp-bar span {
  display: block;
  height: 100%;
  background: #2f6fed;
}

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

.stat-grid span {
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 5px 6px;
}

.reputation-list {
  display: grid;
  gap: 8px;
}

.reputation-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 8px 10px;
}

.stat-plus {
  float: right;
  min-width: 24px;
  border: 1px solid #343a32;
  background: #e8f0d2;
  cursor: pointer;
}

.skill-list {
  display: grid;
  gap: 8px;
}

.skill-tree-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid #c9c2b5;
  padding-top: 10px;
}

.skill-tree-list {
  display: grid;
  gap: 6px;
}

.skill-tree-node {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #c9c2b5;
  background: #fffdf6;
  padding: 6px;
}

.unlocked-skill {
  border-color: #43a05f;
}

.skill-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 8px;
}

.skill-row span {
  display: grid;
  gap: 2px;
}

.skill-row small {
  color: #5c625b;
}

.card-preview-list {
  display: block;
  color: #5f3f08;
  font-size: 11px;
  line-height: 1.25;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
}

.inventory-cell {
  display: grid;
  align-content: space-between;
  min-height: 76px;
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 8px;
  text-align: left;
}

.inventory-cell[draggable="true"] {
  cursor: grab;
}

.quest-inventory-cell {
  border-color: #b88f2f;
  background: #fff4d5;
}

.rarity-common {
  border-color: #9aa092;
}

.rarity-uncommon {
  border-color: #43a05f;
}

.rarity-rare {
  border-color: #2f6fed;
}

.rarity-epic {
  border-color: #8d6ac8;
}

.rarity-quest {
  border-color: #b88f2f;
  background: #fff4d5;
}

.inventory-cell small {
  color: #5f3f08;
}

.inventory-cell.dragging-item {
  opacity: 0.55;
}

.empty-cell {
  background: #e8e3d5;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

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

.quest-window section {
  border: 1px solid #9aa092;
  background: #fffdf6;
  padding: 12px;
}

.quest-window h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.quest-window ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.quest-window li span,
.quest-window li small {
  display: block;
  color: #5c625b;
  margin-top: 2px;
}

.quest-window li .quest-objective {
  color: #7a5d16;
}

.quest-window li .quest-objective.complete {
  color: #20713a;
}

.quest-window .errand-entry {
  list-style: square;
}

.errand-objectives {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.errand-objective {
  border-left: 3px solid #b78d2e;
  background: #f8f2df;
  padding: 6px 8px;
}

.errand-objective.complete {
  border-left-color: #2f8a4f;
  background: #edf7ee;
}

.errand-objective span,
.quest-window li .errand-objective-time {
  color: #4f4b3f;
}

.errand-progress {
  height: 5px;
  overflow: hidden;
  margin-top: 5px;
  background: #d9ceb5;
  border-radius: 999px;
}

.errand-progress i {
  display: block;
  height: 100%;
  background: #b78d2e;
}

.errand-objective.complete .errand-progress i {
  background: #2f8a4f;
}

.drawn-map {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 2px solid #76664e;
  background: #d8c79d;
}

.map-water,
.map-city,
.map-wharf,
.map-fields,
.map-forest,
.map-mountains,
.map-road {
  content: "";
  position: absolute;
}

.map-water {
  left: -8%;
  bottom: -10%;
  width: 42%;
  height: 52%;
  border-radius: 46% 54% 38% 62%;
  background: rgba(74, 111, 152, 0.35);
  border: 2px solid rgba(56, 84, 116, 0.35);
}

.map-city {
  left: 33%;
  top: 34%;
  width: 22%;
  height: 24%;
  background: rgba(146, 127, 96, 0.42);
  border: 2px solid rgba(81, 72, 54, 0.42);
  transform: rotate(-6deg);
}

.map-wharf {
  left: 13%;
  top: 58%;
  width: 18%;
  height: 16%;
  background: rgba(121, 94, 65, 0.34);
  border: 2px solid rgba(81, 72, 54, 0.36);
  transform: rotate(8deg);
}

.map-fields {
  left: 56%;
  top: 43%;
  width: 23%;
  height: 24%;
  background: repeating-linear-gradient(90deg, rgba(126, 151, 76, 0.42) 0 10px, rgba(166, 177, 90, 0.42) 10px 20px);
  border: 2px solid rgba(91, 105, 56, 0.35);
}

.map-forest {
  right: 8%;
  top: 12%;
  width: 26%;
  height: 30%;
  border-radius: 45% 55% 50% 50%;
  background: rgba(48, 103, 65, 0.5);
  border: 2px solid rgba(37, 78, 49, 0.42);
}

.map-mountains {
  right: 6%;
  bottom: 8%;
  width: 28%;
  height: 24%;
  background: linear-gradient(135deg, transparent 0 20%, rgba(94, 90, 84, 0.56) 21% 38%, transparent 39% 48%, rgba(120, 116, 105, 0.52) 49% 66%, transparent 67%);
  border-bottom: 2px solid rgba(81, 72, 54, 0.36);
}

.map-road {
  height: 4px;
  transform-origin: left center;
  background: rgba(96, 78, 48, 0.38);
  border-top: 1px solid rgba(255, 253, 246, 0.34);
}

.road-wharf-city {
  left: 25%;
  top: 65%;
  width: 23%;
  transform: rotate(-24deg);
}

.road-city-fields {
  left: 46%;
  top: 51%;
  width: 19%;
  transform: rotate(8deg);
}

.road-fields-forest {
  left: 67%;
  top: 52%;
  width: 19%;
  transform: rotate(-42deg);
}

.road-fields-mountains {
  left: 68%;
  top: 59%;
  width: 16%;
  transform: rotate(42deg);
}

.drawn-map::before,
.drawn-map::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(81, 72, 54, 0.34);
  transform: rotate(-8deg);
}

.drawn-map::before {
  left: 14%;
  top: 18%;
  width: 62%;
  height: 48%;
}

.drawn-map::after {
  right: 10%;
  bottom: 10%;
  width: 34%;
  height: 28%;
}

.map-location {
  position: absolute;
  z-index: 1;
  display: grid;
  grid-template-columns: 14px max-content;
  align-items: center;
  gap: 5px;
  transform: translate(-7px, -7px);
  font-size: 12px;
}

.map-circle {
  width: 13px;
  height: 13px;
  border: 2px solid #4f432f;
  border-radius: 999px;
  background: #fffdf6;
}

.map-location strong {
  padding: 2px 5px;
  border: 1px solid rgba(79, 67, 47, 0.48);
  background: rgba(255, 253, 246, 0.86);
}

.map-location small {
  grid-column: 2;
  color: #6b3f32;
  background: rgba(255, 253, 246, 0.86);
  padding: 1px 4px;
}

.current-map-node .map-circle {
  background: #7f817d;
  border-color: #20251f;
}

.empty-window {
  color: #5c625b;
}

/* Dark fantasy art direction pass. Kept near the end to override older light prototype colors. */
.window-panel,
.target-window,
.fight-window,
.conversation-window,
.fighter,
.combat-card,
.card-slot,
.inventory-slot,
.quest-entry,
.skill-node,
.deck-card,
.deck-list,
.shop-row,
.map-panel,
.social-row,
.stat-card,
.reward-card,
.quest-step,
.item-detail,
.empty-slot,
.map-location strong,
.map-location small {
  border-color: #4d4537;
  background-color: #171817;
  color: #e0d7c0;
}

.conversation-window,
.window-panel,
.target-window,
.fight-window {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.56);
}

.fight-screen,
.window-overlay,
.target-overlay,
.conversation-overlay {
  background: rgba(5, 7, 7, 0.78);
}

.target-detail,
.fighter span,
.fight-log,
.empty-window,
.hint,
.muted,
.quest-meta,
.item-flavor,
.deck-card small,
.skill-node small {
  color: #a49779;
}

.selected-combat-card,
.selected-card-slot,
.selected-skill-node,
.selected-inventory-slot {
  border-color: #b58b4a;
  background-color: #2b2419;
}

.planned-combat-card {
  opacity: 0.82;
}

.combat-drop-target {
  border-color: #86a0a8;
  box-shadow: 0 0 0 3px rgba(94, 140, 152, 0.28);
}

.fighter-portrait,
.npc-portrait {
  border-color: #7d6845;
  background-color: #171817;
}

.enemy-fighter .fighter-portrait {
  background: #3a1719;
  color: #e0d7c0;
}

.world-map-visual,
.fight-arena {
  border-color: #4d4537;
  background:
    radial-gradient(ellipse at 28% 70%, rgba(43, 72, 42, 0.32) 0 12%, transparent 13%),
    radial-gradient(ellipse at 78% 38%, rgba(72, 78, 79, 0.28) 0 8%, transparent 9%),
    linear-gradient(180deg, #263923 0%, #1c271e 48%, #141714 100%);
}

.feature-water {
  background: rgba(35, 71, 90, 0.58);
  border-color: rgba(55, 104, 123, 0.38);
}

.feature-floor,
.feature-road {
  background: rgba(88, 70, 46, 0.5);
  border-color: rgba(58, 48, 34, 0.58);
}

.feature-field {
  background: repeating-linear-gradient(90deg, rgba(38, 57, 35, 0.62) 0 10px, rgba(50, 70, 39, 0.62) 10px 20px);
  border-color: rgba(49, 66, 39, 0.5);
}

.feature-wall,
.feature-rock {
  background: rgba(63, 70, 72, 0.62);
  border-color: rgba(116, 118, 109, 0.32);
}

.feature-dock,
.feature-counter {
  background: rgba(75, 53, 36, 0.62);
  border-color: rgba(121, 92, 56, 0.36);
}

.fight-screen.combat-v2-active {
  place-items: stretch;
  padding: 0;
  background: #050606;
}

.combat-v2-active .fight-window {
  width: 100%;
  max-height: none;
  min-height: 100vh;
  border: 0;
  background: #050606;
  color: #e6ddc7;
  display: grid;
  grid-template-rows: 68px minmax(310px, 1fr) 240px 26px;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.combat-v2-active .fight-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  min-height: 68px;
  padding: 12px 18px 8px;
  border-bottom: 1px solid rgba(199, 160, 82, 0.24);
  background: linear-gradient(180deg, rgba(5, 6, 6, 0.94), rgba(5, 6, 6, 0.62));
}

.combat-v2-active .fight-timer {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9;
  min-width: 68px;
  padding: 8px 10px;
}

.combat-v2-active .fight-header h2 {
  margin: 0;
  color: #f1e6c8;
  font-size: 18px;
  letter-spacing: 0;
}

.combat-v2-active #fight-round {
  color: #a99b78;
  font-size: 13px;
}

.combat-v2-active .fight-timer {
  border-color: rgba(199, 160, 82, 0.42);
  background: rgba(9, 10, 10, 0.82);
  color: #f3d28a;
}

.combat-v2-active .fight-roster {
  min-height: 0;
  overflow: hidden;
}

.combat-v2-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  overflow: hidden;
  transform: none;
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.28), rgba(5, 6, 6, 0.02) 32%, rgba(5, 6, 6, 0.62) 100%),
    url("/static/assets/combat/arena_bone_chamber.png") center 58% / cover no-repeat;
}

.combat-v2-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 52% 58%, rgba(235, 191, 104, 0.2), transparent 34%),
    radial-gradient(ellipse at 20% 62%, rgba(82, 139, 118, 0.16), transparent 24%),
    radial-gradient(ellipse at 78% 56%, rgba(166, 76, 52, 0.16), transparent 24%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.combat-v2-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(2, 3, 3, 0.88));
  pointer-events: none;
}

.combat-v2-side {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.combat-v2-combatant {
  position: absolute;
  left: var(--slot-x);
  top: var(--slot-y);
  z-index: calc(20 + var(--slot-index));
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: clamp(132px, 10vw, 190px);
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: #efe6cf;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(var(--slot-scale));
}

.combat-v2-combatant.selected-fighter,
.combat-v2-combatant.ally-target-fighter,
.combat-v2-combatant.combat-drop-target {
  outline: 0;
  box-shadow: none;
}

.combat-v2-active .combat-v2-combatant,
.combat-v2-active .combat-v2-combatant:hover,
.combat-v2-active .combat-v2-combatant:focus,
.combat-v2-active .combat-v2-combatant:focus-visible,
.combat-v2-active .combat-v2-combatant:active {
  border-color: transparent;
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

.combat-v2-combatant::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 20px);
  z-index: -1;
  width: 78%;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.68), transparent 68%);
  filter: blur(3px);
}

.combat-v2-sprite-wrap {
  width: clamp(160px, 13vw, 240px);
  height: clamp(230px, 26vh, 340px);
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74));
}

.combat-v2-combatant .combat-v2-sprite-wrap,
.combat-v2-combatant.enemy-fighter .combat-v2-sprite-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.combat-v2-active .combat-v2-combatant .combat-v2-sprite-wrap,
.combat-v2-active .combat-v2-combatant:hover .combat-v2-sprite-wrap,
.combat-v2-active .combat-v2-combatant:focus .combat-v2-sprite-wrap,
.combat-v2-active .combat-v2-combatant:focus-visible .combat-v2-sprite-wrap,
.combat-v2-active .combat-v2-combatant:active .combat-v2-sprite-wrap,
.combat-v2-active .combat-v2-combatant.enemy-fighter .combat-v2-sprite-wrap {
  border-color: transparent;
  background: transparent;
  background-color: transparent;
}

.combat-v2-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.combat-v2-combatant[data-visual-key="enemy_wolf"] .combat-v2-sprite,
.combat-v2-combatant[data-visual-key="enemy_rabbit"] .combat-v2-sprite,
.combat-v2-combatant[data-visual-key="enemy_rat"] .combat-v2-sprite {
  filter: contrast(1.18) brightness(1.12) saturate(1.08);
  transform: scale(0.92) translateY(4%);
  transform-origin: center bottom;
}

.combat-v2-combatant[data-visual-key="enemy_wolf"] .combat-v2-sprite-wrap,
.combat-v2-combatant[data-visual-key="enemy_rabbit"] .combat-v2-sprite-wrap,
.combat-v2-combatant[data-visual-key="enemy_rat"] .combat-v2-sprite-wrap {
  width: clamp(176px, 14vw, 250px);
}

.combat-v2-nameplate {
  position: relative;
  z-index: 8;
  width: min(190px, 100%);
  margin-top: -10px;
  padding: 6px 8px;
  border: 1px solid rgba(213, 176, 98, 0.34);
  background: rgba(7, 8, 8, 0.72);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.combat-v2-nameplate strong {
  color: #f3e7cb;
  font-size: 13px;
}

.combat-v2-nameplate span {
  color: #b9aa85;
  font-size: 11px;
}

.combat-v2-healthbar {
  position: relative;
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(10, 10, 10, 0.82);
  border-radius: 999px;
  background: rgba(58, 12, 10, 0.88);
}

.combat-v2-healthbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--hp-ratio) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9e4d, #83d463);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.enemy-fighter .combat-v2-healthbar::before {
  background: linear-gradient(90deg, #9e2f2f, #e06b42);
}

.combat-v2-nameplate .plan-line {
  color: #e7be69;
}

.combat-v2-intent {
  position: absolute;
  bottom: calc(100% - 22px);
  left: 50%;
  z-index: 5;
  max-width: 190px;
  transform: translateX(-50%);
  border: 1px solid rgba(226, 171, 82, 0.6);
  background: rgba(16, 9, 8, 0.86);
  color: #ffd38d;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.combat-v2-center {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 2;
  min-height: 0;
  transform: translateX(-50%);
  color: rgba(238, 224, 192, 0.72);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.combat-v2-active .combat-replay-banner {
  max-width: 260px;
  padding: 6px 9px;
  font-size: 12px;
}

.combat-v2-active .resolving-arena .fighter[data-resolve-sphere] .combat-v2-sprite-wrap {
  animation: none;
}

.combat-v2-active .resolving-arena .combat-v2-combatant[data-resolve-sphere] .fighter-portrait {
  animation: none;
}

.combat-v2-active .resolving-arena .combat-v2-combatant.combat-v2-melee-acting {
  animation: combat-v2-melee-close 850ms ease-in-out both;
}

.combat-v2-active .resolving-arena .combat-v2-combatant.combat-v2-ranged-acting .combat-v2-sprite-wrap {
  animation: combat-v2-ranged-cast 850ms ease-in-out both;
}

.combat-v2-active .resolving-arena .enemy-fighter.combat-v2-ranged-acting .combat-v2-sprite-wrap {
  animation-name: combat-v2-enemy-ranged-cast;
}

.combat-v2-active .resolving-arena .combat-v2-combatant.combat-v2-mental-acting .combat-v2-sprite-wrap {
  animation: combat-v2-mental-cast 850ms ease-in-out both;
}

.combat-v2-active .resolving-arena .enemy-fighter.combat-v2-mental-acting .combat-v2-sprite-wrap {
  animation-name: combat-v2-enemy-mental-cast;
}

.combat-v2-active .combat-v2-melee-acting::after {
  content: "";
  position: absolute;
  left: 62%;
  top: 34%;
  z-index: 90;
  width: 76px;
  height: 76px;
  border: 3px solid rgba(255, 224, 152, 0.82);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 0 9px rgba(248, 112, 48, 0.72));
  transform: rotate(35deg) scale(0);
  animation: combat-v2-slash-arc 850ms ease-in-out both;
}

.combat-v2-active .combat-v2-mental-acting::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 64%;
  z-index: 1;
  width: 118px;
  height: 34px;
  transform: translate(-50%, -50%) scale(0.55);
  border: 1px solid rgba(170, 128, 255, 0.82);
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(114, 80, 198, 0.32), transparent 62%),
    conic-gradient(from 0deg, transparent, rgba(207, 183, 255, 0.75), transparent 34%, rgba(124, 88, 218, 0.72), transparent 68%);
  filter: blur(0.2px) drop-shadow(0 0 16px rgba(142, 95, 255, 0.88));
  opacity: 0;
  animation: combat-v2-rune-pulse 850ms ease-in-out both;
}

.combat-v2-active .enemy-fighter.combat-v2-mental-acting::after {
  top: 54%;
  width: 142px;
  height: 42px;
}

.combat-v2-active .resolving-arena .combat-v2-combatant[data-impact-sphere="ranged"]::after,
.combat-v2-active .resolving-arena .combat-v2-combatant[data-impact-sphere="mental"]::after {
  content: none;
}

.combat-v2-active .resolving-arena .combat-v2-combatant[data-impact-sphere] .fighter-portrait {
  animation: none;
}

.combat-v2-projectile {
  position: absolute;
  left: var(--from-x);
  top: var(--from-y);
  z-index: 80;
  width: clamp(84px, 7vw, 128px);
  height: clamp(34px, 3.2vw, 54px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  --projectile-direction: 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 12px 8px rgba(0, 0, 0, 0.68));
  animation: combat-v2-projectile-flight 850ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.combat-v2-projectile-bolt {
  background-image: url("/static/assets/combat/projectile_firebolt.png");
}

.combat-v2-projectile-rock {
  width: clamp(58px, 5vw, 92px);
  height: clamp(36px, 3.4vw, 58px);
  background-image: url("/static/assets/combat/projectile_rock.png");
  filter: drop-shadow(0 12px 8px rgba(0, 0, 0, 0.76));
}

.combat-v2-impact-target .combat-v2-sprite-wrap {
  animation: combat-v2-impact-jolt 420ms ease-out both;
}

@keyframes combat-v2-melee-close {
  0%, 100% {
    left: var(--slot-x);
    top: var(--slot-y);
    transform: translate(-50%, -50%) scale(var(--slot-scale));
  }
  36%, 58% {
    left: var(--attack-x);
    top: var(--attack-y);
    transform: translate(-50%, -50%) scale(calc(var(--slot-scale) * 1.08));
  }
  46% {
    filter: brightness(1.35);
  }
}

@keyframes combat-v2-ranged-cast {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  20% {
    transform: translateY(-5px) scale(1.04);
    filter: brightness(1.25);
  }
  40% {
    transform: translateY(1px) scale(0.98);
  }
}

@keyframes combat-v2-enemy-ranged-cast {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  24% {
    transform: translateY(-3px) scale(1.03) rotate(-1deg);
    filter: brightness(1.22);
  }
  46% {
    transform: translateY(1px) scale(0.99) rotate(1deg);
  }
}

@keyframes combat-v2-mental-cast {
  0%, 100% {
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74));
    transform: scale(1);
  }
  45% {
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74)) drop-shadow(0 0 24px rgba(130, 92, 210, 0.95));
    transform: scale(1.08);
  }
}

@keyframes combat-v2-enemy-mental-cast {
  0%, 100% {
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74));
    transform: scale(1);
  }
  45% {
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74)) drop-shadow(0 0 24px rgba(86, 181, 114, 0.86));
    transform: scale(1.07) translateY(-2px);
  }
}

@keyframes combat-v2-slash-arc {
  0%, 30%, 100% {
    opacity: 0;
    transform: rotate(28deg) scale(0);
  }
  45% {
    opacity: 1;
    transform: rotate(40deg) scale(1);
  }
  62% {
    opacity: 0;
    transform: rotate(76deg) scale(1.18);
  }
}

@keyframes combat-v2-rune-pulse {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55) rotate(0deg);
  }
  36% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1) rotate(38deg);
  }
  68% {
    opacity: 0.28;
    transform: translate(-50%, -50%) scale(1.22) rotate(96deg);
  }
}

@keyframes combat-v2-projectile-flight {
  0% {
    left: var(--from-x);
    top: var(--from-y);
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(var(--projectile-direction)) scale(0.7);
  }
  12% {
    opacity: 1;
  }
  72% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(var(--projectile-direction)) scale(1);
  }
  100% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(var(--projectile-direction)) scale(0.85);
  }
}

@keyframes combat-v2-impact-jolt {
  0%, 100% {
    transform: translateX(0);
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74));
  }
  42% {
    transform: translateX(-8px);
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74)) brightness(1.4);
  }
}

.combat-v2-center span,
.combat-v2-center strong {
  display: block;
}

.combat-v2-center strong {
  color: #f1c873;
  font-size: 13px;
}

.combat-v2-active .selected-fighter .combat-v2-sprite-wrap {
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.74)) drop-shadow(0 0 16px rgba(95, 164, 231, 0.85));
}

.combat-v2-active .ally-target-fighter .combat-v2-nameplate {
  border-color: rgba(87, 186, 119, 0.82);
}

.combat-v2-active .combat-drop-target .combat-v2-nameplate,
.combat-v2-active .combat-drop-target.combat-v2-defense-slot {
  box-shadow: 0 0 0 3px rgba(134, 160, 168, 0.35), 0 0 26px rgba(134, 160, 168, 0.36);
}

.combat-v2-dragging .combat-v2-defense-slot {
  border-color: rgba(236, 194, 104, 0.95);
  background:
    linear-gradient(180deg, rgba(70, 50, 22, 0.72), rgba(14, 15, 15, 0.92)),
    radial-gradient(circle at 50% 0, rgba(236, 194, 104, 0.34), transparent 58%);
}

.combat-v2-dragging[data-drag-card-target="enemy"] .enemy-fighter .combat-v2-nameplate,
.combat-v2-dragging[data-drag-card-target="ally"] .player-fighter .combat-v2-nameplate,
.combat-v2-dragging[data-drag-card-target="self"] .player-fighter .combat-v2-nameplate {
  border-color: rgba(236, 194, 104, 0.82);
  box-shadow: 0 0 0 2px rgba(236, 194, 104, 0.22), 0 0 18px rgba(236, 194, 104, 0.28);
}

.combat-v2-dragging .combat-v2-stage {
  cursor: grabbing;
}

.combat-v2-controls {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr minmax(620px, 1.35fr) 1fr;
  grid-template-areas:
    "status status status"
    ". tactical ."
    ". deck ."
    ". cast ."
    "target target target";
  gap: 7px 14px;
  padding: 7px 18px 8px;
  border-top: 1px solid rgba(199, 160, 82, 0.22);
  background: linear-gradient(180deg, rgba(5, 6, 6, 0.7), rgba(2, 3, 3, 0.98));
}

.combat-v2-status-deck {
  grid-area: status;
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(280px, 0.75fr) minmax(240px, 0.65fr);
  gap: 7px;
  align-items: stretch;
}

.combat-v2-selection,
.combat-v2-initiative,
.combat-v2-preview {
  min-height: 36px;
  border: 1px solid rgba(116, 100, 72, 0.62);
  background: rgba(12, 13, 13, 0.72);
  padding: 6px 8px;
  color: #d8ccb0;
  overflow: hidden;
}

.combat-v2-selection {
  display: grid;
  align-items: center;
}

.combat-v2-piles,
.combat-v2-initiative,
.combat-v2-preview {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.combat-v2-piles span,
.combat-v2-initiative span,
.combat-v2-preview span {
  border-color: rgba(116, 100, 72, 0.54);
  background: rgba(28, 24, 18, 0.8);
  color: #d8ccb0;
  white-space: nowrap;
}

.combat-v2-tactical-row {
  grid-area: tactical;
  display: block;
  align-items: stretch;
}

.combat-v2-defense-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 12px;
}

.combat-v2-defense-slot {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  grid-template-rows: auto auto 1fr;
  align-items: center;
  min-width: 0;
  min-height: 74px;
  border-color: rgba(149, 123, 70, 0.72);
  background: radial-gradient(circle at 50% 0, rgba(153, 113, 55, 0.28), rgba(14, 15, 15, 0.9));
  color: #eadbb9;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.combat-v2-defense-slot i {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  border: 2px solid #c49a56;
  transform: rotate(45deg);
}

.combat-v2-defense-slot strong {
  font-size: 12px;
}

.combat-v2-defense-slot > span {
  color: #f3c66f;
  font-size: 20px;
  justify-self: end;
}

.combat-v2-defense-slot small {
  grid-column: 2 / 4;
  color: #a99b78;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.combat-v2-block-stack {
  grid-column: 1 / 4;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: stretch;
  align-items: start;
  min-height: 24px;
  margin-top: 4px;
  border: 1px dashed rgba(196, 154, 86, 0.45);
  background: rgba(0, 0, 0, 0.24);
  padding: 4px;
}

.combat-v2-block-stack > em {
  color: #766a55;
  font-size: 11px;
  font-style: normal;
}

.combat-v2-defense-slot.combat-drop-target {
  transform: translateY(-3px);
}

.combat-v2-defense-slot.combat-drop-target .combat-v2-block-stack {
  border-color: rgba(236, 194, 104, 0.92);
  background: rgba(82, 57, 22, 0.42);
}

.combat-v2-cast-row {
  grid-area: cast;
  align-content: start;
  min-height: 44px;
  border: 1px solid rgba(116, 100, 72, 0.54);
  background: rgba(12, 13, 13, 0.62);
  padding: 7px;
  overflow-x: auto;
}

.combat-v2-deck-area {
  grid-area: deck;
  display: grid;
  grid-template-columns: 78px minmax(360px, 1fr) 78px;
  gap: 16px;
  align-items: center;
  min-height: 116px;
}

.combat-v2-pile {
  display: grid;
  place-items: center;
  align-content: center;
  width: 62px;
  height: 84px;
  justify-self: center;
  border: 2px solid rgba(213, 176, 98, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 211, 164, 0.92), rgba(99, 74, 43, 0.95)),
    #b89557;
  color: #1d1712;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.48);
  transform: rotate(-10deg);
}

.combat-v2-discard-pile {
  transform: rotate(10deg);
}

.combat-v2-pile strong {
  font-size: 20px;
}

.combat-v2-pile span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.combat-v2-cast-row .planned-cast-tile,
.combat-v2-cast-row .unassigned-note {
  border-color: rgba(112, 136, 158, 0.62);
  background: rgba(14, 23, 31, 0.82);
  color: #d8e8f2;
}

.combat-v2-hand {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: end;
  min-height: 126px;
  gap: 0;
  padding-top: 4px;
  overflow: visible;
}

.combat-v2-card {
  position: relative;
  width: clamp(112px, 7.4vw, 138px);
  height: 124px;
  min-height: 124px;
  margin: 0 -10px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto;
  gap: 2px;
  border-color: #4d3f2b;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(244, 228, 190, 0.96), rgba(117, 89, 52, 0.95)),
    #d6bc7d;
  color: #211913;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.58);
  transform: translateY(var(--card-rise)) rotate(var(--card-tilt));
  transform-origin: center bottom;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, background 140ms ease, filter 140ms ease;
}

.combat-v2-card:hover,
.combat-v2-card:focus-visible,
.combat-v2-card.selected-combat-card {
  z-index: 8;
  background:
    linear-gradient(180deg, rgba(255, 244, 210, 1), rgba(218, 185, 119, 0.98)),
    #f1d790;
  color: #17120d;
  filter: brightness(1.16) saturate(1.06);
  transform: translateY(-16px) rotate(0deg);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.72), 0 0 0 3px rgba(219, 177, 91, 0.38);
}

.combat-v2-card:hover i,
.combat-v2-card:hover span,
.combat-v2-card:hover small,
.combat-v2-card:hover em,
.combat-v2-card:focus-visible i,
.combat-v2-card:focus-visible span,
.combat-v2-card:focus-visible small,
.combat-v2-card:focus-visible em,
.combat-v2-card.selected-combat-card i,
.combat-v2-card.selected-combat-card span,
.combat-v2-card.selected-combat-card small,
.combat-v2-card.selected-combat-card em {
  color: #17120d;
}

.combat-v2-card b {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #151716;
  color: #f5d178;
  font-size: 15px;
}

.combat-v2-card i {
  justify-self: end;
  color: #513821;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.combat-v2-card strong {
  padding-top: 20px;
  font-size: 13px;
}

.combat-v2-card span,
.combat-v2-card small,
.combat-v2-card em {
  color: #35291e;
  line-height: 1.2;
  font-size: 11px;
}

.combat-v2-card span {
  overflow: hidden;
}

.combat-v2-card.planned-combat-card {
  opacity: 0.45;
  filter: grayscale(0.45);
}

.combat-v2-target-summary {
  grid-area: target;
  color: #a99b78;
  font-size: 12px;
}

.combat-v2-ready-row {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 8;
  display: grid;
  width: 118px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.combat-v2-ready-row span {
  color: #e3c477;
  text-align: center;
  font-size: 12px;
}

.combat-v2-ready-row button {
  min-height: 44px;
  border: 2px solid rgba(230, 184, 89, 0.82);
  background: linear-gradient(180deg, #7b241f, #2d1110);
  color: #fff0c9;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.combat-v2-ready-row button:disabled {
  border-color: rgba(112, 100, 78, 0.6);
  background: #1a1a18;
  color: #7f735a;
}

.combat-v2-active .fight-log {
  max-height: 26px;
  overflow: auto;
  border-top: 1px solid rgba(116, 100, 72, 0.4);
  background: #050606;
  color: #8f8267;
  padding: 5px 18px;
  font-size: 11px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1 1 130px;
  }

  #map {
    max-height: none;
  }

  .fight-arena {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .enemy-side {
    justify-items: stretch;
  }

  .fighter {
    width: 100%;
  }

  .fight-actions {
    grid-template-columns: 1fr;
  }

  .character-window,
  .inventory-window,
  .quest-window,
  .social-window {
    grid-template-columns: 1fr;
  }

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

  .slot-square,
  .skill-icon {
    width: calc(20% - 7px);
    min-width: 58px;
  }
}

@media (max-width: 900px) {
  .map-status-panel {
    top: 84px;
    right: 8px;
    width: min(218px, calc(100% - 16px));
    padding: 8px;
  }

  .map-status-header {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .map-status-portrait {
    width: 46px;
    height: 46px;
  }

  .map-resource {
    grid-template-columns: 34px minmax(0, 1fr) 54px;
    gap: 5px;
    font-size: 11px;
  }

  .combat-v2-active .fight-window {
    grid-template-rows: auto minmax(360px, 1fr) auto auto;
    overflow: auto;
  }

  .combat-v2-stage {
    min-height: 420px;
  }

  .combat-v2-combatant {
    width: 116px;
  }

  .combat-v2-sprite-wrap {
    width: 96px;
    height: 146px;
  }

  .combat-v2-nameplate {
    width: 126px;
  }

  .combat-v2-intent {
    max-width: 132px;
    white-space: normal;
  }

  .combat-v2-controls {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "tactical"
      "deck"
      "cast"
      "target";
    padding: 8px 10px 12px;
  }

  .combat-v2-status-deck,
  .combat-v2-tactical-row {
    grid-template-columns: 1fr;
  }

  .combat-v2-defense-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .combat-v2-deck-area {
    grid-template-columns: 58px minmax(260px, 1fr) 58px;
    gap: 8px;
    overflow-x: auto;
  }

  .combat-v2-pile {
    width: 48px;
    height: 68px;
  }

  .combat-v2-hand {
    justify-content: flex-start;
    min-height: 140px;
    overflow-x: auto;
    padding-left: 10px;
  }

  .combat-v2-card {
    flex: 0 0 136px;
    margin: 0 4px;
    transform: none;
  }

  .combat-v2-card:hover,
  .combat-v2-card:focus-visible,
  .combat-v2-card.selected-combat-card {
    transform: translateY(-8px);
  }

  .combat-v2-ready-row button {
    min-height: 58px;
  }
}
