/* casio.css - Core Layout & Keyboard */

:root {
    --panel-height: 20vh;
    --toggle-height: 20px;
    --main-key-width: 60px;
    --main-black-width: 40px;
    --bg-color: #111;
    --boundary-color: #ff3366;
    --accent-color: #ff3366;
}

/* Light Mode Core Overrides */
body.light-mode { --bg-color: #e0e0e0; }

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
body { background-color: var(--bg-color); width: 100vw; height: 100vh; overflow: hidden; font-family: 'Courier New', monospace; color: #eee; }

/* Overlay */
#start-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.overlay-content h1 { margin-bottom: 10px; color: var(--accent-color); font-family: sans-serif; }
#start-btn { padding: 15px 40px; background: var(--accent-color); color: white; border: none; border-radius: 50px; font-size: 1.2rem; font-weight: bold; cursor: pointer; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

.casio-wrapper { width: 100%; height: 100%; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.5s ease-in; }

/* Top Panel Container */
.top-panel { height: var(--panel-height); background: #222; border-bottom: 2px solid #000; display: flex; flex-direction: row; flex-shrink: 0; transition: height 0.4s; overflow: hidden; z-index: 10; }
.top-panel.closed { height: 0 !important; border: none; }
body.light-mode .top-panel { background: #dcdcdc; border-bottom: 2px solid #aaa; }

/* Keyboard Area */
.main-keyboard-area { flex-grow: 1; background: #111; position: relative; overflow: hidden; touch-action: none; }
.main-keys-scroller { height: 100%; width: 100%; overflow: hidden; }
.main-keys { display: inline-flex; height: 100%; min-width: max-content; }
.boundary-block { width: 20px; height: 100%; background: repeating-linear-gradient(45deg, #333, #333 5px, #222 5px, #222 10px); border-left: 3px solid var(--boundary-color); border-right: 3px solid var(--boundary-color); }

.key { position: relative; flex-shrink: 0; border-radius: 0 0 8px 8px; }
.key.white { width: var(--main-key-width); height: 100%; background: white; border: 1px solid #999; box-shadow: inset 0 -5px 10px rgba(0,0,0,0.1); }
.key.white.active { background: #ddd; transform: scaleY(0.98); transform-origin: top; }
.key.black { width: var(--main-black-width); height: 65%; background: black; z-index: 2; margin: 0 calc(var(--main-black-width) / -2); box-shadow: 2px 2px 5px rgba(0,0,0,0.6); border-radius: 0 0 4px 4px; }
.key.black.active { background: #222; transform: scaleY(0.98); transform-origin: top; }

/* Key Labels */
.key-label { position: absolute; bottom: 5px; left: 0; width: 100%; text-align: center; font-size: 10px; color: #555; pointer-events: none; display: none; }
.main-keys.show-labels .key-label { display: block; }
.key.black .key-label { color: #ccc; bottom: 8px; }

/* Practice Visuals */
.key.practice-correct { background: #00bfff !important; transition: background 0.1s; }

/* Toggle Bar */
.toggle-bar { height: 20px; background: #181818; border: none; border-top: 1px solid #333; border-bottom: 1px solid #333; width: 100%; color: #666; cursor: pointer; z-index: 20; }

/* Mobile Rotation */
@media screen and (orientation: portrait) {
    body { transform: rotate(90deg); transform-origin: top left; position: fixed; top: 0; left: 100vw; width: 100vh; height: 100vw; overflow: hidden; background: #111; z-index: 99999; }
}
