/* ============================================================
   INDUSTRIA 2.0 — Clean Dark Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

:root {
  --bg:      #07090e;
  --bg2:     #0d1118;
  --bg3:     #131922;
  --bg4:     #1a2130;
  --border:  #1e2d40;
  --border2: #2a3f58;
  --text:    #c8d8e8;
  --text2:   #5a7a9a;
  --accent:  #00d4ff;
  --accent2: #006688;
  --green:   #00ff88;
  --red:     #ff3355;
  --gold:    #ffd700;
  --purple:  #cc88ff;
  --pixel:   'Press Start 2P', monospace;
  --mono:    'Share Tech Mono', monospace;
  --r:       6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: var(--mono); color: var(--text); font-size: 13px; line-height: 1.5; }
body::after { content:''; position:fixed; inset:0; background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.03) 2px,rgba(0,0,0,0.03) 4px); pointer-events:none; z-index:9999; }

/* ── APP GRID ──────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: 52px auto 1fr;
  grid-template-columns: 200px 1fr 260px;
  grid-template-areas: "header header header" "flash flash flash" "sidebar main right";
  height: 100vh; width: 100vw; overflow: hidden;
}

/* ── HEADER ──────────────────────────────────────────── */
#header {
  grid-area: header;
  background: var(--bg2); border-bottom: 2px solid var(--accent2);
  display: flex; align-items: center; padding: 0 18px; gap: 14px;
}
.game-title { font-family: var(--pixel); font-size: 12px; color: var(--accent); text-shadow: 0 0 12px var(--accent); letter-spacing: 2px; flex-shrink: 0; }
.hdr-divider { width: 1px; height: 28px; background: var(--border2); }
.hdr-stats { display: flex; gap: 8px; align-items: center; flex: 1; }
.stat-chip { display: flex; align-items: center; gap: 6px; background: var(--bg3); border: 1px solid var(--border2); padding: 4px 10px; border-radius: var(--r); }
.stat-chip .label { color: var(--text2); font-size: 10px; }
.stat-chip .val { color: var(--accent); font-family: var(--pixel); font-size: 9px; }
.season-chip { font-family: var(--pixel); font-size: 8px; color: var(--gold); background: var(--bg3); border: 1px solid #3a2a00; padding: 4px 10px; border-radius: var(--r); }
.daily-chip  { font-family: var(--pixel); font-size: 8px; color: var(--green); background: var(--bg3); border: 1px solid #003a00; padding: 4px 10px; border-radius: var(--r); cursor: pointer; }
.hdr-right { margin-left: auto; }
#btn-settings { background: none; border: 1px solid var(--border2); color: var(--text2); cursor: pointer; padding: 5px 9px; border-radius: var(--r); font-size: 15px; transition: all 0.2s; }
#btn-settings:hover { border-color: var(--accent); color: var(--accent); }

/* ── FLASH BANNER ──────────────────────────────────────── */
#flash-banner {
  grid-area: flash;
  background: linear-gradient(90deg,#1a0a00,#2a1400,#1a0a00);
  border-bottom: 2px solid var(--gold);
  padding: 7px 20px; font-size: 11px; color: var(--gold);
  text-align: center; animation: flashPulse 2s ease-in-out infinite;
}
#flash-banner.hidden { display: none; }
@keyframes flashPulse { 0%,100%{opacity:0.8;} 50%{opacity:1;} }
.flash-timer { font-family: var(--pixel); font-size: 8px; color: var(--red); margin-left: 8px; }

/* ── SIDEBAR ──────────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-section-label { font-family: var(--pixel); font-size: 7px; color: var(--text2); padding: 14px 14px 6px; letter-spacing: 1px; }
#nav { display: flex; flex-direction: column; gap: 3px; padding: 0 8px; }
.nav-btn { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: none; border: 1px solid transparent; color: var(--text2); cursor: pointer; font-family: var(--pixel); font-size: 7px; border-radius: var(--r); transition: all 0.15s; text-align: left; }
.nav-btn .nav-icon { font-size: 16px; flex-shrink: 0; }
.nav-btn:hover  { color: var(--text); background: var(--bg3); border-color: var(--border); }
.nav-btn.active { color: var(--accent); background: #001a2e; border-color: var(--accent2); }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); font-size: 9px; color: var(--text2); font-family: var(--pixel); text-align: center; }

/* ── MAIN ─────────────────────────────────────────────── */
#main-content { grid-area: main; overflow-y: auto; overflow-x: hidden; background: var(--bg); scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
#factory-content { padding: 20px; min-height: 100%; }

/* ── RIGHT PANEL ──────────────────────────────────────── */
#right-panel { grid-area: right; background: var(--bg2); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.rp-header { font-family: var(--pixel); font-size: 8px; color: var(--accent); padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
#mini-leaderboard { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.lb-cat-tabs { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.lb-cat-btn { font-family: var(--pixel); font-size: 7px; padding: 4px 8px; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; border-radius: 3px; transition: all 0.15s; }
.lb-cat-btn.active { border-color: var(--accent); color: var(--accent); background: #001a2e; }
.lb-rows { padding: 4px; }
.mini-rank-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 3px; border: 1px solid transparent; margin-bottom: 2px; font-size: 10px; }
.mini-rank-row.is-player { background: #1a1400; border-color: var(--gold); }
.mini-rank-row.retaliating { background: #200010; border-color: var(--red); }
.mini-rank-pos { width: 20px; font-family: var(--pixel); font-size: 6px; color: var(--text2); flex-shrink: 0; text-align: center; }
.mini-rank-flag { font-size: 13px; flex-shrink: 0; }
.mini-rank-name { flex: 1; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-rank-rep { font-family: var(--pixel); font-size: 6px; color: var(--gold); flex-shrink: 0; }
.rp-section-label { font-family: var(--pixel); font-size: 6px; color: var(--text2); padding: 8px 10px 4px; letter-spacing: 1px; }
.news-feed { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.news-item { font-size: 9px; color: var(--text); padding: 4px 8px; background: var(--bg3); border-left: 2px solid var(--accent2); border-radius: 0 3px 3px 0; line-height: 1.4; }
.news-item.muted { color: var(--text2); border-left-color: var(--border); }
.rp-factory-stats { border-top: 1px solid var(--border); flex-shrink: 0; }

/* ── FACTORY FLOOR ──────────────────────────────────────── */
.floor-content { display: flex; flex-direction: column; gap: 12px; }
.synergy-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); }
.syn-badge { font-size: 9px; padding: 3px 8px; background: #001a10; border: 1px solid var(--green); border-radius: 3px; color: var(--green); }
.syn-badge.gold { background: #1a1400; border-color: var(--gold); color: var(--gold); }
.syn-badge.red  { background: #1a0010; border-color: var(--red);  color: var(--red); }

.factory-floor { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }

.factory-card {
  width: 220px; flex-shrink: 0;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s;
}
.factory-card:hover { border-color: var(--border2); }
.factory-card.broken { border-color: var(--red); background: #180010; }
.factory-card.stalled { border-color: var(--gold); opacity: 0.8; }

.fc-header { display: flex; align-items: center; gap: 8px; }
.fc-icon { font-size: 22px; flex-shrink: 0; }
.fc-title { flex: 1; }
.fc-name  { font-family: var(--pixel); font-size: 8px; }
.fc-level { font-size: 9px; color: var(--text2); }
.fc-grade { font-family: var(--pixel); font-size: 14px; flex-shrink: 0; }

.fc-tank-row { display: flex; gap: 10px; }
.fc-tank { width: 40px; height: 70px; border: 1px solid var(--border2); background: var(--bg3); border-radius: 4px; position: relative; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fc-tank-fill { position: absolute; bottom: 0; left: 0; right: 0; border-top: 1px solid; transition: height 0.5s; }
.fc-tank-val { position: relative; z-index: 1; font-family: var(--pixel); font-size: 5px; color: #fff; text-shadow: 0 0 6px #000; text-align: center; line-height: 1.4; }
.fc-stats { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.fc-stat  { display: flex; justify-content: space-between; font-size: 9px; }
.fc-stat span { color: var(--text2); }
.fc-stat strong { font-size: 9px; }
.fc-wear { display: flex; align-items: center; gap: 5px; font-size: 9px; }
.fc-wear-bar { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.fc-wear-bar div { height: 100%; border-radius: 2px; transition: width 1s linear; }

.fc-stalled { font-family: var(--pixel); font-size: 7px; color: var(--gold); text-align: center; padding: 3px; background: #1a1400; border-radius: 3px; }
.fc-booster-active { font-size: 9px; color: var(--purple); background: #100020; border: 1px solid var(--purple); border-radius: 3px; padding: 3px 6px; text-align: center; }

.fc-research { display: flex; flex-direction: column; gap: 3px; }
.fc-research-bar { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; border: 1px solid var(--border); }
.fc-research-label { font-size: 8px; color: var(--accent); font-family: var(--pixel); }

.fc-managers { display: flex; flex-direction: column; gap: 4px; }
.fc-mgr-slot { padding: 6px 8px; background: var(--bg3); border: 1px dashed var(--border2); border-radius: 3px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 9px; transition: all 0.15s; }
.fc-mgr-slot:hover { border-color: var(--accent); }
.fc-mgr-slot.filled { border-style: solid; border-color: var(--accent2); background: #001a2e; }
.mgr-empty { color: var(--text2); font-style: italic; }
.mgr-icon { font-size: 14px; }
.mgr-name { font-size: 9px; flex: 1; }

.fc-actions { display: flex; gap: 6px; }

/* ── ADD SLOT ──────────────────────────────────────────── */
.add-slot-card {
  width: 220px; flex-shrink: 0;
  background: var(--bg2); border: 2px dashed var(--border2);
  border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.add-slot-header { font-family: var(--pixel); font-size: 9px; color: var(--text2); text-align: center; margin-bottom: 4px; }
.add-factory-option { display: flex; flex-direction: column; gap: 3px; padding: 10px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; text-align: left; transition: all 0.15s; }
.add-factory-option:hover { border-color: var(--accent); background: #001a2e; }
.af-icon { font-size: 20px; }
.af-name { font-family: var(--pixel); font-size: 8px; }
.af-cost { color: var(--green); font-family: var(--pixel); font-size: 8px; }
.af-desc { font-size: 9px; color: var(--text2); }
.add-factory-locked { font-size: 9px; padding: 6px; border-radius: 3px; background: var(--bg3); }
.locked-factories { display: flex; flex-direction: column; gap: 4px; }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--bg2); border: 2px solid var(--border2); border-radius: 8px; padding: 22px; width: 100%; max-width: 380px; }
.modal-wide { max-width: 560px; }
.modal h2 { font-family: var(--pixel); font-size: 10px; color: var(--accent); margin-bottom: 16px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h2 { margin-bottom: 0; }
.modal-close { background: none; border: 1px solid var(--border2); color: var(--text2); cursor: pointer; padding: 4px 8px; border-radius: 3px; font-size: 13px; }
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.btn-danger { background: #440011; border-color: var(--red); color: var(--red); }
.btn-danger:hover:not([disabled]) { background: #660022; }

/* Detail modal */
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-sub { font-family: var(--pixel); font-size: 8px; color: var(--accent); margin: 12px 0 8px; }
.booster-list { display: flex; flex-direction: column; gap: 6px; }
.booster-btn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; font-size: 10px; text-align: left; transition: all 0.15s; background: var(--bg3); color: var(--text); }
.booster-btn:hover { border-color: var(--accent); }
.manager-picker { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.manager-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; text-align: left; background: var(--bg3); color: var(--text); transition: all 0.15s; }
.manager-option:hover { border-color: var(--accent); background: #001a2e; }
.manager-option.assigned { border-color: var(--green); background: #001a0a; }
.mgr-info { flex: 1; }
.mgr-eff { font-size: 9px; color: var(--text2); }

/* ── CARDS ──────────────────────────────────────────────── */
.cards-content { display: flex; flex-direction: column; gap: 16px; }
.card-collection { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; overflow: hidden; }
.card-rarity-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.card-icon { font-size: 28px; }
.card-name { font-family: var(--pixel); font-size: 7px; }
.card-rarity-label { font-size: 8px; text-transform: capitalize; }
.card-desc { font-size: 8px; color: var(--text2); }
.card-assigned { font-size: 8px; color: var(--green); }

/* Rarity colors */
.rarity-common    { border-color: #555; }
.rarity-common    .card-rarity-bar, .card-rarity-bar.rarity-common    { background: #888; }
.rarity-common    .card-rarity-label { color: #888; }
.rarity-rare      { border-color: #3366ff; }
.rarity-rare      .card-rarity-bar, .card-rarity-bar.rarity-rare      { background: #4488ff; }
.rarity-rare      .card-rarity-label { color: #4488ff; }
.rarity-epic      { border-color: var(--purple); }
.rarity-epic      .card-rarity-bar, .card-rarity-bar.rarity-epic      { background: var(--purple); }
.rarity-epic      .card-rarity-label { color: var(--purple); }
.rarity-legendary { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,215,0,0.3); }
.rarity-legendary .card-rarity-bar, .card-rarity-bar.rarity-legendary { background: var(--gold); }
.rarity-legendary .card-rarity-label { color: var(--gold); }

/* Packs */
.pack-store { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pack-icon { font-size: 32px; }
.pack-name { font-family: var(--pixel); font-size: 9px; }
.pack-info { font-size: 9px; color: var(--text2); }
.pack-cost { font-family: var(--pixel); font-size: 10px; color: var(--gold); }
.fragment-info { margin-top: 10px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); font-size: 10px; display: flex; align-items: center; gap: 10px; }

/* Pack result */
.pack-result { background: var(--bg3); border: 1px solid var(--gold); border-radius: var(--r); padding: 16px; margin-bottom: 14px; text-align: center; }
.pr-title { font-family: var(--pixel); font-size: 10px; color: var(--gold); margin-bottom: 12px; }
.pr-cards { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.pr-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; text-align: center; min-width: 80px; }
.pr-card-icon { font-size: 24px; }
.pr-card-name { font-size: 8px; margin: 4px 0 2px; }
.pr-card-rarity { font-size: 8px; text-transform: capitalize; }

/* ── RESEARCH ───────────────────────────────────────────── */
.research-factory-list { display: flex; flex-direction: column; gap: 10px; }
.research-factory-row { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.rfr-head { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.rfr-head strong { font-family: var(--pixel); font-size: 8px; }
.rfr-progress { display: flex; flex-direction: column; gap: 4px; }

/* ── ORDERS ────────────────────────────────────────────── */
.orders-content { display: flex; flex-direction: column; gap: 14px; }
.orders-header { display: flex; flex-direction: column; gap: 4px; }
.orders-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.order-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.order-card.can-fulfill { border-color: var(--green); }
.order-card.urgent { border-color: var(--red); animation: urgentPulse 1s ease-in-out infinite; }
.order-card.soon { border-color: var(--gold); }
@keyframes urgentPulse { 0%,100%{box-shadow:0 0 0 rgba(255,51,85,0);} 50%{box-shadow:0 0 10px rgba(255,51,85,0.4);} }
.order-header { display: flex; justify-content: space-between; align-items: center; }
.order-type-badge { font-family: var(--pixel); font-size: 7px; background: var(--bg3); border: 1px solid var(--border); padding: 2px 5px; border-radius: 2px; }
.order-timer { font-family: var(--pixel); font-size: 8px; color: var(--text2); }
.order-timer.urgent { color: var(--red); }
.order-timer.soon { color: var(--gold); }
.order-client { font-size: 11px; }
.order-req { display: flex; justify-content: space-between; font-size: 10px; color: var(--text2); }
.order-reward { display: flex; justify-content: space-between; align-items: center; }
.order-cash { font-family: var(--pixel); font-size: 9px; color: var(--green); }
.order-rep  { font-size: 9px; color: var(--gold); }
.order-slots { display: flex; flex-direction: column; gap: 4px; }
.order-slot-option { display: flex; align-items: center; gap: 6px; padding: 4px 7px; background: var(--bg3); border-radius: 2px; font-size: 9px; }
.order-slot-option.eligible { border-left: 2px solid var(--green); }
.order-slot-option.ineligible { border-left: 2px solid var(--border); opacity: 0.6; }
.mini-stock-bar { flex: 1; height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.mini-stock-fill { height: 100%; border-radius: 2px; }
.slot-stock-label { font-family: var(--pixel); font-size: 6px; color: var(--text2); flex-shrink: 0; }
.empty-orders { color: var(--text2); font-family: var(--pixel); font-size: 8px; padding: 20px; text-align: center; }
.flash-event-bar { background: #1a0800; border: 1px solid var(--gold); border-radius: var(--r); padding: 9px 12px; font-size: 10px; color: var(--gold); }

/* ── RANK ──────────────────────────────────────────────── */
.rank-content { display: flex; flex-direction: column; gap: 16px; }
.rank-hero { background: var(--bg2); border: 1px solid var(--accent2); border-radius: var(--r); padding: 18px; text-align: center; }
.rank-your-pos { font-family: var(--pixel); font-size: 10px; color: var(--text2); margin-bottom: 6px; }
.rank-your-pos strong { color: var(--accent); font-size: 18px; }
.rank-your-rep { font-family: var(--pixel); font-size: 9px; color: var(--gold); }
.season-timer { font-size: 10px; color: var(--text2); margin-top: 6px; }
.rank-board { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.rank-row { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); }
.rank-row.is-player { border-color: var(--gold); background: #1a1400; }
.rank-row.retaliating { border-color: var(--red); background: #200010; }
.rank-pos { width: 26px; font-family: var(--pixel); font-size: 7px; text-align: center; flex-shrink: 0; }
.rank-flag { font-size: 16px; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 10px; }
.rank-rep { font-family: var(--pixel); font-size: 7px; color: var(--gold); text-align: right; flex-shrink: 0; }
.you-badge { font-family: var(--pixel); font-size: 6px; color: var(--gold); background: #2a2000; border: 1px solid var(--gold); padding: 1px 3px; border-radius: 2px; }

/* ── DAILY ──────────────────────────────────────────────── */
.daily-content { display: flex; flex-direction: column; gap: 16px; }
.daily-header { display: flex; justify-content: space-between; align-items: center; }
.streak-badge { font-family: var(--pixel); font-size: 8px; background: #1a0a00; border: 1px solid var(--gold); padding: 5px 10px; border-radius: var(--r); }
.ms-list { display: flex; flex-direction: column; gap: 6px; }
.ms-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); }
.ms-card.done { border-color: var(--green); background: #001a0a; }
.ms-icon { font-size: 20px; flex-shrink: 0; }
.ms-info { flex: 1; }
.ms-name { font-family: var(--pixel); font-size: 8px; margin-bottom: 3px; }
.ms-desc { font-size: 9px; color: var(--text2); }
.ms-reward { font-family: var(--pixel); font-size: 7px; color: var(--gold); flex-shrink: 0; text-align: right; }
.daily-bar { height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.daily-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ── BATTLE PASS ─────────────────────────────────────────── */
.bp-content { display: flex; flex-direction: column; gap: 16px; }
.bp-header { display: flex; justify-content: space-between; align-items: center; }
.bp-xp-info { font-family: var(--pixel); font-size: 8px; color: var(--gold); }
.bp-xp-bar { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.bp-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.5s; }
.bp-tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bp-tier { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.bp-tier.claimed { border-color: var(--green); background: #001a0a; }
.bp-tier.current { border-color: var(--accent); background: #001a2e; }
.bp-tier.locked  { opacity: 0.35; }
.bp-tier-num { font-family: var(--pixel); font-size: 7px; color: var(--text2); }
.bp-tier-reward { font-size: 8px; color: var(--text); line-height: 1.3; }
.bp-check { font-family: var(--pixel); font-size: 9px; color: var(--green); }

/* ── TROPHIES ─────────────────────────────────────────────── */
.trophies-content { display: flex; flex-direction: column; gap: 20px; }
.trophy-shelf { display: flex; gap: 10px; flex-wrap: wrap; }
.trophy-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: flex; gap: 12px; align-items: center; }
.trophy-card.gold   { border-color: var(--gold); background: #1a1400; }
.trophy-card.silver { border-color: #aaa; }
.trophy-card.bronze { border-color: #cd7f32; }
.trophy-icon { font-size: 28px; }
.trophy-season { font-family: var(--pixel); font-size: 7px; color: var(--text2); }
.trophy-rank { font-family: var(--pixel); font-size: 10px; }
.trophy-rep { font-size: 9px; color: var(--gold); }

/* ── COMMON ──────────────────────────────────────────────── */
.section-title { font-family: var(--pixel); font-size: 9px; color: var(--accent); padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.section-sub { font-size: 10px; color: var(--text2); margin-top: -6px; }
.stat-rows { display: flex; flex-direction: column; gap: 5px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 11px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); font-size: 11px; }
.stat-row span { color: var(--text2); }
.stat-row strong { color: var(--text); font-size: 11px; }
.slot-tabs-row { display: flex; gap: 4px; flex-wrap: wrap; }
.slot-tab { font-family: var(--pixel); font-size: 7px; padding: 5px 10px; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; border-radius: var(--r); transition: all 0.15s; }
.slot-tab.active { border-color: var(--accent); color: var(--accent); background: #001a2e; }
.locked-badge { font-family: var(--pixel); font-size: 7px; color: var(--text2); }
.owned-badge  { font-family: var(--pixel); font-size: 7px; color: var(--green); }
.rp-bar { height: 7px; background: var(--bg3); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.rp-fill { height: 100%; background: var(--accent); transition: width 1s linear; }
.rp-time { font-size: 8px; color: var(--text2); font-family: var(--pixel); }

/* ── PIXEL BUTTONS ──────────────────────────────────────── */
.pixel-btn {
  font-family: var(--pixel); font-size: 8px; background: var(--accent2); color: #fff;
  border: 2px solid var(--accent); padding: 9px 16px; cursor: pointer; border-radius: var(--r);
  transition: all 0.1s; text-transform: uppercase;
  box-shadow: 0 3px 0 #003344; position: relative; top: 0;
}
.pixel-btn:hover:not([disabled]) { background: var(--accent); top: -2px; box-shadow: 0 5px 0 #003344; }
.pixel-btn:active:not([disabled]) { top: 3px; box-shadow: none; }
.pixel-btn.sm { font-size: 7px; padding: 5px 10px; }
.pixel-btn.disabled, .pixel-btn[disabled] { background: var(--bg3); border-color: var(--border); color: var(--text2); cursor: not-allowed; box-shadow: none; top: 0; }

/* ── TOAST ───────────────────────────────────────────────── */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg2); border: 1px solid var(--border2); color: var(--text); padding: 9px 18px; border-radius: var(--r); font-family: var(--pixel); font-size: 8px; opacity: 0; transition: all 0.3s; z-index: 1000; pointer-events: none; white-space: nowrap; }
#toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red);   color: var(--red);   }
#toast.warn    { border-color: var(--gold);  color: var(--gold);  }
#toast.info    { border-color: var(--accent);color: var(--accent);}

/* ── SCROLLBARS ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── CARD SLOTS (v2.1) ──────────────────────────────────── */
.card-slots-grid { display: flex; flex-direction: column; gap: 14px; }

.cs-section { display: flex; flex-direction: column; gap: 6px; }
.cs-section-title { font-family: var(--pixel); font-size: 8px; color: var(--text2); margin-bottom: 2px; }

.card-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--bg3);
  border: 1px dashed var(--border2); border-radius: var(--r);
  cursor: pointer; transition: all 0.15s; position: relative;
}
.card-slot:hover:not(.locked) { border-color: var(--accent); border-style: solid; background: #001a2e; }
.card-slot.filled { border-style: solid; border-color: var(--accent2); background: #001a2e; }
.card-slot.locked { opacity: 0.4; cursor: not-allowed; }

.cs-icon  { font-size: 20px; flex-shrink: 0; }
.cs-info  { flex: 1; }
.cs-label { font-family: var(--pixel); font-size: 7px; color: var(--text2); margin-bottom: 2px; }
.cs-card-name { font-family: var(--pixel); font-size: 8px; }
.cs-effect { font-size: 9px; color: var(--text2); }
.cs-empty  { font-size: 9px; color: var(--text2); font-style: italic; }
.cs-lock   { font-size: 8px; color: var(--text2); }
.cs-remove { position: absolute; right: 6px; top: 6px; background: none; border: 1px solid var(--border); color: var(--text2); cursor: pointer; padding: 2px 5px; border-radius: 2px; font-size: 9px; }
.cs-remove:hover { border-color: var(--red); color: var(--red); }

/* Rarity text colors */
.rarity-common-text    { color: #888; }
.rarity-rare-text      { color: #4488ff; }
.rarity-epic-text      { color: var(--purple); }
.rarity-legendary-text { color: var(--gold); }

/* Factory card manager display update */
.fc-mgr-slot { min-height: 28px; }

/* ── CARD SLOTS v2 ──────────────────────────────────────── */
.card-slots-grid { display:flex; flex-direction:column; gap:12px; }
.cs-section { display:flex; flex-direction:column; gap:5px; }
.cs-section-title { font-family:var(--pixel); font-size:7px; color:var(--text2); padding-bottom:3px; border-bottom:1px solid var(--border); }
.card-slot { display:flex; align-items:center; gap:10px; padding:9px 12px; background:var(--bg3); border:1px dashed var(--border2); border-radius:var(--r); cursor:pointer; transition:all 0.15s; position:relative; }
.card-slot:hover:not(.locked) { border-color:var(--accent); border-style:solid; background:#001a2e; }
.card-slot.filled { border-style:solid; border-color:var(--accent2); background:#001a2e; }
.card-slot.locked { opacity:0.4; cursor:not-allowed; }
.cs-icon  { font-size:18px; flex-shrink:0; }
.cs-info  { flex:1; min-width:0; }
.cs-label { font-size:10px; color:var(--text); }
.cs-effect { font-size:9px; color:var(--text2); margin-top:2px; }
.cs-lock  { font-size:9px; color:var(--text2); }
.cs-remove { position:absolute; right:6px; top:50%; transform:translateY(-50%); background:none; border:1px solid var(--border); color:var(--text2); cursor:pointer; padding:2px 6px; border-radius:2px; font-size:9px; }
.cs-remove:hover { border-color:var(--red); color:var(--red); }

/* Factory card summary */
.fc-card-summary { display:flex; align-items:center; gap:4px; padding:4px 0; }
.fc-card-badge { font-size:14px; opacity:0.9; }
.fc-card-badge.empty { opacity:0.25; }
.fc-slot-count { font-size:8px; color:var(--text2); margin-left:4px; }

/* Rarity text colors */
.rarity-common-text    { color:#888; }
.rarity-rare-text      { color:#4488ff; }
.rarity-epic-text      { color:var(--purple); }
.rarity-legendary-text { color:var(--gold); }
