:root {
    /* Ink & Gold Theme */
    --app-bg: #fdfbf7;
    --sidebar-bg: rgba(255, 248, 240, 0.9);
    --glass-border: rgba(139, 0, 0, 0.1);
    --text-primary: #2c2c2c;
    /* Ink Black */
    --text-secondary: #5a5a5a;
    --accent-red: #8b0000;
    /* Seal Red */
    --accent-gold: #c5a059;
    /* Antique Gold */
    --accent-green: #4a6b4a;
    /* Bamboo Green */
    --accent-blue: #4a6b8a;
    /* Water Blue */

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);

    --font-family: "Noto Serif SC", "Outfit", serif;
    --font-title: "Ma Shan Zheng", cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--app-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('https://images.unsplash.com/photo-1512592070369-58b24d77672d?q=80&w=2574&auto=format&fit=crop');
    /* Ink wash style landscape */
    background-size: cover;
    background-position: center;
}

.app-container {
    width: 90vw;
    height: 85vh;
    max-width: 1400px;
    background: rgba(255, 252, 245, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 360px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent-red);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: -5px;
}

.highlight {
    color: var(--text-primary);
}

.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Legend Grid */
.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.icon {
    font-size: 1.2rem;
}

/* Mission Buttons */
.mission-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mission-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mission-btn:hover {
    background: #fffdf5;
    border-color: var(--accent-gold);
    transform: translateX(4px);
}

.mission-btn.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.mission-btn.active .btn-sub {
    color: rgba(255, 255, 255, 0.8);
}

.btn-icon {
    font-size: 1.4rem;
}

.btn-text {
    display: flex;
    flex-direction: column;
}

.btn-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Insight Card */
.insight-card {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-gold);
}

.insight-card h3 {
    font-size: 1.1rem;
    color: var(--accent-red);
    margin-bottom: 8px;
    font-family: var(--font-title);
}

.insight-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Footer */
.actions-footer {
    margin-top: auto;
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #f5f5f5;
}

/* Main Stage */
.visualizer-stage {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-pane {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.stage-header {
    text-align: center;
    margin-bottom: 1rem;
}

.stage-header h2 {
    font-size: 2rem;
    color: var(--accent-red);
    font-family: var(--font-title);
}

.stage-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-family: var(--font-title);
    letter-spacing: 2px;
}

/* Garden Map */
.garden-map {
    flex-grow: 1;
    position: relative;
    border-radius: 16px;
    background: #f4f1ea;
    /* Rice paper color */
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Zones - Organic Shapes */
.zone {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.4;
    transition: all 0.5s ease;
}

.zone-a {
    /* Flowers */
    width: 300px;
    height: 300px;
    top: -50px;
    left: -50px;
    background: #ffb7b2;
}

.zone-b {
    /* Trees */
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background: #a8e6cf;
}

.zone-c {
    /* Bamboo */
    width: 250px;
    height: 250px;
    bottom: -50px;
    right: 50px;
    background: #dcedc1;
}

.zone-d {
    /* Aquatic */
    width: 300px;
    height: 200px;
    bottom: 20px;
    left: 50px;
    background: #bae1ff;
}

/* Plant Items */
.plant-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    padding: 8px;
    border-radius: 8px;
}

.plant-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.plant-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plant-item:hover .plant-name {
    opacity: 1;
}

.plant-item:hover .plant-icon {
    transform: scale(1.2);
}

/* Active State for Plants */
.plant-item.active {
    z-index: 20;
}

.plant-item.active .plant-icon {
    transform: scale(1.3);
    filter: drop-shadow(0 0 10px var(--accent-gold));
}

.plant-item.active .plant-name {
    opacity: 1;
    color: var(--accent-red);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plant-item.dim {
    opacity: 0.3;
    filter: grayscale(0.8);
}