:root {
    --screen-black: #0a0a1a;
    --panel-navy: #1a1a2a;
    --pixel-gold: #f0e060;
    --terminal-white: #e0e0e0;
    --interface-blue: #8090b0;
    --hp-red: #e04040;
    --mp-blue: #4080e0;
    --xp-green: #40c040;
    --border-highlight: #6070a0;
    --border-shadow: #2a2a4a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background: var(--screen-black);
    color: var(--terminal-white);
    overflow-x: hidden;
}

/* Scanlines */
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
}

/* Screens */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Title Screen */
.title-screen {
    background: var(--screen-black);
    flex-direction: column;
}

.title-content {
    text-align: center;
    position: relative;
}

.pixel-stars {
    position: absolute;
    inset: -100px;
    pointer-events: none;
}

.pixel-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--pixel-gold);
    animation: starTwinkle 2s ease-in-out infinite;
}

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

.game-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.4rem, 3.5vw, 2.8rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pixel-gold);
    line-height: 1.5;
    text-shadow: 3px 3px 0 #806000, 4px 4px 0 rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.title-sub {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--interface-blue);
    margin-bottom: 2rem;
}

.blink-prompt {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--terminal-white);
    letter-spacing: 0.08em;
    animation: blink 1.2s step-end infinite;
    cursor: pointer;
}

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

/* Game Windows */
.game-window {
    max-width: 700px;
    width: 100%;
    background: var(--panel-navy);
    border: 3px solid var(--border-highlight);
    box-shadow:
        inset -2px -2px 0 var(--border-shadow),
        inset 2px 2px 0 rgba(96, 112, 160, 0.3),
        4px 4px 0 rgba(0,0,0,0.5);
}

.window-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--border-highlight);
    border-bottom: 2px solid var(--border-shadow);
}

.window-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--pixel-gold);
    letter-spacing: 0.08em;
}

.window-controls {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: var(--interface-blue);
}

.window-body {
    padding: 16px;
}

/* Quest List */
.quest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-shadow);
    background: rgba(10, 10, 26, 0.5);
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.quest-item:hover {
    border-color: var(--pixel-gold);
}

.active-quest {
    border-color: var(--xp-green);
}

.quest-icon {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--pixel-gold);
    min-width: 24px;
    text-align: center;
    line-height: 1.5;
}

.quest-info {
    flex: 1;
}

.quest-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--terminal-white);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.quest-desc {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: var(--interface-blue);
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Progress Bar */
.quest-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--screen-black);
    border: 1px solid var(--border-shadow);
    padding: 1px;
}

.progress-fill {
    height: 100%;
    background: var(--xp-green);
    width: 0;
    transition: width 1s ease-in-out;
    image-rendering: pixelated;
}

.progress-text {
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    color: var(--xp-green);
    min-width: 35px;
}

/* Party Grid */
.party-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.party-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-shadow);
    background: rgba(10, 10, 26, 0.3);
}

/* Pixel Avatars */
.member-avatar {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.citizen-avatar {
    background: var(--xp-green);
    clip-path: polygon(30% 0%, 70% 0%, 70% 40%, 100% 40%, 100% 100%, 0% 100%, 0% 40%, 30% 40%);
}

.policy-avatar {
    background: var(--mp-blue);
    clip-path: polygon(20% 0%, 80% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
}

.diplomat-avatar {
    background: var(--pixel-gold);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.member-stats {
    width: 100%;
    text-align: center;
}

.member-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--terminal-white);
    display: block;
    margin-bottom: 2px;
}

.member-class {
    font-family: 'VT323', monospace;
    font-size: 0.8rem;
    color: var(--interface-blue);
    display: block;
    margin-bottom: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.stat-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.4rem;
    color: var(--interface-blue);
    min-width: 20px;
    text-align: right;
}

.stat-bar {
    flex: 1;
    height: 8px;
    background: var(--screen-black);
    border: 1px solid var(--border-shadow);
}

.hp-bar .stat-fill {
    height: 100%;
    background: var(--hp-red);
}

.mp-bar .stat-fill {
    height: 100%;
    background: var(--mp-blue);
}

/* World Map */
.world-map {
    margin-bottom: 16px;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    background: var(--screen-black);
    border: 1px solid var(--border-shadow);
    min-height: 200px;
}

.map-cell {
    aspect-ratio: 1;
    border-radius: 1px;
    transition: transform 0.2s ease;
}

.map-cell:hover {
    transform: scale(1.3);
}

.map-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    color: var(--interface-blue);
}

.legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
}

.safe-dot { background: var(--xp-green); }
.caution-dot { background: var(--pixel-gold); }
.danger-dot { background: var(--hp-red); }

.map-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--border-shadow);
}

.map-label {
    font-family: 'VT323', monospace;
    font-size: 0.85rem;
    color: var(--interface-blue);
}

/* Reveal */
.game-window {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.screen.visible .game-window {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .screen {
        padding: 1rem;
    }

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

    .map-grid {
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }

    .game-title {
        font-size: clamp(1rem, 5vw, 1.8rem);
    }
}
