/* Rhythm Game Specific Layout & Styling */

.game-hud-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(11, 9, 18, 0.6);
    border-bottom: 1px solid rgba(199, 125, 255, 0.1);
    flex-shrink: 0;
}

.hud-stat {
    display: flex;
    flex-direction: column;
}

.hud-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-value {
    font-size: 18px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--pure-light);
}

.hud-value.highlight-cyan {
    color: var(--pulse-cyan);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.hud-value.highlight-amethyst {
    color: var(--laser-amethyst);
    text-shadow: 0 0 10px rgba(199, 125, 255, 0.5);
}

/* Energy Gauge */
.energy-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    width: 90px;
}

.energy-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.energy-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-ultraviolet), var(--pulse-cyan));
    border-radius: 3px;
    transition: width 0.2s ease, background 0.2s ease;
}

.energy-fill.danger {
    background: var(--error-glitch);
    box-shadow: 0 0 8px var(--error-glitch);
}

/* Canvas Viewport */
.rhythm-viewport {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: none;
    background: radial-gradient(circle at 50% 10%, rgba(123, 44, 191, 0.15) 0%, rgba(6, 7, 11, 0.95) 80%);
}

#rhythmCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Floating Judgement Banner */
.judgement-display {
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    opacity: 0;
    transition: transform 0.12s ease-out, opacity 0.2s ease;
    text-shadow: 0 0 16px currentColor;
    z-index: 20;
}

.judgement-display.pop {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.15);
}

.judgement-display.perfect {
    color: var(--pulse-cyan);
}

.judgement-display.great {
    color: var(--laser-amethyst);
}

.judgement-display.miss {
    color: var(--error-glitch);
}

/* Screen Shake Glitch */
.screen-glitch-shake {
    animation: screenShake 0.18s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screenShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Lane Strike Controls Pad Overlay */
.touch-controls-dock {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 15;
    pointer-events: auto;
}

.strike-touch-pad {
    position: relative;
    border-right: 1px solid rgba(199, 125, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    cursor: pointer;
    touch-action: none;
    background: transparent;
    transition: background 0.08s ease;
}

.strike-touch-pad:last-child {
    border-right: none;
}

.strike-touch-pad.active {
    background: linear-gradient(0deg, rgba(0, 242, 254, 0.25) 0%, rgba(123, 44, 191, 0.1) 60%, transparent 100%);
}

.pad-sensor-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(199, 125, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 16, 28, 0.7);
    transition: all 0.1s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.strike-touch-pad.active .pad-sensor-ring {
    border-color: var(--pulse-cyan);
    background: rgba(0, 242, 254, 0.3);
    transform: scale(0.92);
    box-shadow: 0 0 16px var(--pulse-cyan);
}

.pad-key-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.strike-touch-pad.active .pad-key-label {
    color: var(--pure-light);
}

/* Secondary Panels (Record & Sunday Cadence) */
.panel-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.panel-card {
    background: var(--matrix-slate);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-ultraviolet), var(--pulse-cyan));
}

.card-title {
    font-family: var(--font-title);
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--pure-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .card-mark {
    width: 6px;
    height: 14px;
    background: var(--pulse-cyan);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--pulse-cyan);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.stat-box {
    background: rgba(6, 7, 11, 0.6);
    border: 1px solid rgba(199, 125, 255, 0.12);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.stat-box-num {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--pulse-cyan);
    margin-top: 4px;
}

/* Sunday Cadence Allocation */
.countdown-clock {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.clock-unit {
    background: rgba(6, 7, 11, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 4px;
    text-align: center;
}

.clock-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--laser-amethyst);
}

.clock-tag {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.cadence-ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(6, 7, 11, 0.5);
    border: 1px solid rgba(199, 125, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

.cadence-token-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(123, 44, 191, 0.3);
    border: 1px solid var(--laser-amethyst);
    color: var(--pure-light);
}

.cadence-input-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.cadence-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: rgba(6, 7, 11, 0.8);
    color: var(--pure-light);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.cadence-input:focus {
    border-color: var(--pulse-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.cadence-submit-btn, .action-btn {
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--neon-ultraviolet), #4a0072);
    color: var(--pure-light);
    font-family: var(--font-title);
    font-size: 13px;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(123, 44, 191, 0.4);
    transition: all 0.2s ease;
}

.cadence-submit-btn:active, .action-btn:active {
    transform: scale(0.98);
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    box-shadow: none;
    margin-top: 8px;
}

/* Modal Content Styles */
.modal-score-badge {
    font-family: var(--font-mono);
    font-size: 34px;
    font-weight: 700;
    color: var(--pulse-cyan);
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
    margin: 12px 0 4px 0;
}

.modal-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.modal-stats-matrix {
    margin: 18px 0;
    border-top: 1px solid rgba(199, 125, 255, 0.15);
    border-bottom: 1px solid rgba(199, 125, 255, 0.15);
    padding: 12px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.modal-stat-item {
    display: flex;
    flex-direction: column;
}

.modal-stat-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--laser-amethyst);
}
