/* ── PhET Scaling Base ───────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* PhET Stage — scalable container */
#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    overflow-y: auto; /* Re-enabled for natural lab scrolling */
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav {
    position: sticky !important;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    padding: 0 30px !important; /* Shifted left by reducing from 8% to 30px */
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* Increased to stay above all HUD elements */
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    flex-shrink: 0;
}

.sim-container {
    display: flex;
    width: 95%;
    max-width: 1400px;
    margin-top: 20px;
    gap: 20px;
    min-height: 600px;
    flex-shrink: 0; /* Prevents lab area from compressing when scrolling info */
}

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

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

.controls-wrapper {
    flex: 1;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    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.5);
}

.ph-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    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: #2563eb;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    cursor: pointer;
}

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

.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    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);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-fire {
    background: #2563eb;
}

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

.btn-clear:hover {
    background: #e2e8f0;
    transform: none;
}

/* HUD Overlay Styles */
.hud-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.hud-item {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    padding: 8px 14px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.hud-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

/* Data Section */
.data-wrapper {
    width: 95%;
    max-width: 1400px;
    margin-top: 20px;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 60px;
    border: 1px solid #e2e8f0;
}

/* Mobile responsiveness handled by PhET Scaling Engine */
