:root {
    --bg-color: #050510;
    --card-bg: #0a0a1a;
    --neon-cyan: #0ff;
    --neon-magenta: #f0f;
    --neon-lime: #0f0;
    --neon-yellow: #ff0;
    --text-main: #fff;
    --text-dim: #aaa;
    --font-header: 'Press Start 2P', cursive;
    --font-body: 'Roboto', sans-serif;
    --glow-strength: 0 0 10px;
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 9999;
}

.view {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.view.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.view.active {
    opacity: 1;
    z-index: 10;
}

.hub-header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(to bottom, #111, transparent);
    flex-shrink: 0;
}

.neon-text {
    font-family: var(--font-header);
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    font-size: 1.5rem;
    margin: 0;
}

.blink {
    animation: blinker 1.5s linear infinite;
    color: var(--neon-magenta);
    text-shadow: 0 0 10px var(--neon-magenta);
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.category-nav {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-btn {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 5px 10px;
    border-radius: 15px;
    font-family: var(--font-header);
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn.active,
.cat-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

.game-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    align-content: start;
}

.game-card {
    background: linear-gradient(135deg, var(--card-bg), #1a1a2e);
    border: 1px solid #336;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.game-card:hover,
.game-card:active {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover::before {
    opacity: 1;
}

.game-icon {
    width: 60px;
    height: 60px;
    background: #000;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.game-title {
    font-family: var(--font-header);
    font-size: 0.7rem;
    color: var(--neon-yellow);
    line-height: 1.2;
    margin-bottom: 5px;
}

.game-desc {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #111;
}

#current-game-title {
    font-family: var(--font-header);
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--neon-cyan);
    font-family: var(--font-header);
    font-size: 0.8rem;
    cursor: pointer;
}

#canvas-wrapper {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    image-rendering: pixelated;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#overlay-title {
    font-family: var(--font-header);
    color: var(--neon-magenta);
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

#overlay-msg {
    color: var(--text-main);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.neon-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 15px 40px;
    font-family: var(--font-header);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: all 0.2s;
}

.neon-btn:active {
    background: var(--neon-cyan);
    color: #000;
}

.game-hud {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: #111;
    border-top: 1px solid #333;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 2px;
}

#score-display,
#best-display {
    font-family: var(--font-header);
    color: var(--neon-yellow);
    font-size: 1.2rem;
}

#install-btn {
    display: inline-block;
    border: 1px solid var(--neon-lime);
    color: var(--neon-lime);
    padding: 4px 8px;
    font-size: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* SEO Games Section - subtle directory */
.seo-games {
    padding: 40px 20px;
    background: #000;
    border-top: 1px solid #112;
    margin-top: 50px;
}

.seo-game {
    max-width: 800px;
    margin: 0 auto 20px;
    border-bottom: 1px solid #112;
    padding-bottom: 15px;
}

.seo-game h3 a {
    color: var(--neon-cyan);
    text-decoration: none;
    font-size: 0.8rem;
    font-family: var(--font-header);
}

.seo-game p {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 8px;
    line-height: 1.4;
}