/* Font Import - Using parent font */
@font-face {
    font-family: "MONO";
    src: url("../../src/fonts/MONO.ttf") format("truetype");
}

/* CSS Variables */
:root {
    --primary: #49DA6C;
    --primary-dark: #143c1d;
    --primary-rgb: 73, 218, 108;
    --bg: #0a0a0a;
    --bg-light: #111;
    --text: #49DA6C;
    --text-dim: rgba(73, 218, 108, 0.6);
    --border: #49DA6C;
}

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

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

body {
    font-family: "MONO", "Courier New", monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Selection */
::selection {
    background: var(--primary);
    color: var(--primary-dark);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-shadow: 0 0 10px var(--primary);
}

/* Terminal Container */
.terminal-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    background: var(--bg);
    box-shadow:
        inset 0 0 100px rgba(var(--primary-rgb), 0.03),
        0 0 50px rgba(var(--primary-rgb), 0.1);
}

/* Header */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
    background: var(--bg-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex-shrink: 0;
}

.logo-link {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo-link:hover {
    animation: glitch 0.3s ease;
}

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

.header-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.4rem 0.8rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.nav-link.active {
    background: var(--primary);
    color: var(--primary-dark);
    text-shadow: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--primary);
}

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

/* Main Content */
.terminal-main {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px var(--primary);
}

.section-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    text-shadow: 0 0 5px var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--primary-dark);
    text-shadow: none;
}

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

/* Game Card */
.game-card {
    border: 2px solid var(--border);
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
    transform: translateY(-2px);
}

.game-card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.game-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid;
}

.game-status.live {
    color: var(--primary);
    border-color: var(--primary);
}

.game-status.coming {
    color: #f1ac43;
    border-color: #f1ac43;
}

.game-status.planned {
    color: #888;
    border-color: #888;
}

.game-card-body {
    padding: 1rem;
}

.game-type {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.game-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}

.game-card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.game-year {
    opacity: 0.7;
}

.game-play-btn {
    color: var(--primary);
}

/* Content Box */
.content-box {
    border: 1px solid var(--border);
    padding: 1.5rem;
    background: var(--bg-light);
    line-height: 1.8;
}

.content-box h2 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
}

.content-box h2:first-child {
    margin-top: 0;
}

.content-box p {
    margin-bottom: 0.5rem;
}

.info-block {
    background: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-dim);
}

.back-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.back-link:hover {
    background: var(--primary);
    color: var(--primary-dark);
    text-shadow: none;
}

/* Footer */
.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--border);
    background: var(--bg-light);
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-left a {
    margin-right: 0.25rem;
}

.footer-right {
    color: var(--text-dim);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border: 2px solid var(--border);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    background: var(--primary);
    color: var(--primary-dark);
}

.modal-title {
    font-weight: bold;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.modal-close:hover {
    background: var(--primary-dark);
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.modal-body .game-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-body .game-meta span {
    margin-right: 1rem;
}

.modal-body .game-full-description {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.modal-body .game-note {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-body .play-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--primary-dark);
    border: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-body .play-btn:hover {
    box-shadow: 0 0 20px var(--primary);
}

.modal-body .play-btn.disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.modal-body .play-btn.disabled:hover {
    box-shadow: none;
}

/* Loading */
.loading-text {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    animation: blink 1s infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    border: 1px dashed var(--border);
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .terminal-header {
        padding: 1rem;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.85rem;
    }

    .terminal-main {
        padding: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        justify-content: center;
    }

    .filter-label {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .terminal-footer {
        flex-direction: column;
        text-align: center;
    }

    .section-header h1 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1rem;
    }

    .header-right {
        display: none;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Print */
@media print {
    .scanlines,
    .terminal-header,
    .terminal-footer,
    .filter-bar {
        display: none;
    }

    .terminal-container {
        border: none;
        box-shadow: none;
    }

    .section {
        display: block !important;
        page-break-after: always;
    }
}
