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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

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

.event-log {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 12px 20px;
    margin: 15px 0;
    max-height: 80px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
}

.event-message {
    padding: 4px 0;
    font-size: 0.95em;
    color: #333;
    animation: slideIn 0.3s ease-out;
}

.event-message.important {
    font-weight: bold;
    color: #ee0979;
}

.event-message.positive {
    color: #11998e;
    font-weight: bold;
}

.event-message.warning {
    color: #ff6a00;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.game-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 100%);
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    max-height: 50vh;
    height: auto;
    display: block;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
    align-items: center;
}

.migration-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.migration-controls-wrapper label {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.migration-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.migration-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #667eea;
}

.btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-action {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-special {
    background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
}

.btn-direction {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 10px 20px;
    font-size: 1.1em;
}

.btn-direction:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.btn-direction.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
}

.btn-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

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

.info-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.info-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 15px 25px;
    text-align: center;
    min-width: 180px;
}

.info-box h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-box div {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.instructions {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
}

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

.instructions li {
    padding: 8px 0;
    color: #555;
    font-size: 1.05em;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        font-size: 1em;
    }
    
    #gameCanvas {
        width: 100% !important;
        height: auto !important;
        max-height: 40vh !important;
    }
    
    .info-panel {
        gap: 10px;
    }
    
    .info-box {
        min-width: 140px;
        padding: 10px 15px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
}

@media (max-height: 800px) {
    #gameCanvas {
        max-height: 35vh !important;
    }
    
    .container.fullscreen #gameCanvas {
        max-height: 35vh !important;
    }
    
    .event-log {
        max-height: 60px;
    }
}

/* Fullscreen mode */
.container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    padding: 10px;
    z-index: 9999;
    overflow-y: auto;
}

.container.fullscreen #gameCanvas {
    max-height: 40vh;
}

.container.fullscreen .instructions {
    display: none; /* Hide instructions in fullscreen for more space */
}

.container.fullscreen .info-panel {
    flex-wrap: wrap;
    gap: 10px;
}

.container.fullscreen .info-box {
    min-width: 120px;
    padding: 10px 15px;
}
