/* Funky's BurnQuest - Modern Frogger + Community Burns */
/* Clean foundation for KSTO Arcade */

:root {
    --bg: #0a001f;
    --panel: #140028;
    --primary: #c026d3;
    --accent: #00d4ff;
    --green: #18c964;
    --text: #e8e8e8;
    --dim: #999;
    --road: #1a1a1a;
    --water: #0077b6;
    --grass: #1b4332;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

.screen {
    position: fixed;
    inset: 0;
}

/* ========== LOADING ========== */
#loading-screen {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loader {
    text-align: center;
}

.flame {
    font-size: 4rem;
    animation: pulse 1.4s infinite;
}

.loader h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.9rem;
    margin: 16px 0;
    letter-spacing: 3px;
}

.bar {
    width: 260px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    margin: 0 auto 12px;
    overflow: hidden;
}

#load-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.25s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ========== CAMPAIGN SELECT ========== */
#campaign-select {
    background: radial-gradient(ellipse at top, #1a0033, #0a001f);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.select-header {
    text-align: center;
    margin-bottom: 18px;
}

.select-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.3rem;
    font-weight: 900;
}

.select-header h1 span {
    background: linear-gradient(90deg, #fff, #c026d3, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.select-header p {
    color: var(--dim);
    margin-top: 6px;
    font-size: 0.95rem;
}

.funky-left {
    text-align: center;
    margin-bottom: 18px;
}

.funky-char {
    font-size: 5rem;
    filter: drop-shadow(0 0 22px #18c964);
}

.tag {
    font-size: 0.9rem;
    color: var(--dim);
    margin-top: 8px;
    line-height: 1.4;
}

.campaigns-panel {
    background: var(--panel);
    border: 1px solid rgba(192, 38, 211, 0.3);
    border-radius: 20px;
    padding: 22px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.campaigns-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-align: center;
    color: var(--primary);
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.campaign-btn {
    background: rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.25s;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: white;
}

.campaign-btn:hover {
    border-color: var(--primary);
    background: rgba(192, 38, 211, 0.15);
    transform: translateY(-3px);
}

.campaign-btn .icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}

.hint {
    text-align: center;
    color: var(--dim);
    font-size: 0.85rem;
    margin-top: 16px;
}

.bottom-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

/* ========== DASHBOARD ========== */
#dashboard {
    background: var(--bg);
    padding: 16px;
    overflow-y: auto;
}

.dash-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-title h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.55rem;
}

#dash-icon {
    font-size: 1.8rem;
}

.dash-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.progress-card,
.live-board {
    background: var(--panel);
    border: 1px solid rgba(192, 38, 211, 0.25);
    border-radius: 18px;
    padding: 22px;
}

.progress-card h3,
.live-board h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 14px;
}

.level-info {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.progress-bar-bg {
    height: 14px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c026d3, #00d4ff);
    border-radius: 10px;
    transition: width 0.4s;
}

.progress-numbers {
    font-size: 0.95rem;
    color: var(--dim);
    margin-bottom: 10px;
}

.burn-amount {
    font-size: 1.1rem;
    color: #ff9900;
    margin-bottom: 20px;
}

/* Buttons */
.btn-play {
    width: 100%;
    padding: 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #a020f0, #c026d3);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(192, 38, 211, 0.4);
    transition: 0.2s;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(192, 38, 211, 0.55);
}

.btn-small {
    padding: 10px 18px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 30px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.btn-small:hover {
    background: rgba(255,255,255,0.14);
}

.btn-small.secondary {
    border-color: rgba(255,255,255,0.15);
    color: var(--dim);
}

/* Live Board */
.live-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.live-item .name {
    width: 85px;
    white-space: nowrap;
}

.live-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    overflow: hidden;
}

.live-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 6px;
}

.live-pct {
    width: 42px;
    text-align: right;
    color: var(--dim);
    font-size: 0.85rem;
}

/* ========== GAMEPLAY ========== */
#game-screen {
    background: #000;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent);
}

.hud-left,
.hud-right,
.hud-center {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#lives {
    font-size: 1.4rem;
    letter-spacing: 3px;
}

.score-box,
.level-box {
    background: rgba(20, 0, 40, 0.85);
    border: 1px solid rgba(192, 38, 211, 0.35);
    border-radius: 8px;
    padding: 4px 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
}

#btn-pause-game {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 0, 40, 0.85);
    border: 1px solid rgba(192, 38, 211, 0.45);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

/* Mobile Controls */
#mobile-pad {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 14px;
    pointer-events: none;
}

#mobile-pad button {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(192, 38, 211, 0.28);
    border: 2px solid rgba(192, 38, 211, 0.55);
    color: white;
    font-size: 1.45rem;
    pointer-events: auto;
    transition: 0.15s;
}

#mobile-pad button:active {
    background: rgba(192, 38, 211, 0.5);
    transform: scale(0.94);
}

/* ========== MODALS ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(6px);
}

.modal-box {
    background: var(--panel);
    border: 1px solid rgba(192, 38, 211, 0.35);
    border-radius: 20px;
    padding: 36px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
}

.modal-box h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 18px;
}

.modal-box ul {
    text-align: left;
    margin: 0 auto 24px;
    max-width: 300px;
    line-height: 1.85;
}

.big-points {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #18c964;
    margin: 12px 0;
}

/* Responsive */
@media (max-width: 700px) {
    .dash-main {
        grid-template-columns: 1fr;
    }

    .select-header h1 {
        font-size: 1.75rem;
    }

    .campaign-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .funky-char {
        font-size: 4rem;
    }
}