/* 
 * RANKMAKER - Ranking Page Styles
 * Ultra-professional, ultra-modern design system
 */

/* Template Detail */
.template-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xxl);
}

.cover-and-actions {
    display: flex;
    flex-direction: column;
}

.share-action-cover {
    margin-top: var(--spacing-md);
    display: flex; /* Para controlar la alineación del botón si es necesario */
    justify-content: flex-start; /* Alinea el botón a la izquierda */
}

/* Cover Image */
.cover-image {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: fit-content;
}

.cover-image img {
    width: 100%;
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.cover-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

.template-category-badge {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.template-category-badge i {
    color: var(--primary-color);
}

/* Template Info */
.template-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.template-title {
    font-size: var(--font-size-xxl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md) var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.meta-info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.meta-info-item i {
    color: var(--primary-color);
    font-size: var(--font-size-md);
}

.description {
    color: var(--text-secondary);
    line-height: 1.8;
}

.description-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.tags-section {
    margin-top: var(--spacing-md);
}

.tags-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* Options Grid */
.options-section {
    margin-top: var(--spacing-xl);
}

.options-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.options-title i {
    color: var(--primary-color);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.option {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    aspect-ratio: 1/1;
    position: relative;
}

.option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.option-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.template-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-normal);
    white-space: nowrap; /* Evita que el texto se divida en varias líneas */
    min-width: 150px; /* Establece un ancho mínimo para el botón */
    max-width: 200px; /* Establece un ancho máximo para el botón */
    overflow: hidden; /* Oculta el contenido que excede el ancho */
    text-overflow: ellipsis; /* Muestra puntos suspensivos si el texto es demasiado largo */
}

@media (max-width: 768px) {
    .action-button {
        padding: var(--spacing-sm) var(--spacing-md); /* Ajusta el padding para pantallas más pequeñas */
        min-width: 120px;
        max-width: 180px;
    }
}



/* Botón fijo de Start Ranking */
.fixed-start-ranking-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    color: #000;
    box-shadow: var(--shadow-gold);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.fixed-start-ranking-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.4);
    color: #000; /* Mantener el color negro del texto en hover */
}

.fixed-start-ranking-btn i {
    margin-right: var(--spacing-sm);
}

/* Ocultar el botón fijo cuando se está en la vista de batalla o resultados */
.battle-view:not([style*="display: none"]) ~ .fixed-start-ranking-btn,
.results-view:not([style*="display: none"]) ~ .fixed-start-ranking-btn {
    display: none;
}

.share-btn {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.share-btn:hover {
    background-color: var(--primary-color);
}

/* Related Templates */
.related-templates {
    margin-top: var(--spacing-xxl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
}

.related-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-lg);
    position: relative;
    padding-left: var(--spacing-md);
}

.related-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Battle View Styles */
.battle-view {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-xl);
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.battle-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.battle-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.battle-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background-color: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.battle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) auto;
    max-width: 800px;
}

.battle-item {
    flex: 1;
    max-width: 300px;
    background-color: var(--bg-darker);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.battle-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.battle-item-image {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.battle-item-image::before {
    content: "";
    display: block;
    padding-top: 75%; /* Relación de aspecto 4:3 */
}

.battle-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.battle-item-name {
    padding: var(--spacing-sm);
    text-align: center;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Estilos responsivos para dispositivos móviles */
@media (max-width: 768px) {
    .battle-container {
        flex-direction: column;
        gap: var(--spacing-sm); /* Reducido el espacio entre elementos */
    }
    
    .battle-item {
        max-width: 200px; /* Ligeramente más grande */
        width: 92%; /* Ancho relativo ligeramente mayor */
    }
    
    .battle-vs {
        margin: var(--spacing-xs) 0; /* Reducido el margen */
        width: 50px; /* Ligeramente más grande el círculo VS */
        height: 50px; /* Ligeramente más grande el círculo VS */
        font-size: var(--font-size-md); /* Tamaño de fuente ligeramente mayor */
    }
    
    .battle-actions {
        margin-top: var(--spacing-sm); /* Reducido el margen superior */
    }
}
.battle-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    color: #000;
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-gold);
}

.battle-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

/* Results View Styles */
.results-view {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-xl);
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.results-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.results-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-md);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* New Results Completion Header */
.results-completion-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.trophy-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    box-shadow: var(--shadow-gold);
}

.trophy-icon i {
    font-size: 2.5rem;
    color: #000;
}

.completion-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.completion-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: 0;
}

/* Results Navigation Tabs */
.results-navigation {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: 0;
}

.nav-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--font-size-md);
    position: relative;
    border-bottom: 2px solid transparent;
}

.nav-tab:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.nav-tab.active {
    font-weight: var(--font-weight-semibold);
}

.nav-tab.active[data-tab="ranking"] {
    color: var(--gold-gradient-start);
    border-bottom-color: var(--gold-gradient-start);
}

.nav-tab.active[data-tab="history"] {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Podium Section */
.podium-section {
    margin: var(--spacing-md) 0 var(--spacing-xl) 0;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Align items to the bottom */
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 200px;
}

.podium-item.first-place {
    order: 2;
}

.podium-item.second-place {
    order: 1;
}

.podium-item.third-place {
    order: 3;
}

/* Final Podium Styles */
.podium-decorator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 12px;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    border-radius: 2px;
    z-index: 1;
}

.podium-image-container {
    position: relative;
    margin-bottom: var(--spacing-sm);
    padding-top: 12px; /* Space for decorator */
}

.podium-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--bg-darker);
    background-color: var(--bg-darker);
}

.first-place .podium-image {
    width: 160px;
    height: 160px;
    border: 3px solid var(--gold-gradient-start);
    box-shadow: 0 0 25px 5px rgba(255, 215, 0, 0.5);
}

.podium-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podium-details {
    width: 100%;
    text-align: center;
}

.podium-name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
    max-width: 200px;
    padding: 0 var(--spacing-xs);
}

.first-place .podium-name {
    font-size: var(--font-size-lg);
    max-width: 200px;
}

.second-place .podium-name,
.third-place .podium-name {
    font-size: var(--font-size-md);
    max-width: 180px;
    padding: 0 var(--spacing-xs);
    text-align: center;
    margin: 0 auto var(--spacing-xs);
}

.podium-rank-bar {
    height: 30px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
}

.first-place .podium-rank-bar {
        background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
        height: 84px;
    }

    .podium-rank-bar {
        height: 56px;
    }

.second-place .podium-rank-bar {
    background: #374151; /* gray-700 */
    color: var(--text-primary);
}

.third-place .podium-rank-bar {
    background: #8B4513; /* saddlebrown */
    color: var(--text-primary);
}
    object-fit: cover;
}

.podium-rank {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: #000;
    box-shadow: var(--shadow-md);
}

.first-place .podium-rank {
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    width: 50px;
    height: 50px;
    font-size: var(--font-size-xl);
}

.second-place .podium-rank {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.third-place .podium-rank {
    background: linear-gradient(135deg, #CD7F32, #B8722C);
}

.podium-name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    text-align: center;
    font-size: var(--font-size-sm);
    max-width: 140px;
    word-wrap: break-word;
}

.first-place .podium-name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
}

/* Complete Ranking Section */
.complete-ranking-section {
    margin-bottom: var(--spacing-lg);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-darker);
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: grab;
}

.ranking-item:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.5;
}

#reorder-btn.active {
    background-color: var(--color-success);
}

.ranking-item:hover {
    transform: translateX(5px);
    border-left-color: var(--primary-color);
}

.ranking-position {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: #000;
}

.ranking-item:nth-child(1) .ranking-position,
.ranking-item:nth-child(2) .ranking-position,
.ranking-item:nth-child(3) .ranking-position {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.ranking-item:nth-child(n+4) .ranking-position {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.ranking-item-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.ranking-item-image {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ranking-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
}

.ranking-item-name {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-md);
}

/* Battle History in Tab */
.history-content {
    padding: var(--spacing-md) 0;
}

.history-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-style: italic;
}

.section-title {
    font-size: var(--font-size-lg);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--border-light);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Ranked List Section */
.ranked-list-container {
    margin-bottom: var(--spacing-xl);
}

.result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-darker);
    border-radius: var(--border-radius-md);
    transition: transform 0.2s ease;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: linear-gradient(to right, var(--gold-gradient-start), var(--gold-gradient-end));
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    color: #000;
    font-size: var(--font-size-md);
}

.result-item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.result-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-item-name {
    flex: 1;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

/* Battle History Section */
.battle-history-section {
    margin-top: var(--spacing-xl);
}

.battle-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.history-battle {
    background-color: var(--bg-darker);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.history-battle-number {
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.history-battle-items {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.history-item.winner {
    background-color: rgba(76, 175, 80, 0.1);
}

.history-item.loser {
    opacity: 0.8;
}

.history-item-image {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.history-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-item-name {
    font-size: var(--font-size-sm);
    text-align: center;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.history-vs {
    font-weight: var(--font-weight-bold);
    color: var(--text-secondary);
    margin: 0 var(--spacing-xs);
}

.no-history {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--spacing-lg) 0;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

/* Battle History Toggle Button */
.history-toggle-btn {
    display: block;
    margin: var(--spacing-xl) auto var(--spacing-md);
    background-color: var(--bg-darker);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.history-toggle-btn:hover {
    background-color: var(--bg-darkest);
    color: var(--text-primary);
}

/* Results Image Container Styles */
.results-image-container {
    background-color: var(--bg-darkest);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    width: 800px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.results-image-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.results-image-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.results-image-ranking {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    padding-top: var(--spacing-lg);
}

.results-image-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.results-image-watermark {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
    font-size: var(--font-size-md);
    color: var(--primary-color);
    font-weight: var(--font-weight-semibold);
}

/* Responsive */
@media (max-width: 992px) {
    .template-detail {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .battle-container {
        flex-direction: column;
    }
    
    .battle-vs {
        margin: var(--spacing-md) 0;
    }
    
    .battle-item {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .results-image-container {
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .battle-view,
    .results-view {
        padding: var(--spacing-md);
        margin-top: var(--spacing-md);
    }
    
    .battle-header,
    .results-header {
        margin-bottom: var(--spacing-md);
    }
    
    .battle-title,
    .results-title {
        font-size: var(--font-size-lg);
    }
    
    .battle-actions,
    .results-actions {
        gap: var(--spacing-sm);
    }
    
    .history-battle-items {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .history-vs {
        margin: var(--spacing-xs) 0;
    }
    
    /* New responsive styles for results */
    .completion-title {
        font-size: 2rem;
    }
    
    .trophy-icon {
        width: 60px;
        height: 60px;
    }
    
    .trophy-icon i {
        font-size: 2rem;
    }
    
    .podium-container {
        gap: var(--spacing-sm);
        max-width: 100%;
    }
    
    .podium-image {
        width: 80px;
        height: 80px;
    }
    
    .first-place .podium-image {
        width: 100px;
        height: 100px;
    }
    
    .podium-rank {
        width: 30px;
        height: 30px;
        font-size: var(--font-size-md);
    }
    
    .first-place .podium-rank {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
    
    .ranking-item-image {
        width: 60px;
        height: 60px;
    }
    
    .ranking-position {
        min-width: 40px;
        height: 40px;
        font-size: var(--font-size-md);
    }
    
    .fixed-start-ranking-btn {
        bottom: 3rem;
        right: 1.5rem;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-md);
        width: auto;
        min-width: 160px;
        height: 50px;
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    }
}

@media (max-width: 576px) {
    .meta-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .template-actions, 
    .battle-actions,
    .results-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-xs); /* Reducido el espacio entre botones */
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-xs) var(--spacing-md); /* Reducido el padding */
    }
    
    .battle-item {
        max-width: 180px; /* Tamaño intermedio ligeramente mayor */
        width: 90%; /* Ancho relativo ligeramente mayor */
    }
    
    .battle-vs {
        width: 42px; /* Tamaño intermedio ligeramente mayor */
        height: 42px; /* Tamaño intermedio ligeramente mayor */
        font-size: var(--font-size-sm); /* Fuente ligeramente mayor */
    }
    
    .options-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .result-item {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .result-item-name {
        width: 100%;
        margin-top: var(--spacing-xs);
    }
    
    .battle-view,
    .results-view {
        padding: var(--spacing-sm);
        border-radius: var(--border-radius-md);
    }
    
    .template-info {
        gap: var(--spacing-md);
    }
    
    .template-title {
        font-size: var(--font-size-xl);
    }
    
    .options-title {
        font-size: var(--font-size-md);
    }
    
    /* Mobile responsive for new results design */
    .completion-title {
        font-size: 1.8rem;
    }
    
    .completion-subtitle {
        font-size: var(--font-size-md);
    }
    
    .trophy-icon {
        width: 50px;
        height: 50px;
    }
    
    .trophy-icon i {
        font-size: 1.5rem;
    }
    
    .results-navigation {
        flex-direction: row;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }

    .nav-tab {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-sm);
        border-bottom-width: 1px;
    }
    
    .podium-container {
        display: flex;
        justify-content: center;
        align-items: flex-end;
        gap: var(--spacing-sm);
    }
    
    .podium-item {
        width: 120px;
    }
    
    .podium-item.first-place {
        order: 2;
    }
    
    .podium-item.second-place {
        order: 1;
    }
    
    .podium-item.third-place {
        order: 3;
    }

    .first-place .podium-image {
        box-shadow: 0 0 15px 3px rgba(255, 215, 0, 0.5);
    }

    .podium-decorator {
        top: 0;
        width: 20px;
        height: 10px;
    }
    
    .podium-image {
        width: 80px;
        height: 80px;
    }
    
    .first-place .podium-image {
        width: 100px;
        height: 100px;
    }

    .podium-name {
        font-size: var(--font-size-xs);
        max-width: 120px;
        padding: 0 var(--spacing-xs);
        text-align: center;
    }

    .first-place .podium-name {
        font-size: var(--font-size-sm);
        max-width: 140px;
    }

    .second-place .podium-name,
    .third-place .podium-name {
        font-size: var(--font-size-xs);
        max-width: 100px;
    }
    
    .ranking-item {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .ranking-item-image {
        width: 50px;
        height: 50px;
    }
    
    .ranking-position {
        min-width: 35px;
        height: 35px;
        font-size: var(--font-size-sm);
    }
    
    .ranking-item-name {
        font-size: var(--font-size-sm);
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 375px) {
    .options-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .battle-item-image {
        aspect-ratio: 1/1;
    }
    
    .battle-item {
        max-width: 170px; /* Ligeramente más grande para pantallas muy pequeñas */
        width: 88%; /* Ancho relativo ligeramente mayor */
    }
    
    .battle-vs {
        width: 40px; /* Ligeramente más grande para pantallas muy pequeñas */
        height: 40px; /* Ligeramente más grande para pantallas muy pequeñas */
        font-size: var(--font-size-sm); /* Fuente ligeramente mayor */
    }
    
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .battle-view,
    .results-view {
        margin-left: var(--spacing-xs);
        margin-right: var(--spacing-xs);
    }
    
    .fixed-start-ranking-btn {
        bottom: 3rem;
        right: 50%;
        transform: translateX(50%);
        width: 80%;
        max-width: 280px;
        height: 60px;
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-bold);
        box-shadow: 0 4px 24px rgba(255, 215, 0, 0.6);
    }
}