/* ═══════════════════════════════════════════
   VOID BREAKER — CYBERPUNK INFINITE RUNNER
   Premium Styling & UI System
   ═══════════════════════════════════════════ */

:root {
    --neon: #00ffcc;
    --neon-rgb: 0, 255, 204;
    --neon2: #ff00ff;
    --neon2-rgb: 255, 0, 255;
    --neon3: #ffcc00;
    --neon3-rgb: 255, 204, 0;
    --void: #04000c;
    --deep: #080018;
    --mid: #0c0028;
    --panel: rgba(0, 255, 204, 0.07);
    --border: rgba(0, 255, 204, 0.2);
    --txt: #c0ffe8;
    --dim: #2a6050;
    --danger: #ff2244;
    --safe: #00ffcc;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--void);
    font-family: 'Rajdhani', sans-serif;
    color: var(--txt);
}

/* ══ SCREENS ══ */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.off {
    pointer-events: none;
    opacity: 0;
    transform: scale(1.1);
}

/* ══ SPLASH ══ */
#splash {
    background: radial-gradient(circle at 50% 50%, #120030 0%, #04000c 100%);
}

.sp-bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 204, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 204, .06) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridScroll 40s linear infinite;
    perspective: 600px;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 1000px; }
}

.sp-horizon {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(0deg, rgba(0, 255, 204, .1) 0%, transparent 100%);
    pointer-events: none;
}

.sp-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
}

.sp-icon {
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
    border-radius: 24px;
    background: url('../assets/icon.png') center/cover;
    box-shadow: 0 0 40px var(--neon), 0 0 80px rgba(0, 255, 204, 0.3);
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

.sp-logo {
    font-family: 'Audiowide', monospace;
    font-size: clamp(34px, 10vw, 82px);
    background: linear-gradient(135deg, #00ffcc 0%, #ffffff 40%, #ff00ff 70%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 6px;
    line-height: 1;
    filter: drop-shadow(0 0 20px rgba(0, 255, 204, .4));
}

.sp-sub {
    font-size: clamp(10px, 2.8vw, 14px);
    letter-spacing: 9px;
    color: var(--dim);
    text-transform: uppercase;
    margin-top: 4px;
}

.sp-div {
    width: 260px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon), var(--neon2), transparent);
    margin: 24px 0;
    position: relative;
}

.sp-div::before, .sp-div::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

.sp-div::before { left: -14px; color: var(--neon); }
.sp-div::after { right: -14px; color: var(--neon2); }

.sp-best {
    font-family: 'Audiowide', monospace;
    font-size: clamp(12px, 3.5vw, 16px);
    color: var(--neon);
    letter-spacing: 4px;
}

.sp-btn {
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 204, .15), rgba(255, 0, 255, .1));
    border: 1px solid var(--neon);
    color: var(--neon);
    font-family: 'Audiowide', monospace;
    font-size: clamp(15px, 4.5vw, 19px);
    letter-spacing: 5px;
    padding: 18px 58px;
    cursor: pointer;
    clip-path: polygon(14px 0%, 100% 0%, calc(100% - 14px) 100%, 0% 100%);
    transition: all .3s;
    animation: spBtnPulse 2.5s ease-in-out infinite;
}

@keyframes spBtnPulse {
    0%, 100% { filter: drop-shadow(0 0 8px var(--neon)); }
    50% { filter: drop-shadow(0 0 24px var(--neon)) drop-shadow(0 0 48px rgba(0, 255, 204, .3)); }
}

.sp-btn:hover {
    background: rgba(0, 255, 204, .25);
    transform: scale(1.05);
    letter-spacing: 7px;
}

/* ══ GUIDE ══ */
#guide {
    background: rgba(4, 0, 12, .98);
    overflow-y: auto;
    padding: 20px;
}

.gc {
    max-width: 650px;
    width: 100%;
    background: linear-gradient(160deg, #0a0020, #04000c);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(20px, 5vw, 40px);
    margin: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1), inset 0 0 20px rgba(0, 255, 204, 0.05);
}

.g-title {
    font-family: 'Audiowide', monospace;
    font-size: clamp(22px, 6vw, 36px);
    color: var(--neon);
    letter-spacing: 6px;
    text-align: center;
    margin-bottom: 5px;
}

.g-sub {
    font-size: 11px;
    letter-spacing: 5px;
    color: var(--dim);
    text-align: center;
    margin-bottom: 30px;
}

.sec {
    margin-bottom: 25px;
}

.sec-t {
    font-family: 'Audiowide', monospace;
    font-size: 11px;
    color: var(--neon3);
    letter-spacing: 4px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 204, 0, 0.2);
}

.cr {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.kb {
    background: rgba(0, 255, 204, .08);
    border: 1px solid rgba(0, 255, 204, .28);
    color: var(--neon);
    font-family: 'Audiowide', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 4px;
    min-width: 90px;
    text-align: center;
}

.cd { font-size: 14px; color: var(--txt); line-height: 1.5; }

.power-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.pw-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s;
}

.pw-card:hover { transform: translateY(-5px); border-color: var(--neon); }
.pw-icon { font-size: 30px; margin-bottom: 5px; }
.pw-name { font-family: 'Audiowide', monospace; font-size: 9px; color: var(--neon); letter-spacing: 1px; }

.g-start {
    display: block;
    width: 100%;
    margin-top: 30px;
    background: linear-gradient(135deg, rgba(0, 255, 204, .3), rgba(255, 0, 255, .2));
    border: 1px solid var(--neon);
    color: white;
    font-family: 'Audiowide', monospace;
    font-size: 18px;
    letter-spacing: 6px;
    padding: 20px;
    cursor: pointer;
    clip-path: polygon(20px 0%, 100% 0%, calc(100% - 20px) 100%, 0% 100%);
    transition: all .2s;
}

.g-start:hover { transform: scale(1.02); background: rgba(0, 255, 204, .4); }

/* ══ HUD ══ */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(4, 0, 12, 0.9), transparent);
    padding: 15px 30px;
    display: none;
    grid-template-columns: 1fr auto 1fr;
    align-items: flex-start;
    pointer-events: none;
}

.hb { display: flex; flex-direction: column; gap: 4px; justify-self: start; }
.hb-right { display: flex; flex-direction: column; gap: 4px; justify-self: end; align-items: flex-end; }
.hl { font-size: 9px; letter-spacing: 3px; color: var(--dim); text-transform: uppercase; }
.hv { font-family: 'Audiowide', monospace; font-size: clamp(16px, 4vw, 24px); color: var(--neon); }

.hcen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
}

.dist-val {
    font-family: 'Audiowide', monospace;
    font-size: clamp(32px, 8vw, 56px);
    color: var(--neon3);
    line-height: 1;
    text-shadow: 0 0 20px rgba(255, 204, 0, .4);
}

.zone-badge {
    background: rgba(255, 0, 255, .2);
    border: 1px solid var(--neon2);
    padding: 4px 20px;
    margin-top: 8px;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.zone-txt { font-family: 'Audiowide', monospace; font-size: 12px; color: var(--neon2); letter-spacing: 2px; }

.bw { width: 120px; margin-top: 2px; }
.bbg { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.05); }
.bf { height: 100%; transition: width 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67); }

/* ══ CANVAS ══ */
#gameCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--void);
}

/* ══ MOBILE CONTROLS ══ */
#mob-ctrl {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    display: none;
    padding: 30px;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.ctrl-btn {
    width: clamp(80px, 20vw, 110px);
    height: clamp(80px, 20vw, 110px);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: transform 0.1s, background-color 0.1s;
    font-family: 'Audiowide', monospace;
    border: 2px solid transparent;
}

.ctrl-btn:active { transform: scale(0.9); }

.mob-jump {
    background: rgba(0, 255, 204, 0.1);
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

.mob-slide {
    background: rgba(255, 0, 255, 0.1);
    border-color: var(--neon2);
    color: var(--neon2);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
}

.mob-shield {
    width: 80px;
    height: 80px;
    background: rgba(255, 204, 0, 0.1);
    border-color: var(--neon3);
    color: var(--neon3);
    margin-bottom: 10px;
    font-size: 10px;
}

@media (max-width: 768px) {
    #hud {
        grid-template-columns: 1fr 1fr;
        row-gap: 15px;
        padding: 10px;
    }
    .hcen {
        grid-column: 1 / -1;
        order: 3;
    }
    
    #mob-ctrl {
        padding: 15px;
    }
    .ctrl-btn { width: 70px; height: 70px; }
    .mob-shield { width: 60px; height: 60px; }
}

/* ══ OVERLAYS ══ */
#ov {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(4, 0, 12, .95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
}

.ov-t {
    font-family: 'Audiowide', monospace;
    font-size: clamp(40px, 10vw, 80px);
    color: var(--neon);
    letter-spacing: 10px;
    text-shadow: 0 0 40px var(--neon);
    margin-bottom: 10px;
}

.ov-s {
    font-size: 16px;
    letter-spacing: 6px;
    color: var(--dim);
    margin-bottom: 30px;
}

.ov-st {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.sb {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    text-align: center;
    min-width: 140px;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.sv { font-family: 'Audiowide', monospace; font-size: 28px; color: var(--neon); }
.sl { font-size: 10px; letter-spacing: 3px; color: var(--dim); margin-top: 5px; }

.ob {
    background: linear-gradient(135deg, rgba(0, 255, 204, .2), rgba(255, 0, 255, .15));
    border: 1px solid var(--neon);
    color: white;
    font-family: 'Audiowide', monospace;
    font-size: 16px;
    letter-spacing: 4px;
    padding: 16px 40px;
    cursor: pointer;
    clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
    margin: 8px;
    transition: all 0.2s;
}

.ob:hover { transform: scale(1.1); background: rgba(0, 255, 204, 0.3); }

/* ══ UTILS ══ */
.toast-el {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 255, 204, 0.15);
    border: 1px solid var(--neon);
    color: var(--neon);
    font-family: 'Audiowide', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    padding: 10px 30px;
    z-index: 400;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    backdrop-filter: blur(5px);
}

.toast-el.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#combo-flash {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Audiowide', monospace;
    color: var(--neon3);
    text-shadow: 0 0 50px rgba(255, 204, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    z-index: 250;
    white-space: nowrap;
    transition: opacity 0.3s;
}

#countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Audiowide', monospace;
    font-size: 120px;
    color: var(--neon);
    text-shadow: 0 0 60px var(--neon);
    pointer-events: none;
    opacity: 0;
    z-index: 260;
    transition: opacity 0.2s;
}

/* ══ SCREEN SHAKE ══ */
@keyframes shake {
    0% { transform: translate(0,0); }
    25% { transform: translate(-5px, 5px); }
    50% { transform: translate(5px, -5px); }
    75% { transform: translate(-5px, -5px); }
    100% { transform: translate(0,0); }
}
.shake { animation: shake 0.2s ease-in-out; }
