:root {
    --bg: #080d14;
    --cyan: #00ffcc;
    --purple: #8a2be2;
    --pink: #ff3366;
    --gold: #ffcc00;
    --text: #ffffff;
    --text-dim: rgba(255,255,255,0.6);
    --panel-bg: rgba(20, 25, 35, 0.85);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', sans-serif; }
body { 
    background: var(--bg); 
    color: var(--text); 
    overflow: hidden; 
    touch-action: none; 
    height: 100dvh; 
    width: 100vw;
}

/* UI Structure */
#gameArea {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
    pointer-events: none;
}

.nav-left { pointer-events: auto; }
.nav-right { text-align: right; display: flex; gap: 15px; pointer-events: auto; }

.back-btn {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    display: inline-block;
}
.back-btn:hover { color: var(--cyan); border-color: var(--cyan); }

.stat-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim); }
.stat-val { font-size: 1.2rem; font-weight: 700; color: var(--cyan); }
.stat-val.gold { color: var(--gold); }
.stat-val.pink { color: var(--pink); }

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Overlay Menus */
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(8, 13, 20, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.3s;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 90%;
    backdrop-filter: blur(10px);
}
.panel h1 { font-size: 2.5rem; margin-bottom: 10px; color: var(--cyan); text-shadow: 0 0 15px rgba(0,255,204,0.5); }
.panel p { color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; font-size: 0.95rem; }

.btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 15px rgba(0,255,204,0.4);
    margin-bottom: 15px;
}
.btn:hover { transform: scale(1.05); }

.share-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 15px; }
.share-btn { padding: 10px 15px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; color: #fff; font-size: 0.9rem; }
.share-btn.x { background: #1DA1F2; }
.share-btn.wa { background: #25D366; }

.controls-hint {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    z-index: 100;
    pointer-events: none;
}
.footer a { color: var(--cyan); text-decoration: none; pointer-events: auto; }

/* Landscape Prompt */
.landscape-prompt {
    display: none;
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: var(--bg); z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
}
.landscape-prompt h2 { color: var(--cyan); margin-bottom: 10px; }
.landscape-prompt p { color: var(--text-dim); }
.rotate-icon { font-size: 4rem; color: var(--cyan); animation: rotate 2s infinite ease-in-out; margin-bottom: 20px; }

@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(-90deg); } }

@media (max-width: 900px) and (orientation: portrait) {
    .landscape-prompt { display: flex; }
    #gameArea { display: none !important; }
}
