:root {
  --bg-deep: #111319;
  --bg-panel: #191d26;
  --bg-card: #212633;
  --bg-card-hover: #282f3f;
  --border: #2f3647;
  --border-light: #3d465c;

  --text-main: #f1f3f7;
  --text-sub: #a6b0c3;
  --text-muted: #768096;

  --gold: #f0be59;
  --gold-dim: #b68a32;
  --crimson: #e05252;
  --jade: #3fb88b;
  --blue: #4da3ff;
  --purple: #b57bff;

  --rarity-common: #9aa4b2;
  --rarity-rare: #4da3ff;
  --rarity-epic: #b57bff;
  --rarity-legendary: #f6b73c;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* 전체 레이아웃 */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 상단 바 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #1d222e 0%, #161a23 100%);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-seal {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c93b3b 0%, #8e1f1f 100%);
  border: 1px solid #f0be59;
  color: #fce5a8;
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(201, 59, 59, 0.35);
  flex-shrink: 0;
}

.stage-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-chapter {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stage-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-label {
  font-size: 16px;
  font-weight: 800;
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.mode-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.15);
  color: var(--blue);
  border: 1px solid rgba(77, 163, 255, 0.35);
}

.mode-badge.boss {
  background: rgba(224, 82, 82, 0.18);
  color: #ff7a7a;
  border-color: rgba(224, 82, 82, 0.45);
  animation: pulseBadge 1.4s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-sub);
  transition: all 0.15s;
}

.ctrl-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.ctrl-btn.active {
  background: rgba(63, 184, 139, 0.15);
  border-color: rgba(63, 184, 139, 0.5);
  color: #7ee8be;
}

.ctrl-btn.speed-2x {
  background: rgba(240, 190, 89, 0.16);
  border-color: rgba(240, 190, 89, 0.55);
  border-radius: 999px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ctrl-btn.danger:hover {
  background: rgba(224, 82, 82, 0.18);
  border-color: rgba(224, 82, 82, 0.55);
  color: #ff8c8c;
}

.btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* 메인 레이아웃: 모바일(상하) 기본 -> PC(좌우) */
.main-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 전투 화면 */
.battle-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #13161e;
  border-bottom: 1px solid var(--border);
}

.battle-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speech-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f4ebd7;
  border: 1px solid #d7be84;
  border-radius: var(--radius-md);
  font-size: 14px;
  min-height: 44px;
  position: relative;
  color: #1c1710;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.speech-bubble.highlight {
  border-color: var(--gold);
  background: #fff5dd;
  box-shadow: 0 0 0 2px rgba(240, 190, 89, 0.48), 0 6px 18px rgba(0, 0, 0, 0.38);
}

.speech-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  background: #231d14;
  color: #f6cf78;
  flex-shrink: 0;
}

.speech-text {
  flex: 1;
  min-width: 0;
  color: #1c1710;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speech-log-btn,
.battle-toggle-btn {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #2b2317;
  background: rgba(28, 23, 16, 0.08);
  border: 1px solid rgba(28, 23, 16, 0.22);
  transition: background 0.15s;
}

.speech-log-btn:hover,
.battle-toggle-btn:hover {
  background: rgba(28, 23, 16, 0.16);
}

.battle-pane.compact {
  gap: 8px;
  padding: 10px 14px;
}

.battle-pane.compact .battlefield,
.battle-pane.compact .battle-footer {
  display: none;
}

/* 스테이지 진행도 */
.stage-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: #0d1016;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d69d36, #f5cf72);
  transition: width 0.25s ease;
}

.progress-fill.boss {
  background: linear-gradient(90deg, #b82929, #f25f5f);
}

.boss-challenge-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #d94444, #a52424);
  color: #fff;
  border: 1px solid #ff8c8c;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(217, 68, 68, 0.35);
}

.boss-challenge-btn:hover {
  filter: brightness(1.1);
}

/* 전장 영역 */
.battlefield {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 290px;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(240, 190, 89, 0.08), transparent 65%),
              linear-gradient(180deg, #1b202d 0%, #141822 70%, #191d24 100%);
}

.battlefield.theme-1 {
  background: radial-gradient(circle at 50% 15%, rgba(235, 185, 78, 0.14), transparent 60%),
              linear-gradient(180deg, #211f1d 0%, #161820 75%, #1c1a16 100%);
}

.battlefield.theme-2 {
  background: radial-gradient(circle at 50% 15%, rgba(224, 82, 82, 0.16), transparent 60%),
              linear-gradient(180deg, #24191c 0%, #161720 75%, #1d1619 100%);
}

.battlefield.theme-3 {
  background: radial-gradient(circle at 50% 15%, rgba(77, 163, 255, 0.15), transparent 60%),
              linear-gradient(180deg, #18212c 0%, #141922 75%, #161c24 100%);
}

.battlefield.theme-4 {
  background: radial-gradient(circle at 50% 15%, rgba(255, 118, 66, 0.18), transparent 60%),
              linear-gradient(180deg, #281b19 0%, #151923 75%, #1a1820 100%);
}

.battlefield.theme-5 {
  background: radial-gradient(circle at 50% 15%, rgba(164, 118, 255, 0.16), transparent 60%),
              linear-gradient(180deg, #1e1a2b 0%, #141722 75%, #181a24 100%);
}

.battlefield-bg-deco {
  position: absolute;
  inset: auto 0 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.battle-center-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.vs-mark {
  font-size: 18px;
  color: rgba(240, 190, 89, 0.38);
  user-select: none;
}

.team-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  min-width: 0;
}

.ally-zone {
  align-items: flex-end;
}

.enemy-zone {
  align-items: flex-start;
}

.enemy-zone.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.enemy-zone.two-col .unit-card {
  max-width: none;
  padding: 5px 7px;
  gap: 6px;
}

.enemy-zone.two-col .unit-card.boss {
  grid-column: 1 / -1;
  max-width: none;
  padding: 8px 10px;
}

.enemy-zone.two-col .unit-avatar {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.enemy-zone.two-col .unit-card.boss .unit-avatar {
  width: 38px;
  height: 38px;
  font-size: 22px;
}

.enemy-zone.two-col .unit-name-row {
  font-size: 11px;
}

.enemy-zone.two-col .unit-hp-num {
  font-size: 10px;
}

/* 전투 유닛 카드 */
.unit-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 210px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  background: rgba(25, 30, 41, 0.88);
  border: 1px solid var(--border-light);
  transition: transform 0.14s ease, opacity 0.25s ease, border-color 0.2s;
  backdrop-filter: blur(4px);
}

.unit-card.hero {
  border-color: rgba(240, 190, 89, 0.7);
  box-shadow: 0 0 12px rgba(240, 190, 89, 0.12);
}

.unit-card.boss {
  max-width: 235px;
  padding: 10px 12px;
  border-color: rgba(224, 82, 82, 0.85);
  background: linear-gradient(135deg, rgba(64, 22, 26, 0.92), rgba(28, 22, 32, 0.92));
  box-shadow: 0 0 18px rgba(224, 82, 82, 0.25);
}

.unit-card.dead {
  opacity: 0.28;
  filter: grayscale(0.9);
}

.unit-card.attack-ally {
  transform: translateX(18px) scale(1.03);
}

.unit-card.attack-enemy {
  transform: translateX(-18px) scale(1.03);
}

.unit-card.hit {
  animation: unitHit 0.22s ease;
  border-color: #ff6b6b !important;
}

@keyframes unitHit {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.unit-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  flex-shrink: 0;
  animation: idleBob 2.4s ease-in-out infinite;
}

.avatar-svg,
.avatar-img,
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-img {
  object-fit: cover;
}

.frame-common {
  border-color: rgba(154, 164, 178, 0.55) !important;
}

.frame-rare {
  border-color: rgba(77, 163, 255, 0.8) !important;
  box-shadow: 0 0 8px rgba(77, 163, 255, 0.22);
}

.frame-epic {
  border-color: rgba(181, 123, 255, 0.85) !important;
  box-shadow: 0 0 10px rgba(181, 123, 255, 0.3);
}

.frame-legendary {
  border-color: rgba(246, 183, 60, 0.95) !important;
  box-shadow: 0 0 12px rgba(246, 183, 60, 0.35);
}

.frame-boss {
  border-color: rgba(255, 107, 107, 0.9) !important;
  box-shadow: 0 0 12px rgba(224, 82, 82, 0.35);
}

.frame-mob {
  border-color: rgba(201, 136, 91, 0.55) !important;
}

.slot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-light);
  display: grid;
  place-items: center;
}

.hero-avatar,
.general-avatar {
  overflow: hidden;
  border: 1.5px solid var(--border-light);
}

.hero-avatar {
  cursor: pointer;
}

.unit-card.boss .unit-avatar {
  width: 44px;
  height: 44px;
  font-size: 25px;
  background: rgba(224, 82, 82, 0.2);
  border-color: rgba(240, 190, 89, 0.5);
}

.unit-card.dead .unit-avatar {
  animation: none;
}

@keyframes idleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.unit-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 13px;
}

.unit-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-hp-num {
  font-size: 11px;
  color: var(--text-sub);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.hp-track {
  width: 100%;
  height: 7px;
  background: #0c0f15;
  border-radius: 999px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.15s ease;
}

.hp-fill.ally {
  background: linear-gradient(90deg, #2b9a6f, #53d6a4);
}

.hp-fill.enemy {
  background: linear-gradient(90deg, #c93b3b, #f26d6d);
}

.atk-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.atk-fill {
  height: 100%;
  background: rgba(240, 190, 89, 0.85);
}

/* 데미지 플로팅 레이어 */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.damage-pop {
  position: absolute;
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  animation: floatDamage 0.75s ease-out forwards;
  white-space: nowrap;
}

.damage-pop.ally-dmg {
  color: #ff8c8c;
}

.damage-pop.enemy-dmg {
  color: #ffffff;
}

.damage-pop.crit {
  color: #ffd859;
  font-size: 18px;
}

.damage-pop.reward {
  color: #7ee8be;
  font-size: 13px;
}

@keyframes floatDamage {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.9);
  }
  25% {
    transform: translate(-50%, -14px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40px) scale(0.95);
  }
}

.battle-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 2px;
}

/* 오른쪽 / 아래쪽 제어 패널 */
.control-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-panel);
  min-height: 0;
}

/* 상단 요약 */
.summary-card {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1d222e 0%, #191d26 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.hero-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(240, 190, 89, 0.22), rgba(240, 190, 89, 0.06));
  border: 1px solid rgba(240, 190, 89, 0.55);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.hero-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 15px;
}

.hero-edit-btn {
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}

.hero-edit-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.level-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(240, 190, 89, 0.18);
  color: var(--gold);
}

.exp-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exp-bar-track {
  width: 100%;
  max-width: 190px;
  height: 6px;
  background: #0d1016;
  border-radius: 999px;
  overflow: hidden;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3a86ff, #72b6ff);
  transition: width 0.2s ease;
}

.exp-text {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.power-box {
  text-align: right;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 156, 107, 0.08);
  border: 1px solid rgba(255, 156, 107, 0.25);
}

.stat-caption {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.power-value {
  font-size: 22px;
  color: #ff9c6b;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.resource-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 8px;
}

.resource-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.resource-item.resource-primary {
  background: linear-gradient(135deg, rgba(240, 190, 89, 0.14), var(--bg-card));
  border-color: rgba(240, 190, 89, 0.42);
}

.gold-text {
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.gold-text.gold-hero {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.rate-text {
  color: var(--jade);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.exp-highlight {
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

/* 하단 가이드 배너 & 주력 액션 도크 */
.action-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #161a24;
  flex-shrink: 0;
}

.guide-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: rgba(240, 190, 89, 0.1);
  border: 1px solid rgba(240, 190, 89, 0.35);
  font-size: 13px;
}

.guide-banner.boss {
  background: rgba(224, 82, 82, 0.14);
  border-color: rgba(224, 82, 82, 0.45);
}

.guide-text {
  color: var(--text-main);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-action-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(240, 190, 89, 0.22);
  color: var(--gold);
  border: 1px solid rgba(240, 190, 89, 0.45);
  transition: filter 0.15s;
}

.guide-banner.boss .guide-action-btn {
  background: rgba(224, 82, 82, 0.25);
  color: #ff9a9a;
  border-color: rgba(224, 82, 82, 0.55);
}

.guide-action-btn:hover {
  filter: brightness(1.12);
}

.hero-strike-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  text-align: left;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}

.hero-strike-btn.ready {
  background: linear-gradient(135deg, rgba(240, 190, 89, 0.18), rgba(201, 59, 59, 0.12));
  border-color: rgba(240, 190, 89, 0.65);
  box-shadow: 0 2px 12px rgba(240, 190, 89, 0.14);
}

.hero-strike-btn.ready:active {
  transform: scale(0.98);
}

.hero-strike-btn:not(.ready) {
  opacity: 0.72;
  cursor: not-allowed;
}

.strike-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.strike-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(240, 190, 89, 0.16);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.strike-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.strike-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.strike-sub {
  font-size: 12px;
  color: var(--text-sub);
}

.strike-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.hero-strike-btn.ready .strike-badge {
  background: var(--gold);
  color: #16130b;
}

/* 하단 고정 탭 네비게이션 */
.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  background: #161a23;
  position: sticky;
  bottom: 0;
  z-index: 30;
  flex-shrink: 0;
}

.tab-btn {
  padding: 12px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  border-top: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--gold);
  border-top-color: var(--gold);
  background: rgba(240, 190, 89, 0.08);
}

/* 탭 컨텐츠 */
.tab-content-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

.panel-header-note, .sub-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section-title-row h3 {
  font-size: 15px;
  font-weight: 800;
}

/* 수련 툴바 & 리스트 */
.train-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mult-toggle-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  flex-shrink: 0;
}

.mult-btn {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sub);
  transition: background 0.15s, color 0.15s;
}

.mult-btn.active {
  background: var(--gold);
  color: #16130b;
}

.train-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.train-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.train-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.train-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.train-title {
  font-size: 15px;
  font-weight: 700;
}

.train-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* 공통 액션 버튼 */
.action-btn {
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}

.action-btn.tutorial-glow:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(240, 190, 89, 0.75), 0 0 16px rgba(240, 190, 89, 0.55);
  animation: tutorialGlow 1.5s ease-in-out infinite;
}

@keyframes tutorialGlow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(240, 190, 89, 0.65), 0 0 10px rgba(240, 190, 89, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(240, 190, 89, 0.95), 0 0 20px rgba(240, 190, 89, 0.75);
  }
}

.action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.action-btn.primary {
  background: linear-gradient(135deg, #e0ac45, #b88322);
  color: #16130b;
}

.action-btn.secondary {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.action-btn.jade {
  background: linear-gradient(135deg, #38b083, #237c5b);
  color: #fff;
}

.action-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.action-btn.ghost:hover {
  color: var(--text-sub);
  border-color: var(--border-light);
}

.action-btn.full-width {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* 출전 슬롯 */
.party-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.party-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 78px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  text-align: center;
  font-size: 12px;
}

.party-slot.filled {
  border-style: solid;
  cursor: pointer;
}

.party-slot.filled:hover {
  background: var(--bg-card-hover);
}

.party-slot.hero-slot {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(240, 190, 89, 0.08);
  cursor: default;
}

.slot-emoji {
  font-size: 20px;
}

.slot-name {
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* 상위 등급 무장 교체 추천 박스 */
.swap-guide-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(63, 184, 139, 0.14), rgba(240, 190, 89, 0.08));
  border: 1px solid rgba(63, 184, 139, 0.55);
}

.swap-guide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.swap-guide-title {
  font-size: 13px;
  font-weight: 800;
  color: #7ee8be;
}

.swap-guide-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.swap-unit-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.swap-arrow {
  color: var(--gold);
  font-weight: 900;
}

.general-card.swap-highlight {
  box-shadow: 0 0 0 1px rgba(63, 184, 139, 0.65), 0 0 14px rgba(63, 184, 139, 0.2);
}

/* 보유 무장 카드 */
.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 24px 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
}

.general-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rarity-common);
  border-radius: var(--radius-md);
}

.general-card.rarity-common { border-left-color: var(--rarity-common); }
.general-card.rarity-rare { border-left-color: var(--rarity-rare); }
.general-card.rarity-epic { border-left-color: var(--rarity-epic); }
.general-card.rarity-legendary {
  border-left-color: var(--rarity-legendary);
  background: linear-gradient(90deg, rgba(246, 183, 60, 0.08), var(--bg-card));
}

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

.general-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.general-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.general-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.rarity-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  color: #111;
}

.rarity-badge.common { background: var(--rarity-common); }
.rarity-badge.rare { background: var(--rarity-rare); color: #fff; }
.rarity-badge.epic { background: var(--rarity-epic); color: #fff; }
.rarity-badge.legendary { background: var(--rarity-legendary); color: #1a1204; }

.star-badge {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.general-stats-line {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.general-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* 주막 */
.tavern-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tavern-header h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
}

.tavern-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tavern-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rarity-common);
  border-radius: var(--radius-md);
}

.tavern-card.rarity-rare { border-left-color: var(--rarity-rare); }
.tavern-card.rarity-epic { border-left-color: var(--rarity-epic); }
.tavern-card.rarity-legendary {
  border-left-color: var(--rarity-legendary);
  background: linear-gradient(90deg, rgba(246, 183, 60, 0.12), var(--bg-card));
}

.tavern-card.hired {
  opacity: 0.55;
}

.dup-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(63, 184, 139, 0.2);
  color: #7ee8be;
}

/* 모달 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.modal-card h2 {
  font-size: 18px;
  color: var(--gold);
}

.modal-desc {
  font-size: 14px;
  color: var(--text-sub);
}

.away-modal-card {
  max-width: 380px;
  background: #141821;
  border-color: var(--border-light);
  padding: 22px 20px;
  gap: 16px;
}

.away-header h2 {
  font-size: 20px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.away-duration {
  font-size: 13px;
  color: var(--text-muted);
}

.away-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.away-stat-card {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 16px;
  background: #0d1017;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.away-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.away-kills-num {
  color: var(--jade);
}

.away-stat-label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 600;
}

.away-guide-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.away-guide-note strong {
  color: var(--text-sub);
}

/* 광장 탭 & 공지사항 */
.plaza-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.plaza-account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.plaza-account-info strong {
  font-size: 14px;
}

.plaza-coming-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.08), var(--bg-card));
  border: 1px solid rgba(77, 163, 255, 0.28);
  border-radius: var(--radius-md);
}

.plaza-coming-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.plaza-coming-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.2);
  color: var(--blue);
  flex-shrink: 0;
}

.notice-section {
  display: flex;
  flex-direction: column;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.notice-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.notice-row-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.notice-pin {
  font-size: 12px;
  flex-shrink: 0;
}

.notice-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.18);
  color: #7ebdff;
  flex-shrink: 0;
}

.notice-tag.info {
  background: rgba(240, 190, 89, 0.18);
  color: var(--gold);
}

.notice-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-date {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 공지 상세 모달 */
.notice-modal-card {
  max-width: 460px;
  max-height: 82vh;
  border-color: var(--border-light);
  gap: 12px;
}

.notice-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notice-modal-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 14px;
  display: grid;
  place-items: center;
}

.modal-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.notice-modal-title {
  font-size: 17px !important;
  color: var(--text-main) !important;
  line-height: 1.35;
}

.notice-modal-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notice-modal-body {
  overflow-y: auto;
  padding-right: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.65;
}

.notice-section-block h4 {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.notice-section-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notice-section-block li::before {
  content: '· ';
  color: var(--gold);
  font-weight: 800;
}

/* 전황 기록 모달 */
.battle-log-modal-card {
  max-width: 440px;
  max-height: 78vh;
  border-color: var(--border-light);
  gap: 12px;
}

.battle-log-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  min-height: 120px;
}

.battle-log-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
}

.battle-log-item.important {
  border-color: rgba(240, 190, 89, 0.35);
  color: var(--gold);
}

.battle-log-item.danger {
  border-color: rgba(224, 82, 82, 0.35);
  color: #f59494;
}

.battle-log-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 신무장 꾸미기 모달 */
.customize-modal-card {
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  gap: 14px;
}

.customize-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.custom-hero-preview {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.customize-name-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customize-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customize-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customize-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.custom-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-sub);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.custom-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.custom-pill.selected {
  background: rgba(240, 190, 89, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

.color-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.customize-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
}

.job-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(224, 82, 82, 0.2);
  color: #ff9c9c;
  border: 1px solid rgba(224, 82, 82, 0.45);
}

.modal-subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.modal-subtab {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub);
  transition: background 0.15s, color 0.15s;
}

.modal-subtab.active {
  background: rgba(240, 190, 89, 0.18);
  color: var(--gold);
}

.customize-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job-section-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.job-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.job-section-head h3 {
  font-size: 14px;
  font-weight: 800;
}

.job-promo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-promo-info {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.job-origin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-origin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.job-origin-row.current {
  border-color: var(--gold);
  background: rgba(240, 190, 89, 0.08);
}

/* 인앱 브라우저 안내 모달 */
#inapp-modal {
  z-index: 110;
}

.inapp-modal-card {
  max-width: 390px;
}

.inapp-modal-card .modal-desc {
  line-height: 1.55;
}

.inapp-modal-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--gold);
}

.inapp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 신무장 생성 모달 */
#onboarding-modal {
  z-index: 105;
}

.onboarding-modal-card {
  max-width: 410px;
}

.onboarding-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.name-input-row {
  display: flex;
  gap: 8px;
}

.text-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus {
  border-color: var(--gold);
}

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

.origin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.origin-card:hover {
  background: var(--bg-card-hover);
}

.origin-card.selected {
  border-color: var(--gold);
  background: rgba(240, 190, 89, 0.12);
  box-shadow: 0 0 0 1px rgba(240, 190, 89, 0.3);
}

.origin-emoji {
  font-size: 22px;
}

.origin-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.origin-desc {
  font-size: 10px;
  color: var(--text-sub);
  line-height: 1.3;
}

.modal-footnote {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* 토스트 */
.toast-container {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 120;
  pointer-events: none;
}

.toast {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(25, 30, 41, 0.96);
  border: 1px solid var(--gold-dim);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.2s ease;
}

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

/* PC 반응형 (가로가 넓을 때: 왼쪽 전투 / 오른쪽 제어) */
@media (min-width: 960px) {
  .app-shell {
    height: 100vh;
    overflow: hidden;
  }

  .main-layout {
    flex-direction: row;
    overflow: hidden;
  }

  .battle-pane {
    flex: 1.2;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 16px 20px;
  }

  .battle-toggle-btn {
    display: none;
  }

  .battle-pane.compact .mini-log,
  .battle-pane.compact .battlefield,
  .battle-pane.compact .battle-footer {
    display: flex;
  }

  .battle-pane.compact .battlefield {
    display: grid;
  }

  .control-pane {
    flex: none;
    width: 450px;
    flex-shrink: 0;
    overflow: hidden;
  }

  .tab-nav {
    position: static;
  }

  .battlefield {
    flex: 1;
    min-height: 0;
    padding: 20px 24px;
  }

  .unit-card {
    max-width: 245px;
    padding: 9px 11px;
  }

  .unit-card.boss {
    max-width: 270px;
  }
}
