/* ============================================
   economics.quest - Retro Vapor Gradients
   ============================================ */

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

body {
    background: #1A0A2E;
    color: #FFE0F0;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.7;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* --- CRT OVERLAY --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 1px,
        rgba(0,0,0,0.15) 1px,
        rgba(0,0,0,0.15) 2px
    );
}

.crt-overlay.intense {
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 0.5px,
        rgba(0,0,0,0.2) 0.5px,
        rgba(0,0,0,0.2) 1px
    );
}

/* --- HUD BAR --- */
.hud-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: rgba(18,8,38,0.9);
    border-bottom: 1px solid rgba(0,245,255,0.2);
    padding: 8px 24px;
    display: flex;
    gap: 2rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: #00F5FF;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.hud-bar.visible {
    transform: translateY(0);
}

.hud-xp,
.hud-level,
.hud-quest {
    color: #FFD700;
}

/* --- TITLE SCREEN --- */
.title-screen {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1A0A2E 0%, #2D1150 40%, #FF2E88 100%);
    overflow: hidden;
}

/* Perspective Grid Floor */
.grid-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    overflow: hidden;
    perspective: 400px;
}

.grid-floor-inner {
    width: 200%;
    height: 200%;
    position: absolute;
    top: 0;
    left: -50%;
    background:
        repeating-linear-gradient(90deg, rgba(0,245,255,0.2) 0px, transparent 1px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(0,245,255,0.2) 0px, transparent 1px, transparent 40px);
    transform: rotateX(60deg);
    transform-origin: center top;
    animation: grid-scroll 30s linear infinite;
}

@keyframes grid-scroll {
    0% { transform: rotateX(60deg) translateY(0); }
    100% { transform: rotateX(60deg) translateY(40px); }
}

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

.chrome-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, #FFD700, #FFFFFF, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.4));
    transform: scale(0.8);
    opacity: 0;
    animation: chrome-entrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
}

@keyframes chrome-entrance {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.press-start {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: #FFE0F0;
    margin-top: 2rem;
    animation: pulse-attention 1.5s ease-in-out infinite;
}

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

/* --- QUEST CHAPTERS --- */
.quest-chapter {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.chapter-1 {
    background: linear-gradient(180deg, #1A0A2E 0%, #FF2E88 100%);
}

.chapter-2 {
    background: linear-gradient(180deg, #FF2E88 0%, #FF6B35 100%);
}

.chapter-3 {
    background: linear-gradient(180deg, #FF6B35 0%, #FFD700 100%);
}

.chapter-boss {
    background: linear-gradient(180deg, #FFD700 0%, #1A0A2E 100%);
}

/* --- QUEST PANEL --- */
.quest-panel {
    max-width: 700px;
    width: 100%;
    background: rgba(18,8,38,0.85);
    border: 1px solid rgba(0,245,255,0.2);
    border-radius: 4px;
    padding: 3rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.quest-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    letter-spacing: 0.08em;
    color: #FFE0F0;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.neon-glow {
    text-shadow:
        0 0 10px #FF2E88,
        0 0 20px #FF2E88,
        0 0 40px #FF2E88,
        0 0 80px rgba(255,46,136,0.4);
}

.boss-glow {
    text-shadow:
        0 0 15px #FF2E88,
        0 0 30px #FF2E88,
        0 0 60px #FF2E88,
        0 0 120px rgba(255,46,136,0.6);
}

.quest-desc {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #FFE0F0;
    margin-bottom: 1.5rem;
}

.quest-objective {
    border-top: 1px solid rgba(0,245,255,0.2);
    padding-top: 1rem;
}

.objective-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #FFD700;
    display: block;
    margin-bottom: 0.5rem;
}

.objective-text {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #00F5FF;
}

/* --- BOSS FIGHT --- */
.boss-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #FF2E88;
    box-shadow: inset 0 0 20px rgba(255,46,136,0.3);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

.boss-border.active {
    animation: boss-pulse 1s ease-in-out infinite;
}

@keyframes boss-pulse {
    0%, 100% { opacity: 0.5; box-shadow: inset 0 0 20px rgba(255,46,136,0.3); }
    50% { opacity: 1; box-shadow: inset 0 0 40px rgba(255,46,136,0.5); }
}

/* --- HIGH SCORE FOOTER --- */
.high-score-section {
    background: #120826;
    padding: 4rem 2rem;
    text-align: center;
}

.score-heading {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #FFD700;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

.leaderboard {
    max-width: 500px;
    margin: 0 auto;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,245,255,0.1);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
}

.score-rank {
    color: #00F5FF;
    width: 60px;
    text-align: left;
}

.score-name {
    color: #FFE0F0;
    flex: 1;
    text-align: center;
}

.score-val {
    color: #FFD700;
    width: 100px;
    text-align: right;
}

.footer-credit {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,224,240,0.3);
    margin-top: 2rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .quest-panel {
        padding: 2rem 1.5rem;
    }

    .hud-bar {
        font-size: 0.55rem;
        gap: 1rem;
    }
}
