/* Modern Futuristic Virtual Marimba Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --accent-gradient: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --shadow-primary: 0 20px 60px rgba(31, 38, 135, 0.3);
    --shadow-hover: 0 30px 80px rgba(31, 38, 135, 0.4);
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Universal hidden class for consistent element hiding */
.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(45deg, #0f0f0f, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 20px;
}

.loading-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.loading-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: floatParticle 4s infinite linear;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* Main Body Styles */
body {
    margin: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', Arial, sans-serif;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    color: #fff;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(600px circle at 50% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Ambient Particles */
.ambient-particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Header Navigation */
.header-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease-in-out;
}

.header-nav.hidden {
    transform: translateY(-100%);
}

.nav-button {
    padding: 10px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

/* Main Container */
.main-container {
    padding-top: 82px;
    padding-bottom: 5px;
    padding-left: 15px;
    padding-right: 15px;
    height: calc(100vh - 127px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Page Title */
.page-title {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
    margin: 40px 0 60px 0;
    letter-spacing: -0.02em;
}

/* Marimba Container - Full Width Design */
.marimba-container {
    width: 100%;
    max-width: none;
    padding: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 127px);
}

.marimba-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

/* Drum Machine Overlay */
.drum-machine-window {
    position: absolute;
    inset: 72px 22px auto auto;
    z-index: 5000;
    width: min(920px, calc(100% - 44px));
    max-height: calc(100% - 100px);
    display: none;
    pointer-events: none;
}

.drum-machine-window.open {
    display: block;
}

.drum-machine-panel {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    background:
        linear-gradient(135deg, rgba(12, 16, 27, 0.96), rgba(31, 20, 34, 0.94)),
        radial-gradient(circle at top left, rgba(248, 113, 113, 0.2), transparent 36%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    color: white;
    overflow: hidden;
}

.drum-machine-header,
.drum-machine-toolbar,
.drum-pattern-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drum-machine-header {
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.drum-machine-window.dragging .drum-machine-header {
    cursor: grabbing;
}

.drum-machine-window.dragging .drum-machine-panel {
    box-shadow: 0 32px 86px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.drum-machine-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.drum-machine-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f97316, #38bdf8);
    color: #07111f;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0;
}

.drum-machine-title-wrap h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0;
}

.drum-machine-title-wrap p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

.drum-machine-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.drum-machine-close:hover {
    background: rgba(248, 113, 113, 0.28);
    border-color: rgba(248, 113, 113, 0.5);
}

.drum-machine-toolbar {
    padding: 12px 16px 8px;
    flex-wrap: wrap;
}

.drum-pattern-tools {
    padding: 0 16px 12px;
    flex-wrap: wrap;
}

.drum-transport-btn,
.drum-tool-btn,
.drum-stepper-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    color: white;
    min-height: 34px;
    padding: 0 12px;
    font-weight: 700;
    cursor: pointer;
}

.drum-transport-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(14, 165, 233, 0.22));
}

.drum-transport-btn[data-playing="true"] {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.34), rgba(249, 115, 22, 0.28));
}

.drum-tool-btn:hover,
.drum-stepper-btn:hover,
.drum-transport-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.34);
}

.drum-tool-btn.danger:hover {
    background: rgba(248, 113, 113, 0.24);
    border-color: rgba(248, 113, 113, 0.5);
}

.drum-tempo-control,
.drum-step-length-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.drum-tempo-control label,
.drum-step-length-control label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 800;
}

#drum-bpm-input,
#drum-step-count,
#drum-pattern-name,
#drum-pattern-select {
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.34);
    color: white;
    padding: 0 10px;
    font-weight: 700;
}

#drum-bpm-input {
    width: 72px;
    text-align: center;
}

#drum-step-count {
    width: 68px;
    text-align: center;
}

#drum-pattern-name {
    width: 180px;
}

#drum-pattern-select {
    width: 210px;
}

.drum-sequencer {
    display: grid;
    grid-template-columns: 112px repeat(var(--drum-steps, 16), minmax(28px, 1fr));
    gap: 6px;
    padding: 0 16px 16px;
    overflow-x: auto;
}

.drum-row-label,
.drum-step-index,
.drum-pad {
    height: 30px;
    border-radius: 7px;
}

.drum-row-label {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.78rem;
    font-weight: 800;
}

.drum-step-index {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
    font-weight: 800;
}

.drum-step-index.measure {
    color: rgba(255, 255, 255, 0.86);
}

.drum-pad {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    min-width: 28px;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.drum-pad:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.34);
}

.drum-pad.active {
    background: var(--drum-active, #38bdf8);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 18px color-mix(in srgb, var(--drum-active, #38bdf8) 48%, transparent);
}

.drum-pad.playhead,
.drum-step-index.playhead {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 1px;
}

@media (max-width: 900px) {
    .drum-machine-window {
        inset: 64px 12px auto 12px;
        width: auto;
    }

    .drum-sequencer {
        grid-template-columns: 98px repeat(var(--drum-steps, 16), 30px);
    }
}

/* Marimba Controls */
.marimba-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 3;
}

/* Settings Dropdown */
.settings-dropdown-container {
    position: relative;
    display: flex;
    justify-content: flex-end;
    z-index: 2000;
}

.settings-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.settings-toggle:hover {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.settings-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.settings-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 350px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(31, 38, 135, 0.3);
    padding: 20px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2001;
}

/* Marimba Type button and dropdown should be lowest priority */
#marimba-type-toggle {
    z-index: 1999;
}

#marimba-type-dropdown {
    z-index: 2000;
}

/* Marimba Settings dropdown should be higher than Learn How to Play */
#settings-dropdown {
    z-index: 2002;
}

/* Keep Learn How to Play dropdown above keys */
#songs-dropdown {
    z-index: 3000;
}

#songs-toggle,
#songs-toggle.settings-toggle,
#songs-toggle ~ * {
    z-index: 2500;
}

.settings-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.song-browser {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 340px;
    backdrop-filter: blur(6px);
}

.song-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.8);
}

.song-search-icon {
    font-size: 0.95rem;
}

.song-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.song-category-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 6px;
}

.song-category-list::-webkit-scrollbar {
    width: 6px;
}

.song-category-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.song-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-category.hidden {
    display: none;
}

.song-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 2px 10px;
    letter-spacing: 1px;
}

.song-item-group {
    display: grid;
    gap: 8px;
}

.song-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.song-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.song-feature-badge {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    text-transform: uppercase;
}

.song-badge-audio {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.32);
    background: rgba(59, 130, 246, 0.14);
}

.song-badge-score {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.32);
    background: rgba(245, 158, 11, 0.13);
}

.song-badge-progress {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, 0.32);
    background: rgba(139, 92, 246, 0.13);
}

.song-badge-complete {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.32);
    background: rgba(34, 197, 94, 0.13);
}

.song-item:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.18);
}

.song-item.selected {
    border-color: rgba(102, 126, 234, 0.85);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.25);
}

.song-item.coming-soon {
    cursor: default;
    opacity: 0.5;
    border-style: dashed;
    pointer-events: none;
}

.song-item.hidden {
    display: none;
}

.song-empty-state {
    text-align: center;
    font-size: 0.9rem;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.song-select-native {
    display: none;
}

.play-mode-toggle,
.rumble-toggle {
    position: relative;
    width: 120px;
    height: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.play-mode-toggle:hover,
.rumble-toggle:hover {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 54px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow:
        0 4px 12px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-mode-toggle[data-mode="hover"] .toggle-slider {
    transform: translateX(57px);
    background: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
    box-shadow:
        0 4px 12px rgba(52, 152, 219, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rumble-toggle[data-rumble="on"] .toggle-slider {
    transform: translateX(57px);
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    box-shadow:
        0 4px 12px rgba(231, 76, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.toggle-text-left,
.toggle-text-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toggle-text-left {
    left: 15px;
}

.toggle-text-right {
    right: 15px;
}

.play-mode-toggle[data-mode="click"] .toggle-text-left {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.play-mode-toggle[data-mode="hover"] .toggle-text-right {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.rumble-toggle[data-rumble="off"] .toggle-text-left {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.rumble-toggle[data-rumble="on"] .toggle-text-right {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.mode-description,
.rumble-description,
.speed-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Speed Control */
.speed-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

/* Speed Labels */
.speed-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    padding: 0 5px;
}

.speed-label-left,
.speed-label-center,
.speed-label-right {
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

.speed-label-left {
    color: #4ade80; /* Green for slow */
}

.speed-label-center {
    color: #fbbf24; /* Yellow for medium */
}

.speed-label-right {
    color: #f87171; /* Red for fast */
}

#rumble-speed {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#rumble-speed::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

#rumble-speed::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    border: none;
}

#rumble-speed-display {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(243, 156, 18, 0.2) 100%);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 4px 8px;
    backdrop-filter: blur(5px);
}

/* Metronome Indicator */
.metronome-indicator {
    position: relative;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(41, 128, 185, 0.05) 100%);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 5;
    cursor: pointer;
}

.metronome-indicator.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(41, 128, 185, 0.2) 100%);
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.tab-key {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(41, 128, 185, 0.1) 100%);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.metronome-indicator.active .tab-key {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.4) 0%, rgba(41, 128, 185, 0.3) 100%);
    border-color: rgba(52, 152, 219, 0.7);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.5);
}

/* TRG Style Indicator */
.trg-style-indicator {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.trg-style-indicator.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 165, 0, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.caps-key {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.trg-style-indicator.active .caps-key {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 165, 0, 0.3) 100%);
    border-color: rgba(255, 215, 0, 0.7);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

/* Shift Rumble Indicator */
.shift-rumble-indicator {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.shift-rumble-indicator.active {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.3) 0%, rgba(52, 152, 219, 0.2) 100%);
    border-color: rgba(142, 68, 173, 0.5);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
    transform: translateY(-2px);
}

.shift-key {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.shift-rumble-indicator.active .shift-key {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.4) 0%, rgba(52, 152, 219, 0.3) 100%);
    border-color: rgba(142, 68, 173, 0.6);
    color: white;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.4);
}

/* Ctrl Hover Indicator */
.ctrl-hover-indicator {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.ctrl-hover-indicator.active {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3) 0%, rgba(39, 174, 96, 0.2) 100%);
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transform: translateY(-2px);
}

.ctrl-key {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 4px;
    transition: all 0.3s ease;
}

.ctrl-hover-indicator.active .ctrl-key {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4) 0%, rgba(39, 174, 96, 0.3) 100%);
    border-color: rgba(46, 204, 113, 0.6);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

/* Help Icon for Indicators */
.help-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 17px;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    cursor: help;
    margin-left: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    position: relative;
}

.help-icon:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    color: white;
}

/* Custom Tooltip - Position to the right */
.help-icon::after {
    content: attr(title);
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    line-height: 1.4;
    text-align: left;
}

.help-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Tooltip Arrow - Point to the left */
.help-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(100% + 2px);
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(0, 0, 0, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1001;
}

.help-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Marimba Keys Container */
.marimba-keys {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin: 20px auto 40px auto;
    max-width: 100%;
    position: relative;
    z-index: 2;
    flex-wrap: nowrap;
    padding: 0 20px;
}

/* Individual Marimba Keys */
.marimba-note {
    min-width: 70px;
    width: 70px;
    flex-shrink: 0;
    height: clamp(180px, 25vh, 280px);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    backdrop-filter: blur(5px);
}

.marimba-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    border-radius: 10px;
    pointer-events: none;
}

.marimba-note span {
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    z-index: 3;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.marimba-note:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 255, 255, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.marimba-note:active,
.marimba-note.played {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 255, 255, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    animation: noteGlow 0.6s ease-out;
}

.marimba-note.highlight {
    animation: highlight 0.8s ease;
}

@keyframes noteGlow {
    0% {
        box-shadow:
            0 20px 50px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(255, 255, 255, 0.8);
    }
    100% {
        box-shadow:
            0 8px 25px rgba(0, 0, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.2);
    }
}

@keyframes highlight {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 50px rgba(102, 126, 234, 0.8),
            0 20px 40px rgba(102, 126, 234, 0.4);
        transform: translateY(-12px) scale(1.1);
    }
}

/* Super Soprano Extension Button */
.soprano-extension-btn {
    align-self: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.soprano-extension-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* Controls Section */
.controls-section {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    padding: 30px;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: var(--shadow-primary);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: start;
}

.control-group {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group h3 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 5px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
}

.btn-accent {
    background: var(--accent-gradient);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

/* Form Controls */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    margin: 8px 0;
}

select option {
    background: #14162b;
    color: #f8fafc;
}

select option:checked {
    background: linear-gradient(135deg, #312e81, #4c1d95);
    color: #ffffff;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Cheat Sheet Toggle */
.cheat-sheet-toggle {
    text-align: center;
    margin: 15px 0 10px 0;
}

.toggle-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.toggle-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.toggle-icon {
    font-size: 0.9rem;
}

/* Cheat Sheet Container */
.cheat-sheet-container {
    margin-top: 10px;
    padding: 15px 0;
    transition: all 0.3s ease;
    opacity: 1;
    max-height: 220px;
    overflow: hidden;
}

.cheat-sheet-container.hidden {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin-top: 0;
}

.cheat-sheet {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.cheat-keys {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cheat-octave-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
}

.cheat-octave-label {
    min-width: 48px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
    text-align: center;
}

.cheat-octave-group.soprano-extension-group {
    display: none;
}

.cheat-octave-group.soprano-extension-group.available {
    display: inline-flex;
}

.cheat-key {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    line-height: 1;
}

.cheat-key small {
    font-size: 0.6rem;
    opacity: 0.8;
    margin-top: 1px;
    opacity: 0.8;
}

.cheat-key:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Musical Note Animation */
.musical-note {
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: noteFloat 2s ease-out forwards;
}

@keyframes noteFloat {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) translateX(var(--random-x, 10px)) scale(1.2) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) translateX(calc(var(--random-x, 10px) + 20px)) scale(0.5) rotate(25deg);
    }
}

.musical-note.note-1 {
    animation-delay: 0s;
    color: #ff6b6b;
}

.musical-note.note-2 {
    animation-delay: 0.1s;
    color: #4ecdc4;
}

.musical-note.note-3 {
    animation-delay: 0.2s;
    color: #45b7d1;
}

.musical-note.note-4 {
    animation-delay: 0.3s;
    color: #f9ca24;
}

.musical-note.note-5 {
    animation-delay: 0.4s;
    color: #6c5ce7;
}

/* Recording Controls Overlay */
.recording-controls-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.record-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.record-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Recording Timer */
.recording-timer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 15px 20px;
    border: 2px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.timer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
}

.record-dot {
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.timer-text {
    font-size: 1.1rem;
    color: #ef4444;
    font-weight: 700;
}

.timer-duration {
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    color: #fff;
}

.stop-timer-btn {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stop-timer-btn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #8e44ad;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.recordings-count {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    white-space: nowrap;
}

/* Saved Recordings List */
.saved-recordings-list {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea transparent;
}

.saved-recordings-list::-webkit-scrollbar {
    width: 8px;
}

.saved-recordings-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.saved-recordings-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.saved-recordings-list::-webkit-scrollbar-thumb:hover {
    background: #8e44ad;
}

.no-recordings {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-recordings-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-recordings-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #888;
}

.no-recordings-subtitle {
    font-size: 1rem;
    opacity: 0.7;
}

/* Recording Item */
.recording-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recording-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-left-color: #8e44ad;
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 15px;
}

.recording-title {
    color: #fff;
    margin: 0;
    flex: 1;
    font-weight: 600;
    font-size: 1.2rem;
}

.recording-actions {
    display: flex;
    gap: 8px;
}

.recording-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recording-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Action Buttons */
.btn-action {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action.btn-play {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-action.btn-play:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action.btn-download {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-action.btn-download:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-action.btn-rename {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-action.btn-rename:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-action.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-action.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Professional Recordings Studio Modal */
.recordings-studio-modal {
    width: min(1180px, calc(100vw - 64px));
    max-width: min(1180px, calc(100vw - 64px));
    height: min(84vh, 820px);
    max-height: min(84vh, 820px);
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 8%, rgba(99,102,241,0.2), transparent 34%),
        radial-gradient(circle at 92% 12%, rgba(236,72,153,0.12), transparent 30%),
        linear-gradient(145deg, rgba(23,25,44,0.98), rgba(39,38,64,0.96));
    border: 1px solid rgba(226,232,240,0.18);
    box-shadow: 0 30px 90px rgba(0,0,0,0.52);
}

.recordings-studio-header {
    align-items: center;
    padding: 24px 30px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.recordings-studio-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.recordings-studio-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #ef4444, #7c3aed);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    box-shadow: 0 16px 32px rgba(124,58,237,0.32);
}

.recordings-studio-title-wrap h3 {
    margin: 0;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 850;
    letter-spacing: 0;
}

.recordings-studio-title-wrap p {
    margin: 4px 0 0;
    color: rgba(226,232,240,0.66);
    font-size: 0.9rem;
    font-weight: 500;
}

.recordings-studio-body {
    padding: 22px 30px 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recordings-studio-summary {
    display: grid;
    grid-template-columns: 1.1fr repeat(3, 0.82fr) 1.25fr;
    gap: 12px;
}

.recording-stat-card {
    min-width: 0;
    padding: 14px 15px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.045));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.recording-stat-card.is-primary {
    background: linear-gradient(145deg, rgba(99,102,241,0.24), rgba(124,58,237,0.14));
    border-color: rgba(129,140,248,0.34);
}

.recording-stat-label {
    display: block;
    color: rgba(191,219,254,0.82);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 7px;
}

.recording-stat-card strong {
    display: block;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.recording-stat-card small {
    display: block;
    margin-top: 7px;
    color: rgba(226,232,240,0.58);
    font-size: 0.72rem;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-usage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.recording-usage-head strong {
    font-size: 1rem;
    color: #bfdbfe;
}

.recording-usage-track {
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(15,23,42,0.74);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

.recording-usage-track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #3b82f6, #a855f7);
    transition: width 0.28s ease;
}

.recordings-command-panel,
.recordings-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.34);
    padding: 10px;
}

.recordings-search-shell {
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.13);
    padding: 0 12px;
}

.recordings-search-shell span {
    color: rgba(255,255,255,0.62);
    font-size: 1.15rem;
}

.recordings-search-shell input {
    width: 100%;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.recordings-search-shell input::placeholder {
    color: rgba(226,232,240,0.46);
}

.recordings-select,
.recordings-view-toggle {
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.13);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.88);
    font-size: 0.8rem;
    font-weight: 800;
}

.recordings-select {
    padding: 0 12px;
    background-color: rgba(17,24,39,0.92);
}

.recordings-select option {
    background: #12172c;
    color: #f8fafc;
}

.recordings-select option:checked,
.recordings-select option:hover {
    background: #312e81;
    color: #ffffff;
}

.recordings-view-toggle {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
}

.recordings-view-toggle button {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(255,255,255,0.58);
    padding: 0 10px;
    font-size: 0.76rem;
    font-weight: 850;
    cursor: pointer;
}

.recordings-view-toggle button.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59,130,246,0.78), rgba(124,58,237,0.78));
}

.recordings-bulk-bar {
    justify-content: space-between;
    padding: 9px 12px;
}

.recordings-bulk-bar strong {
    color: #fff;
    font-size: 0.86rem;
}

.recordings-bulk-bar span {
    color: rgba(226,232,240,0.58);
    font-size: 0.78rem;
    margin-left: 8px;
}

.recordings-bulk-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.recordings-bulk-actions button,
.recording-card-action {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.88);
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.76rem;
    font-weight: 850;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.recordings-bulk-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    transform: none;
}

.recordings-bulk-actions button:hover,
.recording-card-action:hover {
    transform: translateY(-1px);
    border-color: rgba(129,140,248,0.42);
    background: rgba(129,140,248,0.16);
}

.recordings-bulk-actions .danger,
.recording-card-action.danger {
    color: #fecaca;
    border-color: rgba(248,113,113,0.26);
}

.recordings-studio-modal .saved-recordings-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: grid;
    gap: 12px;
    overflow-y: auto;
    padding: 2px 8px 76px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(129,140,248,0.74) rgba(10,12,27,0.72);
    scroll-padding-bottom: 80px;
}

.recordings-studio-modal .saved-recordings-list::-webkit-scrollbar {
    width: 10px;
}

.recordings-studio-modal .saved-recordings-list::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(8,10,24,0.88), rgba(25,19,50,0.72));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
}

.recordings-studio-modal .saved-recordings-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #6366f1 52%, #a855f7);
    border: 2px solid rgba(10,12,27,0.88);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.recordings-studio-modal .saved-recordings-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7dd3fc, #818cf8 52%, #c084fc);
}

.recordings-studio-modal .saved-recordings-list.is-compact {
    gap: 8px;
}

.recordings-studio-modal .recording-item {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.12);
    border-left: 4px solid rgba(99,102,241,0.88);
    background:
        radial-gradient(circle at 18% 0%, rgba(99,102,241,0.16), transparent 36%),
        linear-gradient(145deg, rgba(255,255,255,0.095), rgba(255,255,255,0.045));
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

.recordings-studio-modal .recording-item:hover {
    transform: translateY(-2px);
    border-left-color: #f59e0b;
    box-shadow: 0 20px 38px rgba(0,0,0,0.28);
}

.recordings-studio-modal .recording-item.is-selected {
    border-color: rgba(96,165,250,0.58);
    border-left-color: #38bdf8;
    background:
        radial-gradient(circle at 18% 0%, rgba(56,189,248,0.18), transparent 36%),
        linear-gradient(145deg, rgba(59,130,246,0.16), rgba(255,255,255,0.055));
}

.recording-card-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
}

.recording-select-box {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: #6366f1;
}

.recording-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.recordings-studio-modal .recording-title {
    font-size: 1.02rem;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-instrument-pill,
.recording-source-pill {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.recording-instrument-pill {
    color: #bfdbfe;
    background: rgba(59,130,246,0.14);
    border: 1px solid rgba(96,165,250,0.22);
}

.recording-source-pill {
    color: #bbf7d0;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.2);
}

.recordings-studio-modal .recording-meta {
    margin: 10px 0 0;
    gap: 8px;
}

.recordings-studio-modal .meta-item {
    border-radius: 999px;
    background: rgba(15,23,42,0.32);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 5px 8px;
    color: rgba(226,232,240,0.78);
    font-size: 0.73rem;
    font-weight: 760;
}

.recording-waveform {
    display: flex;
    align-items: end;
    gap: 3px;
    height: 34px;
    margin-top: 13px;
    max-width: 440px;
}

.recording-waveform span {
    width: 5px;
    min-height: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(129,140,248,0.9), rgba(236,72,153,0.65));
    opacity: 0.86;
}

.recording-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(98px, auto));
    gap: 8px;
}

.recording-card-action.primary {
    color: #fff;
    background: linear-gradient(135deg, #10b981, #2563eb);
    border-color: rgba(255,255,255,0.18);
}

.recording-card-action.export {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.recordings-studio-modal .saved-recordings-list.is-compact .recording-card-main {
    grid-template-columns: auto 1fr auto;
    padding: 11px 14px;
    align-items: center;
}

.recordings-studio-modal .saved-recordings-list.is-compact .recording-waveform,
.recordings-studio-modal .saved-recordings-list.is-compact .recording-source-pill {
    display: none;
}

.recordings-studio-modal .saved-recordings-list.is-compact .recording-meta {
    margin-top: 5px;
}

.recordings-studio-modal .saved-recordings-list.is-compact .recording-card-actions {
    grid-template-columns: repeat(4, auto);
}

.recordings-studio-modal .no-recordings {
    min-height: 300px;
    display: grid;
    place-content: center;
    color: rgba(226,232,240,0.72);
}

/* Current Recording Display */
.current-recording-display {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 22, 40, 0.95));
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 25px 30px;
}

.modal-info {
    margin-bottom: 25px;
}

.recording-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex: 1;
}

.stat-label {
    display: block;
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: white;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #8e44ad;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.2);
}

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

.input-help {
    margin-top: 6px;
    color: #ccc;
    font-size: 0.85rem;
    font-style: italic;
}

.modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 30px 30px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 120px;
    padding: 12px 24px;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recording-controls-overlay {
        top: 15px;
        left: 15px;
    }

    .record-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .recording-timer {
        padding: 12px 16px;
    }

    .timer-content {
        gap: 8px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: auto;
        width: 100%;
    }

    .recording-item {
        padding: 15px;
    }

    .recording-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .recording-actions {
        justify-content: center;
    }

    .recording-meta {
        justify-content: center;
        text-align: center;
    }

    .recording-controls {
        justify-content: center;
    }

    .recording-stats {
        flex-direction: column;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Recording Management Styles */
.recording-management {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 30px auto;
    box-shadow: var(--shadow-primary);
    max-width: 1200px;
}

.recording-controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.recording-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.recording-input-group input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.recording-input-group input:focus {
    outline: none;
    border-color: #8e44ad;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.recording-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.recording-status {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.recording-status.info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.recording-status.success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.recording-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.recording-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.recording-library {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 25px;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.library-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.library-controls select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #667eea;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
}

.library-controls select option {
    background: #2a2a2a;
    color: white;
}

.recordings-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea transparent;
}

.recordings-list::-webkit-scrollbar {
    width: 8px;
}

.recordings-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.recordings-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.recordings-list::-webkit-scrollbar-thumb:hover {
    background: #8e44ad;
}

.recording-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
}

.recording-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}

.recording-header h5 {
    color: #fff;
    margin: 0;
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.recording-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 35px;
    height: 30px;
}

.btn-small.btn-primary {
    background: #667eea;
    color: white;
}

.btn-small.btn-primary:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.btn-small.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.recording-info {
    color: #ccc;
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recording-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-recordings {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

/* Enhanced button styles */
.btn.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn.btn-success:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .recording-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .recording-input-group input {
        min-width: auto;
        width: 100%;
    }

    .library-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .library-controls {
        justify-content: center;
    }

    .recording-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .recording-actions {
        justify-content: center;
    }

    .recording-info {
        justify-content: center;
        text-align: center;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Learning Mode */
.learning-container {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    padding: 30px;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: var(--shadow-primary);
    display: none;
}

.learning-container.active {
    display: block;
}

.song-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 1.2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.note-highlight {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Recording Display */
.recording-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    min-height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: monospace;
}

.recorded-note {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 2px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .marimba-controls {
        margin-bottom: 20px;
    }

    .hover-toggle-container {
        flex-direction: column;
        gap: 12px;
        padding: 15px 20px;
        text-align: center;
    }

    .play-mode-toggle {
        width: 100px;
        height: 35px;
    }

    .toggle-slider {
        width: 45px;
        height: 27px;
    }

    .play-mode-toggle[data-mode="hover"] .toggle-slider {
        transform: translateX(50px);
    }

    .toggle-text-left {
        left: 12px;
        font-size: 0.8rem;
    }

    .toggle-text-right {
        right: 12px;
        font-size: 0.8rem;
    }

    .mode-description {
        font-size: 0.85rem;
    }

    .marimba-keys {
        gap: 4px;
        margin: 15px auto 20px auto;
    }

    .marimba-note {
        width: clamp(35px, 8vw, 50px);
        height: clamp(120px, 20vh, 180px);
    }

    .controls-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cheat-keys {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }

    .cheat-key {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .footer-buttons {
        flex-direction: column;
        align-items: center;
    }

    .main-container {
        padding-top: 120px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
        margin: 20px 0 40px 0;
    }

    .marimba-container {
        padding: 20px 10px;
        margin: 30px 0;
    }

    .controls-section, .cheat-sheet, .learning-container {
        margin: 20px 10px;
        padding: 20px 15px;
    }

    .cheat-key {
        width: 45px;
        height: 45px;
    }
}

/* Custom Song Dropdown Styling */
#song-select {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

#song-select:hover {
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

#song-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 12px 40px rgba(102, 126, 234, 0.3);
    outline: none;
}

#song-select option {
    background: rgba(0, 0, 0, 0.95) !important;
    color: white !important;
    padding: 12px 16px !important;
    font-weight: 500 !important;
    border: none !important;
}

#song-select option:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

/* Learning Display System */
.learning-display-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 25px 80px rgba(31, 38, 135, 0.25);
}

.learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.learning-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    color: white;
    font-size: 14px;
    opacity: 0.9;
    min-width: 50px;
}

.notes-display-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.note-group {
    display: flex;
    gap: 10px;
}

.note-item {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.learning-feedback {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    margin-top: -10px;
    margin-bottom: 15px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.learning-feedback.success {
    color: #4ade80;
    opacity: 1;
}

.learning-feedback.error {
    color: #f87171;
    opacity: 1;
}

.current-note.error {
    box-shadow: 0 0 25px rgba(248, 113, 113, 0.5);
    animation: noteErrorPulse 0.4s ease;
}

@keyframes noteErrorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Previous notes styling */
.previous-note {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    transform: scale(0.7);
    opacity: 0.6;
}

/* Next notes styling */
.next-note {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    transform: scale(0.8);
    opacity: 0.8;
}

/* Current note styling - THE STAR! */
.current-note {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
    font-size: 36px;
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4);
    animation: currentNotePulse 2s infinite ease-in-out;
    flex-direction: column;
    gap: 5px;
}

.note-text {
    font-size: 36px;
    font-weight: bold;
    z-index: 2;
}

.note-key-hint {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 2;
}

/* Animated pulse background */
.note-pulse {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulseRing 2s infinite;
}

/* Sparkle animations */
.note-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    animation: sparkleFloat 3s infinite ease-in-out;
}

.sparkle-1 {
    top: -10px;
    right: -10px;
    animation-delay: 0s;
}

.sparkle-2 {
    bottom: -10px;
    left: -10px;
    animation-delay: 1s;
}

.sparkle-3 {
    top: 50%;
    right: -15px;
    animation-delay: 2s;
}

.learning-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.stat-item {
    color: white;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Animations */
@keyframes currentNotePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 25px 50px rgba(255, 107, 107, 0.6);
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-10px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-5px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-15px) rotate(270deg);
        opacity: 1;
    }
}

/* Success animation when note is played correctly */
@keyframes noteSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); background: linear-gradient(135deg, #4CAF50, #45a049); }
    100% { transform: scale(1); }
}

.note-success {
    animation: noteSuccess 0.6s ease;
}

/* Error animation when wrong note is played */
@keyframes noteError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.note-error {
    animation: noteError 0.5s ease;
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
}

/* =============================================
   DIFFICULTY MODE SYSTEM
   ============================================= */

/* ---------- Difficulty Selector Panel (in modal) ---------- */
.difficulty-selector {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    border-radius: 0 0 16px 16px;
}
.diff-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.diff-selected-song {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
    font-weight: 600;
}
.diff-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.diff-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
    color: white;
    font-family: inherit;
    transition: all 0.18s;
    min-width: 88px;
    flex: 1;
    gap: 3px;
    position: relative;
}
.diff-btn:hover:not(:disabled) {
    border-color: rgba(255,255,255,0.45);
    transform: translateY(-2px);
    background: rgba(255,255,255,0.1);
}
.diff-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
}
.diff-btn.completed {
    border-color: #4ade80;
    background: rgba(74,222,128,0.08);
}
.diff-btn[data-diff="legendary"] {
    border-color: rgba(251,191,36,0.4);
    background: rgba(251,191,36,0.06);
}
.diff-btn[data-diff="legendary"]:hover:not(:disabled) {
    border-color: gold;
    background: rgba(251,191,36,0.12);
}
.diff-icon { font-size: 1.3rem; }
.diff-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.diff-desc {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    line-height: 1.3;
}
.diff-badge-status {
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Mobile difficulty picker overlay */
.diff-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background:
        radial-gradient(circle at top, rgba(102,126,234,0.18), transparent 32%),
        rgba(4, 8, 20, 0.78);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}
.diff-picker-sheet {
    width: min(100%, 760px);
    max-height: min(88dvh, 620px);
    overflow: auto;
    background:
        radial-gradient(circle at top right, rgba(148,163,255,0.18), transparent 28%),
        linear-gradient(180deg, rgba(24,29,60,0.98), rgba(10,12,26,0.98));
    border: 1px solid rgba(165,180,252,0.18);
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
    border-radius: 24px 24px 18px 18px;
    padding: 14px 14px 16px;
}
.diff-picker-handle {
    width: 54px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    margin: 0 auto 14px;
}
.diff-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.diff-picker-heading {
    min-width: 0;
}
.diff-picker-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(191,219,254,0.72);
    margin-bottom: 5px;
}
.diff-picker-close-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.66);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.diff-picker-close-btn:active {
    transform: scale(0.96);
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.diff-picker-title {
    font-size: clamp(1.05rem, 3.7vw, 1.4rem);
    font-weight: 700;
    color: white;
    line-height: 1.1;
    margin-bottom: 4px;
}
.diff-picker-song {
    font-size: 0.86rem;
    color: rgba(255,255,255,0.58);
    max-width: 38ch;
}
.diff-picker-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.diff-picker-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.78);
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.diff-picker-meta-pill.success {
    color: #86efac;
    border-color: rgba(74,222,128,0.3);
    background: rgba(34,197,94,0.12);
}
.diff-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.diff-picker-btn {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 136px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
    color: white;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    text-align: left;
    overflow: hidden;
}
.diff-picker-btn::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 18px 0 0 18px;
    opacity: 0.95;
}
.diff-picker-btn:active:not(:disabled) {
    transform: scale(0.985);
}
.diff-picker-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.diff-picker-card-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.diff-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.diff-picker-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.diff-picker-btn.completed {
    box-shadow: inset 0 0 0 1px rgba(74,222,128,0.22);
}
.diff-picker-btn.locked {
    filter: saturate(0.7);
}
.diff-picker-btn.diff-easy::before { background: linear-gradient(180deg, #34d399, #16a34a); }
.diff-picker-btn.diff-medium::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.diff-picker-btn.diff-hard::before { background: linear-gradient(180deg, #fb7185, #ef4444); }
.diff-picker-btn.diff-legendary::before { background: linear-gradient(180deg, #fde68a, #f59e0b); }
.diff-picker-btn.diff-easy:not(:disabled) {
    border-color: rgba(52,211,153,0.26);
    background: linear-gradient(180deg, rgba(22,163,74,0.16), rgba(255,255,255,0.03));
}
.diff-picker-btn.diff-medium:not(:disabled) {
    border-color: rgba(251,191,36,0.24);
    background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(255,255,255,0.03));
}
.diff-picker-btn.diff-hard:not(:disabled) {
    border-color: rgba(248,113,113,0.24);
    background: linear-gradient(180deg, rgba(239,68,68,0.15), rgba(255,255,255,0.03));
}
.diff-picker-btn.diff-legendary:not(:disabled) {
    border-color: rgba(251,191,36,0.28);
    background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(255,255,255,0.03));
}
.diff-picker-btn .diff-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    font-size: 1.15rem;
}
.diff-picker-btn .diff-label {
    font-size: 0.98rem;
    font-weight: 700;
}
.diff-picker-btn .diff-reward {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.72);
    white-space: nowrap;
}
.diff-picker-btn .diff-rhythm {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
}
.diff-picker-btn .diff-desc {
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.56);
}
.diff-picker-btn .diff-badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
}
.diff-picker-btn.completed .diff-badge-status {
    color: #86efac;
    border-color: rgba(74,222,128,0.3);
    background: rgba(34,197,94,0.12);
}
.diff-picker-btn.locked .diff-badge-status {
    color: rgba(255,255,255,0.48);
}
.diff-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}
.diff-picker-footer-note {
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.48);
}
.diff-picker-cancel {
    flex-shrink: 0;
    min-width: 96px;
    min-height: 40px;
    padding: 0 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: rgba(255,255,255,0.76);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.diff-picker-cancel:active {
    transform: scale(0.97);
}
@media (max-width: 420px) {
    .diff-picker-overlay {
        padding: 10px;
    }

    .diff-picker-sheet {
        padding: 12px 12px 14px;
    }

    .diff-picker-grid {
        grid-template-columns: 1fr;
    }

    .diff-picker-btn {
        min-height: 118px;
    }

    .diff-picker-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .diff-picker-cancel {
        width: 100%;
    }
}
@media (orientation: landscape) and (max-height: 500px) {
    .diff-picker-overlay {
        align-items: center;
        padding: 8px;
    }

    .diff-picker-sheet {
        width: min(100%, 860px);
        max-height: min(96dvh, 372px);
        border-radius: 22px;
        padding: 10px;
        overflow: hidden;
    }

    .diff-picker-handle {
        display: none;
    }

    .diff-picker-header {
        margin-bottom: 6px;
        gap: 8px;
    }

    .diff-picker-title {
        font-size: 0.96rem;
        margin-bottom: 2px;
    }

    .diff-picker-song {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .diff-picker-meta {
        margin-bottom: 8px;
        gap: 5px;
    }

    .diff-picker-meta-pill {
        min-height: 21px;
        padding: 0 8px;
        font-size: 0.6rem;
    }

    .diff-picker-grid {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .diff-picker-btn {
        min-height: 74px;
        padding: 8px 10px;
        gap: 5px;
        border-radius: 15px;
    }

    .diff-picker-btn .diff-icon {
        width: 24px;
        height: 24px;
        border-radius: 8px;
        font-size: 0.84rem;
    }

    .diff-picker-btn .diff-label {
        font-size: 0.76rem;
    }

    .diff-picker-btn .diff-reward {
        font-size: 0.56rem;
    }

    .diff-picker-btn .diff-rhythm {
        font-size: 0.62rem;
    }

    .diff-picker-btn .diff-desc {
        font-size: 0.56rem;
        line-height: 1.15;
    }

    .diff-picker-btn .diff-badge-status {
        min-height: 17px;
        padding: 0 6px;
        font-size: 0.5rem;
    }

    .diff-picker-footer {
        margin-top: 7px;
    }

    .diff-picker-footer-note {
        font-size: 0.58rem;
        line-height: 1.1;
    }

    .diff-picker-cancel {
        min-height: 32px;
        min-width: 78px;
        font-size: 0.72rem;
        padding: 0 12px;
    }

    .diff-picker-close-btn {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 0.86rem;
    }

    .diff-picker-eyebrow {
        font-size: 0.54rem;
        margin-bottom: 3px;
    }
}

@media (orientation: landscape) and (max-height: 430px) {
    .diff-picker-sheet {
        max-height: min(96dvh, 332px);
        padding: 8px;
    }

    .diff-picker-meta {
        margin-bottom: 6px;
    }

    .diff-picker-meta-pill:nth-child(2) {
        display: none;
    }

    .diff-picker-btn {
        min-height: 64px;
        padding: 7px 9px;
        gap: 4px;
    }

    .diff-picker-btn .diff-desc {
        display: none;
    }

    .diff-picker-footer-note {
        display: none;
    }
}

/* ---------- Countdown Overlay ---------- */
.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 99000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(5px);
}
.countdown-number {
    font-size: 130px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 60px rgba(102,126,234,0.7), 0 0 20px rgba(255,255,255,0.4);
    animation: countdownPop 0.85s ease forwards;
    user-select: none;
}
.countdown-number.go {
    font-size: 80px;
    color: #4ade80;
    text-shadow: 0 0 40px rgba(74,222,128,0.6);
}
@keyframes countdownPop {
    0%   { transform: scale(0.2); opacity: 0; }
    45%  { transform: scale(1.18); opacity: 1; }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- Legendary Strikes ---------- */
.legendary-strikes {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    border: 1px solid rgba(251,191,36,0.3);
}
.strikes-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: gold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#strikes-display {
    font-size: 1rem;
    letter-spacing: 2px;
}
.strike-used {
    filter: grayscale(1) opacity(0.25);
}

/* ---------- Difficulty Badge in Learning Display ---------- */
.difficulty-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 7px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}
.difficulty-badge.easy     { background: rgba(34,197,94,0.2);    color: #4ade80;  border: 1px solid rgba(34,197,94,0.4);  }
.difficulty-badge.medium   { background: rgba(245,158,11,0.2);   color: #fbbf24;  border: 1px solid rgba(245,158,11,0.4); }
.difficulty-badge.hard     { background: rgba(239,68,68,0.2);    color: #f87171;  border: 1px solid rgba(239,68,68,0.4);  }
.difficulty-badge.legendary{ background: rgba(251,191,36,0.15);  color: gold;     border: 1px solid rgba(251,191,36,0.45);}

/* ---------- Easy mode: dim non-active notes ---------- */
.marimba-note.easy-mode-dim {
    opacity: 0.38;
    transition: opacity 0.3s ease;
}
.marimba-note.learning-active {
    opacity: 1 !important;
}

/* ---------- Inactivity fade ---------- */
.marimba-note.inactivity-fade {
    opacity: 0 !important;
    transition: opacity 1.5s ease;
}

/* ---------- Hard/Legendary: hide notes timeline + hints only ---------- */
/* Progress bar, progress text, and RP pot remain visible in all modes */
.learning-display-container.hard-mode .notes-display-row,
.learning-display-container.hard-mode #learning-feedback {
    display: none !important;
}
/* Mobile equivalents */
.mobile-learning-interface.hard-mode .li-notes-area,
.mobile-learning-interface.hard-mode #learning-note-hint {
    display: none !important;
}

/* ---------- Legendary mode: hide tempo section ---------- */
.learning-display-container.legendary-mode #tempo-control-container {
    display: none !important;
}
.mobile-learning-interface.legendary-mode #learning-tempo-section {
    display: none !important;
}

/* ---------- No-mistake bonus notification extra line ---------- */
.rpt-bonus-line {
    color: #fbbf24;
    font-size: 0.82rem;
    margin: 3px 0;
}

/* ---------- Difficulty progress indicators in modal song list ---------- */
.song-diff-progress {
    display: flex;
    gap: 2px;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}
.sdp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
}
.sdp-dot.done { background: #4ade80; border-color: #4ade80; }
.sdp-dot.done[data-d="medium"] { background: #fbbf24; border-color: #fbbf24; }
.sdp-dot.done[data-d="hard"]   { background: #f87171; border-color: #f87171; }
.sdp-dot.done[data-d="legendary"] { background: gold; border-color: gold; }

/* ---------- Begin Legendary button ---------- */
.begin-legendary-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    margin-top: 8px;
    background: linear-gradient(135deg, #78350f, #92400e);
    border: 2px solid gold;
    border-radius: 12px;
    color: gold;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.begin-legendary-btn:hover {
    background: linear-gradient(135deg, #92400e, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(251,191,36,0.3);
}
#begin-legendary-btn-mobile {
    display: none;
    width: auto;
}

/* =============================================================
   PHASE 1 — PayFast Monetization UI (Desktop)
   Dashboard redesign, pricing cards, subscription panel,
   bundle banner, songbook R10 buttons, checkout-soon modal
   ============================================================= */

/* ---------- Dashboard v2 layout ---------- */
.profile-dashboard-v2 {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.profile-dashboard-v2-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(102,126,234,0.18), rgba(139,92,246,0.10));
    border: 1px solid rgba(139,92,246,0.32);
    border-radius: 18px;
}
.profile-dashboard-v2-hero .profile-dashboard-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    font: 700 1.4rem Inter, sans-serif; color: #eef2ff;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
}
.profile-dashboard-v2-hero .profile-dashboard-avatar img { width:100%; height:100%; object-fit: cover; }
.profile-dashboard-v2-hero-copy { min-width: 0; }
.profile-dashboard-v2-hero .profile-dashboard-name {
    font: 700 1.25rem Inter, sans-serif;
    color: #f5f7ff;
    margin: 0 0 4px;
}
.profile-dashboard-v2-hero .profile-dashboard-subtitle {
    font-size: 0.88rem;
    color: rgba(238,242,255,0.62);
}
.profile-plan-badge {
    display: inline-flex; align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font: 700 0.72rem Inter, sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.06);
    color: #eef2ff;
    border: 1px solid rgba(255,255,255,0.18);
    white-space: nowrap;
}
.profile-plan-badge[data-plan="basic"]    { background: linear-gradient(135deg, #64748b, #475569); border-color: rgba(255,255,255,0.22); }
.profile-plan-badge[data-plan="premium"]  { background: linear-gradient(135deg, #667eea, #8b5cf6); border-color: rgba(139,92,246,0.6); color: #fff; }
.profile-plan-badge[data-plan="ultimate"] { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: rgba(251,191,36,0.55); color: #1f1306; }

.profile-dashboard-v2-metric-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 8px;
}
.profile-metric-chip {
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    display: flex; flex-direction: column;
    gap: 4px;
}
.profile-metric-chip-label {
    font: 600 0.7rem Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: rgba(238,242,255,0.55);
}
.profile-metric-chip-value {
    font: 700 1.05rem Inter, sans-serif;
    color: #f5f7ff;
}

.profile-dashboard-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 900px) {
    .profile-dashboard-v2-grid { grid-template-columns: 1fr; }
    .profile-dashboard-v2-metric-strip { grid-template-columns: repeat(3, 1fr); }
    .profile-dashboard-v2-hero { grid-template-columns: auto 1fr; }
    .profile-plan-badge { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Subscription card ---------- */
.profile-subscription-card {
    background: linear-gradient(135deg, rgba(102,126,234,0.10), rgba(139,92,246,0.06));
    border: 1px solid rgba(139,92,246,0.30);
    padding: 22px 22px 18px;
}
.profile-subscription-head {
    display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.profile-subscription-kicker {
    font: 600 0.72rem Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(238,242,255,0.55);
}
.profile-subscription-price {
    font: 800 1.6rem Inter, sans-serif;
    color: #f5f7ff;
    margin-top: 2px;
}
.profile-subscription-tagline {
    font-size: 0.9rem;
    color: rgba(238,242,255,0.68);
    margin-top: 2px;
}
.profile-subscription-status-wrap {
    text-align: right;
    display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.profile-subscription-status {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    font: 700 0.74rem Inter, sans-serif;
    background: rgba(34,197,94,0.16);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.32);
}
.profile-subscription-status[data-status="cancelling"] {
    background: rgba(251,191,36,0.16); color: #facc15; border-color: rgba(251,191,36,0.32);
}
.profile-subscription-status[data-status="expired"],
.profile-subscription-status[data-status="failed"] {
    background: rgba(239,68,68,0.16); color: #f87171; border-color: rgba(239,68,68,0.32);
}
.profile-subscription-status[data-status="free"] {
    background: rgba(148,163,184,0.16); color: #cbd5e1; border-color: rgba(148,163,184,0.32);
}
.profile-subscription-status[data-status="promo"] {
    background: rgba(245,158,11,0.16); color: #fcd38a; border-color: rgba(245,158,11,0.34);
}
.profile-subscription-renewal { font-size: 0.78rem; color: rgba(238,242,255,0.55); }
.profile-subscription-benefits {
    list-style: none; padding: 0; margin: 0 0 12px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
}
.profile-subscription-benefits li {
    position: relative;
    padding-left: 18px;
    font-size: 0.88rem;
    color: rgba(238,242,255,0.82);
}
.profile-subscription-benefits li::before {
    content: '✓';
    position: absolute; left: 0; top: 0;
    color: #4ade80; font-weight: 800;
}
.profile-subscription-meta {
    display: flex; gap: 8px;
    font-size: 0.82rem;
    color: rgba(238,242,255,0.62);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.profile-subscription-meta .over-limit { color: #f87171; font-weight: 700; }
.profile-subscription-dot { opacity: 0.4; }
.profile-subscription-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
}

.profile-primary-btn {
    appearance: none;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #8b5cf6);
    color: #fff;
    font: 700 0.92rem Inter, sans-serif;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(139,92,246,0.35); }

/* ---------- Pricing modal ---------- */
.pricing-modal-container {
    width: min(1720px, 97vw) !important;
    height: min(920px, 94vh) !important;
    max-width: none !important;
    max-height: 94vh !important;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.14);
    background:
        radial-gradient(circle at 18% 0%, rgba(96,165,250,0.18), transparent 32%),
        radial-gradient(circle at 88% 8%, rgba(245,158,11,0.12), transparent 28%),
        linear-gradient(150deg, rgba(12,16,35,0.99), rgba(10,12,27,0.99) 48%, rgba(18,18,39,0.99));
    box-shadow: 0 32px 90px rgba(0,0,0,0.64), inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden !important;
}
.pricing-modal-container .modal-header {
    padding: 34px 44px 22px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 22px;
}
.pricing-modal-container .modal-body {
    padding: 26px 44px 38px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1;
    display: block !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.72) rgba(10,12,27,0.72);
}

.pricing-modal-container .modal-body::-webkit-scrollbar {
    width: 10px;
}

.pricing-modal-container .modal-body::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(8,10,24,0.86), rgba(25,19,50,0.72));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
}

.pricing-modal-container .modal-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #60a5fa, #8b5cf6 52%, #ec4899);
    border: 2px solid rgba(10,12,27,0.88);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.pricing-modal-container .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #93c5fd, #a78bfa 52%, #f472b6);
}
.pricing-modal-title-wrap h3 {
    margin: 6px 0 10px;
    font: 900 2.5rem Inter, sans-serif;
    letter-spacing: 0;
    color: #f5f7ff;
}
.pricing-modal-kicker {
    font: 800 0.74rem Inter, sans-serif;
    color: #93c5fd;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.pricing-modal-subtitle {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.55;
    color: rgba(238,242,255,0.76);
    max-width: 980px;
}
.pricing-billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.13);
    background: rgba(0,0,0,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.pricing-billing-option {
    appearance: none;
    border: 0;
    border-radius: 999px;
    min-width: 104px;
    padding: 10px 14px;
    color: rgba(238,242,255,0.72);
    background: transparent;
    font: 900 0.82rem Inter, sans-serif;
    cursor: pointer;
}
.pricing-billing-option span {
    margin-left: 6px;
    color: #86efac;
    font-size: 0.72rem;
}
.pricing-billing-option.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.pricing-currency-switcher {
    flex: 0 0 auto;
}

.pricing-currency-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 128px;
    height: 43px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.055)),
        rgba(8, 10, 24, 0.58);
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 10px 26px rgba(0,0,0,0.22);
    overflow: hidden;
    cursor: pointer;
}

.pricing-currency-select-wrap::after {
    content: "⌄";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-54%);
    color: rgba(226,232,240,0.72);
    font-size: 0.92rem;
    pointer-events: none;
}

.pricing-currency-current {
    display: block;
    width: 100%;
    padding: 0 28px 0 12px;
    color: #f8fafc;
    font: 900 0.82rem Inter, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.pricing-currency-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.pricing-source-currency {
    display: block;
    margin-top: 5px;
    color: rgba(191,219,254,0.68);
    font: 800 0.68rem Inter, sans-serif;
    line-height: 1.1;
}

.pricing-rp-pack-price .pricing-source-currency {
    margin-top: 2px;
    font-size: 0.62rem;
}

.pricing-hero-panel {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(420px, 0.86fr);
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.11);
    background: linear-gradient(135deg, rgba(96,165,250,0.12), rgba(255,255,255,0.045));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.pricing-hero-panel strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    font: 900 1.28rem Inter, sans-serif;
    letter-spacing: 0;
}
.pricing-hero-label {
    color: rgba(191,219,254,0.78);
    font: 800 0.72rem Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pricing-hero-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.pricing-hero-points span {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.18);
    color: rgba(238,242,255,0.86);
    font: 800 0.82rem Inter, sans-serif;
    line-height: 1.25;
}
.pricing-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 28px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255,255,255,0.035);
}
@media (max-width: 1100px) {
    .pricing-cards-grid { grid-template-columns: 1fr; gap: 18px; }
    .pricing-hero-panel { grid-template-columns: 1fr; }
    .pricing-hero-points { grid-template-columns: 1fr; }
    .pricing-billing-toggle { margin-left: 0; }
    .pricing-modal-container .modal-header,
    .pricing-modal-container .modal-body { padding-left: 22px; padding-right: 22px; }
}
.pricing-card {
    position: relative;
    background:
        radial-gradient(circle at 18% 0%, rgba(96,165,250,0.12), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.052), rgba(255,255,255,0.018));
    border: 0;
    border-right: 1px solid rgba(255,255,255,0.105);
    border-radius: 0;
    padding: 30px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 560px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: none;
}
.pricing-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, rgba(96,165,250,0.9), rgba(34,211,238,0.45));
}
.pricing-card::after {
    content: "";
    position: absolute;
    top: 18px;
    right: 22px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.18), transparent 68%);
    pointer-events: none;
}
.pricing-card:last-child {
    border-right: 0;
}
.pricing-card:hover {
    transform: none;
    background:
        radial-gradient(circle at 18% 0%, rgba(96,165,250,0.16), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.026));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.pricing-card-featured {
    background:
        radial-gradient(circle at 22% 0%, rgba(124,58,237,0.28), transparent 38%),
        linear-gradient(180deg, rgba(37,99,235,0.20), rgba(255,255,255,0.04));
    box-shadow: inset 0 0 0 1px rgba(147,197,253,0.42), 0 0 0 1px rgba(147,197,253,0.18);
    z-index: 1;
}
.pricing-card[data-plan-key="basic"]::before {
    background: linear-gradient(90deg, #22c55e, rgba(45,212,191,0.55));
}
.pricing-card[data-plan-key="basic"]::after {
    background: radial-gradient(circle, rgba(34,197,94,0.18), transparent 68%);
}
.pricing-card[data-plan-key="premium"]::before {
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
}
.pricing-card[data-plan-key="premium"]::after {
    background: radial-gradient(circle, rgba(139,92,246,0.22), transparent 68%);
}
.pricing-card[data-plan-key="ultimate"] {
    background:
        radial-gradient(circle at 24% 0%, rgba(251,191,36,0.20), transparent 38%),
        linear-gradient(180deg, rgba(251,191,36,0.075), rgba(255,255,255,0.026));
}
.pricing-card[data-plan-key="ultimate"]::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}
.pricing-card[data-plan-key="ultimate"]::after {
    background: radial-gradient(circle, rgba(251,191,36,0.20), transparent 68%);
}
.pricing-card-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 11px;
    border-radius: 999px;
    font: 900 0.66rem Inter, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37,99,235,0.34);
}
.pricing-card[data-plan-key="ultimate"] .pricing-card-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1f1306;
}
.pricing-card-name {
    position: relative;
    z-index: 1;
    font: 900 0.92rem Inter, sans-serif;
    color: rgba(238,242,255,0.82);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.pricing-card[data-plan-key="free"] .pricing-card-name { color: #bfdbfe; }
.pricing-card[data-plan-key="basic"] .pricing-card-name { color: #bbf7d0; }
.pricing-card[data-plan-key="premium"] .pricing-card-name { color: #ddd6fe; }
.pricing-card[data-plan-key="ultimate"] .pricing-card-name { color: #fde68a; }
.pricing-card-price {
    position: relative;
    z-index: 1;
    font: 900 3rem Inter, sans-serif;
    color: #f5f7ff;
    margin-top: 10px;
    line-height: 1;
}
.pricing-card-cadence {
    font: 600 0.92rem Inter, sans-serif;
    color: rgba(238,242,255,0.55);
    margin-left: 6px;
}
.pricing-card-tagline {
    position: relative;
    z-index: 1;
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.42;
    color: rgba(248,250,252,0.9);
    min-height: 68px;
}
.pricing-card-note {
    position: relative;
    z-index: 1;
    min-height: 18px;
    color: rgba(238,242,255,0.48);
    font: 700 0.78rem Inter, sans-serif;
    margin-top: 8px;
}
.pricing-card-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 4px 0 2px;
}
.pricing-card-section-label {
    color: rgba(238,242,255,0.46);
    font: 800 0.78rem Inter, sans-serif;
}
.pricing-card-benefits {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
    flex: 1;
}
.pricing-card-benefits li {
    position: relative;
    padding-left: 26px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(238,242,255,0.88);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.pricing-card-benefits li::before {
    content: '✓';
    position: absolute; left: 0; top: 0;
    color: #60a5fa; font-weight: 900;
}
.pricing-benefit-text {
    flex: 1;
    min-width: 0;
}
.pricing-benefit-help {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    border: 1px solid rgba(191,219,254,0.42);
    background: rgba(96,165,250,0.12);
    color: #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 1000;
    cursor: help;
}
.pricing-benefit-help::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(260px, 58vw);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(191,219,254,0.24);
    background: rgba(10, 14, 30, 0.96);
    color: #f8fafc;
    box-shadow: 0 16px 36px rgba(0,0,0,0.34);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 8;
}
.pricing-benefit-help:hover::after,
.pricing-benefit-help:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}
.pricing-card-cta {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(135deg, rgba(96,165,250,0.24), rgba(34,211,238,0.14));
    color: #f5f7ff;
    padding: 16px 22px;
    border-radius: 14px;
    font: 900 0.98rem Inter, sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 6px;
}
.pricing-card[data-plan-key="basic"] .pricing-card-cta {
    background: linear-gradient(135deg, rgba(34,197,94,0.88), rgba(20,184,166,0.72));
    border-color: rgba(187,247,208,0.2);
}
.pricing-card[data-plan-key="ultimate"] .pricing-card-cta {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-color: rgba(253,230,138,0.26);
    color: #1f1306;
}
.pricing-card-cta:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.32);
}
.pricing-card-cta.is-featured {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
}
.pricing-card-cta.is-featured:hover { box-shadow: 0 12px 28px rgba(37,99,235,0.4); }
.pricing-card-cta:disabled { opacity: 0.55; cursor: default; }

.pricing-rp-panel {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 12%, rgba(251, 191, 36, 0.18), transparent 28%),
        radial-gradient(circle at 94% 18%, rgba(96, 165, 250, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(12, 16, 34, 0.94), rgba(30, 27, 75, 0.72));
    display: grid;
    grid-template-columns: minmax(250px, 0.82fr) minmax(460px, 1.18fr);
    gap: 20px;
    align-items: stretch;
    position: relative;
    overflow: hidden;
}

.pricing-rp-panel::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 42%);
    pointer-events: none;
}

.pricing-rp-copy,
.pricing-rp-shop {
    position: relative;
    z-index: 1;
}

.pricing-rp-copy {
    min-height: 100%;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.035));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pricing-rp-panel strong,
.pricing-rp-copy strong {
    display: block;
    color: #f8fafc;
    font-size: clamp(1.35rem, 1.8vw, 2rem);
    line-height: 1.05;
    margin-top: 8px;
    max-width: 360px;
}

.pricing-rp-copy p {
    margin: 12px 0 0;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 390px;
}

.pricing-rp-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pricing-rp-benefits span {
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
    padding: 6px 9px;
    font-size: 0.72rem;
    font-weight: 900;
}

.pricing-rp-shop {
    display: grid;
    gap: 12px;
}

.pricing-rp-shop-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.pricing-rp-shop-head span {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 900;
}

.pricing-rp-shop-head small {
    color: rgba(203, 213, 225, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
}

.pricing-rp-packs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pricing-rp-pack {
    min-height: 154px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.095), rgba(255,255,255,0.035)),
        rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-start;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.pricing-rp-pack:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.48);
    background:
        linear-gradient(145deg, rgba(251, 191, 36, 0.14), rgba(96, 165, 250, 0.07)),
        rgba(17, 24, 39, 0.95);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.pricing-rp-pack.is-highlighted {
    border-color: rgba(251, 191, 36, 0.36);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 10px 28px rgba(251, 191, 36, 0.08);
}

.pricing-rp-pack.is-patron {
    grid-column: span 2;
    background:
        radial-gradient(circle at 92% 20%, rgba(251, 191, 36, 0.18), transparent 32%),
        linear-gradient(145deg, rgba(255,255,255,0.105), rgba(124,58,237,0.08)),
        rgba(15, 23, 42, 0.82);
}

.pricing-rp-pack.is-patron strong {
    font-size: clamp(1.6rem, 1.9vw, 2.15rem);
}

.pricing-rp-pack.is-patron em {
    max-width: 280px;
}

.pricing-rp-pack-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #fb7185);
    color: #111827;
    padding: 4px 8px;
    font-size: 0.62rem;
    font-weight: 1000;
}

.pricing-rp-pack-price {
    color: #fde68a;
    font-size: 0.8rem;
    font-weight: 900;
}

.pricing-rp-pack strong {
    color: #dbeafe;
    font-size: 1.48rem;
    line-height: 1.05;
    margin: 0;
}

.pricing-rp-pack small {
    color: rgba(203, 213, 225, 0.72);
    font-weight: 700;
    line-height: 1.25;
}

.pricing-rp-pack em {
    width: 100%;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #f8fafc;
    padding: 8px 10px;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.pricing-rp-pack:hover em,
.pricing-rp-pack.is-highlighted em {
    background: linear-gradient(135deg, #f59e0b, #7c3aed);
}

.pricing-rp-custom {
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.72));
    padding: 14px;
}

.pricing-rp-custom label {
    display: block;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.pricing-rp-custom-row {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.pricing-rp-currency,
.pricing-rp-custom output {
    color: #bfdbfe;
    font-weight: 900;
}

.pricing-rp-custom input {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 9px;
    background: rgba(2, 6, 23, 0.64);
    color: #fff;
    padding: 9px 10px;
    font: 800 0.92rem Inter, sans-serif;
}

.pricing-rp-custom button,
.sb-rp-shop-btn {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #7c3aed);
    color: #fff;
    padding: 9px 13px;
    font: 800 0.82rem Inter, sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.pricing-rp-custom small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.76rem;
}

@media (max-width: 820px) {
    .pricing-rp-panel {
        grid-template-columns: 1fr;
    }
    .pricing-rp-shop-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .pricing-rp-shop-head small {
        text-align: left;
    }
    .pricing-rp-packs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pricing-rp-pack.is-patron {
        grid-column: span 2;
    }
    .pricing-rp-custom-row {
        grid-template-columns: auto minmax(76px, 1fr) auto;
    }
    .pricing-rp-custom button {
        grid-column: 1 / -1;
    }
}

@media (min-width: 821px) and (max-width: 1120px) {
    .pricing-rp-packs-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .pricing-rp-pack.is-patron {
        grid-column: span 3;
    }
}
.pricing-footnote {
    margin-top: 26px;
    padding: 18px 22px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    font-size: 0.92rem;
    color: rgba(238,242,255,0.74);
    line-height: 1.6;
}

/* ---------- Checkout coming soon modal ---------- */
.checkout-soon-container { max-width: 480px; width: min(480px, 92vw); }
.checkout-soon-kicker {
    font: 600 0.72rem Inter, sans-serif;
    color: rgba(139,92,246,0.85);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.checkout-soon-copy {
    font-size: 0.95rem;
    color: rgba(238,242,255,0.82);
    line-height: 1.5;
    margin: 0 0 12px;
}
.checkout-soon-meta {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: rgba(238,242,255,0.82);
    margin-bottom: 16px;
    min-height: 18px;
}
.checkout-soon-meta:empty { display: none; }
.checkout-soon-actions { display: flex; justify-content: flex-end; }

/* ---------- Songbook bundle banner ---------- */
.sb-bundle-banner {
    margin: 12px 18px 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(102,126,234,0.18), rgba(139,92,246,0.08));
    border: 1px solid rgba(139,92,246,0.38);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
}
.sb-bundle-banner-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb-bundle-kicker {
    font: 700 0.7rem Inter, sans-serif;
    color: rgba(139,92,246,0.95);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.sb-bundle-headline {
    font: 700 0.98rem Inter, sans-serif;
    color: #f5f7ff;
}
.sb-bundle-subline {
    font-size: 0.82rem;
    color: rgba(238,242,255,0.68);
}
.sb-bundle-cta {
    appearance: none;
    background: linear-gradient(135deg, #667eea, #8b5cf6);
    border: none;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font: 700 0.88rem Inter, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sb-bundle-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(139,92,246,0.4); }
.sb-bundle-cta:disabled {
    cursor: progress;
    opacity: 0.68;
    transform: none;
    box-shadow: none;
}

.songbook-bundle-dialog {
    width: min(560px, calc(100vw - 34px)) !important;
    max-width: 560px !important;
    overflow: hidden;
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 16% 0%, rgba(139,92,246,0.28), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(251,191,36,0.16), transparent 30%),
        linear-gradient(150deg, rgba(13,16,38,0.98), rgba(24,18,48,0.97)) !important;
    border: 1px solid rgba(167,139,250,0.3) !important;
    box-shadow: 0 28px 82px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.14) !important;
}

.songbook-bundle-dialog.success {
    border-color: rgba(251,191,36,0.36) !important;
    background:
        radial-gradient(circle at 14% 0%, rgba(251,191,36,0.24), transparent 34%),
        radial-gradient(circle at 92% 10%, rgba(139,92,246,0.22), transparent 30%),
        linear-gradient(150deg, rgba(13,16,38,0.98), rgba(30,22,50,0.97)) !important;
}

.songbook-bundle-kicker {
    display: block;
    margin-bottom: 6px;
    color: #a78bfa;
    font: 900 0.72rem Inter, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.songbook-bundle-dialog.success .songbook-bundle-kicker {
    color: #fbbf24;
}

.songbook-bundle-hero-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.42), rgba(236,72,153,0.24));
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 16px 32px rgba(0,0,0,0.2);
    font-size: 1.5rem;
}

.songbook-bundle-dialog.success .songbook-bundle-hero-icon {
    background: linear-gradient(135deg, rgba(251,191,36,0.42), rgba(139,92,246,0.24));
}

.songbook-bundle-copy {
    margin: 0 0 14px;
    color: rgba(248,250,252,0.92);
    font: 750 1.02rem/1.55 Inter, sans-serif;
}

.songbook-bundle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.songbook-bundle-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(226,232,240,0.82);
    font: 850 0.75rem Inter, sans-serif;
}

.songbook-bundle-note {
    margin: 0;
    color: rgba(203,213,225,0.68);
    font: 600 0.82rem/1.55 Inter, sans-serif;
}

.songbook-bundle-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.songbook-bundle-primary {
    background: linear-gradient(135deg, #7c3aed, #f59e0b) !important;
    border-color: rgba(251,191,36,0.34) !important;
}

.sb-rp-shop-row {
    margin: 10px 18px 0;
    padding: 10px 12px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
    color: rgba(238,242,255,0.78);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font: 700 0.78rem Inter, sans-serif;
}

.profile-card-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.profile-rp-shop-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.profile-rp-shop-preview span {
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* ---------- Songbook "Buy R10" pill ---------- */
.sb-buy-r10 {
    appearance: none;
    border: 1px solid rgba(251,191,36,0.5);
    background: rgba(251,191,36,0.10);
    color: #fbbf24;
    padding: 4px 10px;
    border-radius: 999px;
    font: 700 0.7rem Inter, sans-serif;
    cursor: pointer;
    margin-left: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.sb-buy-r10:hover {
    background: rgba(251,191,36,0.22);
    border-color: rgba(251,191,36,0.85);
    color: #fde68a;
}

.leaderboard-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 8, 20, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 140000;
}

.leaderboard-overlay.active {
    display: flex;
}

.leaderboard-modal {
    width: min(960px, calc(100vw - 32px));
    max-height: min(82vh, 840px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 24, 0.98));
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
    color: #f8fafc;
}

.leaderboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.leaderboard-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(96, 165, 250, 0.92);
}

.leaderboard-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.leaderboard-title-block {
    min-width: 0;
}

.leaderboard-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.leaderboard-mode-switch {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.leaderboard-mode {
    border: none;
    border-radius: 999px;
    padding: 8px 13px;
    background: transparent;
    color: rgba(226, 232, 240, 0.72);
    font: 800 0.78rem/1 Inter, sans-serif;
    cursor: pointer;
}

.leaderboard-mode.active {
    background: linear-gradient(135deg, #2563eb, #f59e0b);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.leaderboard-streak-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 9px 15px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    background:
        radial-gradient(circle at 18% 20%, rgba(251,191,36,0.26), transparent 34%),
        linear-gradient(135deg, rgba(124,58,237,0.34), rgba(249,115,22,0.26));
    color: #fff7ed;
    box-shadow: 0 10px 24px rgba(249,115,22,0.12), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.leaderboard-streak-button span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(251,191,36,0.16);
    box-shadow: inset 0 0 0 1px rgba(251,191,36,0.22);
}

.leaderboard-streak-button:hover,
.leaderboard-streak-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(251,191,36,0.72);
    background:
        radial-gradient(circle at 18% 20%, rgba(251,191,36,0.36), transparent 34%),
        linear-gradient(135deg, rgba(124,58,237,0.52), rgba(249,115,22,0.46));
    box-shadow: 0 14px 30px rgba(249,115,22,0.2), 0 0 0 3px rgba(251,191,36,0.1);
}

.leaderboard-subtitle {
    margin: 6px 0 0;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.92rem;
    line-height: 1.5;
}

.leaderboard-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    font-size: 1.3rem;
    cursor: pointer;
}

.leaderboard-refresh {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    margin-right: 8px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.leaderboard-refresh:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.5);
    color: #dbeafe;
}

.leaderboard-refresh:disabled {
    cursor: progress;
    opacity: 0.7;
}

.leaderboard-refresh-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.leaderboard-refresh.is-loading .leaderboard-refresh-icon {
    animation: leaderboard-refresh-spin 0.9s linear infinite;
    transform-origin: 50% 50%;
}

@keyframes leaderboard-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.leaderboard-body {
    padding: 20px 26px 24px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.72) rgba(7,11,24,0.78);
}

.leaderboard-body::-webkit-scrollbar,
.leaderboard-badge-catalog::-webkit-scrollbar,
.leaderboard-player-badge-grid::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.leaderboard-body::-webkit-scrollbar-track,
.leaderboard-badge-catalog::-webkit-scrollbar-track,
.leaderboard-player-badge-grid::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(7,11,24,0.92), rgba(18,20,48,0.78));
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.1);
}

.leaderboard-body::-webkit-scrollbar-thumb,
.leaderboard-badge-catalog::-webkit-scrollbar-thumb,
.leaderboard-player-badge-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #6366f1 52%, #a855f7);
    border: 2px solid rgba(7,11,24,0.9);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.leaderboard-body::-webkit-scrollbar-thumb:hover,
.leaderboard-badge-catalog::-webkit-scrollbar-thumb:hover,
.leaderboard-player-badge-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7dd3fc, #818cf8 52%, #c084fc);
}

.leaderboard-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 18px;
}

.leaderboard-tabs.is-hidden {
    display: none;
}

.leaderboard-tab {
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.72);
    padding: 10px 16px;
    border-radius: 999px;
    font: 700 0.88rem/1 Inter, sans-serif;
    cursor: pointer;
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.24);
}

.leaderboard-panel {
    display: none;
}

.leaderboard-panel.active {
    display: block;
}

.leaderboard-list {
    display: grid;
    gap: 12px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.1);
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.leaderboard-row:hover,
.leaderboard-row:focus-visible {
    border-color: rgba(96, 165, 250, 0.42);
    transform: translateY(-1px);
    outline: none;
}

.leaderboard-row.rank-gold {
    background: linear-gradient(135deg, rgba(133, 77, 14, 0.35), rgba(120, 53, 15, 0.25));
    border-color: rgba(250, 204, 21, 0.28);
}

.leaderboard-row.rank-silver {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.38), rgba(51, 65, 85, 0.24));
    border-color: rgba(226, 232, 240, 0.24);
}

.leaderboard-row.rank-bronze {
    background: linear-gradient(135deg, rgba(124, 45, 18, 0.35), rgba(154, 52, 18, 0.22));
    border-color: rgba(251, 146, 60, 0.28);
}

.leaderboard-rank {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-rank-number {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.leaderboard-rank-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rank-gold .leaderboard-rank-label {
    background: rgba(250, 204, 21, 0.18);
    color: #fde68a;
}

.rank-silver .leaderboard-rank-label {
    background: rgba(226, 232, 240, 0.18);
    color: #e2e8f0;
}

.rank-bronze .leaderboard-rank-label {
    background: rgba(251, 146, 60, 0.18);
    color: #fdba74;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.leaderboard-avatar,
.leaderboard-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.leaderboard-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(139, 92, 246, 0.28));
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    overflow: hidden;
}

.leaderboard-avatar img {
    object-fit: cover;
    display: block;
}

.leaderboard-avatar.small,
.leaderboard-avatar.small img {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
}

.leaderboard-player-copy {
    min-width: 0;
}

.leaderboard-player-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-player-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: rgba(191, 219, 254, 0.72);
}

.leaderboard-badge-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    margin-top: 8px;
}

.leaderboard-badge-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(251, 191, 36, 0.22);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.26);
}

.leaderboard-badge-more {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.72rem;
    font-weight: 800;
}

.leaderboard-value {
    text-align: right;
}

.leaderboard-value-amount {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.leaderboard-value-label {
    margin-top: 4px;
    font-size: 0.76rem;
    color: rgba(226, 232, 240, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.leaderboard-empty,
.leaderboard-loading {
    padding: 28px 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px dashed rgba(148, 163, 184, 0.18);
    text-align: center;
    color: rgba(226, 232, 240, 0.7);
}

.leaderboard-status {
    margin-top: 14px;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.72);
}

.leaderboard-badge-intro {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.18);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.12)),
        rgba(15, 23, 42, 0.72);
}

.leaderboard-badge-intro h4 {
    margin: 0;
    font-size: 1.06rem;
    color: #fff;
}

.leaderboard-badge-intro p {
    margin: 8px 0 0;
    max-width: 780px;
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.9rem;
    line-height: 1.55;
}

.leaderboard-badge-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.leaderboard-badge-card {
    display: flex;
    gap: 12px;
    min-height: 136px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.leaderboard-badge-art {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.leaderboard-badge-card-copy {
    min-width: 0;
}

.leaderboard-badge-category {
    display: block;
    margin-bottom: 4px;
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-badge-card h5 {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
}

.leaderboard-badge-card p {
    margin: 5px 0 9px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.78rem;
    line-height: 1.38;
}

.leaderboard-badge-holders {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(203, 213, 225, 0.72);
    font-size: 0.73rem;
    line-height: 1.25;
}

.profile-earned-badges-card {
    grid-column: 1 / -1;
}

.profile-earned-badges-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.profile-earned-badges-head .profile-card-title {
    margin-bottom: 4px;
}

.profile-earned-badges-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: #bfdbfe;
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-earned-badges-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.profile-earned-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.profile-earned-badge img {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.profile-earned-badge strong,
.profile-earned-badge span {
    display: block;
}

.profile-earned-badge strong {
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.18;
}

.profile-earned-badge span {
    margin-top: 4px;
    color: rgba(100, 116, 139, 0.9);
    font-size: 0.76rem;
    font-weight: 700;
}

.leaderboard-player-badges {
    position: fixed;
    inset: 0;
    z-index: 120010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(3, 7, 18, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.leaderboard-player-badges-panel {
    position: relative;
    width: min(760px, calc(100vw - 24px));
    max-height: min(82vh, 760px);
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(12, 18, 36, 0.98), rgba(7, 11, 24, 0.98));
    color: #f8fafc;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    padding: 20px;
}

.leaderboard-player-badges-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    font-size: 1.2rem;
    cursor: pointer;
}

.leaderboard-player-badges-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 48px;
    margin-bottom: 16px;
}

.leaderboard-player-badges-head h4 {
    margin: 0;
    font-size: 1.1rem;
}

.leaderboard-player-badges-head p {
    margin: 4px 0 0;
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.84rem;
}

.leaderboard-player-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.leaderboard-player-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    min-height: 74px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.64);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.leaderboard-player-badge img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-player-badge.locked {
    opacity: 0.46;
    filter: grayscale(0.72);
}

.leaderboard-player-badge strong,
.leaderboard-player-badge span {
    display: block;
}

.leaderboard-player-badge strong {
    font-size: 0.84rem;
    color: #fff;
}

.leaderboard-player-badge span {
    margin-top: 3px;
    color: rgba(226, 232, 240, 0.66);
    font-size: 0.74rem;
}

.badge-earned-toast {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 130000;
    width: min(390px, calc(100vw - 28px));
    min-height: 118px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background:
        radial-gradient(circle at 18% 22%, rgba(251, 191, 36, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
    color: #f8fafc;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38), 0 0 28px rgba(251, 191, 36, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: badgeToastIn 0.58s cubic-bezier(0.2, 0.9, 0.2, 1) both;
    cursor: pointer;
}

.badge-earned-toast.leaving {
    animation: badgeToastOut 0.52s ease-in both;
}

.badge-earned-art-wrap {
    position: relative;
    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.badge-earned-art-wrap::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 1px solid rgba(251, 191, 36, 0.26);
    opacity: 0.8;
}

.badge-earned-art {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.34));
    animation: badgeEarnedSpin 1.15s cubic-bezier(0.18, 0.88, 0.22, 1.08) 0.08s both;
}

.badge-earned-copy {
    min-width: 0;
}

.badge-earned-kicker {
    display: block;
    margin-bottom: 3px;
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-earned-copy strong,
.badge-earned-name {
    display: block;
}

.badge-earned-copy strong {
    color: #fff;
    font-size: 1.02rem;
    line-height: 1.15;
}

.badge-earned-name {
    margin-top: 3px;
    color: #fde68a;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
}

.badge-earned-copy p {
    margin: 7px 0 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.78rem;
    line-height: 1.35;
}

@keyframes badgeToastIn {
    from {
        opacity: 0;
        transform: translateX(calc(100% + 34px)) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes badgeToastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(calc(100% + 34px)) scale(0.98);
    }
}

@keyframes badgeEarnedSpin {
    0% {
        transform: rotateY(0deg) scale(0.88);
    }
    72% {
        transform: rotateY(360deg) scale(1.08);
    }
    100% {
        transform: rotateY(360deg) scale(1);
    }
}

@media (max-width: 860px) {
    .leaderboard-overlay {
        align-items: flex-start;
        padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        height: var(--mobile-visual-height, 100dvh);
        min-height: var(--mobile-visual-height, 100dvh);
        overflow: hidden;
        box-sizing: border-box;
    }

    .leaderboard-modal {
        width: 100%;
        height: calc(var(--mobile-visual-height, 100dvh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)) - 8px);
        max-height: calc(var(--mobile-visual-height, 100dvh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)) - 8px);
        border-radius: 18px;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .leaderboard-head,
    .leaderboard-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .leaderboard-head {
        align-items: center;
        gap: 8px;
        padding-top: 9px;
        padding-bottom: 8px;
    }

    .leaderboard-title-row {
        align-items: center;
        gap: 7px;
    }

    .leaderboard-kicker {
        font-size: 0.52rem;
        margin-bottom: 2px;
    }

    .leaderboard-title {
        font-size: 1.05rem;
        line-height: 1;
    }

    .leaderboard-mode-switch {
        padding: 3px;
        gap: 3px;
    }

    .leaderboard-mode {
        padding: 6px 9px;
        font-size: 0.62rem;
    }

    .leaderboard-streak-button {
        min-height: 28px;
        padding: 6px 10px;
        font-size: 0.62rem;
        gap: 5px;
    }

    .leaderboard-streak-button span {
        width: 16px;
        height: 16px;
    }

    .leaderboard-mode-switch {
        max-width: 100%;
        overflow-x: auto;
    }

    .leaderboard-subtitle {
        display: none;
    }

    .leaderboard-refresh,
    .leaderboard-close {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        margin-right: 3px;
        font-size: 1rem;
    }

    .leaderboard-refresh-icon {
        width: 15px;
        height: 15px;
    }

    .leaderboard-body {
        min-height: 0;
        overflow: hidden;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 7px;
        padding-top: 8px;
        padding-bottom: 9px;
    }

    .leaderboard-tabs {
        margin-bottom: 0;
        padding: 4px;
        gap: 4px;
    }

    .leaderboard-tab {
        padding: 7px 10px;
        font-size: 0.66rem;
    }

    .leaderboard-panel {
        min-height: 0;
        overflow: hidden;
    }

    .leaderboard-panel.active {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .leaderboard-list {
        gap: 6px;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        max-height: 100%;
        padding-right: 3px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .leaderboard-badge-catalog {
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        padding-right: 3px;
        -webkit-overflow-scrolling: touch;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .leaderboard-badge-intro {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 58px;
        padding: 7px 9px;
        border-radius: 11px;
    }

    .leaderboard-value {
        grid-column: auto;
        text-align: right;
        padding-left: 0;
    }

    .leaderboard-rank {
        gap: 2px;
    }

    .leaderboard-rank-number {
        font-size: 0.78rem;
    }

    .leaderboard-rank-label {
        display: none;
    }

    .leaderboard-player {
        gap: 7px;
    }

    .leaderboard-avatar,
    .leaderboard-avatar img {
        width: 28px;
        height: 28px;
        font-size: 0.68rem;
    }

    .leaderboard-player-name {
        font-size: 0.76rem;
    }

    .leaderboard-player-meta,
    .leaderboard-value-label {
        display: none;
    }

    .leaderboard-value-amount {
        font-size: 0.75rem;
    }

    .leaderboard-badge-strip {
        min-height: 16px;
        margin-top: 3px;
        gap: 2px;
    }

    .leaderboard-badge-mini {
        width: 16px;
        height: 16px;
    }

    .leaderboard-badge-more {
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 0.56rem;
    }

    .leaderboard-status {
        margin-top: 0;
        font-size: 0.62rem;
        min-height: 0;
    }

    .profile-earned-badges-head {
        flex-direction: column;
    }

    .profile-earned-badges-list {
        grid-template-columns: 1fr;
    }

    .leaderboard-badge-card {
        min-height: 58px;
        max-height: 66px;
        padding: 6px 7px;
        gap: 7px;
        border-radius: 10px;
        align-items: center;
        overflow: hidden;
    }

    .leaderboard-badge-art {
        width: 42px;
        height: 42px;
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
    }

    .leaderboard-badge-card-copy {
        min-width: 0;
        overflow: hidden;
    }

    .leaderboard-badge-category {
        margin-bottom: 2px;
        font-size: 0.48rem;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-badge-card h5 {
        font-size: 0.68rem;
        line-height: 1.05;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-badge-card p {
        display: none;
    }

    .leaderboard-badge-holders {
        margin-top: 3px;
        gap: 3px;
        font-size: 0.52rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-badge-holders .leaderboard-avatar.small,
    .leaderboard-badge-holders .leaderboard-avatar.small img {
        width: 16px;
        height: 16px;
        font-size: 0.48rem;
    }

    .leaderboard-badge-holders .leaderboard-avatar.small:nth-of-type(n+3) {
        display: none;
    }

    .badge-earned-toast {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        width: min(360px, calc(100vw - 20px));
        min-height: 104px;
        padding: 12px;
    }

    .badge-earned-art-wrap {
        width: 72px;
        height: 72px;
    }

    .badge-earned-art {
        width: 66px;
        height: 66px;
    }
}

@media (max-width: 860px) and (orientation: landscape), (orientation: landscape) and (max-height: 480px) {
    .leaderboard-overlay {
        align-items: flex-start;
        padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        height: var(--mobile-visual-height, 100dvh);
        overflow: hidden;
    }

    .leaderboard-modal {
        width: min(100%, 960px);
        height: calc(var(--mobile-visual-height, 100dvh) - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom)) - 6px);
        max-height: calc(var(--mobile-visual-height, 100dvh) - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom)) - 6px);
        border-radius: 16px;
    }

    .leaderboard-head {
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .leaderboard-title {
        font-size: 0.98rem;
    }

    .leaderboard-body {
        padding-top: 7px;
        padding-bottom: 8px;
        gap: 6px;
    }

    .leaderboard-row {
        min-height: 54px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .leaderboard-tabs {
        max-width: 100%;
        overflow-x: auto;
    }

    .leaderboard-badge-catalog {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .leaderboard-badge-card {
        min-height: 52px;
        max-height: 58px;
        padding: 5px 6px;
        gap: 6px;
    }

    .leaderboard-badge-art {
        width: 36px;
        height: 36px;
    }

    .leaderboard-badge-category {
        font-size: 0.42rem;
    }

    .leaderboard-badge-card h5 {
        font-size: 0.62rem;
    }

    .leaderboard-badge-holders {
        font-size: 0.48rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .badge-earned-toast,
    .badge-earned-toast.leaving,
    .badge-earned-art {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }
}
