/* SkiFree 90s - Retro Styling */
@import url('https://fonts.googleapis.com/css2?family=VT323:wght@400&display=swap');

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

body {
    font-family: 'VT323', monospace;
    font-size: 16px;
    background: #c0c0c0;
    color: #000;
    overflow: hidden;
    user-select: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Windows 95 Style Title Bar */
.title-bar {
    background: linear-gradient(90deg, #0054e3 0%, #1e3e79 100%);
    color: white;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-size: 14px;
    border-bottom: 1px solid #000040;
}

.title-bar-text {
    font-weight: bold;
    display: flex;
    align-items: center;
}

.title-bar-text::before {
    content: "🎿";
    margin-right: 8px;
    font-size: 16px;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-control {
    width: 24px;
    height: 18px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-bar-control:hover {
    background: #d4d0c8;
}

.title-bar-control:active {
    border: 1px inset #c0c0c0;
}

.title-bar-control.close {
    background: #ff6b6b;
    color: white;
}

.title-bar-control.close:hover {
    background: #ff5252;
}

/* Menu Bar */
.menu-bar {
    background: #c0c0c0;
    height: 25px;
    display: flex;
    border-bottom: 1px solid #808080;
    font-size: 14px;
}

.menu-item {
    padding: 4px 12px;
    cursor: pointer;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: #316ac5;
    color: white;
    border: 1px solid #0054e3;
}

/* Status Bar */
.status-bar {
    background: #c0c0c0;
    height: 25px;
    display: flex;
    align-items: center;
    border-bottom: 1px inset #c0c0c0;
    font-size: 14px;
    padding: 0 8px;
}

.status-item {
    padding: 0 12px;
    border-right: 1px solid #808080;
    font-weight: bold;
}

.status-item:last-child {
    border-right: none;
}

/* Main Game Container */
.game-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - 80px);
    background: #c0c0c0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Game Canvas */
#gameCanvas {
    background: linear-gradient(180deg, #87ceeb 0%, #ffffff 100%);
    border: 2px inset #c0c0c0;
    cursor: crosshair;
    image-rendering: pixelated;
}

/* Retro Windows */
.retro-window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    font-family: 'VT323', monospace;
}

.window-header {
    background: linear-gradient(90deg, #0054e3 0%, #1e3e79 100%);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #000040;
}

.window-content {
    padding: 20px;
    text-align: center;
}

/* Game UI Overlay */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background: rgba(192, 192, 192, 0.95);
}

.screen.active {
    display: flex;
}

/* Game Logo */
.game-logo {
    margin-bottom: 20px;
}

.logo-text {
    font-size: 48px;
    font-weight: bold;
    color: #0054e3;
    text-shadow: 2px 2px 0px #000040;
    letter-spacing: 4px;
}

.logo-subtitle {
    font-size: 20px;
    color: #666;
    margin-top: 5px;
}

/* Game Instructions */
.game-instructions {
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
}

.game-instructions h3 {
    color: #0054e3;
    margin-bottom: 10px;
    text-align: center;
    font-size: 18px;
}

.game-instructions p {
    margin: 5px 0;
    font-size: 16px;
    line-height: 1.4;
}

/* Retro Buttons */
.retro-button {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    margin: 5px;
    min-width: 120px;
}

.retro-button:hover {
    background: #d4d0c8;
}

.retro-button:active {
    border: 2px inset #c0c0c0;
}

.start-btn {
    background: #4CAF50;
    border: 2px outset #4CAF50;
    color: white;
    font-weight: bold;
    font-size: 18px;
    padding: 12px 24px;
}

.start-btn:hover {
    background: #45a049;
}

/* Game Over Screen */
.game-over-stats {
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
    padding: 20px;
    margin: 20px 0;
}

.game-over-stats h2 {
    color: #0054e3;
    font-size: 24px;
    margin-bottom: 10px;
}

.game-over-stats p {
    font-size: 18px;
    margin: 5px 0;
}

.high-score-entry {
    background: #ffffcc;
    border: 2px solid #ffcc00;
    padding: 15px;
    margin: 20px 0;
}

.high-score-entry h3 {
    color: #cc6600;
    margin-bottom: 10px;
}

.high-score-entry input {
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 8px;
    border: 1px inset #c0c0c0;
    margin: 10px;
    text-align: center;
    background: white;
}

/* High Scores List */
.high-scores-list {
    background: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    font-family: monospace;
}

.high-score-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dotted #ccc;
    font-size: 18px;
}

.high-score-item:last-child {
    border-bottom: none;
}

.score-rank {
    color: #0054e3;
    font-weight: bold;
}

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

.score-points {
    color: #cc6600;
    font-weight: bold;
}

/* Yeti Warning */
.yeti-warning {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0000;
    color: white;
    padding: 10px 20px;
    border: 2px solid #cc0000;
    font-size: 18px;
    font-weight: bold;
    z-index: 200;
    animation: flashWarning 0.5s infinite alternate;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
}

@keyframes flashWarning {
    0% { background: #ff0000; }
    100% { background: #cc0000; }
}

/* Power-ups Display */
.powerups-display {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 150;
}

.powerup-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 3px;
    animation: powerupFade 3s ease-out forwards;
}

@keyframes powerupFade {
    0% { opacity: 1; transform: scale(1.2); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Sound Controls */
.sound-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 150;
}

.sound-btn {
    width: 40px;
    height: 40px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn:hover {
    background: #d4d0c8;
}

.sound-btn:active {
    border: 2px inset #c0c0c0;
}

.sound-btn.muted {
    background: #808080;
    color: #404040;
}

/* Retro Loading Screen */
.loading-screen {
    background: #000080;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.loading-bar {
    width: 300px;
    height: 20px;
    border: 2px solid white;
    margin: 20px 0;
    position: relative;
    background: #000040;
}

.loading-progress {
    height: 100%;
    background: #00ff00;
    width: 0%;
    transition: width 0.5s;
}

/* Retro Dialog Boxes */
.dialog-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 20px;
    z-index: 300;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.dialog-icon {
    font-size: 32px;
    margin-right: 15px;
    float: left;
}

.dialog-text {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.dialog-buttons {
    text-align: right;
    clear: both;
}

/* Ski Trail Effects */
.ski-trail {
    position: absolute;
    width: 2px;
    height: 20px;
    background: rgba(100, 100, 100, 0.3);
    pointer-events: none;
    animation: trailFade 2s ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Snow Particle Effects */
.snow-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: snowFall 3s linear infinite;
}

@keyframes snowFall {
    0% { 
        transform: translateY(-10px);
        opacity: 1;
    }
    100% { 
        transform: translateY(610px);
        opacity: 0;
    }
}

/* Game Performance Stats */
.debug-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    z-index: 200;
    display: none;
}

.debug-info.show {
    display: block;
}

/* Mobile Responsive (for retro feel) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    #gameCanvas {
        width: 100vw;
        height: calc(100vh - 80px);
    }
    
    .retro-window {
        min-width: 90vw;
        max-width: 95vw;
    }
    
    .logo-text {
        font-size: 32px;
    }
    
    .game-instructions {
        font-size: 14px;
    }
    
    .sound-controls {
        bottom: 80px;
    }
}

/* Retro CRT Effect (Optional) */
.crt-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        );
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles (Retro Manual Style) */
@media print {
    body {
        background: white;
        color: black;
        font-family: 'Courier New', monospace;
    }
    
    .game-container,
    .title-bar,
    .menu-bar,
    .status-bar {
        display: none;
    }
    
    .game-instructions {
        display: block !important;
        border: 2px solid black;
        page-break-inside: avoid;
    }
}