/* ==========================================================================
   SCRAP STORM - Industrial Dark Theme CSS (Reference UI Overhaul)
   ========================================================================== */

:root {
  --bg-dark: #0b1017;
  --bg-panel: #111827;
  --bg-card: #151f2e;
  --bg-card-hover: #1e293b;
  --border-color: #243448;
  --border-glow: #f59e0b;

  --accent-orange: #f59e0b;
  --accent-amber: #d97706;
  --accent-red: #ef4444;
  --accent-cyan: #00d2d3;
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  --accent-green: #4ade80;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #fbbf24;

  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  touch-action: manipulation;
}

/* 산업용 그리드 배경 */
body {
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(245, 158, 11, 0.05) 0%, transparent 60%),
    linear-gradient(rgba(30, 41, 59, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.3) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

/* 메인 최상위 래퍼 컨테이너 */
#app-shake-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 이펙트 오버레이 캔버스 (전체 화면 고정) */
#effects-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

/* ==========================================================================
   헤더 영역 (상단 정보 및 HUD) - Reference Header Bar
   ========================================================================== */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: linear-gradient(180deg, #131b26 0%, #0d131d 100%);
  border-bottom: 2px solid #243448;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  position: relative;
  gap: 12px;
}

.header-bar::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #f59e0b 20%, #f59e0b 80%, transparent 100%);
  opacity: 0.6;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.3px;
}

.brand-gear-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

.brand-scrap {
  color: #ffffff;
}

.brand-storm {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ==========================================================================
   헤더 상단 공장 종합 상태 칩 바 (8종 통일형 카드 칩)
   ========================================================================== */
.header-stats-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-stats-bar::-webkit-scrollbar {
  display: none;
}

.header-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid #1f293d;
  border-radius: 8px;
  padding: 5px 9px;
  white-space: nowrap;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.chip-icon {
  font-size: 0.85rem;
}

.chip-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
}

.chip-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
}

.chip-val.highlight-gold {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.chip-val.highlight-cyan {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.chip-val.highlight-white {
  color: #ffffff;
}

.chip-val.highlight-purple {
  color: #c084fc;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.35);
}

.chip-val.highlight-green {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

.chip-val.highlight-gem {
  color: #00f2fe;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.header-stat-chip.chip-gems {
  border-color: rgba(0, 242, 254, 0.3);
}

/* 컨트롤 액션 버튼들 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: #151f2e;
  border: 1px solid #243448;
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: #1e293b;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn.muted {
  color: #ef4444;
  border-color: #ef4444;
}

/* 언어 전환 버튼 */
.header-lang-btn {
  background: #151f2e;
  border: 1px solid #243448;
  color: #38bdf8;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
  user-select: none;
}

.header-lang-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.header-lang-btn:active {
  transform: translateY(1px);
}

.lang-globe-icon {
  font-size: 0.92rem;
}

/* ==========================================================================
   메인 레이아웃 (좌측 타격 공장실 + 우측 업그레이드/목록 패널)
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: calc(100vh - 60px);
}

/* ==========================================================================
   좌측 패널: 일꾼 관리 (Workforce) + 업그레이드 (Training)
   ========================================================================== */
.workers-zone {
  width: 320px;
  min-width: 300px;
  max-width: 340px;
  background: #11141b;
  border-right: 2px solid #202634;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  user-select: none;
  z-index: 5;
  box-shadow: inset -2px 0 10px rgba(0, 0, 0, 0.4);
}

.workers-zone::-webkit-scrollbar {
  width: 5px;
}

.workers-zone::-webkit-scrollbar-thumb {
  background: #283142;
  border-radius: 3px;
}

/* 1. 상단 일꾼 관리 컨테이너 */
.workforce-box {
  background: #181d28;
  border: 1px solid #273142;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.workforce-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #242c3b;
  padding-bottom: 6px;
}

.box-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #f0f6fc;
}

.box-header-icon {
  font-size: 1.0rem;
}

.box-header-count {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-gold);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #323d4f;
}

/* 3대 티어 일꾼 그룹 카드 */
.worker-group-card {
  background: #12151e;
  border: 1px solid #232a38;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.worker-group-card.locked {
  opacity: 0.55;
  border-style: dashed;
  border-color: #3b4559;
}

.group-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #cbd5e1;
}

.group-count-tag {
  font-size: 0.70rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 210, 211, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 210, 211, 0.25);
}

/* 5열 아바타 그리드 (티어별 최대 5명 표시로 화면 과밀도 해소) */
.worker-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  min-height: 38px;
  max-height: none;
  overflow: visible;
  align-content: start;
  padding: 3px;
  background: rgba(10, 13, 18, 0.5);
  border-radius: 6px;
}

.worker-avatar-grid::-webkit-scrollbar {
  display: none;
}

/* 일꾼 개별 아바타 유닛 */
.worker-unit {
  width: 100%;
  aspect-ratio: 1;
  background: #1a202c;
  border: 1px solid #2d3748;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease, border-color 0.2s ease;
  animation: workerIdle 2.5s ease-in-out infinite alternate;
  padding: 2px;
}

/* 5명 초과 보유 시 5번째 아바타에 표시되는 초과 인원 뱃지 */
.worker-extra-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #2563eb;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.worker-unit:nth-child(even) {
  animation-delay: -1.25s;
}

.worker-unit:hover {
  border-color: #f59f00;
  transform: translateY(-1px);
}

.worker-unit .worker-svg-wrap {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.worker-unit.worker-striking .worker-svg-wrap {
  animation: workerSwing 0.28s ease-in-out;
}

/* 그룹 빠른 고용/해금 액션 바 */
.group-quick-bar {
  display: flex;
  width: 100%;
}

.btn-group-quick-hire {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.35);
  transition: all 0.15s ease;
}

.btn-group-quick-hire:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn-group-quick-hire:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-group-quick-hire:disabled {
  background: #21262d;
  color: #6e7681;
  border: 1px solid #30363d;
  cursor: not-allowed;
  box-shadow: none;
}

.quick-cost {
  color: #fff3bf;
  font-weight: 900;
}

/* 로봇단 서브 카드 */
.robots-sub-card {
  background: #12151e;
  border: 1px solid rgba(0, 210, 211, 0.3);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.robots-stage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-height: 50px;
  align-content: start;
}

.robot-unit {
  width: 100%;
  aspect-ratio: 1;
  background: #151d28;
  border: 1px solid rgba(0, 210, 211, 0.4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0, 210, 211, 0.15);
  animation: workerIdle 3.0s ease-in-out infinite alternate;
  padding: 3px;
}

.robot-unit .robot-svg-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(0, 210, 211, 0.6));
}

.robot-unit.robot-striking .robot-svg-wrap {
  animation: robotStrike 0.22s ease-in-out;
}

/* 2. 하단 업그레이드 (Training) 컨테이너 */
.worker-training-box {
  background: #181d28;
  border: 1px solid #273142;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.training-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #242c3b;
  padding-bottom: 6px;
}

.box-header-icon-plus {
  color: #ffaa48;
  font-weight: 900;
  font-size: 0.95rem;
}

.worker-training-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.worker-train-row {
  background: #12151e;
  border: 1px solid #232a38;
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.2s ease;
}

.worker-train-row:hover {
  border-color: #3b475d;
}

.train-row-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.train-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.train-row-name-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.train-row-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.train-row-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f1f5f9;
}

.train-row-lvl {
  font-size: 0.70rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0, 210, 211, 0.12);
  border: 1px solid rgba(0, 210, 211, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
}

.train-row-stat {
  font-size: 0.70rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.train-row-buy-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(230, 126, 34, 0.3);
  transition: all 0.15s ease;
  margin-top: 2px;
}

.train-row-buy-btn:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.train-row-buy-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.train-row-buy-btn:disabled {
  background: #21262d;
  color: #6e7681;
  border: 1px solid #30363d;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-cost-text {
  color: #fff3bf;
  font-weight: 900;
}

.btn-action-text {
  color: #ffffff;
}

/* 타격 및 대기 애니메이션 */
/* ==========================================================================
   중앙 무대: 공장 컨베이어 벨트 작업실 (Factory Conveyor Yard)
   ========================================================================== */
.factory-zone {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 12px;
  position: relative;
  overflow: hidden;
  background: #0c0f16;
}

.factory-stage-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #232b3c;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, rgba(14, 18, 25, 0.72) 0%, rgba(9, 11, 16, 0.88) 100%),
              url('../assets/factory_background.jpg') center/cover no-repeat;
}

/* 수직 강철 구조물 지지대 (Steel Structural Pillars) */
.stage-steel-pillars {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
  display: flex;
  justify-content: space-between;
}

.pillar {
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #1e2634 0%, #2f3a4e 45%, #18202d 100%);
  border-right: 1px solid #414f6b;
  border-left: 1px solid #141a24;
  position: relative;
  opacity: 0.85;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(0, 0, 0, 0.4) 15px, rgba(0, 0, 0, 0.4) 30px);
}

.pillar.pillar-right {
  border-left: 1px solid #414f6b;
  border-right: 1px solid #141a24;
}

/* 컨베이어 레인 배치 무대 */
/* 컨베이어 레인 배치 무대 - 규격 단계별 CSS 변수 바인딩 */
.conveyor-stage {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 12px;
  padding: 16px 28px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  --chute-w: 52px;
  --lane-h: 64px;
}

.conveyor-stage[data-width-tier="1"] {
  --chute-w: 52px;
  --lane-h: 64px;
}

.conveyor-stage[data-width-tier="2"] {
  --chute-w: 68px;
  --lane-h: 104px;
}

.conveyor-stage[data-width-tier="3"] {
  --chute-w: 82px;
  --lane-h: 148px;
}

/* 개별 컨베이어 레인 (규격 업그레이드 시 세로 폭 동적 확장) */
.conveyor-lane {
  position: relative;
  width: 100%;
  height: var(--lane-h, 64px);
  min-height: calc(var(--lane-h, 64px) - 8px);
  max-height: calc(var(--lane-h, 64px) + 8px);
  flex: 0 1 var(--lane-h, 64px);
  display: flex;
  align-items: center;
  border-radius: 6px;
  background: #11151e;
  border: 2px solid #283345;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65), inset 0 1px 6px rgba(0, 0, 0, 0.6);
  overflow: visible;
  user-select: none;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              min-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

/* 컨베이어 규격 티어 1: 표준 전자제품 벨트 (기본: 이전의 약 57% 크기 콤팩트 규격) */
.conveyor-stage[data-width-tier="1"] .conveyor-lane,
.conveyor-lane.width-tier-1 {
  border: 2px solid #283345;
  background: #11151e;
}

/* 컨베이어 규격 티어 2: 중공업 광폭 컨베이어 (T7~T8 오픈) */
.conveyor-stage[data-width-tier="2"] .conveyor-lane,
.conveyor-lane.width-tier-2 {
  border: 2px solid #7c3aed;
  background: linear-gradient(90deg, #131620 0%, #17182c 50%, #131620 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8), inset 0 2px 10px rgba(124, 58, 237, 0.22);
}

.conveyor-stage[data-width-tier="2"] .lane-chute.exit,
.conveyor-lane.width-tier-2 .lane-chute.exit {
  background: linear-gradient(135deg, #7c2d12 0%, #450a0a 100%);
  border-left: 2px solid #ea580c;
  box-shadow: -2px 0 16px rgba(234, 88, 12, 0.45), inset 0 0 14px rgba(0, 0, 0, 0.8);
}

.conveyor-stage[data-width-tier="2"] .conveyor-track,
.conveyor-lane.width-tier-2 .conveyor-track {
  top: 8px;
  bottom: 15px;
  background-size: 34px 100%;
  border-top: 3px solid #6366f1;
}

.conveyor-stage[data-width-tier="2"] .conveyor-hazard-trim,
.conveyor-lane.width-tier-2 .conveyor-hazard-trim {
  bottom: 6px;
  height: 7px;
}

/* 컨베이어 규격 티어 3: 특수 초광폭 메가 벨트 (T9~T10 오픈) */
.conveyor-stage[data-width-tier="3"] .conveyor-lane,
.conveyor-lane.width-tier-3 {
  border: 2px solid #00d2d3;
  background: linear-gradient(90deg, #0d1520 0%, #10212e 50%, #0d1520 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), inset 0 2px 14px rgba(0, 210, 211, 0.3);
}

.conveyor-stage[data-width-tier="3"] .lane-chute.exit,
.conveyor-lane.width-tier-3 .lane-chute.exit {
  background: linear-gradient(135deg, #4c1d95 0%, #2e1065 100%);
  border-left: 2px solid #e879f9;
  box-shadow: -2px 0 20px rgba(232, 121, 249, 0.55), inset 0 0 16px rgba(0, 0, 0, 0.85);
}

.conveyor-stage[data-width-tier="3"] .conveyor-track,
.conveyor-lane.width-tier-3 .conveyor-track {
  top: 10px;
  bottom: 18px;
  background-size: 46px 100%;
  border-top: 3px solid #00d2d3;
}

.conveyor-stage[data-width-tier="3"] .conveyor-hazard-trim,
.conveyor-lane.width-tier-3 .conveyor-hazard-trim {
  bottom: 7px;
  height: 9px;
}

.conveyor-lane.lane-saturated {
  border-color: #ef4444 !important;
  box-shadow: inset 0 0 16px rgba(239, 68, 68, 0.4), 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.lane-jam-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(231, 76, 60, 0.95);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 10px;
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
  animation: pulseJam 1.2s infinite ease-in-out;
  white-space: nowrap;
}

@keyframes pulseJam {
  0% { transform: translateX(-50%) scale(0.96); opacity: 0.85; }
  50% { transform: translateX(-50%) scale(1.04); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.96); opacity: 0.85; }
}

/* 1. 좌측 투입구 (LINE 0X + Glowing Chevron Arrow + Status LED) */
.lane-chute.entrance {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--chute-w, 52px);
  z-index: 6;
  background: linear-gradient(90deg, #1f2736 0%, #151b26 90%, transparent 100%);
  border-right: 2px solid #38465f;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 4px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.6);
  transition: width 0.35s ease;
}

.chute-line-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.chute-line-sub {
  font-size: 0.54rem;
  font-weight: 800;
  color: #8b9bb4;
  letter-spacing: 0.5px;
}

.chute-line-num {
  font-family: var(--font-mono);
  font-size: 0.80rem;
  font-weight: 900;
  color: #ffaa48;
}

.chute-dir-arrow {
  font-size: 0.88rem;
  font-weight: 900;
  color: #00d2d3;
  text-shadow: 0 0 8px #00d2d3;
  animation: arrowPulse 1.2s infinite ease-in-out;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(2px); }
}

.chute-status-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c997;
  box-shadow: 0 0 8px #20c997;
}

/* 2. 움직이는 벨트 표면 (고무 트레드 스크롤) */
.conveyor-track {
  position: absolute;
  top: 6px;
  bottom: 12px;
  left: var(--chute-w, 52px);
  right: var(--chute-w, 52px);
  border-radius: 4px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    #181d26 0px,
    #181d26 14px,
    #252c39 14px,
    #252c39 28px
  );
  background-size: 28px 100%;
  animation: beltTreadScroll 0.9s linear infinite;
  border-top: 2px solid #3a475d;
  border-bottom: 2px solid #141720;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8);
  transition: left 0.35s ease, right 0.35s ease, top 0.35s ease, bottom 0.35s ease;
}

@keyframes beltTreadScroll {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

/* 3. 하단 안전 주의 줄무늬 트림 (Yellow & Black Hazard Warning Stripes) */
.conveyor-hazard-trim {
  position: absolute;
  bottom: 5px;
  left: var(--chute-w, 52px);
  right: var(--chute-w, 52px);
  height: 5px;
  z-index: 4;
  border-radius: 2px;
  background: repeating-linear-gradient(
    -45deg,
    #f59f00 0px,
    #f59f00 7px,
    #18181b 7px,
    #18181b 14px
  );
  border-top: 1px solid #283141;
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: left 0.35s ease, right 0.35s ease, bottom 0.35s ease, height 0.35s ease;
}

/* 4. 우측 파쇄기 배출구 (Heavy Crimson Red Crusher Box with Rivets & Vertical '분쇄기') */
.lane-chute.exit {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--chute-w, 52px);
  z-index: 6;
  background: linear-gradient(135deg, #881337 0%, #4c0519 100%);
  border-left: 2px solid #f43f5e;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 0 12px rgba(244, 63, 94, 0.4), inset 0 0 12px rgba(0, 0, 0, 0.7);
  transition: width 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

.crusher-plate {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crusher-rivet {
  position: absolute;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #d1d5db;
  box-shadow: inset 0 1px 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.8);
}

.crusher-rivet.top-left { top: 4px; left: 4px; }
.crusher-rivet.top-right { top: 4px; right: 4px; }
.crusher-rivet.bottom-left { bottom: 4px; left: 4px; }
.crusher-rivet.bottom-right { bottom: 4px; right: 4px; }

.crusher-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: #ffe4e6;
  text-shadow: 0 0 8px rgba(255, 100, 100, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* 바닥 산업 안전 마킹 덱 */
.stage-floor-deck {
  height: 22px;
  width: 100%;
  background: #11141c;
  border-top: 2px solid #242c3c;
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
  z-index: 3;
}

.floor-hazard-stripes {
  width: 100%;
  height: 7px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    -45deg,
    #f59f00 0px,
    #f59f00 10px,
    #18181b 10px,
    #18181b 20px
  );
  border-top: 1px solid #2f3849;
  border-bottom: 1px solid #000;
}

/* 레인 아이템 레이어 */
.lane-items-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--chute-w, 52px);
  right: var(--chute-w, 52px);
  overflow: visible;
  pointer-events: none;
  transition: left 0.35s ease, right 0.35s ease;
}

/* ==========================================================================
   컨베이어 이동 폐기물 물품 (Conveyor Waste Item)
   ========================================================================== */
/* 기본 폐기물 물품 (T1~T6: 축소된 기본 규격 벨트에 맞춘 콤팩트 사이즈 - 이전의 약 57%) */
.conveyor-item {
  position: absolute;
  top: 50%;
  transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px)));
  width: 70px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  cursor: crosshair;
  pointer-events: auto;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.05s ease-out, filter 0.15s ease;
  z-index: 10;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 2단계 컨베이어 전용 중대형 폐기물 (T7 드럼세탁기, T8 폐차) */
.conveyor-item.item-tier-wide {
  width: 110px;
  height: 75px;
}
.conveyor-item.item-tier-wide .target-img-container {
  transform: none;
}

/* 3단계 컨베이어 전용 초광폭 메가 폐기물 (T9 고장 전차, T10 추락 UFO) */
.conveyor-item.item-tier-mega {
  width: 155px;
  height: 108px;
}
.conveyor-item.item-tier-mega .target-img-container {
  transform: none;
}

.conveyor-item:hover .item-visual-wrap {
  filter: drop-shadow(0 0 14px rgba(255, 146, 43, 0.9)) brightness(1.12);
}

.conveyor-item:active {
  transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(0.95);
}

.conveyor-item.hit-wobble {
  animation: itemPunch 0.08s ease-in-out;
}

@keyframes itemPunch {
  0% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(1.0); }
  50% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(0.94) rotate(-2deg); }
  100% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(1.0); }
}

.conveyor-item.target-destroying {
  animation: itemDestroy 0.25s forwards ease-out;
  pointer-events: none;
}

@keyframes itemDestroy {
  0% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(1.0); filter: brightness(2.5) contrast(1.5); }
  45% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(1.15) rotate(5deg); opacity: 0.8; }
  100% { transform: translate(-50%, calc(-50% + var(--item-offset-y, 0px))) scale(0.3) rotate(-15deg); opacity: 0; filter: brightness(4); }
}

/* 상단 메타 바 (플로팅 티어 뱃지 + 미니 체력바) - 기본 T1~T6 콤팩트 */
.item-meta-bar {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(13, 17, 23, 0.90);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  z-index: 12;
  white-space: nowrap;
  pointer-events: none;
}

.conveyor-item.item-tier-wide .item-meta-bar {
  top: -8px;
  gap: 4px;
  padding: 1.5px 5.5px;
  border-radius: 5px;
}

.conveyor-item.item-tier-mega .item-meta-bar {
  top: -10px;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
}

.item-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  font-size: 0.58rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.5px 3.5px;
  border-radius: 3px;
  line-height: 1.2;
}

.conveyor-item.item-tier-wide .item-tier-badge {
  font-size: 0.66rem;
  padding: 1px 4.5px;
  border-radius: 4px;
}

.conveyor-item.item-tier-mega .item-tier-badge {
  font-size: 0.74rem;
  padding: 1.5px 5.5px;
  border-radius: 4px;
}

.item-tier-badge .badge-crown {
  font-size: 0.60rem;
  line-height: 1;
  display: inline-block;
}

.conveyor-item.item-tier-wide .item-tier-badge .badge-crown {
  font-size: 0.70rem;
}

.conveyor-item.item-tier-mega .item-tier-badge .badge-crown {
  font-size: 0.78rem;
}

.tier-1-badge { background: #495057; }
.tier-2-badge { background: #1971c2; }
.tier-3-badge { background: #099268; }
.tier-4-badge { background: #d9480f; }
.tier-5-badge { background: #e03131; box-shadow: 0 0 8px rgba(224, 49, 49, 0.8); }
.tier-6-badge { background: #0284c7; box-shadow: 0 0 8px rgba(56, 189, 248, 0.6); }
.tier-7-badge { background: #7c3aed; box-shadow: 0 0 8px rgba(167, 139, 250, 0.6); }
.tier-8-badge { background: #e11d48; box-shadow: 0 0 8px rgba(251, 113, 133, 0.6); }
.tier-9-badge { background: #ea580c; box-shadow: 0 0 8px rgba(249, 115, 22, 0.6); }
.tier-10-badge { background: #c026d3; box-shadow: 0 0 10px rgba(232, 121, 249, 0.8); }

/* 미니 체력 바 - T1~T6 콤팩트 기본 */
.item-hp-mini-bar {
  width: 26px;
  height: 3px;
  background: rgba(10, 14, 20, 0.9);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}

.conveyor-item.item-tier-wide .item-hp-mini-bar {
  width: 36px;
  height: 4px;
}

.conveyor-item.item-tier-mega .item-hp-mini-bar {
  width: 46px;
  height: 5px;
}

.item-hp-mini-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff7a45, #ff4d4f);
  border-radius: 2px;
  transition: width 0.05s ease-out;
}

/* 희귀도별 실루엣 발광 및 메타바 커스텀 (배경/카드테두리 없음) */
/* 1. 레어 (Rare): 실루엣 블루 네온 발광 */
.conveyor-item.rarity-rare .item-visual-wrap {
  filter: drop-shadow(0 0 10px rgba(0, 123, 255, 0.85)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}

.conveyor-item.rarity-rare .item-meta-bar {
  background: rgba(6, 24, 52, 0.92);
  border-color: rgba(0, 123, 255, 0.65);
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.45);
}

.conveyor-item.rarity-rare .item-tier-badge,
.item-tier-badge.badge-rare {
  background: rgba(6, 24, 52, 0.95) !important;
  border: 1px solid #007bff !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.5) !important;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

.conveyor-item.rarity-rare .item-tier-badge .badge-crown {
  filter: hue-rotate(185deg) brightness(1.3) drop-shadow(0 0 4px #00b4d8);
  opacity: 1;
}

.conveyor-item.rarity-rare .item-hp-mini-bar {
  border-color: rgba(0, 123, 255, 0.5);
}

/* 2. 골드 (Gold): 실루엣 골든 펄스 발광 */
.conveyor-item.rarity-gold .item-visual-wrap {
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  animation: goldSilhouettePulse 2.2s infinite ease-in-out;
}

@keyframes goldSilhouettePulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(245, 159, 0, 0.75)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1.0)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  }
}

.conveyor-item.rarity-gold .item-meta-bar {
  background: rgba(48, 30, 4, 0.92);
  border-color: rgba(255, 208, 0, 0.7);
  box-shadow: 0 2px 12px rgba(255, 208, 0, 0.5);
}

.conveyor-item.rarity-gold .item-tier-badge,
.item-tier-badge.badge-gold {
  background: rgba(48, 30, 4, 0.95) !important;
  border: 1px solid #ffd000 !important;
  color: #ffd700 !important;
  box-shadow: 0 0 8px rgba(255, 208, 0, 0.5) !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.conveyor-item.rarity-gold .item-tier-badge .badge-crown {
  filter: drop-shadow(0 0 6px #ffd700);
  opacity: 1;
}

.conveyor-item.rarity-gold .item-hp-mini-bar {
  border-color: rgba(245, 159, 0, 0.55);
}

/* 일반 티어 뱃지 */
.conveyor-item:not(.rarity-rare):not(.rarity-gold) .item-tier-badge,
.item-tier-badge.badge-normal {
  background: rgba(18, 24, 34, 0.9) !important;
  border: 1px solid #38465c !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.conveyor-item:not(.rarity-rare):not(.rarity-gold) .item-tier-badge .badge-crown {
  filter: grayscale(1) brightness(1.2);
  opacity: 0.85;
}

.item-visual-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  transition: filter 0.05s ease;
}

.item-visual-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.target-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  transition: filter 0.05s ease;
}

.target-svg.hit-flash {
  filter: brightness(1.6) drop-shadow(0 0 15px rgba(255, 146, 43, 0.8));
}

/* 실사/일러스트 이미지 기반 대상 렌더링 (배경 및 테두리 완전 제거) */
.target-img-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.target-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  transition: filter 0.05s ease, transform 0.05s ease;
}

.target-img.hit-flash {
  filter: brightness(1.7) contrast(1.2) drop-shadow(0 0 16px rgba(255, 146, 43, 0.95)) !important;
}

/* 파손 균열 SVG 오버레이 */
.item-crack-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

/* ==========================================================================
   우측 사이드바 패널 (Tabs & Upgrades Panel)
   ========================================================================== */
.sidebar-panel {
  width: 380px;
  min-width: 330px;
  max-width: 400px;
  background: #11141b;
  border-left: 2px solid #202634;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  box-shadow: inset 2px 0 10px rgba(0, 0, 0, 0.4);
}

/* 사이드바 상단 재화 대형 디스플레이 (고철 & 보석) */
.sidebar-currency-hub {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  background: #0b0e14;
  border-bottom: 2px solid #202634;
}

.currency-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #131822;
  border: 1px solid #222c3d;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.currency-card:hover {
  transform: translateY(-1px);
}

.currency-card.currency-scrap {
  border-left: 3px solid #f59f00;
  background: linear-gradient(135deg, rgba(245, 159, 0, 0.08) 0%, #131822 65%);
}

.currency-card.currency-gem {
  border-left: 3px solid #00f2fe;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, #131822 65%);
}

.currency-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.currency-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.currency-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1px;
}

.currency-amount {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency-card.currency-scrap .currency-amount {
  color: #ffd43b;
  text-shadow: 0 0 12px rgba(255, 212, 59, 0.45);
}

.currency-card.currency-gem .currency-amount {
  color: #00f2fe;
  text-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

/* 탭 헤더 바 (Reference Mockup: Solid Orange Gradient for Active Tab) */
.panel-tabs {
  display: flex;
  background: #0c0f16;
  border-bottom: 2px solid #202634;
}

.tab-btn {
  flex: 1;
  padding: 11px 8px;
  background: #151922;
  border: none;
  border-bottom: 3px solid transparent;
  color: #8b949e;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #e2e8f0;
  background: #1a202c;
}

.tab-btn.active {
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  color: #ffffff;
  font-weight: 800;
  border-bottom: 3px solid #ffaa48;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
}

/* 일괄 구매 배율 선택기 (x1, x10, x100) */
.bulk-buy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: #11141b;
  border-bottom: 1px solid #202634;
}

.bulk-buy-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bulk-btn-group {
  display: flex;
  gap: 4px;
}

.bulk-btn {
  background: #161b24;
  border: 1px solid #263042;
  color: #8b949e;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-btn:hover {
  border-color: #ff922b;
  color: #f1f5f9;
  background: #1e2430;
}

.bulk-btn.active {
  background: rgba(255, 146, 43, 0.2);
  border-color: #ff922b;
  color: #ffaa48;
  box-shadow: 0 0 8px rgba(255, 146, 43, 0.3);
}

/* 탭 컨텐츠 뷰 컨테이너 */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 60px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab-content::-webkit-scrollbar {
  width: 5px;
}

.tab-content::-webkit-scrollbar-thumb {
  background: #283142;
  border-radius: 3px;
}

/* 업그레이드 카드 디자인 */
.upgrade-card {
  background: #161b24;
  border: 1px solid #273142;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.upgrade-card:hover {
  border-color: #3d4a61;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  z-index: 25;
}

/* 배너 느낌표 (!) 상세 툴팁 버튼 */
.card-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #94a3b8;
  font-size: 0.70rem;
  font-weight: 800;
  cursor: help;
  user-select: none;
  margin-left: 6px;
  position: static;
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.card-info-btn:hover,
.card-info-btn:focus {
  background: var(--accent-orange, #ff9f43);
  color: #0f172a;
  border-color: var(--accent-orange, #ff9f43);
  box-shadow: 0 0 10px rgba(255, 159, 67, 0.5);
}

.card-info-tooltip {
  display: none;
  position: absolute;
  top: 42px;
  left: 8px;
  right: 8px;
  background: #0f141f;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: normal;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 1000;
  pointer-events: auto;
  word-break: keep-all;
  white-space: normal;
  text-align: left;
}

.card-info-tooltip strong {
  color: #f8fafc;
}

.card-info-tooltip .tooltip-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ff9f43;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-info-tooltip .tooltip-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.card-info-btn:hover .card-info-tooltip,
.card-info-btn:focus .card-info-tooltip {
  display: block;
}

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

.upgrade-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upgrade-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #2d3748;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.upgrade-title-group {
  display: flex;
  flex-direction: column;
}

.upgrade-name {
  font-size: 0.90rem;
  font-weight: 800;
  color: #f1f5f9;
}

.upgrade-tier-pill {
  font-size: 0.70rem;
  font-weight: 700;
  color: #ffaa48;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.upgrade-level-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: #00d2d3;
  background: rgba(0, 210, 211, 0.12);
  border: 1px solid rgba(0, 210, 211, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}

.upgrade-desc {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.35;
}

.upgrade-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #202634;
}

.upgrade-stat-preview {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: #00d2d3;
}

.upgrade-buy-btn {
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-weight: 800;
  font-size: 0.80rem;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.35);
  transition: all 0.15s ease;
}

.upgrade-buy-btn:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.upgrade-buy-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.upgrade-buy-btn:disabled {
  background: #21262d;
  color: #6e7681;
  border: 1px solid #30363d;
  cursor: not-allowed;
  box-shadow: none;
}



/* ==========================================================================
   알림 토스트 & 모달
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(18, 22, 28, 0.95);
  border: 1px solid var(--accent-orange);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 15px rgba(255, 146, 43, 0.3);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.3s ease-out;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   모달 다이얼로그 (초기화 및 통계 확인)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #30363d;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.stat-item strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.stat-item-lang {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.lang-switch-buttons {
  display: flex;
  gap: 6px;
}

.lang-btn {
  background: #151f2e;
  border: 1px solid #243448;
  color: #94a3b8;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  border-color: #38bdf8;
  color: #fff;
}

.lang-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger {
  background: #c92a2a;
  border: 1px solid #ff6b6b;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  border: 1px solid #ff922b;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   관리자 모드 및 자동화 일꾼단 스타일
   ========================================================================== */

/* 헤더 관리자 토글 버튼 */
.dev-toggle-btn {
  background: rgba(255, 71, 87, 0.15) !important;
  border-color: rgba(255, 71, 87, 0.5) !important;
  color: #ff6b6b !important;
}

.dev-toggle-btn:hover {
  background: rgba(255, 71, 87, 0.3) !important;
  border-color: #ff4757 !important;
  transform: rotate(30deg);
}

/* 관리자 모드 활성 알림 배너 */
.admin-banner-bar {
  background: linear-gradient(90deg, rgba(255, 71, 87, 0.25) 0%, rgba(26, 18, 20, 0.95) 100%);
  border-bottom: 2px solid #ff4757;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 90;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.admin-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4757;
  box-shadow: 0 0 10px #ff4757;
  animation: adminPulse 0.8s infinite alternate ease-in-out;
}

@keyframes adminPulse {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.admin-banner-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: 0.3px;
}

.admin-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-mini-action-btn {
  background: rgba(255, 71, 87, 0.2);
  border: 1px solid #ff4757;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-mini-action-btn:hover {
  background: #ff4757;
  color: #ffffff;
}

.admin-mini-action-btn.btn-exit {
  background: rgba(110, 118, 129, 0.2);
  border-color: #6e7681;
  color: #c9d1d9;
}

.admin-mini-action-btn.btn-exit:hover {
  background: #6e7681;
  color: #ffffff;
}

/* 자동화 총 화력 요약 대시보드 카드 */
.automation-summary-card {
  background: linear-gradient(135deg, rgba(32, 201, 151, 0.12) 0%, rgba(14, 17, 23, 0.8) 100%);
  border: 1px solid rgba(32, 201, 151, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.summary-dps-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(32, 201, 151, 0.4);
}

.summary-breakdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

.summary-breakdown strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* 자동화 일꾼단 관리 카드 */
.workforce-card {
  background: var(--bg-card);
  border: 1px solid #3d444d;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: visible;
  z-index: 1;
}

.workforce-card:hover {
  z-index: 25;
}

.workforce-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workforce-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workforce-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.workforce-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.workforce-tier-tag {
  font-size: 0.72rem;
  color: var(--accent-orange);
  font-weight: 700;
}

.workforce-count-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255, 146, 43, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 146, 43, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.workforce-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.workforce-spec-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px;
  border-radius: 6px;
}

.workforce-diff-box {
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid rgba(255, 146, 43, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.diff-title {
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 2px;
}

.diff-item {
  color: #94a3b8;
  line-height: 1.35;
}

.diff-item strong {
  color: #f8fafc;
}

.spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spec-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.workforce-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.workforce-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.workforce-btn.btn-hire {
  background: linear-gradient(180deg, #20c997 0%, #099268 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(32, 201, 151, 0.3);
}

.workforce-btn.btn-hire:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.workforce-btn.btn-promote {
  background: linear-gradient(180deg, #ff922b 0%, #e67e22 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 146, 43, 0.3);
}

.workforce-btn.btn-promote:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.workforce-btn:disabled {
  background: #21262d;
  color: #6e7681;
  border: 1px solid #30363d;
  cursor: not-allowed;
  box-shadow: none;
}

/* 관리자 모달 전용 스타일 */
.admin-modal-box {
  max-width: 520px;
  border-color: #ff4757;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 71, 87, 0.25);
}

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

.modal-close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.modal-close-x:hover {
  color: #ffffff;
}

.admin-sections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
}

.admin-section-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-orange);
}

.admin-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-action-btn:hover {
  background: #30363d;
  border-color: #58a6ff;
  color: #ffffff;
  transform: translateY(-1px);
}

.admin-action-btn.btn-highlight {
  background: linear-gradient(180deg, #ff4757 0%, #d63031 100%);
  border-color: #ff4757;
  color: #ffffff;
}

.admin-action-btn.btn-warn {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.admin-action-btn.btn-warn:hover {
  background: #ff4757;
  color: #ffffff;
}

/* 일꾼 정원 확장 버튼 (+5 최대치) */
.workforce-btn.btn-expand-cap {
  background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.workforce-btn.btn-expand-cap:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* 로봇 연구소/배치 관리 카드 */
.robot-lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: visible;
  transition: border-color 0.2s ease;
  z-index: 1;
}

.robot-lab-card:hover {
  z-index: 25;
}

.robot-lab-card.unlocked {
  border-color: rgba(0, 210, 211, 0.4);
  box-shadow: 0 0 16px rgba(0, 210, 211, 0.1);
}

.robot-locked-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(14, 17, 23, 0.9);
  border: 1px dashed #4a5568;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  gap: 6px;
}

.robot-locked-icon {
  font-size: 2.0rem;
}

.robot-locked-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-gold);
}

.robot-locked-req {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* 초고출력 레이저 분쇄 로봇 카드 */
.laser-bot-card {
  border-color: rgba(0, 242, 254, 0.25);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.06) 0%, var(--bg-card) 100%);
}

.laser-bot-card.ready {
  border-color: rgba(0, 242, 254, 0.7);
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.2);
}

.laser-bot-card.unlocked {
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.btn-laser-action {
  background: linear-gradient(180deg, #00f2fe 0%, #00b4d8 100%);
  color: #041b2d;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.35);
}

.btn-laser-action:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-laser-gem-upgrade {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.btn-laser-gem-upgrade:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* 관리자 모달 디버그 모니터 */
.admin-debug-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: #38bdf8;
}

.admin-luck-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.luck-stat-item {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}

.luck-stat-item.luck-stat-full {
  grid-column: span 2;
}

.luck-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.luck-stat-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.luck-probs-list {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #38bdf8;
  margin-top: 4px;
  word-break: break-all;
}

/* ==========================================================================
   모바일 최적화 (반응형 레이아웃)
   ========================================================================== */
.conveyor-stage {
  touch-action: manipulation;
}

.tab-content {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  #app-shake-container {
    height: auto;
    min-height: 100vh;
  }

  .header-bar {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-stats-bar {
    order: 3;
    width: 100%;
    margin: 4px 0 0 0;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .currency-hub {
    margin-left: auto;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .scrap-amount {
    font-size: 1.3rem;
  }

  .main-content {
    flex-direction: column;
    overflow: visible;
    height: auto;
  }

  .workers-zone {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: none;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }

  .factory-zone {
    flex: none;
    min-height: 420px;
    padding: 10px 8px;
    gap: 8px;
  }

  .conveyor-stage {
    min-height: 280px;
    max-height: 520px;
    padding: 8px 6px;
    gap: 8px;
    --chute-w: 46px;
    --lane-h: 56px;
  }

  .conveyor-stage[data-width-tier="1"] {
    --chute-w: 46px;
    --lane-h: 56px;
  }

  .conveyor-stage[data-width-tier="2"] {
    --chute-w: 58px;
    --lane-h: 88px;
  }

  .conveyor-stage[data-width-tier="3"] {
    --chute-w: 70px;
    --lane-h: 124px;
  }

  .item-meta-bar {
    transform: scale(0.9);
  }

  .sidebar-panel {
    max-width: 100%;
    flex: none;
    height: 480px;
    border-left: none;
    border-top: 2px solid var(--border-color);
  }
}



