* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #F0E68C 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2c3e50;
}

#game-container {
    width: 100%;
    max-width: 800px;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Screen Management */
.screen {
    display: none;
    padding: 20px;
    height: 100%;
    min-height: 600px;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Screen */
.farm-header {
    text-align: center;
    margin-bottom: 30px;
}

.farm-header h1 {
    font-size: 2.5em;
    color: #8B4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.farm-header p {
    font-size: 1.2em;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

.characters-preview {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.character-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.character-card:hover {
    transform: translateY(-5px);
}

.character-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.character-card h3 {
    color: #8B4513;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.character-card p {
    color: #666;
    font-size: 0.9em;
}

/* Buttons */
.main-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.main-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.9em;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.secondary-btn:hover {
    background: #5a6268;
}

/* Role Assignment Screen */
.assignment-content, .role-content {
    text-align: center;
    padding: 40px 20px;
}

.assignment-content h2, .role-content h2 {
    color: #8B4513;
    margin-bottom: 20px;
    font-size: 2em;
}

.player-assignment h3 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.player-assignment p {
    font-size: 1.1em;
    margin: 10px 0;
    color: #555;
}

/* Role Display */
.role-icon {
    font-size: 6em;
    margin: 20px 0;
}

#role-title {
    color: #8B4513;
    font-size: 2.2em;
    margin-bottom: 15px;
}

#role-description {
    font-size: 1.2em;
    color: #555;
    max-width: 500px;
    margin: 0 auto 30px;
    line-height: 1.5;
}

/* Night Screen */
.night-content {
    text-align: center;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin: 20px;
}

.moon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #fff; }
    to { text-shadow: 0 0 20px #fff, 0 0 30px #fff; }
}

.night-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.night-content p {
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* Day Screen */
.day-content {
    text-align: center;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin: 20px;
}

.sun {
    font-size: 4em;
    margin-bottom: 20px;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.day-content h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.player-btn {
    background: white;
    color: #2c3e50;
    border: 3px solid #3498db;
    padding: 15px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: bold;
}

.player-btn:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.player-btn.selected {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
}

.player-btn.eliminated {
    background: #95a5a6;
    border-color: #7f8c8d;
    color: #2c3e50;
    opacity: 0.6;
    cursor: not-allowed;
}

.player-btn.eliminated:hover {
    transform: none;
    background: #95a5a6;
    color: #2c3e50;
}

/* Timer */
#timer {
    font-size: 3em;
    font-weight: bold;
    color: #e74c3c;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Eliminated Player Display */
.eliminated {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.eliminated h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.eliminated .player-icon {
    font-size: 3em;
    margin: 10px 0;
}

/* Game End Screen */
.end-content {
    text-align: center;
    padding: 40px 20px;
}

#winner-icon {
    font-size: 6em;
    margin: 20px 0;
}

#winner-title {
    font-size: 2.5em;
    color: #8B4513;
    margin-bottom: 20px;
}

#winner-description {
    font-size: 1.3em;
    color: #555;
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Audio Controls */
#audio-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.audio-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.5em;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.audio-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.margin-top {
    margin-top: 20px;
}

/* Debug Info */
.debug {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.8em;
    max-width: 300px;
}

.debug h4 {
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #game-container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .farm-header h1 {
        font-size: 2em;
    }
    
    .characters-preview {
        flex-direction: column;
        align-items: center;
    }
    
    .character-card {
        max-width: 300px;
    }
    
    .player-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .night-content, .day-content {
        margin: 10px;
        padding: 20px 15px;
    }
    
    #timer {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .farm-header h1 {
        font-size: 1.8em;
    }
    
    .main-btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    .player-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Special animations for game phases */
.phase-transition {
    animation: phaseTransition 1s ease-in-out;
}

@keyframes phaseTransition {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* Role-specific styling */
.role-werewolf {
    background: linear-gradient(135deg, #8B0000, #4B0000);
    color: white;
}

.role-dog {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.role-villager {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}
