/* Variables CSS */
:root {
    --color-pub: #808080; /* Gris - Zorro */
    --color-mim: #fb8500; /* Naranja - León */
    --color-tur: #219ebc; /* Azul - Oso */
    --color-gap: #e63946; /* Rojo - Águila */
    --color-background: #f8f9fa;
    --color-text: #212529;
    --color-primary: #6c63ff;
    --color-secondary: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 1rem; /* Ajustado para espacio con la navbar */
}

/* Encabezado */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-secondary);
}

/* Tablero de puntuaciones */
.scoreboard {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.scoreboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.scoreboard-header h2 {
    font-size: 1.8rem;
    color: var(--color-text);
}

#refresh-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#refresh-btn:hover {
    background-color: #5751db;
}

/* Casas */
.houses-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
    padding-top: 10px; /* Espacio mínimo para acomodar el efecto de elevación */
}

/* Estilos para crear un efecto de "podio" */
.house-card[data-position="1"] {
    order: 1;
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    z-index: 3;
    position: relative;
    border: 2px solid #ffd700;
    animation: pulse-gold 3s infinite alternate;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 15px 30px rgba(255, 215, 0, 0.2);
    }
    100% {
        box-shadow: 0 15px 30px rgba(255, 215, 0, 0.5);
    }
}

.house-card[data-position="2"] {
    order: 2;
    transform: translateY(-4px) scale(1.04);
    z-index: 2;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #c0c0c0;
}

.house-card[data-position="3"] {
    order: 3;
    transform: translateY(-2px) scale(1.02);
    z-index: 1;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #cd7f32;
}

.house-card[data-position="4"] {
    order: 4;
    opacity: 0.95;
}

.house-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.5s ease, box-shadow 0.5s ease, order 0.8s ease;
    border: 1px solid #f1f1f1;
    position: relative;
}

/* Hover general para tarjetas que no están en el podio */
.house-card:not([data-position="1"]):not([data-position="2"]):not([data-position="3"]):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Efectos hover específicos para el podio */
.house-card[data-position="1"]:hover {
    transform: translateY(-12px) scale(1.08);
}

.house-card[data-position="2"]:hover {
    transform: translateY(-8px) scale(1.04);
}

.house-card[data-position="3"]:hover {
    transform: translateY(-6px) scale(1.02);
}

.house-header {
    padding: 1.5rem;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.pub-header {
    background-color: var(--color-pub);
}

.mim-header {
    background-color: var(--color-mim);
}

.tur-header {
    background-color: var(--color-tur);
}

.gap-header {
    background-color: var(--color-gap);
}

.house-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.house-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.house-score {
    background-color: white;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    position: relative;
    display: inline-block;
}

.score-number::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.house-card:hover .score-number::after {
    opacity: 0.6;
}

.score-label {
    font-size: 0.9rem;
    color: var(--color-secondary);
}

.house-position {
    margin-top: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.first-position {
    background: linear-gradient(to right, #ffd700, #f9bc0f);
    color: #222;
    transform: scale(1.1);
}

.second-position {
    background: linear-gradient(to right, #c0c0c0, #a9a9a9);
    color: #222;
}

.third-position {
    background: linear-gradient(to right, #cd7f32, #b87333);
    color: #fff;
}

.other-position {
    background-color: #f8f9fa;
    color: #666;
}

.house-card:hover .house-position {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

/* Historial */
.history-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.history-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.last-saved-info {
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.last-saved-info i {
    color: var(--color-primary);
}

.history-entry {
    border-left: 4px solid var(--color-primary);
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0 8px 8px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
}

.history-entry.slide-in {
    animation: slideInFromLeft 0.5s forwards;
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.history-entry.positive-change {
    background-color: rgba(76, 175, 80, 0.1);
    border-left-width: 6px;
}

.history-entry.negative-change {
    background-color: rgba(244, 67, 54, 0.1);
    border-left-width: 6px;
}

.history-entry.positive-change .entry-description strong:nth-of-type(2) {
    color: #4caf50;
    font-size: 1.2em;
}

.history-entry.negative-change .entry-description strong:nth-of-type(2) {
    color: #f44336;
    font-size: 1.2em;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.entry-date {
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.entry-description {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-icon {
    font-size: 1rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.positive-change .change-icon {
    color: white;
    background-color: #4caf50;
}

.negative-change .change-icon {
    color: white;
    background-color: #f44336;
}

.pub-event {
    border-left-color: var(--color-pub);
}

.mim-event {
    border-left-color: var(--color-mim);
}

.tur-event {
    border-left-color: var(--color-tur);
}

.gap-event {
    border-left-color: var(--color-gap);
}

/* Pie de página */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--color-secondary);
    font-size: 0.9rem;
}

/* Responsividad */
@media screen and (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .scoreboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .houses-container {
        grid-template-columns: 1fr;
    }
}

/* Animaciones */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1s ease-in-out;
}

/* Mensaje de estado */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

.status-message.success {
    background-color: #4caf50;
    color: white;
}

.status-message.error {
    background-color: #f44336;
    color: white;
}

.status-message.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Estilos para los escudos de las casas */
.house-shield {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    transition: transform 0.3s ease;
}

/* Animación para los escudos al cargar */
@keyframes shieldAppear {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.shield-image {
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    animation: shieldAppear 0.8s ease-out forwards;
}

/* Retraso en la animación para cada escudo */
#house-pub .shield-image {
    animation-delay: 0.1s;
}

#house-mim .shield-image {
    animation-delay: 0.3s;
}

#house-tur .shield-image {
    animation-delay: 0.5s;
}

#house-gap .shield-image {
    animation-delay: 0.7s;
}

.house-card:hover .shield-image {
    transform: scale(1.05);
}

/* Estilos específicos para los escudos de las casas */
.house-card[data-house="PUB"] .shield-image {
    transform: rotate(-3deg);
}

.house-card[data-house="MIM"] .shield-image {
    transform: scale(1.02);
}

.house-card[data-house="TUR"] .shield-image {
    transform: scale(1.02);
}

.house-card[data-house="GAP"] .shield-image {
    transform: rotate(3deg);
}

.house-card[data-house="PUB"]:hover .shield-image {
    transform: rotate(-3deg) scale(1.05);
}

.house-card[data-house="MIM"]:hover .shield-image {
    transform: scale(1.08);
}

.house-card[data-house="TUR"]:hover .shield-image {
    transform: scale(1.08);
}

.house-card[data-house="GAP"]:hover .shield-image {
    transform: rotate(3deg) scale(1.05);
}

/* Tooltip personalizado para las casas */
.house-card {
    position: relative;
}

.house-card:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.house-card:hover::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    pointer-events: none;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Animación para el trofeo de primer lugar */
@keyframes trophy-bounce {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    100% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Estilos para la página de normas */
.rules-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.rules-container h1 {
    text-align: center;
    color: #2b2d42;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.rules-intro {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 5px solid #2b2d42;
}

.rules-intro p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2b2d42;
}

.rules-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.rules-section h2 {
    color: #2b2d42;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e5e5;
}

.rules-section h2 i {
    margin-right: 0.5rem;
}

.rule-category {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.rule-category h3 {
    color: #2b2d42;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.rule-category h3 i {
    margin-right: 0.5rem;
    color: #4a4e69;
}

.rule-category ul {
    list-style: none;
    padding-left: 1.5rem;
}

.rule-category li {
    margin-bottom: 0.8rem;
    line-height: 1.5;
    position: relative;
}

.rule-category li::before {
    content: "•";
    color: #4a4e69;
    position: absolute;
    left: -1rem;
}

.points {
    font-weight: bold;
    color: #2b2d42;
    background-color: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0 0.2rem;
}

.points.negative {
    color: #e63946;
}

.gain-points {
    border-left: 5px solid #2a9d8f;
}

.lose-points {
    border-left: 5px solid #e63946;
}

.additional-info {
    border-left: 5px solid #4a4e69;
}

.rules-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.rules-footer h3 {
    color: #2b2d42;
    font-size: 1.5rem;
}

.rules-footer i {
    color: #ffd700;
    margin-right: 0.5rem;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .rules-container {
        margin: 1rem;
        padding: 1rem;
    }

    .rules-container h1 {
        font-size: 2rem;
    }

    .rules-section {
        padding: 1rem;
    }

    .rule-category {
        padding: 0.8rem;
    }
} 