/* ============================================
   APOYA BAS! — Dark Aggressive Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --accent: #e63946;
    --accent-glow: rgba(230, 57, 70, 0.4);
    --accent-secondary: #ff6b35;
    --accent-gradient: linear-gradient(135deg, #e63946, #ff6b35);
    --text-primary: #f1faee;
    --text-secondary: #a8b2d1;
    --text-muted: #6c7590;
    --border: rgba(255, 255, 255, 0.06);
    --success: #2ecc71;
    --gold: #f1c40f;
    --silver: #bdc3c7;
    --bronze: #e67e22;
    --font: 'Outfit', sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Particles Background --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.15;
    animation: floatParticle linear infinite;
}

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

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
    animation: modalEnter 0.5s ease-out;
}

.disclaimer-card {
    max-width: 560px;
}

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

.modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

/* Disclaimer specific */
.disclaimer-text {
    text-align: left;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.disclaimer-text p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.disclaimer-text p:last-child {
    margin-bottom: 0;
}

.disclaimer-text strong {
    color: var(--text-primary);
}

.disclaimer-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Input */
#username-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    margin-bottom: 16px;
}

#username-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

#username-input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
}

/* Buttons */
.btn-primary {
    padding: 14px 36px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 14px 36px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: scale(1.08);
}

/* --- Header --- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.emoji-spin {
    display: inline-block;
    -webkit-text-fill-color: initial;
    animation: spinEmoji 2s ease-in-out infinite;
}

@keyframes spinEmoji {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.username-badge {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

/* --- Stats Bar --- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(230, 57, 70, 0.3);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Counter animation */
.counter-pop {
    animation: counterPop 0.3s ease-out;
}

@keyframes counterPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: var(--accent); }
    100% { transform: scale(1); }
}

/* --- Main Area --- */
.main-area {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    gap: 24px;
    padding: 24px 32px;
    min-height: calc(100vh - 250px);
}

/* --- Button Section --- */
.button-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.punch-counter-ring {
    position: relative;
    width: 280px;
    height: 280px;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#ring-gradient);
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 879.6;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.punch-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    background: radial-gradient(circle at 30% 30%, var(--bg-card-hover), var(--bg-card));
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.punch-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 0 50px var(--accent-glow), inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.punch-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.punch-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.punch-button.disabled:hover {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.punch-button.punch-animate {
    animation: punchShake 0.4s ease-out;
}

@keyframes punchShake {
    0% { transform: translate(-50%, -50%) scale(0.9); }
    30% { transform: translate(-50%, -50%) scale(1.15) rotate(-5deg); }
    60% { transform: translate(-50%, -50%) scale(1.05) rotate(3deg); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.punch-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

.fist-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.punch-text {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Cooldown text */
.cooldown-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    animation: cooldownPulse 1s ease-in-out infinite;
}

@keyframes cooldownPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#cooldown-seconds {
    font-size: 28px;
    font-weight: 900;
}

.hint-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* Milestone popup */
.milestone {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 24px 48px;
    z-index: 500;
    text-align: center;
    animation: milestoneEnter 0.5s ease-out;
    box-shadow: 0 0 60px rgba(241, 196, 15, 0.3);
}

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

#milestone-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
}

/* Badge popup */
.badge-popup {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: badgeSlideIn 0.5s ease-out;
    box-shadow: 0 0 40px var(--accent-glow);
}

@keyframes badgeSlideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

#badge-icon {
    font-size: 36px;
}

#badge-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Right Panel --- */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Leaderboard */
.leaderboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.leaderboard-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.leaderboard-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.leaderboard-list {
    max-height: 350px;
    overflow-y: auto;
}

.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: transparent;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

.lb-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.lb-item:hover {
    background: var(--bg-card-hover);
}

.lb-item.current-user {
    background: rgba(230, 57, 70, 0.08);
    border-left: 3px solid var(--accent);
}

.lb-rank {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 14px;
    margin-right: 14px;
    flex-shrink: 0;
}

.lb-rank.gold {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #1a1a2e;
}

.lb-rank.silver {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    color: #1a1a2e;
}

.lb-rank.bronze {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #1a1a2e;
}

.lb-rank.normal {
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.lb-score {
    font-weight: 800;
    font-size: 16px;
    color: var(--accent);
}

/* Badges Card */
.badges-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.badges-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.badge-item.earned {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.badge-item.locked {
    opacity: 0.35;
    filter: grayscale(1);
}

.badge-emoji {
    font-size: 24px;
}

.badge-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

/* Activity Card */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.activity-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.activity-feed {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-feed::-webkit-scrollbar {
    width: 4px;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

.activity-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    animation: activitySlideIn 0.3s ease-out;
}

@keyframes activitySlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.activity-item strong {
    color: var(--accent);
}

/* --- Float Numbers (click feedback) --- */
#float-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.float-number {
    position: absolute;
    font-size: 28px;
    font-weight: 900;
    color: var(--accent);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 0 0 10px var(--accent-glow);
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(1.5); }
}

/* --- Screen Flash --- */
.screen-flash {
    position: fixed;
    inset: 0;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
    z-index: 998;
    animation: flashEffect 0.3s ease-out;
}

@keyframes flashEffect {
    0% { opacity: 0.15; }
    100% { opacity: 0; }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .main-area {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    header {
        padding: 16px;
    }

    .main-area {
        padding: 16px;
    }

    .punch-counter-ring {
        width: 240px;
        height: 240px;
    }

    .punch-button {
        width: 190px;
        height: 190px;
    }

    .fist-img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        font-size: 24px;
    }

    .stat-value {
        font-size: 20px;
    }

    .modal-card {
        padding: 32px 24px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .disclaimer-actions {
        flex-direction: column;
    }

    .badges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   PWA SPECIFIC
   ============================================ */

/* iOS safe area padding */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }

    footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Standalone mode (installed PWA) */
@media (display-mode: standalone) {
    header {
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
    }
}

/* Touch optimizations */
.punch-button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button, input {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent pull-to-refresh */
body {
    overscroll-behavior-y: contain;
}

/* Prevent text selection on game elements */
.punch-button,
.stat-card,
.lb-item,
.badge-item {
    -webkit-user-select: none;
    user-select: none;
}

/* PWA Install prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 900;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
    animation: slideUp 0.5s ease-out;
    max-width: 90vw;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(50px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.install-prompt-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.install-prompt-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.install-prompt .btn-primary {
    padding: 10px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.install-prompt .btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ============================================
   RHYTHM GAME MODE (LEFT PANEL & MODAL)
   ============================================ */

/* Left Panel Card */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rhythm-card {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(18, 12, 28, 0.95));
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: var(--radius);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(230, 57, 70, 0.05);
    transition: var(--transition);
}

.rhythm-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 25px var(--accent-glow);
    transform: translateY(-2px);
}

.rhythm-card-badge {
    position: absolute;
    top: -12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.rhythm-icon {
    font-size: 42px;
    margin: 12px 0 8px;
    animation: bounce 2s infinite ease-in-out;
}

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

.rhythm-card h2 {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.rhythm-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.rhythm-preview {
    width: 100px;
    height: 80px;
    background: rgba(10, 10, 15, 0.6);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.orbit-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    animation: spinOrbit 3s linear infinite;
}

@keyframes spinOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orbit-preview .dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: 50%;
    margin-top: -7px;
}

.orbit-preview .red-dot {
    left: -4px;
    background: #e63946;
    box-shadow: 0 0 10px #e63946;
}

.orbit-preview .orange-dot {
    right: -4px;
    background: #ff6b35;
    box-shadow: 0 0 10px #ff6b35;
}

.controls-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 6px;
    width: 100%;
}

.rhythm-go-btn {
    width: 100%;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
}

/* FULLSCREEN RHYTHM MODAL */
.rhythm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 10, 0.96);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

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

.rhythm-modal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Topbar */
.rhythm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(18, 18, 26, 0.8);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.rhythm-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rhythm-diff-selector {
    display: flex;
    gap: 8px;
    background: rgba(10, 10, 15, 0.6);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.diff-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.diff-btn:hover {
    color: var(--text-primary);
}

.diff-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.rhythm-close-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rhythm-close-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(230, 57, 70, 0.1);
}

/* Stats Overlay inside Rhythm Arena */
.rhythm-stats {
    position: absolute;
    top: 80px;
    left: 32px;
    display: flex;
    gap: 16px;
    z-index: 10;
    pointer-events: none;
}

.rhythm-stat-box {
    background: rgba(26, 26, 46, 0.7);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}

.rhythm-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

.rhythm-stat-val {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
}

/* Canvas Wrapper */
.rhythm-canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

/* Feedback text (PERFECT / GOOD / MISS) */
.rhythm-feedback {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.rhythm-feedback.perfect {
    color: #2ecc71;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    animation: feedbackPop 0.4s ease-out;
}

.rhythm-feedback.good {
    color: #f1c40f;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.6);
    animation: feedbackPop 0.4s ease-out;
}

.rhythm-feedback.miss {
    color: #e63946;
    text-shadow: 0 0 20px rgba(230, 57, 70, 0.6);
    animation: feedbackPop 0.4s ease-out;
}

@keyframes feedbackPop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Start Prompt overlay */
.rhythm-start-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 36px 48px;
    text-align: center;
    z-index: 30;
    box-shadow: 0 0 50px var(--accent-glow);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.rhythm-start-prompt .prompt-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 1.5s infinite ease-in-out;
}

.rhythm-start-prompt h2 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rhythm-start-prompt p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 6px;
}

.rhythm-start-prompt .mobile-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* Mobile Touch Controls */
.rhythm-mobile-controls {
    display: none;
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    padding: 0 24px;
    gap: 16px;
    z-index: 40;
}

.touch-btn {
    flex: 1;
    padding: 20px;
    background: rgba(230, 57, 70, 0.2);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
    background: var(--accent);
    transform: scale(0.96);
}

.touch-btn-full {
    background: var(--accent-gradient);
    font-size: 20px;
    padding: 24px;
    box-shadow: 0 0 30px var(--accent-glow);
}

.guide-hint {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--gold) !important;
    margin: 12px 0 !important;
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
    .main-area {
        grid-template-columns: 240px 1fr 300px;
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 992px) {
    .main-area {
        grid-template-columns: 1fr;
    }

    .left-panel {
        order: -1;
    }

    .rhythm-mobile-controls {
        display: flex;
    }
}

