body { font-family: 'Kantumruy Pro', sans-serif; background: #0f172a; height: 100vh; display: flex; flex-direction: column; margin: 0; color: white; overflow: hidden; }

/* =========================================
    ✨ MODALS (LOGIN, CLOUD, DONATION) ✨
========================================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(8px); z-index: 3000; justify-content: center; align-items: center; }
.bg-glow { position: absolute; width: 400px; height: 400px; background: #8b5cf6; filter: blur(150px); opacity: 0.3; border-radius: 50%; z-index: 0; }
.neon-box { position: relative; width: 360px; border-radius: 20px; overflow: hidden; padding: 3px; z-index: 1; box-shadow: 0 15px 50px rgba(0,0,0,0.6); }
@keyframes spin-neon { 100% { transform: rotate(360deg); } }
.neon-box::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 0deg, transparent 40%, rgba(139, 92, 246, 0.1) 60%, #8b5cf6 80%, #0ea5e9 100%); animation: spin-neon 3s linear infinite; z-index: 1; }
.neon-inner { position: relative; background: #ffffff; border-radius: 17px; padding: 35px 25px; z-index: 2; display: flex; flex-direction: column; }
.auth-input { width: 100%; padding: 12px 15px; margin-bottom: 15px; border-radius: 8px; background: #1e293b; border: 1px solid #334155; color: white; outline: none; transition: 0.3s; font-family: 'Kantumruy Pro'; }
.auth-input:focus { border-color: #8b5cf6; box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); background: #020617; }
.list-modal-content { position: relative; background: #0f172a; padding: 25px; border-radius: 16px; border: 1px solid #334155; width: 500px; max-width: 95%; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.6); z-index: 2; }

.donation-content { width: 400px; padding: 20px 25px; border-color: #8b5cf6; }
.qr-image { max-width: 100%; height: auto; border-radius: 12px; border: 4px solid #334155; margin-bottom: 15px; max-height: 350px; }

/* =========================================
    🎹 PIANO APP UI STYLES ✨
========================================== */
.toolbox { background: #1e293b; padding: 8px 12px; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; justify-content: flex-start; align-items: center; border-bottom: 3px solid #334155; z-index: 10; }
.toolbox::-webkit-scrollbar { height: 6px; }
.toolbox::-webkit-scrollbar-track { background: #1e293b; }
.toolbox::-webkit-scrollbar-thumb { background: #475569; border-radius: 6px; }

.tool-group { display: flex; gap: 4px; background: #0f172a; padding: 4px 8px; border-radius: 10px; align-items: center; border: 1px solid #475569; box-sizing: border-box; white-space: nowrap; }
.tool-label-top { font-size: 0.7rem; color: #94a3b8; margin-right: 4px; font-weight: bold; }
.tool-item, .select-tool { height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; box-sizing: border-box; cursor: pointer; transition: all 0.2s; user-select: none; margin: 0; white-space: nowrap; flex-shrink: 0; }
.tool-item { background: #334155; padding: 0 10px; min-width: 36px; border: 2px solid transparent; font-weight: bold; font-size: 1.3rem; color: white; }
.tool-item:hover { background: #475569; }
.tool-item.active { border-color: #8b5cf6; background: #2e1065; color: white; }
.text-sm-btn { font-size: 0.85rem !important; padding: 0 10px !important; }
.select-tool { background: #334155; color: white; border: 1px solid #475569; padding: 0 10px; font-size: 0.8rem; outline: none; width: auto; }
.select-tool:focus { border-color: #8b5cf6; }

.action-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; font-weight: bold; font-size: 0.8rem; padding: 0 12px !important; height: 36px !important; border-radius: 8px; border: none; white-space: nowrap !important; cursor: pointer; transition: 0.2s; }
.btn-menu { background: #6366f1; color: white; } .btn-menu:hover { background: #4f46e5; }
.btn-beat { background: #d4af37; color: #1e293b; } .btn-beat:hover { background: #f9e27d; }
.btn-backspace { background: #ea580c; color: white; } .btn-backspace:hover { background: #f97316; }
.btn-clear { background: #991b1b; color: white; } .btn-clear:hover { background: #dc2626; }

.input-header { background: #334155; border: 1px solid #475569; color: white; padding: 0 10px; height: 38px; border-radius: 6px; font-size: 0.85rem; outline: none; box-sizing: border-box; }
.input-header:focus { border-color: #8b5cf6; }

.sheet-outer-container { background: #cbd5e1; margin: 10px auto; border-radius: 8px; flex: 1; overflow-x: auto; overflow-y: auto; width: 98%; border: 2px solid #334155; padding: 40px 0; position: relative; scroll-behavior: smooth; cursor: text; -webkit-overflow-scrolling: touch; }
canvas#sheet-canvas { display: block; background: white; margin: 0 auto; box-shadow: 0 15px 35px rgba(0,0,0,0.4); min-width: 1200px; }

.lyrics-row-input { position: absolute; left: 120px; width: 80%; background: rgba(255, 255, 255, 0.9); border: 2px solid #8b5cf6; color: #1e293b; font-family: 'Kantumruy Pro'; font-size: 1.1rem; padding: 6px 12px; text-align: left; outline: none; border-radius: 6px; z-index: 5; display: none; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.lyrics-row-input:focus { border-color: #6366f1; }

.chord-row-input { position: absolute; left: 120px; width: 80%; background: rgba(255, 255, 255, 0.95); border: 2px solid #f59e0b; color: #b45309; font-family: 'Kantumruy Pro'; font-size: 1.1rem; padding: 6px 12px; text-align: left; outline: none; border-radius: 6px; z-index: 5; display: none; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-weight: bold; }
.chord-row-input:focus { border-color: #d97706; }

.controls { padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; gap: 15px; background: #1e293b; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.controls::-webkit-scrollbar { height: 6px; } .controls::-webkit-scrollbar-thumb { background: #475569; border-radius: 6px; }
#control-buttons { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
#control-buttons::-webkit-scrollbar { height: 4px; display: none; }

.piano-container { height: 240px; background: #020617; display: block; border-top: 5px solid #334155; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.piano-container::-webkit-scrollbar { height: 6px; }
.piano-container::-webkit-scrollbar-thumb { background: #475569; border-radius: 6px; }
.piano-scroll-zone { height: 25px; width: 100%; min-width: 1200px; background: #1e293b; border-bottom: 1px solid #0f172a; display: flex; align-items: center; justify-content: center; cursor: grab; }
.piano-scroll-zone span { position: sticky; left: 0; width: 100vw; text-align: center; color: #94a3b8; font-size: 11px; font-weight: bold; letter-spacing: 1px; pointer-events: none; }
.keys-wrapper { display: flex; height: calc(100% - 25px); width: 100%; min-width: 1200px; position: relative; touch-action: pan-x; }

.key { flex: 1; height: 100%; background: white; border: 1px solid #cbd5e1; border-radius: 0 0 6px 6px; cursor: pointer; z-index: 1; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 8px; user-select: none; box-shadow: inset 0 -4px 0 #e2e8f0; position: relative; touch-action: pan-x; }
.key.black { flex: 0 0 2.2%; height: 60%; background: linear-gradient(#1e293b, #000); margin-left: -1.1%; margin-right: -1.1%; z-index: 2; border-radius: 0 0 4px 4px; border: none; }
.key.active { background: #8b5cf6 !important; transform: translateY(2px); box-shadow: none; }
.key.chord-active { background: #d97706 !important; transform: translateY(2px); box-shadow: inset 0 0 10px rgba(0,0,0,0.2); }
.key-label { font-size: 0.65rem; font-weight: bold; color: #94a3b8; pointer-events: none; text-align: center; line-height: 1.2;}

#menu-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(2, 6, 23, 0.6); backdrop-filter: blur(3px); z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s; }
#menu-backdrop.active { opacity: 1; visibility: visible; }
#main-menu-overlay { position: fixed; top: 0; left: -360px; width: 340px; max-width: 85vw; height: 100vh; background: #0f172a; border-right: 1px solid #334155; z-index: 2001; display: flex; flex-direction: column; overflow-y: auto; transition: left 0.3s; }
#main-menu-overlay.active { left: 0; box-shadow: 5px 0 25px rgba(0,0,0,0.6); }
#menu-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #1e293b; border-bottom: 2px solid #334155; }
#close-menu-btn { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid #ef4444; padding: 6px 12px; border-radius: 8px; font-weight: bold; cursor: pointer; }
.sidebar-card { background: #1e293b; padding: 15px; border-radius: 12px; width: 100%; display: flex; flex-direction: column; gap: 12px; border: 1px solid #334155; box-sizing: border-box; margin-bottom: 15px; }

#mobile-top-bar { display: none; position: fixed; top: 10px; right: 10px; z-index: 1000; gap: 10px; align-items: center; }
#hamburger-btn { background: #6366f1; color: white; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; box-shadow: 0 4px 6px rgba(0,0,0,0.3); cursor: pointer; }
#beat-panel { position: fixed; top: 80px; right: 20px; width: 350px; background: rgba(26, 10, 0, 0.95); border: 2px solid #d4af37; border-radius: 20px; padding: 15px; z-index: 2500; display: none; box-shadow: 0 10px 30px rgba(0,0,0,0.8); }
.beat-indicator { width: 10px; height: 10px; border-radius: 2px; background: #331100; margin: 0 2px; }
.beat-active { background: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.mode-btn { padding: 4px 10px; border-radius: 20px; font-size: 10px; font-weight: bold; cursor: pointer; border: 1px solid #d4af37; color: #d4af37; }
.mode-active { background: #d4af37; color: #000; }

.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #475569; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #ef4444; }
input:checked + .slider:before { transform: translateX(22px); }
.btn-metro { background: #475569; border: 1px solid #64748b; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.btn-metro.active { background: #10b981; border-color: #059669; }

@media (max-width: 850px) {
    #pc-record-container, #desktop-menu-wrapper { display: none !important; } 
    #mobile-top-bar { display: flex; }
    .toolbox { padding-right: 110px; justify-content: flex-start; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; }
    .toolbox::-webkit-scrollbar { display: none; }
    .piano-container { height: 210px !important; padding: 0px !important; border-top: 2px solid #334155; }
    .piano-scroll-zone { height: 35px; }
    .keys-wrapper { height: calc(100% - 35px) !important; }
    #beat-panel { top: 50%; left: 50%; transform: translate(-50%, -50%); right: auto; width: 90%; max-width: 350px; }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .piano-container { height: 140px !important; }
    .piano-scroll-zone { height: 20px; }
    .keys-wrapper { height: calc(100% - 20px) !important; }
    .sheet-outer-container { margin: 5px auto; padding: 20px 0; border-width: 1px; }
    .controls { padding: 5px 10px; }
    .action-btn { height: 32px !important; font-size: 0.75rem !important; padding: 0 10px !important; }
    .toolbox { padding: 5px 12px; }
}