    :root {
      --bg: #12110f;
      --panel: #1f211d;
      --panel-2: #272a25;
      --line: #3d4038;
      --text: #f4f0e8;
      --muted: #b7b0a4;
      --gold: #f0c84b;
      --hp: #ef5b5b;
      --exp: #5aa7ff;
      --durability: #f29345;
      --good: #65d48a;
      --bad: #ff7878;
      --button: #343831;
      --button-hover: #41473d;
      --ui-scale: 1;
      --scene-scale: 1;
      --app-width: 1180px;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: Arial, sans-serif;
      letter-spacing: 0;
      font-size: calc(14px * var(--ui-scale));
    }

    body.display-compact {
      --ui-scale: 0.9;
      --scene-scale: 0.86;
      --app-width: 980px;
    }

    body.display-comfort {
      --ui-scale: 1;
      --scene-scale: 1;
      --app-width: 1180px;
    }

    body.display-large {
      --ui-scale: 1.08;
      --scene-scale: 1.08;
      --app-width: 1320px;
    }

    body.battle-focus[data-game-screen="battle"] #sandboxScreen,
    body.battle-focus[data-game-screen="battle"] #logPanel {
      display: none;
    }

    body.battle-focus[data-game-screen="battle"] #battleScreen {
      display: block;
    }

    body.battle-focus[data-game-screen="battle"] .app {
      width: min(1320px, calc(100vw - 24px));
    }

    .app {
      width: min(var(--app-width), calc(100vw - 24px));
      margin: 0 auto;
      padding: 16px 0 20px;
    }

    header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }

    .screen-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      width: 100%;
      order: 3;
    }

    .screen-tab {
      min-height: 40px;
      padding: 0 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--button);
      color: var(--text);
      font-weight: 800;
      cursor: pointer;
    }

    .screen-tab:hover {
      background: var(--button-hover);
    }

    .screen-tab.active {
      border-color: var(--gold);
      color: var(--gold);
      box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.18) inset;
    }

    .screen-tab:disabled {
      opacity: 0.42;
      cursor: not-allowed;
    }

    body[data-game-screen="battle"] #sandboxScreen {
      display: none;
    }

    body[data-game-screen="overview"] #battleScreen,
    body[data-game-screen="growth"] #battleScreen,
    body[data-game-screen="gear"] #battleScreen,
    body[data-game-screen="shop"] #battleScreen,
    body[data-game-screen="world"] #battleScreen,
    body[data-game-screen="chat"] #battleScreen {
      display: none !important;
    }

    body[data-game-screen="overview"] #sandboxScreen .screen-only:not(.screen-overview),
    body[data-game-screen="growth"] #sandboxScreen .screen-only:not(.screen-growth),
    body[data-game-screen="gear"] #sandboxScreen .screen-only:not(.screen-gear),
    body[data-game-screen="shop"] #sandboxScreen .screen-only:not(.screen-shop),
    body[data-game-screen="world"] #sandboxScreen .screen-only:not(.screen-world),
    body[data-game-screen="chat"] #sandboxScreen .screen-only:not(.screen-chat) {
      display: none;
    }

    body[data-game-screen="growth"] #sandboxScreen,
    body[data-game-screen="gear"] #sandboxScreen,
    body[data-game-screen="shop"] #sandboxScreen,
    body[data-game-screen="world"] #sandboxScreen,
    body[data-game-screen="chat"] #sandboxScreen {
      grid-template-columns: 1fr;
    }

    h1 {
      margin: 0;
      font-size: 24px;
      font-weight: 800;
    }

    .version {
      color: var(--muted);
      font-size: 13px;
    }

    .display-panel {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
    }

    .display-panel select,
    .display-panel button {
      min-height: 34px;
      border-radius: 6px;
      font-size: 12px;
    }

    .display-panel select {
      color: var(--text);
      background: var(--button);
      border: 1px solid var(--line);
      padding: 0 8px;
      font-weight: 800;
    }

    .grid {
      display: grid;
      grid-template-columns: 1fr 1.25fr;
      gap: 12px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
    }

    .text-input {
      width: 100%;
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 0 10px;
      background: rgba(0, 0, 0, 0.22);
      color: var(--text);
      font: inherit;
      font-weight: 800;
      box-sizing: border-box;
    }

    .text-input:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.28);
    }

    .panel h2 {
      margin: 0 0 12px;
      font-size: 17px;
    }

    .overview-hero-panel {
      position: relative;
      grid-row: span 3;
      min-height: 640px;
      overflow: hidden;
      display: grid;
      grid-template-rows: auto 1fr auto;
      background:
        radial-gradient(circle at 48% 36%, rgba(107, 139, 126, 0.18), transparent 38%),
        linear-gradient(180deg, rgba(34, 39, 34, 0.98), rgba(12, 16, 15, 0.98));
    }

    .overview-hero-panel::before {
      content: "";
      position: absolute;
      inset: 48% -20% auto;
      height: 40%;
      background: radial-gradient(ellipse at center, rgba(101, 212, 138, 0.10), transparent 64%);
      pointer-events: none;
    }

    .overview-hero-header {
      position: relative;
      z-index: 2;
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .overview-hero-title {
      margin: 0;
      font-size: 20px;
      font-weight: 950;
    }

    .overview-hero-subtitle {
      color: var(--muted);
      font-size: 12px;
      margin-top: 4px;
      line-height: 1.35;
    }

    .overview-hero-badge {
      border: 1px solid rgba(240, 200, 75, 0.45);
      border-radius: 999px;
      padding: 6px 10px;
      color: var(--gold);
      background: rgba(240, 200, 75, 0.08);
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }

    .overview-character-stage {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      min-height: 0;
      padding: 8px 0 0;
    }

    .overview-character-stage::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 18px;
      width: 76%;
      height: 42px;
      transform: translateX(-50%);
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.12) 62%, transparent 72%);
      pointer-events: none;
    }

    .overview-character-art {
      position: relative;
      z-index: 2;
      width: min(96%, 430px);
      max-height: 548px;
      object-fit: contain;
      object-position: 50% 100%;
      filter: drop-shadow(0 18px 12px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 18px rgba(240, 200, 75, 0.10));
    }

    .overview-hero-footer {
      position: relative;
      z-index: 2;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .overview-hero-stat {
      border: 1px solid rgba(209, 215, 213, 0.14);
      border-radius: 8px;
      background: rgba(6, 9, 8, 0.48);
      padding: 9px 10px;
      min-width: 0;
    }

    .overview-hero-stat span {
      display: block;
      color: var(--muted);
      font-size: 11px;
      margin-bottom: 3px;
    }

    .overview-hero-stat strong {
      display: block;
      color: var(--text);
      font-size: 14px;
      line-height: 1.15;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .harr-lineup-panel {
      overflow: hidden;
    }

    .lineup-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .lineup-header h2 {
      margin: 0;
    }

    .lineup-note {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
      max-width: 520px;
    }

    .harr-lineup-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(150px, 1fr));
      gap: 10px;
    }

    .harr-lineup-card {
      min-width: 0;
      border: 1px solid rgba(209, 215, 213, 0.13);
      border-radius: 8px;
      background:
        radial-gradient(circle at 48% 34%, rgba(104, 148, 122, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(20, 27, 24, 0.94), rgba(7, 10, 9, 0.96));
      overflow: hidden;
    }

    .harr-lineup-stage {
      position: relative;
      height: clamp(250px, 30vw, 390px);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding: 10px 8px 0;
    }

    .harr-lineup-stage::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 10px;
      width: 76%;
      height: 28px;
      transform: translateX(-50%);
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.10) 68%, transparent 76%);
      pointer-events: none;
    }

    .harr-lineup-art {
      position: relative;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: 50% 100%;
      filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.72));
    }

    .harr-lineup-meta {
      position: relative;
      z-index: 2;
      border-top: 1px solid rgba(209, 215, 213, 0.11);
      padding: 10px;
      background: rgba(5, 7, 6, 0.72);
    }

    .harr-lineup-role {
      color: var(--text);
      font-size: 15px;
      font-weight: 950;
      line-height: 1.1;
      margin-bottom: 4px;
    }

    .harr-lineup-read {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .stat {
      background: var(--panel-2);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      min-height: 64px;
    }

    .label {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 5px;
    }

    .value {
      font-size: 22px;
      font-weight: 800;
      line-height: 1.1;
    }

    .gold { color: var(--gold); }
    .hp { color: var(--hp); }
    .exp { color: var(--exp); }
    .durability { color: var(--durability); }
    .good { color: var(--good); }
    .bad { color: var(--bad); }

    .equipment-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
    }

    .recovery-status {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid var(--line);
      background: rgba(11, 16, 13, 0.66);
      border-radius: 6px;
    }

    .recovery-status-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .recovery-status-copy {
      min-width: 0;
      line-height: 1.35;
    }

    .recovery-status-copy strong,
    .recovery-status-copy span {
      display: block;
    }

    .recovery-status-copy span {
      color: var(--muted);
      font-size: 0.88rem;
    }

    @media (max-width: 520px) {
      .recovery-status-row {
        align-items: stretch;
        flex-direction: column;
      }
      .recovery-status-row button { width: 100%; }
    }

.gear-power {
      color: var(--muted);
      font-size: 13px;
}

.market-mode-nav {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .2);
}

.market-mode-nav button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
}

.market-mode-nav button.selected {
  color: var(--gold);
  border-color: rgba(240, 200, 75, .62);
  background: rgba(240, 200, 75, .09);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.market-mode-hidden {
  display: none !important;
}

.market-workspace {
  display: grid;
  gap: 12px;
}

.market-workspace[hidden] {
  display: none !important;
}

.market-workspace h3 {
  margin: 0;
}

.sale-listing-create {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0 18px;
}

.sale-listing-create label {
  min-width: 0;
}

.sale-listing-create select,
.sale-listing-create input,
.sale-listing-create button {
  width: 100%;
}

.sale-listing-directory {
  display: grid;
  gap: 8px;
}

.sale-listing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.sale-listing-row.sold,
.sale-listing-row.cancelled,
.sale-listing-row.blocked {
  opacity: 0.7;
}

.sale-listing-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sale-listing-copy span,
.sale-listing-copy small {
  overflow-wrap: anywhere;
}

.market-listing-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
}

.market-listing-state {
  color: var(--good);
  font-size: 12px;
}

.market-empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.history-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.history-tabs button {
  width: auto;
  min-height: 34px;
  border-color: transparent;
}

.history-tabs button[aria-selected="true"] {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--good);
}

.history-event-list {
  display: grid;
  gap: 6px;
}

.history-event {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(220px, 1fr) minmax(200px, .7fr);
  gap: 10px;
  align-items: baseline;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
}

.history-event time,
.history-event span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.buy-order-item-select {
  width: min(100%, 420px);
  margin-top: 4px;
}

.direct-trade-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.4fr) minmax(100px, .6fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}
.direct-trade-controls.compact { grid-template-columns: minmax(220px, 1fr) minmax(120px, .4fr); max-width: 680px; }
.direct-trade-controls label { min-width: 0; }
.direct-trade-controls select, .direct-trade-controls input, .direct-trade-controls button { width: 100%; }
@media (max-width: 820px) { .direct-trade-controls, .direct-trade-controls.compact { grid-template-columns: 1fr; max-width: none; } }

@media (max-width: 820px) {
  .sale-listing-create,
  .sale-listing-row {
    grid-template-columns: 1fr;
  }

  .sale-listing-row button {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .market-mode-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.repair-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--gold);
  background: var(--panel-2);
}

.repair-quote[hidden] {
  display: none;
}

.repair-quote-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.repair-quote-copy span {
  overflow-wrap: anywhere;
}

.repair-quote-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

@media (max-width: 520px) {
  .repair-quote {
    align-items: stretch;
    flex-direction: column;
  }

  .repair-quote-actions button {
    flex: 1;
  }
}

    .gear-power strong {
      color: var(--good);
      font-size: 18px;
    }

    .gear-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
      min-height: 34px;
    }

    .gear-summary-empty,
    .gear-stat-chip {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-2);
      padding: 8px 10px;
      font-size: 12px;
      color: var(--muted);
    }

    .gear-stat-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .gear-stat-chip strong {
      color: var(--good);
      font-size: 13px;
    }

    .slot {
      background: var(--panel-2);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      min-height: 112px;
    }

    .slot-icon,
    .slot-empty-icon {
      font-size: 22px;
      margin-bottom: 8px;
    }

    .slot-equipped-head {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 76px;
    }

    .slot-item-art,
    .gear-shop-art,
    .inventory-item-art,
    .item-art-placeholder {
      display: block;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #151612;
      object-fit: contain;
    }

    .slot-item-art,
    .item-art-placeholder {
      width: 74px;
      height: 74px;
    }

    .gear-shop-art {
      width: 72px;
      height: 72px;
    }

    .inventory-item-art {
      width: 34px;
      height: 34px;
      flex: 0 0 auto;
    }

    .item-art-placeholder {
      display: grid;
      place-items: center;
      color: var(--muted);
      font-size: 22px;
      font-weight: 800;
    }

    .slot-name {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 5px;
      text-transform: uppercase;
    }

    .item-name {
      min-height: 36px;
      font-weight: 800;
      line-height: 1.15;
    }

    .item-meta {
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .bar {
      width: 100%;
      height: 8px;
      margin-top: 8px;
      background: #151612;
      border: 1px solid var(--line);
      border-radius: 6px;
      overflow: hidden;
    }

    .bar-fill {
      height: 100%;
      width: 100%;
      background: var(--durability);
    }

    .actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .archetype-actions {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin-top: 8px;
    }

    .simulation-actions {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin-top: 8px;
    }

    button {
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--button);
      color: var(--text);
      font-weight: 800;
      cursor: pointer;
    }

    button:hover {
      background: var(--button-hover);
    }

    button:active {
      transform: translateY(1px);
    }

    .log {
      height: 300px;
      overflow: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding-right: 4px;
    }

    .log-entry {
      background: var(--panel-2);
      border: 1px solid var(--line);
      border-left: 4px solid var(--exp);
      border-radius: 8px;
      padding: 10px;
      line-height: 1.35;
    }

    .log-entry.success { border-left-color: var(--good); }
    .log-entry.warning { border-left-color: var(--durability); }
    .log-entry.danger { border-left-color: var(--bad); }
    .log-entry.shop { border-left-color: var(--gold); }

    .world-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(12, 18, 16, 0.52);
      margin-bottom: 10px;
      padding: 10px;
    }

    .world-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }

    .world-header h3 {
      margin: 0;
      font-size: 15px;
    }

    .world-header button {
      min-height: 34px;
      padding: 8px 12px;
      width: auto;
    }

    .world-feed {
      display: grid;
      gap: 8px;
    }

    .world-event {
      border: 1px solid rgba(209, 215, 213, 0.14);
      border-left: 4px solid var(--good);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.035);
      padding: 9px 10px;
      line-height: 1.32;
    }

    .world-event.danger { border-left-color: var(--bad); }
    .world-event.record {
      border-left-color: var(--gold);
      background: rgba(240, 200, 75, 0.06);
    }

    .world-event-title {
      color: var(--text);
      font-weight: 900;
      margin-bottom: 3px;
    }

    .world-event-text {
      color: var(--text);
    }

    .world-event-meta {
      color: var(--muted);
      font-size: 11px;
      margin-top: 4px;
    }

    .achievement-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(12, 18, 16, 0.52);
      margin-bottom: 10px;
      padding: 10px;
    }

    .achievement-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }

    .achievement-header h3 {
      margin: 0;
      font-size: 15px;
    }

    .achievement-badge {
      border: 1px solid rgba(240, 200, 75, 0.36);
      border-radius: 999px;
      color: var(--gold);
      background: rgba(240, 200, 75, 0.08);
      padding: 5px 9px;
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }

    .achievement-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 8px;
    }

    .achievement-card {
      border: 1px solid rgba(209, 215, 213, 0.12);
      border-left: 4px solid rgba(209, 215, 213, 0.22);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.025);
      padding: 9px 10px;
      opacity: 0.62;
      min-height: 82px;
    }

    .achievement-card.unlocked {
      border-left-color: var(--gold);
      background: rgba(240, 200, 75, 0.055);
      opacity: 1;
    }

    .achievement-title {
      color: var(--text);
      font-weight: 950;
      margin-bottom: 4px;
    }

    .achievement-text {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.32;
    }

    .achievement-card.unlocked .achievement-text {
      color: var(--text);
    }

    .achievement-meta {
      color: var(--muted);
      font-size: 11px;
      margin-top: 6px;
    }

    .inventory {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      min-height: 38px;
    }

    .inventory-chip {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 10px;
      background: var(--panel-2);
      color: var(--muted);
      font-size: 13px;
    }

    .world-gathering { display: grid; gap: 12px; }
    .world-action-row { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
    .world-action-row button { width: auto; min-height: 38px; }
    .world-progress { color: var(--good); font-weight: 900; }
    .resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .resource-stack { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; justify-content: space-between; gap: 8px; background: rgba(255,255,255,.035); }
    .resource-stack strong { color: var(--gold); }
    .world-resource-select { display: grid; gap: 4px; color: var(--muted); font-size: 12px; min-width: 220px; }
    .world-resource-select select, .world-resource-select input { min-height: 38px; max-width: 100%; }
    .world-depot-quote { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 10px; border-radius: 8px; }
    .world-depot-quote button { width: auto; }
    .world-operation-message { min-height: 20px; color: var(--good); }
    .world-operation-message.error { color: var(--bad); }
    .processing-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .processing-resources h3 { margin: 0 0 8px; font-size: 14px; }
    .processing-recipe-grid { display: grid; gap: 6px; }
    .processing-recipe { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; background: rgba(255,255,255,.025); }
    .processing-recipe span { color: var(--muted); font-size: 12px; }
    .crafted-inventory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .crafted-item { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: grid; gap: 3px; background: var(--panel-2); }
    .crafted-item span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
    .maintenance-order-list { display: grid; gap: 8px; }
    .maintenance-order { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--panel-2); }
    .maintenance-order span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
    .maintenance-order button { width: auto; }

    @media (max-width: 520px) {
      .resource-grid { grid-template-columns: 1fr; }
      .processing-resources { grid-template-columns: 1fr; }
      .crafted-inventory { grid-template-columns: 1fr; }
      .maintenance-order { grid-template-columns: 1fr; }
      .maintenance-order button { width: 100%; }
      .world-action-row, .world-depot-quote { align-items: stretch; flex-direction: column; }
      .world-action-row button, .world-depot-quote button, .world-resource-select { width: 100%; }
      .history-tabs { width: 100%; overflow-x: auto; }
      .history-tabs button { flex: 1 0 auto; }
      .history-event { grid-template-columns: 1fr; gap: 4px; }
    }

    .inventory-item-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-align: left;
    }

    .gear-shop {
      display: grid;
      gap: 16px;
      margin-top: 14px;
    }

    .gear-shop-workspace {
      padding-top: 0;
    }

    .shop-workspace-toolbar {
      position: sticky;
      top: 0;
      z-index: 8;
      margin: 0 -14px;
      padding: 14px;
      border-bottom: 1px solid var(--line);
      border-radius: 10px 10px 0 0;
      background: rgba(31, 33, 29, 0.97);
      backdrop-filter: blur(10px);
    }

    .shop-workspace-heading {
      align-items: flex-start;
    }

    .shop-character-facts,
    .shop-escape-actions,
    .shop-filter-tabs,
    .shop-selection-summary {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .shop-character-facts {
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
    }

    .shop-character-facts span + span::before {
      content: "\00b7";
      margin-right: 8px;
    }

    .shop-escape-actions button,
    .shop-filter-tabs button {
      min-height: 38px;
    }

    .shop-filter-tabs {
      margin-top: 8px;
    }

    .shop-filter-tabs button {
      border: 1px solid var(--line);
      background: var(--button);
      color: var(--text);
      font-weight: 800;
    }

    .shop-filter-tabs button.active {
      border-color: var(--gold);
      color: var(--gold);
      box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.18) inset;
    }

    .shop-filter-tabs button[data-locked="true"]:not(.active) {
      color: var(--muted);
    }

    .shop-filter-tabs button span {
      color: var(--muted);
      font-size: 11px;
    }

    .shop-selection-summary {
      justify-content: space-between;
      margin-top: 9px;
      color: var(--muted);
      font-size: 12px;
    }

    .gear-shop-section {
      display: grid;
      gap: 8px;
    }

    .gear-shop-section h3 {
      margin: 0;
      color: var(--gold);
      font-size: 15px;
    }

    .gear-shop-section-grid {
      display: grid;
      gap: 8px;
    }

    .gear-shop-card {
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-2);
      padding: 10px;
    }

    .gear-shop-card button {
      min-width: 84px;
    }

    .wide {
      grid-column: 1 / -1;
    }

    .panel-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .panel-title-row h2 {
      margin: 0;
    }

    .growth-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .small-action {
      width: auto;
      min-height: 34px;
      padding: 7px 12px;
      font-size: 12px;
    }

    .ap-badge {
      border: 1px solid var(--gold);
      border-radius: 999px;
      padding: 8px 12px;
      background: rgba(240, 200, 75, .1);
      color: var(--gold);
      font-weight: 900;
      white-space: nowrap;
    }

    .progress-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-2);
      padding: 12px;
      margin-bottom: 10px;
    }

    .progress-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      color: var(--muted);
      font-size: 13px;
      margin-bottom: 10px;
    }

    .progress-top strong {
      color: var(--text);
    }

    .exp-track {
      position: relative;
      height: 18px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #111;
      overflow: visible;
    }

    .exp-track-fill {
      height: 100%;
      width: 0;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--blue), var(--good));
      transition: width .2s ease;
    }

    .exp-marker {
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 2px;
      height: 28px;
      background: rgba(255, 255, 255, .22);
    }

    .exp-marker span {
      position: absolute;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 10px;
      font-weight: 800;
      color: var(--muted);
    }

    .exp-marker.reached {
      background: var(--gold);
    }

    .exp-marker.claimed {
      background: var(--good);
    }

    .exp-marker.claimed span {
      color: var(--good);
    }

    .stat-upgrade-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 8px;
    }

    .growth-section {
      margin-top: 18px;
    }

    .growth-section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }

    .growth-section-title h3 {
      margin: 0;
    }

    .mastery-grid,
    .ward-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .upgrade-stat {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-2);
      padding: 10px;
      min-width: 0;
    }

    .upgrade-value-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin: 7px 0 10px;
    }

    .upgrade-value-row strong {
      font-size: 24px;
      color: var(--good);
    }

    .spent-pill {
      font-size: 11px;
      color: var(--gold);
      border: 1px solid rgba(240, 200, 75, .35);
      border-radius: 999px;
      padding: 2px 6px;
      white-space: nowrap;
    }

    .ward-source {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.7;
    }

    .ward-source b {
      color: var(--text);
    }

    .stat-add-btn {
      width: 100%;
      min-height: 34px;
    }

    .stat-add-btn:disabled {
      opacity: .45;
      cursor: not-allowed;
    }

    .stat-note {
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
    }



    .hidden { display: none; }
    .contracts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    button.primary { border-color: var(--good); }
    button.selected { border-color: var(--exp); box-shadow: 0 0 0 1px var(--exp) inset; }
    .battle-shell { padding: 12px; }
    .battle-top { display: grid; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr); gap: 10px; align-items: stretch; }
    .fighter { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
    .fighter-name { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
    .vs { display: grid; place-items: center; gap: 6px; color: var(--gold); text-align: center; }
    .vs-mark { font-size: 22px; font-weight: 900; }
    .battle-meta { width: 100%; display: grid; gap: 6px; }
    .battle-meta .stat { min-height: 48px; padding: 8px; }
    .battle-meta .value { font-size: 18px; }
    .battle-scene { position: relative; margin-top: 10px; min-height: 680px; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 50% 30%, rgba(90, 167, 255, 0.13), rgba(0, 0, 0, 0.26) 54%, rgba(0, 0, 0, 0.10)); overflow: hidden; }
    .battle-scene.resolving { border-color: rgba(240, 200, 75, 0.55); box-shadow: 0 0 24px rgba(240, 200, 75, 0.12) inset; }
    .scene-lane { position: absolute; left: 7%; right: 7%; top: 56%; height: 2px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
    .scene-distance { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); color: var(--muted); font-size: 13px; }
    .battle-plan { position: absolute; left: 50%; top: 72px; z-index: 4; transform: translateX(-50%); width: min(680px, calc(100% - 24px)); display: grid; grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1fr) 96px; gap: 8px; }
    .plan-pill { min-height: 42px; border: 1px solid rgba(183, 176, 164, 0.22); border-radius: 6px; background: rgba(18, 17, 15, 0.78); padding: 7px 9px; }
    .plan-pill .label { margin: 0 0 3px; }
    .plan-pill .value { font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .plan-pill.ready { border-color: rgba(101, 212, 138, 0.7); box-shadow: 0 0 14px rgba(101, 212, 138, 0.12) inset; }
    .mode-hint { position: absolute; left: 50%; top: 124px; z-index: 4; transform: translateX(-50%); color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
    .hex-field { position: absolute; left: 50%; top: 154px; transform: translateX(-50%); display: grid; grid-template-columns: repeat(7, 50px); grid-auto-rows: 43px; gap: 8px; padding: 34px 20px 22px; border: 1px solid rgba(120, 188, 255, 0.44); border-radius: 8px; background: radial-gradient(circle at 50% 45%, rgba(74, 119, 135, 0.19), transparent 62%), linear-gradient(180deg, rgba(16, 31, 40, 0.82), rgba(8, 16, 22, 0.72)); box-shadow: 0 0 34px rgba(90, 167, 255, 0.17) inset, 0 0 18px rgba(90, 167, 255, 0.08); overflow: visible; }
    .hex-field.move-mode { border-color: rgba(240, 200, 75, 0.72); box-shadow: 0 0 24px rgba(240, 200, 75, 0.18), 0 0 30px rgba(90, 167, 255, 0.16) inset; }
    .hex-cell { position: relative; width: 50px; height: 43px; border: 0; overflow: visible; clip-path: none; background: transparent; color: rgba(237, 236, 226, 0.68); display: grid; place-items: center; font-size: 10px; font-weight: 900; cursor: pointer; isolation: isolate; }
    .hex-cell::before { content: ""; position: absolute; left: 50%; top: 56%; z-index: 0; width: 55px; height: 44px; transform: translate(-50%, -50%) scaleY(0.44); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); border: 1px solid rgba(209, 215, 213, 0.25); background: linear-gradient(180deg, rgba(255,255,255,0.105), rgba(255,255,255,0.032)); box-shadow: 0 9px 14px rgba(0, 0, 0, 0.24), 0 1px 0 rgba(255,255,255,0.08) inset; transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
    .hex-cell:nth-child(14n + 8), .hex-cell:nth-child(14n + 9), .hex-cell:nth-child(14n + 10), .hex-cell:nth-child(14n + 11), .hex-cell:nth-child(14n + 12), .hex-cell:nth-child(14n + 13), .hex-cell:nth-child(14n + 14) { transform: translateX(26px); }
    .hex-cell.player-pos, .hex-cell.enemy-pos, .hex-cell.ally-pos, .hex-cell.foe-pos { color: var(--text); }
    .hex-cell.player-pos::before { border-color: rgba(101, 212, 138, 0.82); background: linear-gradient(180deg, rgba(101, 212, 138, 0.30), rgba(101, 212, 138, 0.10)); box-shadow: 0 0 14px rgba(101, 212, 138, 0.24), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.enemy-pos::before { border-color: rgba(255, 120, 120, 0.82); background: linear-gradient(180deg, rgba(255, 120, 120, 0.28), rgba(255, 120, 120, 0.09)); box-shadow: 0 0 14px rgba(255, 120, 120, 0.22), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.ally-pos::before { border-color: rgba(101, 212, 138, 0.70); background: linear-gradient(180deg, rgba(101, 212, 138, 0.26), rgba(101, 212, 138, 0.08)); box-shadow: 0 0 14px rgba(101, 212, 138, 0.20), 0 8px 14px rgba(0, 0, 0, 0.24); }
    .hex-cell.foe-pos::before { border-color: rgba(255, 120, 120, 0.72); background: linear-gradient(180deg, rgba(255, 120, 120, 0.25), rgba(255, 120, 120, 0.08)); box-shadow: 0 0 14px rgba(255, 120, 120, 0.20), 0 8px 14px rgba(0, 0, 0, 0.24); }
    .hex-cell.targeted-foe::before { border-color: var(--gold); background: linear-gradient(180deg, rgba(240, 200, 75, 0.34), rgba(240, 200, 75, 0.12)); box-shadow: 0 0 18px rgba(240, 200, 75, 0.28), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.attackable-foe::before { border-color: rgba(255, 224, 116, 0.98); box-shadow: 0 0 22px rgba(240, 200, 75, 0.42), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.inspected-ally::before { border-color: rgba(101, 212, 138, 0.95); background: linear-gradient(180deg, rgba(101, 212, 138, 0.34), rgba(101, 212, 138, 0.12)); box-shadow: 0 0 18px rgba(101, 212, 138, 0.30), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.reserve-pos::before { border-color: rgba(240, 200, 75, 0.38); background: linear-gradient(180deg, rgba(240, 200, 75, 0.16), rgba(240, 200, 75, 0.045)); }
    .hex-cell.reserve-pos { color: var(--gold); }
    .hex-stack { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; max-width: 38px; min-height: 36px; }
    .hex-main-label { font-size: 9px; line-height: 1; }
    .hex-cell:has(.hex-unit-art)::after { content: ""; position: absolute; left: 50%; top: 59%; z-index: 1; width: 38px; height: 15px; transform: translate(-50%, -50%); border-radius: 999px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.58), rgba(0,0,0,0.08) 70%, transparent 72%); pointer-events: none; }
    .hex-cell:has(.hex-unit-art) .hex-stack { flex-direction: column; flex-wrap: nowrap; gap: 0; max-width: 58px; min-height: 76px; transform: translateY(-18px); }
    .hex-unit { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 46px; pointer-events: auto; }
    .hex-unit-art { position: relative; z-index: 3; width: 62px; height: 84px; margin-top: -40px; object-fit: contain; object-position: 50% 100%; transform: scaleX(-1); filter: brightness(1.12) saturate(1.08) drop-shadow(0 7px 5px rgba(0,0,0,0.70)) drop-shadow(0 0 8px rgba(101, 212, 138, 0.20)); pointer-events: none; }
    .hex-unit-art.harr-guardian-art { width: 78px; height: 104px; margin-top: -56px; }
    .hex-unit-art.race-field-art { width: 70px; height: 92px; margin-top: -48px; }
    .hex-unit-art.race-orc-art { width: 76px; height: 98px; margin-top: -54px; }
    .hex-unit-art.race-dwarf-art { width: 68px; height: 82px; margin-top: -38px; }
    .hex-unit-art.race-goblin-art { width: 62px; height: 82px; margin-top: -38px; }
    .hex-unit.ally .hex-unit-art { opacity: 1; filter: brightness(1.12) contrast(1.14) saturate(1.08) drop-shadow(0 8px 5px rgba(0,0,0,0.84)) drop-shadow(0 0 2px rgba(255,255,255,0.18)); }
    .hex-unit.foe .hex-unit-art { transform: none; filter: brightness(1.08) saturate(1.08) drop-shadow(0 7px 5px rgba(0,0,0,0.70)) drop-shadow(0 0 8px rgba(255, 120, 120, 0.24)); }
    .hex-unit.reserve .hex-unit-art { opacity: 0.82; filter: brightness(1.04) saturate(0.88) drop-shadow(0 7px 5px rgba(0,0,0,0.66)) drop-shadow(0 0 8px rgba(240, 200, 75, 0.22)); }
    .hex-unit.down .hex-unit-art { opacity: 0.42; filter: grayscale(0.7) brightness(0.72) drop-shadow(0 5px 4px rgba(0,0,0,0.58)); }
    .hex-unit.staggered .hex-unit-art { opacity: 0.70; filter: saturate(0.75) brightness(0.92) drop-shadow(0 7px 5px rgba(0,0,0,0.64)); }
    .hex-unit.trading .hex-unit-art, .hex-unit.pressing .hex-unit-art { filter: brightness(1.18) saturate(1.12) drop-shadow(0 7px 5px rgba(0,0,0,0.70)) drop-shadow(0 0 10px rgba(240, 200, 75, 0.32)); }
    .hex-unit.is-attacking,
    .hex-unit.combat-action-strike,
    .hex-unit.combat-action-block,
    .hex-unit.combat-action-counter,
    .hex-unit.combat-action-wound,
    .hex-unit.combat-action-crit { z-index: 8; }
    .hex-unit.is-attacking .hex-unit-art,
    .hex-unit.combat-action-strike .hex-unit-art,
    .hex-unit.combat-action-counter .hex-unit-art,
    .hex-unit.combat-action-crit .hex-unit-art { opacity: 1; animation: unitActionPulse 460ms ease-out 1; }
    .hex-unit.combat-action-block .hex-unit-art { opacity: 1; animation: unitBlockBrace 460ms ease-out 1; }
    .hex-unit.combat-action-wound .hex-unit-art { opacity: 1; animation: unitWoundFlash 520ms ease-out 1; }
    .hex-unit.is-attacking::before,
    .hex-unit.combat-action-strike::before,
    .hex-unit.combat-action-counter::before,
    .hex-unit.combat-action-crit::before { content: ""; position: absolute; left: 50%; bottom: 38px; z-index: 9; width: 56px; height: 5px; border-radius: 999px; transform-origin: 92% 50%; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 12%, rgba(235,245,255,0.96) 46%, rgba(122,190,255,0.74) 72%, transparent 100%); box-shadow: 0 0 8px rgba(210,235,255,0.74), 0 0 16px rgba(90,167,255,0.34); animation: swordSlashFoe 460ms ease-out 1; pointer-events: none; }
    .hex-unit.is-attacking::after,
    .hex-unit.combat-action-strike::after,
    .hex-unit.combat-action-counter::after,
    .hex-unit.combat-action-crit::after { content: ""; position: absolute; left: 50%; bottom: 41px; z-index: 10; width: 18px; height: 18px; border-radius: 999px; background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(240,200,75,0.45) 42%, transparent 70%); transform: translate(-30px, -6px) scale(0); animation: swordSparkFoe 460ms ease-out 1; pointer-events: none; }
    .hex-unit.ally.is-attacking::before,
    .hex-unit.ally.combat-action-strike::before,
    .hex-unit.ally.combat-action-counter::before,
    .hex-unit.ally.combat-action-crit::before { transform-origin: 8% 50%; animation-name: swordSlashAlly; filter: drop-shadow(0 0 8px rgba(101,212,138,0.25)); }
    .hex-unit.ally.is-attacking::after,
    .hex-unit.ally.combat-action-strike::after,
    .hex-unit.ally.combat-action-counter::after,
    .hex-unit.ally.combat-action-crit::after { animation-name: swordSparkAlly; }
    .hex-unit.combat-action-counter::before { background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 12%, rgba(255,236,168,0.98) 48%, rgba(255,154,76,0.78) 74%, transparent 100%); box-shadow: 0 0 10px rgba(255,220,128,0.74), 0 0 18px rgba(255,154,76,0.36); animation-duration: 380ms; }
    .hex-unit.combat-action-crit::before { height: 7px; width: 68px; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.30) 10%, rgba(255,246,214,1) 40%, rgba(255,92,101,0.82) 78%, transparent 100%); box-shadow: 0 0 12px rgba(255,255,255,0.78), 0 0 24px rgba(255,92,101,0.46); }
    .hex-unit.combat-action-block::before { content: ""; position: absolute; left: 50%; bottom: 32px; z-index: 9; width: 48px; height: 46px; border-radius: 50%; border: 2px solid rgba(101, 212, 138, 0.88); background: radial-gradient(circle, rgba(101,212,138,0.22), rgba(101,212,138,0.06) 56%, transparent 70%); box-shadow: 0 0 12px rgba(101,212,138,0.45), inset 0 0 16px rgba(255,255,255,0.10); transform: translate(-50%, 0) scale(0.2); animation: blockShield 460ms ease-out 1; pointer-events: none; }
    .hex-unit.combat-action-block::after { content: ""; position: absolute; left: 50%; bottom: 52px; z-index: 10; width: 36px; height: 16px; border-radius: 999px; background: radial-gradient(circle at 15% 50%, rgba(255,255,255,0.95), transparent 18%), radial-gradient(circle at 52% 35%, rgba(240,200,75,0.85), transparent 20%), radial-gradient(circle at 82% 65%, rgba(101,212,138,0.70), transparent 18%); transform: translate(-50%, 0) scale(0); animation: blockSparks 460ms ease-out 1; pointer-events: none; }
    .hex-unit.combat-action-wound::before { content: ""; position: absolute; left: 50%; bottom: 43px; z-index: 9; width: 42px; height: 34px; border-radius: 999px; background: radial-gradient(circle, rgba(255,120,120,0.80), rgba(255,92,101,0.34) 45%, transparent 72%); box-shadow: 0 0 18px rgba(255,92,101,0.52); transform: translate(-50%, 0) scale(0); animation: woundBurst 520ms ease-out 1; pointer-events: none; }
    .hex-unit.combat-action-wound::after { content: ""; position: absolute; left: 50%; bottom: 76px; z-index: 10; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 92, 101, 0.92); box-shadow: 0 0 12px rgba(255, 92, 101, 0.68); transform: translate(-50%, 0) scale(0); animation: woundDrop 520ms ease-out 1; pointer-events: none; }
    .combat-popup { position: absolute; left: 50%; bottom: 88px; z-index: 14; min-width: 42px; max-width: 92px; padding: 4px 7px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.26); background: rgba(20, 19, 16, 0.94); color: var(--text); font-size: 10px; font-weight: 950; line-height: 1; text-align: center; text-transform: uppercase; white-space: nowrap; box-shadow: 0 8px 16px rgba(0,0,0,0.42), 0 0 12px rgba(255,255,255,0.08); pointer-events: none; transform: translate(-50%, 0); animation: combatPopupRise 880ms ease-out forwards; }
    .combat-popup--damage { background: rgba(76, 17, 17, 0.96); border-color: rgba(255,120,120,0.62); color: #ffd7d7; box-shadow: 0 8px 16px rgba(0,0,0,0.42), 0 0 14px rgba(255,92,101,0.36); }
    .combat-popup--crit { background: rgba(92, 13, 18, 0.98); border-color: rgba(255,220,122,0.72); color: #ffe57e; font-size: 11px; letter-spacing: 0.04em; box-shadow: 0 8px 16px rgba(0,0,0,0.42), 0 0 18px rgba(255,92,101,0.46); }
    .combat-popup--block { background: rgba(11, 55, 30, 0.96); border-color: rgba(101,212,138,0.70); color: #caffda; }
    .combat-popup--dodge { background: rgba(8, 45, 60, 0.96); border-color: rgba(94,215,255,0.74); color: #d4f6ff; }
    .combat-popup--counter { background: rgba(56, 34, 92, 0.96); border-color: rgba(202,176,255,0.72); color: #eadfff; }
    .combat-popup--luck { background: rgba(75, 55, 8, 0.96); border-color: rgba(255,216,94,0.78); color: #fff1a8; }
    .combat-popup--injury { background: rgba(80, 35, 8, 0.96); border-color: rgba(255,154,82,0.76); color: #ffe0c8; }
    @keyframes unitActionPulse { 0% { filter: brightness(1); } 36% { filter: brightness(1.22) contrast(1.08); } 100% { filter: brightness(1); } }
    @keyframes unitBlockBrace { 0%, 100% { filter: brightness(1); } 35% { filter: brightness(1.18) saturate(1.12); } }
    @keyframes unitWoundFlash { 0%, 100% { filter: brightness(1); } 28% { filter: brightness(1.18) saturate(0.92) drop-shadow(0 0 12px rgba(255,92,101,0.45)); } 52% { filter: brightness(0.90) saturate(0.82); } }
    @keyframes swordSlashAlly { 0% { opacity: 0; transform: translate(-8px, -5px) rotate(-30deg) scaleX(0.10); } 36% { opacity: 1; transform: translate(18px, -12px) rotate(-8deg) scaleX(1); } 100% { opacity: 0; transform: translate(36px, -4px) rotate(12deg) scaleX(0.18); } }
    @keyframes swordSlashFoe { 0% { opacity: 0; transform: translate(-48px, -5px) rotate(30deg) scaleX(0.10); } 36% { opacity: 1; transform: translate(-76px, -12px) rotate(8deg) scaleX(1); } 100% { opacity: 0; transform: translate(-92px, -4px) rotate(-12deg) scaleX(0.18); } }
    @keyframes swordSparkAlly { 0%, 20% { opacity: 0; transform: translate(28px, -7px) scale(0); } 38% { opacity: 1; transform: translate(44px, -13px) scale(1); } 100% { opacity: 0; transform: translate(52px, -10px) scale(0.2); } }
    @keyframes swordSparkFoe { 0%, 20% { opacity: 0; transform: translate(-34px, -7px) scale(0); } 38% { opacity: 1; transform: translate(-50px, -13px) scale(1); } 100% { opacity: 0; transform: translate(-58px, -10px) scale(0.2); } }
    @keyframes blockShield { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.2); } 34% { opacity: 1; transform: translate(-50%, -2px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -4px) scale(1.18); } }
    @keyframes blockSparks { 0%, 20% { opacity: 0; transform: translate(-50%, 0) scale(0); } 36% { opacity: 1; transform: translate(-50%, -7px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px) scale(0.35); } }
    @keyframes woundBurst { 0% { opacity: 0; transform: translate(-50%, 2px) scale(0); } 30% { opacity: 1; transform: translate(-50%, -2px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -10px) scale(1.25); } }
    @keyframes woundDrop { 0%, 24% { opacity: 0; transform: translate(-50%, -4px) scale(0); } 38% { opacity: 1; transform: translate(-50%, -12px) scale(1); } 100% { opacity: 0; transform: translate(-50%, 4px) scale(0.35); } }
    @keyframes combatPopupRise { 0% { opacity: 0; transform: translate(-50%, 8px) scale(0.72); } 18% { opacity: 1; transform: translate(-50%, -4px) scale(1.04); } 72% { opacity: 1; transform: translate(-50%, -18px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -32px) scale(0.92); } }
    .hex-unit-name { position: relative; z-index: 4; display: block; margin-top: -9px; padding: 1px 5px 2px; border-radius: 999px; background: rgba(7, 12, 10, 0.82); color: var(--text); font-size: 8px; line-height: 1; box-shadow: 0 0 0 1px rgba(101, 212, 138, 0.34), 0 3px 8px rgba(0,0,0,0.42); pointer-events: none; }
    .hex-unit.ally .hex-unit-name { background: rgba(5, 17, 10, 0.94); color: #d9ffe5; box-shadow: 0 0 0 1px rgba(101, 212, 138, 0.72), 0 3px 8px rgba(0,0,0,0.52), 0 0 10px rgba(101, 212, 138, 0.24); }
    .hex-unit.foe .hex-unit-name { box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.46), 0 3px 8px rgba(0,0,0,0.42); }
    .hex-unit.reserve .hex-unit-name { color: var(--gold); box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.42), 0 3px 8px rgba(0,0,0,0.42); }
    .hex-cell.player-pos:has(.hex-unit-art) { background: transparent; }
    .hex-token { position: relative; z-index: 3; display: grid; place-items: center; width: 24px; height: 18px; border-radius: 999px; font-size: 9px; font-weight: 900; box-shadow: 0 4px 8px rgba(0,0,0,0.34); }
    .hex-token.ally { background: rgba(116, 235, 154, 1); color: #07140c; }
    .hex-token.foe { background: rgba(255, 137, 137, 1); color: #1b0c0c; }
    .hex-token.reserve { background: rgba(240, 200, 75, 0.90); color: #171305; }
    .hex-token.pressing { box-shadow: 0 0 0 2px rgba(240, 200, 75, 0.45), 0 0 12px rgba(240, 200, 75, 0.36); }
    .hex-token.staggered { opacity: 0.72; filter: saturate(0.75); }
    .hex-token.trading { box-shadow: 0 0 0 2px rgba(90, 167, 255, 0.34); }
    .hex-token.down { opacity: 0.42; text-decoration: line-through; }
    .hex-cell:disabled { opacity: 1; }
    .hex-cell.selectable::before { border-color: rgba(240, 200, 75, 0.42); background: linear-gradient(180deg, rgba(240, 200, 75, 0.17), rgba(240, 200, 75, 0.055)); }
    .hex-cell.selected-cell::before { border-color: var(--gold); background: linear-gradient(180deg, rgba(240, 200, 75, 0.36), rgba(240, 200, 75, 0.13)); box-shadow: 0 0 16px rgba(240, 200, 75, 0.20), 0 8px 14px rgba(0, 0, 0, 0.26); }
    .hex-cell.selectable:not(:disabled):hover::before { border-color: var(--gold); background: linear-gradient(180deg, rgba(240, 200, 75, 0.30), rgba(240, 200, 75, 0.10)); transform: translate(-50%, -56%) scaleY(0.47); }
    .battle-phase { position: absolute; left: 50%; top: 38px; transform: translateX(-50%); min-width: 160px; padding: 7px 12px; border: 1px solid rgba(240, 200, 75, 0.32); border-radius: 999px; background: rgba(18, 17, 15, 0.72); color: var(--gold); font-size: 13px; font-weight: 800; text-align: center; }
    .battle-tabs { position: absolute; left: 50%; top: 438px; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; }
    .battle-tab { min-height: 34px; min-width: 118px; border-radius: 4px; border-color: rgba(240, 200, 75, 0.24); background: rgba(18, 17, 15, 0.84); color: var(--gold); }
    .battle-tab.active { border-color: var(--gold); background: rgba(240, 200, 75, 0.18); color: var(--text); box-shadow: 0 0 0 1px rgba(240, 200, 75, 0.24) inset; }
    .battle-tab.ready { border-color: var(--good); color: var(--text); }
    .pvp-status { margin: 10px 0 0; border-color: rgba(90, 167, 255, 0.30); background: rgba(23, 35, 42, 0.62); }
    .pvp-status .battle-card-title { color: var(--gold); }
    .combatant { position: absolute; top: 318px; width: 280px; transition: transform 180ms ease, left 180ms ease, right 180ms ease, opacity 160ms ease; }
    .combatant.player { left: 7%; }
    .combatant.bot { right: 7%; }
    .team-lanes { display: none; }
    .team-stack { display: grid; gap: 8px; align-content: start; }
    .team-stack.red { grid-column: 3; }
    .team-unit { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: rgba(18, 17, 15, 0.72); padding: 7px 8px; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; align-items: center; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16); }
    .team-unit.blue { border-color: rgba(101, 212, 138, 0.55); }
    .team-unit.red { border-color: rgba(255, 120, 120, 0.55); }
    .team-unit-dot { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; color: #10120f; font-size: 10px; font-weight: 900; }
    .team-unit.blue .team-unit-dot { background: var(--good); }
    .team-unit.red .team-unit-dot { background: var(--bad); }
    .team-unit-name { color: var(--text); font-size: 11px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .team-unit-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
    .team-unit-hp { height: 4px; margin-top: 5px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
    .team-unit-hp > span { display: block; height: 100%; background: var(--hp); }
    .team-unit.reserve { opacity: 0.72; }
    .battle-controls { margin-top: 10px; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; align-items: end; }
    .battle-controls .panellet { min-width: 0; }
    .battle-controls-label { color: var(--muted); font-size: 12px; margin: 0 0 6px; }
    button:disabled { opacity: 0.45; cursor: not-allowed; }
    .battle-scene.move-forward .combatant.player { transform: translateX(34px); }
    .battle-scene.move-forward .combatant.bot { transform: translateX(-34px); }
    .battle-scene.move-back .combatant.player { transform: translateX(-28px); }
    .battle-scene.move-back .combatant.bot { transform: translateX(28px); }
    .combatant-label { text-align: center; color: var(--text); font-size: 15px; font-weight: 800; margin-bottom: 8px; }
    .combatant-task { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .body-figure { display: grid; grid-template-columns: repeat(5, 48px); grid-template-rows: repeat(5, 48px); gap: 6px; justify-content: center; align-content: center; }
    .combatant.player .body-figure { animation: playerBreath 2.2s ease-in-out infinite; }
    .combatant.bot .body-figure { animation: botGuard 1.7s ease-in-out infinite; }
    .body-zone { border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; color: var(--muted); font-size: 9px; font-weight: 800; text-align: center; line-height: 1.05; transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
    .body-zone-cell { position: relative; min-width: 0; min-height: 0; }
    .body-zone-cell .body-zone { width: 100%; height: 100%; }
    .body-zone-cell.head { grid-column: 3; grid-row: 1; }
    .body-zone-cell.neck { grid-column: 3; grid-row: 2; }
    .body-zone-cell.chest { grid-column: 3; grid-row: 3; }
    .body-zone-cell.belly { grid-column: 3; grid-row: 4; }
    .body-zone-cell.left_shoulder { grid-column: 2; grid-row: 3; }
    .body-zone-cell.right_shoulder { grid-column: 4; grid-row: 3; }
    .body-zone-cell.left_arm { grid-column: 1; grid-row: 3 / span 2; }
    .body-zone-cell.right_arm { grid-column: 5; grid-row: 3 / span 2; }
    .body-zone-cell.left_leg { grid-column: 2; grid-row: 5; }
    .body-zone-cell.right_leg { grid-column: 4; grid-row: 5; }
    .body-zone.head, .body-zone.left_shoulder, .body-zone.right_shoulder { border-radius: 50%; }
    .body-zone.attack-target { border-color: var(--bad); background: rgba(255, 92, 101, 0.22); box-shadow: 0 0 18px rgba(255, 92, 101, 0.28); cursor: pointer; }
    .body-zone.defense-target { border-color: var(--good); background: rgba(99, 218, 142, 0.20); box-shadow: 0 0 18px rgba(99, 218, 142, 0.24); cursor: pointer; }
    .body-zone.attack-ready { border-color: rgba(255, 154, 76, 0.9); background: rgba(255, 154, 76, 0.16); cursor: pointer; }
    .body-zone.defense-ready { border-color: rgba(99, 218, 142, 0.9); background: rgba(99, 218, 142, 0.14); cursor: pointer; }
    .body-zone:not(:disabled):hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); }
    .body-zone.input-disabled { opacity: 0.46; cursor: default; }
    .body-zone.wounded { border-color: var(--bad); background: rgba(239, 91, 91, 0.18); color: var(--text); box-shadow: 0 0 16px rgba(239, 91, 91, 0.2) inset; }
    .body-zone.wounded::before { content: ''; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 999px; background: var(--bad); box-shadow: 0 0 9px rgba(239, 91, 91, 0.75); }
    .point-count { position: absolute; right: -8px; top: -8px; min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; color: #111; font-weight: 900; }
    .point-count.attack { background: var(--durability); }
    .point-count.defense { background: var(--good); }
    .body-zone { position: relative; }
    .body-zone.impact { transform: scale(1.08); box-shadow: 0 0 26px rgba(255, 208, 92, 0.55); }
    .zone-equipment-card { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(24, 25, 21, 0.96); padding: 10px; }
    .zone-equipment-card[hidden] { display: none; }
    .zone-equipment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .zone-equipment-head div { display: grid; gap: 2px; }
    .zone-equipment-head span { color: var(--muted); font-size: 11px; }
    .zone-equipment-head strong { color: var(--text); font-size: 15px; }
    .zone-equipment-close { width: 30px; height: 30px; min-width: 30px; padding: 0; font-size: 20px; line-height: 1; }
    .zone-equipment-items { display: grid; gap: 8px; margin-top: 8px; }
    .zone-equipment-item { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: rgba(255,255,255,0.035); }
    .zone-equipment-item[data-relation="linked"] { border-style: dashed; }
    .zone-equipment-art { width: 54px; height: 54px; object-fit: contain; }
    .zone-equipment-copy { min-width: 0; display: grid; gap: 3px; }
    .zone-equipment-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
    .zone-equipment-title strong { overflow-wrap: anywhere; }
    .zone-equipment-title span { color: var(--muted); font-size: 10px; white-space: nowrap; }
    .zone-equipment-status { width: max-content; font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .zone-equipment-status.active { color: var(--good); }
    .zone-equipment-status.broken { color: var(--bad); }
    .zone-equipment-empty { color: var(--muted); padding: 8px 0 2px; }
    .strike-arrow { position: absolute; left: 35%; right: 35%; top: 394px; height: 3px; background: var(--gold); opacity: 0; transform: scaleX(0.5); transform-origin: left center; transition: opacity 120ms ease, transform 160ms ease; }
    .strike-arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border-left: 10px solid var(--gold); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
    .strike-arrow.active { opacity: 1; transform: scaleX(1); }
    @keyframes playerBreath {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-2px); }
    }
    @keyframes botGuard {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      45% { transform: translateY(-2px) rotate(-1deg); }
      70% { transform: translateY(1px) rotate(1deg); }
    }
    .choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
    .stance-grid, .move-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .stance-grid button, .move-grid button { min-height: 36px; font-size: 12px; }
    .battle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .battle-actions .primary { grid-column: 1 / -1; }
    .battle-result-panel { margin-top: 10px; }
    .battle-result-panel h2 { display: flex; align-items: center; gap: 8px; }
    .battle-card { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--exp); border-radius: 8px; padding: 10px; margin-bottom: 8px; line-height: 1.35; }
    .battle-card.director-main { background: rgba(240, 200, 75, 0.08); border-color: rgba(240, 200, 75, 0.28); border-left-color: var(--gold); }
    .battle-card.director-plan { opacity: 0.86; }
    .battle-card-title { color: var(--text); font-weight: 900; margin-bottom: 4px; }
    .battle-card-emotion { color: var(--text); font-size: 18px; font-weight: 950; line-height: 1.18; margin: 2px 0 7px; }
    .battle-card-text { color: var(--text); }
    .battle-card.warning { border-left-color: var(--durability); }
    .battle-card.danger { border-left-color: var(--bad); }
    .battle-card.success { border-left-color: var(--good); }
    .battle-card.damage { border-left-color: var(--bad); }
    .pvp-debug {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.25;
    }
    .pvp-debug span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .pvp-debug strong { color: var(--text); }
    .battle-details { color: var(--muted); font-size: 13px; line-height: 1.45; max-height: 190px; overflow: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
    .combat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .combat-tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 22px;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: #10130f;
      font-size: 11px;
      font-weight: 900;
      line-height: 1;
      letter-spacing: 0.03em;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
      text-transform: uppercase;
    }
    .combat-tag--hit { background: #f1f1df; }
    .combat-tag--crit { background: #ff6464; color: #1c0505; }
    .combat-tag--luck { background: #ffd85e; color: #211600; }
    .combat-tag--dodge { background: #5ed7ff; color: #021620; }
    .combat-tag--counter { background: #a98cff; color: #150b22; }
    .combat-tag--block { background: #6df0a6; color: #03180c; }
    .combat-tag--injury { background: #ff9a52; color: #1e0b00; }

    body.display-compact .battle-scene { min-height: 600px; }
    body.display-compact .battle-plan { top: 58px; width: min(610px, calc(100% - 20px)); }
    body.display-compact .mode-hint { top: 110px; }
    body.display-compact .hex-field { top: 136px; grid-template-columns: repeat(7, 42px); grid-auto-rows: 36px; gap: 6px; padding: 13px 16px; }
    body.display-compact .hex-cell { width: 42px; height: 36px; font-size: 9px; }
    body.display-compact .hex-cell::before { width: 47px; height: 38px; }
    body.display-compact .hex-cell:has(.hex-unit-art)::after { width: 32px; height: 12px; }
    body.display-compact .hex-cell:has(.hex-unit-art) .hex-stack { min-height: 62px; transform: translateY(-14px); }
    body.display-compact .hex-unit-art { width: 52px; height: 70px; margin-top: -34px; }
    body.display-compact .hex-unit-art.harr-guardian-art { width: 64px; height: 86px; margin-top: -45px; }
    body.display-compact .hex-unit-art.race-field-art { width: 58px; height: 76px; margin-top: -40px; }
    body.display-compact .hex-unit-art.race-orc-art { width: 62px; height: 82px; margin-top: -45px; }
    body.display-compact .hex-unit-art.race-dwarf-art { width: 56px; height: 68px; margin-top: -32px; }
    body.display-compact .hex-unit-art.race-goblin-art { width: 52px; height: 68px; margin-top: -32px; }
    body.display-compact .hex-unit.is-attacking::before,
    body.display-compact .hex-unit.combat-action-strike::before,
    body.display-compact .hex-unit.combat-action-counter::before,
    body.display-compact .hex-unit.combat-action-crit::before { width: 48px; height: 4px; bottom: 33px; }
    body.display-compact .hex-unit.is-attacking::after,
    body.display-compact .hex-unit.combat-action-strike::after,
    body.display-compact .hex-unit.combat-action-counter::after,
    body.display-compact .hex-unit.combat-action-crit::after { width: 15px; height: 15px; bottom: 36px; }
    body.display-compact .hex-unit.combat-action-block::before { width: 40px; height: 38px; bottom: 29px; }
    body.display-compact .hex-unit.combat-action-block::after { width: 30px; height: 13px; bottom: 45px; }
    body.display-compact .hex-unit.combat-action-wound::before { width: 36px; height: 29px; bottom: 37px; }
    body.display-compact .hex-unit.combat-action-wound::after { width: 14px; height: 14px; bottom: 66px; }
    body.display-compact .hex-unit-name { font-size: 7px; margin-top: -8px; }
    body.display-compact .hex-cell:nth-child(14n + 8),
    body.display-compact .hex-cell:nth-child(14n + 9),
    body.display-compact .hex-cell:nth-child(14n + 10),
    body.display-compact .hex-cell:nth-child(14n + 11),
    body.display-compact .hex-cell:nth-child(14n + 12),
    body.display-compact .hex-cell:nth-child(14n + 13),
    body.display-compact .hex-cell:nth-child(14n + 14) { transform: translateX(22px); }
    body.display-compact .battle-tabs { top: 384px; }
    body.display-compact .combatant { top: 282px; width: 244px; }
    body.display-compact .body-figure { grid-template-columns: repeat(5, 40px); grid-template-rows: repeat(5, 40px); gap: 5px; }
    body.display-compact .battle-controls { margin-top: 8px; }

    body.display-large .battle-scene { min-height: 760px; }
    body.display-large .battle-plan { top: 82px; width: min(760px, calc(100% - 24px)); }
    body.display-large .mode-hint { top: 138px; }
    body.display-large .hex-field { top: 174px; grid-template-columns: repeat(7, 56px); grid-auto-rows: 48px; gap: 9px; padding: 18px 22px; }
    body.display-large .hex-cell { width: 56px; height: 48px; font-size: 11px; }
    body.display-large .hex-cell::before { width: 61px; height: 48px; }
    body.display-large .hex-cell:has(.hex-unit-art)::after { width: 42px; height: 16px; }
    body.display-large .hex-cell:has(.hex-unit-art) .hex-stack { min-height: 86px; transform: translateY(-20px); }
    body.display-large .hex-unit-art { width: 70px; height: 94px; margin-top: -46px; }
    body.display-large .hex-unit-art.harr-guardian-art { width: 88px; height: 118px; margin-top: -63px; }
    body.display-large .hex-unit-art.race-field-art { width: 80px; height: 106px; margin-top: -56px; }
    body.display-large .hex-unit-art.race-orc-art { width: 88px; height: 114px; margin-top: -64px; }
    body.display-large .hex-unit-art.race-dwarf-art { width: 78px; height: 94px; margin-top: -44px; }
    body.display-large .hex-unit-art.race-goblin-art { width: 72px; height: 94px; margin-top: -44px; }
    body.display-large .hex-unit.is-attacking::before,
    body.display-large .hex-unit.combat-action-strike::before,
    body.display-large .hex-unit.combat-action-counter::before,
    body.display-large .hex-unit.combat-action-crit::before { width: 64px; height: 6px; bottom: 43px; }
    body.display-large .hex-unit.is-attacking::after,
    body.display-large .hex-unit.combat-action-strike::after,
    body.display-large .hex-unit.combat-action-counter::after,
    body.display-large .hex-unit.combat-action-crit::after { width: 20px; height: 20px; bottom: 46px; }
    body.display-large .hex-unit.combat-action-block::before { width: 56px; height: 54px; bottom: 37px; }
    body.display-large .hex-unit.combat-action-block::after { width: 42px; height: 18px; bottom: 61px; }
    body.display-large .hex-unit.combat-action-wound::before { width: 50px; height: 40px; bottom: 50px; }
    body.display-large .hex-unit.combat-action-wound::after { width: 18px; height: 18px; bottom: 86px; }
    body.display-large .hex-cell:nth-child(14n + 8),
    body.display-large .hex-cell:nth-child(14n + 9),
    body.display-large .hex-cell:nth-child(14n + 10),
    body.display-large .hex-cell:nth-child(14n + 11),
    body.display-large .hex-cell:nth-child(14n + 12),
    body.display-large .hex-cell:nth-child(14n + 13),
    body.display-large .hex-cell:nth-child(14n + 14) { transform: translateX(29px); }
    body.display-large .battle-tabs { top: 486px; }
    body.display-large .combatant { top: 358px; width: 318px; }
    body.display-large .body-figure { grid-template-columns: repeat(5, 54px); grid-template-rows: repeat(5, 54px); gap: 7px; }

    body.battle-focus .battle-top { grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); }
    body.battle-focus .battle-result-panel { margin-top: 10px; }

    @media (max-width: 820px) {
      .grid {
        grid-template-columns: 1fr;
      }

      .equipment-grid,
      .actions,
      .contracts,
      .stats,
      .stat-upgrade-grid,
      .choice-grid,
      .stance-grid,
      .move-grid,
      .battle-top {
        grid-template-columns: 1fr;
      }

      .gear-shop-card {
        grid-template-columns: 58px minmax(0, 1fr);
      }

      .gear-shop-card button {
        grid-column: 1 / -1;
      }

      .shop-workspace-toolbar {
        margin: 0 -10px;
        padding: 10px;
      }

      .shop-workspace-heading {
        display: grid;
      }

      .shop-escape-actions,
      .shop-filter-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
      }

      .gear-shop-art {
        width: 58px;
        height: 58px;
      }

      .progress-top {
        flex-direction: column;
        gap: 4px;
      }
      .overview-hero-panel { min-height: 590px; }
      .overview-character-art {
        width: min(108%, 390px);
        max-height: 470px;
      }
      .overview-hero-footer { grid-template-columns: 1fr; }
      .lineup-header {
        align-items: flex-start;
        flex-direction: column;
      }
      .harr-lineup-grid {
        grid-template-columns: 1fr;
      }
      .harr-lineup-stage {
        height: 430px;
      }
      .harr-lineup-art {
        width: min(100%, 360px);
      }
      .battle-scene { min-height: 1160px; }
      .battle-plan { top: 74px; grid-template-columns: 1fr 1fr; }
      .mode-hint { top: 178px; width: calc(100% - 24px); }
      .hex-field { top: 212px; grid-template-columns: repeat(7, 36px); grid-auto-rows: 31px; gap: 5px; padding: 12px 14px; }
      .hex-cell { width: 36px; height: 31px; font-size: 9px; }
      .hex-cell:nth-child(14n + 8), .hex-cell:nth-child(14n + 9), .hex-cell:nth-child(14n + 10), .hex-cell:nth-child(14n + 11), .hex-cell:nth-child(14n + 12), .hex-cell:nth-child(14n + 13), .hex-cell:nth-child(14n + 14) { transform: translateX(19px); }
      .hex-stack { max-width: 32px; gap: 1px; }
      .hex-main-label { font-size: 8px; }
      .hex-cell::before { width: 40px; height: 33px; }
      .hex-cell:has(.hex-unit-art)::after { width: 28px; height: 11px; }
      .hex-cell:has(.hex-unit-art) .hex-stack { max-width: 44px; min-height: 54px; transform: translateY(-11px); }
      .hex-unit-art { width: 44px; height: 60px; margin-top: -28px; }
      .hex-unit-art.harr-guardian-art { width: 54px; height: 74px; margin-top: -39px; }
      .hex-unit-art.race-field-art { width: 50px; height: 66px; margin-top: -34px; }
      .hex-unit-art.race-orc-art { width: 54px; height: 72px; margin-top: -39px; }
      .hex-unit-art.race-dwarf-art { width: 48px; height: 58px; margin-top: -27px; }
      .hex-unit-art.race-goblin-art { width: 44px; height: 58px; margin-top: -27px; }
      .hex-unit.is-attacking::before,
      .hex-unit.combat-action-strike::before,
      .hex-unit.combat-action-counter::before,
      .hex-unit.combat-action-crit::before { width: 42px; height: 4px; bottom: 28px; }
      .hex-unit.is-attacking::after,
      .hex-unit.combat-action-strike::after,
      .hex-unit.combat-action-counter::after,
      .hex-unit.combat-action-crit::after { width: 13px; height: 13px; bottom: 31px; }
      .hex-unit.combat-action-block::before { width: 34px; height: 32px; bottom: 25px; }
      .hex-unit.combat-action-block::after { width: 26px; height: 12px; bottom: 39px; }
      .hex-unit.combat-action-wound::before { width: 31px; height: 25px; bottom: 32px; }
      .hex-unit.combat-action-wound::after { width: 12px; height: 12px; bottom: 57px; }
      .hex-unit-name { font-size: 7px; margin-top: -7px; }
      .hex-token { width: 18px; height: 15px; font-size: 8px; }
      .battle-tabs { top: 456px; width: min(330px, calc(100% - 28px)); justify-content: center; }
      .battle-tab { flex: 1; min-width: 0; }
      .combatant.player { left: 50%; top: 510px; transform: translateX(-50%); }
      .combatant.bot { right: auto; left: 50%; top: 844px; transform: translateX(-50%); }
      .battle-scene.move-forward .combatant.player,
      .battle-scene.move-forward .combatant.bot,
      .battle-scene.move-back .combatant.player,
      .battle-scene.move-back .combatant.bot { transform: translateX(-50%); }
      .battle-controls { grid-template-columns: 1fr; }
      .strike-arrow { left: 50%; right: auto; top: 540px; width: 3px; height: 54px; transform: scaleY(0.5); transform-origin: top center; }
      .strike-arrow::after { right: -5px; top: auto; bottom: -2px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--gold); border-bottom: 0; }
      .strike-arrow.active { transform: scaleY(1); }
    }
    .director-top-tag {
      display: inline-flex;
      align-items: center;
      width: max-content;
      max-width: 100%;
      margin: 0 0 8px;
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid rgba(255, 218, 85, 0.5);
      background: rgba(255, 218, 85, 0.12);
      color: #ffe06b;
      font-size: 11px;
      font-weight: 900;
      line-height: 1;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      box-shadow: 0 0 18px rgba(255, 218, 85, 0.08);
    }

    .director-top-tag--hit { color: #ffd779; border-color: rgba(255, 190, 80, 0.65); background: rgba(130, 88, 25, 0.22); }
    .director-top-tag--return { color: #70e79b; border-color: rgba(90, 230, 140, 0.65); background: rgba(25, 120, 60, 0.22); }
    .director-top-tag--injury { color: #ff9a73; border-color: rgba(255, 140, 90, 0.68); background: rgba(130, 58, 25, 0.24); }
    .director-top-tag--team { color: #9cefb7; border-color: rgba(90, 220, 130, 0.62); background: rgba(35, 110, 55, 0.2); }
    .director-top-tag--plan { color: #7fc0ff; border-color: rgba(90, 170, 255, 0.62); background: rgba(30, 90, 150, 0.2); }
    .director-top-tag--run { color: #ff8d8d; border-color: rgba(255, 95, 95, 0.68); background: rgba(140, 35, 45, 0.24); }
    .director-top-tag--block { color: #a8c9ff; border-color: rgba(125, 175, 255, 0.65); background: rgba(35, 70, 130, 0.22); }
    .director-top-tag--dodge { color: #74d7ff; border-color: rgba(90, 205, 255, 0.65); background: rgba(30, 110, 150, 0.22); }
    .director-top-tag--luck { color: #ffe06b; border-color: rgba(255, 220, 80, 0.7); background: rgba(130, 110, 20, 0.24); }
    .director-top-tag--crit { color: #ff8080; border-color: rgba(255, 90, 90, 0.7); background: rgba(130, 20, 30, 0.26); }
    .director-top-tag--ai { color: #d5b3ff; border-color: rgba(190, 140, 255, 0.62); background: rgba(90, 45, 140, 0.22); }
