/**
 * Rotational Motion Lab - local styles
 * requirements: black bg, Courier New, max-width 800px, controls inline
 */
#content_sim .rm-lab {
    max-width: 800px;
    height: 600px;
    margin: 0 auto;
    padding: 10px;
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #e0e0e0;
    border-radius: 6px;
}

#content_sim .rm-lab * {
    box-sizing: border-box;
}

#content_sim .rm-lab .rm-title {
    font-size: 12px;
    font-weight: bold;
    color: #0cf;
    margin-bottom: 6px;
}

#content_sim .rm-lab .rm-view-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
}

#content_sim .rm-lab .rm-view-selector label {
    color: #aaa;
    font-size: 11px;
}

#content_sim .rm-lab .rm-view {
    width: 100%;
}

#content_sim .rm-lab .rm-inspect-panel {
    width: 100%;
}

#content_sim .rm-lab .rm-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    padding: 10px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 10px;
}

#content_sim .rm-lab .rm-view-race .rm-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px 0;
}

#content_sim .rm-lab .rm-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
}

#content_sim .rm-lab .rm-race-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#content_sim .rm-lab .rm-controls label {
    color: #aaa;
    font-size: 11px;
    white-space: nowrap;
}

#content_sim .rm-lab .rm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

#content_sim .rm-lab .rm-row label { margin-right: 2px; }

#content_sim .rm-lab .rm-row input[type="range"] {
    width: 70px;
    min-width: 50px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

#content_sim .rm-lab .rm-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #0cf;
    border-radius: 50%;
    cursor: pointer;
}

#content_sim .rm-lab .rm-row input[type="checkbox"] {
    accent-color: #0cf;
    cursor: pointer;
}

#content_sim .rm-lab select {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: #1a1a1a;
    color: #0cf;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
}

#content_sim .rm-lab .rm-val {
    color: #0cf;
    font-size: 11px;
    min-width: 2em;
}

#content_sim .rm-lab .rm-btn {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 4px 10px;
    background: #1a1a1a;
    color: #0cf;
    border: 1px solid #0cf;
    border-radius: 4px;
    cursor: pointer;
}

#content_sim .rm-lab .rm-btn:hover {
    background: #0cf;
    color: #000;
}

#content_sim .rm-lab .rm-btn.danger {
    border-color: #f66;
    color: #f66;
}

#content_sim .rm-lab .rm-btn.danger:hover {
    background: #f66;
    color: #000;
}

#content_sim .rm-lab .rm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 700px) {
    #content_sim .rm-lab .rm-grid { grid-template-columns: 1fr; }
}

#content_sim .rm-lab .rm-panel {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    overflow: hidden;
}

#content_sim .rm-lab .rm-3d-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    background: #000;
    border-radius: 4px;
}

#content_sim .rm-lab .rm-3d-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#content_sim .rm-lab .rm-cam-btns {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 10;
}

#content_sim .rm-lab .rm-torque-overlay-wrap {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 140px;
    pointer-events: none;
    z-index: 5;
}

#content_sim .rm-lab .rm-torque-overlay-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#content_sim .rm-lab .rm-cam-btn {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.7);
    color: #0cf;
    border: 1px solid #0cf;
    border-radius: 3px;
    cursor: pointer;
}

#content_sim .rm-lab .rm-cam-btn:hover {
    background: #0cf;
    color: #000;
}

#content_sim .rm-lab .rm-formula {
    font-size: 11px;
    color: #8f8;
    margin: 6px 0 2px;
    word-break: break-all;
}

#content_sim .rm-lab .rm-inertia-val {
    font-size: 12px;
    color: #0cf;
    font-weight: bold;
}

#content_sim .rm-lab .rm-race-wrap {
    width: 100%;
    height: 400px;
    background: #0a0a0a;
    border-radius: 4px;
    position: relative;
}

#content_sim .rm-lab #rmRaceCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#content_sim .rm-lab .rm-energy-bars {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

#content_sim .rm-lab .rm-energy-box {
    flex: 1;
    min-width: 120px;
}

#content_sim .rm-lab .rm-energy-label {
    font-size: 14px;
    color: #fff;
    margin-bottom: 2px;
}

#content_sim .rm-lab .rm-energy-bar {
    height: 10px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}

#content_sim .rm-lab .rm-energy-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.05s;
}

#content_sim .rm-lab .rm-energy-bar-fill.trans { background: #0cf; }
#content_sim .rm-lab .rm-energy-bar-fill.rot { background: #8f8; }

#content_sim .rm-lab .rm-graph-wrap {
    width: 100%;
    height: 140px;
    background: #000;
    border-radius: 4px;
    margin-top: 8px;
}

#content_sim .rm-lab #rmGraphCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#content_sim .rm-lab .rm-parallel-controls,
#content_sim .rm-lab .rm-torque-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    padding: 8px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    margin-top: 8px;
}

#content_sim .rm-lab .rm-torque-formulas {
    flex-basis: 100%;
    font-size: 11px;
    color: #8f8;
    margin-top: 2px;
}

#content_sim .rm-lab .rm-torque-formulas .rm-val {
    color: #0cf;
}

#content_sim .rm-lab .rm-torque-formulas .rm-torque-formula-text {
    margin-left: 0.5em;
    color: #8f8;
}

#content_sim .rm-lab .rm-mode-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}
