/**
 * Warhammer Reservas - Estilos Públicos Finales
 * Versión 4.0 - Código completo, refactorizado e incluyendo todos los componentes
 */

/* ==========================================================================
   1. ESTILOS BASE Y CONTENEDORES PRINCIPALES (Móvil Primero)
   ========================================================================== */

.warhammer-multistep-form {
    max-width: 900px;
    margin: 2em auto;
    background: #fff;
    padding: 20px 15px;
    /* Padding ajustado para móvil */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-layout-container {
    display: flex;
    flex-direction: column;
    /* Apilado por defecto (Móvil) */
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s;
    text-align: center;
}

/* Restaurar alineación normal dentro del step para elementos de texto/input */
.form-step.active .zona-tabs-row,
.form-step.active .zona-panels-wrap,
.form-step.active .hours-grid,
.form-step.active .franja-btn-group,
.form-step.active .players-details-grid,
.form-step.active .form-group,
.form-step.active .selected-slot-info,
.form-step.active label {
    text-align: left;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.step-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em;
}

/* ==========================================================================
   2. STEPPER DE PASOS (Móvil Primero)
   ========================================================================== */

.form-stepper {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    width: 100%;
}

.form-stepper .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    color: #aaa;
    font-weight: 500;
    z-index: 1;
    flex: 1;
}

.form-stepper .step-label {
    display: none;
    /* Ocultamos el texto en móvil por defecto */
}

.form-stepper .step-icon {
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
}

/* Estado activo: icono y texto en morado y negrita */
.form-stepper .step.active {
    color: #9d45b4;
    font-weight: bold;
}

/* Línea inferior para el paso activo en MÓVIL */
.form-stepper .step.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    /* Distancia de la línea al icono */
    height: 3px;
    width: 60%;
    /* Ancho de la línea */
    background-color: #9d45b4;
    border-radius: 2px;
}

.form-stepper .step.active .step-icon {
    color: #9d45b4;
}

/* ==========================================================================
   3. CONTENIDO DE LOS PASOS DEL FORMULARIO (Móvil Primero)
   ========================================================================== */

.category-selection-grid,
.game-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.category-card,
.game-card {
    padding: 10px 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.category-card:hover,
.game-card:hover {
    border-color: #9d45b4;
}

.category-card.selected,
.game-card.selected {
    border-color: #9d45b4;
    background-color: #f9f2fc;
}

.category-card img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 6px;
    display: block;
}

.category-card span {
    font-weight: bold;
    font-size: 0.82em;
    display: block;
    line-height: 1.2;
}

.game-card h5 {
    font-weight: bold;
    margin: 0 0 5px 0;
}

.game-card p {
    margin: 0;
    font-size: 0.9em;
    color: #777;
}

.date-time-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#turnos-container,
.turnos-selection,
.turno-card {
    width: 100%;
    box-sizing: border-box;
}

.turnos-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.turno-card {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    transition: all 0.2s ease;
}

.turno-card:hover:not(.disabled) {
    border-color: #9d45b4;
}

.turno-card.selected {
    border-color: #9d45b4;
    background: #f9f2fc;
}

.turno-card.disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #eee;
}

.players-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.player-column {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
}

.player-column h4 {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.form-field input[type="text"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

.current-player-name {
    font-size: 1.1em;
    background: #f0f0f0;
    padding: 12px;
    border-radius: 5px;
    display: block;
}

.form-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    gap: 12px;
}

/* Si hay un botón anterior + siguiente, separar con space-between */
.form-navigation>*:not(:only-child):first-child {
    margin-right: auto;
}

.button-link-style {
    background: none;
    border: none;
    padding: 0;
    color: #9d45b4;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1em;
}

.button-primary-style {
    background-color: #9d45b4;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.button-primary-style:hover {
    background-color: #7b2e91;
    color: #ffffff;
}

/* ==========================================================================
   4. ESTILOS DEL CALENDARIO FLATPICKR
   ========================================================================== */

/* =============================================================
   CALENDARIO FLATPICKR — FORMULARIO DE RESERVAS
   Mobile-first: fluido y responsivo en cualquier pantalla.
   ============================================================= */

/* Contenedor wrapper: 100% del paso */
#calendario-inline {
    width: 100%;
    box-sizing: border-box;
}

/* Calendario inline: ocupa todo el ancho disponible */
.warhammer-multistep-form .flatpickr-calendar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0d0f0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(157, 69, 180, 0.1);
    padding: 12px 10px 16px;
    font-family: inherit;
}

/* Todos los contenedores internos: 100% y border-box */
.warhammer-multistep-form .flatpickr-innerContainer {
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.warhammer-multistep-form .flatpickr-rContainer {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* .flatpickr-days: flatpickr fija aquí 307.875px — hay que sobreescribirlo */
.warhammer-multistep-form .flatpickr-days {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Días de la semana */
.warhammer-multistep-form .flatpickr-weekdays {
    width: 100% !important;
    box-sizing: border-box !important;
}

.warhammer-multistep-form .flatpickr-weekdaycontainer {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr);
    width: 100% !important;
    box-sizing: border-box !important;
}

.warhammer-multistep-form .flatpickr-weekday {
    color: #9d45b4;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.04em;
    float: none !important; /* flatpickr usa float en algunas versiones */
}

/* Rejilla de días: grid sin gap para que quepan exactamente 7 columnas */
.warhammer-multistep-form .dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    box-sizing: border-box !important;
    padding: 0 !important;
}

/* Cabecera del mes */
.warhammer-multistep-form .flatpickr-months {
    padding: 0 4px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0e8f8;
}

.warhammer-multistep-form .flatpickr-current-month {
    font-weight: 700;
    font-size: 1.05em;
    color: #333;
    letter-spacing: 0.02em;
}

.warhammer-multistep-form .flatpickr-current-month .numInputWrapper input,
.warhammer-multistep-form .flatpickr-current-month select {
    color: #333 !important;
    background: transparent;
}

.warhammer-multistep-form .flatpickr-prev-month,
.warhammer-multistep-form .flatpickr-next-month {
    top: 0;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.18s;
}

.warhammer-multistep-form .flatpickr-prev-month:hover,
.warhammer-multistep-form .flatpickr-next-month:hover {
    background: #f3eafa;
}

.warhammer-multistep-form .flatpickr-prev-month svg,
.warhammer-multistep-form .flatpickr-next-month svg {
    width: 14px;
    height: 14px;
    fill: #9d45b4;
}

/* Celda de día: aspecto cuadrado mediante aspect-ratio */
.warhammer-multistep-form .flatpickr-day {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border: 1px solid transparent;
    color: #444;
    font-size: 0.88em;
    font-weight: 500;
    line-height: 1;
    margin: 0 !important;
    padding: 2px !important;
    box-sizing: border-box;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    float: none !important;
}

/* Estados de disponibilidad */
.warhammer-multistep-form .flatpickr-day.dia-free {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    border-color: #c8e6c9 !important;
}

.warhammer-multistep-form .flatpickr-day.dia-partial {
    background: #fff3e0 !important;
    color: #e65100 !important;
    border-color: #ffe0b2 !important;
}

.warhammer-multistep-form .flatpickr-day.dia-full {
    background: #ffebee !important;
    color: #b71c1c !important;
    border-color: #ffcdd2 !important;
}

.warhammer-multistep-form .flatpickr-day:not(.flatpickr-disabled):hover {
    background: #f3eafa !important;
    color: #7b2e91 !important;
}

.warhammer-multistep-form .flatpickr-day.today {
    border-color: #9d45b4 !important;
    color: #9d45b4 !important;
    font-weight: 700;
}

.warhammer-multistep-form .flatpickr-day.selected,
.warhammer-multistep-form .flatpickr-day.selected:hover {
    background: linear-gradient(135deg, #9d45b4, #7b2e91) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(157, 69, 180, 0.35);
}

.warhammer-multistep-form .flatpickr-day.flatpickr-disabled,
.warhammer-multistep-form .flatpickr-day.flatpickr-disabled:hover {
    background: #fafafa !important;
    color: #ccc !important;
    cursor: not-allowed;
    border-color: transparent !important;
    text-decoration: none;
}

/* Días del mes anterior/siguiente */
.warhammer-multistep-form .flatpickr-day.prevMonthDay,
.warhammer-multistep-form .flatpickr-day.nextMonthDay {
    color: #ccc !important;
}

/* Reducción de fuente en pantallas muy pequeñas */
@media (max-width: 380px) {
    .warhammer-multistep-form .flatpickr-day {
        font-size: 0.72em;
    }
    .warhammer-multistep-form .flatpickr-weekday {
        font-size: 0.6em;
        letter-spacing: 0;
    }
}


/* ==========================================================================
   5. LISTADO DE PARTIDAS (SHORTCODE)
   ========================================================================== */

.reservas-day-group {
    margin-bottom: 40px;
}

.reservas-day-group h2 {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.reservas-day-group h2 .dashicons {
    font-size: 28px;
    color: #555;
}

/* --- Cabecera de día --- */
.wh-day-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 8px;
    border-bottom: 2px solid #eee;
    margin-bottom: 10px;
}

.wh-day-icon {
    font-size: 1.2em;
}

.wh-day-label {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    text-transform: capitalize;
}

.wh-day-count {
    margin-left: auto;
    font-size: 0.8em;
    color: #999;
    background: #f4f4f4;
    border-radius: 12px;
    padding: 2px 10px;
}

/* --- Card de partida --- */
.wh-match-card {
    background: #fff;
    border: 1px solid #eee;
    border-left: 5px solid #aaa;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}

.wh-match-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Fila superior: hora, mesa, cat, puntos */
.wh-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 10px;
    font-size: 0.82em;
}

.wh-card-time {
    font-weight: 700;
    color: #333;
}

.wh-card-table {
    color: #7b2e91;
    background: #f3eaf7;
    border-radius: 4px;
    padding: 2px 7px;
}

.wh-card-cat {
    color: #555;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 2px 7px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.wh-card-pts {
    color: #c0392b;
    font-weight: 600;
}

/* Jugadores */
.wh-card-players {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wh-player-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.wh-player-right {
    text-align: center;
}

/* Avatar ejército */
.wh-army-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    border: 2px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.wh-army-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wh-army-placeholder {
    font-size: 1.4em;
}

.wh-player {
    font-weight: 700;
    color: #222;
    text-decoration: none;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

a.wh-player:hover {
    color: #9d45b4;
    text-decoration: underline;
}

.wh-army {
    font-size: 0.75em;
    color: #888;
    font-style: italic;
}

/* Badge de convidat */
.wh-guest-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 600;
    color: #7b2e91;
    background: #f3eaf7;
    border: 1px solid #d9b8e8;
    border-radius: 10px;
    padding: 1px 6px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.5;
}

/* Fila de convidats extres (Roll / altres categories) */
.wh-card-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #eee;
    font-size: 0.82em;
    color: #555;
}

.wh-extra-player {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #333;
}

/* Centro VS */
.wh-vs-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding: 0 6px;
    gap: 2px;
}

.wh-game-name {
    font-size: 0.72em;
    color: #aaa;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    /* allow wrapping */
    word-break: break-word;
    max-width: 100px;
    line-height: 1.2;
}

.wh-vs {
    font-size: 1.1em;
    font-weight: 900;
    letter-spacing: 0.05em;
}

/* Badges de la fila superior */
.wh-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.78em;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.6;
}

/* Universo: borde de color + texto de color */
.wh-badge-universe {
    background: transparent;
    border: 1px solid currentColor;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Juego: fondo gris suave, texto oscuro */
.wh-badge-game {
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ddd;
}

/* Puntos: fondo naranja suave, texto rojo */
.wh-badge-pts {
    background: #fff4e5;
    color: #c0392b;
    border: 1px solid #f5c6a0;
}

/* Pintura */
.wh-pintura {
    gap: 12px;
    font-size: 0.9em;
}

.wh-pintura .wh-player {
    font-size: 0.95em;
}

.wh-pintura .wh-game-name {
    color: #9d45b4;
    font-size: 0.85em;
    max-width: none;
}

/* Mobile */
@media (max-width: 540px) {
    .wh-army-avatar {
        width: 40px;
        height: 40px;
    }

    .wh-player-block {
        align-items: center;
    }

    .wh-vs {
        font-size: 0.95em;
    }

    .wh-game-name {
        max-width: 70px;
        font-size: 0.68em;
    }
}


/* ==========================================================================
   6. PÁGINA DE RESUMEN DE RESERVA
   ========================================================================== */

.reserva-summary-container {
    max-width: 700px;
    margin: 2em auto;
    text-align: center;
    background: #fff;
    padding: 30px 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.summary-title {
    font-size: 2em;
    margin-bottom: 10px;
    color: #4CAF50;
}

.summary-subtitle {
    font-size: 1.1em;
    color: #777;
    margin-bottom: 30px;
}

.reserva-details {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.reserva-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reserva-details li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.reserva-details li:last-child {
    border-bottom: none;
}

.reserva-details li strong {
    color: #333;
    margin-bottom: 5px;
}

.reserva-details li span {
    color: #555;
    text-align: left;
}

.summary-footer {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 30px;
}

.reserva-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.reserva-actions .button {
    text-decoration: none;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.button-secondary-style {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}

.button-secondary-style:hover {
    background-color: #e0e0e0;
    color: #333;
}

.button-cancel-style {
    background-color: transparent;
    color: #f44336;
    border: 1px solid #f44336;
}

.button-cancel-style:hover {
    background-color: #fbe9e7;
    color: #d32f2f;
    border-color: #d32f2f;
}


/* ==========================================================================
   6. VISTA DE ESCRITORIO (min-width: 768px)
   ========================================================================== */

@media (min-width: 768px) {
    .warhammer-multistep-form {
        padding: 30px 40px;
    }

    /* --- Layout principal: columna única en todos los tamaños --- */
    .form-layout-container {
        flex-direction: column;
        /* stepper arriba, form debajo */
        gap: 20px;
        align-items: center;
    }

    #warhammer-reserva-form {
        width: 100%;
        max-width: 100%;
        border-left: none;
        padding-left: 0;
    }

    /* --- Stepper horizontal centrado en desktop --- */
    .form-stepper {
        flex-direction: row;
        /* pasos en fila */
        justify-content: center;
        align-items: center;
        gap: 0;
        width: 100%;
        max-width: 600px;
        margin: 0 auto 10px;
        flex-basis: auto;
        flex-shrink: 1;
        padding-top: 0;
    }

    .form-stepper .step {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .form-stepper .step-label {
        display: block;
    }

    .form-stepper .step.active .step-label {
        color: #333;
        border-bottom: 2px solid #9d45b4;
        padding-bottom: 2px;
    }

    .form-stepper .step.active::after {
        display: block;
        /* línea conectora entre pasos, visible en desktop */
    }

    /* --- Contenido de los pasos en Escritorio --- */
    .category-selection-grid,
    .game-selection-grid,
    .players-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-card img {
        width: 70px;
        height: 70px;
    }

    .category-card span {
        font-size: 0.88em;
    }

    .franja-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .franja-btn {
        padding: 16px 10px;
        font-size: 1.05em;
    }

    .date-time-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 30px;
    }

    /* Escritorio: calendario con ancho natural y centrado */
    #calendario-inline {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }

    /* El calendario en sí: ancho justo al contenido, centrado */
    .warhammer-multistep-form .flatpickr-calendar {
        width: fit-content !important;
        max-width: fit-content !important;
        margin: 0 auto !important;
    }

    /* Árbol interno: todos al mismo ancho (7 días × 44px = 308px nativo) */
    .warhammer-multistep-form .flatpickr-rContainer {
        width: 308px;
    }

    .warhammer-multistep-form .flatpickr-weekdays,
    .warhammer-multistep-form .flatpickr-days {
        width: 308px;
    }

    .warhammer-multistep-form .flatpickr-weekdaycontainer,
    .warhammer-multistep-form .dayContainer {
        display: flex !important;
        flex-wrap: wrap;
        width: 308px !important;
        min-width: 308px !important;
        max-width: 308px !important;
        gap: 0;
    }

    .warhammer-multistep-form .flatpickr-weekday {
        flex: 1;
    }

    /* Celdas: tamaño natural de flatpickr */
    .warhammer-multistep-form .flatpickr-day {
        width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        aspect-ratio: unset;
        line-height: 44px !important;
        margin: 0 !important;
    }

    .players-details-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* --- Listado de Partidas en Escritorio --- */
    .match-card {
        padding: 20px;
    }

    .player-info {
        flex-direction: row;
        text-align: left;
    }

    .player-info.opponent .player-details {
        align-items: flex-end;
    }

    .player-details {
        order: initial;
    }

    .army-icon-wrapper {
        order: initial;
    }

    .player-name {
        font-size: 1.2em;
    }

    .army-icon {
        width: 60px;
        height: 60px;
    }


    /* --- Resumen de Reserva en Escritorio --- */
    .reserva-summary-container {
        padding: 40px 50px;
    }

    .summary-title {
        font-size: 2.5em;
    }

    .reserva-details li {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .reserva-details li strong {
        margin-bottom: 0;
    }

    .reserva-details li span {
        text-align: right;
    }

    .reserva-actions {
        flex-direction: row;
    }

    .reserva-actions .button {
        width: auto;
        flex-grow: 0;
    }
}

/* ==========================================================================
   7. FORM V2.0 — PASO 2: SELECTOR DE MESAS Y HORAS
   ========================================================================== */

.step-subtitle {
    text-align: center;
    color: #777;
    margin: -15px 0 20px;
    font-size: 0.95em;
}

.date-selected-hint {
    text-align: center;
    color: #9d45b4;
    margin-top: 20px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.95em;
    background: #f3eafa;
    border-radius: 8px;
    padding: 10px 16px;
    display: inline-block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   FRANJAS HORARIAS
   ========================================================================== */
.franja-selector {
    margin-bottom: 20px;
}

.franja-label {
    font-size: 0.95em;
    font-weight: 700;
    color: #5a2d82;
    margin: 0 0 12px;
    text-align: center;
}

.franja-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.franja-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1em;
    color: #444;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    gap: 2px;
    font-weight: 600;
    line-height: 1.3;
}

.franja-btn span {
    font-size: 0.95em;
}

.franja-btn small {
    font-size: 0.7em;
    font-weight: 400;
    color: #888;
}

.franja-btn:hover {
    border-color: #9d45b4;
    background: #f9f2fc;
}

.franja-btn.active {
    border-color: #9d45b4;
    background: linear-gradient(135deg, #9d45b4 0%, #7b2e91 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(100, 30, 130, 0.25);
}

.franja-btn.active small {
    color: rgba(255, 255, 255, 0.75);
}

/* "Ver todas las horas" button — dentro de cada mesa */
.mesa-ver-todas-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 7px 12px;
    font-size: 0.8em;
    font-weight: 600;
    color: #7b2e91;
    background: #fdf7ff;
    border: 1.5px dashed #c9a0dc;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background 0.18s, border-color 0.18s;
}

.mesa-ver-todas-btn:hover {
    background: #f3eaf7;
    border-color: #9d45b4;
}

/* ==========================================================================
   ZONA TABS (mismo concepto que los botones de franja)
   ========================================================================== */
.zona-tabs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.zona-tab-btn {
    padding: 9px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.zona-tab-btn:hover {
    border-color: #9d45b4;
    color: #7b2e91;
}

.zona-tab-btn.active {
    border-color: #9d45b4;
    background: linear-gradient(135deg, #9d45b4 0%, #7b2e91 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(100, 30, 130, 0.2);
}

/* Lista de mesas */
.mesas-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tarjeta de mesa */
.mesa-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.mesa-card.mesa-selected {
    border-color: #9d45b4;
    background: #fdf7ff;
}

.mesa-nombre {
    margin: 0 0 10px;
    font-size: 0.95em;
    font-weight: bold;
    color: #444;
}

/* Grilla de horas */
.hours-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hour-pill {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f0fdf0;
    color: #2d6a2d;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1;
}

.hour-pill:hover:not(:disabled) {
    background: #c8f0c8;
    border-color: #5cb85c;
}

.hour-pill.occupied {
    background: #f5f5f5;
    color: #bbb;
    border-color: #e0e0e0;
    cursor: not-allowed;
    text-decoration: line-through;
}

.hour-pill.selected {
    background: #9d45b4;
    color: #fff;
    border-color: #7b2e91;
}

.hour-pill.start-pill {
    background: #5c1e91;
    color: #fff;
    border-color: #3b0d6b;
}

/* Pills de madrugada (día siguiente en franja noche) */
.hour-pill.next-day-pill {
    background: #eef0ff;
    color: #3a3acf;
    border-color: #9999ee;
}

.hour-pill.next-day-pill:hover:not(:disabled) {
    background: #d4d8ff;
    border-color: #5555cc;
}

.hour-pill.next-day-pill.selected {
    background: #5555cc;
    color: #fff;
    border-color: #3333aa;
}

.hour-pill sup {
    font-size: 0.65em;
    vertical-align: super;
    margin-left: 1px;
    font-weight: 700;
}

/* Separador "Día siguiente" en la grilla de noche */
.hour-separator {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
    font-size: 0.75em;
    color: #5555cc;
    font-weight: 600;
}

.hour-separator::before,
.hour-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #c0c8ff;
}

/* Badge "+1 día" en el resumen del slot */
.next-day-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #5555cc;
    color: #fff;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* Slot seleccionado summary */
.selected-slot-info {
    margin-top: 14px;
    padding: 10px 16px;
    background: #f3eaf7;
    border: 1px solid #c9a0dc;
    border-radius: 6px;
    font-size: 1em;
    color: #5a1e7a;
    text-align: center;
}

/* ==========================================================================
   8. FORM V2.0 — PASO 3: TIPO DE PARTIDA, RIVAL E INVITADOS
   ========================================================================== */

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1em;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

/* Tipo de partida pills */
.tipo-partida-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tipo-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tipo-option:has(input:checked) {
    border-color: #9d45b4;
    background: #f3eaf7;
    color: #5a1e7a;
}

.tipo-option input[type="radio"] {
    display: none;
}

/* Aviso de invitados */
.invitado-notice {
    margin: 10px 0;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.95em;
}

.invitado-notice p {
    margin: 0;
}

/* Checkbox invitado */
.invitado-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    cursor: pointer;
    font-size: 0.95em;
}

.invitado-checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Formulario datos invitado */
.invitado-datos-form {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px;
    margin: 10px 0;
}

.invitado-datos-form h5 {
    margin: 0 0 12px;
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
}

.invitado-datos-form .form-field {
    margin-bottom: 8px;
}

.full-width {
    width: 100%;
    padding: 10px;
    border: 0px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

/* Bloques de invitados adicionales */
.invitado-adicional-block {
    background: #fafafa;
    border: 1px dashed #ccc;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.invitado-adicional-block h6 {
    margin: 0 0 10px;
    font-size: 0.9em;
    color: #888;
}

.button-add-invitado {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px dashed #9d45b4;
    border-radius: 6px;
    background: transparent;
    color: #9d45b4;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    margin-top: 6px;
}

.button-add-invitado:hover {
    background: #f3eaf7;
}

.remove-invitado {
    border: none;
    background: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 4px;
    padding: 0;
    text-decoration: underline;
}

/* ==========================================================================
   9. ADMIN DASHBOARD — ZONAS Y MESAS
   ========================================================================== */

.zones-dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.zone-section h3 {
    font-size: 1em;
    margin: 0 0 10px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.table-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.table-card.is-free {
    border-top: 3px solid #4caf50;
}

.table-card.is-partial {
    border-top: 3px solid #ff9800;
}

.table-card h4 {
    margin: 0;
    padding: 8px 10px;
    background: #f9f9f9;
    font-size: 0.85em;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 5px;
}

.table-card-body {
    padding: 8px 10px;
    font-size: 0.8em;
}

.status-text {
    color: #4caf50;
    font-weight: bold;
    margin: 4px 0;
}

.reservation-details {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reservation-details:last-child {
    border-bottom: none;
}

.res-time {
    font-weight: bold;
    color: #333;
}

.invitado-badge {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.8em;
}

.tipo-badge {
    display: inline-block;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.78em;
    font-weight: bold;
}

.tipo-amistosa {
    background: #e8f5e9;
    color: #2e7d32;
}

.tipo-puntos {
    background: #e3f2fd;
    color: #1565c0;
}

.tipo-torneo {
    background: #fce4ec;
    color: #880e4f;
}

.reservation-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reservation-actions .button-small {
    font-size: 0.75em;
    padding: 2px 8px;
}

@media (min-width: 768px) {
    .mesas-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .mesa-card {
        flex: 1 1 300px;
    }
}

/* ==========================================================================
   NUEVOS ESTILOS v2.1 – Formulario, Jugadores, Partidas y Calendario Filtro
   ========================================================================== */

/* --- Error inline (reemplaza los alert()) --- */
.wh-inline-error {
    background: #fdecea;
    border-left: 4px solid #d32f2f;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.9em;
    font-weight: 500;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Puntos dropdown --- */
.puntos-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}

.puntos-selector label {
    font-weight: 600;
    color: #444;
    font-size: 0.95em;
}

.puntos-select,
.wh-select,
.wh-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.puntos-select:focus,
.wh-select:focus,
.wh-input:focus {
    border-color: #9d45b4;
    outline: none;
    background: #fff;
}

/* --- Battle Players Grid (Paso 3 – Jugadores) --- */
.battle-players-section {
    margin-top: 30px;
}

.battle-players-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.battle-player-card {
    background: #f8f5ff;
    border: 1.5px solid #e2d4f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rival-card {
    background: #fff5f8;
    border-color: #f0d4df;
}

.battle-player-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.battle-player-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.player1-badge {
    background: #9d45b4;
    color: #fff;
}

.rival-badge {
    background: #e91e63;
    color: #fff;
}

.battle-player-name {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.battle-search {
    position: relative;
}

.battle-search .wh-input {
    width: 100%;
    box-sizing: border-box;
}

/* ===== Dropdown de búsqueda de usuarios ===== */
.user-search-results,
.oponente-search-results,
.extra-rival-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1c4e9;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(120, 50, 160, 0.15), 0 2px 6px rgba(0,0,0,0.08);
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
    animation: searchDropIn 0.15s ease;
    scrollbar-width: thin;
    scrollbar-color: #d1c4e9 transparent;
}

@keyframes searchDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cada resultado */
.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.93em;
    color: #2d1b4e;
    border-bottom: 1px solid #f3eaf7;
    transition: background 0.12s, color 0.12s;
}
.result-item:last-child { border-bottom: none; }

.result-item:hover,
.result-item:focus {
    background: #f3eaf7;
    color: #7b2e91;
}

/* Avatar circular con iniciales */
.result-item .result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9d45b4, #e91e63);
    color: #fff;
    font-weight: 700;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Nombre del usuario */
.result-item .result-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Rol/rol badge */
.result-item .result-role {
    font-size: 0.75em;
    color: #999;
    white-space: nowrap;
}

/* Estado: sin resultados */
.result-item.no-results {
    cursor: default;
    color: #999;
    font-style: italic;
    justify-content: center;
    padding: 14px;
}
.result-item.no-results:hover { background: transparent; color: #999; }

/* Estado: buscando (loading) */
.result-item.searching {
    cursor: default;
    color: #9d45b4;
    justify-content: center;
    gap: 8px;
    padding: 14px;
}
.result-item.searching:hover { background: transparent; }
.result-item.searching::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #d1c4e9;
    border-top-color: #9d45b4;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input con usuario ya seleccionado */
.battle-search .wh-input.user-selected {
    border-color: #9d45b4;
    background: #fdf4ff;
    color: #5b1f7a;
    font-weight: 600;
}

.battle-player-army label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}

.battle-vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}

.vs-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #9d45b4, #e91e63);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85em;
    letter-spacing: 0.02em;
    box-shadow: 0 3px 10px rgba(157, 69, 180, 0.35);
}

.invitado-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.88em;
    color: #555;
}

.invitado-toggle-label input[type="checkbox"] {
    accent-color: #9d45b4;
}

.toggle-text {
    line-height: 1.4;
}

.invitado-datos-form {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitado-datos-form h6 {
    margin: 0 0 6px;
    font-size: 0.9em;
    color: #b8860b;
    font-weight: 700;
}

/* --- Match card: meta header (horario, puntos, zona) --- */
.match-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: #f4f0fa;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e6ddf5;
    margin-bottom: 0;
}

.match-horario {
    font-weight: 700;
    color: #5a2d82;
    font-size: 0.95em;
    white-space: nowrap;
}

.match-categoria {
    background: #9d45b4;
    color: #fff;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.match-categoria.categoria-the-old-world {
    background: #8B4513;
}

.match-categoria.categoria-age-of-sigmar {
    background: #1976D2;
}

.match-categoria.categoria-the-horus-heresy {
    background: #b71c1c;
}

.match-categoria.categoria-warhammer-40k {
    background: #2e7d32;
}

.match-categoria.categoria-pintura-y-montaje {
    background: #f57f17;
}

.match-puntos {
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.8em;
    font-weight: 700;
}

.match-zona {
    background: #f3e5f5;
    color: #6a1b9a;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.8em;
    font-weight: 600;
}

.match-card-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 14px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .match-card-players {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-card-players .game-info-center {
        width: 100%;
        text-align: center;
    }

    .match-card-players .player-info.opponent {
        flex-direction: row;
    }

    .wh-partidas-filter {
        align-items: center;
        width: 100%;
    }

    .wh-partidas-filter #wh-filter-calendario {
        width: 100%;
    }

    .match-card-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .reservas-day-group h2 {
        font-size: 1em;
    }
}

/* --- Calendario de filtro de partidas --- */
.wh-partidas-filter {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.wh-filter-title {
    font-size: 1em;
    font-weight: 700;
    color: #5a2d82;
    margin: 0;
}

#wh-filter-calendario .flatpickr-calendar {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Días con reserva: punto de color debajo del número */
.flatpickr-day.wh-has-partida {
    position: relative;
    font-weight: 700;
    color: #5a2d82 !important;
    background: #f3e5f5 !important;
    border-radius: 50% !important;
}

.flatpickr-day.wh-has-partida::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9d45b4;
}

.wh-filter-clear-btn {
    background: transparent;
    border: 1.5px solid #9d45b4;
    color: #9d45b4;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.wh-filter-clear-btn:hover {
    background: #9d45b4;
    color: #fff;
}

/* ===========================================================================
   BARRA DE FILTRES DE CATEGORIA (univers / torneig / les meves)
   Estil basat en .wh-badge-universe
   =========================================================================== */

.wh-cat-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.wh-cat-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;

    /* Estat per defecte: "borde de color + text de color" = badge-universe inactiu */
    background: transparent;
    color: #9d45b4;
    border: 1.5px solid #9d45b4;

    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.wh-cat-btn:hover {
    background: rgba(157, 69, 180, 0.08);
    color: #7b2e91;
    border-color: #7b2e91;
}

/* Estat actiu: fons sòlid = badge seleccionat */
.wh-cat-btn.active {
    background: #9d45b4;
    color: #fff;
    border-color: #9d45b4;
}

.wh-cat-btn.active:hover {
    background: #7b2e91;
    border-color: #7b2e91;
    color: #fff;
}

.no-partidas-msg {
    text-align: center;
    color: #888;
    padding: 20px 0;
    font-style: italic;
}

/* Ocultar sección de comentarios si quedara visible */
#comentarios-section {
    display: none !important;
}

/* ============================================================
   TARJETA SIMPLIFICADA DE PINTURA
   ============================================================ */
.match-card-pintura {
    box-shadow: 0 2px 10px rgba(90, 45, 130, 0.08);
}

.match-card-pintura-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 1em;
}

.match-card-pintura-body .pintura-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.match-card-pintura-body .player-name {
    font-weight: 700;
    color: #5a2d82;
    font-size: 1em;
}

.match-card-pintura-body .pintura-label {
    color: #888;
    font-size: 0.9em;
}

/* ============================================================
   MÓVIL: META PRIMERO, DESPUÉS JUGADORES
   ============================================================ */
@media (max-width: 640px) {
    .match-card {
        display: flex;
        flex-direction: column;
    }

    .match-card-meta {
        order: -1;
    }

    .match-card-players {
        order: 1;
    }
}

/* Extra rival cards para Roll */
.extra-rival-card {
    margin-top: 12px;
}


/* ==========================================================================
   TORNEOS / EVENTOS — Tarjeta especial
   ========================================================================== */

/* Tarjeta de torneo — igual que .wh-match-card pero con acento rojo */
.wh-torneo-card {
    background: #fff;
    border: 1px solid #f5c6c6;
    border-left: 5px solid #c0392b;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(192, 57, 43, 0.08);
    transition: box-shadow 0.15s;
    position: relative;
    overflow: visible;
}

.wh-torneo-card:hover {
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.15);
}

/* Fila superior reutiliza .wh-card-top — sólo resetear overrides */
.wh-torneo-card .wh-card-top {
    padding: 0;
    background: none;
    border-bottom: none;
    margin-bottom: 10px;
}

.wh-torneo-card .wh-card-time {
    font-weight: 700;
    color: #333;
    font-size: inherit;
}

/* Badge de TORNEO */
.wh-badge-torneo {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: .4px;
    padding: 2px 9px;
    border-radius: 4px;
}

.wh-torneo-body {
    padding: 0;
}

.wh-torneo-title {
    margin: 0 0 8px;
    font-size: 1.05em;
    font-weight: 700;
    color: #b71c1c;
}

.wh-torneo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.wh-torneo-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82em;
    color: #c0392b;
    background: #fdf0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    padding: 2px 8px;
}

.wh-torneo-desc {
    margin: 8px 0 0;
    font-size: 0.82em;
    color: #777;
    line-height: 1.5;
    border-top: 1px solid #f5c6c6;
    padding-top: 8px;
    font-style: italic;
}

/* Assistents al torneo */
.wh-torneo-assistents {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f5c6c6;
}

.wh-assit-label {
    display: block;
    font-size: 0.78em;
    font-weight: 700;
    color: #c0392b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.wh-assit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wh-assit-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.wh-assit-member {
    background: #fdf0f0;
    color: #b71c1c;
    border-color: #f5c6c6;
}

.wh-assit-ext {
    background: #f5f5f5;
    color: #555;
    border-color: #ddd;
}

@media (max-width: 600px) {
    .wh-torneo-meta {
        flex-direction: column;
        gap: 6px;
    }

    .wh-torneo-title {
        font-size: 1em;
    }
}


/* ==========================================================================
   CONTROL DE ACCESO — Aviso "Solo socios"
   ========================================================================== */

.wh-acceso-restringido {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 52px 32px;
    margin: 0 auto;
    max-width: 520px;
    background: #fff;
    border: 1.5px solid rgba(157, 69, 180, 0.25);
    border-top: 4px solid #9d45b4;
    border-radius: 14px;
    box-shadow: 0 6px 28px rgba(90, 45, 130, 0.10);
}

.wh-acceso-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 8px rgba(157, 69, 180, 0.25));
}

.wh-acceso-title {
    margin: 0 0 12px;
    font-size: 1.4em;
    font-weight: 800;
    color: #5a2d82;
    letter-spacing: 0.3px;
}

.wh-acceso-msg {
    margin: 0 0 28px;
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

.wh-acceso-btn {
    display: inline-block;
    padding: 12px 36px;
    background: #9d45b4;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(157, 69, 180, 0.30);
}

.wh-acceso-btn:hover {
    background: #7b2e91;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 69, 180, 0.45);
}


/* ================================================================
   ESCENOGRAFÍA — TARJETAS DE KIT EN EL FORMULARIO DE RESERVA
   ================================================================ */
.esceno-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.esceno-card {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, background .2s, box-shadow .2s;
    position: relative;
}

.esceno-card:hover {
    border-color: #9d45b4;
    box-shadow: 0 2px 8px rgba(157, 69, 180, .12);
}

.esceno-card.selected {
    border-color: #9d45b4;
    background-color: #f9f2fc;
    box-shadow: 0 0 0 3px rgba(157, 69, 180, .18);
}

.esceno-card.no-disponible {
    opacity: 0.45;
    cursor: not-allowed;
}

.esceno-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.esceno-icon {
    font-size: 1.2em;
    line-height: 1;
}

.esceno-nombre {
    font-weight: bold;
    font-size: 0.88em;
    flex: 1;
    line-height: 1.3;
}

.esceno-stock {
    font-size: 0.72em;
    background: #edf7ed;
    color: #2e7d32;
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
}

.esceno-nodisponible {
    font-size: 0.72em;
    background: #fce4ec;
    color: #880e4f;
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
}

.esceno-desc {
    color: #777;
    font-size: 0.85em;
    margin: 0;
    line-height: 1.4;
}

/* ===========================================================================
   RESULTAT DE PARTIDA
   =========================================================================== */

.wh-resultado-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.wh-resultado-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.wh-res-win {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.wh-res-draw {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.wh-res-pending {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
    font-weight: 500;
}

/* Botons per establir el resultat */
.wh-resultado-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.wh-resultado-label {
    font-size: 0.75em;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 2px;
}

.wh-res-btn {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    background: transparent;
    color: #5a2d82;
    border: 1.5px solid #9d45b4;
    transition: background 0.18s, color 0.18s;
}

.wh-res-btn:hover:not(:disabled) {
    background: #9d45b4;
    color: #fff;
}

.wh-res-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Formulari ocult (estat per defecte quan ja hi ha resultat) */
.wh-resultado-form--hidden {
    display: none !important;
}

/* Bot\u00f3 d'editar resultat */
.wh-res-edit-btn {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72em;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    color: #888;
    border: 1px solid #ccc;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    margin-left: 4px;
    vertical-align: middle;
}

.wh-res-edit-btn:hover {
    color: #5a2d82;
    border-color: #9d45b4;
    background: rgba(157, 69, 180, 0.06);
}

/* Bot\u00f3 cancel\u00b7lar (X) dins el form d'edici\u00f3 */
.wh-res-cancel-btn {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
    transition: color 0.15s, border-color 0.15s;
    margin-left: 2px;
}

.wh-res-cancel-btn:hover {
    color: #c62828;
    border-color: #c62828;
}

/* ===========================================================================
   RANKING [warhammer_ranking]
   =========================================================================== */

.wh-ranking-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.wh-ranking-cat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.wh-ranking-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.wh-ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.92em;
}

.wh-ranking-table thead th {
    background: #5a2d82;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.wh-rank-th-pos { width: 44px; text-align: center !important; }

.wh-ranking-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.wh-ranking-table tbody tr:hover {
    background: #f9f4fd;
}

.wh-ranking-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.wh-ranking-table tbody tr:nth-child(even):hover {
    background: #f3edf9;
}

.wh-ranking-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

.wh-rank-td-pos {
    text-align: center;
    font-size: 1.15em;
}

.wh-rank-name {
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.wh-rank-name:hover {
    color: #9d45b4;
    text-decoration: underline;
}

.wh-rank-num {
    text-align: center;
    font-weight: 600;
}

.wh-rank-wins  { color: #2e7d32; }
.wh-rank-losses { color: #c62828; }

/* Barra de % de victòria */
.wh-rank-pct-cell {
    min-width: 110px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wh-rank-pct-bar {
    flex: 1;
    height: 8px;
    background: #eeeeee;
    border-radius: 4px;
    overflow: hidden;
}

.wh-rank-pct-fill {
    height: 100%;
    background: linear-gradient(90deg, #9d45b4, #5a2d82);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.wh-rank-pct-label {
    font-size: 0.78em;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
    min-width: 34px;
}

/* Primera fila (or) */
.wh-ranking-table tbody tr:first-child td {
    font-size: 1.02em;
}

/* Botons de filtre del ranking (classe pr\u00f2pia per evitar conflictes) */
.wh-ranking-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    background: transparent;
    color: #9d45b4;
    border: 1.5px solid #9d45b4;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.wh-ranking-btn:hover {
    background: rgba(157, 69, 180, 0.08);
    color: #7b2e91;
    border-color: #7b2e91;
}

.wh-ranking-btn.active {
    background: #9d45b4;
    color: #fff;
    border-color: #9d45b4;
}

.wh-ranking-btn.active:hover {
    background: #7b2e91;
    border-color: #7b2e91;
    color: #fff;
}

/* Barra de % dins la cel\u00b7la (contenidor flex en un div, no al td directament) */
.wh-rank-pct-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}
