:root {
    --bg-image: url('../images/background.jpg');
    --font-ui: 'Open Sans', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    --color-panel: #ffffff;
    --color-text: #333333;
    --color-border: #e2e8f0;

    --btn-primary: #2563eb;
    --btn-primary-hover: #1d4ed8;

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    color: var(--color-text);
    background: #c4e1f7;
    height: 100vh;
    display: flex;
    justify-content: center;
    padding: 10px 20px;
    overflow: hidden;
}

.main-container {
    background: #c4e1f7;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding-top: 8px;
}

/* --- Config Panel (Compact) --- */
.config-panel {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.08);
    margin: 0 0 8px 0;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: transparent;
    text-align: center;
    margin-bottom: 10px;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    margin: 0;
}

.header-title p {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    margin: 0;
}


.controls-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-row label {
    font-size: 0.88rem;
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.controls-row input {
    padding: 6px 10px;
    width: 72px;
    font-size: 0.85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
    background: #fafbfc;
}

.controls-row input:focus {
    border-color: var(--btn-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f55454;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.mode-select {
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    background: white;
    color: #333333;
    font-family: var(--font-ui);
}

.mode-select:hover {
    border-color: #94a3b8;
}

.hidden {
    display: none !important;
}

.input-wrapper {
    display: flex;
}

.input-wrapper input {
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 2px 0;
}

.coordinates-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coordinates-row h3 {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
    margin: 0;
}

.coordinate-box {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    max-height: 44px;
    overflow-y: auto;
    padding: 5px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    white-space: nowrap;
}


.placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* --- Main Split Content --- */
.content-split {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 12px;
    overflow: hidden;
    padding: 0;
}

/* Visualization (Left/Center) */
.viz-container {
    flex: 3;
    min-height: 0;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.canvas-frame {
    flex: 1;
    border: none;
    border-radius: 8px;
    background: #0b0f19;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(0, 0, 0, 0.5);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.stats-bar {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    padding: 8px 12px;
    color: #334155;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Right Panel */
.right-panel {
    flex: 1.5;
    min-width: 310px;
    min-height: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
    overflow: visible;
    z-index: 10;
}

.btn-nav {
    flex: 1;
    background: linear-gradient(135deg, #e8eef5 0%, #dce4f0 100%);
    color: #334155;
    border: 1.5px solid #cbd5e1;
    height: 38px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 7px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-nav:hover {
    background: linear-gradient(135deg, #dce4f0 0%, #cbd5e1 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-nav:active {
    transform: translateY(1px);
}

.dropdown-container {
    position: relative;
    flex: 1;
    display: flex;
    height: 38px;
}

.dropdown-container .btn-nav {
    width: 100%;
    height: 100%;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btnAuto.active {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    color: #7f1d1d;
    border-color: #f87171;
}


.step-log-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.step-log-container h3 {
    padding: 8px 10px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.88rem;
    font-weight: 600;
}

.log-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.log-entry {
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
    animation: fadeIn 0.2s;
    border-radius: 4px;
    margin-bottom: 3px;
    transition: all 0.3s ease;
}

.log-entry.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 3px solid #2563eb;
    padding-left: 5px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    border-bottom: 1px solid #93c5fd;
}

.step-num {
    font-weight: bold;
    color: #2563eb;
    margin-right: 5px;
}

.log-entry.active .step-num {
    color: #1d4ed8;
}

/* Recursion log active style - purple tint */
.log-entry.rec-active {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-left: 3px solid #7c3aed;
    padding-left: 5px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
    border-bottom: 1px solid #a78bfa;
}

.log-entry.rec-active .step-num {
    color: #6d28d9;
}

/* Recursion sub-list (multi-line entries) */
.rec-sub-list {
    margin-top: 3px;
    padding-left: 12px;
    border-left: 2px solid rgba(124, 58, 237, 0.15);
    margin-left: 4px;
}

.rec-sub-item {
    font-size: 0.78rem;
    color: #64748b;
    padding: 1px 0;
    line-height: 1.4;
}

.rec-active .rec-sub-item {
    color: #4b5563;
}

.legend {
    padding: 8px 10px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.legend-items {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.legend h4 {
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: #2c3e50;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: #475569;
    white-space: nowrap;
}



.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Mode Indicator --- */
.mode-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef5 100%);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.mode-label {
    color: #64748b;
    font-weight: 500;
}

.mode-value {
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Dynamic Params & Modal --- */
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.log-header h3 {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    flex: 1;
}

.step-info {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
    margin-right: 10px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-sm:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    font-family: var(--font-ui);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    font-size: 1.25rem;
}

.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.param-card {
    background: #f8fafc;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.param-card h4 {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.param-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
}

/* --- Dropdown Styling --- */
.dropdown-container .btn {
    width: 100%;
}

.dropdown-menu {
    position: absolute;
    top: 105%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 50;
    overflow: hidden;
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
}

/* --- Simulation View Fix --- */
.simulation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.simulation-view.hidden {
    display: none;
}

/* --- Comparison Page Specific Styles --- */
.comparison-view {
    display: none;
    padding: 15px;
    height: 100%;
}

.comparison-view.active {
    display: block;
}

.comparison-container {
    display: grid;
    grid-template-columns: 0.75fr 1.1fr 1.1fr;
    gap: 12px;
    max-width: 1300px;
    width: 100%;
    height: 500px;
    margin: 0 auto;
}

.panel-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 100%;
}

.panel-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1rem;
    color: #1e293b;
    margin: 0;
}

.result-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.metric-val {
    font-weight: 700;
    font-family: var(--font-mono);
}

.bar-container {
    height: 20px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.bf-bar {
    background: #ef4444;
}

.dc-bar {
    background: #22c55e;
}

/* Observation boxes - hidden by default */
.observation-box {
    display: none;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.observation-box.visible {
    display: block;
}

.observation-box.bf-obs {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.observation-box.dc-obs {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}

.input-group {
    margin-bottom: 8px;
}

.input-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* ============================================= */
/* === Tab Toggle System (Compact)           === */
/* ============================================= */
.viz-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.viz-tabs {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e8eef5;
    padding: 2px;
    flex-shrink: 0;
}

.viz-tab {
    padding: 5px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    color: #64748b;
    background: transparent;
    font-family: var(--font-ui);
    letter-spacing: 0.3px;
    position: relative;
    white-space: nowrap;
}

.viz-tab:hover:not(.active):not(.disabled) {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.viz-tab.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.viz-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tab lock message */
.tab-lock-msg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #ef4444;
    font-weight: 500;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
}

.tab-lock-msg svg {
    flex-shrink: 0;
}

/* Tab Content Panels */
.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ============================================= */
/* === Recursion Tree View                   === */
/* ============================================= */
.tree-frame {
    flex: 1;
    border-radius: 8px;
    background: #0b0f19;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.tree-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 0.90rem;
    text-align: center;
    padding: 30px;
}

.tree-placeholder p {
    max-width: 280px;
    line-height: 1.5;
}

/* Tree SVG Canvas */
.tree-svg {
    display: block;
}

/* Tree Edges */
.tree-edge {
    stroke: #283040;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.35s ease, stroke-width 0.35s ease;
}

.tree-edge.visited {
    stroke: #3d4f65;
    stroke-width: 1.5;
}

.tree-edge.active {
    stroke: #38bdf8;
    stroke-width: 2;
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.4));
}

.tree-edge.completed {
    stroke: #22c55e;
    stroke-width: 1.5;
    opacity: 0.7;
}

/* Tree Nodes */
.tree-node-group {
    cursor: default;
}

.tree-node-rect {
    rx: 7;
    ry: 7;
    fill: #151d2b;
    stroke: #283040;
    stroke-width: 1.5;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Depth-based border colors */
.tree-node-rect.depth-0 { stroke: #6366f1; }
.tree-node-rect.depth-1 { stroke: #8b5cf6; }
.tree-node-rect.depth-2 { stroke: #a855f7; }
.tree-node-rect.depth-3 { stroke: #d946ef; }
.tree-node-rect.depth-4 { stroke: #ec4899; }

/* Node States */
.tree-node-rect.visited {
    fill: #1a2332;
    stroke-width: 1.5;
}

.tree-node-rect.active {
    fill: #172554;
    stroke: #38bdf8 !important;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}

.tree-node-rect.completed {
    fill: #0f2a1e;
    stroke: #22c55e !important;
    stroke-width: 1.5;
}

.tree-node-rect.base-case {
    fill: #1e1b30;
    stroke: #a78bfa !important;
    stroke-width: 1.5;
}

.tree-node-rect.active.base-case {
    fill: #1e1b44;
    stroke: #38bdf8 !important;
}

/* Node Text */
.tree-node-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    fill: #cbd5e1;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    transition: fill 0.3s ease;
}

.tree-node-label.title {
    font-weight: 700;
    font-size: 10px;
    fill: #e2e8f0;
}

.tree-node-label.detail {
    font-size: 8.5px;
    fill: #94a3b8;
}

.tree-node-label.comment {
    font-size: 8px;
    fill: #64748b;
    font-family: var(--font-ui);
    font-style: italic;
}

.tree-node-label.node-type {
    font-size: 9px;
    font-weight: 600;
    fill: #7dd3fc;
    font-family: var(--font-ui);
    letter-spacing: 0.3px;
}

.tree-node-label.delta {
    font-size: 9px;
    fill: #4ade80;
    font-weight: 600;
}

/* Pulse animation for active node */
@keyframes nodePulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.25)); }
    50%      { filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.55)); }
}

.tree-node-rect.active {
    animation: nodePulse 2s ease-in-out infinite;
}

/* ============================================= */
/* === Responsive Design                     === */
/* ============================================= */

/* Tablets and Smaller Laptops */
@media (max-width: 1024px) {
    .comparison-container {
        grid-template-columns: 1fr 1fr;
        height: auto;
        min-height: 550px;
    }

    .panel-card:first-child {
        grid-column: span 2;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto;
        padding: 10px;
    }

    .main-container {
        padding-top: 10px;
        height: auto;
    }

    .content-split {
        flex-direction: column;
        height: auto;
    }

    .viz-container {
        height: 400px;
        flex: none;
    }

    .right-panel {
        flex: none;
        min-width: unset;
    }

    .comparison-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .panel-card:first-child {
        grid-column: auto;
    }

    .controls-row {
        justify-content: center;
    }

    #btnShowAdvanced {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 10px;
    }

    .nav-controls {
        flex-wrap: wrap;
    }

    .nav-controls>button,
    .nav-controls>.dropdown-container {
        flex: 1 1 45%;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 15px;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
