* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #120c24 0%, #24143e 50%, #1a252f 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    user-select: none;
}

/* Top Navigation Bar matching Money Machine & TempoSpark */
.top-nav {
    width: 100%;
    max-width: 860px;
    margin: 20px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.back-link {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.15s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fde68a;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.mute-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.mute-btn.muted {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fecaca;
}

/* Game Container */
.game-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

canvas {
    width: 100%;
    max-width: 800px;
    height: auto;
    background: linear-gradient(180deg, #1b0f36 0%, #3b1c54 45%, #ff758c 100%);
    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 117, 140, 0.25);
    cursor: pointer;
}

.controls {
    margin-top: 16px;
    font-size: 14px;
    color: #cbd5e1;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 999px;
}

/* Mobile Touch Controls */
.mobile-controls {
    display: none;
    width: 100%;
    max-width: 800px;
    gap: 14px;
    margin-top: 14px;
}

.touch-btn {
    flex: 1;
    padding: 18px 14px;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, filter 0.08s ease;
}

.touch-btn:active {
    transform: scale(0.96);
    filter: brightness(1.15);
}

.jump-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.throw-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

/* Automatically show touch buttons and hide keyboard hint on phones/tablets */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    .desktop-controls {
        display: none;
    }
}

/* Daily Leaderboard & Score Submission */
.lb-form {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid #f59e0b;
    border-radius: 14px;
}

.lb-prompt {
    font-size: 14px;
    color: #fde68a;
}

.lb-form input[type="text"] {
    background: rgba(15, 10, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    width: 185px;
    outline: none;
    user-select: text;
}

.lb-form input[type="text"]:focus {
    border-color: #facc15;
}

.lb-form button {
    background: #10b981;
    color: #064e3b;
    font-weight: 800;
    font-size: 14px;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lb-form button:hover:not(:disabled) {
    background: #34d399;
}

.lb-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lb-msg {
    font-size: 13px;
    font-weight: 600;
    color: #fca5a5;
}

.leaderboard-card {
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
    background: rgba(15, 10, 35, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px 22px;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.lb-header h2 {
    font-size: 17px;
    color: #fde68a;
}

.lb-date {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
}

.lb-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 14px;
}

.lb-list li:nth-child(1) { border-left: 3px solid #facc15; }
.lb-list li:nth-child(2) { border-left: 3px solid #cbd5e1; }
.lb-list li:nth-child(3) { border-left: 3px solid #d97706; }

.lb-rank {
    font-weight: 800;
    color: #facc15;
    margin-right: 8px;
}

.lb-score {
    font-weight: 800;
    color: #34d399;
}

.lb-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 10px 0;
}

