* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #050010;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #fff;
    min-height: 100vh;
}

.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* =============================================
   HOME SCREEN
   ============================================= */
#home-screen {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    overflow-y: auto;
    max-height: 100vh;
}

.home-header {
    text-align: center;
    padding: 40px 0 20px;
}

.home-logo {
    font-size: 56px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

#home-screen h1 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6ec4, #7873f5, #4fc3f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: rgba(255,255,255,0.45);
    font-size: 14px;
    margin-top: 4px;
}

.home-section { margin-top: 32px; }

.home-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 14px;
    padding-left: 4px;
}

/* Song Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.song-card {
    padding: 18px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.song-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-color, #7c4dff);
    opacity: 0;
    transition: opacity 0.2s;
}

.song-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.12);
}

.song-card:hover::before, .song-card.active::before { opacity: 1; }

.song-card.active {
    border-color: var(--card-color, #7c4dff);
    box-shadow: 0 0 20px color-mix(in srgb, var(--card-color) 30%, transparent);
}

.card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.card-name { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.card-sub { font-size: 11px; color: rgba(255,255,255,0.4); }

.card-play-badge {
    position: absolute;
    top: 10px; right: 10px;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

.song-card:hover .card-play-badge,
.song-card.active .card-play-badge { opacity: 0.8; }

/* Upload Area */
.upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: rgba(255,255,255,0.45);
    font-size: 14px;
}

.upload-area:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.03);
}

.upload-area-icon { font-size: 22px; }

/* Accompaniment Chips */
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.accomp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: rgba(255,255,255,0.65);
}

.accomp-chip:hover { background: rgba(255,255,255,0.1); color: #fff; }

.accomp-chip.active {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

.chip-icon { font-size: 16px; }

/* Resource Links */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.resource-category {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.resource-category h3 {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    margin-bottom: 10px;
}

.resource-item {
    display: block;
    padding: 6px 0;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    transition: color 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.resource-item:last-child { border-bottom: none; }
.resource-item:hover { color: #b388ff; }
.resource-item .res-name { font-weight: 600; }
.resource-item .res-desc { font-size: 11px; color: rgba(255,255,255,0.35); display: block; margin-top: 1px; }

/* =============================================
   PLAYER SCREEN
   ============================================= */
#player-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: #050010;
}

#canvas-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Canvas 2D */
#canvas-2d {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Engine Switch */
.engine-switch {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 2px;
}

.engine-btn {
    padding: 4px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.engine-btn:hover { color: rgba(255,255,255,0.7); }

.engine-btn.active {
    background: rgba(124, 77, 255, 0.3);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

/* HUD */
#hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.hud-left { display: flex; flex-direction: column; gap: 1px; }

#song-name {
    font-size: 13px; font-weight: 600;
    max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#time-display { font-size: 11px; color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; }

.hud-center { display: flex; align-items: center; gap: 12px; }

.bpm-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.bpm-control input[type=range] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
}

.bpm-control input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #b388ff;
    cursor: pointer;
}

/* Vis Mode Dropdown */
.vis-mode-dropdown {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    padding: 5px 28px 5px 10px;
    cursor: pointer;
    outline: none;
    transition: background 0.2s, border-color 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.5)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.vis-mode-dropdown:hover {
    background-color: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.25);
}

.vis-mode-dropdown:focus {
    border-color: rgba(124, 77, 255, 0.6);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.3);
}

.vis-mode-dropdown option {
    background: #1a1030;
    color: #fff;
}

.hud-right { display: flex; gap: 6px; }

.hud-right button {
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff; font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}

.hud-right button:hover { background: rgba(255,255,255,0.2); }

/* =============================================
   BOTTOM PANEL: NOTATION + VIRTUAL KEYBOARD
   ============================================= */
#bottom-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

/* Notation Panel */
#notation-panel {
    background: rgba(8, 4, 24, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
    height: 160px;
    transition: height 0.3s ease;
}

#notation-panel.collapsed { height: 36px; }
#notation-panel.collapsed .notation-canvas-wrap { display: none; }

.notation-toolbar {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 32px;
}

.tab-group { display: flex; gap: 4px; }

.tab-btn {
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

.tab-btn.active {
    background: rgba(124, 77, 255, 0.25);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

.toolbar-info { flex: 1; text-align: center; }
#edit-hint { font-size: 11px; color: rgba(255,255,255,0.3); }

.btn-icon {
    width: 26px; height: 26px;
    border: none; border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover { background: rgba(255,255,255,0.12); color: #fff; }

.notation-canvas-wrap {
    width: 100%;
    height: calc(100% - 34px);
    overflow: hidden;
}

#notation-canvas { width: 100%; height: 100%; display: block; }

/* =============================================
   VIRTUAL KEYBOARD
   ============================================= */
#virtual-keyboard-wrap {
    background: rgba(8, 4, 24, 0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 4px 12px 8px;
}

.vk-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    text-align: center;
    margin-bottom: 4px;
}

#virtual-keyboard {
    position: relative;
    display: flex;
    justify-content: center;
    height: 70px;
    gap: 2px;
    user-select: none;
    -webkit-user-select: none;
}

.vk-white {
    width: 48px;
    height: 70px;
    background: linear-gradient(to bottom, #f5f3ee 0%, #e8e5dd 100%);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 5px;
    transition: background 0.08s, box-shadow 0.08s;
    position: relative;
    z-index: 1;
}

.vk-white:hover { background: linear-gradient(to bottom, #fff 0%, #f0edea 100%); }

.vk-white.vk-active {
    background: linear-gradient(to bottom, #d4c8ff 0%, #b388ff 100%) !important;
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.6);
    transform: scaleY(0.97);
    transform-origin: top;
}

.vk-white .vk-label {
    font-size: 16px;
    font-weight: 700;
    color: rgba(0,0,0,0.5);
    line-height: 1;
}

.vk-white .vk-note {
    font-size: 9px;
    color: rgba(0,0,0,0.3);
    margin-top: 2px;
}

.vk-white.vk-active .vk-label { color: #fff; }
.vk-white.vk-active .vk-note { color: rgba(255,255,255,0.7); }

.vk-black-row {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45px;
    pointer-events: none;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.vk-black {
    position: absolute;
    width: 32px;
    height: 45px;
    background: linear-gradient(to bottom, #2a2a30 0%, #111115 100%);
    border: 1px solid rgba(0,0,0,0.4);
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    transition: background 0.08s, box-shadow 0.08s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.vk-black:hover { background: linear-gradient(to bottom, #3a3a42 0%, #1a1a20 100%); }

.vk-black.vk-active {
    background: linear-gradient(to bottom, #7c4dff 0%, #5c2ddf 100%) !important;
    box-shadow: 0 0 12px rgba(124, 77, 255, 0.5);
    transform: scaleY(0.95);
    transform-origin: top;
}

.vk-black .vk-label {
    font-size: 8px;
    color: rgba(255,255,255,0.4);
}

.vk-black.vk-active .vk-label { color: #fff; }

/* =============================================
   PITCH PICKER
   ============================================= */
.pitch-picker {
    position: fixed;
    z-index: 200;
    background: rgba(20, 12, 45, 0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    backdrop-filter: blur(16px);
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    transform: translateX(-50%) translateY(-100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    min-width: 100px;
}

.pitch-option {
    padding: 6px 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
    white-space: nowrap;
}

.pitch-option:hover { background: rgba(124, 77, 255, 0.2); color: #fff; }
.pitch-option.active { background: rgba(124, 77, 255, 0.35); color: #b388ff; font-weight: 600; }

/* =============================================
   AUTH UI
   ============================================= */
.home-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    margin-bottom: 8px;
}

/* Language Toggle */
.btn-lang {
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: auto;
    letter-spacing: 0.5px;
}

.btn-lang:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-status {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.auth-status.verified { color: #66ffaa; }
.auth-status.unverified { color: #ffaa44; }

.btn-auth {
    padding: 6px 18px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auth:hover {
    background: rgba(124, 77, 255, 0.2);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

#user-info.hidden { display: none; }

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c4dff, #e040fb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.user-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verified-badge {
    color: #66ffaa;
    font-size: 14px;
    font-weight: 700;
}

.btn-sm {
    padding: 2px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-sm:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    width: 380px;
    max-width: 92vw;
    background: rgba(16, 10, 35, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-tabs { display: flex; gap: 4px; }

.modal-tab {
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-tab:hover { color: #fff; }

.modal-tab.active {
    background: rgba(124, 77, 255, 0.25);
    border-color: rgba(124, 77, 255, 0.5);
    color: #b388ff;
}

.modal-close {
    width: 30px; height: 30px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}

.modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

.modal-body {
    padding: 20px 18px 24px;
}

.modal-body.hidden { display: none; }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: rgba(124, 77, 255, 0.5);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.2);
}

.form-group input::placeholder { color: rgba(255,255,255,0.2); }

.btn-primary {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c4dff, #e040fb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 4px;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.form-link {
    text-align: center;
    margin-top: 12px;
}

.form-link a {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s;
}

.form-link a:hover { color: #b388ff; }

.form-msg {
    margin-top: 12px;
    font-size: 12px;
    text-align: center;
    min-height: 16px;
}

.form-msg.error { color: #ff5555; }
.form-msg.success { color: #66ffaa; }

/* =============================================
   GAME SCREEN
   ============================================= */
#game-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    background: linear-gradient(135deg, #0a0020 0%, #120830 50%, #0a0018 100%);
    overflow: hidden;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-top-bar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 16px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.game-back-btn {
    width: 36px; height: 36px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: #fff; font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.game-back-btn:hover { background: rgba(255,255,255,0.15); }

.game-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6ec4, #7873f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.game-stats {
    display: flex;
    gap: 16px;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    transition: transform 0.2s, color 0.2s;
}

.stat-value.streak-hot { color: #ffaa00; }
.stat-value.streak-fire { color: #ff4444; text-shadow: 0 0 10px rgba(255,60,60,0.5); }

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

.game-prompt {
    font-size: 20px;
    color: rgba(255,255,255,0.8);
    text-align: center;
    max-width: 500px;
    line-height: 1.5;
    min-height: 30px;
}

.game-play-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-play-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    border: 2px solid rgba(124, 77, 255, 0.5);
    border-radius: 50px;
    background: rgba(124, 77, 255, 0.15);
    color: #b388ff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.game-play-btn:hover {
    background: rgba(124, 77, 255, 0.3);
    border-color: rgba(124, 77, 255, 0.8);
    transform: scale(1.05);
}

.game-play-btn.playing {
    animation: pulse-play 0.6s ease;
}

@keyframes pulse-play {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(124, 77, 255, 0.4); }
    100% { transform: scale(1); }
}

.play-icon { font-size: 22px; }

.game-answers {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
}

.game-answer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 120px;
    justify-content: center;
}

.game-answer-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.game-answer-btn:active {
    transform: scale(0.97);
}

.game-answer-btn.correct {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: rgba(76, 175, 80, 0.7) !important;
    color: #66ff88 !important;
    animation: pop-correct 0.3s ease;
}

.game-answer-btn.wrong {
    background: rgba(244, 67, 54, 0.3) !important;
    border-color: rgba(244, 67, 54, 0.7) !important;
    color: #ff6666 !important;
    animation: shake-wrong 0.3s ease;
}

.game-answer-btn:disabled {
    pointer-events: none;
    opacity: 0.7;
}

@keyframes pop-correct {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shake-wrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.answer-icon { font-size: 20px; }

.note-btn {
    font-size: 18px;
    min-width: 100px;
    font-family: 'Segoe UI', monospace;
}

.interval-btn {
    font-size: 14px;
    min-width: 110px;
}

.game-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: feedback-in 0.3s ease;
    pointer-events: none;
}

.feedback-correct {
    background: rgba(76, 175, 80, 0.25);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #66ff88;
    backdrop-filter: blur(10px);
}

.feedback-wrong {
    background: rgba(244, 67, 54, 0.25);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ff8888;
    backdrop-filter: blur(10px);
}

.feedback-icon { font-size: 28px; }

@keyframes feedback-in {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.game-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
}

.game-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c4dff, #e040fb);
    transition: width 0.5s ease;
    border-radius: 2px;
}

/* Game card highlight */
.game-card:hover {
    border-color: var(--card-color) !important;
}

/* Keyboard badge on answer buttons */
.kbd-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-left: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

.kbd-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-left: 6px;
}

/* Keyboard hint bar at bottom of game */
.game-kbd-bar {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

/* Theory tip bubble */
.game-theory-tip {
    max-width: 520px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.25);
    color: rgba(200, 230, 255, 0.85);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    animation: feedback-in 0.3s ease;
}

/* Timbre & Chord button variants */
.timbre-btn {
    min-width: 110px;
    font-size: 15px;
}

.chord-btn {
    min-width: 120px;
    font-size: 14px;
}

/* =============================================
   NEXT BUTTON + COUNTDOWN
   ============================================= */
.game-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 40px;
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 50px;
    background: rgba(76, 175, 80, 0.15);
    color: #66ff88;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    animation: feedback-in 0.3s ease;
}

.game-next-btn:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.8);
    transform: scale(1.05);
}

.game-countdown-bar {
    width: 300px;
    max-width: 80%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.game-countdown-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c4dff, #e040fb);
    border-radius: 2px;
    transition: none;
    width: 100%;
}

/* =============================================
   RHYTHM TAP / WHEEL
   ============================================= */
.rhythm-tap-container {
    overflow-y: auto;
}

.rhythm-tap-body {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.rhythm-tap-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#rhythm-wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(124,77,255,0.2);
}

.rhythm-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.rhythm-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.rhythm-control-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.rhythm-control-row select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 12px;
    outline: none;
}

.rhythm-control-row select option {
    background: #1a1030;
    color: #fff;
}

.rhythm-control-row input[type=range] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
}

.rhythm-control-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #ff5722;
    cursor: pointer;
}

.rhythm-timesig-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.rt-timesig-btn {
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.rt-timesig-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.rt-timesig-btn.active {
    background: rgba(255,87,34,0.25);
    border-color: rgba(255,87,34,0.6);
    color: #ff8a65;
}

.rhythm-tap-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 340px;
    min-width: 260px;
}

.rhythm-knowledge-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
}

.rhythm-knowledge-card h3 {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    font-weight: 600;
}

#rhythm-knowledge-content {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
}

#rhythm-knowledge-content b {
    color: #ff8a65;
}

.rhythm-tap-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.rt-tap-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(255,87,34,0.5);
    background: rgba(255,87,34,0.15);
    color: #ff8a65;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
}

.rt-tap-btn:hover {
    background: rgba(255,87,34,0.25);
    border-color: rgba(255,87,34,0.8);
}

.rt-tap-btn.rt-tap-active {
    transform: scale(0.92);
    background: rgba(255,87,34,0.5);
    box-shadow: 0 0 30px rgba(255,87,34,0.4);
}

.rt-start-btn {
    padding: 12px 32px;
    border: 2px solid rgba(255,87,34,0.5);
    border-radius: 30px;
    background: rgba(255,87,34,0.15);
    color: #ff8a65;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rt-start-btn:hover {
    background: rgba(255,87,34,0.3);
    transform: scale(1.05);
}

.rt-rating-display {
    font-size: 22px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 12px;
    animation: feedback-in 0.2s ease;
    text-align: center;
    min-height: 40px;
}

.rt-rating-perfect {
    color: #ffd700;
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.3);
}

.rt-rating-great {
    color: #66ff88;
    background: rgba(76,175,80,0.15);
    border: 1px solid rgba(76,175,80,0.3);
}

.rt-rating-good {
    color: #80d8ff;
    background: rgba(33,150,243,0.15);
    border: 1px solid rgba(33,150,243,0.3);
}

.rt-rating-miss {
    color: #ff6666;
    background: rgba(244,67,54,0.15);
    border: 1px solid rgba(244,67,54,0.3);
}

.rt-rating-info {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    font-weight: 600;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
    #home-screen { padding: 20px 14px 40px; }
    .home-header { padding: 24px 0 12px; }
    #home-screen h1 { font-size: 24px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .song-card { padding: 14px 12px; }
    .resource-grid { grid-template-columns: 1fr; }
    #notation-panel { height: 130px; }
    #virtual-keyboard { height: 60px; }
    .vk-white { width: 38px; height: 60px; }
    .vk-black { width: 26px; height: 38px; }
    .hud-center { flex-wrap: wrap; gap: 6px; }
    .bpm-control { display: none; }
    .game-prompt { font-size: 16px; }
    .game-answer-btn { padding: 12px 20px; font-size: 14px; min-width: 90px; }
    .game-play-btn { padding: 12px 28px; font-size: 15px; }
    .game-stats { gap: 10px; }
    .stat-value { font-size: 16px; }
    .game-title { font-size: 15px; }
    .rhythm-tap-body { flex-direction: column; align-items: center; padding: 12px; gap: 16px; }
    #rhythm-wheel-canvas { width: 220px; height: 220px; }
    .rhythm-controls { width: 100%; }
    .rhythm-tap-right { max-width: 100%; min-width: 0; }
    .rt-tap-btn { width: 90px; height: 90px; font-size: 18px; }
    .game-next-btn { padding: 10px 28px; font-size: 15px; }
}
