/* ==========================================================================
   MapleStory Eternal Flame Calculator - Design System
   Modern Glassmorphic Dark Mode with Vibrant Rainbow Flame Accents
   ========================================================================== */

:root {
    --bg-primary: #080c14;
    --bg-secondary: #0f172a;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(24, 33, 53, 0.85);
    --bg-input: rgba(15, 23, 42, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-accent: rgba(249, 115, 22, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Flame Color Accents */
    --flame-red: #ef4444;
    --flame-orange: #f97316;
    --flame-amber: #f59e0b;
    --flame-emerald: #10b981;
    --flame-cyan: #06b6d4;
    --flame-blue: #3b82f6;
    --flame-purple: #a855f7;

    --gradient-flame: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%);
    --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.7) 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.15), transparent 70%);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.25);

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249, 115, 22, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.08), transparent);
    background-attachment: fixed;
}

.app-container {
    max-width: 1420px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #fb923c;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.brand-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.app-header h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 70%, #fdba74 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.6rem;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 760px;
    margin: 0 auto;
}

.formula-chip {
    display: inline-block;
    margin-top: 0.8rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #38bdf8;
}

/* ==========================================================================
   Layout Grid
   ========================================================================== */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Card Styling
   ========================================================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title svg {
    color: var(--flame-orange);
}

.card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.control-group {
    margin-bottom: 1.25rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.control-label .label-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--flame-orange);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Hide up/down spinner arrows for purely typed inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

input[type="number"],
.no-spinners {
    -moz-appearance: textfield;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.2rem;
    appearance: none;
}

/* Range Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--flame-orange);
    box-shadow: 0 0 10px var(--flame-orange);
    cursor: pointer;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-val-box {
    width: 78px;
}

.slider-val-box input {
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: .3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked + .toggle-slider {
    background-color: var(--flame-orange);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--flame-orange) 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

/* Quick presets buttons */
.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip:hover, .chip.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.4);
    color: #fdba74;
}

/* ==========================================================================
   Primary Metrics Highlights (The WOW Factor)
   ========================================================================== */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 1200px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .metrics-row {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.metric-card.highlight {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(249, 115, 22, 0.35);
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.12);
}

.metric-card.highlight-cyan {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.12);
}

.metric-card.highlight-cyan .metric-value {
    background: linear-gradient(135deg, #a5f3fc 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-card.highlight-gold {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.12);
}

.metric-card.highlight-gold .metric-value {
    background: linear-gradient(135deg, #fef08a 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-card.highlight-emerald {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.12);
}

.metric-card.highlight-emerald .metric-value {
    background: linear-gradient(135deg, #a7f3d0 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.metric-card.highlight .metric-value {
    background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.secondary-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 768px) {
    .secondary-metrics-row {
        grid-template-columns: 1fr;
    }
}

.mini-metric {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-metric-title {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mini-metric-val {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: #38bdf8;
}

/* ==========================================================================
   Chart Section
   ========================================================================== */
.chart-container {
    margin-bottom: 1.75rem;
}

.chart-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab-btn.active {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.4);
    color: #fed7aa;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background: rgba(10, 15, 26, 0.7);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.5rem;
}

.canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.85rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* ==========================================================================
   Percentiles & Data Table
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

table.data-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

table.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

table.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-score-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #38bdf8;
}

.table-flames-badge {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #fb923c;
}

/* ==========================================================================
   Item Stat Builder (Collapsible / Modal)
   ========================================================================== */
.stat-builder-panel {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.2s ease;
}

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

.stat-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

@media (max-width: 600px) {
    .stat-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

.stat-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-input-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-input-group input {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Math & Guide Modal / Accordion
   ========================================================================== */
.math-explainer {
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 1.25rem;
    margin-top: 1.75rem;
}

.math-explainer h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fdba74;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.math-explainer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.math-explainer ul {
    margin-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 3.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--flame-orange);
}

/* ==========================================================================
   Target Efficiency (Inverse Mode) Styles
   ========================================================================== */

/* Mode Switcher Segmented Control */
.mode-switcher-container {
    margin-bottom: 1.25rem;
}

.mode-segmented-control {
    display: flex;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.mode-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.mode-tab-btn.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0%, rgba(236, 72, 153, 0.14) 100%);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.mode-tab-btn svg {
    flex-shrink: 0;
}

/* Target Efficiency Hero Banner */
.target-hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    gap: 1.5rem;
}

.target-hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
}

.badge-target-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.target-hero-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.015em;
}

.target-hero-title .accent-text {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.target-hero-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    max-width: 600px;
}

.target-hero-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
}

.target-hero-sub {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.target-hero-val {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #38bdf8;
    line-height: 1.1;
    margin-top: 0.2rem;
}

@media (max-width: 768px) {
    .target-hero-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .target-hero-metric {
        align-items: flex-start;
        text-align: left;
    }
}

/* 5 Target Cards Grid - 3 boxes per row */
.target-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
}

@media (max-width: 1180px) {
    .target-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .target-cards-grid {
        grid-template-columns: 1fr;
    }
}

.target-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.target-card:hover {
    transform: translateY(-2px);
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(249, 115, 22, 0.15);
}

.target-card.highlight-weapon {
    border-color: rgba(139, 92, 246, 0.25);
}

.target-card.highlight-weapon:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.18);
}

.target-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.target-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.target-card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.target-card.highlight-weapon .target-card-badge {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
    color: #c084fc;
}

.target-card-score-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.6rem;
    text-align: center;
    margin-bottom: 0.85rem;
}

.target-score-num {
    font-size: 2.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #fbbf24;
    line-height: 1;
    letter-spacing: -0.02em;
}

.target-card.highlight-weapon .target-score-num {
    color: #c084fc;
}

.target-score-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.35rem;
}

.target-spend-pill {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.target-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.target-metric-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.6rem;
    min-width: 0;
    overflow: hidden;
}

.target-metric-item.target-metric-full {
    grid-column: span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    background: rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.2);
    min-width: 0;
}

.target-metric-name {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.target-metric-val {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 0.18rem;
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.target-metric-full .target-metric-val {
    margin-top: 0;
    font-size: 1rem;
    white-space: nowrap;
}

.highlight-cyan-text {
    color: #38bdf8 !important;
}

.highlight-orange-text {
    color: #fb923c !important;
}

.highlight-gold-text {
    color: #fbbf24 !important;
}

.highlight-emerald-text {
    color: #10b981 !important;
}

.target-breakdown-box {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--flame-amber);
    padding: 0.45rem 0.65rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
}

.target-breakdown-box strong {
    color: var(--text-primary);
    font-weight: 600;
}

.target-card.highlight-weapon .target-breakdown-box {
    border-left-color: #a855f7;
}

.target-card-actions {
    margin-top: auto;
}

.btn-inspect-target {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.55rem;
}

/* Comparison Matrix Table */
.target-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.target-matrix-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.target-matrix-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    white-space: nowrap;
}

.target-matrix-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.target-matrix-table td.score-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fbbf24;
}

.target-matrix-table td.spend-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #38bdf8;
}

.target-matrix-table td.stat-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: normal;
    min-width: 180px;
}

