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

:root {
    --primary: #4A90E2;
    --success: #2ECC71;
    --error: #E74C3C;
    --bg-color: #F0F8FF;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#game-container {
    width: 100%;
    max-width: 900px;
    background: transparent;
}

/* Manejo de Pantallas */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s;
}

.screen.active {
    display: flex;
}

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

/* Pantalla de Inicio y Fin */
#start-screen, #end-screen {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

h1 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

input[type="text"] {
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
    margin-top: 10px;
}

button:hover {
    background: #357ABD;
    transform: translateY(-2px);
}

.error-msg {
    color: var(--error);
    height: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.scores-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s;
}

.scores-link:hover {
    background: var(--primary);
    color: white;
}

/* Interfaz de Juego */
.game-header {
    text-align: center;
    background: white;
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    width: 100%;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #eee;
}

.weather-prompt {
    font-size: 28px;
    color: #333;
    margin: 0 0 10px 0;
}

.game-board {
    display: flex;
    gap: 30px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

/* Armario */
.wardrobe {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    flex: 1;
    align-content: start;
}

.clothing-item {
    background: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    font-size: 50px;
    cursor: grab;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    user-select: none;
    position: relative;
}

.clothing-item .item-name {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    font-size: 12px;
    color: #666;
    font-weight: bold;
    pointer-events: none;
}

.clothing-item:active { cursor: grabbing; }
.clothing-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: white;
    box-shadow: 0 5px 10px rgba(0,0,0,0.05);
}
.clothing-item.dragging {
    opacity: 0.5;
    border: 2px solid var(--primary);
}

/* Personaje */
.character-zone {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px dashed transparent;
    transition: all 0.3s;
    position: relative;
}

.character-zone.drag-over {
    border-color: var(--primary);
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.avatar-container {
    position: relative;
    width: 160px;
    height: 240px;
    margin-top: 20px;
}

.character-avatar {
    font-size: 160px;
    line-height: 1;
    text-align: center;
    user-select: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* Posiciones precisas del cuerpo sobre el emoji 🧍 */
#worn-clothes {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

.body-slot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Ajuste de posiciones relativas al contenedor de 240px de alto */
#slot-head { top: -10px; font-size: 50px; z-index: 5; } /* Gorro */
#slot-torso { top: 60px; font-size: 70px; z-index: 4; } /* Polera / Chaqueta */
#slot-hand { top: 75px; left: 85%; font-size: 45px; z-index: 6; } /* Paraguas / Guantes */
#slot-legs { top: 110px; font-size: 55px; z-index: 3; } /* Shorts */
#slot-feet { top: 160px; font-size: 45px; z-index: 4; } /* Botas */

.drop-instruction {
    font-size: 18px;
    color: #666;
    font-weight: bold;
    pointer-events: none;
    position: absolute;
    top: 15px;
}

/* Feedback */
.feedback {
    margin-top: 25px;
    font-size: 24px;
    font-weight: bold;
    height: 35px;
    text-align: center;
    transition: opacity 0.3s;
}
.feedback.success { color: var(--success); }
.feedback.error { color: var(--error); }
.feedback.info { color: var(--primary); }

.final-score {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .game-board { flex-direction: column; align-items: center; }
    .wardrobe { width: 100%; grid-template-columns: repeat(4, 1fr); }
    .character-zone { width: 100%; height: 350px; }
    .clothing-item { font-size: 40px; padding: 15px 5px; }
}
@media (max-width: 480px) {
    .wardrobe { grid-template-columns: repeat(3, 1fr); }
}
