/* ===================== */
/* 1. GENERAL            */
/* ===================== */
body {
    background-color: #f5e6d3;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #4b3b2a;
    padding-top: 64px;
}

h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #8b5a2b;
    text-shadow: 2px 2px #f0c27b;
}

/* ===================== */
/* 2. MENÚ FIJO Y RESPONSIVE */
/* ===================== */
#mainMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background: linear-gradient(145deg, #e6a65c, #f0c27b);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0;
}

#menuLinks {
    display: flex;
    gap: 32px;
    align-items: center;
}

#mainMenu a, .menu-link {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-family: 'Press Start 2P', monospace;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    display: block;
}

#mainMenu a:hover, .menu-link:hover {
    background: #8b5a2b;
    color: #fff;
}

#menuToggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    margin-right: 16px;
    cursor: pointer;
}

/* Menú desplegable de aldeanos */
.menu-dropdown {
    position: relative;
    display: inline-block;
    align-items: center;
}

#aldeanosLinks {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff3e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 0 0 12px 12px;
    min-width: 240px;
    z-index: 1001;
    display: none;
    padding: 8px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* SIEMPRE 3 columnas */
    gap: 4px 0;
    max-height: 60vh; /* Limita la altura y permite scroll si hay muchos aldeanos */
    overflow-y: auto;
}

#aldeanosLinks a {
    color: #8b5a2b;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 14px;
    border-bottom: none;
    display: block;
    text-align: left;
    border-radius: 6px;
}

#aldeanosLinks a:hover {
    background: #8b5a2b;
    color: #fff;
}

/* ===================== */
/* 3. TABLAS PRINCIPALES */
/* ===================== */
table,
.recipes-table {
    width: 100%;
    max-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

th, .recipes-table th {
    background: linear-gradient(145deg, #e6a65c, #f0c27b);
    color: #fff;
    font-size: 14px;
    padding: 15px 20px;
    text-align: center;
    text-shadow: 1px 1px #8b5a2b;
}

td, .recipes-table td {
    background-color: #fff3e6;
    border-bottom: 1px solid #e0c097;
    padding: 15px 20px;
    text-align: center;
    vertical-align: middle;
}

tbody tr:nth-child(even) td,
.recipes-table tbody tr:nth-child(even) td {
    background-color: #fff0d9;
}

/* ===================== */
/* 4. IMÁGENES EN TABLAS */
/* ===================== */
td img, .recipes-table td img {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 8px;
    transition: transform 0.2s;
}

td img:hover, .recipes-table td img:hover {
    transform: scale(1.1);
}

/* ===================== */
/* 5. CORAZONES Y REGALOS */
/* ===================== */
.hearts span {
    color: #222;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    margin: 2px;
    transition: transform 0.2s, color 0.2s;
}

.hearts span.done {
    color: #ff4b5c;
    text-shadow: 1px 1px #b34047;
}

.hearts span:hover {
    transform: scale(1.3);
}

.check {
    width: 25px;
    height: 25px;
    border: 2px solid #d1a06a;
    display: inline-block;
    background-color: #fff8dc;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s, transform 0.2s;
}

.check.done {
    background-color: #4caf50;
}

.check:hover {
    transform: scale(1.2);
}

/* ===================== */
/* 6. BOTONES            */
/* ===================== */
button, a.button {
    background: linear-gradient(145deg, #e6a65c, #f0c27b);
    border: none;
    padding: 12px 25px;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: background 0.3s, transform 0.2s;
    margin-top: 25px;
    color: #4b3b2a;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
}

button:hover, a.button:hover {
    background: linear-gradient(145deg, #f0c27b, #ffdd9a);
    transform: translateY(-2px);
}

.buttons-row {
    display: flex;
    gap: 24px;
    margin-top: 25px;
}

.buttons-row button {
    margin-top: 0;
}

/* ===================== */
/* 7. RECETAS            */
/* ===================== */
#recipesSection h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    color: #8b5a2b;
    text-shadow: 2px 2px #f0c27b;
    margin-bottom: 18px;
    margin-top: 30px;
    text-align: center;
}

/* ===================== */
/* 8. CALENDARIO         */
/* ===================== */
.calendario-mes {
    width: 100%;
    max-width: 800px;
    min-width: 100%;
    margin-left: 0;
    margin-right: 0;
    table-layout: fixed;
}

.calendario-mes td {
    border: 1px solid #bbb;
    width: 14.2%;
    height: 80px;
    vertical-align: top;
    padding: 4px;
    background: #f9f9f9;
    position: relative;
}

.calendario-mes th {
    background: linear-gradient(145deg, #e6a65c, #f0c27b);
    color: #fff;
    font-size: 14px;
    text-align: center;
    text-shadow: 1px 1px #8b5a2b;
    height: 32px;
    padding: 6px 0;
}

.festival-extra {
    max-width: 18px;
    max-height: 18px;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    margin-right: 2px;
    vertical-align: middle;
}

.evento {
    font-size: 0.95em;
    margin-top: 4px;
    display: block;
    color: #1565c0;
    text-decoration: none;
}

.festival {
    color: #d84315;
    font-weight: bold;
}

.resaltado {
    background-color: #ffe082;
}

/* ===================== */
/* 9. FOOTER             */
/* ===================== */
#mainFooter {
    width: 100vw;
    background: linear-gradient(145deg, #e6a65c, #f0c27b);
    color: #fff;
    text-align: center;
    padding: 12px 0 12px 0;
    font-size: 14px;
    margin-top: 36px;
    border-top: 2px solid #8b5a2b;
}

#mainFooter a {
    color: #8b5a2b;
    text-decoration: underline;
    font-weight: bold;
}

/* ===================== */
/* 10. RESPONSIVE        */
/* ===================== */
@media (max-width: 600px) {
    tbody#villagersTable,
    tbody#villagersTable tr,
    tbody#villagersTable td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    tbody#villagersTable tr {
        margin-bottom: 18px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-radius: 10px;
        background: #fff3e6;
        padding: 10px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    tbody#villagersTable td {
        text-align: center;
        padding: 8px 12px;
        border-bottom: none;
        position: relative;
        width: 100%;
    }
    thead {
        display: none;
    }
    .hearts span {
        color: #222 !important;
        background: none;
        text-shadow: none;
    }
    .hearts span.done {
        color: #ff4b5c !important;
        text-shadow: 1px 1px #b34047;
    }
    .calendario-mes-wrapper {
        padding-left: 8px;
        padding-right: 8px;
        width: 100vw;
        box-sizing: border-box;
    }
    .calendario-mes {
        width: 100%;
        margin: 0;
        table-layout: fixed;
    }
    .calendario-mes td, .calendario-mes th {
        width: 14.28%;
        height: 48px;
        font-size: 12px;
        padding: 2px;
    }
    #mainMenu {
        justify-content: flex-start;
        padding: 0 8px;
        height: 56px;
    }
    #menuToggle {
        display: block;
    }
    #menuLinks {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100vw;
        width: 90vw; 
        max-width: 340px;
        background: #fff3e6;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-radius: 0 0 12px 12px;
        z-index: 999;
    }
    #menuLinks.show {
        display: flex;
    }
    #mainMenu a, .menu-link {
        color: #8b5a2b;
        background: none;
        font-size: 16px;
        padding: 16px;
        border-radius: 0;
        border-bottom: 1px solid #e0c097;
    }
    #mainMenu a:last-child, .menu-link:last-child {
        border-bottom: none;
    }
    #mainMenu a:hover, .menu-link:hover {
        background: #8b5a2b;
        color: #fff;
    }
   #aldeanosLinks {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
    }
  
}
