/* ==========================================================================
   Survivor 3D - Retro Synth Edition
   CSS Styles
   ========================================================================== */

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

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0a1a;
    color: #0ff;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Game Container
   -------------------------------------------------------------------------- */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-container canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   HUD - Heads Up Display
   -------------------------------------------------------------------------- */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    pointer-events: none;
    z-index: 100;
}

/* Health Bar */
#health-bar-container {
    width: 250px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #f00;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f00, #ff4444);
    transition: width 0.3s ease;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Experience Bar */
#exp-bar-container {
    width: 250px;
    height: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

#exp-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0f0, #88ff88);
    transition: width 0.2s ease;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Stats Display */
#stats {
    margin-top: 10px;
    font-size: 18px;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
}

/* Timer */
#timer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 15px #0ff, 0 0 30px #0ff;
    letter-spacing: 4px;
}

/* Kill Count */
#kill-count {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 18px;
    text-shadow: 0 0 10px #f0f, 0 0 20px #f0f;
    color: #f0f;
}

/* Combo Display */
#combo-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #ff0;
    text-shadow: 0 0 15px #ff0, 0 0 30px #ff0;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    letter-spacing: 2px;
}

/* Biome/Stage Display */
#biome-display {
    position: fixed;
    top: 50px;
    right: 20px;
    font-size: 18px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    letter-spacing: 2px;
}

/* --------------------------------------------------------------------------
   Wave Warning
   -------------------------------------------------------------------------- */
#wave-warning {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000, 0 0 60px #ff0000;
    opacity: 0;
    transition: opacity 0.3s ease;
    letter-spacing: 6px;
    text-transform: uppercase;
    z-index: 150;
    animation: wavePulse 0.5s ease-in-out infinite alternate;
}

@keyframes wavePulse {
    from {
        transform: translate(-50%, -50%) scale(1);
        text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    }
    to {
        transform: translate(-50%, -50%) scale(1.1);
        text-shadow: 0 0 30px #ff0000, 0 0 60px #ff0000, 0 0 80px #ff0000;
    }
}

/* --------------------------------------------------------------------------
   Low Health Overlay
   -------------------------------------------------------------------------- */
#low-health-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-shadow: inset 0 0 100px 50px rgba(255, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 50;
}

/* --------------------------------------------------------------------------
   Level Up Screen
   -------------------------------------------------------------------------- */
#level-up-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#level-up-screen h1 {
    font-size: 64px;
    color: #ff0;
    text-shadow: 0 0 20px #ff0, 0 0 40px #ff0, 0 0 60px #ff0;
    margin-bottom: 40px;
    letter-spacing: 8px;
    animation: levelUpPulse 0.5s ease-in-out infinite alternate;
}

@keyframes levelUpPulse {
    from {
        transform: scale(1);
        text-shadow: 0 0 20px #ff0, 0 0 40px #ff0;
    }
    to {
        transform: scale(1.05);
        text-shadow: 0 0 30px #ff0, 0 0 60px #ff0, 0 0 80px #ff0;
    }
}

#upgrade-options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
}

.upgrade-card {
    width: 220px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    border: 2px solid #0ff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.upgrade-card:hover {
    transform: scale(1.08) translateY(-5px);
    border-color: #f0f;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
}

.upgrade-card .upgrade-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.5));
}

.upgrade-card h3 {
    font-size: 22px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.upgrade-card p {
    font-size: 14px;
    color: #aaa;
    line-height: 1.4;
}

.upgrade-card:hover h3 {
    color: #f0f;
    text-shadow: 0 0 15px #f0f;
}

/* --------------------------------------------------------------------------
   Pause Screen
   -------------------------------------------------------------------------- */
#pause-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#pause-screen h1 {
    font-size: 64px;
    color: #0ff;
    text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
    margin-bottom: 30px;
    letter-spacing: 8px;
}

#pause-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.pause-section {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 8px;
    padding: 20px;
    min-width: 200px;
}

.pause-section h3 {
    color: #0ff;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 3px;
}

.pause-section div {
    color: #aaa;
    font-size: 14px;
    line-height: 1.8;
}

.pause-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.pause-item-name { color: #888; }
.pause-item-value { color: #0ff; }

#pause-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

#pause-buttons button {
    padding: 15px 30px;
    font-size: 18px;
}

#quit-btn {
    border-color: #f66;
    color: #f66;
}

#quit-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    box-shadow: 0 0 20px rgba(255, 100, 100, 0.5);
}

/* --------------------------------------------------------------------------
   Settings Screen
   -------------------------------------------------------------------------- */
#settings-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#settings-screen h1 {
    font-size: 48px;
    color: #f0f;
    text-shadow: 0 0 20px #f0f;
    margin-bottom: 40px;
    letter-spacing: 6px;
}

#settings-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 400px;
    margin-bottom: 40px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid #f0f;
    border-radius: 6px;
}

.setting-row label {
    color: #fff;
    font-size: 16px;
}

.setting-row input[type="range"] {
    width: 150px;
    accent-color: #f0f;
}

.setting-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #f0f;
}

.setting-row select {
    background: #111;
    color: #f0f;
    border: 1px solid #f0f;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 14px;
    border-radius: 4px;
}

.setting-row span {
    color: #f0f;
    font-size: 14px;
    min-width: 50px;
    text-align: right;
}

#settings-back-btn {
    padding: 15px 40px;
}

/* --------------------------------------------------------------------------
   Game Over Screen
   -------------------------------------------------------------------------- */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#game-over-screen h1 {
    font-size: 72px;
    color: #f00;
    text-shadow: 0 0 20px #f00, 0 0 40px #f00, 0 0 60px #f00;
    margin-bottom: 30px;
    letter-spacing: 10px;
    animation: gameOverFlicker 0.1s ease-in-out infinite;
}

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

#final-stats {
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    text-align: center;
    margin-bottom: 40px;
    line-height: 2;
}

#final-stats span {
    color: #ff0;
    text-shadow: 0 0 10px #ff0;
}

#run-recap {
    margin-bottom: 20px;
    max-width: 600px;
    text-align: center;
}

#run-recap h3 {
    color: #f0f;
    font-size: 16px;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

#recap-timeline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.recap-event {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
}

.recap-event .event-time {
    color: #888;
    font-size: 10px;
}

.recap-event .event-icon {
    font-size: 14px;
}

.recap-event .event-text {
    color: #fff;
}

#restart-btn {
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    padding: 16px 40px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    letter-spacing: 3px;
}

#restart-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Start Screen - Redesigned to fix overlaps
   -------------------------------------------------------------------------- */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 300;
    padding-top: 40px;
    overflow-y: auto;
    padding-bottom: 60px;
}

#start-screen h1 {
    font-size: 60px;
    color: #0ff;
    text-shadow: 
        0 0 10px #0ff,
        0 0 20px #0ff,
        0 0 40px #0ff;
    letter-spacing: 12px;
    margin-bottom: 5px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            0 0 10px #0ff,
            0 0 20px #0ff,
            0 0 40px #0ff;
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 15px #0ff,
            0 0 30px #0ff,
            0 0 60px #0ff,
            0 0 100px #f0f;
        filter: brightness(1.2);
    }
}

.subtitle {
    font-size: 20px;
    color: #f0f;
    text-shadow: 0 0 10px #f0f;
    letter-spacing: 6px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

#soul-balance {
    margin-bottom: 20px;
    font-size: 18px;
    color: #9966ff;
    text-shadow: 0 0 10px #9966ff;
    background: rgba(153, 102, 255, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(153, 102, 255, 0.3);
}

#character-select {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    padding: 0 20px;
}

.character-card {
    width: 140px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #333;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-card:hover:not(.locked) {
    border-color: #0ff;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

.character-card.selected {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.character-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
}

.character-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
    border: 2px solid;
}

.character-card .name {
    font-size: 14px;
    color: #0ff;
    margin-bottom: 4px;
}

.character-card .desc {
    font-size: 10px;
    color: #888;
    line-height: 1.2;
}

.character-card .char-stats {
    font-size: 10px;
    color: #aaa;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.start-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

button {
    font-family: 'Courier New', Courier, monospace;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#start-btn {
    font-size: 24px;
    padding: 15px 40px;
    text-shadow: 0 0 10px #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    letter-spacing: 3px;
}

#start-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

#meta-shop-btn {
    font-size: 20px;
    padding: 12px 30px;
    border-color: #9966ff;
    color: #9966ff;
    text-shadow: 0 0 10px #9966ff;
    box-shadow: 0 0 15px rgba(153, 102, 255, 0.3);
}

#meta-shop-btn:hover {
    background: rgba(153, 102, 255, 0.1);
    box-shadow: 0 0 30px rgba(153, 102, 255, 0.5);
    transform: scale(1.05);
}

#controls-info {
    font-size: 14px;
    color: #666;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

#global-stats {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.global-stats-box {
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #888;
}

.stat-row span:last-child {
    color: #0ff;
}

/* --------------------------------------------------------------------------
   Scanline Effect
   -------------------------------------------------------------------------- */
#game-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 50;
}

/* --------------------------------------------------------------------------
   Minimap
   -------------------------------------------------------------------------- */
#minimap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 4px;
    z-index: 100;
}

/* --------------------------------------------------------------------------
   Achievement Notification (Enhanced)
   -------------------------------------------------------------------------- */
#achievement-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 165, 0, 0.15));
    border: 3px solid #ffd700;
    border-radius: 12px;
    z-index: 250;
    animation: achievementSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), achievementGlow 2s ease-in-out infinite, achievementFade 5s ease-in-out forwards;
    pointer-events: none;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 165, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(5px);
}

#achievement-notification::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff8800, #ffd700, #ffaa00);
    background-size: 300% 300%;
    border-radius: 14px;
    z-index: -1;
    animation: achievementBorderFlow 2s linear infinite;
    opacity: 0.7;
}

#achievement-notification .icon {
    font-size: 48px;
    animation: achievementIconBounce 0.6s ease-out, achievementIconPulse 1s ease-in-out infinite 0.6s;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

#achievement-notification .text {
    display: flex;
    flex-direction: column;
}

#achievement-notification .label {
    color: #ff8800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 4px;
}

#achievement-notification .title {
    color: #ffd700;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 15px #ffd700, 0 0 30px #ff8800;
    letter-spacing: 1px;
}

#achievement-notification .desc {
    color: #ccc;
    font-size: 13px;
    margin-top: 6px;
    font-style: italic;
}

@keyframes achievementSlide {
    0% { transform: translateX(150px) scale(0.5); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 165, 0, 0.3); }
    50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 165, 0, 0.5); }
}

@keyframes achievementFade {
    0%, 75% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(50px); }
}

@keyframes achievementBorderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes achievementIconBounce {
    0% { transform: scale(0) rotate(-15deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes achievementIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* --------------------------------------------------------------------------
   Soul Currency Display (HUD)
   -------------------------------------------------------------------------- */
#soul-display {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(130px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #9966ff;
    border-radius: 20px;
    font-size: 18px;
    color: #9966ff;
    text-shadow: 0 0 10px #9966ff;
    box-shadow: 0 0 15px rgba(153, 102, 255, 0.3);
    z-index: 100;
}

/* --------------------------------------------------------------------------
   Meta Shop Screen
   -------------------------------------------------------------------------- */
#meta-shop-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 350;
    padding: 40px 20px;
    overflow-y: auto;
}

#meta-shop-screen h1 {
    font-size: 48px;
    color: #9966ff;
    text-shadow: 0 0 20px #9966ff, 0 0 40px #6633cc;
    margin-bottom: 10px;
    letter-spacing: 6px;
}

#meta-shop-screen .soul-balance {
    font-size: 24px;
    color: #9966ff;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#meta-shop-screen .soul-balance .icon {
    font-size: 28px;
}

#meta-upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin-bottom: 40px;
}

.meta-upgrade-card {
    padding: 25px;
    background: linear-gradient(135deg, rgba(153, 102, 255, 0.1), rgba(102, 51, 153, 0.05));
    border: 2px solid #6633cc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.meta-upgrade-card:hover:not(.maxed):not(.cant-afford) {
    border-color: #9966ff;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(153, 102, 255, 0.4);
}

.meta-upgrade-card.maxed {
    opacity: 0.6;
    border-color: #44ff44;
    cursor: default;
}

.meta-upgrade-card.cant-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.meta-upgrade-card .upgrade-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.meta-upgrade-card .upgrade-icon {
    font-size: 36px;
}

.meta-upgrade-card .upgrade-name {
    font-size: 20px;
    color: #9966ff;
    text-shadow: 0 0 10px #9966ff;
}

.meta-upgrade-card .upgrade-level {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.meta-upgrade-card .upgrade-desc {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.meta-upgrade-card .upgrade-cost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(153, 102, 255, 0.3);
}

.meta-upgrade-card .cost-amount {
    color: #9966ff;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-upgrade-card .buy-text {
    color: #0ff;
    font-size: 14px;
    letter-spacing: 1px;
}

.meta-upgrade-card.maxed .buy-text {
    color: #44ff44;
}

/* --------------------------------------------------------------------------
   Upgrade Card Categories
   -------------------------------------------------------------------------- */
.upgrade-card.weapon {
    border-color: #f00;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 100, 0, 0.1));
}

.upgrade-card.weapon h3 {
    color: #f00;
}

.upgrade-card.passive {
    border-color: #0f0;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 100, 0.1));
}

.upgrade-card.passive h3 {
    color: #0f0;
}

.upgrade-card.evolution {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 100, 0, 0.2));
    animation: evolvedPulse 2s ease-in-out infinite;
}

@keyframes evolvedPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.7); }
}

.upgrade-card.evolution h3 {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8800;
}

.upgrade-card .level-badge.evolved {
    background: #ffd700;
    color: #000;
    font-weight: bold;
    letter-spacing: 1px;
}

.upgrade-card .level-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 40px;
        letter-spacing: 6px;
    }

    .character-card {
        width: 120px;
        padding: 10px;
    }

    #start-btn {
        font-size: 20px;
        padding: 12px 30px;
    }
}
