/* Base styles */
html {
    height: 100%;
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100%;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Typography Structure */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-md);
}

p {
    margin: 0 0 var(--space-16) 0;
}

a {
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-standard);
}



/* Main Content Layout */
.main-content {
    padding: 20px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.main-content.show {
    opacity: 1;
    transform: translateY(0);
}

/* Tabs Layout */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gamer-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Tab Select Styles */
.mobile-tabs-container {
    display: none;
    position: relative;
    z-index: 100;
}

.custom-dropdown {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    position: relative;
}

.dropdown-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--gaming-surface);
    color: var(--gaming-primary);
    border: 2px solid var(--gaming-primary);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dropdown-btn:hover,
.dropdown-btn.active {
    background: var(--gaming-card);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
}

.dropdown-content {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: var(--gaming-surface);
    border: 2px solid var(--gaming-primary);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.custom-dropdown.open .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 15px 20px;
    color: var(--gaming-text);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    font-weight: 500;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--gaming-primary);
    padding-left: 25px;
}

.dropdown-item.active {
    background: rgba(0, 255, 255, 0.2);
    color: var(--gaming-primary);
    font-weight: bold;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.custom-dropdown.open .btn-arrow {
    transform: rotate(180deg);
}

.gamer-tab {
    position: relative;
    border: none;
    border-radius: 60px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    width: auto;
    padding: 0.8rem 1.5rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s, color 0.2s;
}

.gamer-tab .tab-icon {
    font-size: 1.3em;
    margin-right: 0.5em;
    vertical-align: middle;
}

.gamer-tab .tab-label {
    vertical-align: middle;
}

.gamer-tab .tab-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px 12px 0 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: -1;
}

.gamer-tab.active .tab-glow,
.gamer-tab:focus-visible .tab-glow {
    opacity: 1;
}

.gamer-tab.active,
.gamer-tab:focus-visible {
    transform: scale(1.04);
}

.gamer-tab:hover {
    transform: scale(1.06);
}

.gamer-tab:active {
    transform: scale(0.98);
}

.tabs-content .tab-panel {
    display: none;
    width: 100%;
}

.tabs-content .tab-panel.active {
    display: block;
}

/* Cards Layout */
.leaderboard-card {
    border-radius: 15px;
    padding: 0;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    z-index: 10;
}

.leaderboard-card.show {
    opacity: 1;
    transform: translateY(0);
}

.leaderboard-card:hover {
    transform: translateY(-5px);
    transition: all var(--animation-fast) var(--ease-smooth);
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid transparent;
    /* Border color handled in theme */
    position: relative;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-title {
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fix centering */
    text-align: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 550;
}

.card-header .refresh-btn {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.card-header .refresh-btn:hover {
    transform: translateY(-50%);
}

.card-header .refresh-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Table Layout */
.table-container {
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
}

.leaderboard-table th {
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.leaderboard-table td {
    padding: 8px 25px;
    vertical-align: middle;
}

.leaderboard-table tbody tr {
    transition: all var(--animation-fast) var(--ease-smooth);
    opacity: 0;
    transform: translateX(-20px);
}

.leaderboard-table tbody tr.show {
    opacity: 1;
    transform: translateX(0);
}

.leaderboard-table tbody tr:hover {
    transform: scale(1.02);
}

.rank-col {
    width: 60px;
    text-align: center;
}

.player-col {
    text-align: left;
}

.score-col {
    text-align: center;
    width: 100px;
}

.badge-col {
    display: table-cell;
    width: 60px;
    text-align: center;
}

@media (max-width: 600px) {
    .badge-col {
        display: none;
    }
}

.rank-number {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
}

.player-score {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.badge {
    font-size: 1.5rem;
    text-align: center;
}

/* Buttons Layout */
/* Buttons Layout */

.gaming-btn {
    position: relative;
    border: 2px solid transparent;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--animation-fast) var(--ease-smooth);
}

.gaming-btn:hover {
    transform: translateY(-3px);
}

.btn-icon {
    margin-right: 8px;
    display: inline-block;
}



.table-show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(31, 184, 205, 0.2);
    color: var(--gaming-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    /* Push to bottom if flex container */
    border-radius: 0 0 15px 15px;
}

.table-show-more-btn:hover {
    background: rgba(31, 184, 205, 0.1);
    color: #fff;
    text-shadow: 0 0 8px var(--gaming-primary);
}

.table-show-more-btn .btn-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.table-show-more-btn:hover .btn-icon {
    transform: translateY(2px);
}



/* Responsive Adjustments */
@media (max-width: 999px) {
    .gamer-tabs {
        display: none;
    }

    .mobile-tabs-container {
        display: block;
        margin-bottom: 2rem;
        text-align: center;
    }

    .gamer-tab {
        width: 100%;
        max-width: 300px;
    }

    .gaming-btn {
        width: 200px;
    }
}

/* Hall of Fame Styles */
.hof-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin: 0 auto;
}

/* Hall of Fame Year Section */
.hof-year-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hall of Fame Year Header */
.hof-year-header {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    padding: 2rem 0 1rem 0;
    background: linear-gradient(135deg, #1FB8CD, #FFC300, #FF5733);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    letter-spacing: 4px;
    text-transform: uppercase;
    position: relative;
}

.hof-year-section:first-child .hof-year-header {
    margin-top: 0;
}

.hof-year-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gaming-primary), transparent);
    box-shadow: 0 0 10px var(--gaming-primary);
}

/* Hall of Fame Cards Grid - Auto-fit within each year */
.hof-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 200px));
    gap: 3rem;
    justify-content: center;
}

.hof-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.hof-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--gaming-primary);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    padding-top: 0;
}

.hof-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: static;
}

.hof-image-wrapper:hover .hof-image {
    transform: scale(1.15);
}

.hof-image-wrapper:hover {
    box-shadow: 0 0 30px var(--gaming-primary);
    border-color: var(--gaming-accent);
}

.hof-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    transform: none;
}

.hof-image-wrapper:hover .hof-overlay {
    opacity: 1;
    transform: none;
}

.hof-player {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gaming-primary);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-align: center;
    padding: 0 1rem;
}

.hof-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gaming-accent);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.hof-month {
    font-size: 1.2rem;
    color: var(--gaming-text-dim);
    font-weight: 500;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: static;
    background: transparent;
    padding: 0;
    border: none;
}

.hof-month {
    font-size: 1.2rem;
    color: var(--gaming-text-dim);
    font-weight: 500;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: static;
    /* Override absolute positioning */
    background: transparent;
    padding: 0;
    border: none;
}

/* Hide global show more button when on stats or hall of fame tab */
.main-content[data-active-tab="stats"] .table-show-more-btn,
.main-content[data-active-tab="hall-of-fame"] .table-show-more-btn {
    /* Usually not needed as these tabs don't have the button, but good for safety */
    display: none !important;
}

/* Hall of Fame Epic Text Animation */
.hof-epic-text {
    font-size: 1.5rem;
    line-height: 1.6;
    background: linear-gradient(to right,
            #FFD700 20%,
            #FF8C00 40%,
            #FF0080 60%,
            #00FFFF 80%,
            #FFD700 100%);
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    font-weight: 800;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.hof-epic-text:hover {
    animation-duration: 2s;
    /* Speed up on hover */
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.02);
    transition: transform 0.3s ease;
}