:root {
    --bg-dark: #09090b;
    --bg-panel: rgba(20, 20, 25, 0.7);
    --primary-color: #a855f7;
    /* Purple */
    --accent-color: #ec4899;
    /* Pink */
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background Effects */
.app-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #000000 100%);
    z-index: -2;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Container */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

/* Header */
/* Site Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 1px;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-item {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s, text-shadow 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    text-shadow: 0 0 8px var(--accent-color);
}

/* Game HUD Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.glitch-text {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.8rem;
    color: white;
    text-shadow: 2px 2px var(--primary-color);
    letter-spacing: -1px;
    position: relative;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-top: 0.2rem;
}

/* Stats */
.stats-panel {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: var(--text-dim);
}

.bar-container {
    width: 150px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px black;
}

.scores-group {
    display: flex;
    gap: 1rem;
}

.score-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-icon {
    font-size: 1.2rem;
}

.score-info {
    display: flex;
    flex-direction: column;
}

.score-info .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-dim);
}

.score-info .value {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Main Game Window */
.terminal-window {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 1.5rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.5);
}

.terminal-window::-webkit-scrollbar {
    width: 6px;
}

.terminal-window::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* Messages */
.message {
    animation: fadeIn 0.3s ease-out;
    max-width: 90%;
}

.system-message {
    color: var(--primary-color);
    font-style: italic;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 0.5rem;
}

.narrator-message {
    align-self: flex-start;
    color: #e2e8f0;
}

.narrator-message strong {
    color: #fca5a5;
    /* Highlight important text */
}

.player-message {
    align-self: flex-end;
    color: #38bdf8;
    /* Blue */
    text-align: right;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 8px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.typing-indicator {
    color: var(--text-dim);
    font-size: 1.5rem;
    padding-left: 0.5rem;
    animation: pulse 1s infinite;
}

.hidden {
    display: none;
}

/* Input Area */
.input-area {
    margin-top: 1rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.prompt-symbol {
    color: var(--success);
    font-family: var(--font-mono);
    font-weight: bold;
    padding: 0 0.8rem;
    font-size: 1.2rem;
}

#player-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    padding: 0.5rem;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-ui);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.action-btn:hover {
    background: #9333ea;
}

.hints {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Utility */
.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Specific Page Styling */
.content-page {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 2rem;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.content-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.text-content {
    max-width: 750px;
    margin: 0 auto;
    color: #cbd5e1;
    line-height: 1.7;
}

.text-content h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    padding-bottom: 0.5rem;
}

.text-content p {
    margin-bottom: 1rem;
}

.text-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.text-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.site-footer {
    margin-top: auto;
    padding-top: 2rem;
    padding-bottom: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-links {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.separator {
    margin: 0 0.5rem;
    opacity: 0.3;
}

/* Contact Form */
.styled-form {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-family: var(--font-ui);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.mono-text {
    font-family: var(--font-mono);
    color: var(--success);
}