@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;600;800;900&family=Share+Tech+Mono&display=swap');

:root {
    --bg-deep: #050508;
    --bg-primary: #0a0a14;
    --bg-secondary: #121225;
    --bg-card: rgba(18, 18, 37, 0.6);
    --border-color: rgba(0, 240, 255, 0.15);
    --border-hover: rgba(0, 240, 255, 0.4);
    
    --neon-cyan: #00f0ff;
    --neon-pink: #ff007f;
    --neon-purple: #9d00ff;
    --neon-yellow: #ffbd00;
    
    --text-primary: #f5f5f7;
    --text-muted: #8a8da3;
    --text-bright: #ffffff;
    
    --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.3), 0 0 20px rgba(0, 240, 255, 0.1);
    --glow-pink: 0 0 10px rgba(ff, 0, 7f, 0.3), 0 0 20px rgba(ff, 0, 7f, 0.1);
    --glow-purple: 0 0 10px rgba(157, 0, 255, 0.3), 0 0 20px rgba(157, 0, 255, 0.1);
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* CRT Scanline and Vignette Effects */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    opacity: 0.4;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.8) 150%);
    pointer-events: none;
    z-index: 9998;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Neon utilities */
.text-neon-cyan {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}
.text-neon-pink {
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
}
.text-neon-purple {
    color: var(--neon-purple);
    text-shadow: var(--glow-purple);
}

/* Layout container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 42px;
    width: 42px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    object-fit: cover;
    background-color: #fff;
    padding: 2px;
}

.logo span {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
}

.logo::after {
    content: 'ONLINE';
    font-size: 0.6rem;
    font-family: 'Share Tech Mono', monospace;
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    box-shadow: var(--glow-cyan);
    animation: blink 2s infinite;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

nav a:hover, nav li.active a {
    color: var(--neon-cyan);
    border-color: var(--border-hover);
    background: rgba(0, 240, 255, 0.05);
    text-shadow: var(--glow-cyan);
}

/* Background dynamic elements */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    z-index: -1;
    perspective: 500px;
}

/* View Sections */
.view-section {
    display: none;
    padding: 40px 0 80px 0;
    min-height: calc(100vh - 80px);
}

.view-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 0;
}

.hero-content {
    flex: 1;
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-pink);
    text-transform: uppercase;
    font-size: 1.1rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 25px;
    color: var(--text-bright);
}

.hero-title span {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 14px 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
}

.btn-primary {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-bright);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
    transform: translateY(-2px);
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.arcade-container {
    width: 350px;
    height: 450px;
    position: relative;
    background: var(--bg-secondary);
    border: 3px solid var(--neon-purple);
    border-radius: 20px;
    box-shadow: var(--glow-purple), inset 0 0 20px rgba(157, 0, 255, 0.2);
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.arcade-screen-frame {
    height: 70%;
    margin: 15px;
    background: #000;
    border: 2px solid var(--neon-cyan);
    border-radius: 10px;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.arcade-screen-demo {
    width: 100%;
    height: 100%;
    background: radial-gradient(#0c1830, #030610);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.arcade-grid-animation {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%;
    background-image: linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    transform: perspective(80px) rotateX(60deg);
    transform-origin: bottom center;
    animation: gridScroll 3s linear infinite;
}

.arcade-player {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid var(--neon-pink);
    bottom: 30px;
    filter: drop-shadow(0 0 5px var(--neon-pink));
    animation: playerMove 4s ease-in-out infinite;
}

.arcade-control-panel {
    height: calc(30% - 30px);
    margin: 0 15px 15px 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px dashed var(--border-color);
}

.joystick {
    width: 40px;
    height: 40px;
    background: #252535;
    border-radius: 50%;
    position: relative;
    border: 2px solid var(--text-muted);
}

.joystick::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--neon-pink);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--glow-pink);
    animation: joystickWiggle 4s ease-in-out infinite;
}

.arcade-buttons {
    display: flex;
    gap: 10px;
}

.arc-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid #252535;
    box-shadow: 0 3px 0 #111;
}

.arc-btn-1 { background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.arc-btn-2 { background: var(--neon-yellow); }

/* Grid Background Animation */
@keyframes gridScroll {
    from { background-position: 0 0; }
    to { background-position: 0 40px; }
}

@keyframes playerMove {
    0%, 100% { left: 45%; }
    50% { left: 55%; }
}

@keyframes joystickWiggle {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-80%, -50%); }
    75% { transform: translate(-20%, -50%); }
}

/* Library View Styling */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.library-title {
    font-size: 2rem;
    position: relative;
}

.library-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    margin-top: 8px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-wrapper {
    position: relative;
    width: 280px;
}

.search-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 20px 12px 40px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.search-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.6;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: rgba(18, 18, 37, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: var(--glow-cyan);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 20, 0.9) 100%);
    z-index: 1;
    pointer-events: none;
}

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

.game-card:hover .card-img {
    transform: scale(1.05);
}

.card-img-wrapper {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #06060c;
    transition: var(--transition-smooth);
}

.card-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 3px;
    z-index: 2;
    text-transform: uppercase;
}

.card-tag.cyan { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.card-tag.pink { color: var(--neon-pink); border-color: var(--neon-pink); }
.card-tag.purple { color: var(--neon-purple); border-color: var(--neon-purple); }

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-bright);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.card-stat {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-play-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.game-card:hover .card-play-btn {
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
}

/* Play View (Theater Mode) */
.play-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

@media (max-width: 992px) {
    .play-layout {
        grid-template-columns: 1fr;
    }
}

.game-screen-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-cabinet-wrapper {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-cabinet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.game-cabinet-title {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    animation: blink 1s infinite alternate;
}

.screen-controls {
    display: flex;
    gap: 10px;
}

.screen-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: var(--transition-smooth);
}

.screen-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.game-canvas-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-canvas-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.iframe-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.iframe-placeholder-icon {
    font-size: 3.5rem;
    animation: float 4s ease-in-out infinite;
}

.game-info-details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
}

.game-info-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--neon-cyan);
}

.game-description {
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.sidebar-title {
    font-size: 1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
    color: var(--text-bright);
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.control-key {
    font-family: 'Share Tech Mono', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--neon-pink);
    font-weight: bold;
    box-shadow: 0 0 5px rgba(255, 0, 127, 0.1);
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-weight: bold;
}
.rank-1 { color: var(--neon-yellow); }
.rank-2 { color: #d1d1d1; }
.rank-3 { color: #cd7f32; }

/* About View Styling (Interactive Terminal) */
.about-logo-container {
    margin-bottom: 25px;
    display: inline-block;
    position: relative;
}

.about-logo {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    border: 3px solid var(--neon-purple);
    box-shadow: var(--glow-purple);
    object-fit: cover;
    background-color: #fff;
    padding: 6px;
    animation: float 6s ease-in-out infinite;
}

.terminal-window {
    background: #06060c;
    border: 2px solid var(--neon-purple);
    border-radius: 8px;
    box-shadow: var(--glow-purple);
    overflow: hidden;
    max-width: 800px;
    margin: 40px auto;
}

.terminal-header {
    background: #121225;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.term-dot-red { background: #ff5f56; }
.term-dot-yellow { background: #ffbd2e; }
.term-dot-green { background: #27c93f; }

.terminal-body {
    padding: 25px;
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-cyan);
    font-size: 0.95rem;
    line-height: 1.6;
    height: 450px;
    overflow-y: auto;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.terminal-prompt {
    color: var(--neon-pink);
    margin-right: 10px;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--neon-cyan);
    margin-left: 5px;
    animation: blink 0.8s infinite;
}

.terminal-out-white {
    color: var(--text-primary);
}

.terminal-out-purple {
    color: var(--neon-purple);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-deep);
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.social-link:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-3px);
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

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

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-desc {
        margin: 0 auto 30px auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .arcade-container {
        width: 300px;
        height: 380px;
    }
    
    .library-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper {
        width: 100%;
    }
    
    .filter-buttons {
        overflow-x: auto;
        padding-bottom: 5px;
    }
}
