/* ── 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;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exp-body {
    background: var(--bg-darker);
    height: 100%;
    width: 100%;
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
}

nav.glass {
    position: relative;
    margin: 1rem;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    width: calc(100% - 2rem);
    flex-shrink: 0;
}

.exp-title {
    font-weight: 600;
    color: var(--text-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.exp-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.simulation-view {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#pendulumCanvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#pendulumCanvas:active {
    cursor: grabbing;
}

.stats-overlay {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.controls-panel {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 280px;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.9);
}

.controls-panel h3 {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.theory-panel {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.theory-panel h2 {
    color: var(--accent);
    font-size: 1.8rem;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 2rem;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    color: var(--text-white);
    font-style: italic;
}

.insights ul {
    padding-left: 1.5rem;
    color: var(--text-gray);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.insights strong {
    color: var(--text-white);
}

.energy-graph {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 1rem;
}

#energyCanvas {
    width: 100%;
    height: 100px;
}

.graph-labels {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 1000px) {
    .exp-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}