/* Main Game Styles */

:root {
    --primary-color: #1a472a;
    --secondary-color: #2d7a4a;
    --accent-color: #ffd700;
    --text-color: #ffffff;
    --bg-dark: #0a1f15;
    --bg-light: #e8f5e9;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a1a1a;
    }
}

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

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a1f15 0%, #1a472a 100%);
}

#game-canvas {
    display: block;
    background: linear-gradient(180deg, #87ceeb 0%, #90ee90 50%, #228b22 100%);
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* HUD Overlay */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

.hud-section {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px 16px;
    pointer-events: auto;
    font-size: 14px;
}

.player-info {
    align-self: flex-start;
    min-width: 250px;
}

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

.stat-label {
    color: var(--accent-color);
    font-weight: bold;
}

.stat-value {
    color: var(--text-color);
    margin-left: 8px;
}

.game-info {
    align-self: center;
    text-align: center;
}

.controls {
    align-self: flex-end;
    text-align: right;
    font-size: 12px;
    max-width: 250px;
}

.control-help p {
    margin: 4px 0;
}

.control-help strong {
    color: var(--accent-color);
}

/* Notification */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px 30px;
    font-size: 18px;
    color: var(--text-color);
    pointer-events: auto;
    z-index: 200;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.notification.warning {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.notification.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.notification.hidden {
    display: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-content {
    text-align: center;
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen p {
    font-size: 18px;
    color: var(--text-color);
}

.loading-screen.hidden {
    display: none;
}

/* Menu Screen */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0a1f15 0%, #1a472a 100%);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    border: 2px solid var(--accent-color);
}

.menu-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.menu-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--text-color);
}

.menu-info {
    text-align: left;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.menu-info h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.menu-info ul {
    list-style: none;
    padding: 0;
}

.menu-info li {
    margin: 8px 0;
    font-size: 14px;
}

.menu-footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--secondary-color);
}

.menu-screen.hidden {
    display: none;
}

/* Game Over Screen */
.gameover-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gameover-content {
    text-align: center;
    background: var(--primary-color);
    padding: 40px;
    border-radius: 16px;
    border: 2px solid var(--accent-color);
    max-width: 400px;
}

.gameover-content h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--accent-color);
}

#session-stats {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: left;
}

#session-stats p {
    margin: 10px 0;
    font-size: 16px;
}

#session-stats strong {
    color: var(--accent-color);
}

.gameover-screen.hidden {
    display: none;
}

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

.btn-primary {
    background: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}
