/* ============ CSS Variables ============ */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-nav: rgba(255,255,255,0.97);
    --bg-input: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8888a0;
    --border-color: #d8dce5;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --accent: #e17055;
    --accent-light: #fab1a0;
    --accent-dark: #c0392b;
    --accent-bg: rgba(225,112,85,0.08);
    --primary: #6C5CE7;
    --primary-light: #a29bfe;
    --primary-dark: #5541d7;
    --primary-bg: rgba(108,92,231,0.08);
    --success: #00b894;
    --success-light: #55efc4;
    --warning: #fdcb6e;
    --warning-dark: #e17055;
    --danger: #d63031;
    --info: #0984e3;
    --beat-strong: #e17055;
    --beat-medium: #f39c12;
    --beat-weak: #6C5CE7;
    --ring-track: #e8e8e8;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f1023;
    --bg-secondary: #1a1b35;
    --bg-card: #22234a;
    --bg-nav: rgba(15,16,35,0.97);
    --bg-input: #2a2b52;
    --text-primary: #f0f0f8;
    --text-secondary: #b8b8d0;
    --text-muted: #8888a8;
    --border-color: #3a3b62;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
    --accent-bg: rgba(225,112,85,0.15);
    --primary-bg: rgba(108,92,231,0.15);
    --ring-track: #2a2b52;
}

/* ============ Reset & Base ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 20px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    line-height: 1.5;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

input {
    font-family: inherit;
    outline: none;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

/* ============ Top Navigation ============ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.08);
}

.top-nav .btn-sm {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.top-nav .btn-sm:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ============ Main Stage ============ */
.main-stage {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 32px 40px;
}

/* ============ Visual Area ============ */
.visual-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 28px 0 12px;
    position: relative;
}

/* ============ Beat Dots ============ */
.beat-dots {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

.beat-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.beat-dot.accent-strong {
    border-color: var(--beat-strong);
    color: var(--beat-strong);
}

.beat-dot.accent-medium {
    border-color: var(--beat-medium);
    color: var(--beat-medium);
}

.beat-dot.accent-weak {
    border-color: var(--beat-weak);
    color: var(--beat-weak);
}

.beat-dot.active {
    transform: scale(1.35);
}

.beat-dot.accent-strong.active {
    background: var(--beat-strong);
    color: white;
    box-shadow: 0 0 28px rgba(225,112,85,0.6), 0 0 56px rgba(225,112,85,0.25);
    border-color: var(--beat-strong);
}

.beat-dot.accent-medium.active {
    background: var(--beat-medium);
    color: white;
    box-shadow: 0 0 24px rgba(243,156,18,0.5), 0 0 48px rgba(243,156,18,0.2);
    border-color: var(--beat-medium);
}

.beat-dot.accent-weak.active {
    background: var(--beat-weak);
    color: white;
    box-shadow: 0 0 20px rgba(108,92,231,0.5), 0 0 40px rgba(108,92,231,0.2);
    border-color: var(--beat-weak);
}

/* Subdivision indicator inside dot */
.beat-dot .sub-indicator {
    position: absolute;
    bottom: -6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0;
    transition: opacity 0.1s;
}

.beat-dot.active .sub-indicator {
    opacity: 1;
}

/* ============ Metronome Center ============ */
.metronome-center {
    position: relative;
    width: 320px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ Pendulum ============ */
.pendulum-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pendulum-arm {
    position: absolute;
    left: 50%;
    bottom: 38%;
    width: 4px;
    height: 55%;
    margin-left: -2px;
    background: linear-gradient(to top, var(--accent), var(--accent-light));
    border-radius: 2px;
    transform-origin: bottom center;
    transform: rotate(0deg);
    transition: none;
}

.pendulum-weight {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
}

.weight-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 4px 12px rgba(225,112,85,0.4);
    transition: box-shadow 0.15s;
}

.pendulum-weight.at-extreme .weight-inner {
    box-shadow: 0 4px 20px rgba(225,112,85,0.7), 0 0 40px rgba(225,112,85,0.3);
}

.pendulum-base {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.base-center {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(225,112,85,0.4);
}

/* ============ BPM Display ============ */
.bpm-display {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.bpm-value {
    font-size: 3.6rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -2px;
}

.bpm-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 18px;
}

/* ============ Current Beat Info ============ */
.current-beat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.beat-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-height: 1.6em;
    transition: color 0.2s;
}

.beat-label.active-beat {
    color: var(--accent);
}

.tempo-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    font-style: italic;
}

/* ============ BPM Slider ============ */
.bpm-slider-section {
    padding: 0 12px;
    margin: 8px 0 16px;
}

.bpm-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    padding: 0 2px;
}

.bpm-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--primary));
    outline: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.bpm-slider:hover {
    opacity: 1;
}

.bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.bpm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(225,112,85,0.4);
}

.bpm-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ============ Tempo Presets ============ */
.tempo-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.tempo-btn {
    padding: 10px 20px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.tempo-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225,112,85,0.2);
}

.tempo-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(225,112,85,0.35);
}

/* ============ Main Controls ============ */
.main-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 20px 0 28px;
    flex-wrap: wrap;
}

.ctrl-btn {
    padding: 16px 36px;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    transition: var(--transition);
    min-width: 140px;
}

.ctrl-play {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    min-width: 180px;
    font-size: 1.3rem;
    padding: 18px 48px;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(225,112,85,0.35);
}

.ctrl-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(225,112,85,0.5);
}

.ctrl-play.playing {
    background: linear-gradient(135deg, var(--warning-dark), #d35400);
}

.ctrl-stop {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.ctrl-stop:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(214,48,49,0.06);
}

.ctrl-tap {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.ctrl-tap:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.ctrl-tap:active {
    transform: scale(0.95);
}

.ctrl-tap.tapping {
    animation: tapPulse 0.15s ease;
}

@keyframes tapPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* ============ Settings Panels ============ */
.settings-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.setting-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: var(--transition);
}

.setting-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

.setting-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ============ Time Signature ============ */
.time-signature-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ts-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 56px;
    text-align: center;
}

.ts-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

.ts-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.accent-info {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.accent-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.accent-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.accent-dot.strong { background: var(--beat-strong); }
.accent-dot.medium { background: var(--beat-medium); }
.accent-dot.weak { background: var(--beat-weak); }

/* ============ Sound Selection ============ */
.sound-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.sound-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.sound-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

.sound-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.sound-icon {
    font-size: 1.4rem;
}

/* Volume */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vol-icon {
    font-size: 1.2rem;
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--ring-track);
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.vol-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.vol-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

/* ============ Options ============ */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}

.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

/* ============ Training Section ============ */
.training-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.training-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.training-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.training-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.stat-item {
    text-align: center;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
}

.btn-training {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
}

.btn-training:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,92,231,0.4);
}

.btn-training.active {
    background: linear-gradient(135deg, var(--danger), #c0392b);
}

/* ============ Shortcuts Hint ============ */
.shortcuts-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 16px 0;
    font-weight: 500;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 2px;
}

/* ============ Flash Overlay ============ */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.06s ease-out;
}

.flash-overlay.flash-strong {
    background: radial-gradient(circle, rgba(225,112,85,0.3), transparent 70%);
    opacity: 1;
}

.flash-overlay.flash-weak {
    background: radial-gradient(circle, rgba(108,92,231,0.15), transparent 70%);
    opacity: 1;
}

/* ============ Toast ============ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    font-size: 1rem;
    border-left: 5px solid var(--accent);
    font-weight: 500;
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning-dark); }
.toast.error { border-left-color: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-20px); }
}

/* ============ Fullscreen Mode ============ */
.fullscreen-mode .top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.fullscreen-mode .top-nav:hover {
    opacity: 1;
}

.fullscreen-mode .main-stage {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.fullscreen-mode .settings-panels,
.fullscreen-mode .shortcuts-hint {
    display: none;
}

.fullscreen-mode .bpm-value {
    font-size: 5rem;
}

.fullscreen-mode .beat-dot {
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
}

.fullscreen-mode .metronome-center {
    width: 420px;
    height: 360px;
}

.fullscreen-mode .ctrl-play {
    font-size: 1.6rem;
    padding: 22px 56px;
}

.fullscreen-mode .tempo-btn {
    padding: 14px 28px;
    font-size: 1.1rem;
}

/* ============ Responsive - Large Screens ============ */
@media (min-width: 1400px) {
    .metronome-center {
        width: 380px;
        height: 320px;
    }

    .bpm-value {
        font-size: 4rem;
    }

    .settings-panels {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============ Responsive - Tablets & Small Laptops ============ */
@media (max-width: 1024px) {
    html {
        font-size: 18px;
    }

    .metronome-center {
        width: 280px;
        height: 250px;
    }

    .bpm-value {
        font-size: 3rem;
    }

    .main-stage {
        padding: 20px 24px;
    }
}

/* ============ Responsive - Tablets Portrait ============ */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .main-stage {
        padding: 16px 16px;
    }

    .metronome-center {
        width: 260px;
        height: 230px;
    }

    .bpm-value {
        font-size: 2.6rem;
    }

    .beat-dot {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .beat-dots {
        gap: 10px;
    }

    .ctrl-btn {
        padding: 14px 28px;
        font-size: 1rem;
        min-width: 110px;
    }

    .ctrl-play {
        min-width: 150px;
        font-size: 1.15rem;
        padding: 16px 36px;
    }

    .sound-group {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-panels {
        grid-template-columns: 1fr;
    }

    .top-nav {
        padding: 12px 16px;
    }

    .nav-title {
        font-size: 1.2rem;
    }

    .tempo-presets {
        gap: 8px;
    }

    .tempo-btn {
        padding: 8px 16px;
        font-size: 0.88rem;
    }
}

/* ============ Responsive - Mobile ============ */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .metronome-center {
        width: 220px;
        height: 200px;
    }

    .bpm-value {
        font-size: 2.2rem;
    }

    .beat-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        border-width: 2px;
    }

    .beat-dots {
        gap: 8px;
    }

    .main-controls {
        gap: 10px;
    }

    .ctrl-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-width: 90px;
    }

    .ctrl-play {
        min-width: 130px;
        padding: 14px 28px;
        font-size: 1.05rem;
    }

    .ctrl-stop, .ctrl-tap {
        min-width: 0;
        flex: 1;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .sound-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .training-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .shortcuts-hint {
        display: none;
    }

    .time-signature-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .ts-btn {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
}

/* ============ Animations ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(225,112,85,0.3); }
    50% { box-shadow: 0 0 40px rgba(225,112,85,0.6); }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============ Selection Color ============ */
::selection {
    background: rgba(225,112,85,0.2);
}
