/* Base Styles & Variables */
:root {
    --snow-white: #f0f8ff;
    --ice-blue: #e0f4ff;
    --frost-blue: #b8e0f6;
    --mountain-blue: #4a90b8;
    --deep-blue: #2c5f7c;
    --night-blue: #1a3a4a;
    --warm-orange: #ff7b4a;
    --golden: #ffd700;
    --pine-green: #2d5a3d;
    --snow-shadow: rgba(176, 196, 222, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #1a3a4a 0%, #2c5f7c 30%, #4a90b8 60%, #87ceeb 100%);
    min-height: 100vh;
    color: var(--snow-white);
    overflow-x: hidden;
}

/* Snowflakes Animation */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: white;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: fall linear infinite;
    opacity: 0.8;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* Start Screen */
.start-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mountain-art pre {
    font-family: monospace;
    font-size: 1.2rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--snow-white);
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--warm-orange), #ff9966);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 123, 74, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 123, 74, 0.6);
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    gap: 30px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.altitude-bar, .energy-bar {
    width: 150px;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.altitude-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pine-green), var(--golden));
    transition: width 0.5s ease;
    border-radius: 6px;
}

.energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffd93d);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.backpack-preview {
    background: rgba(139, 90, 43, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1.1rem;
}

.backpack-preview:hover {
    transform: scale(1.05);
}

/* Scene */
.scene-container {
    position: relative;
    height: 350px;
    background: linear-gradient(180deg, 
        rgba(26, 58, 74, 0.8) 0%, 
        rgba(44, 95, 124, 0.6) 40%,
        rgba(74, 144, 184, 0.4) 70%,
        rgba(255, 255, 255, 0.3) 100%
    );
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.scene {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    position: relative;
}

.scene-elements {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 20px;
    font-size: 2rem;
}

.climber {
    position: absolute;
    font-size: 2.5rem;
    transition: all 0.5s ease;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
    z-index: 10;
}

/* Event Panel */
.event-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: var(--night-blue);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.event-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.event-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--deep-blue);
}

.event-panel p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.event-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.event-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-collect {
    background: linear-gradient(135deg, var(--pine-green), #4a8c5e);
    color: white;
}

.btn-continue {
    background: linear-gradient(135deg, var(--mountain-blue), var(--deep-blue));
    color: white;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-climb {
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    flex: 1;
    max-width: 200px;
}

.btn-rest {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-explore {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
    border: 3px solid #D2691E;
}

.backpack-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.backpack-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.backpack-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 2rem;
}

.backpack-item.empty {
    opacity: 0.3;
}

.backpack-item span {
    display: block;
    font-size: 0.7rem;
    margin-top: 5px;
}

.wildlife-section h3 {
    margin-bottom: 10px;
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 15px;
}

.wildlife-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wildlife-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 10px;
    font-size: 1.5rem;
    text-align: center;
    min-width: 60px;
}

.wildlife-item span {
    display: block;
    font-size: 0.6rem;
}

.btn-close {
    width: 100%;
    margin-top: 15px;
    background: linear-gradient(135deg, #654321, #8B4513);
    color: white;
}

/* Summit Screen */
.summit-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summit-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--golden);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.summit-view {
    margin-bottom: 30px;
}

.panorama {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

.summit-altitude {
    font-size: 1.2rem;
    opacity: 0.9;
}

.soup-section h3 {
    margin-bottom: 20px;
}

.soup-pot {
    position: relative;
    margin-bottom: 20px;
}

.pot {
    font-size: 5rem;
}

.steam {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: steam 1s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes steam {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
    50% { transform: translateX(-50%) translateY(-10px); opacity: 0.3; }
}

.soup-ingredients {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.soup-ingredient {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1.5rem;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.btn-cook {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    font-size: 1.2rem;
    padding: 20px 40px;
}

.soup-result {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    border: 2px solid var(--golden);
}

.soup-result h3 {
    color: var(--golden);
    margin-bottom: 10px;
}

.soup-result .soup-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.soup-result .soup-description {
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 15px;
}

.soup-rating-stars {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Final Screen */
.final-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.final-content h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--golden);
}

.achievement-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.achievement {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.achievement-icon {
    font-size: 2rem;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .altitude-bar, .energy-bar {
        width: 100px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn-climb {
        max-width: none;
    }
    
    .scene-container {
        height: 280px;
    }
    
    .backpack-items {
        grid-template-columns: repeat(2, 1fr);
    }
}
