/* --- Frames Size Synchronization --- */
.canvas-container {
    position: relative;
    width: 100%;
    height: 500px; 
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
    overflow: hidden;
    cursor: default;
}

.energy-sidebar {
    display: flex;
    flex-direction: row; 
    justify-content: space-around;
    align-items: flex-end;
    height: 500px; 
    padding: 1.5rem 1rem;
    box-sizing: border-box; 
}

/* --- Canvas Stats (Top Left) --- */
.canvas-stats {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.92);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    
    font-family: 'Roboto Mono', monospace;
    color: var(--text-light);
    font-size: 0.85rem; 
    font-weight: 500;
    line-height: 1.5;
    z-index: 5;
    pointer-events: none; 
}

/* --- Canvas & Overlay --- */
canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; 
}

canvas.draggable { cursor: grab; }
canvas.dragging { cursor: grabbing; }

.overlay-instruction {
    position: absolute;
    top: 25%;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.7;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* --- UI Layer --- */
.ui-layer {
    position: absolute;
    bottom: 4px !important;
    left: 4px !important;
    right: 4px !important;
    display: flex;
    flex-direction: row;
    align-items: stretch; 
    gap: 6px; 
    z-index: 10;
}

.panel-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.92);
    padding: 0.85rem 1rem; 
    display: flex;
    align-items: center;
}

.panel-left {
    flex: 0 0 auto;
    gap: 1rem; 
    flex-direction: row;
    justify-content: center;
}

.panel-right {
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem; 
}

/* Stopwatch Styling */
.stopwatch-display {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 1rem; 
    color: var(--text-main);
    width: 85px;
    text-align: right;
    line-height: 1;
}

/* Buttons */
.btn-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.control-btn {
    background: #f0f2f5;
    border: none;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px; 
    border-radius: 8px;
    transition: all 0.2s;
}

.control-btn:hover { background: #e2e8f0; transform: translateY(-1px); }
.control-btn:active { transform: scale(0.95); }
.control-btn.small { color: var(--text-light); padding: 5px; }
.control-btn.small:hover { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }

/* Sliders */
.slider-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.8rem;
    font-size: 1rem; 
    color: var(--text-light);
    font-weight: 500;
}

.slider-row label { 
    min-width: 80px; 
    text-align: right;
}

/* Range Input Styling */
input[type=range] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px; 
    background: #cbd5e0;
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); 
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* --- Sidebar Internals --- */
.energy-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 50px;
    gap: 8px;
}

.bar-track {
    flex-grow: 1; 
    width: 100%;
    background: rgba(0,0,0,0.05);
    border-radius: 99px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 0.05s linear; 
    border-radius: 99px;
}

.fill-ek { background: #ff4757; box-shadow: 0 0 10px rgba(255, 71, 87, 0.4); } 
.fill-ep { background: #2ed573; box-shadow: 0 0 10px rgba(46, 213, 115, 0.4); } 
.fill-etot { background: #5352ed; box-shadow: 0 0 10px rgba(83, 82, 237, 0.4); } 

.bar-label { 
    font-weight: 700; 
    color: var(--text-light); 
    font-size: 1rem; 
    line-height: 1;
}

.bar-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem; 
    color: var(--text-light);
    font-weight: 500;
    min-height: 1.2em; 
}