:root {
    --primary: #00f3ff;
    --secondary: #ff00ea;
    --danger: #ff3c00;
    --bg: #050505;
    --text: #ffffff;
    --hud-height: 70px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    position: fixed;
    inset: 0;
    height: 100dvh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#hud {
    height: var(--hud-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 15px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-left { display: flex; justify-content: flex-start; }
.hud-center { display: flex; flex-direction: column; align-items: center; min-width: 100px; }
.hud-right { display: flex; justify-content: flex-end; gap: 15px; }

.hub-btn {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}

#score {
    font-size: 28px;
    font-weight: 900;
    display: block;
    line-height: 1;
    text-shadow: 0 0 10px var(--primary);
}

#best-container { font-size: 10px; opacity: 0.6; letter-spacing: 1px; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

#progress-bar-container {
    position: absolute;
    top: calc(var(--hud-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
}

#progress-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.3s ease;
}

#current-level-label, #next-level-label { font-size: 14px; font-weight: 600; }

#gameCanvas {
    width: 100%;
    height: calc(100% - var(--hud-height));
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
    text-align: center;
}

.overlay.hidden { display: none !important; }

.overlay-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--primary);
}

.instruction-box {
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.instruction-item p { font-size: 14px; color: rgba(255, 255, 255, 0.8); }

.primary-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    transition: transform 0.2s;
    margin-bottom: 10px;
}

.secondary-btn { text-decoration: none; color: #fff; opacity: 0.6; font-size: 14px; font-weight: 600; }

.stat-row {
    display: flex;
    justify-content: space-between;
    width: 220px;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* Social Share */
.share-section {
    margin: 20px 0 30px;
    width: 100%;
    max-width: 300px;
}

.share-section p { font-size: 12px; letter-spacing: 2px; opacity: 0.5; margin-bottom: 15px; }

.share-btns { display: flex; gap: 10px; justify-content: center; }

.share-btn {
    flex: 1;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-btn.wa { background: #25D366; color: #fff; }
.share-btn.x { background: #000; color: #fff; border: 1px solid #333; }

.share-btn:active { opacity: 0.7; }
