#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
    transform-origin: top left;
}

/* --- PREMIUM SCIENCE-SIM NAVIGATION --- */
.sim-nav {
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 200;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.sim-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    color: #3b82f6;
}

.logo-thin {
    font-weight: 300;
}

.nav-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: #64748b;
}

.nav-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-breadcrumbs a:hover {
    color: #3b82f6;
}

.nav-breadcrumbs .sep {
    font-weight: 300;
    color: #cbd5e1;
}

.nav-breadcrumbs .current {
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.nav-back:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

.sim-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    position: relative;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: inset 0 20px 40px rgba(0,0,0,0.02);
}

.canvas-wrapper {
    position: relative;
    flex: 3;
    background: #f1f5f9;
    background-image:
        radial-gradient(#cbd5e1 1px, transparent 1px),
        radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    border-radius: 20px;
    box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 4px solid #fff;
    display: flex;
}

canvas#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

canvas#simCanvas:active {
    cursor: grabbing;
}

.controls-wrapper {
    flex: 1;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.ph-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    display: flex;
    justify-content: space-between;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #ef4444;
    /* Charge 1 default */
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    cursor: pointer;
}

#q2Slider {
    accent-color: #3b82f6;
    /* Charge 2 default */
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-clear {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    text-transform: none;
    font-weight: 600;
}

/* HUD & Formula */
.hud-overlay {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.hud-item {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: 12px;
    border-left: 5px solid #ef4444;
    display: flex;
    flex-direction: column;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hud-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    letter-spacing: 1px;
}

.hud-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 18px;
    color: #f8fafc;
    font-weight: 700;
}

.formula-display {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Space Grotesk', serif;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* Data Section */
.data-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: none; /* Hide footer data for a cleaner Lab look within 720px stage */
}
