/* ==========================================================================
   Neon Serpent - Fast-Paced Snake Game
   ========================================================================== */

/* Hide shared template elements */
#btn-account, #btn-stats, #btn-leaderboard, #btn-help, .language-selector {
    display: none !important;
}
.game-header {
    background: transparent !important;
    border-bottom: none !important;
    position: absolute; top: 0; left: 0; right: 0; z-index: 30;
}
.game-header__title { color: rgba(255,255,255,0.9) !important; font-weight: 700 !important; }
.game-header__back svg { color: rgba(255,255,255,0.9) !important; }
.game-main { padding-top: 0 !important; height: 100dvh !important; overflow: hidden !important; }
.word-game-wrapper { background: #0a0a1a !important; height: 100dvh !important; overflow: hidden !important; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
.ns-game {
    position: relative;
    width: 100%;
    height: 100dvh;
    background: #0a0a1a;
    overflow: hidden;
    font-family: 'Orbitron', 'Share Tech Mono', monospace, system-ui, sans-serif;
}

/* --------------------------------------------------------------------------
   HUD (overlaid on canvas)
   -------------------------------------------------------------------------- */
.ns-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 52px 16px 8px;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: none;
}

.ns-hud-score, .ns-hud-speed, .ns-hud-length {
    text-align: center;
}

.ns-hud-label {
    display: block;
    font-size: 0.6rem;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ns-hud-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.ns-hud-score .ns-hud-value { color: #0f0; text-shadow: 0 0 10px rgba(0,255,0,0.5); }
.ns-hud-speed .ns-hud-value { color: #f0f; text-shadow: 0 0 10px rgba(255,0,255,0.5); }

/* --------------------------------------------------------------------------
   Canvas
   -------------------------------------------------------------------------- */
#ns-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

/* D-Pad hidden — swipe controls only on mobile */
.ns-dpad {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Welcome
   -------------------------------------------------------------------------- */
.ns-welcome {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a1a 70%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ns-welcome.active { display: flex; }

.ns-welcome-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* Logo snake animation */
.ns-logo {
    margin-bottom: 20px;
}

.ns-logo-snake {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.ns-segment {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    animation: ns-pulse 1.2s ease-in-out infinite;
}

.ns-s1 { background: #0f0; animation-delay: 0s; }
.ns-s2 { background: #0e0; animation-delay: 0.1s; }
.ns-s3 { background: #0d0; animation-delay: 0.2s; }
.ns-s4 { background: #0c0; animation-delay: 0.3s; }
.ns-s5 { background: #0b0; animation-delay: 0.4s; box-shadow: 0 0 12px #0f0; }

@keyframes ns-pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

.ns-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0f0;
    margin: 0 0 4px;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0,255,0,0.6), 0 0 40px rgba(0,255,0,0.3);
    font-family: 'Orbitron', monospace, system-ui;
}

.ns-subtitle {
    font-size: 0.95rem;
    color: #888;
    margin: 0 0 24px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.ns-stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.ns-stat { text-align: center; }
.ns-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0ff;
    text-shadow: 0 0 8px rgba(0,255,255,0.5);
}
.ns-stat-label {
    font-size: 0.65rem;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ns-play-btn {
    display: inline-block;
    background: linear-gradient(135deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 16px 56px;
    font-size: 1.2rem;
    font-weight: 900;
    font-family: inherit;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(0,255,0,0.4);
    transition: all 0.2s;
    margin-bottom: 16px;
}

.ns-play-btn:hover {
    box-shadow: 0 0 50px rgba(0,255,0,0.6);
    transform: scale(1.05);
}

.ns-controls-hint {
    font-size: 0.75rem;
    color: #555;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Game Over
   -------------------------------------------------------------------------- */
.ns-gameover {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ns-gameover.active { display: flex; }

.ns-gameover-content {
    text-align: center;
    max-width: 360px;
    width: 100%;
    padding: 0 24px;
}

.ns-gameover-title {
    font-size: 2rem;
    font-weight: 900;
    color: #f44;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(255,68,68,0.5);
    margin-bottom: 20px;
    font-family: inherit;
}

.ns-gameover-score {
    margin-bottom: 16px;
}

.ns-go-label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ns-go-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0f0;
    text-shadow: 0 0 20px rgba(0,255,0,0.5);
}

.ns-gameover-details {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
}

.ns-go-detail {
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}

.ns-go-detail span:last-child {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0ff;
}

.ns-go-highscore {
    color: #ff0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,255,0,0.5);
    margin-bottom: 16px;
    animation: ns-pulse 1s infinite;
}

.ns-gameover-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.ns-retry-btn, .ns-home-btn {
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.ns-retry-btn {
    background: linear-gradient(135deg, #0f0, #0c0);
    color: #000;
    box-shadow: 0 0 20px rgba(0,255,0,0.3);
}

.ns-home-btn {
    background: rgba(255,255,255,0.1);
    color: #aaa;
    border: 1px solid rgba(255,255,255,0.2);
}

.ns-retry-btn:hover { box-shadow: 0 0 30px rgba(0,255,0,0.5); }
.ns-home-btn:hover { background: rgba(255,255,255,0.2); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
    .ns-title { font-size: 1.8rem; letter-spacing: 2px; }
    .ns-play-btn { padding: 14px 40px; font-size: 1rem; }
}


@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
