/* ============================================
   Practice Gameplay Screen
   ============================================ */

.gameplay-screen {
    align-items: center;
    justify-content: flex-start;
}

.gameplay-screen .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top bar */
.gameplay-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-4);
    flex-shrink: 0;
}

.gameplay-stats {
    display: flex;
    gap: var(--space-6);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-accent);
}

.gameplay-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Main gameplay area */
.gameplay-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    position: relative;
}

/* BPM display */
.bpm-display {
    text-align: center;
}

.bpm-display .bpm-number {
    font-size: var(--font-size-hero);
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1;
}

.bpm-display .bpm-label {
    font-size: var(--font-size-sm);
    color: var(--text-accent);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: var(--space-1);
}

/* Chord progression bar */
.progression-bar-container {
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
    height: 44px;
    margin-bottom: var(--space-3);
}

.progression-track {
    display: flex;
    gap: var(--space-3);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    padding: 4px 0;
}

.chord-pill {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.5;
    transform: scale(0.9);
}

.chord-pill.active {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 16px rgba(43, 157, 238, 0.4),
        0 0 32px rgba(43, 157, 238, 0.15);
}

.chord-pill.past {
    opacity: 0.35;
    transform: scale(0.85);
}

/* Metronome canvas container */
.metronome-container {
    width: 460px;
    height: 460px;
    position: relative;
}

/* Note ring toggle */
.note-ring-toggle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-accent);
    font-family: inherit;
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0.85;
    z-index: 2;
}

.note-ring-toggle:hover {
    opacity: 1;
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.note-ring-toggle.off {
    opacity: 0.45;
    color: var(--text-muted);
}

.note-ring-toggle-icon {
    font-size: var(--font-size-sm);
}

/* Pattern info */
.pattern-info {
    text-align: center;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.pattern-info .pattern-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.pattern-info .pattern-notes {
    font-size: var(--font-size-sm);
    color: var(--text-accent);
    font-family: monospace;
    letter-spacing: 0.1em;
}

/* Hit feedback — stacking markers */
.hit-feedback-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 200px;
    height: 120px;
}

.hit-marker {
    position: absolute;
    bottom: 0;
    left: 50%;
    font-size: var(--font-size-xl);
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    animation: markerFloat 0.9s var(--ease-out) forwards;
    transform: translateX(calc(-50% + var(--jitter, 0px)));
    text-shadow: 0 0 12px currentColor;
}

@keyframes markerFloat {
    0% {
        opacity: 1;
        transform: translateX(calc(-50% + var(--jitter, 0px))) translateY(0) scale(0.6);
    }

    20% {
        opacity: 1;
        transform: translateX(calc(-50% + var(--jitter, 0px))) translateY(-10px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateX(calc(-50% + var(--jitter, 0px))) translateY(-60px) scale(0.85);
    }
}

.hit-marker.perfect {
    color: var(--color-perfect);
}

.hit-marker.good {
    color: var(--color-good);
}

.hit-marker.ok {
    color: var(--color-ok);
}

.hit-marker.miss {
  color: var(--color-miss);
}

/* Partial chord hit — amber-orange, slightly smaller to distinguish from full hits */
.hit-marker.partial {
  color: #fb923c;
  font-size: var(--font-size-lg);
}


/* Countdown overlay */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 18, 25, 0.85);
    z-index: 10;
    border-radius: var(--radius-md);
}

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

.countdown-number {
    font-size: 120px;
    font-weight: 700;
    color: var(--accent);
    animation: countdownPulse 0.5s var(--ease-out);
}

@keyframes countdownPulse {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 1;
    }
}

/* Bottom status bar */
.gameplay-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    margin-top: auto;
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected {
    background: var(--color-success);
}

.status-dot.disconnected {
    background: var(--color-error);
}

.status-dot.active {
    background: var(--accent);
}

/* Streak display */
.streak-display {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.streak-display .streak-count {
    color: var(--color-warning);
    font-weight: 700;
    font-size: var(--font-size-md);
}

/* Theory info */
.theory-info {
    max-width: 500px;
    margin: var(--space-2) auto 0;
    font-size: var(--font-size-xs);
    line-height: 1.6;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-subtle);
}