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

body.kepler-page {
    background: #0f172a;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    touch-action: none;
    overscroll-behavior: none;
}

/* PhET Stage — scalable container */
#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    overflow: hidden;   /* No scrolling — content must fit 720px design */
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Main container setup */
.sim-container {
    display: flex;
    width: 98%;
    max-width: 1600px;
    margin-top: 10px;
    gap: 15px;
    height: 590px;       /* Fixed px — vh units reference real viewport, not the 720px design */
    min-height: unset;
}

/* Sidebar Styling */
.controls-wrapper {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    color: #e2e8f0;
    border: 1px solid #334155;
}

/* Physics World Styling */
.canvas-wrapper {
    position: relative;
    flex: 3;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 70%, #000000 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 2px solid #334155;
}

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

/* Panels and Controls */
.ph-panel {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-darker {
    background: #0f172a;
    border-color: #1e293b;
}

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

.control-group label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #10b981;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
    padding: 4px 0;
    transition: 0.2s;
}

.toggle-label:hover {
    color: #10b981;
}

.toggle-label input[type="checkbox"] {
    accent-color: #10b981;
    width: 16px;
    height: 16px;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.btn-fire {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-fire:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-clear {
    background: #475569;
}

.btn-clear:hover {
    background: #334155;
}

/* Data Display */
.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-row span:last-child {
    font-weight: bold;
    color: #f8fafc;
}

/* Overlay Labels */
.law-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

/* Educational Content */
.laws-grid-edu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.law-card-edu {
    background: #0f172a;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #334155;
}

.law-card-edu h3 {
    margin-top: 0;
    color: #10b981;
}

.law-card-edu p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 0;
}

/* NOTE: Responsive layout handled by PhET Stage Scaling Engine.
   Media queries are removed to prevent layout reflow on real viewport width.
   The stage renders at 1280×720 and scales uniformly on all devices. */
