
@font-face {
  font-family: "Dark Wedding";
  src: url("/fonts/a-dark-wedding.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Colors: /palette.css */
  --font-display: "Segoe UI", "Trebuchet MS", sans-serif;
  --font-body: "Segoe UI", system-ui, sans-serif;
  --font-agon: "Dark Wedding", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
}
#root, .app-shell {
  min-height: 100%;
  min-height: 100dvh;
}
.app-shell {
  display: flex;
  justify-content: center;
  background-color: #080706;
}
/* Town outside combat. Fixed so a long menu does not stretch the art. */
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #080706;
  background-image:
    linear-gradient(180deg, rgba(8, 7, 6, 0.46) 0%, rgba(8, 7, 6, 0.1) 18%, rgba(8, 7, 6, 0.22) 100%),
    url('/town/town-portrait.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.app-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 6px 12px 14px;
  gap: 8px;
}
/* Arena fills the whole viewport; the phone frame stays a narrow UI column. */
.app-shell:has(.battle-view) {
  background-color: #080706;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
    url('/battle/arena-portrait.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.app-frame:has(.battle-view) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 6px 10px 8px;
  gap: 4px;
  background: transparent;
}
/* Wide / landscape: horizontal art so the sides stay filled. */
@media (min-width: 700px), (orientation: landscape) and (max-height: 500px) {
  .app-shell::before {
    background-image:
      linear-gradient(180deg, rgba(8, 7, 6, 0.46) 0%, rgba(8, 7, 6, 0.1) 18%, rgba(8, 7, 6, 0.22) 100%),
      url('/town/town-landscape.jpg');
  }
  .app-shell:has(.battle-view) {
    background-image:
      linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
      url('/battle/arena-landscape.png');
  }
}
.app-shell:has(.battle-view)::before {
  display: none;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.55rem;
  color: var(--accent2);
  text-transform: uppercase;
}
.brand.title-agon,
.page-title.title-agon {
  font-family: var(--font-agon);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--accent2);
  text-shadow: 0 0 16px rgba(197, 164, 94, 0.38);
}
.brand.title-agon {
  font-size: 2.7rem;
  line-height: 0.95;
}
.sub { color: var(--muted); font-size: 0.92rem; line-height: 1.35; }
.panel {
  background: linear-gradient(180deg, #1a1612 0%, #0e0c0a 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack > .page-topbar { margin-bottom: -2px; }
.banner-stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }
input, select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg0);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 1rem;
}
button, .btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent);
  color: #11100d;
}
button.secondary { background: transparent; border-color: var(--bronze); color: var(--ink-warm); }
button.ghost { background: var(--surface2); color: var(--ink); }
button:hover:not(:disabled) { background: var(--accent2); }
button.secondary:hover:not(:disabled) { background: var(--surface2); }
button.ghost:hover:not(:disabled) { background: #4a3c2a; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ok { background: var(--accent); color: #e5dcc8; }
button.ok:hover:not(:disabled) { background: var(--accent2); }
button.danger { background: var(--danger); color: var(--ink); }
button.danger:hover:not(:disabled) { background: #c45051; }
.point-pool {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.point-pool.has-pool {
  border-color: rgba(197, 164, 94, 0.55);
  background: rgba(167, 137, 79, 0.16);
  color: var(--accent2);
}
.point-pool.pool-spent {
  border-color: rgba(63, 143, 90, 0.45);
  background: rgba(63, 143, 90, 0.12);
  color: #b8e0c4;
}
.error {
  background: rgba(194,59,59,0.18);
  border: 1px solid rgba(194,59,59,0.45);
  color: #ffd0d0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.notice {
  background: rgba(63,143,90,0.18);
  border: 1px solid rgba(63,143,90,0.4);
  padding: 10px 12px;
  border-radius: 12px;
}
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.card strong { display: block; }
.muted { color: var(--muted); font-size: 0.85rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
}
.stat .k { color: var(--muted); font-size: 0.75rem; }
.stat .v { font-size: 1.15rem; font-weight: 700; }
.stats-sheet {
  gap: 8px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.stats-sheet.compact { gap: 6px; }
.unified-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}
.unified-stats.compact { gap: 4px; }
.ustat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px;
  min-width: 0;
}
.unified-stats.compact .ustat {
  padding: 4px 6px;
  border-radius: 8px;
  overflow: hidden;
}
.ustat-head {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.ustat-name {
  flex: 1; font-size: 0.78rem; font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unified-stats.compact .ustat-name { font-size: 0.72rem; }
.ustat-val {
  font-size: 1.02rem; font-weight: 800;
  font-variant-numeric: tabular-nums; min-width: 1.4rem; text-align: right;
}
.unified-stats.compact .ustat-val { font-size: 0.95rem; }
.sec-stats-block,
.race-passive-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}
.sec-stats-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.sec-stats-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sec-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
}
.sec-col-atk {
  order: 1;
  background: var(--c-atk-col);
  border: 1px solid rgba(150, 165, 195, 0.12);
}
.sec-col-def {
  order: 2;
  background: var(--c-def-col);
  border: 1px solid rgba(150, 165, 195, 0.12);
}
.sec-stat {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 1px 0;
  line-height: 1.2;
}
.sec-stat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.sec-stat-name {
  font-size: 0.66rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sec-stat-val {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.sec-formula {
  display: block;
  font-size: 0.58rem;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}
.sec-formula .f-coef {
  color: var(--muted);
  font-weight: 600;
}
.sec-formula .f-part { font-weight: 800; }
.sec-formula .c-base { color: var(--c-base); font-weight: 600; }
.sec-formula .c-race,
.f-part.c-race { color: var(--c-race); }
.f-part.c-race-mark { text-decoration: underline; text-decoration-color: var(--c-race); text-underline-offset: 2px; }
.f-part.c-class-mark { text-decoration: underline; text-decoration-color: var(--c-class); text-underline-offset: 2px; }
.f-part.c-gear-mark { text-decoration: underline; text-decoration-color: var(--c-gear); text-underline-offset: 2px; }
.c-crit { color: var(--c-crit); }
.c-ability { color: var(--c-ability); font-weight: 800; }
.c-race { color: var(--c-race); }
.c-class { color: var(--c-class); }
.c-gear { color: var(--c-gear); }
.race-passive-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.race-passive-line {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--ink);
}
.ustat.stat-str .ustat-name, .ustat.stat-str .ustat-val, .c-str { color: var(--c-str); }
.ustat.stat-dex .ustat-name, .ustat.stat-dex .ustat-val, .c-dex { color: var(--c-dex); }
.ustat.stat-con .ustat-name, .ustat.stat-con .ustat-val, .c-con, .c-hp { color: var(--c-con); }
.ustat.stat-sta .ustat-name, .ustat.stat-sta .ustat-val, .c-sta { color: var(--c-sta); }
.ustat.stat-agi .ustat-name, .ustat.stat-agi .ustat-val, .c-agi { color: var(--c-agi); }
.ustat.stat-int .ustat-name, .ustat.stat-int .ustat-val, .c-int { color: var(--c-int); }
.ustat.stat-vit .ustat-name, .ustat.stat-vit .ustat-val, .c-vit { color: var(--c-vit); }
.ustat.stat-wil .ustat-name, .ustat.stat-wil .ustat-val, .c-wil { color: var(--c-wil); }
.stat-radar {
  display: flex;
  justify-content: center;
  padding: 2px 0 0;
}
.stat-radar.compact { padding: 0; }
.stat-radar-svg {
  width: min(100%, 200px);
  height: auto;
  overflow: visible;
}
.stat-radar.compact .stat-radar-svg {
  width: min(100%, 150px);
}
.radar-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.radar-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.radar-fill {
  fill: rgba(79, 95, 255, 0.28);
  stroke: var(--accent2);
  stroke-width: 1.6;
}
.radar-dot { stroke: var(--bg0); stroke-width: 1; }
.radar-dot-str { fill: var(--c-str); }
.radar-dot-dex { fill: var(--c-dex); }
.radar-dot-con { fill: var(--c-con); }
.radar-dot-sta { fill: var(--c-sta); }
.radar-dot-agi { fill: var(--c-agi); }
.radar-dot-int { fill: var(--c-int); }
.radar-dot-vit { fill: var(--c-vit); }
.radar-dot-wil { fill: var(--c-wil); }
.radar-label {
  font-size: 10px;
  font-weight: 700;
  fill: var(--muted);
}
.radar-label-str { fill: var(--c-str); }
.radar-label-dex { fill: var(--c-dex); }
.radar-label-con { fill: var(--c-con); }
.radar-label-sta { fill: var(--c-sta); }
.radar-label-agi { fill: var(--c-agi); }
.radar-label-int { fill: var(--c-int); }
.radar-label-vit { fill: var(--c-vit); }
.radar-label-wil { fill: var(--c-wil); }
.c-lvl { color: var(--c-lvl); }
.c-base { color: var(--c-base); font-weight: 600; }
.sub-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.sub-meta .lvl-chip {
  color: var(--c-lvl); font-weight: 800; font-variant-numeric: tabular-nums;
}
.stat-controls { display: flex; align-items: center; gap: 2px; margin-left: 2px; flex: 0 0 auto; }
.stat-controls button {
  padding: 2px 7px !important;
  border-radius: 6px;
  min-width: 0;
  width: auto;
  font-size: 0.85rem !important;
  line-height: 1.1;
}
.unified-stats.compact .stat-controls { gap: 2px; margin-left: 0; }
.unified-stats.compact .stat-controls button {
  width: 22px;
  height: 22px;
  padding: 0 !important;
  border-radius: 6px;
  font-size: 0.9rem !important;
  line-height: 1;
}
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border-radius: 999px; border: 1px solid var(--line); padding: 8px 12px;
  background: var(--surface2); color: var(--ink); font-weight: 600;
}
.pill.active { background: var(--accent); border-color: transparent; }
.create-view { gap: 4px; }
.create-form { gap: 6px !important; padding: 10px !important; }
.create-name {
  width: 100%;
  height: 2.5rem;
  margin: 0;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.create-race-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.create-gender-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  align-self: stretch;
}
.create-gender-col .create-gender {
  flex: 1 1 0;
  width: 28px;
  min-width: 28px;
  min-height: 0;
  height: auto;
  padding: 4px !important;
  border-radius: 8px;
  gap: 0;
}
.create-gender-col .create-choice-ico {
  width: 16px;
  height: 16px;
}
.create-section-gap {
  height: 8px;
  flex: 0 0 auto;
}
.create-choice-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: stretch;
  justify-content: stretch;
  flex: 1 1 auto;
  min-width: 0;
}
.create-choice-wrap { flex-wrap: wrap; }
.create-choice {
  flex: 1 1 0;
  min-width: 48px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px !important;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.05;
  width: auto;
}
.create-choice-wrap .create-choice {
  flex: 1 1 calc(33.33% - 4px);
  min-width: 52px;
}
.create-choice.active {
  background: rgba(167, 137, 79, 0.28);
  border-color: var(--accent2);
  color: var(--ink);
}
.create-choice:disabled {
  opacity: 0.35;
  pointer-events: none;
}
.create-choice-ico {
  width: 14px;
  height: 14px;
  display: block;
}
.create-stats-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50%;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.create-stats-split .stat-radar.wide {
  width: 100%;
  max-width: 50vw;
  justify-self: stretch;
  min-width: 0;
}
.create-stats-split .stat-radar.wide .stat-radar-svg {
  width: 100%;
  max-width: none;
}
.unified-stats.create-side {
  grid-template-columns: 1fr;
  gap: 3px;
  align-content: center;
  min-width: 0;
}
.unified-stats.create-side .ustat {
  padding: 3px 5px;
  border-radius: 7px;
  min-width: 0;
  overflow: hidden;
}
.unified-stats.create-side .ustat-head {
  gap: 3px;
  min-width: 0;
}
.unified-stats.create-side .ustat-name {
  font-size: 0.62rem;
  flex: 1 1 auto;
  min-width: 0;
}
.unified-stats.create-side .ustat-val {
  font-size: 0.85rem;
  min-width: 1.1rem;
}
.unified-stats.create-side .stat-controls {
  margin-left: 0;
  flex: 0 0 auto;
}
.unified-stats.create-side .stat-controls button {
  padding: 1px 5px !important;
  font-size: 0.72rem !important;
  border-radius: 5px;
}
.create-actions {
  display: flex;
  gap: 8px;
}
.create-actions button { flex: 1; }
.hpbar {
  position: relative;
  height: 10px; border-radius: 999px; background: #11100d; overflow: hidden; border: 1px solid var(--line);
}
.hpbar > i {
  position: absolute; left: 0; top: 0; bottom: 0;
  display: block; height: 100%;
  border-radius: inherit;
}
.hpbar > .hp-trail,
.hpbar > .sta-trail-loss {
  left: 0;
  z-index: 0;
  pointer-events: none;
}
.hpbar > .hp-trail {
  background: linear-gradient(90deg, #9a4a12, #f0a030);
}
.hpbar > .sta-trail-loss {
  background: linear-gradient(90deg, #102e1e, #1a4a30);
}
.hpbar > .sta-trail-gain {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #245c3c, var(--c-sta-bonus));
  pointer-events: none;
}
.hpbar > .hp-fill {
  left: 0;
  z-index: 1;
  pointer-events: none;
}
.hpbar:not(.mpbar):not(.stabar) > .hp-fill {
  background: linear-gradient(90deg, #762f32, #a83238);
}
.hpbar.mpbar > .hp-fill {
  background: linear-gradient(90deg, #2c4a6e, #5379a5);
}
.hpbar.stabar > .hp-fill {
  background: linear-gradient(90deg, #143d28, var(--c-sta));
}
.tone-sta .f-part.c-gear {
  color: var(--c-sta-bonus);
}
.sec-formula .f-part.c-gear[title="способность"],
.f-part.c-gear[title="способность"] {
  color: var(--accent2);
}
.hpbar.xpbar > .hp-fill {
  background: linear-gradient(90deg, #5c4826, #a07c42);
}
.xp-line { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.hub-hero {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hub-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hub-hero-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.hub-hero-actions { display: flex; gap: 6px; }
.hub-hero-actions button { flex: 1; }
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.menu-tile {
  min-height: 72px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1612 0%, #0e0c0a 100%);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.menu-tile:hover:not(:disabled) {
  background: linear-gradient(180deg, #221c16 0%, #14110d 100%);
  border-color: var(--bronze);
}
.menu-tile:disabled { opacity: 0.42; cursor: default; }
.menu-tile .tile-mark {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent2);
}
.menu-tile .tile-ico {
  width: 18px;
  height: 18px;
  display: block;
}
.menu-tile .tile-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}
.menu-tile .tile-title {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.menu-tile .tile-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.menu-arena .tile-mark { color: #a07070; }
.menu-train .tile-mark { color: var(--accent2); }
.menu-temple .tile-mark { color: var(--c-legend); }
.menu-journal .tile-mark { color: #7a90a8; }
.menu-links { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-links button { flex: 1; min-width: 72px; }
.quest-card {
  flex-direction: column;
  align-items: stretch;
  cursor: default;
}
.quest-card.quest-claimed { opacity: 0.72; }
.quest-card.quest-ready { outline: 1px solid var(--accent2); }
.bar-meta { font-size: 0.78rem; color: var(--muted); }
.battle-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-topbar {
  position: relative;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 0;
  padding: 0;
  margin: 0;
  align-items: center;
}
.bell-btn {
  position: relative;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
}
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #a43c3d;
  color: #e5dcc8;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}
.notice-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: 240px;
  max-height: 260px;
  overflow: auto;
  background: #1c1914;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.notice-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.3;
}
.notice-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-chip {
  flex: 0 0 auto;
  max-width: 96px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-chip-xp {
  max-width: none;
  background: #52401e;
  color: #e5dcc8;
}
.notice-chip-level {
  background: #5e2628;
  color: #e5dcc8;
}
.notice-chip-item,
.notice-chip-ability {
  background: #221c16;
  color: #a08648;
}
.stat-draft-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  box-sizing: border-box;
  width: 100%;
}
.stat-draft-label {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 800;
}
button.point-pool.has-confirm {
  cursor: pointer;
  width: 100%;
  margin: 0;
  border-color: rgba(138, 106, 52, 0.75);
  background: rgba(106, 82, 40, 0.28);
  color: var(--ink-warm);
  box-shadow: 0 0 0 1px rgba(106, 82, 40, 0.25) inset;
}
button.point-pool.has-confirm:hover,
button.point-pool.has-confirm:focus-visible {
  background: rgba(106, 82, 40, 0.42);
  border-color: rgba(160, 124, 66, 0.9);
  color: #e5dcc8;
  outline: none;
}
.stat-confirm-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(138, 106, 52, 0.35);
  border: 1px solid rgba(160, 124, 66, 0.55);
  color: var(--accent2);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}
.quest-quote { line-height: 1.35; }
.quest-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quest-count {
  font-variant-numeric: tabular-nums;
  min-width: 3.4em;
  font-size: 0.85rem;
}
.quest-bar { flex: 1; height: 8px; margin: 0; }
.quest-card.quest-done { opacity: 0.72; }
.page-topbar-titles {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--accent2);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.page-title.battle-outcome { text-transform: uppercase; }
.page-title.title-agon {
  font-size: 1.45rem;
  line-height: 1;
  overflow: visible;
}
.page-subtitle {
  font-size: 0.7rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.page-top-actions {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.page-top-btn {
  padding: 4px 8px !important;
  font-size: 0.74rem !important;
  border-radius: 7px;
  min-height: 28px;
  line-height: 1.1;
}
.battle-topbar { flex: 0 0 auto; gap: 6px; }
.battle-topbar .battle-icon-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  line-height: 0;
}
.battle-topbar .log-toggle {
  width: auto;
  min-width: 0;
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  place-items: center;
}
.battle-ui-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.battle-surrender-btn {
  background: rgba(180, 48, 48, 0.22) !important;
  border: 1px solid rgba(220, 72, 72, 0.55) !important;
  color: #ff8e8e !important;
}
.battle-surrender-btn:hover,
.battle-surrender-btn:focus-visible {
  background: rgba(200, 56, 56, 0.38) !important;
  color: #ffb0b0 !important;
}
.battle-outcome {
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.battle-duel {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* identity, bars, stance, body, forecast, gear, stats, leftover */
  grid-template-rows: repeat(7, auto) minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 4px;
  overflow: visible;
  align-content: start;
  align-items: stretch;
}
.fighter-tabs {
  flex-wrap: nowrap;
  width: 100%;
}
.fighter-tabs > .pill {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  padding: 6px 4px;
}
.zone-slot-badge {
  position: absolute;
  top: 3px;
  left: 4px;
  z-index: 2;
  max-width: calc(100% - 36px);
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(17, 16, 13, 0.82);
  border: 1px solid rgba(102, 80, 46, 0.55);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-warm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.fighter-outcome {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  flex: 0 0 2.4em;
  height: 2.4em;
  min-height: 2.4em;
  max-height: 2.4em;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.fighter-outcome .outcome-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 6px;
  align-items: center;
  min-width: 0;
  height: 1.15em;
  overflow: hidden;
}
.fighter-outcome .outcome-empty {
  color: transparent;
  user-select: none;
}
.fighter-outcome .outcome-tone-dmg {
  color: #c07078;
}
.fighter-outcome .outcome-tone-block {
  color: #9aa3b5;
}
.fighter-outcome .outcome-tone-miss {
  color: #8b97ab;
}
.fighter-outcome .outcome-tone-crit {
  color: #d4b05a;
}
.fighter-outcome .outcome-tone-plain {
  color: var(--accent2);
}
.battle-duel > .hit-arrows {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}
.fighter-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 0 0 30px;
  height: 30px;
  min-height: 30px;
  overflow: hidden;
}
.fighter-controls.empty {
  visibility: hidden;
  pointer-events: none;
}
.fighter-controls .ctrl-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fighter-controls .ctrl-label.sta-short {
  color: #ff9a6a;
  text-transform: none;
}
.magic-toggle {
  width: auto !important;
  flex: 0 0 auto;
  padding: 4px 8px !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--ink);
}
.magic-toggle.active {
  background: rgba(122, 100, 220, 0.35);
  border-color: rgba(170, 140, 255, 0.65);
  color: #d2c2ff;
}
.battle-lock-row {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding-top: 4px;
  width: 100%;
}
.battle-lock-row .turn-check {
  width: 100%;
  height: 44px;
  align-self: stretch;
}
.hit-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.hit-strip,
.hit-strip-edge {
  stroke-linecap: round;
  fill: none;
}
.hit-strip-edge {
  stroke: rgba(4, 6, 14, 0.78);
}
.hit-strip.tone-attack { stroke: #e25a72; }
.hit-strip.tone-crit { stroke: #f0c14a; }
.hit-strip.tone-block { stroke: #6d93f0; }
.hit-strip.tone-pierce { stroke: #f0a04a; }
.hit-strip.tone-graze { stroke: #aeb8c8; }
.hit-strip.tone-shove { stroke: #b49bff; }
.hit-strip.tone-miss { stroke: #8b97ab; }
.hit-strip.tone-miss,
.hit-strip-edge.tone-miss {
  stroke-dasharray: 5 4;
}
.hit-fx-badge {
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.7));
}
.hit-fx-ring { stroke-width: 1.75; }
.hit-fx-badge.tone-attack .hit-fx-ring { fill: #3a1218; stroke: #ff8b9a; }
.hit-fx-badge.tone-attack .hit-fx-ico { fill: #ffd0d6; }
.hit-fx-badge.tone-crit .hit-fx-ring { fill: #3a2c08; stroke: #ffd36a; }
.hit-fx-badge.tone-crit .hit-fx-ico { fill: #ffe7a3; }
.hit-fx-badge.tone-block .hit-fx-ring { fill: #121a38; stroke: #9eb6ff; }
.hit-fx-badge.tone-block .hit-fx-ico { fill: #d5e0ff; }
.hit-fx-badge.tone-pierce .hit-fx-ring { fill: #3a220c; stroke: #ffb060; }
.hit-fx-badge.tone-pierce .hit-fx-ico { fill: #ffd0a0; }
.hit-fx-badge.tone-graze .hit-fx-ring { fill: #1a2230; stroke: #b7c3d4; }
.hit-fx-badge.tone-graze .hit-fx-ico { fill: #d5deea; }
.hit-fx-badge.tone-miss .hit-fx-ring { fill: #1a2230; stroke: #8b97ab; }
.hit-fx-badge.tone-miss .hit-fx-ico { fill: #c5ceda; }
.hit-fx-badge.tone-shove .hit-fx-ring { fill: #241838; stroke: #c4b0ff; }
.hit-fx-badge.tone-shove .hit-fx-ico { fill: #e4d8ff; }
.hit-lbl-spell {
  fill: #c9b6ff;
  font-size: 0.72rem;
  font-weight: 700;
}
.hit-arrow-label-bg {
  fill: rgba(2, 4, 10, 0.94);
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 1;
}
.hit-arrow-label-text {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-body);
}
.hit-lbl-dmg { fill: #e4546c; }
.hit-lbl-crit { fill: #ffd36a; }
.hit-lbl-blocked { fill: #a8b3c4; font-weight: 700; }
.hit-lbl-miss,
.hit-lbl-muted { fill: #a8b3c4; }
.log-overlay-body {
  max-height: min(60dvh, 480px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-sheet { max-height: 82dvh; }
.manual-view { gap: 8px; }
.manual-toc {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.manual-toc-btn {
  font-size: 0.78rem !important;
  padding: 6px 10px !important;
}
.manual-body { gap: 8px; }
.manual-section { gap: 8px; }
.manual-h {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent2);
}
.manual-p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
}
.manual-ul {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink);
}
.manual-ul li::marker { color: var(--accent2); }
.turn-panel {
  flex: 0 0 auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.turn-panel.turn-locked { opacity: 0.72; pointer-events: none; }
.turn-panel.turn-locked .zone-btn,
.turn-panel.turn-locked .stance-ico,
.turn-panel.turn-locked .mode-btn { cursor: default; }
.turn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  min-height: 0;
  max-height: 38dvh;
}
.turn-left,
.turn-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  min-height: 0;
}
.turn-col-label {
  flex: 0 0 1.1em;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.turn-modes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.turn-mode-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.stance-ico {
  width: 36px;
  min-width: 36px;
  height: auto;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--muted);
  align-self: stretch;
}
.stance-ico .log-icon { width: 16px; height: 16px; }
.stance-ico.active {
  background: rgba(138, 106, 52, 0.5);
  border-color: rgba(235, 200, 110, 0.95);
  color: #ffe8a8;
  box-shadow:
    0 0 0 2px rgba(255, 220, 140, 0.9),
    0 0 12px rgba(255, 190, 90, 0.4);
}
.mode-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.mode-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #11100d;
}
.mode-btn.placeholder {
  visibility: hidden;
  pointer-events: none;
}
.zone-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.zone-btn.vert {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 4px;
  font-size: 0.68rem;
}
.zone-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
}
.zone-btn .zone-ico {
  width: 16px;
  height: 16px;
  color: var(--accent2);
  flex: 0 0 auto;
}
.zone-btn.active .zone-ico { color: #11100d; }
.zone-btn-label {
  font-size: 0.66rem;
  font-weight: 700;
}
.zone-btn.zone-head .zone-ico { color: #ffb86b; }
.zone-btn.zone-torso .zone-ico { color: #7d94b0; }
.zone-btn.zone-waist .zone-ico { color: #a07c42; }
.zone-btn.zone-legs .zone-ico { color: var(--c-sta); }
.zone-btn.active.zone-head .zone-ico,
.zone-btn.active.zone-torso .zone-ico,
.zone-btn.active.zone-waist .zone-ico,
.zone-btn.active.zone-legs .zone-ico { color: #11100d; }
.turn-hint {
  font-size: 0.75rem;
  text-align: left;
}
.turn-check {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  flex: 0 0 auto;
}
.turn-check:disabled {
  opacity: 0.45;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.turn-check.locked:disabled {
  opacity: 1;
  color: var(--ink-warm);
  border-color: rgba(138, 106, 52, 0.6);
  background: rgba(106, 82, 40, 0.28);
}
.ready-chip {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; color: #e5dcc8; background: #6a5228;
  border-radius: 999px; padding: 2px 8px;
}
.fighter-panel.enemy-ready {
  border-color: rgba(138, 106, 52, 0.55);
  box-shadow: 0 0 0 1px rgba(106, 82, 40, 0.28) inset;
}
@keyframes nameReadyPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(138, 106, 52, 0.45); }
  50% { text-shadow: 0 0 14px rgba(160, 124, 66, 0.7); }
}
.fighter-panel {
  padding: 6px 8px;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
  overflow: hidden;
  align-items: start;
  /* Let arena art show through — lighter wash than a solid .panel */
  background: linear-gradient(
    180deg,
    rgba(26, 22, 18, 0.42) 0%,
    rgba(14, 12, 10, 0.28) 100%
  );
  border-color: rgba(50, 42, 32, 0.45);
}
.fighter-panel.slot-self { grid-column: 1; }
.fighter-panel.slot-enemy { grid-column: 2; }
.fighter-identity {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.fighter-panel .name-row,
.name-row.char-title-row,
.name-row.hub-hero-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.hub-hero-name-row .hub-hero-name {
  flex: 1 1 auto;
  min-width: 0;
}
.char-title-row .page-title {
  flex: 1 1 auto;
  min-width: 0;
}
button.fighter-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: left;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}
.fighter-race-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 0 1 auto;
}
.fighter-race-name,
.fighter-class {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fighter-meta-sep {
  flex: 0 0 auto;
  font-size: 0.68rem;
  line-height: 1.2;
}
.fighter-race-after-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
button.race-passive-tip {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0 !important;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  line-height: 0;
  box-shadow: none;
  opacity: 0.72;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease,
    background 0.15s ease;
}
button.race-passive-tip.is-active {
  opacity: 1;
  border-color: rgba(230, 190, 70, 0.75);
  background: rgba(180, 130, 30, 0.35);
  color: #ffe08a;
  box-shadow: 0 0 0 1px rgba(255, 210, 90, 0.25), 0 0 10px rgba(230, 180, 50, 0.35);
  animation: race-passive-pulse 1.4s ease-in-out infinite;
}
@keyframes race-passive-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 210, 90, 0.25), 0 0 8px rgba(230, 180, 50, 0.28);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 220, 110, 0.45), 0 0 14px rgba(255, 200, 70, 0.5);
  }
}
.race-passive-tip-ico {
  width: 12px;
  height: 12px;
  display: block;
}
.race-passive-overlay .race-passive-popover {
  max-width: min(340px, 92vw);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.race-passive-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.race-passive-card-ico {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.race-passive-card-title {
  font-weight: 800;
  font-size: 0.95rem;
}
.race-passive-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 4px 0;
}
.race-passive-line-ico {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
  opacity: 0.9;
}
.race-passive-bullet {
  color: var(--muted);
  flex: 0 0 auto;
}
.race-passive-line-text { min-width: 0; }
.create-origin-info { margin-top: 6px; }
.ability-origin-label {
  margin-top: 8px;
  font-size: 0.85em;
}
.race-passive-part.c-crit { color: var(--c-crit); font-weight: 700; }
.race-passive-part.c-result { color: var(--c-result); font-weight: 700; }
.race-passive-part.c-muted { color: var(--c-muted-part); font-weight: 500; }
.race-passive-part.c-miss { color: var(--c-miss); font-weight: 700; }
.race-passive-part.c-hit { color: var(--c-hit); font-weight: 700; }
.race-passive-part.c-avoid { color: var(--c-avoid); font-weight: 700; }
.race-passive-part.c-lvl { color: var(--c-lvl); font-weight: 700; }
.race-passive-block .race-passive-card-head { margin-top: 2px; }
button.fighter-name:hover,
button.fighter-name:focus-visible {
  color: var(--accent2);
  background: transparent;
  outline: none;
}
button.fighter-name.name-ready {
  color: var(--accent2);
  font-weight: 800;
  text-shadow: 0 0 10px rgba(138, 106, 52, 0.65);
  box-shadow: 0 2px 0 0 rgba(138, 106, 52, 0.85);
  animation: nameReadyPulse 1.4s ease-in-out infinite;
}
button.fighter-name.name-ready:hover,
button.fighter-name.name-ready:focus-visible {
  color: #e5dcc8;
  text-shadow: 0 0 12px rgba(160, 124, 66, 0.8);
}
.fighter-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  min-width: 0;
  width: 100%;
  min-height: 18px;
  overflow: hidden;
}
.fighter-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 0;
}
.hp-hud-statuses {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
}
.hp-tag {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(8, 14, 28, 0.55);
}
.hp-tag.buff { color: #8fbfa4; }
.hp-tag.debuff { color: #f0a0a8; }
.hp-hud-round {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.hp-hud-round.dmg { color: #e07080; }
.hp-hud-round.heal { color: var(--c-sta-bonus); }
.hp-hud-round .spell-name {
  color: #b8a6ff;
  font-weight: 800;
}
.stance-row {
  flex: 0 0 34px;
  height: 34px;
  min-height: 34px;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 6px;
}
.stance-row .stance-ico {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  position: relative;
  border-radius: 8px;
}
.stance-row .stance-ico.stance-magic.active {
  background: rgba(122, 100, 220, 0.35);
  border-color: rgba(170, 140, 255, 0.65);
  color: #d2c2ff;
}
.stance-row .stance-ico.stance-magic.ready:not(.active) {
  border-color: rgba(138, 106, 52, 0.7);
  color: var(--accent2);
}
/* Soft ring: previous-round stance (dimmer than the selected .active gold) */
.stance-row .stance-ico.was-prev {
  box-shadow:
    0 0 0 1px rgba(255, 210, 120, 0.35),
    0 0 6px rgba(255, 190, 90, 0.18);
}
.stance-row .stance-ico.was-prev:not(.active) {
  border-color: rgba(255, 200, 120, 0.4);
  color: #d4b86a;
}
.stance-row .stance-ico.was-prev.active {
  box-shadow:
    0 0 0 2px rgba(255, 230, 160, 0.95),
    0 0 14px rgba(255, 200, 100, 0.5);
}
.stance-row-info {
  justify-content: stretch;
}
.stance-row-placeholder {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  opacity: 0.45;
}
.last-stance {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffe08a;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 3px rgba(0, 0, 0, 0.75);
}
.last-stance-magic {
  color: #9273bd;
}
.last-stance .log-icon {
  width: 14px;
  height: 14px;
  color: inherit;
}
.last-stance-defensive {
  color: #5379a5;
}
.last-stance-text {
  white-space: nowrap;
}
.resource-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  height: 12px;
  min-height: 12px;
  max-height: 12px;
  overflow: hidden;
}
.resource-row .hpbar {
  position: relative;
  flex: 1 1 auto;
  height: 7px;
  min-height: 7px;
  max-height: 7px;
  min-width: 0;
  overflow: hidden;
}
.resource-row .res-nums {
  flex: 0 0 7ch;
  width: 7ch;
  min-width: 7ch;
  max-width: 7ch;
  margin: 0;
  padding: 0;
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.92;
}
.avatar-stage {
  /* Locked height so the four bands stay on the body. */
  flex: 0 0 220px;
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  border: 1px dashed rgba(92, 72, 38, 0.55);
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  position: relative;
  container-type: size;
}
@media (min-height: 860px) {
  .avatar-stage {
    flex-basis: 260px;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }
}
.pixel-avatar {
  --lpc-x: 11;
  --lpc-y: 11;
  --lpc-w: 38;
  --lpc-h: 52;
  --frames: 2;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  line-height: 0;
  position: relative;
  overflow: hidden;
}
.pixel-avatar.frame-head {
  --lpc-x: 18;
  --lpc-y: 16;
  --lpc-w: 28;
  --lpc-h: 21;
}
.pixel-avatar .lpc-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pixel-avatar .lpc-stack {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  /* One full 64px frame per step, wider than the crop window. */
  width: calc(var(--frames) * 100% * 64 / var(--lpc-w));
}
.pixel-avatar .lpc-stack img {
  position: absolute;
  width: 100%;
  height: calc(100% * 64 / var(--lpc-h));
  left: calc(-100% * var(--lpc-x) / 64 / var(--frames));
  top: calc(-100% * var(--lpc-y) / var(--lpc-h));
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.pixel-avatar.face-left:not(.size-stage) .lpc-clip { transform: scaleX(-1); }
.pixel-avatar.size-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.pixel-avatar.size-stage .lpc-clip {
  inset: auto;
  top: 0;
  left: 50%;
  height: 100cqh;
  width: calc(100cqh * var(--lpc-w) / var(--lpc-h));
  max-width: 100cqw;
  transform: translateX(-50%);
}
.pixel-avatar.size-stage.face-left .lpc-clip {
  transform: translateX(-50%) scaleX(-1);
}
@keyframes lpc-reel {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.pixel-avatar.size-card {
  flex: 0 0 auto;
  height: 100px;
  width: calc(100px * var(--lpc-w) / var(--lpc-h));
}
.pixel-avatar.size-sheet {
  flex: 0 0 auto;
  height: calc(0.85rem * 1.15);
  width: calc(0.85rem * 1.15 * var(--lpc-w) / var(--lpc-h));
}
.char-hero .muted { line-height: 1.15; }
.char-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}
.char-identity .pixel-avatar.size-sheet {
  height: 2.15rem;
  width: calc(2.15rem * var(--lpc-w) / var(--lpc-h));
}
.char-identity-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.char-identity .page-subtitle {
  flex: 0 1 auto;
  width: 100%;
}
.pixel-avatar.size-preview {
  flex: 0 0 auto;
  height: 2.5rem;
  width: calc(2.5rem * var(--lpc-w) / var(--lpc-h));
}
.card-body { flex: 1; min-width: 0; }
.char-hero {
  display: flex;
  gap: 10px;
  align-items: center;
}
.create-avatar-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.create-avatar-row .create-name { flex: 1; min-width: 0; }
.zone-band {
  position: relative;
  flex: 18 0 0;
  min-height: 0;
  border-bottom: 1px solid rgba(73, 64, 47, 0.9);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
/* Sprite rows plus the outline: head 19, chest 27, belt 13, legs 39. Sum 98. */
.avatar-stage > .zone-head { flex-grow: 24; }
.avatar-stage > .zone-torso { flex-grow: 10; }
.avatar-stage > .zone-waist { flex-grow: 6; }
.avatar-stage > .zone-legs { flex-grow: 12; }
.zone-band:last-child { border-bottom: none; }
.zone-band.zone-head { background: rgba(255, 200, 120, 0.06); }
.zone-band.zone-torso { background: rgba(125, 148, 176, 0.08); }
.zone-band.zone-waist { background: rgba(160, 124, 66, 0.08); }
.zone-band.zone-legs { background: rgba(200, 140, 255, 0.06); }
.avatar-stage.interactive .zone-band.clickable {
  cursor: pointer;
}
.avatar-stage.interactive .zone-band.clickable:hover {
  background: rgba(255, 255, 255, 0.08);
}
.zone-band.zone-blocked {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}
.zone-band.selected-attack {
  background: rgba(224, 84, 108, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 140, 160, 0.55);
}
.zone-band.selected-defend {
  background: rgba(80, 140, 255, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(140, 180, 255, 0.55);
}
.zone-band.ability-target {
  background: rgba(255, 190, 70, 0.38) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 210, 100, 0.85),
    0 0 12px rgba(255, 180, 60, 0.35);
}
.zone-gear {
  position: absolute;
  z-index: 2;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(12, 11, 9, 0.62);
  color: var(--accent2);
  pointer-events: none;
}
.zone-gear.zone-gear-end {
  left: auto;
  right: 6px;
}
.zone-strike {
  position: absolute;
  z-index: 2;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #e8d48a;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.zone-strike.exhausted,
.strike-exhausted {
  color: #ff9a6a;
}
.strike-full {
  color: rgba(232, 228, 214, 0.7);
  font-weight: 700;
}
.turn-timer {
  flex: 0 0 6px;
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: rgba(20, 28, 48, 0.9);
  border: 1px solid rgba(102, 80, 46, 0.45);
  overflow: hidden;
  margin: 0 0 4px;
}
.turn-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6a5228, #8a6a34 55%, #8a3234);
  transition: width 0.1s linear;
}
.strike-forecast {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
  padding: 1px 2px 0;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.strike-forecast.empty { visibility: hidden; }
.strike-forecast-left {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.strike-dmg { color: #e8d48a; }
.strike-hit {
  color: rgba(160, 170, 190, 0.75);
  font-weight: 700;
  font-size: 0.72rem;
}
.strike-sta { color: var(--c-sta); }
.ability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ability-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.ability-chip.chip-attack {
  background: rgba(224, 84, 108, 0.22);
  border-color: rgba(255, 140, 160, 0.45);
  color: #ffb0be;
}
.ability-chip.chip-defend {
  background: rgba(80, 140, 255, 0.22);
  border-color: rgba(140, 180, 255, 0.45);
  color: #a8c8ff;
}
.ability-chip.chip-passive {
  background: rgba(120, 120, 140, 0.25);
  color: var(--muted);
}
.ability-chip.chip-sta {
  color: var(--c-sta-bonus);
  border-color: rgba(58, 125, 84, 0.55);
}
.ability-chip.chip-cd {
  color: #ffe08a;
  border-color: rgba(255, 210, 120, 0.4);
}
.ability-block-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.ability-block-body {
  font-size: 0.9rem;
  line-height: 1.45;
}
.ability-zone { font-weight: 800; }
.ability-dmg { color: #e07080; font-weight: 700; }
.ability-fx { color: #e7c6ff; font-weight: 800; }
.ability-you { color: var(--accent2); font-weight: 800; }
.ability-foe { color: #ffb0be; font-weight: 800; }
.ability-stat { font-weight: 800; }
.ability-stat-str { color: var(--c-str); }
.ability-stat-dex { color: var(--c-dex); }
.ability-stat-con { color: var(--c-con); }
.ability-stat-sta { color: var(--c-sta); }
.ability-stat-hp { color: var(--c-hp); }
.zone-armor-val {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}
.spell-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spell-sheet { max-height: 82dvh; }

.loadout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.loadout-slot {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--ink);
  position: relative;
}
.loadout-slot .slot-label {
  font-size: 0.7rem;
  color: var(--muted);
}
.loadout-slot .slot-name {
  font-size: 0.85rem;
  font-weight: 700;
}
.loadout-slot .slot-unequip {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 6px;
}
.inv-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.bag-cat-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  overflow: visible;
  padding-bottom: 0;
}
.bag-cat-btn {
  flex: unset;
  min-width: 0;
  width: 100%;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(70, 78, 96, 0.28);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.bag-cat-btn.active {
  background: rgba(120, 130, 150, 0.45);
  border-color: rgba(180, 190, 210, 0.35);
}
.bag-cat-btn.dim {
  opacity: 0.45;
}
.bag-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.bag-anchor {
  height: 0;
  overflow: hidden;
}
.bag-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-margin-top: 4px;
}
.bag-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}
.bag-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  min-height: 64px;
  aspect-ratio: auto;
  min-width: 0;
  min-height: 0;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid rgba(102, 80, 46, 0.55);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.bag-cell.stashed {
  background: rgba(8, 12, 22, 0.35);
  border-color: rgba(73, 64, 47, 0.95);
  opacity: 0.9;
}
.bag-cell.stashed:hover,
.bag-cell.stashed:focus-visible {
  opacity: 1;
  border-color: rgba(167, 137, 79, 0.7);
  background: rgba(16, 24, 42, 0.55);
}
.bag-cell.worn {
  background: rgba(12, 18, 34, 0.9);
  opacity: 1;
}
.bag-cell-ico {
  position: relative;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--accent2);
}
.bag-cell-name {
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  max-width: 100%;
  min-height: calc(1.05em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
}
.bag-cell.stashed .bag-cell-name {
  color: var(--muted);
  font-weight: 600;
}
.bag-cell-num {
  position: absolute;
  right: -4px;
  bottom: -3px;
  font-size: 0.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffe08a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.bag-cell.stashed .bag-cell-num {
  color: rgba(255, 224, 138, 0.55);
}
.item-card {
  border: 2px solid var(--line);
}
.item-desc {
  line-height: 1.45;
  font-size: 0.92rem;
}
.item-ref {
  color: #e07080;
  font-weight: 700;
}
.item-stat {
  font-size: 0.85rem;
  color: var(--accent2);
}
.battle-ability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
}
.ability-loadout-list,
.ability-catalog {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.ability-section-label {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}
.stance-ability-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}
.stance-ability-wrap .stance-row {
  flex: 0 0 34px;
}
.ability-btn.stance-ico,
.ability-btn {
  display: flex !important;
  place-items: unset;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 30px;
  height: auto;
  width: auto;
  min-width: 0;
  padding: 4px 6px !important;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}
.ability-btn .gear-ico {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}
.ability-btn-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6rem;
  letter-spacing: -0.01em;
}
.ability-btn-sta {
  flex: 0 0 2ch;
  width: 2ch;
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-sta-bonus);
  line-height: 1;
  text-align: right;
}
.ability-btn.ready {
  border-color: rgba(138, 106, 52, 0.7);
  color: var(--ink-warm);
}
/* Passive: gold frame while the combat effect is live (like ready actives). */
.ability-btn.passive-hot {
  border-color: rgba(138, 106, 52, 0.75);
  color: var(--ink-warm);
  background: rgba(106, 82, 40, 0.28);
  box-shadow: 0 0 10px rgba(138, 106, 52, 0.28);
}
.ability-btn.passive-live-val .ability-btn-live {
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.ability-live-now .ability-block-label {
  color: var(--accent2);
}
.sec-stat-ability {
  font-size: inherit;
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--accent2);
}
.ability-btn.active {
  background: rgba(138, 106, 56, 0.32);
  border-color: var(--accent2);
  color: var(--ink-warm);
}
.ability-btn.empty {
  opacity: 0.4;
  justify-content: center;
  pointer-events: none;
}
.ability-btn.passive-slot {
  border-style: dashed;
}
.ability-loadout-grid .ability-btn.empty {
  pointer-events: none;
}
.ability-facts { gap: 8px; }
.temple-panel { gap: 8px; }
.temple-tabs .pill {
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  padding: 8px 4px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.temple-npc-blurb { margin: 0; }
.temple-ability {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.45);
}
.temple-ability.owned {
  border-color: rgba(138, 106, 52, 0.55);
}
.temple-ability-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.temple-ability-foot button {
  margin-left: auto;
  min-width: 112px;
}
.battle-gear-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex: 0 0 30px;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  padding-top: 2px;
  overflow: hidden;
  position: relative;
  z-index: 0;
}
.gear-chip {
  flex: 1 1 0;
  min-width: 0;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 3px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.55);
  color: var(--accent2);
  font-size: 0.68rem;
  font-weight: 800;
}
.gear-chip.empty {
  opacity: 0.35;
  background: rgba(40, 48, 64, 0.55);
}
.gear-chip-num {
  font-variant-numeric: tabular-nums;
}
.gear-ico {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}
.gear-ico.sm {
  width: 12px;
  height: 12px;
}
.gear-ico.lg {
  width: 22px;
  height: 22px;
}
.item-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.inv-equipped {
  gap: 6px;
  flex: 0 0 auto;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(160, 170, 185, 0.35);
  border-radius: 12px;
  background: rgba(28, 32, 40, 0.55);
}
.inv-loadout-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 5px;
  width: 100%;
  overflow: visible;
}
.inv-doll {
  display: none;
}
.inv-doll-col {
  display: none;
}
.inv-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: unset;
  width: auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  position: relative;
  cursor: pointer;
}
.inv-slot-face {
  width: 100%;
  height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(160, 170, 185, 0.45);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  padding: 2px 2px 3px;
  position: relative;
  color: var(--accent2);
}
.inv-slot .slot-label {
  font-size: 0.48rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.05;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.inv-slot-face .gear-ico {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.inv-slot.empty .inv-slot-face {
  border-color: rgba(160, 170, 185, 0.35);
  background: rgba(40, 48, 64, 0.15);
}
.inv-slot.filled .inv-slot-face {
  background: rgba(12, 18, 34, 0.85);
}
.inv-slot-num {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 0.52rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffe08a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.inv-slot .slot-name {
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  width: 100%;
  min-height: calc(1.05em * 2);
  line-height: 1.05;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
}
.inv-slot .slot-unequip {
  position: absolute;
  top: 0;
  right: -2px;
  z-index: 1;
  padding: 0 3px;
  line-height: 1.1;
  font-size: 0.68rem;
  min-width: 0;
}
.inv-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.inv-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffe08a;
}
.ability-catalog-row {
  display: flex;
  gap: 4px;
  align-items: stretch;
  width: 100%;
}
.ability-catalog-row .ability-row-main {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.ability-row-action {
  flex: 0 0 auto;
  min-width: 4.8rem;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.ability-row-sta {
  flex: 0 0 3.2ch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-sta-bonus);
}
.ability-card-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.ability-card-name {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ability-mark {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.85rem;
}
.ability-mark.mark-attack { color: #ffb0be; }
.ability-mark.mark-defend { color: #a8c8ff; }
.ability-mark.mark-passive {
  color: var(--muted);
  font-size: 0.72rem;
}
.ability-card-mult {
  flex: 0 0 auto;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-sta-bonus);
}
.ability-card-x {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 1.15rem;
}
.ability-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}
.ability-card-origin,
.ability-card-req {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
}
.ability-card-req {
  margin-left: auto;
  text-align: right;
}
.ability-effect {
  line-height: 1.4;
}
.stat-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  padding-top: 2px;
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}
.stat-cell {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(8, 14, 28, 0.45);
}
.stat-abbr {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.stat-val {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
}
.inspect-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(17, 16, 13, 0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
.inspect-sheet {
  width: 100%; max-width: 460px; max-height: 94dvh; overflow: hidden;
  background: linear-gradient(180deg, #1a1612, #080706);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.inspect-equip {
  font-size: 0.72rem;
  line-height: 1.3;
}
.inv-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.inv-row.equipped {
  border-color: rgba(154, 168, 255, 0.45);
  background: rgba(79, 95, 255, 0.12);
}
.inv-row .grow { flex: 1; font-size: 0.85rem; min-width: 0; }
.inv-row button { flex: 0 0 auto; padding: 6px 10px; font-size: 0.8rem; }
.inv-name {
  font-weight: 800;
  color: var(--c-gear);
}
.zone-btn.elem-light { border-color: rgba(180, 200, 255, 0.55); color: #c8d4ff; }
.zone-btn.elem-arcane { border-color: rgba(170, 140, 255, 0.55); color: #d2c2ff; }
.zone-btn.elem-light.active {
  background: rgba(79, 95, 255, 0.18);
}
.zone-btn.elem-arcane.active {
  background: rgba(120, 90, 220, 0.2);
}
.inv-info { font-size: 0.85rem; }
.inv-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  min-height: 320px;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}
.inv-mode-nav {
  display: flex;
  gap: 6px;
}
.inv-mode-btn {
  flex: 1 1 0;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(70, 78, 96, 0.28);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}
.inv-mode-btn.active {
  background: rgba(120, 130, 150, 0.45);
  border-color: rgba(180, 190, 210, 0.35);
}
.inv-bag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inv-gold {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffe08a;
  font-variant-numeric: tabular-nums;
}
.inv-shop-hint {
  font-size: 0.68rem;
  line-height: 1.25;
}
.shop-price {
  font-size: 0.55rem;
  font-weight: 800;
  color: #ffe08a;
  line-height: 1;
}
.bag-cell.shop-cell.owned {
  opacity: 0.72;
}
.bag-cell.shop-cell.locked:not(.owned) {
  opacity: 0.55;
}
.inv-bag {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(160, 170, 185, 0.35);
  border-radius: 12px;
  background: rgba(28, 32, 40, 0.55);
  display: flex;
  flex-direction: column;
}
.action-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; border-bottom: 1px solid var(--line);
}
.turn-panel > .action-row:last-child,
.turn-panel > .action-row:has(+ .turn-footer) { border-bottom: none; }
.action-label {
  flex: 0 0 64px; font-size: 0.78rem; font-weight: 700; color: var(--ink);
}
.action-zones {
  display: flex; gap: 4px; flex: 1; overflow-x: auto; padding-bottom: 0;
}
.zone-btn {
  flex: 1 0 auto; min-width: 52px; padding: 6px 8px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--line); color: var(--ink);
  font-size: 0.75rem; font-weight: 600;
}
.zone-btn.active { background: var(--accent); border-color: transparent; color: #11100d; }
.log {
  max-height: 170px; overflow: auto; font-size: 0.78rem; color: var(--ink);
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}
.log-line {
  display: flex; align-items: flex-start; gap: 6px;
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
  line-height: 1.35;
}
.log-line .log-body {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.log-line .log-icon {
  flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; color: var(--accent2);
}
.log-zone {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 1px;
  color: var(--accent2);
}
.log-zone-ico {
  width: 13px;
  height: 13px;
  display: block;
}
.log-zone-head { color: #ffb86b; }
.log-zone-torso { color: #7d94b0; }
.log-zone-waist { color: #a07c42; }
.log-zone-legs { color: var(--c-sta-bonus); }
.log-line.log-block .log-icon { color: var(--ok); }
.log-line.log-hit { color: var(--ink); }
.log-line.log-heal { color: var(--ink); }
.log-line.log-status { color: var(--accent2); }
.log-tone-plain { color: inherit; }
.log-tone-muted { color: var(--muted); }
.log-tone-damage { color: var(--danger); font-weight: 700; }
.log-tone-dealt { color: #c65b48; font-weight: 700; }
.log-tone-heal { color: var(--ok); font-weight: 700; }
.log-tone-crit { color: var(--accent2); font-weight: 700; }
.spacer { flex: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.timer { font-variant-numeric: tabular-nums; color: var(--accent2); font-weight: 700; }
.fighter-head { display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, #66502e, #29251d);
  border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: var(--accent2);
}
