/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: white;
    min-height: 100vh;
    /* Gradient initial */
    background: linear-gradient(-45deg, #7c0000, #111827, #111827, #2563eb);
    /*background-size: 400% 400%;
    /*animation: gradientShift 10s ease infinite;*/
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-logo {
    position: absolute;
    top: 0;
    left: -70px;
    max-width: 500px;    /* taille de ton choix */
    height: auto;
}

.header-doc-box {
    position: absolute;
    top: 5%;
    left: 90%;
    max-width: 150px;
    background: linear-gradient(145deg, #1f2937, #111827); /* léger dégradé sombre */
    border-radius: 0.75rem;
    border: 2px solid #9333ea;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.header-doc-box:hover {
    transform: scale(1.2);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.header-doc-box span {
    font-size: 0.85rem;
    color: #f3f4f6;
    font-weight: 500;
}

/* Container */
.container {
    max-width: auto;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header h1 a {
    text-decoration: none;
    background: linear-gradient(to right, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: #9ca3af;
}

.back-button {
    background: #720000;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s;
    display: block;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    margin: 0 auto 1.5rem auto;
    max-width: fit-content;
}

.back-button:hover {
    background: #8d0000;
}

.pointer {
    cursor: pointer;
}

/* Search bar */
.search-container {
    max-width: 672px;
    margin: 0 auto 2rem;
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: #1f2937;
    border: 2px solid #9333ea;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input::placeholder {
    color: #6b7280;
}

.search-input:focus {
    border-color: #a78bfa;
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #9333ea;
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.search-button:hover {
    background: #7e22ce;
}

/* Loading spinner */
.loading-container {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid transparent;
    border-top-color: #9333ea;
    border-radius: 50%;
    margin: 0 auto;
}

.loading-text {
    margin-top: 1rem;
    color: #9ca3af;
}

/* Error message */
.error-container {
    max-width: 672px;
    margin: 0 auto;
    background: rgba(127, 29, 29, 0.5);
    border: 1px solid #dc2626;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

/* Stats layout */
.stats-layout {
    display: flex;
    gap: 0.75rem;
}

.stats-column-gods,
.stats-column-globals-stats {
    width: 25%;
    flex-shrink: 0;
}

.stats-column-history {
    width: 49%;
    flex-shrink: 0;
}

.over-all {
    z-index: 99999;
}

.above {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.god-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.90); /* fond noir semi-transparent */
}

.above.less {
    z-index: 999;
}

/* Stats card */
.stats-card {
    background: linear-gradient(to bottom right, #1f2937, #111827);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 2px solid #9333ea;
    position: sticky;
    top: 1rem;
    justify-content: space-between;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.stats-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-title.god {
    width: fit-content;
}

.back-button-god {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #a78bfa;
    display: flex;
    gap: 0.5rem;
    width: fit-content;
    transition: all 0.2s;
}

.back-button-god:hover {
    transform: scale(1.2);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-box {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.stat-box.god {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s, background-color 0.3s;
}

.stat-box.god:hover {
    background: rgba(91, 99, 110, 0.5);
    transform: scale(1.05);
}

.stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stat-value.litle {
    font-size: 1rem;
    font-weight: bold;
    color: white;
}

.stat-value.green {
    color: #4ade80;
}

.stat-value.red {
    color: #f87171;
}

.stat-value-lg {
    font-size: 1.125rem;
    font-weight: bold;
    color: white;
}

.stat-value-xl {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
}

.stat-subtext {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Sort buttons */
.sort-label {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    padding-left: 1rem;
}

.sort-buttons {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: 1rem;
}

.sort-button {
    font-size: 0.8125rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    background: #374151;
    color: #d1d5db;

}

.sort-button:hover {
    background: #4b5563;
}

.sort-button.active {
    background: #9333ea;
    color: white;
}

.scrollable {
    max-height: 40rem;
    overflow-y: auto;
    padding-right: 1rem;
    padding-left: 1rem;
    padding-top: 0.5rem;
}

.scrollable.gods {
    max-height: 37rem;
}

/* Match history */
.scrollable.history {
    max-height: 32rem;
}

.scrollable::-webkit-scrollbar {
    width: 8px;
}

.scrollable::-webkit-scrollbar-track {
    background: rgba(75, 85, 99, 0.3);
    border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.6);
    border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.8);
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Match card */
.match-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.match-card {
    border: 2px solid;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: transform 0.3s;
}

.match-card:hover {
    transform: scale(1.015);
}

.match-card.win {
    background: rgba(20, 83, 45, 0.4);
    border-color: #16a34a;
}

.match-card.loss {
    background: rgba(127, 29, 29, 0.3);
    border-color: #dc2626;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.match-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.match-date {
    font-size: 0.875rem;
    color: #9ca3af;
}

.match-god {
    font-weight: bold;
    font-size: 1.25rem;
}

.match-badge {
    padding: 0.25rem 0.75rem;
    background: #1f2937;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.match-badge.mvp {
    color: #fbbf24;
}

.match-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.match-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-stat-value {
    font-weight: 600;
}

/* Match detail page */
.match-detail {
    max-width: auto;
    margin: 0 auto;
}

.match-detail-header {
    background: #1f2937;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem; /* padding léger autour du texte */
    display: block;  /* s’adapte à la largeur du contenu */
    max-width: fit-content;
    margin: 0 auto 1.5rem auto;
    text-align: center; /* ou center si tu veux centrer le texte */
}

.match-detail-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
}

.match-detail-subtitle {
    color: #9ca3af;
    text-align: center;
}

.teams-layout {
    display: flex;
    gap: 5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.team-section {
    width: 40%;
    flex-shrink: 0;
}

.team-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.team-indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
}

.team-indicator.blue {
    background: #2563eb;
}

.team-indicator.red {
    background: #dc2626;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.5rem;
}

.player-card {
    background: #1f2937;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: background-color 0.3s;
}

.player-card:hover {
    background: #4b5563;
}

.player-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    flex: 1;
}

.white-text {
    font-size: 1.125rem;
}

.white-text.bold {
    font-weight: bold;
}

.player-god-info {
    color: #9ca3af;
    margin-left: 0.5rem;
}

.player-stats {
    text-align: right;
    font-family: monospace;
}

.player-score {
    color: #fbbf24;
    font-weight: bold;
    margin-right: 1rem;
}

.player-details {
    color: #9ca3af;
}

.winner-banner {
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    max-width: 40%;
    display: block;
    margin: 0 auto;
}

.winner-banner.blue {
    background: linear-gradient(-45deg, #2563eb, #112a5f, #0d1a36, #000000);
}

.winner-banner.red {
    background: linear-gradient(-45deg, #000000, #331010, #581010, #eb2525);
}

.winner-text {
    font-size: 1.5rem;
    font-weight: bold;
}

.separator {
    width: 2px;
    background-color: white;
    align-self: stretch;
    margin-top: 3.5rem; /* légèrement après le titre ou le premier joueur */
    margin-bottom: 1rem; /* un peu avant la fin de la colonne */
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-layout {
        flex-direction: column;
    }
    
    .stats-column-left,
    .stats-column-right {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .match-header {
        flex-direction: column;
        align-items: flex-start;
    }
}