/* Font Face Declarations */
@font-face {
    font-family: 'PT Mono';
    src: url('fonts/PTMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PT Mono', 'Orbitron', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #00ff41;
    overflow: hidden;
    min-height: 100vh;
    position: relative;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.1"/></svg>');
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 65, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Game Container */
.game-container {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    transition: all 0.5s ease;
}

.screen.active {
    transform: translateX(0);
    opacity: 1;
}

.screen.inactive {
    transform: translateX(100%);
    opacity: 0;
}

/* Screen Header */
.screen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #00ff41;
    z-index: 100;
}

.back-btn {
    background: none;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.screen-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px #00ff41;
}

.score {
    font-size: 1rem;
    font-weight: bold;
    color: #00ff41;
}

/* Main Menu */
#main-menu {
    justify-content: center;
    gap: 3rem;
}

.glitch-header {
    text-align: center;
    margin-bottom: 2rem;
}

.glitch {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 0 10px #00ff41;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0066;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #0066ff;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
}

.subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: #888;
    margin-top: 1rem;
    letter-spacing: 0.5em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Menu Options */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.menu-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 1rem 2rem;
    font-family: 'PT Mono', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
    transition: left 0.5s ease;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.3);
}

.menu-instructions {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.menu-instructions p {
    margin: 0.5rem 0;
}

/* Terminal Game */
.terminal-game {
    width: 100%;
    max-width: 800px;
    height: 70vh;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff41;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-display {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'PT Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 0.5rem;
    color: #00ff41;
}

.terminal-input-area {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #00ff41;
}

.prompt {
    color: #00ff41;
    margin-right: 0.5rem;
    font-weight: bold;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'PT Mono', monospace;
    font-size: 0.9rem;
    outline: none;
}

#terminal-input::placeholder {
    color: #666;
}

.terminal-commands {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #333;
}

.command-hint {
    color: #888;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.command-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cmd {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmd:hover {
    background: rgba(0, 255, 65, 0.2);
    transform: scale(1.05);
}

/* Particle Game */
#particle-canvas {
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    cursor: crosshair;
}

.game-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.game-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.particle-count {
    color: #00ff41;
    font-weight: bold;
}

/* Cyber Grid (Minesweeper) */
.grid-game {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#cyber-grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 10px;
}

.grid-cell {
    width: 35px;
    height: 35px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
}

.grid-cell:hover {
    background: rgba(0, 255, 65, 0.2);
    transform: scale(1.05);
}

.grid-cell.revealed {
    background: rgba(0, 0, 0, 0.9);
    border-color: #333;
}

.grid-cell.flagged {
    background: rgba(255, 68, 68, 0.8);
    color: #fff;
}

.grid-cell.mine {
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    animation: explode 0.5s ease;
}

.grid-cell.mines-1 { color: #00ffff; }
.grid-cell.mines-2 { color: #00ff00; }
.grid-cell.mines-3 { color: #ffff00; }
.grid-cell.mines-4 { color: #ff8800; }
.grid-cell.mines-5 { color: #ff0088; }
.grid-cell.mines-6 { color: #8800ff; }
.grid-cell.mines-7 { color: #ffffff; }
.grid-cell.mines-8 { color: #888888; }

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.grid-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.grid-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.grid-info {
    display: flex;
    gap: 1rem;
    color: #00ff41;
    font-weight: bold;
}

/* Neural Maze */
#maze-canvas {
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    cursor: crosshair;
}

.maze-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.maze-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.maze-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.maze-info {
    display: flex;
    gap: 1rem;
    color: #00ff41;
    font-weight: bold;
}

/* 2048 Game Screen */
.game2048-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.game2048-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

.game2048-score-container {
    display: flex;
    gap: 1rem;
}

.score-box {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff41;
}

.new-game-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-game-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.game2048-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 10px;
    width: 400px;
    height: 400px;
}

.tile {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #00ff41;
    transition: all 0.3s ease;
}

.tile-2 { background: rgba(0, 255, 65, 0.2); }
.tile-4 { background: rgba(0, 255, 65, 0.3); }
.tile-8 { background: rgba(0, 255, 65, 0.4); }
.tile-16 { background: rgba(0, 255, 65, 0.5); }
.tile-32 { background: rgba(0, 255, 65, 0.6); }
.tile-64 { background: rgba(0, 255, 65, 0.7); }
.tile-128 { background: rgba(0, 255, 65, 0.8); }
.tile-256 { background: rgba(0, 255, 65, 0.9); }
.tile-512 { background: rgba(0, 255, 65, 1); color: #000; }
.tile-1024 { background: rgba(0, 255, 65, 1); color: #000; }
.tile-2048 { background: rgba(0, 255, 65, 1); color: #000; }

.game2048-instructions {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.game2048-instructions p {
    margin: 0.5rem 0;
}

/* Interactive Dots Screen */
.interactive-dots-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#dots-canvas {
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    cursor: crosshair;
}

.dots-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dots-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dots-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

/* Particle Physics Screen */
.particle-physics-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#physics-canvas {
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    cursor: crosshair;
}

.physics-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.physics-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.physics-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

/* Three.js Cube Screen */
.three-cube-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#three-canvas {
    width: 600px;
    height: 600px;
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
}

.three-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.three-controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5rem 1rem;
    font-family: 'PT Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.three-controls button:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

/* Connect Screen */
.connect-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.connect-animation {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-wave {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid #00ff41;
    border-radius: 50%;
    animation: signal-pulse 2s infinite;
}

.signal-wave:nth-child(1) { animation-delay: 0s; }
.signal-wave:nth-child(2) { animation-delay: 0.7s; }
.signal-wave:nth-child(3) { animation-delay: 1.4s; }

@keyframes signal-pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.connect-text h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px #00ff41;
}

.connect-text p {
    color: #888;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.connect-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(45deg, #00ff41, #00cc33);
    color: #000;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'PT Mono', monospace;
}

.connect-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.connect-button:hover::before {
    left: 100%;
}

.connect-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.5);
}

.button-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.connect-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Particle System */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 1rem;
    }
    
    .glitch {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .menu-btn {
        min-width: 250px;
        font-size: 1rem;
    }
    
    #particle-canvas {
        width: 100%;
        height: 400px;
    }
    
    #maze-canvas {
        width: 100%;
        height: 400px;
    }
    
    .connect-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc33;
}

/* Selection */
::selection {
    background: #00ff41;
    color: #000;
}

/* Focus Styles */
*:focus {
    outline: 2px solid #00ff41;
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes loading {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.loading {
    animation: loading 1.5s infinite;
} 