/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    height: 100dvh;
    overflow: auto !important;
    background: #0f0f0f;
    color: white;
    font-family: 'Courier New', Courier, 'Liberation Mono', monospace;
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 10px;
    padding-bottom: 80px;
    overflow: hidden;
    background: #0f0f0f;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    flex-shrink: 0;
    text-align: center;
    padding: 5px 0;
    margin-bottom: 8px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: #ffcc00;
    font-family: Arial, sans-serif;
}

#songTitle {
    color: #ffcc00;
    font-size: 1rem;
    margin: 4px 0;
    font-weight: normal;
    font-family: Arial, sans-serif;
}

#keyDisplay {
    color: #00ffcc;
    margin-top: 2px;
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
}

.home-btn {
    background: #2a2a4e;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    min-height: 40px;
    min-width: 40px;
}

.logout-btn {
    background: #4a2a2a !important;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 40px;
    min-width: 40px;
}

.logout-btn:hover {
    background: #5a3a3a !important;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px 0;
    flex-shrink: 0;
    position: relative;
}

#searchInput {
    flex: 1;
    padding: 10px 14px;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    outline: none;
    transition: border-color 0.3s;
    min-height: 44px;
}

#searchInput:focus {
    border-color: #4fc3f7;
}

#searchInput::placeholder {
    color: #666;
}

#clearSearchBtn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 10px;
    min-height: 44px;
    min-width: 44px;
    display: none;
}

#clearSearchBtn:hover {
    color: #fff;
}

/* ============================================
   SONG LIST
   ============================================ */
.song-list {
    flex: 0 0 auto;
    max-height: 160px;
    overflow-y: auto;
    background: #151515;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 8px;
}

.song-list button {
    width: 100%;
    margin: 3px 0;
    padding: 10px 12px;
    text-align: left;
    background: #1a1a2e;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 40px;
    font-family: Arial, sans-serif;
}

.song-list button:active {
    background: #2a2a4e;
}

.loading-text,
.empty-text,
.error-text {
    text-align: center;
    padding: 20px;
    color: #888;
    font-family: Arial, sans-serif;
}

.error-text {
    color: #ff4444;
}

.result-count {
    color: #888;
    font-size: 0.8rem;
    padding: 8px 10px 4px 10px;
    font-family: Arial, sans-serif;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 4px;
}

.scroll-hint {
    color: #666;
    font-size: 0.8rem;
    text-align: center;
    padding: 6px;
    font-family: Arial, sans-serif;
    border-top: 1px solid #2a2a2a;
    margin-top: 4px;
    animation: pulse 2s infinite;
}

.hidden-result {
    display: block;
}

/* ============================================
   OUTPUT - LYRICS
   ============================================ */
.output {
    flex: 1 1 auto !important;
    height: 0 !important;
    min-height: 150px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #1b1b1b;
    padding: 15px 15px;
    border-radius: 10px;
    font-family: 'Courier New', Courier, 'Liberation Mono', monospace !important;
    white-space: pre !important;
    word-wrap: normal !important;
    text-align: left;
    font-size: 16px;
    line-height: 1.4 !important;
    border: 1px solid #2a2a2a;
    position: relative;
    transition: border-color 0.3s;
    -webkit-overflow-scrolling: touch;
}

.output.scrolling {
    border-color: #4fc3f7;
}

/* ============================================
   CHORD & LYRICS ROWS
   ============================================ */
.chord-row {
    font-family: 'Courier New', Courier, 'Liberation Mono', monospace !important;
    font-size: 16px;
    line-height: 1.2 !important;
    color: #00ffcc !important;
    font-weight: bold !important;
    white-space: pre !important;
    letter-spacing: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lyric-row {
    font-family: 'Courier New', Courier, 'Liberation Mono', monospace !important;
    font-size: 16px;
    line-height: 1.2 !important;
    color: #ffffff !important;
    white-space: pre !important;
    padding: 0 !important;
    margin: 0 !important;
}

.line-spacer {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   SPEED INDICATOR & TAP HINT
   ============================================ */
.speed-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #4fc3f7;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: none;
    pointer-events: none;
    z-index: 10;
    font-family: Arial, sans-serif;
}

.output.scrolling::after {
    content: '👆 Tap to stop';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    animation: pulse 2s infinite;
    pointer-events: none;
    z-index: 5;
    font-family: Arial, sans-serif;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.output::-webkit-scrollbar {
    width: 5px;
}
.output::-webkit-scrollbar-track {
    background: #1b1b1b;
}
.output::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

.song-list::-webkit-scrollbar {
    width: 4px;
}
.song-list::-webkit-scrollbar-track {
    background: #151515;
}
.song-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

/* ============================================
   FLOATING CONTROL BAR
   ============================================ */
.floating-bar {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(15, 15, 15, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 14px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    border: 1px solid #2a2a2a;
    flex-wrap: nowrap;
}

.floating-bar button {
    font-size: 1rem;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    background: #1a1a2e;
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.2s, transform 0.1s;
}

.floating-bar button:active {
    background: #2a2a4e;
    transform: scale(0.92);
}

/* ============================================
   INDEX PAGE
   ============================================ */
.index-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(145deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
    padding: 20px;
    overflow-y: auto;
}

.index-card {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 50px 45px;
    max-width: 520px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.index-card:hover {
    transform: translateY(-4px);
}

.index-header {
    margin-bottom: 10px;
}

.index-icon {
    font-size: 4rem;
    margin-bottom: 8px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.index-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.index-header h1 .color-asli {
    background: linear-gradient(135deg, #ffcc00 0%, #f5a623 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.index-header h1 .color-busker {
    background: linear-gradient(135deg, #ff8800 0%, #e65c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.index-header h1 .color-chords {
    background: linear-gradient(135deg, #ff4400 0%, #cc0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.index-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    margin-top: 4px;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
}

.index-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ffcc00, #ff8800);
    border-radius: 10px;
    margin: 20px auto 30px;
}

.index-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.index-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.index-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.index-btn:hover::before {
    opacity: 1;
}

.index-btn:active {
    transform: scale(0.97);
}

.index-btn-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.index-btn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.index-btn-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.index-btn-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
}

.index-btn-arrow {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.index-btn:hover .index-btn-arrow {
    color: #fff;
    transform: translateX(4px);
}

.admin-btn {
    background: linear-gradient(135deg, #2a1a4e, #3a2a6e);
    border: 1px solid rgba(74, 58, 142, 0.4);
}

.admin-btn .index-btn-icon {
    background: rgba(74, 58, 142, 0.3);
}

.admin-btn:hover {
    border-color: rgba(74, 58, 142, 0.8);
    box-shadow: 0 8px 30px rgba(74, 58, 142, 0.3);
}

.viewer-btn {
    background: linear-gradient(135deg, #1a2a4e, #2a4a6e);
    border: 1px solid rgba(58, 106, 142, 0.4);
}

.viewer-btn .index-btn-icon {
    background: rgba(58, 106, 142, 0.3);
}

.viewer-btn:hover {
    border-color: rgba(58, 106, 142, 0.8);
    box-shadow: 0 8px 30px rgba(58, 106, 142, 0.3);
}

.dashboard-btn {
    background: linear-gradient(135deg, #1a3a2e, #2a5a4e) !important;
    border: 1px solid rgba(58, 142, 106, 0.4) !important;
}

.dashboard-btn .index-btn-icon {
    background: rgba(58, 142, 106, 0.3) !important;
}

.dashboard-btn:hover {
    border-color: rgba(58, 142, 106, 0.8) !important;
    box-shadow: 0 8px 30px rgba(58, 142, 106, 0.3) !important;
}

.index-footer {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
.fullscreen-mode .header,
.fullscreen-mode .search-container,
.fullscreen-mode .song-list,
.fullscreen-mode .floating-bar,
.fullscreen-mode .home-btn,
.fullscreen-mode .logout-btn,
.fullscreen-mode a[href="list.html"] {
    display: none !important;
}

.fullscreen-mode .app {
    padding: 0 !important;
    padding-bottom: 0 !important;
    background: #0f0f0f !important;
}

.fullscreen-mode .output {
    border-radius: 0 !important;
    border: none !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 15px 10px !important;
    font-size: clamp(13px, 3.5vw, 20px) !important;
    line-height: 1.5 !important;
    background: #0f0f0f !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

.fullscreen-mode .chord-row {
    font-size: clamp(13px, 3.5vw, 20px) !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    line-height: 1.3 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.fullscreen-mode .lyric-row {
    font-size: clamp(13px, 3.5vw, 20px) !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.5 !important;
    padding: 0 !important;
    margin: 0 0 4px 0 !important;
}

/* ============================================
   TRANSPOSE POPUP MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a2e;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    border: 1px solid #2a2a4e;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a4e;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #ffcc00;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 8px;
    font-family: Arial, sans-serif;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-current-key {
    font-family: Arial, sans-serif;
    font-size: 1.1rem;
    color: #aaa;
    padding: 10px 0 16px 0;
    border-bottom: 1px solid #2a2a4e;
    margin-bottom: 16px;
}

.modal-enharmonic {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0 16px 0;
    border-bottom: 1px solid #2a2a4e;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.modal-enharmonic span {
    font-family: Arial, sans-serif;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2a2a4e;
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: #888;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #ff8800;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: #fff;
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

.key-list-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}

.key-item {
    padding: 10px 16px;
    background: #151515;
    border-radius: 8px;
    color: #ccc;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.key-item:hover {
    background: #2a2a4e;
    color: #fff;
}

.key-item.highlight-key {
    background: linear-gradient(135deg, #ffcc00, #ff8800) !important;
    color: #0f0f0f !important;
    font-weight: bold !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.key-item.highlight-key:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #2a2a4e;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.modal-cancel-btn {
    background: #2a2a4e;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.2s;
}

.modal-cancel-btn:hover {
    background: #3a3a6e;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */
.dashboard-wrapper {
    display: block !important;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto !important;
    background: linear-gradient(145deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
    padding: 20px;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.dashboard-card {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 40px 35px;
    max-width: 800px;
    width: 100%;
    min-height: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    margin: 0 auto;
}

.dashboard-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    font-size: 2rem;
    margin: 0;
    color: #ffcc00;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    margin-top: 4px;
    font-family: Arial, sans-serif;
}

.dashboard-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ffcc00, #ff8800);
    border-radius: 10px;
    margin: 20px 0 25px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #2a2a4e;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffcc00;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-top: 4px;
    font-family: Arial, sans-serif;
}

.dashboard-section {
    margin-top: 25px;
}

.dashboard-section h3 {
    color: #aaa;
    font-size: 1.1rem;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
    background: #151515;
    border-radius: 10px;
    padding: 5px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 14px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid #2a2a4e;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #2a2a4e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: bold;
    color: #fff;
    font-family: Arial, sans-serif;
}

.user-email {
    font-size: 0.8rem;
    color: #888;
    font-family: Arial, sans-serif;
}

.user-login {
    font-size: 0.7rem;
    color: #666;
    font-family: Arial, sans-serif;
}

.user-count {
    font-size: 0.8rem;
    color: #4fc3f7;
    font-family: Arial, sans-serif;
    white-space: nowrap;
}

.song-list-dashboard {
    max-height: 250px;
    overflow-y: auto;
    background: #151515;
    border-radius: 10px;
    padding: 5px;
}

.song-item-dashboard {
    padding: 10px 14px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 4px;
    border: 1px solid #2a2a4e;
    color: #fff;
    font-family: Arial, sans-serif;
}

.dashboard-footer {
    margin-top: 25px;
    text-align: center;
}

.back-btn {
    background: #2a2a4e;
    color: white;
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #3a3a6e;
}

.back-btn:active {
    transform: scale(0.96);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app {
        padding: 8px;
        padding-bottom: 80px;
    }

    .header h2 { font-size: 1rem; }
    #songTitle { font-size: 0.95rem; }
    #keyDisplay { font-size: 0.85rem; }

    .song-list { max-height: 120px; }
    .song-list button {
        font-size: 0.85rem;
        padding: 8px 10px;
        min-height: 36px;
    }

    .output {
        font-size: 18px;
        padding: 12px;
        min-height: 120px;
    }

    .chord-row { font-size: 18px; }
    .lyric-row { font-size: 18px; }

    .floating-bar {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        justify-content: space-around;
        padding: 8px 5px;
        gap: 4px;
        border: none;
        border-top: 1px solid #2a2a2a;
        background: rgba(15, 15, 15, 0.95);
    }

    .floating-bar button {
        flex: 1;
        font-size: 1.1rem;
        padding: 12px 0;
        min-height: 48px;
        min-width: 0;
        margin: 0 2px;
    }

    .search-container {
        padding: 0 0 6px 0;
    }

    #searchInput {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 38px;
    }

    #clearSearchBtn {
        right: 6px;
        min-height: 38px;
        min-width: 38px;
        font-size: 1rem;
    }

    .index-card {
        padding: 35px 25px;
        border-radius: 24px;
    }

    .index-header h1 {
        font-size: 2.2rem;
    }

    .index-icon {
        font-size: 3rem;
    }

    .index-btn {
        padding: 14px 18px;
        gap: 12px;
    }

    .index-btn-icon {
        font-size: 1.5rem;
        width: 42px;
        height: 42px;
    }

    .index-btn-label {
        font-size: 1rem;
    }

    .index-btn-desc {
        font-size: 0.7rem;
    }

    .fullscreen-mode .output {
        padding: 12px 8px !important;
    }

    .modal-content {
        max-width: 95%;
        margin: 10px;
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px 18px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 16px 18px;
    }

    .key-item {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .key-list-container {
        max-height: 250px;
    }

    .modal-enharmonic {
        gap: 8px;
    }

    .dashboard-card {
        padding: 25px 20px;
        border-radius: 24px;
    }

    .dashboard-header h2 {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .user-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .user-count {
        width: 100%;
        text-align: right;
    }

    .user-list {
        max-height: 200px;
    }

    .song-list-dashboard {
        max-height: 180px;
    }
}

@media (max-width: 400px) {
    .app { padding: 5px; padding-bottom: 75px; }
    .header h2 { font-size: 0.9rem; }
    #songTitle { font-size: 0.85rem; }

    .output {
        font-size: 16px;
        padding: 10px;
        min-height: 100px;
    }

    .chord-row { font-size: 16px; }
    .lyric-row { font-size: 16px; }

    .floating-bar button {
        font-size: 0.9rem;
        padding: 10px 0;
        min-height: 42px;
    }

    .song-list { max-height: 100px; }
    .song-list button {
        font-size: 0.8rem;
        padding: 6px 8px;
        min-height: 32px;
    }

    .fullscreen-mode .output {
        padding: 10px 6px !important;
    }

    .modal-content {
        padding: 0;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-body {
        padding: 12px 14px;
    }

    .key-item {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .key-list-container {
        max-height: 200px;
    }
}

@media (min-width: 769px) {
    .app {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        padding-bottom: 100px;
    }

    .output {
        font-size: 18px;
        min-height: 300px;
    }

    .chord-row { font-size: 18px; }
    .lyric-row { font-size: 18px; }

    .song-list { max-height: 200px; }

    .floating-bar {
        gap: 10px;
        padding: 10px 20px;
    }
    .floating-bar button {
        padding: 10px 18px;
        min-width: 50px;
    }
    .floating-bar button:hover {
        background: #2a2a4e;
    }

    .index-card {
        padding: 60px 55px;
        max-width: 560px;
    }

    .index-header h1 {
        font-size: 3.2rem;
    }

    .index-btn {
        padding: 22px 28px;
    }

    .index-btn-icon {
        width: 56px;
        height: 56px;
        font-size: 2.2rem;
    }

    .index-btn-label {
        font-size: 1.3rem;
    }

    .fullscreen-mode .output {
        padding: 30px 20px !important;
        font-size: 20px !important;
    }

    .fullscreen-mode .chord-row {
        font-size: 20px !important;
    }

    .fullscreen-mode .lyric-row {
        font-size: 20px !important;
    }

    .modal-content {
        max-width: 480px;
    }

    .key-item:hover {
        background: #2a2a4e;
        transform: scale(1.02);
    }

    .dashboard-card {
        padding: 40px 35px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.song-list button {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   UTILITY
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }