/* ===== BRICK BREAKER 3D — Modern Neon UI ===== */

:root {
    --accent: #a78bfa;
    --accent2: #f472b6;
    --glow-pink: rgba(244, 114, 182, 0.5);
    --glow-purple: rgba(167, 139, 250, 0.4);
    --bg: #050510;
    --surface: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: #fff;
}

/* ---- Game Container ---- */
.game-container {
    padding-top: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.game-container>h1 {
    margin-top: 24px;
    margin-bottom: 18px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #a78bfa, #f472b6, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.5));
}

/* ---- Game UI Box ---- */
#game-ui {
    position: relative;
    width: 440px;
    height: 680px;
    border-radius: 24px;
    overflow: hidden;
    background: #050510;
    box-shadow:
        0 0 0 1px rgba(167, 139, 250, 0.2),
        0 0 60px rgba(167, 139, 250, 0.1),
        0 30px 80px rgba(0, 0, 0, 0.8);
    margin-bottom: 60px;
}

/* ---- Canvas ---- */
#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: none;
}

/* ---- HUD ---- */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(5, 5, 16, 0.9) 0%, transparent 100%);
    pointer-events: none;
}

#lives-display {
    display: flex;
    gap: 6px;
    align-items: center;
}

.heart {
    font-size: 1.5rem;
    color: #f472b6;
    filter: drop-shadow(0 0 8px #f472b6);
    transition: all 0.3s;
    line-height: 1;
}

.heart.lost {
    color: rgba(255, 255, 255, 0.12);
    filter: none;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

.heart.pop {
    animation: heartPop 0.3s ease;
}

#level-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

#score-display {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 20px var(--accent);
    min-width: 60px;
    text-align: right;
}

@keyframes scoreFlash {
    0% {
        transform: scale(1);
        color: #fff;
    }

    50% {
        transform: scale(1.3);
        color: #a78bfa;
    }

    100% {
        transform: scale(1);
        color: #fff;
    }
}

.score-flash {
    animation: scoreFlash 0.25s ease;
}

/* ---- Overlay Base ---- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    background: radial-gradient(ellipse at center, rgba(10, 8, 30, 0.97) 0%, rgba(5, 5, 16, 0.99) 100%);
    backdrop-filter: blur(12px);
}

.hidden {
    display: none !important;
}

.overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 24px;
    width: 100%;
    gap: 10px;
}

/* ---- Main Menu ---- */
.game-logo {
    font-size: 4.5rem;
    filter: drop-shadow(0 0 30px rgba(244, 114, 182, 0.8));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.overlay h2 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.subtitle {
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    margin-top: -4px;
}

.best-score {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: #a78bfa;
    margin: 4px 0 10px;
}

.controls-hint {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    opacity: 0.4;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* ---- Buttons ---- */
.primary-btn {
    padding: 16px 48px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.5), 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: 'Outfit', sans-serif;
    margin: 8px 0;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.8), 0 8px 30px rgba(0, 0, 0, 0.5);
}

.primary-btn:active {
    transform: scale(0.97);
}

.bonus-btn {
    padding: 12px 32px;
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d97706, #ea580c);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.4);
    font-family: 'Outfit', sans-serif;
    margin: 4px 0;
}

.bonus-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(234, 88, 12, 0.7);
}

/* ---- Game Over Score ---- */
.score-block {
    margin: 10px 0;
}

.final-score {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.6));
}

.final-best {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 6px;
}

/* ---- Level Banner ---- */
.level-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    pointer-events: none;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(167, 139, 250, 0.8));
    white-space: nowrap;
}

@keyframes bannerAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.level-banner.showing {
    animation: bannerAnim 1.8s ease forwards;
    display: block !important;
}

/* ---- Cross Promo Scroller ---- */
#game-over-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 2px;
    margin-top: 8px;
    width: 100%;
    max-width: 380px;
    scrollbar-width: none;
}

#game-over-scroller::-webkit-scrollbar {
    display: none;
}

.promo-card {
    min-width: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s;
}

.promo-card:hover {
    transform: scale(1.06);
    background: rgba(255, 255, 255, 0.1);
}

.promo-card .promo-emoji {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}

.promo-card .promo-name {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* ---- Game Description ---- */
.game-description {
    max-width: 760px;
    padding: 40px 24px 80px;
    opacity: 0.85;
}

.game-description h2 {
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.game-description h3 {
    margin: 24px 0 10px;
}

.game-description ul {
    list-style: none;
}

.game-description li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.game-description li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

footer {
    text-align: center;
    padding: 20px;
    opacity: 0.5;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 8px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

/* ---- Bottom Ad ---- */
#bottom-ad {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 50px;
    z-index: 9999;
}

/* ---- Desktop Adsterra ---- */
#adsterra-banner {
    position: fixed;
    bottom: 5px;
    right: 10px;
    z-index: 9000;
    display: none;
    width: 160px;
    height: 600px;
}

@media (min-width: 1024px) {
    #adsterra-banner {
        display: block;
    }
}

/* ---- Mobile ---- */
@media (max-width: 500px) {
    #game-ui {
        width: 100vw;
        height: calc(100vw * 680 / 440);
        border-radius: 0;
    }

    .game-container>h1 {
        font-size: 1.4rem;
    }

    .overlay h2 {
        font-size: 1.6rem;
    }

    .primary-btn {
        padding: 14px 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    #game-ui {
        height: 82vh;
    }
}

#tap-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;

    color: white;
    text-shadow: 0 5px 20px rgba(0,0,0,0.7);

    pointer-events: none;
    z-index: 50;

    animation: tapPulse 1.2s infinite;
}

#tap-overlay.hidden {
    display: none;
}

@keyframes tapPulse {
    0% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.4; transform: scale(1); }
}