/* ============================================================
   Dragon Engineering Lab — Visual System (Redesigned)
   Cleaner hierarchy, Basic/Advanced modes, improved readability.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Segoe UI', 'Inter', -apple-system, system-ui, sans-serif;
  background: #0a0a14;
  color: #c8ccd4;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- LAYOUT ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  background: #0e0e1a;
  border-bottom: 1px solid #1a1a2e;
  gap: 12px;
  z-index: 100;
}
.header-left { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.app-title { font-size: 14px; font-weight: 700; color: #d0d4dc; letter-spacing: -0.2px; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.app-main {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  height: calc(100vh - 44px);
  overflow: hidden;
}

/* ---- PANELS ---- */
.panel { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #1a1a2e #0a0a14; }
.panel::-webkit-scrollbar { width: 5px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: #1a1a2e; border-radius: 3px; }

.panel-left {
  background: #0c0c16;
  border-right: 1px solid #161628;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-center { position: relative; overflow: hidden; }
.panel-right {
  background: #0c0c16;
  border-left: 1px solid #161628;
  padding: 12px;
}
.canvas-container { width: 100%; height: 100%; background: #0a0a14; }

/* ---- TABS ---- */
.tab-bar { display: flex; gap: 1px; }
.tab-btn {
  background: transparent;
  border: none;
  color: #556;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.tab-btn:hover { color: #99a; background: rgba(255,255,255,0.03); }
.tab-btn.active { color: #4af0c0; background: rgba(74,240,192,0.08); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.panel-title {
  font-size: 11px;
  font-weight: 600;
  color: #667;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #161628;
}

/* ---- MODE TOGGLE GROUP ---- */
.mode-toggle-group {
  display: flex;
  background: #0e0e1a;
  border: 1px solid #2a2a3a;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}
.mode-btn {
  background: transparent;
  border: none;
  color: #445;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  white-space: nowrap;
}
.mode-btn:hover { color: #889; background: rgba(255,255,255,0.03); }
.mode-btn--active {
  background: #4af0c0;
  color: #07120e;
  cursor: default;
}
.mode-btn--active:hover { background: #4af0c0; color: #07120e; }

/* ---- BUTTONS ---- */
.action-bar { display: flex; gap: 4px; }
.action-bar-secondary { display: flex; gap: 4px; }

.btn-primary, .btn-secondary {
  border: none;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #1a8a6a, #15a080);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: linear-gradient(135deg, #20a07a, #18b890); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-secondary {
  background: #141420;
  color: #667;
  border: 1px solid #1e1e30;
  flex: 1;
}
.btn-secondary:hover { background: #1a1a2a; color: #889; }
.btn-icon {
  background: #141420;
  border: 1px solid #1e1e30;
  color: #556;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: #1a1a2a; color: #889; }

/* ---- MULTI-ZONE COLOUR SYSTEM ---- */
.color-zones-wrap { display: flex; flex-direction: column; gap: 5px; }

.color-zone-row { display: flex; gap: 5px; }

.color-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  flex: 1;
  position: relative;
}

.color-zone-lbl {
  font-size: 8px;
  font-weight: 600;
  color: #445;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.color-zone-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #1e1e30;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  display: block;
  pointer-events: none;
}

.color-zone:hover .color-zone-dot {
  border-color: #4af0c0;
  transform: scale(1.10);
  box-shadow: 0 0 8px rgba(74, 240, 192, 0.30);
}

.color-zone input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

.theme-row {
  display: flex;
  gap: 3px;
}

.theme-btn {
  flex: 1;
  height: 11px;
  border-radius: 3px;
  border: 1px solid #1e1e30;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  padding: 0;
}

.theme-btn:hover {
  border-color: #4af0c0;
  transform: scaleY(1.4);
}

.theme-btn.active {
  border-color: #4af0c0;
  box-shadow: 0 0 4px rgba(74, 240, 192, 0.4);
}

/* ---- PRESETS ---- */
.presets-section { }
.section-label { font-size: 10px; color: #445; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.presets-row { display: flex; gap: 3px; flex-wrap: wrap; }
.preset-btn {
  background: #111120;
  border: 1px solid #1e1e30;
  color: #667;
  padding: 3px 7px;
  font-size: 9px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.preset-btn:hover { background: #181828; color: #99a; border-color: #2a2a3a; }

/* ============================================================
   BASIC MODE SLIDERS
   ============================================================ */
.slider-group--basic { margin-bottom: 2px; }
.basic-slider-card {
  background: #111120;
  border: 1px solid #1a1a2e;
  border-radius: 8px;
  padding: 10px 12px;
}
.basic-slider-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.basic-slider-icon { font-size: 18px; flex-shrink: 0; }
.basic-slider-info { flex: 1; min-width: 0; }
.basic-slider-label { font-size: 12px; font-weight: 600; color: #bbc; display: block; }
.basic-slider-desc { font-size: 9px; color: #556; display: block; }
.basic-slider-value {
  font-size: 18px; font-weight: 700; color: #4af0c0;
  min-width: 24px; text-align: right;
  font-variant-numeric: tabular-nums;
}

.basic-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none; appearance: none;
  background: #1a1a2e;
  border-radius: 3px;
  outline: none;
}
.basic-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4af0c0;
  cursor: pointer;
  border: 2px solid #0c0c16;
  box-shadow: 0 0 8px rgba(74,240,192,0.3);
}
.basic-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4af0c0;
  cursor: pointer;
  border: 2px solid #0c0c16;
}

/* ============================================================
   ADVANCED MODE SLIDERS
   ============================================================ */
.slider-group--advanced { margin-bottom: 4px; }
.slider-group-label {
  font-size: 10px;
  font-weight: 600;
  color: #3a6a5a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 0;
  border-bottom: 1px solid #141428;
  margin-bottom: 2px;
}
.slider-group-label--collapsible {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2px;
  border-radius: 3px;
  transition: background 0.15s;
}
.slider-group-label--collapsible:hover { background: rgba(255,255,255,0.02); }
.collapse-arrow { font-size: 10px; color: #445; }
.slider-group-content { }
.slider-group-content.collapsed { display: none; }

.trait-slider { padding: 3px 0; }
.trait-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}
.trait-label { font-size: 11px; color: #889; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.trait-value-group { display: flex; align-items: center; gap: 5px; }
.trait-value { font-size: 13px; font-weight: 700; color: #4af0c0; min-width: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.trait-descriptor { font-size: 9px; color: #556; min-width: 50px; text-align: right; }

input[type="range"] {
  width: 100%;
  height: 3px;
  -webkit-appearance: none; appearance: none;
  background: #1a1a2e;
  border-radius: 2px;
  outline: none;
  margin: 3px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4af0c0;
  cursor: pointer;
  border: 2px solid #0c0c16;
  box-shadow: 0 0 4px rgba(74,240,192,0.2);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4af0c0;
  cursor: pointer;
  border: 2px solid #0c0c16;
}

.info-btn {
  background: rgba(74,240,192,0.08);
  border: 1px solid rgba(74,240,192,0.15);
  color: #4af0c0;
  width: 13px; height: 13px;
  border-radius: 50%;
  font-size: 8px; font-weight: 700;
  cursor: help;
  padding: 0;
  line-height: 11px;
  text-align: center;
}

/* ---- FIRE DESIGN PANEL ---- */
.fire-design-panel { margin-top: 6px; }
.fire-section { margin-bottom: 8px; }
.fire-label { font-size: 10px; color: #889; font-weight: 500; display: flex; align-items: center; gap: 3px; margin-bottom: 3px; }
.fire-select-group { display: flex; flex-wrap: wrap; gap: 3px; }
.fire-option {
  background: #111120;
  border: 1px solid #1e1e30;
  color: #667;
  padding: 4px 6px;
  font-size: 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 62px;
  text-align: center;
}
.fire-option:hover { border-color: #3a3a4a; color: #99a; }
.fire-option.selected { border-color: #4af0c0; color: #4af0c0; background: rgba(74,240,192,0.04); }
.fire-option-icon { font-size: 13px; }
.fire-option-label { font-size: 9px; line-height: 1.2; }
.fire-option-role { font-size: 8px; color: #445; text-transform: uppercase; }

.fire-compat-display { margin-top: 6px; padding: 6px 8px; background: #0e0e1a; border-radius: 5px; }
.compat-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; font-size: 10px; }
.compat-badge { font-weight: 700; font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.compat-good { color: #4af0c0; background: rgba(74,240,192,0.08); }
.compat-ok { color: #ccaa44; background: rgba(204,170,68,0.08); }
.compat-bad { color: #ff5544; background: rgba(255,85,68,0.08); }

/* ============================================================
   RESULTS
   ============================================================ */
.results-content { display: flex; flex-direction: column; gap: 10px; }
.placeholder-text { color: #334; font-style: italic; text-align: center; padding: 24px 0; font-size: 11px; }

.classification-card {
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #1e1e30;
}
.badge-apex { background: linear-gradient(135deg, rgba(74,240,192,0.1), rgba(40,180,140,0.06)); border-color: #2a5a4a; }
.badge-excellent { background: linear-gradient(135deg, rgba(80,160,255,0.08), rgba(40,120,200,0.04)); border-color: #2a4a5a; }
.badge-good { background: linear-gradient(135deg, rgba(100,200,120,0.08), rgba(60,160,80,0.04)); border-color: #2a4a3a; }
.badge-warning { background: linear-gradient(135deg, rgba(240,200,60,0.08), rgba(200,160,40,0.04)); border-color: #4a4a2a; }
.badge-danger { background: linear-gradient(135deg, rgba(255,80,60,0.08), rgba(200,50,40,0.04)); border-color: #4a2a2a; }
.badge-neutral { background: rgba(255,255,255,0.02); }

.classification-name { font-size: 16px; font-weight: 700; color: #d8dce4; margin-bottom: 3px; }
.classification-desc { font-size: 10px; color: #667; }

.result-section {
  background: #0e0e18;
  border: 1px solid #161628;
  border-radius: 6px;
  padding: 8px 10px;
}
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.result-title { font-size: 11px; font-weight: 600; color: #99a; }
.result-subtitle { font-size: 9px; color: #556; font-style: italic; }

.result-meter { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.meter-label { font-size: 9px; color: #667; min-width: 90px; }
.meter-bar { flex: 1; height: 5px; background: #141420; border-radius: 3px; overflow: hidden; }
.meter-bar.large { height: 8px; }
.meter-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.meter-good { background: linear-gradient(90deg, #1a7a5a, #4af0c0); }
.meter-warning { background: linear-gradient(90deg, #8a7a20, #ccaa44); }
.meter-danger { background: linear-gradient(90deg, #8a2a1a, #ff5544); }
.meter-value { font-size: 10px; font-weight: 700; color: #889; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }

.result-explanations { margin-top: 6px; }
.result-detail { font-size: 10px; color: #778; margin-bottom: 3px; line-height: 1.4; }
.result-rec { font-size: 10px; color: #6a9a88; margin-bottom: 3px; line-height: 1.4; font-style: italic; }

.failure-modes {
  background: rgba(255,50,30,0.04);
  border: 1px solid rgba(255,50,30,0.12);
  border-radius: 6px;
  padding: 8px;
}
.failure-title { font-size: 10px; font-weight: 600; color: #ff5544; margin-bottom: 4px; }
.failure-item { font-size: 10px; color: #aa7766; margin-bottom: 3px; line-height: 1.3; }
.failure-icon { color: #ff5544; }

.lab-report {
  background: #0a0a14;
  border: 1px solid #161628;
  border-radius: 6px;
  padding: 10px;
}
.lab-report-title { font-size: 11px; font-weight: 600; color: #3a6a5a; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.lab-report-row { font-size: 10px; color: #778; margin-bottom: 3px; line-height: 1.4; }
.lr-label { color: #889; font-weight: 600; }
.lr-warning { color: #bb8866; }

/* ---- HABITAT ---- */
.habitat-selector { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.habitat-btn {
  background: #111120;
  border: 1px solid #1e1e30;
  color: #667;
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.habitat-btn:hover { border-color: #2a2a3a; color: #99a; }
.habitat-btn.active { border-color: #4af0c0; color: #4af0c0; background: rgba(74,240,192,0.04); }
.habitat-dot { width: 7px; height: 7px; border-radius: 50%; }

.habitat-viability { text-align: center; margin-bottom: 10px; }
.viability-label { font-size: 10px; color: #667; margin-bottom: 3px; }
.viability-score { font-size: 24px; font-weight: 700; color: #d8dce4; margin-bottom: 4px; }
.habitat-deltas { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.delta-row { display: flex; justify-content: space-between; font-size: 10px; padding: 2px 5px; border-radius: 2px; }
.delta-up { color: #4af0c0; background: rgba(74,240,192,0.03); }
.delta-down { color: #ff5544; background: rgba(255,85,68,0.03); }
.delta-neutral { color: #556; }

/* ---- BATTLE ---- */
.battle-section-title { font-size: 10px; font-weight: 600; color: #667; text-transform: uppercase; letter-spacing: 0.4px; margin: 8px 0 4px; }
.enemy-grid { display: flex; flex-direction: column; gap: 3px; }
.enemy-card {
  background: #0e0e1a;
  border: 1px solid #1e1e30;
  border-radius: 5px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  display: flex; align-items: center; gap: 6px;
}
.enemy-card:hover { border-color: #2a2a3a; }
.enemy-card.selected { border-color: #ff6644; background: rgba(255,102,68,0.04); }
.enemy-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.enemy-name { font-size: 11px; font-weight: 600; color: #aab; }
.enemy-desc { font-size: 9px; color: #445; }

.arena-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.arena-btn {
  background: #111120;
  border: 1px solid #1e1e30;
  color: #667;
  padding: 4px 8px;
  font-size: 9px;
  border-radius: 3px;
  cursor: pointer;
}
.arena-btn:hover { border-color: #2a2a3a; color: #99a; }
.arena-btn.active { border-color: #4af0c0; color: #4af0c0; }

.speed-control { display: flex; gap: 3px; }
.speed-btn {
  background: #111120;
  border: 1px solid #1e1e30;
  color: #556;
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
}
.speed-btn.active { border-color: #4af0c0; color: #4af0c0; }
.btn-start-battle { margin-top: 8px; width: 100%; }

.battle-hud { display: flex; gap: 8px; margin-bottom: 8px; }
.combatant-hud { flex: 1; background: #0e0e18; border-radius: 5px; padding: 6px; border: 1px solid #161628; }
.combatant-name { font-size: 11px; font-weight: 600; color: #aab; margin-bottom: 4px; }
.player-hud { border-left: 2px solid #4af0c0; }
.enemy-hud { border-left: 2px solid #ff5544; }
.battle-vs { font-size: 12px; font-weight: 700; color: #334; align-self: center; }

.battle-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.bar-label { font-size: 8px; color: #556; min-width: 44px; }
.bar-track { flex: 1; height: 4px; background: #141420; border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.bar-hp { background: linear-gradient(90deg, #8a2a1a, #4abb66); }
.bar-stamina { background: linear-gradient(90deg, #554400, #ccaa44); }
.bar-fire { background: linear-gradient(90deg, #772200, #ff6644); }
.bar-value { font-size: 9px; font-weight: 700; color: #778; min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.last-action { font-size: 9px; color: #445; margin-top: 3px; }

.battle-tick-counter { text-align: center; font-size: 10px; color: #445; margin-bottom: 4px; }
.battle-log {
  background: #0a0a12;
  border: 1px solid #161628;
  border-radius: 5px;
  padding: 6px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 10px;
}
.log-entry { color: #778; margin-bottom: 2px; line-height: 1.3; }
.log-tick { color: #4af0c0; font-weight: 700; margin-right: 3px; }

.battle-summary { text-align: center; padding: 10px; }
.battle-result { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.result-win { color: #4af0c0; }
.result-loss { color: #ff5544; }
.result-draw { color: #ccaa44; }
.battle-summary-text { font-size: 12px; color: #99a; margin-bottom: 10px; }
.battle-detail { font-size: 10px; color: #778; margin-bottom: 3px; text-align: left; }
.battle-recs-title { font-size: 10px; font-weight: 600; color: #6a9a88; margin: 6px 0 3px; text-align: left; }
.battle-rec { font-size: 10px; color: #6a9a88; margin-bottom: 3px; text-align: left; font-style: italic; }
.battle-summary .btn-primary, .battle-summary .btn-secondary { margin: 3px; }

/* ---- SCIENCE NOTES ---- */
.science-notes-grid { display: flex; flex-direction: column; gap: 12px; }
.science-cat-label { font-size: 10px; font-weight: 600; color: #3a6a5a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.science-note-card { background: #0e0e18; border: 1px solid #161628; border-radius: 5px; padding: 8px; margin-bottom: 4px; }
.note-title { font-size: 11px; font-weight: 600; color: #aab; margin-bottom: 3px; }
.note-content { font-size: 10px; color: #778; line-height: 1.5; }
.glossary-section { margin-top: 14px; }
.glossary-grid { display: flex; flex-direction: column; gap: 3px; }
.glossary-item { font-size: 10px; color: #667; line-height: 1.3; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.02); }

/* ---- TUTORIAL ---- */
.tutorial-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; pointer-events: none; }
.tutorial-callout {
  position: fixed;
  background: #141428;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 16px;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 40px rgba(74,240,192,0.06);
  pointer-events: all;
  z-index: 1001;
}
.tutorial-title { font-size: 14px; font-weight: 700; color: #d8dce4; margin-bottom: 6px; }
.tutorial-text { font-size: 11px; color: #889; line-height: 1.5; margin-bottom: 10px; }
.tutorial-dots { display: flex; gap: 4px; margin-bottom: 8px; justify-content: center; }
.step-dot { width: 5px; height: 5px; border-radius: 50%; background: #2a2a3a; }
.step-dot.active { background: #4af0c0; box-shadow: 0 0 4px rgba(74,240,192,0.4); }
.step-dot.done { background: #2a4a3a; }
.tutorial-buttons { display: flex; gap: 6px; justify-content: flex-end; }
.tutorial-next {
  background: linear-gradient(135deg, #1a8a6a, #15a080);
  color: #fff; border: none;
  padding: 6px 14px; border-radius: 4px;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.tutorial-skip {
  background: transparent;
  border: 1px solid #2a2a3a;
  color: #556;
  padding: 6px 10px; border-radius: 4px;
  font-size: 10px; cursor: pointer;
}
.tutorial-highlight {
  position: relative; z-index: 1002;
  box-shadow: 0 0 0 2px rgba(74,240,192,0.25), 0 0 16px rgba(74,240,192,0.1);
  border-radius: 6px;
}

/* ---- NOTIFICATIONS ---- */
.notification {
  position: fixed; bottom: 16px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 8px 16px; border-radius: 5px;
  font-size: 11px; font-weight: 500;
  z-index: 2000; opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}
.notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notification-info { background: #141428; color: #88aacc; border: 1px solid #1e2a3a; }
.notification-success { background: #141e1a; color: #4af0c0; border: 1px solid #1e3a2a; }
.notification-error { background: #1e1414; color: #ff5544; border: 1px solid #3a1e1e; }

/* ---- DRAGON NAME INPUT ---- */
.dragon-name-wrap {
  padding: 2px 0 4px;
}
.dragon-name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #2a2a40;
  color: #e8eaf0;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 2px;
  outline: none;
  letter-spacing: -0.2px;
  transition: border-color 0.2s;
}
.dragon-name-input::placeholder { color: #3a3a56; font-weight: 400; font-size: 13px; }
.dragon-name-input:focus { border-bottom-color: #5a5aaa; }

.color-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0 2px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-sizing: border-box;
  transition: border-color 0.14s, transform 0.12s;
  flex-shrink: 0;
}
.color-swatch:hover  { transform: scale(1.22); }
.color-swatch.active { border-color: #e8eaf0; }
.color-custom-label {
  position: relative;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px dashed #4a4a6a;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a6a8a;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.14s;
}
.color-custom-label:hover { border-color: #e8eaf0; color: #e8eaf0; }
.color-custom-label input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* ---- CHALLENGES PANEL ---- */
.challenge-progress-label {
  font-size: 11px;
  color: #5a5a80;
  font-weight: 400;
  margin-left: 6px;
}
.challenges-content { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }

.challenge-tier { display: flex; flex-direction: column; gap: 4px; }
.challenge-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a5a80;
  padding: 2px 0 4px;
  border-bottom: 1px solid #161628;
}
.challenge-tier-count { color: #4a4a70; }

.challenge-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid #1a1a2e;
  background: #0e0e1a;
  transition: background 0.15s;
}
.challenge-done {
  background: #0e1a14;
  border-color: #1a3028;
}
.challenge-done .challenge-title { color: #4af0c0; }
.challenge-done .challenge-desc { color: #2a5044; }

.challenge-icon { font-size: 16px; flex-shrink: 0; }
.challenge-info { flex: 1; min-width: 0; }
.challenge-title { font-size: 12px; font-weight: 600; color: #c8ccd4; }
.challenge-desc { font-size: 11px; color: #5a5a80; margin-top: 1px; }
.challenge-check {
  font-size: 14px;
  color: #4af0c0;
  font-weight: 700;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

/* ---- BATTLE RECORD BAR ---- */
.battle-record-bar {
  font-size: 11px;
  color: #5a5a80;
  padding: 6px 0 2px;
  letter-spacing: 0.02em;
}
.rec-wins { color: #4af0c0; font-weight: 700; }
.rec-losses { color: #ff5544; font-weight: 700; }

/* ---- SKIP BUTTON ---- */
.btn-skip {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  font-size: 11px;
  padding: 5px 10px;
  opacity: 0.7;
}
.btn-skip:hover { opacity: 1; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) { .app-main { grid-template-columns: 240px 1fr 280px; } }
@media (max-width: 900px) {
  .app-main { grid-template-columns: 1fr; grid-template-rows: auto 280px auto; }
  .panel-left { border-right: none; border-bottom: 1px solid #161628; }
  .panel-right { border-left: none; border-top: 1px solid #161628; }
  .canvas-container { height: 280px; }
  body { overflow: auto; }
  .app-main { height: auto; }
}
