body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f8fafc;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
}

#phet-stage {
    position: absolute; top: 0; left: 0;
    width: 1280px; height: 720px;
    background: #f8fafc;
    overflow: hidden; transform-origin: 0 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

nav {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #0f172a !important;
    position: absolute;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#sim-app {
    display: flex;
    margin-top: 60px;
    height: calc(100% - 60px);
    width: 100%;
}

.sim-container {
    flex: 1;
    display: flex;
}

.canvas-panel {
    background: #ffffff;
    overflow: hidden;
    background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
    cursor: default;
}

#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.observation-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.observation-box strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.control-panel {
    width: 260px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 10;
    color: #f8fafc;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.phet-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.phet-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.section-header {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.stat-line {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.val-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-icon {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Info Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.overlay-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.info-scroll {
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 15px;
    margin-top: 1rem;
}

.info-scroll::-webkit-scrollbar {
    width: 6px;
}

.info-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #0f172a;
}

.overlay h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.overlay h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
    color: #1e293b;
}

.overlay ul {
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.overlay li {
    margin-bottom: 0.5rem;
}

.physics-note {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Controls */
label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s;
}

label:hover {
    color: #f8fafc;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0 20px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    border: 2px solid white;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #475569;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.5);
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #38bdf8;
    cursor: pointer;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
}