/* Copyright (c) 2025. Jericho Crosby (Chalwk) */

:root{
    --bg:#0b0f17;
    --card:#0f1720;
    --accent: #00f0ff;
    --accent2:#8b5cf6;
    --muted: #98a0b3;
    --glass: rgba(255,255,255,0.03);
    --neon: 0 0 18px rgba(0,240,255,0.18), 0 0 28px rgba(139,92,246,0.12);
    --glass-border: rgba(255,255,255,0.04);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
html,body,#app{height:100%; margin:0; background: radial-gradient(1200px 600px at 10% 10%, rgba(139,92,246,0.06), transparent), radial-gradient(1000px 500px at 90% 90%, rgba(0,240,255,0.04), transparent), var(--bg); color:#e6eef8;}
.topbar{
    display:flex; align-items:center; justify-content:space-between; padding:12px 20px; gap:12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    border-bottom:1px solid var(--glass-border);
}
.brand{font-weight:700; font-size:1.1rem; letter-spacing:0.6px; color:var(--accent);}
.info{display:flex; gap:14px; align-items:center; font-size:0.95rem; color:var(--muted);}
.controls .btn{margin-left:6px}

.game-area{display:grid; place-items:center; padding:18px; height:calc(100% - 128px); position:relative;}
canvas#gameCanvas{
    width: min(820px, 92vw);
    height: min(620px, 70vh);
    background: linear-gradient(180deg, rgba(10,12,16,0.6), rgba(2,6,10,0.8));
    border-radius:12px;
    box-shadow: var(--neon);
    outline: none;
    image-rendering: crisp-edges;
}

/* Overlay styles */
.overlay{
    position:absolute; inset:0; display:grid; place-items:center; pointer-events:auto;
}
.overlay.menu{background: linear-gradient(90deg, rgba(8,10,14,0.45), rgba(2,3,6,0.65)); backdrop-filter: blur(5px);}
.menu-card{
    width: 420px; max-width:92vw; background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    border-radius:14px; padding:22px; border:1px solid var(--glass-border); box-shadow: 0 6px 30px rgba(0,0,0,0.6);
    text-align:center;
}
.menu-card h1{margin:0; font-size:2rem; color:var(--accent2); text-shadow:0 2px 8px rgba(139,92,246,0.18)}
.tagline{color:var(--muted); margin-top:6px; margin-bottom:14px}
.menu-controls{display:flex; gap:10px; justify-content:center; margin:12px 0; flex-wrap:wrap}
.menu-controls label{font-size:0.85rem; color:var(--muted)}
.menu-buttons{display:flex; gap:10px; justify-content:center; margin-top:12px; flex-wrap:wrap}

.btn{
    background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border:1px solid rgba(255,255,255,0.04);
    padding:8px 12px; border-radius:10px; color:#e6eef8; cursor:pointer; font-weight:600;
    transition:transform .12s ease, box-shadow .12s ease;
}
.btn:hover{transform:translateY(-3px); box-shadow:0 10px 30px rgba(0,0,0,0.45)}
.btn.big{padding:10px 18px; font-size:1rem; border-radius:12px}
.smallprint{font-size:0.8rem; color:var(--muted); margin-top:10px}

/* Game Over / Info panels */
.hidden{display:none}
.info-panel .info-card, .game-over .gameover-card{
    width:420px; max-width:92vw; padding:18px; border-radius:12px; background:var(--card); border:1px solid var(--glass-border);
    text-align:left; color:var(--muted);
}

/* Touch controls */
.touch-controls{position:absolute; right:18px; bottom:18px; pointer-events:none}
.touch-controls .dpad{pointer-events:auto; user-select:none; display:flex; flex-direction:column; gap:6px; align-items:center}
.btn-round{width:46px; height:46px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:1.05rem}

/* Footer */
.footer{padding:12px 20px; display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:0.9rem; border-top:1px solid var(--glass-border)}

/* Game HUD inside canvas area (floating) */
#score, #best{font-weight:700; color:var(--accent);}

/* Small responsive tweaks */
@media (max-width:720px){
    .menu-card{padding:16px}
    .topbar{padding:8px 12px}
    .brand{font-size:1rem}
    .btn-round{width:52px;height:52px}
}

/* Powerup message */
.powerup-message {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #8b5cf6;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(139, 92, 246, 0.4);
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.powerup-message.show {
    opacity: 1;
}

.powerup-message.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}