/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   CSS VARIABLES
============================================ */
:root {
    /* Light mode colors */
    --bg: #f8f9fa;
    --bg-alt: #ffffff;
    --bg-secondary: #e5e7eb;
    --bg-subtle: #f1f3f5;
    --text: #1a1a1a;
    --text-light: #6c757d;
    --accent: #3d6e00;
    --accent-hover: #2d5200;
    --accent-hover-subtle: rgba(61, 110, 0, 0.15);
    --xp-event-tournament: #f59e0b;
    --xp-event-season-end: #6366f1;
    --card: #ffffff;
    --border: #e5e7eb;
    --border-dark: #cbd5e1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4a8000 0%, #1f4200 100%);
    --gradient-secondary: linear-gradient(135deg, #6aab00 0%, #3d6e00 100%);
    --gradient-accent: linear-gradient(135deg, #7bc618 0%, #3d6e00 100%);
    --gradient-green-analytics: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    /* Radius */
    --radius: 16px;
    --radius-sm: 8px;
    
    /* Shadows */
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode colors */
body.dark {
    --bg: #0a0a0a;
    --bg-alt: #121212;
    --bg-secondary: #0d0d0d;
    --bg-subtle: #1e1e1e;
    --text: #e2e2e2;
    --text-light: #a0a0a0;
    --accent: #7bc618;
    --accent-hover: #65a814;
    --accent-hover-subtle: rgba(123, 198, 24, 0.12);
    --xp-event-tournament: #f59e0b;
    --xp-event-season-end: #818cf8;
    --card: #121212;
    --border: #222222;
    --border-dark: #333333;

    --gradient-primary: linear-gradient(135deg, #7bc618 0%, #3d6e00 100%);
    --gradient-secondary: linear-gradient(135deg, #7bc618 0%, #1f4200 100%);
    --gradient-accent: linear-gradient(135deg, #7bc618 0%, #007a30 100%);

    --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.6), 0 2px 4px -1px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.7), 0 4px 6px -2px rgba(0,0,0,0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.8), 0 10px 10px -5px rgba(0,0,0,0.7);
}

/* Dark mode - Select elements fix */
body.dark select,
body.dark .filter-select,
body.dark .slot-select,
body.dark .player-select,
body.dark .bey-select {
    background-color: var(--bg-alt);
    color: var(--text);
    border-color: var(--border);
    color-scheme: dark;
}

body.dark select option,
body.dark .filter-select option,
body.dark .slot-select option,
body.dark .player-select option,
body.dark .bey-select option {
    background-color: var(--bg-alt);
    color: var(--text);
}

/* ============================================
   GLOBAL STYLES
============================================ */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0.5rem 0;
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================
   ACCESSIBILITY
============================================ */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--accent-hover);
    outline-offset: 2px;
}

/* ============================================
   HEADER & NAVIGATION
============================================ */
header {
    background: var(--bg-alt);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header-link {
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.header-link:hover {
    opacity: 0.8;
}

.home-icon {
    font-size: 1.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-icon:hover,
.home-icon:focus-visible {
    transform: scale(1.15);
    background: var(--bg);
    outline: none;
}

.home-icon:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav a,
nav button {
    margin: 0;
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    color: var(--text-light);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

nav a:hover,
nav a:focus-visible {
    color: var(--accent);
    background: var(--bg);
    transform: translateY(-2px);
}

/* Active page indicator */
nav a.active {
    color: var(--accent);
    background: var(--accent-hover-subtle);
    font-weight: 700;
}

nav button {
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
}

nav button:hover {
    transform: scale(1.1) rotate(10deg);
}

/* ============================================
   THEME SWITCH (Dark Mode Toggle)
============================================ */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: var(--transition);
    border-radius: 24px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.theme-slider:before {
    position: absolute;
    content: "🌙";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-switch input:checked + .theme-slider {
    background: var(--accent);
}

.theme-switch input:checked + .theme-slider:before {
    content: "☀️";
    transform: translateX(26px);
}

.theme-switch input:focus + .theme-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   HAMBURGER MENU
============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.hamburger:hover,
.hamburger:focus-visible {
    background: var(--bg);
    outline: none;
}

.hamburger:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   NAV DROPDOWN MENU
============================================ */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    color: var(--text-light);
    background: transparent;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
    font-family: 'Inter', sans-serif;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible {
    color: var(--accent);
    background: var(--bg);
    transform: translateY(-2px);
    outline: none;
}

.nav-dropdown-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
}

/* Arrow icon for dropdown toggles */
.nav-dropdown-toggle .nav-arrow {
    font-size: 0.625rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-toggle .nav-arrow,
.nav-dropdown.active .nav-dropdown-toggle .nav-arrow {
    transform: rotate(180deg);
}

/* Nav icon styling */
.nav-icon {
    font-size: 1rem;
    margin-right: 0.25rem;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    /* Width increased to accommodate icons + text in dropdown items */
    min-width: 180px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

/* Touch device dropdown support - show dropdown on .active class toggle */
/* This ensures dropdowns work on tablets at desktop breakpoints */
.nav-dropdown.active .nav-dropdown-content {
    display: block;
}

/* On touch devices, disable hover-only dropdown to prevent flicker */
body.touch-device .nav-dropdown:hover .nav-dropdown-content {
    display: none;
}

body.touch-device .nav-dropdown.active .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

.nav-dropdown-content a:hover,
.nav-dropdown-content a:focus-visible {
    background: var(--bg);
    color: var(--accent);
    transform: none;
    outline: none;
}

.nav-dropdown-content a:focus-visible {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Dropdown item icons */
.nav-dropdown-content a .nav-item-icon {
    font-size: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

/* ============================================
   BREADCRUMB NAVIGATION
============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    padding: 0.5rem 0 1rem 0;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    outline: none;
}

.breadcrumb-separator {
    color: var(--border);
    user-select: none;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
============================================ */
main {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}

main h2 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

/* ============================================
   GRID & TILES
============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tile {
    padding: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    display: block;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.tile:hover::before {
    transform: scaleX(1);
}

.tile:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.tile h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text);
}

.tile p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ============================================
   GALLERY
============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 0;
}

.gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gallery img {
    width: 100%;
    border-radius: var(--radius);
    cursor: zoom-in;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.gallery img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-xl);
}

.profile-link-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
}

.profile-link-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ============================================
   IMAGE VIEWER
============================================ */
#viewerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

#viewerOverlay .viewer-image-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#viewerOverlay img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    object-fit: contain;
    box-shadow: var(--shadow-xl);
}

.viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 2.5rem;
    color: #1a1a1a;
    cursor: pointer;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 1001;
    line-height: 1;
    font-weight: 600;
}

body.dark .viewer-nav {
    background: rgba(18, 18, 18, 0.95);
    color: #f0f0f0;
}

.viewer-nav:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.viewer-nav.prev {
    left: 2rem;
}

.viewer-nav.next {
    right: 2rem;
}

.viewer-title {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.125rem;
    z-index: 1001;
    max-width: 80%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

body.dark .viewer-title {
    background: rgba(18, 18, 18, 0.95);
    color: #f0f0f0;
}

.viewer-counter {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
}

body.dark .viewer-counter {
    background: rgba(18, 18, 18, 0.95);
    color: #f0f0f0;
}

/* ============================================
   SEARCH
============================================ */
.search-container {
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow);
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#searchInput::placeholder {
    color: var(--text-light);
}

/* ============================================
   LEADERBOARD CONTROLS
============================================ */
.leaderboard-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* Arena Selector Styles */
.arena-selector-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.arena-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.arena-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 250px;
}

.arena-select:hover {
    border-color: var(--accent);
}

.arena-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.version-selector-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.version-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.version-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 160px;
}

.version-select:hover {
    border-color: var(--accent);
}

.version-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.version-select:disabled,
.arena-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.toggle-switch {
    position: relative;
    width: 56px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: var(--transition);
    border-radius: 28px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Active state for toggle text */
.toggle-label:has(input:not(:checked)) .toggle-text:first-child,
.toggle-label:has(input:checked) .toggle-text:last-child {
    color: var(--accent);
    font-weight: 700;
}

/* ============================================
   MATCH INDEX HISTORICAL CONTROLS
============================================ */
.match-index-controls {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.match-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.match-index-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-index-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.match-index-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.toggle-text-small {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
}

.match-index-slider-container {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.match-index-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.match-index-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-light);
}

.match-index-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 4rem;
    text-align: center;
}

.match-index-total {
    font-size: 0.9375rem;
    color: var(--text-light);
}

.slider-wrapper {
    margin: 1rem 0;
}

.match-index-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    cursor: pointer;
}

.match-index-slider:hover {
    opacity: 1;
}

.match-index-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.match-index-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
}

.match-index-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.match-index-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
}

.slider-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.slider-marker {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.match-index-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.match-index-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.match-index-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.match-index-btn:active {
    transform: translateY(0);
}

.match-index-reset {
    background: var(--text-light);
}

.match-index-reset:hover {
    background: var(--text);
}

.match-index-input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.match-index-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Match Details Display */
.match-details {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    text-align: center;
}

.match-details-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-details-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.match-id {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.match-team-a,
.match-team-b {
    font-weight: 600;
    color: var(--text);
}

.match-score {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.125rem;
    padding: 0 0.5rem;
}

/* ============================================
   LEGEND
============================================ */
.legend {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
}

.legend-header:hover {
    background: var(--bg);
}

.legend-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.legend-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    transition: var(--transition);
}

.legend-toggle:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.legend-content {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.legend-content.expanded {
    max-height: 2000px;
    overflow-y: auto;
    padding: 1.25rem;
}

.legend-content.collapsed {
    max-height: 0;
    padding: 0 1.25rem;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.legend-item:hover {
    background: var(--bg);
    border-bottom-color: var(--border);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-sm);
}

.legend-abbr {
    font-weight: 700;
    color: var(--accent);
    min-width: 70px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.legend-desc {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.legend-short {
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.legend-long {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Legacy support for old format */
.legend-full {
    color: var(--text-light);
}

/* ============================================
   TABLE
============================================ */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 80px;
}

th {
    font-weight: 700;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: capitalize;
    letter-spacing: 0.025em;
    font-size: 0.8125rem;
}

td {
    font-size: 0.875rem;
}

/* Specific minimum widths for important columns */
th:nth-child(1), td:nth-child(1) { min-width: 60px; text-align: center; } /* Platz/Rank */
th:nth-child(2), td:nth-child(2) { min-width: 120px; } /* Name/Bey */
th:nth-child(3), td:nth-child(3) { min-width: 70px; } /* ELO */

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

th.sortable::after {
    content: "⇅";
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.75rem;
}

th.sortable.sorted-asc::after {
    content: "▲";
    opacity: 1;
    color: var(--accent);
}

th.sortable.sorted-desc::after {
    content: "▼";
    opacity: 1;
    color: var(--accent);
}

th.sorted-asc,
th.sorted-desc {
    color: var(--accent);
}

/* ELO Highlights */
.elo-high,
.delta-pos-up,
.delta-elo-up {
    color: #10b981;
    font-weight: 700;
}

.elo-low,
.delta-pos-down,
.delta-elo-down {
    color: #ef4444;
    font-weight: 700;
}

.delta-neutral {
    color: var(--text-light);
    opacity: 0.7;
}

/* ============================================
   INLINE ELO DELTA BADGE (next to Bey names)
============================================ */
.bey-with-delta {
    white-space: nowrap;
}

.elo-delta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

.elo-delta-badge.delta-up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.elo-delta-badge.delta-down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.elo-delta-badge .delta-arrow {
    font-size: 0.625rem;
}

/* Dark mode adjustments for delta badge */
body.dark .elo-delta-badge.delta-up {
    background: rgba(16, 185, 129, 0.2);
}

body.dark .elo-delta-badge.delta-down {
    background: rgba(239, 68, 68, 0.2);
}

/* Mobile card bey-name with delta badge */
.card-bey .bey-name {
    display: block;
    text-align: center;
    margin-bottom: 0.25rem;
}

/* Mobile card ELO change badge row */
.card-bey .bey-elo-change {
    display: flex;
    justify-content: center;
    margin-bottom: 0.375rem;
}

.card-bey .bey-elo-change .elo-delta-badge {
    margin-left: 0;
}

/* ELO Trend Highlights - applies to both table cells and mobile card details */
.trend-very-positive,
.lb-detail-value.trend-very-positive {
    color: #10b981;
    font-weight: 700;
}

.trend-positive,
.lb-detail-value.trend-positive {
    color: #22c55e;
    font-weight: 600;
}

.trend-neutral,
.lb-detail-value.trend-neutral {
    color: var(--text-light);
    font-weight: 500;
}

.trend-negative,
.lb-detail-value.trend-negative {
    color: #f59e0b;
    font-weight: 600;
}

.trend-very-negative,
.lb-detail-value.trend-very-negative {
    color: #ef4444;
    font-weight: 700;
}

/* ============================================
   FOOTER
============================================ */
footer {
    background: var(--bg-alt);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.875rem;
}

footer p {
    margin: 0;
}

/* ============================================
   MOBILE CARDS (for small screens)
============================================ */
/* Mobile Sort Controls */
.mobile-sort-controls {
    display: none;
    margin: 1rem 0;
}

.sort-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
}

.sort-button:hover {
    background: var(--hover);
}

.sort-button:active {
    transform: scale(0.98);
}

.sort-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.sort-label {
    font-weight: 500;
}

#currentSortLabel {
    font-weight: 700;
    color: var(--primary);
}

/* Sort Modal */
.sort-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.sort-modal.active {
    display: flex;
}

.sort-modal-content {
    background: var(--card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.sort-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sort-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.sort-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
}

.sort-modal-close:hover {
    color: var(--text);
}

.sort-modal-body {
    padding: 1rem;
    max-height: calc(80vh - 5rem);
    overflow-y: auto;
}

.sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-option:hover {
    background: var(--hover);
    border-color: var(--primary);
}

.sort-option.active {
    background: var(--hover);
    border-color: var(--primary);
}

.sort-option-label {
    font-weight: 500;
    color: var(--text);
}

.sort-option-direction {
    display: flex;
    gap: 0.5rem;
}

.direction-btn {
    padding: 0.25rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.direction-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.direction-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#leaderboardCards {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.lb-card {
    background: var(--card);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: relative;
    transition: var(--transition);
}

.lb-card:active {
    transform: scale(0.98);
}

.lb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.lb-card-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-light);
    min-width: 2.5rem;
    text-align: center;
}

.rank-gold {
    color: #d4af37;
}

.rank-silver {
    color: #f0f0f0;
}

.rank-bronze {
    color: #cd7f32;
}

.lb-card-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    flex: 1;
    margin: 0;
}

.lb-card-elo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-top: 0.25rem;
}

.lb-card-elo.trend-very-positive {
    color: #10b981;
}

.lb-card-elo.trend-positive {
    color: #22c55e;
}

.lb-card-elo.trend-neutral {
    color: var(--text);
    opacity: 1.0;
}

.lb-card-elo.trend-negative {
    color: #f59e0b;
}

.lb-card-elo.trend-very-negative {
    color: #ef4444;
}

.lb-card-elo-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
}

.lb-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.lb-stat {
    text-align: center;
}

.lb-stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.lb-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.lb-stat-value.trend-very-positive {
    color: #10b981;
}

.lb-stat-value.trend-positive {
    color: #22c55e;
}

.lb-stat-value.trend-neutral {
    color: var(--text);
    opacity: 1.0;
}

.lb-stat-value.trend-negative {
    color: #f59e0b;
}

.lb-stat-value.trend-very-negative {
    color: #ef4444;
}

.lb-card-expand {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    display: none;
}

.lb-card-expand.expanded {
    display: block;
}

.lb-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.lb-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.lb-detail-label {
    color: var(--text-light);
    font-weight: 500;
}

.lb-detail-value {
    color: var(--text);
    font-weight: 600;
}

/* Delta colors for mobile card details */
.lb-detail-value.delta-pos-up,
.lb-detail-value.delta-elo-up {
    color: #10b981;
    font-weight: 700;
}

.lb-detail-value.delta-pos-down,
.lb-detail-value.delta-elo-down {
    color: #ef4444;
    font-weight: 700;
}

.lb-detail-value.delta-neutral {
    color: var(--text-light);
    opacity: 0.7;
}

.lb-expand-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.lb-expand-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.lb-expand-btn::after {
    content: " ▼";
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.lb-card-expand.expanded + .lb-expand-btn::after {
    content: " ▲";
}

/* Card actions for compare page */
.lb-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.lb-card-actions .lb-expand-btn {
    flex: 1;
}

.lb-card-actions .add-compare-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.lb-card-actions .add-compare-btn:hover {
    background: var(--accent);
    color: white;
}

.lb-card-actions .add-compare-btn.selected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Compare page specific card styles */
.compare-card .compare-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
}

.compare-card .lb-stat {
    text-align: center;
    padding: 0.25rem;
}

.compare-card .lb-stat-label {
    font-size: 0.625rem;
    margin-bottom: 0.125rem;
}

.compare-card .lb-stat-value {
    font-size: 0.875rem;
}

.compare-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.compare-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compare-total-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.compare-total-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.compare-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compare-add-btn:hover {
    background: var(--accent);
    color: white;
}

.compare-add-btn.selected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Stats cards container for compare page */
#statsCards {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ============================================
   WIKI PAGE STYLES
============================================ */
.wiki-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.wiki-controls .search-container {
    width: 100%;
    max-width: 600px;
}

#wikiSearch {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow);
}

#wikiSearch:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#wikiSearch::placeholder {
    color: var(--text-light);
}

.tournament-filter-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
}

.tournament-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 600;
    color: var(--text);
    user-select: none;
}

.tournament-filter-label:hover {
    border-color: var(--accent);
    background: var(--bg-alt);
}

.tournament-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--accent);
}

.tournament-filter-text {
    font-size: 0.9375rem;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.filter-select:hover {
    border-color: var(--accent);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-section {
    width: 100%;
    text-align: center;
}

.filter-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

.filter-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    background: var(--bg);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.bey-count {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.wiki-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.wiki-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.wiki-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: var(--bg);
    overflow: hidden;
}

.wiki-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.wiki-card:hover .wiki-card-image img {
    transform: scale(1.05);
}

.wiki-card-type {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Rank Badge on Wiki Card - now inline with title */
.wiki-card-rank {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

body.dark .wiki-card-rank {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Shimmer animation for top 3 ranks */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Gold rank for #1 */
.wiki-card-rank.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #1a1a1a;
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.wiki-card-rank.rank-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    pointer-events: none;
}

body.dark .wiki-card-rank.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffcc00 100%);
    color: #1a1a1a;
    border: 2px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Silver rank for #2 */
.wiki-card-rank.rank-silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
    color: #1a1a1a;
    border: 1px solid rgba(192, 192, 192, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(192, 192, 192, 0.4);
    position: relative;
    overflow: hidden;
}

.wiki-card-rank.rank-silver::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    animation-delay: 0.3s;
    pointer-events: none;
}

body.dark .wiki-card-rank.rank-silver {
    background: linear-gradient(135deg, #d4d4d4 0%, #a8a8a8 100%);
    color: #1a1a1a;
    border: 2px solid #c0c0c0;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.6), 0 0 20px rgba(192, 192, 192, 0.3);
}

/* Bronze rank for #3 */
.wiki-card-rank.rank-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
    color: #ffffff;
    border: 1px solid rgba(205, 127, 50, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(205, 127, 50, 0.4);
    position: relative;
    overflow: hidden;
}

.wiki-card-rank.rank-bronze::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    animation-delay: 0.6s;
    pointer-events: none;
}

body.dark .wiki-card-rank.rank-bronze {
    background: linear-gradient(135deg, #d4883a 0%, #b8742e 100%);
    color: #ffffff;
    border: 2px solid #cd7f32;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.6), 0 0 20px rgba(205, 127, 50, 0.3);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .wiki-card-rank.rank-gold::after,
    .wiki-card-rank.rank-silver::after,
    .wiki-card-rank.rank-bronze::after {
        animation: none;
    }
}

/* Trophy container on Wiki Card - now in content area */
.wiki-card-trophies {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.trophy-icon {
    font-size: 1.125rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    cursor: default;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.trophy-icon:hover {
    transform: scale(1.2);
}

.achievement-icon {
    width: 1.25em;
    height: 1.25em;
    vertical-align: text-bottom;
    display: inline-block;
    object-fit: contain;
}

.wiki-card-type.attack {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.wiki-card-type.defense {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.wiki-card-type.stamina {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.wiki-card-type.balance {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.wiki-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title row with rank badge */
.wiki-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wiki-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.wiki-card-code {
    font-size: 0.8125rem;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-sm);
    display: inline-block;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

/* Basic Line (BX) - Blue */
.wiki-card-code.basic-line {
    background: linear-gradient(135deg, #70bbe9 0%, #4a9fd9 100%);
    box-shadow: 0 2px 12px rgba(112, 187, 233, 0.4), 0 0 20px rgba(112, 187, 233, 0.2);
}

.wiki-card:hover .wiki-card-code.basic-line {
    box-shadow: 0 4px 16px rgba(112, 187, 233, 0.6), 0 0 30px rgba(112, 187, 233, 0.3);
    transform: translateY(-2px);
}

/* Unique Line (UX) - Orange */
.wiki-card-code.unique-line {
    background: linear-gradient(135deg, #ee7700 0%, #cc6600 100%);
    box-shadow: 0 2px 12px rgba(238, 119, 0, 0.4), 0 0 20px rgba(238, 119, 0, 0.2);
}

.wiki-card:hover .wiki-card-code.unique-line {
    box-shadow: 0 4px 16px rgba(238, 119, 0, 0.6), 0 0 30px rgba(238, 119, 0, 0.3);
    transform: translateY(-2px);
}

/* Custom Line (CX) - Red/Pink */
.wiki-card-code.custom-line {
    background: linear-gradient(135deg, #e8314a 0%, #c92842 100%);
    box-shadow: 0 2px 12px rgba(232, 49, 74, 0.4), 0 0 20px rgba(232, 49, 74, 0.2);
}

.wiki-card:hover .wiki-card-code.custom-line {
    box-shadow: 0 4px 16px rgba(232, 49, 74, 0.6), 0 0 30px rgba(232, 49, 74, 0.3);
    transform: translateY(-2px);
}

.wiki-card:hover .wiki-card-code {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

/* Wiki Card Archetype Badge */
.wiki-card-archetype {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--bg);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.wiki-card-archetype.archetype-category-offense {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.wiki-card-archetype.archetype-category-defense {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.wiki-card-archetype.archetype-category-stamina {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.wiki-card-archetype.archetype-category-control {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.wiki-card-archetype.archetype-category-balance {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #8b5cf6;
}

.wiki-card-archetype.archetype-category-unknown {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.4);
    color: #6b7280;
}

.wiki-card-archetype .archetype-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.wiki-card-archetype .archetype-name {
    font-size: 0.6875rem;
    line-height: 1;
}

/* Wiki Card Stats (ELO and Power Index) */
.wiki-card-stats {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    justify-content: center;
}

.wiki-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem 0.75rem;
}

.wiki-stat-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wiki-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.wiki-stat-value.trend-very-positive {
    color: #10b981;
}

.wiki-stat-value.trend-positive {
    color: #22c55e;
}

.wiki-stat-value.trend-neutral {
    color: var(--text-light);
}

.wiki-stat-value.trend-negative {
    color: #f59e0b;
}

.wiki-stat-value.trend-very-negative {
    color: #ef4444;
}

.wiki-card-description {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    flex: 1;
}

.wiki-card-parts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.part-label {
    color: var(--text-light);
    font-weight: 600;
}

.part-value {
    color: var(--accent);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 768px) {
    /* Hamburger menu visible on mobile */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 4.5rem;
        right: -100%;
        width: 280px;
        max-width: 80vw;
        background: var(--bg-alt);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 1rem;
        box-shadow: var(--shadow-xl);
        border-left: 1px solid var(--border);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 0.5rem;
        max-height: calc(100vh - 4.5rem);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu a,
    .nav-menu button {
        width: 100%;
        text-align: left;
        padding: 0.875rem 1rem;
        margin: 0;
        border-radius: var(--radius-sm);
    }
    
    .nav-menu a:hover,
    .nav-menu button:hover {
        transform: none;
    }
    
    /* Mobile dropdown styles */
    .nav-dropdown {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 1rem;
        justify-content: space-between;
        font-weight: 600;
        border-radius: var(--radius-sm);
    }
    
    .nav-dropdown.active .nav-dropdown-toggle {
        background: var(--bg);
    }
    
    .nav-dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: var(--radius-sm);
        background: var(--bg);
        padding-left: 0;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        overflow: hidden;
    }
    
    .nav-dropdown.active .nav-dropdown-content {
        display: block;
        animation: slideDown 0.2s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-dropdown-content a {
        padding: 0.875rem 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        transition: var(--transition);
    }
    
    .nav-dropdown-content a:hover,
    .nav-dropdown-content a:focus-visible {
        border-left-color: var(--accent);
        background: rgba(99, 102, 241, 0.1);
    }
    
    header {
        padding: 1rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 1.125rem;
        flex-shrink: 0;
    }
    
    main {
        padding: 1.5rem 1rem;
        overflow-x: hidden;
    }
    
    main h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .tile {
        padding: 1.25rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .viewer-nav {
        font-size: 2rem;
        padding: 0.75rem 1rem;
    }
    
    .viewer-nav.prev {
        left: 1rem;
    }
    
    .viewer-nav.next {
        right: 1rem;
    }
    
    .viewer-title {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        top: 1rem;
    }
    
    th, td {
        padding: 0.5rem 0.375rem;
        font-size: 0.8125rem;
    }
    
    .search-container {
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
    }
    
    #searchInput {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .leaderboard-controls {
        gap: 1rem;
    }
    
    .toggle-text {
        font-size: 0.875rem;
    }
    
    .toggle-switch {
        width: 48px;
        height: 24px;
    }
    
    .toggle-slider:before {
        height: 16px;
        width: 16px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(24px);
    }

    .legend-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .legend-item {
        font-size: 0.8125rem;
    }
    
    /* Wiki page mobile styles */
    .wiki-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-container {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.875rem 1rem;
    }
    
    header h1 {
        font-size: 1rem;
    }
    
    nav a, nav button {
        padding: 0.4375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    nav button {
        font-size: 1.125rem;
        padding: 0.375rem 0.5rem;
    }
    
    main {
        padding: 1.25rem 0.875rem;
        overflow-x: hidden;
    }
    
    main h2 {
        font-size: 1.5rem;
    }
    
    .tile {
        padding: 1rem;
    }
    
    .tile h3 {
        font-size: 1.0625rem;
    }
    
    .tile p {
        font-size: 0.875rem;
    }
    
    #searchInput {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    #matchesCards {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 1rem 0;
    }
    
    .matches-card {
        padding: 0.75rem 0.625rem;
        width: calc(100% - 2px);
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        margin-left: auto;
        margin-right: auto;
    }
    
    .card-bey {
        padding: 0.5rem 0.25rem;
    }
    
    .bey-name {
        font-size: 0.8125rem;
    }
    
    .bey-score {
        font-size: 1.125rem;
    }
}

/* ============================================
   MATCHES PAGE STYLES
============================================ */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-controls label {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    background: var(--bg-alt);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.filter-controls select:hover {
    border-color: var(--accent);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Match table specific styles */
#matchesTable .winner {
    font-weight: 600;
    color: var(--accent);
}

#matchesTable .score-winner {
    font-weight: 700;
    color: var(--accent);
}

#matchesTable .match-winner {
    font-weight: 600;
}

/* Match cards for mobile */
#matchesCards {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Matches page card styling - ensures proper vertical layout */
.matches-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    transition: var(--transition);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.matches-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.card-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1rem 0;
    width: 100%;
    box-sizing: border-box;
}

.card-bey {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    overflow: hidden;
    word-wrap: break-word;
}

.card-bey.winner {
    background: var(--accent);
    color: white;
}

.bey-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bey-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-bey.winner .bey-score {
    color: white;
}

.card-vs {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.875rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.card-date {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.card-footer {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-light);
}

.card-footer strong {
    color: var(--accent);
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    main {
        padding: 2rem 0.75rem;
        overflow-x: hidden;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .filter-controls select {
        width: 100%;
    }
    
    .leaderboard-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    #matchesCards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .matches-card {
        padding: 0.875rem 0.75rem;
        width: calc(100% - 2px);
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        margin-left: auto;
        margin-right: auto;
    }
    
    .card-match {
        gap: 0.375rem;
    }
    
    .card-bey {
        padding: 0.625rem 0.375rem;
    }
    
    .bey-name {
        font-size: 0.875rem;
    }
    
    .bey-score {
        font-size: 1.25rem;
    }
    
    .bey-elo,
    .bey-elo-change {
        font-size: 0.75rem;
    }
}

/* ============================================
   BEY PROFILE PAGE STYLES
============================================ */
.bey-profile {
    max-width: 1000px;
    margin: 0 auto;
}

.loading-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.125rem;
}

.error-state a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.error-state a:hover {
    text-decoration: underline;
}

.profile-header {
    display: flex;
    gap: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.profile-image-container {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.profile-type {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    box-shadow: var(--shadow-md);
}

.profile-type.attack {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.profile-type.defense {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.profile-type.stamina {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.profile-type.balance {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-code {
    display: inline-block;
    font-size: 0.875rem;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-code.basic-line {
    background: linear-gradient(135deg, #70bbe9 0%, #4a9fd9 100%);
    box-shadow: 0 2px 12px rgba(112, 187, 233, 0.4);
}

.profile-code.unique-line {
    background: linear-gradient(135deg, #ee7700 0%, #cc6600 100%);
    box-shadow: 0 2px 12px rgba(238, 119, 0, 0.4);
}

.profile-code.custom-line {
    background: linear-gradient(135deg, #e8314a 0%, #c92842 100%);
    box-shadow: 0 2px 12px rgba(232, 49, 74, 0.4);
}

/* Profile Trophies */
.profile-trophies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-trophy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: var(--shadow-md), 0 0 15px rgba(255, 215, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.profile-trophy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 25px rgba(255, 215, 0, 0.6);
}

.profile-trophy-icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
}

.profile-trophy-name {
    letter-spacing: 0.025em;
}

/* Season Champion Badges (Profile) */
.profile-season-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.season-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    cursor: default;
}

.season-badge:hover {
    transform: translateY(-2px);
}

.season-badge-tier1 {
    background: linear-gradient(135deg, #c8a400 0%, #e5c000 100%);
    color: #1a1a1a;
    box-shadow: var(--shadow-md), 0 0 14px rgba(200, 164, 0, 0.45);
}

.season-badge-tier1:hover {
    box-shadow: var(--shadow-lg), 0 0 22px rgba(200, 164, 0, 0.65);
}

.season-badge-tier2 {
    background: linear-gradient(135deg, #8a9aa8 0%, #afc0cc 100%);
    color: #1a1a1a;
    box-shadow: var(--shadow-md), 0 0 14px rgba(138, 154, 168, 0.45);
}

.season-badge-tier2:hover {
    box-shadow: var(--shadow-lg), 0 0 22px rgba(138, 154, 168, 0.65);
}

.season-badge-tier3 {
    background: linear-gradient(135deg, #a0673a 0%, #c07d4a 100%);
    color: #fff;
    box-shadow: var(--shadow-md), 0 0 14px rgba(160, 103, 58, 0.45);
}

.season-badge-tier3:hover {
    box-shadow: var(--shadow-lg), 0 0 22px rgba(160, 103, 58, 0.65);
}

.season-badge-cup {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: #fff;
    box-shadow: var(--shadow-md), 0 0 14px rgba(99, 102, 241, 0.45);
}

.season-badge-cup:hover {
    box-shadow: var(--shadow-lg), 0 0 22px rgba(99, 102, 241, 0.65);
}

.season-badge-icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.season-badge-name {
    letter-spacing: 0.025em;
}

/* Season champion icons on wiki cards */
.wiki-card-season-badges {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.season-icon {
    font-size: 1.125rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    cursor: default;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.season-icon:hover {
    transform: scale(1.2);
}

/* Season History Table */
.season-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.season-history-table th,
.season-history-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.season-history-table th {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--card);
}

.season-history-table tbody tr:hover {
    background: var(--card-hover, rgba(99, 102, 241, 0.05));
}

.season-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    vertical-align: middle;
    margin-left: 0.25rem;
    cursor: default;
}

.season-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.season-link:hover {
    text-decoration: underline;
}

.profile-description {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    flex: 1;
}

.profile-parts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.profile-section {
    margin-bottom: 2rem;
}

/* Arena Plot Selector for Bey Pages */
.arena-plot-selector-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.arena-plot-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.arena-plot-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 250px;
}

.arena-plot-select:hover {
    border-color: var(--accent);
}

.arena-plot-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text);
}

/* Collapsible Profile Section Details */
.profile-section-details {
    margin-bottom: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.section-summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-summary::-webkit-details-marker {
    display: none;
}

.section-summary::after {
    content: "▼";
    font-size: 0.625rem;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.profile-section-details[open] .section-summary::after {
    transform: rotate(180deg);
}

.section-summary:hover {
    background: var(--bg-alt);
}

.profile-section-details .stats-grid {
    padding: 1rem 1.25rem;
}

/* Key Stats Grid (ELO and Power Index) */
.key-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.key-stat-card {
    background: linear-gradient(135deg, var(--card) 0%, var(--bg) 100%);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.key-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.key-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.key-stat-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.key-stat-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.key-stat-value.trend-very-positive {
    color: #10b981;
}

.key-stat-value.trend-positive {
    color: #22c55e;
}

.key-stat-value.trend-neutral {
    color: var(--text-light);
}

.key-stat-value.trend-negative {
    color: #f59e0b;
}

.key-stat-value.trend-very-negative {
    color: #ef4444;
}

/* Key stat card border colors based on trend */
.key-stat-card.trend-very-positive {
    border-color: #10b981;
}

.key-stat-card.trend-very-positive::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.key-stat-card.trend-positive {
    border-color: #22c55e;
}

.key-stat-card.trend-positive::before {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.key-stat-card.trend-neutral {
    border-color: var(--text-light);
}

.key-stat-card.trend-neutral::before {
    background: linear-gradient(90deg, var(--text-light), var(--text-light));
}

.key-stat-card.trend-negative {
    border-color: #f59e0b;
}

.key-stat-card.trend-negative::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.key-stat-card.trend-very-negative {
    border-color: #ef4444;
}

.key-stat-card.trend-very-negative::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.key-stat-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
    text-align: center;
}

.stat-value.trend-very-positive {
    color: #10b981;
}

.stat-value.trend-positive {
    color: #22c55e;
}

.stat-value.trend-neutral {
    color: var(--text-light);
}

.stat-value.trend-negative {
    color: #f59e0b;
}

.stat-value.trend-very-negative {
    color: #ef4444;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Recent Matches */
.recent-matches {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.match-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.match-card.win {
    border-left: 4px solid #10b981;
}

.match-card.loss {
    border-left: 4px solid #ef4444;
}

.match-result {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 50px;
    text-align: center;
}

.match-card.win .match-result {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.match-card.loss .match-result {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.match-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.match-opponent {
    font-size: 0.9375rem;
    color: var(--text);
}

.opponent-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.opponent-link:hover {
    text-decoration: underline;
}

.match-score {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.match-date {
    font-size: 0.8125rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Profile Plot */
.profile-plot-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.profile-plot {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Clickable Bey Names */
.bey-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.bey-link:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Fix bey-link color in winner cards (mobile matches view) */
.card-bey.winner .bey-link {
    color: white;
}

.card-bey.winner .bey-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Wiki Card Clickable */
.wiki-card-clickable {
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    
    .profile-image-container {
        width: 150px;
        height: 150px;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .match-card {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .match-date {
        width: 100%;
        text-align: right;
    }
}

/* ============================================
   BEY HOVER CARD STYLES
============================================ */
.bey-hover-card {
    position: absolute;
    z-index: 9999;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.bey-hover-card.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.hover-card-inner {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
}

.hover-card-image {
    position: relative;
    width: 100%;
    height: 140px;
    background: var(--bg);
    overflow: hidden;
}

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

.hover-card-type {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    box-shadow: var(--shadow);
}

.hover-card-type.attack {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.hover-card-type.defense {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.hover-card-type.stamina {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.hover-card-type.balance {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.hover-card-content {
    padding: 1rem;
}

.hover-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.hover-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.hover-card-rank {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

body.dark .hover-card-rank {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gold rank for #1 - hover card */
.hover-card-rank.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #1a1a1a;
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.hover-card-rank.rank-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    pointer-events: none;
}

body.dark .hover-card-rank.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffcc00 100%);
    color: #1a1a1a;
    border: 2px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Silver rank for #2 - hover card */
.hover-card-rank.rank-silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
    color: #1a1a1a;
    border: 1px solid rgba(192, 192, 192, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(192, 192, 192, 0.4);
    position: relative;
    overflow: hidden;
}

.hover-card-rank.rank-silver::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    animation-delay: 0.3s;
    pointer-events: none;
}

body.dark .hover-card-rank.rank-silver {
    background: linear-gradient(135deg, #d4d4d4 0%, #a8a8a8 100%);
    color: #1a1a1a;
    border: 2px solid #c0c0c0;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.6), 0 0 20px rgba(192, 192, 192, 0.3);
}

/* Bronze rank for #3 - hover card */
.hover-card-rank.rank-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
    color: #ffffff;
    border: 1px solid rgba(205, 127, 50, 0.5);
    box-shadow: var(--shadow), 0 0 8px rgba(205, 127, 50, 0.4);
    position: relative;
    overflow: hidden;
}

.hover-card-rank.rank-bronze::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
    animation-delay: 0.6s;
    pointer-events: none;
}

body.dark .hover-card-rank.rank-bronze {
    background: linear-gradient(135deg, #d4883a 0%, #b8742e 100%);
    color: #ffffff;
    border: 2px solid #cd7f32;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.6), 0 0 20px rgba(205, 127, 50, 0.3);
}

/* Respect reduced motion preferences for hover card ranks */
@media (prefers-reduced-motion: reduce) {
    .hover-card-rank.rank-gold::after,
    .hover-card-rank.rank-silver::after,
    .hover-card-rank.rank-bronze::after {
        animation: none;
    }
}

.hover-card-code {
    display: inline-block;
    font-size: 0.6875rem;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(var(--accent-rgb, 124, 58, 237), 0.5),
                0 0 20px rgba(var(--accent-rgb, 124, 58, 237), 0.3);
}

.hover-card-code.basic-line {
    background: linear-gradient(135deg, #70bbe9 0%, #4a9fd9 100%);
    box-shadow: 0 0 10px rgba(112, 187, 233, 0.5),
                0 0 20px rgba(112, 187, 233, 0.3);
}

.hover-card-code.unique-line {
    background: linear-gradient(135deg, #ee7700 0%, #cc6600 100%);
    box-shadow: 0 0 10px rgba(238, 119, 0, 0.5),
                0 0 20px rgba(238, 119, 0, 0.3);
}

.hover-card-code.custom-line {
    background: linear-gradient(135deg, #e8314a 0%, #c92842 100%);
    box-shadow: 0 0 10px rgba(232, 49, 74, 0.5),
                0 0 20px rgba(232, 49, 74, 0.3);
}

.hover-card-archetype {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* When archetype has a category, style the entire card */
.hover-card-archetype.archetype-category-offense {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4),
                0 0 20px rgba(239, 68, 68, 0.2);
}

.hover-card-archetype.archetype-category-defense {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4),
                0 0 20px rgba(59, 130, 246, 0.2);
}

.hover-card-archetype.archetype-category-stamina {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4),
                0 0 20px rgba(16, 185, 129, 0.2);
}

.hover-card-archetype.archetype-category-control {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4),
                0 0 20px rgba(245, 158, 11, 0.2);
}

.hover-card-archetype.archetype-category-balance {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4),
                0 0 20px rgba(139, 92, 246, 0.2);
}

.hover-card-archetype.archetype-category-unknown {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.3);
    box-shadow: 0 0 10px rgba(107, 114, 128, 0.4),
                0 0 20px rgba(107, 114, 128, 0.2);
}

.archetype-icon {
    font-size: 0.875rem;
    line-height: 1;
}

.archetype-name {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hover-card-description {
    color: var(--text-light);
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hover Card Stats (ELO and Power Index) */
.hover-card-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dynamic glow effects based on ELO rating */
.hover-card-stats.trend-very-positive {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3),
                0 0 20px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
}

.hover-card-stats.trend-positive {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3),
                0 0 20px rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.2);
}

.hover-card-stats.trend-neutral {
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.3),
                0 0 20px rgba(156, 163, 175, 0.15);
    border-color: rgba(156, 163, 175, 0.2);
}

.hover-card-stats.trend-negative {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3),
                0 0 20px rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.2);
}

.hover-card-stats.trend-very-negative {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3),
                0 0 20px rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.2);
}

.hover-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem 0.75rem;
}

.hover-stat-label {
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hover-stat-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text);
}

.hover-stat-value.trend-very-positive {
    color: #10b981;
}

.hover-stat-value.trend-positive {
    color: #22c55e;
}

.hover-stat-value.trend-neutral {
    color: var(--text-light);
}

.hover-stat-value.trend-negative {
    color: #f59e0b;
}

.hover-stat-value.trend-very-negative {
    color: #ef4444;
}

.hover-card-parts {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.hover-card-part {
    font-size: 0.6875rem;
}

.hover-card-part .part-label {
    color: var(--text-light);
    font-weight: 600;
}

.hover-card-part .part-value {
    color: var(--accent);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.hover-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.625rem;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
}

/* Hide hover cards on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    .bey-hover-card {
        display: none !important;
    }
}

/* Also hide on small screens */
@media (max-width: 768px) {
    .bey-hover-card {
        display: none !important;
    }
}

/* ============================================
   UPSET ANALYSIS PAGE STYLES
============================================ */

/* Summary Cards */
.upset-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.summary-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
    min-width: 0;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
}

.summary-label {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Upset Match Card specific styles */
.upset-match-card {
    position: relative;
}

.upset-magnitude {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
}

.card-bey.loser {
    opacity: 0.9;
}

.bey-elo {
    font-size: 0.75rem;
    color: var(--text);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Win probability styling for upset cards */
.win-probability {
    font-size: 0.6875rem;
    color: #059669;
    font-weight: 700;
    margin-top: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    display: inline-block;
}

body.dark .win-probability {
    color: #34d399;
    background: rgba(52, 211, 153, 0.25);
}

/* Responsive styles for summary cards */
@media (max-width: 768px) {
    .upset-summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-icon {
        font-size: 2rem;
    }
    
    .summary-value {
        font-size: 1rem;
    }
}

/* ============================================
   EXTENDED MATCH HISTORY STYLES
============================================ */

/* Collapsible Filters Panel */
.filters-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 1rem;
    overflow: hidden;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.filters-header:hover {
    background: var(--bg);
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.filters-icon {
    font-size: 1rem;
}

.active-filters-count {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 700;
    display: none;
}

.active-filters-count.visible {
    display: inline-block;
}

.filters-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.filters-content {
    padding: 1rem;
    border-top: 1px solid var(--border);
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    max-height: 500px;
    opacity: 1;
}

.filters-content.collapsed {
    max-height: 0;
    padding: 0 1rem;
    opacity: 0;
    border-top: none;
    overflow: hidden;
}

.filters-content.expanded {
    max-height: 1200px;
    padding: 1rem;
    opacity: 1;
    border-top: 1px solid var(--border);
}

/* Filter Input Fields */
.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    min-width: 80px;
    width: 100px;
}

.filter-input:hover {
    border-color: var(--accent);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-input::placeholder {
    color: var(--text-light);
}

/* Match Count Display */
.match-count {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 1rem 0;
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.625rem 1.25rem;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
}

.pagination-info span {
    font-weight: 700;
    color: var(--accent);
}

/* Match Card ELO Diff Badge */
.match-elo-diff {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Match ID Styling */
.match-id {
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    user-select: all;
}

.match-id:hover {
    background: var(--accent-hover-subtle);
    color: var(--accent);
}

.match-id.copied {
    background: #10b981;
    color: white;
}

.match-id.copied::after {
    content: ' ✓';
}

.match-id-cell {
    text-align: center;
}

.card-match-id {
    margin-right: auto;
}

.timeline-match-id {
    font-size: 0.6875rem;
    flex-shrink: 0;
}

/* Mobile Card Stat Labels */
.stat-label {
    font-size: 0.6875rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.card-bey.winner .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Card ELO Change */
.bey-elo-change {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* ELO display in mobile cards */
.bey-elo {
    font-size: 0.8125rem;
    color: var(--text);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Score display in mobile cards */
.bey-score {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

/* Fix bey-elo-change color inside winner cards */
.card-bey.winner .bey-elo-change {
    color: white;
}

.card-bey.winner .bey-elo-change.delta-elo-up {
    color: #bbf7d0;
}

.card-bey.winner .bey-elo-change.delta-elo-down {
    color: #fecaca;
}

.card-bey.winner .bey-elo {
    color: rgba(255, 255, 255, 0.9);
}

/* Mobile Filter Adjustments */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
        min-width: unset;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-btn {
        width: 100%;
    }
    
    #pageSize {
        width: 100%;
    }
}

/* ============================================
   HISTORY & TIMELINE SECTION STYLES
============================================ */

/* Performance Trends Grid */
.history-trends {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.trend-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.trend-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

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

.trend-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
}

.trend-change {
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.trend-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.trend-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.sparkline-container {
    height: 50px;
    margin: 0.5rem 0;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.trend-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-light);
    font-weight: 500;
}

.no-data-small {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Milestones Section */
.milestones-section {
    margin-bottom: 1.5rem;
}

.subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.milestone-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.milestone-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.milestone-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.milestone-content {
    flex: 1;
    min-width: 0;
}

.milestone-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.milestone-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.125rem 0;
}

.milestone-desc {
    font-size: 0.6875rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Timeline Section */
.timeline-details {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.timeline-summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-summary::-webkit-details-marker {
    display: none;
}

.timeline-summary::after {
    content: "▼";
    font-size: 0.625rem;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.timeline-details[open] .timeline-summary::after {
    transform: rotate(180deg);
}

.timeline-summary:hover {
    background: var(--bg-alt);
}

.timeline-container {
    padding: 1rem 1.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.timeline-day {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.timeline-day:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.timeline-date {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-matches {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.timeline-match {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.timeline-match.win {
    border-left: 3px solid #10b981;
}

.timeline-match.loss {
    border-left: 3px solid #ef4444;
}

.timeline-result {
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    min-width: 1.5rem;
    text-align: center;
}

.timeline-match.win .timeline-result {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.timeline-match.loss .timeline-result {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.timeline-opponent {
    flex: 1;
    color: var(--text);
}

.timeline-score {
    font-weight: 600;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

/* ============================================
   COUNTERS & MATCHUPS SECTION STYLES
============================================ */

.counters-matchups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.matchup-category {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.matchup-category-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.matchup-description {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0 0 1rem 0;
}

.matchup-card-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.matchup-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.matchup-card {
    display: block;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.matchup-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.matchup-card.matchup-hard {
    border-left: 3px solid #ef4444;
}

.matchup-card.matchup-easy {
    border-left: 3px solid #10b981;
}

.matchup-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.matchup-bey-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.matchup-effectiveness {
    font-size: 1rem;
}

.matchup-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.matchup-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.matchup-stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.matchup-stat-value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.counters-page-link {
    text-align: center;
    margin-top: 1.5rem;
}

.view-all-counters-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.view-all-counters-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .counters-matchups-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .matchup-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RELATED BEYS SECTION STYLES
============================================ */

.related-beys-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.related-category {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.related-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.related-beys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.related-bey-card {
    display: flex;
    flex-direction: column;
    padding: 0.875rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid transparent;
}

.related-bey-card:hover {
    background: var(--bg-alt);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.related-bey-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.related-bey-shared,
.related-bey-elo {
    font-size: 0.6875rem;
    color: var(--text-light);
}

/* Frequent Opponents */
.related-beys-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.frequent-opponent-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid transparent;
}

.frequent-opponent-card:hover {
    background: var(--bg-alt);
    border-color: var(--accent);
}

.opponent-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.opponent-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--accent);
}

.opponent-record {
    font-size: 0.75rem;
    color: var(--text-light);
}

.opponent-winrate {
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
}

.opponent-winrate.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.opponent-winrate.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.opponent-winrate.neutral {
    color: var(--text-light);
    background: var(--border);
}

/* Responsive adjustments for history section */
@media (max-width: 768px) {
    .history-trends {
        grid-template-columns: 1fr;
    }
    
    .milestones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-beys-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-container {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .milestones-grid {
        grid-template-columns: 1fr;
    }
    
    .related-beys-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RPG STAT BARS - Parallelogram Tile Design
============================================ */
.rpg-stats-section {
    margin-bottom: 2rem;
}

.rpg-stats-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

/* Wrapper for row + expandable details */
.rpg-stat-row-wrapper {
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.rpg-stat-row-wrapper:last-child {
    margin-bottom: 0;
}

.rpg-stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.rpg-stat-row:hover {
    background: var(--bg);
}

.rpg-stat-label {
    min-width: 110px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rpg-stat-label-icon {
    font-size: 1.125rem;
}

.rpg-stat-info-btn {
    font-size: 0.875rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.rpg-stat-row:hover .rpg-stat-info-btn {
    opacity: 1;
}

.rpg-stat-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Expandable details panel */
.rpg-stat-details {
    display: none;
    padding: 1rem;
    margin-top: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rpg-stat-row-wrapper.expanded .rpg-stat-details {
    display: block;
}

.rpg-stat-row-wrapper.expanded .rpg-stat-row {
    background: var(--bg);
}

.rpg-stat-row-wrapper.expanded .rpg-stat-info-btn {
    opacity: 1;
}

.rpg-stat-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rpg-stat-details-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.rpg-stat-details-score {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--accent);
    background: var(--card);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.rpg-stat-details-desc {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.rpg-stat-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.rpg-stat-detail-item {
    background: var(--card);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.rpg-stat-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.rpg-stat-detail-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
}

.rpg-stat-detail-value {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent);
}

.rpg-stat-detail-desc {
    font-size: 0.6875rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Tile container for parallelogram tiles */
.rpg-stat-tiles {
    display: flex;
    gap: 4px;
    flex: 1;
}

/* Individual parallelogram tile */
.rpg-stat-tile {
    flex: 1;
    height: 24px;
    position: relative;
    transform: skewX(-12deg);
    border: 2px solid var(--border);
    border-radius: 3px;
    background: var(--bg);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

/* Tile fill for full and partial values */
.rpg-stat-tile-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shimmer animation for filled tiles */
.rpg-stat-tile-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: tileShimmer 2s ease-in-out infinite alternate;
}

@keyframes tileShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Stat tile colors for each stat type */
.rpg-stat-tile.attack .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.rpg-stat-tile.attack.filled,
.rpg-stat-tile.attack.partial {
    border-color: #ef4444;
}

.rpg-stat-tile.defense .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.rpg-stat-tile.defense.filled,
.rpg-stat-tile.defense.partial {
    border-color: #3b82f6;
}

.rpg-stat-tile.stamina .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.rpg-stat-tile.stamina.filled,
.rpg-stat-tile.stamina.partial {
    border-color: #10b981;
}

.rpg-stat-tile.control .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.rpg-stat-tile.control.filled,
.rpg-stat-tile.control.partial {
    border-color: #f59e0b;
}

.rpg-stat-tile.meta_impact .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.rpg-stat-tile.meta_impact.filled,
.rpg-stat-tile.meta_impact.partial {
    border-color: #8b5cf6;
}

/* Empty tile styling */
.rpg-stat-tile.empty {
    opacity: 0.5;
}

.rpg-stat-value {
    min-width: 45px;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    text-align: right;
}

/* RPG Stats Tooltip */
.rpg-stat-tooltip {
    position: relative;
    cursor: help;
}

.rpg-stat-tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    min-width: 200px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.5rem;
}

.rpg-stat-tooltip:hover .rpg-stat-tooltip-content,
.rpg-stat-tooltip:focus .rpg-stat-tooltip-content {
    display: block;
}

.rpg-stat-tooltip-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.rpg-stat-tooltip-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
}

.rpg-stat-tooltip-metric-name {
    color: var(--text-light);
}

.rpg-stat-tooltip-metric-value {
    color: var(--text);
    font-weight: 600;
}

/* RPG Stats Summary (compact view) */
.rpg-stats-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.rpg-stat-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    border: 1px solid var(--border);
}

.rpg-stat-badge-icon {
    font-size: 0.875rem;
}

.rpg-stat-badge-value {
    font-weight: 700;
    color: var(--text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rpg-stat-row {
        flex-wrap: wrap;
    }
    
    .rpg-stat-label {
        min-width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .rpg-stat-bar-container {
        width: 100%;
    }
    
    .rpg-stat-tile {
        height: 18px;
    }
    
    .rpg-stat-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .rpg-stat-tiles {
        gap: 3px;
    }
    
    .rpg-stat-tile {
        height: 16px;
    }
    
    .rpg-stat-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================
   ARCHETYPE STYLES
============================================ */
.archetype-container {
    margin-bottom: 1.5rem;
}

.archetype-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 2px solid var(--archetype-color, var(--border));
    position: relative;
    overflow: hidden;
}

.archetype-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--archetype-color, var(--accent));
}

.archetype-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.archetype-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.archetype-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.archetype-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.hover-card-archetype-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.hover-card-archetype-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Apply category colors to the archetype name text */
.hover-card-archetype.archetype-category-offense .hover-card-archetype-name {
    color: #ef4444;
}

.hover-card-archetype.archetype-category-defense .hover-card-archetype-name {
    color: #3b82f6;
}

.hover-card-archetype.archetype-category-stamina .hover-card-archetype-name {
    color: #10b981;
}

.hover-card-archetype.archetype-category-control .hover-card-archetype-name {
    color: #f59e0b;
}

.hover-card-archetype.archetype-category-balance .hover-card-archetype-name {
    color: #8b5cf6;
}

.hover-card-archetype.archetype-category-unknown .hover-card-archetype-name {
    color: #6b7280;
}

.archetype-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.archetype-category-offense {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.archetype-category-defense {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.archetype-category-stamina {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.archetype-category-control {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.archetype-category-balance {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.archetype-category-unknown {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.archetype-description {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.archetype-confidence {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.archetype-confidence-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.archetype-confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.archetype-confidence-fill.confidence-high {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.archetype-confidence-fill.confidence-medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.archetype-confidence-fill.confidence-low {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
}

.archetype-confidence-label {
    font-size: 0.8125rem;
    color: var(--text-light);
    font-weight: 500;
    min-width: 80px;
}

.archetype-candidates {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.archetype-candidates-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.archetype-candidate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.archetype-candidate-name {
    color: var(--text);
}

.archetype-candidate-score {
    color: var(--text-light);
    font-weight: 500;
}

/* Dark mode archetype adjustments */
.dark .archetype-card {
    /* Fallback for older browsers */
    border-color: rgba(107, 114, 128, 0.5);
    /* Modern browsers with color-mix support */
    border-color: color-mix(in srgb, var(--archetype-color, var(--border)) 50%, transparent);
}

.dark .archetype-category-offense {
    background: rgba(239, 68, 68, 0.2);
}

.dark .archetype-category-defense {
    background: rgba(59, 130, 246, 0.2);
}

.dark .archetype-category-stamina {
    background: rgba(16, 185, 129, 0.2);
}

.dark .archetype-category-control {
    background: rgba(245, 158, 11, 0.2);
}

.dark .archetype-category-balance {
    background: rgba(139, 92, 246, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .archetype-card {
        padding: 1rem;
    }
    
    .archetype-icon {
        font-size: 2rem;
    }
    
    .archetype-name {
        font-size: 1.25rem;
    }
    
    .archetype-confidence {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .archetype-confidence-bar {
        width: 100%;
    }
}

/* ============================================
   COMPARE PAGE STYLES
============================================ */
.compare-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.compare-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--card);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.view-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.view-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.view-btn.active {
    background: var(--accent);
    color: white;
}

.compare-section {
    margin-bottom: 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

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

.section-header p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Stats Table */
.table-controls {
    margin-bottom: 1.5rem;
}

.table-controls .search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

#tableSearch {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow);
}

#tableSearch:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#tableSearch::placeholder {
    color: var(--text-light);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.stats-table th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.stats-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.stats-table th.sortable:hover {
    background: var(--border);
}

.stats-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
}

.stats-table th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

.stats-table th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

.stats-table th.stat-attack { color: #ef4444; }
.stats-table th.stat-defense { color: #3b82f6; }
.stats-table th.stat-stamina { color: #10b981; }
.stats-table th.stat-control { color: #f59e0b; }
.stats-table th.stat-meta { color: #8b5cf6; }

.stats-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.stats-table tr:hover {
    background: var(--bg);
}

.stats-table .name-cell a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.stats-table .name-cell a:hover {
    text-decoration: underline;
}

.stats-table .rank-cell {
    font-weight: 700;
    color: var(--text-light);
}

.stats-table .elo-cell {
    font-weight: 600;
}

.stats-table .stat-cell {
    font-weight: 600;
    text-align: center;
}

.stats-table .stat-cell.stat-attack { color: #ef4444; }
.stats-table .stat-cell.stat-defense { color: #3b82f6; }
.stats-table .stat-cell.stat-stamina { color: #10b981; }
.stats-table .stat-cell.stat-control { color: #f59e0b; }
.stats-table .stat-cell.stat-meta { color: #8b5cf6; }

.stats-table .total-cell {
    font-weight: 700;
    color: var(--text);
}

.stats-table .actions-cell {
    text-align: center;
}

.add-compare-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.add-compare-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.add-compare-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Compare Selector */
.compare-selector {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.selector-slot {
    min-height: 50px;
}

.slot-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
}

.slot-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}

.slot-name {
    font-weight: 600;
    color: var(--text);
}

.slot-remove {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.slot-remove:hover {
    color: #ef4444;
}

.clear-compare-btn {
    display: block;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.clear-compare-btn:hover {
    background: var(--bg);
    color: var(--text);
}

/* Compare Cards */
.compare-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.compare-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    overflow: hidden;
}

.compare-card-header {
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.compare-card-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.compare-card-header h3 a {
    color: var(--text);
    text-decoration: none;
}

.compare-card-header h3 a:hover {
    color: var(--accent);
}

.compare-card-rank {
    display: flex;
    gap: 0.75rem;
}

.rank-badge {
    font-weight: 700;
    color: var(--text-light);
}

.elo-badge {
    font-weight: 600;
    color: var(--accent);
}

.compare-stats-grid {
    padding: 1rem 1.25rem;
}

.compare-stat-row {
    margin-bottom: 0.75rem;
}

.compare-stat-row:last-child {
    margin-bottom: 0;
}

.compare-stat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.compare-stat-header:hover {
    opacity: 0.8;
}

.compare-stat-label {
    min-width: 90px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
}

.compare-stat-bar {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}

.compare-stat-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.compare-stat-fill.stat-attack { background: linear-gradient(90deg, #ef4444, #f87171); }
.compare-stat-fill.stat-defense { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.compare-stat-fill.stat-stamina { background: linear-gradient(90deg, #10b981, #34d399); }
.compare-stat-fill.stat-control { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.compare-stat-fill.stat-meta_impact { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.compare-stat-value {
    min-width: 35px;
    text-align: right;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
}

.compare-expand-icon {
    font-size: 0.625rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.compare-stat-row.expanded .compare-expand-icon {
    transform: rotate(180deg);
}

.compare-sub-metrics {
    display: none;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.compare-stat-row.expanded .compare-sub-metrics {
    display: block;
}

.sub-metric-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.75rem;
}

.sub-metric-name {
    color: var(--text-light);
}

.sub-metric-value {
    font-weight: 600;
    color: var(--text);
}

.compare-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-weight: 600;
}

.total-value {
    font-size: 1.25rem;
    color: var(--accent);
}

.compare-empty {
    text-align: center;
    padding: 3rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    color: var(--text-light);
}

/* Radar Chart Section */
.compare-chart-section {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.compare-chart-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.compare-radar-container {
    max-width: 500px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .compare-cards {
        grid-template-columns: 1fr;
    }
    
    .stats-table {
        font-size: 0.75rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.5rem 0.375rem;
    }
}

@media (max-width: 480px) {
    .selector-grid {
        grid-template-columns: 1fr;
    }
    
    .compare-view-toggle {
        flex-direction: column;
    }
}

/* Compare button on bey profile page */
.compare-bey-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.compare-bey-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ============================================
   ENHANCED COMPARE TOOL STYLES
============================================ */

/* Type Badge in Compare Cards */
.compare-card-type {
    margin-top: 0.5rem;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.type-badge.type-attack { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.type-badge.type-defense { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.type-badge.type-stamina { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.type-badge.type-balance { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.type-badge.type-unknown { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

/* Stat Battle Section */
.compare-battle-section,
.compare-leaderboard-section,
.compare-advanced-section,
.compare-finish-section,
.compare-parts-section,
.compare-archetype-section,
.compare-h2h-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.compare-battle-section h3,
.compare-leaderboard-section h3,
.compare-advanced-section h3,
.compare-finish-section h3,
.compare-parts-section h3,
.compare-archetype-section h3,
.compare-h2h-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--text);
}

/* Stat Battle Grid */
.stat-battle-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-battle-row {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.stat-battle-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.stat-battle-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-battle-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.stat-battle-item.winner {
    background: rgba(16, 185, 129, 0.1);
}

.stat-battle-item.loser {
    background: rgba(239, 68, 68, 0.05);
}

.stat-battle-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-battle-bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.stat-battle-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-battle-value {
    font-weight: 700;
    font-size: 0.875rem;
    text-align: right;
}

.stat-battle-value.advantage {
    color: #10b981;
}

.stat-battle-value.disadvantage {
    color: #ef4444;
}

/* Leaderboard Stats Comparison */
.leaderboard-stats-grid,
.advanced-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-stat-row,
.advanced-stat-row {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.leaderboard-stat-label,
.advanced-stat-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-desc {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-light);
}

.leaderboard-stat-values,
.advanced-stat-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.leaderboard-stat-item,
.advanced-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--card);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.stat-bey-name {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.stat-value.advantage {
    color: #10b981;
}

.stat-value.disadvantage {
    color: #ef4444;
}

/* Finish Type Comparison */
.finish-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.finish-type-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.finish-type-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.finish-icon {
    font-size: 1.25rem;
}

.finish-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.finish-type-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.finish-value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.finish-value-item.winner {
    background: rgba(16, 185, 129, 0.1);
}

.finish-bey-name {
    font-weight: 600;
    font-size: 0.8125rem;
}

.finish-rate {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
}

.finish-rate.advantage {
    color: #10b981;
}

/* Parts Comparison */
.parts-comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.parts-category {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.parts-category h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.parts-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.part-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--card);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.part-name {
    font-size: 0.75rem;
    color: var(--text-light);
}

.part-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.part-category {
    margin-top: 0.25rem;
    font-size: 0.6875rem;
}

.parts-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.part-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--card);
    border-radius: var(--radius-sm);
}

.part-stat-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-light);
    flex: 1;
}

.part-stat-values {
    display: flex;
    gap: 1.5rem;
}

.part-stat-value {
    font-weight: 700;
    font-size: 0.875rem;
    min-width: 40px;
    text-align: center;
}

.part-stat-value.advantage {
    color: #10b981;
}

.part-stat-value.disadvantage {
    color: #ef4444;
}

/* Archetype Comparison */
.archetype-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.archetype-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border-top: 3px solid;
}

.archetype-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.archetype-emoji {
    font-size: 1.5rem;
}

.archetype-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.archetype-bey-name {
    font-weight: 700;
    font-size: 1rem;
}

.archetype-type {
    display: inline-block;
    width: fit-content;
}

.archetype-desc {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.archetype-traits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.archetype-strengths,
.archetype-weaknesses {
    font-size: 0.8125rem;
}

.traits-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.archetype-strengths .traits-label { color: #10b981; }
.archetype-weaknesses .traits-label { color: #f59e0b; }

.archetype-traits ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-light);
}

.archetype-traits li {
    margin-bottom: 0.25rem;
}

/* Head-to-Head Section */
.h2h-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.h2h-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.h2h-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.h2h-bey {
    font-weight: 700;
    font-size: 0.9375rem;
}

.h2h-vs {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--card);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.h2h-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.h2h-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h2h-label {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.h2h-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.h2h-value .advantage {
    color: #10b981;
}

.h2h-value .disadvantage {
    color: #ef4444;
}

.h2h-win-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.h2h-bar-a,
.h2h-bar-b {
    height: 100%;
    transition: width 0.3s ease;
}

.h2h-win-labels {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.8125rem;
}

.h2h-empty {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-style: italic;
}

/* Responsive for Compare Sections */
@media (max-width: 768px) {
    .stat-battle-item {
        grid-template-columns: 80px 1fr 40px;
        gap: 0.5rem;
    }
    
    .finish-comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .archetype-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .archetype-traits {
        grid-template-columns: 1fr;
    }
    
    .parts-info-row {
        grid-template-columns: 1fr;
    }
    
    .part-stat-values {
        gap: 0.75rem;
    }
    
    .h2h-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .finish-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-battle-name {
        font-size: 0.75rem;
    }
    
    .compare-battle-section,
    .compare-leaderboard-section,
    .compare-advanced-section,
    .compare-finish-section,
    .compare-parts-section,
    .compare-archetype-section,
    .compare-h2h-section {
        padding: 1rem;
    }
    
    .leaderboard-stat-values,
    .advanced-stat-values {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PARTS PERFORMANCE PAGE STYLES
============================================ */

.page-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Parts Tabs */
.parts-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.parts-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition);
}

.parts-tab:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.parts-tab.active {
    background: var(--accent);
    color: white;
}

/* Parts Sections */
.parts-section {
    display: none;
}

.parts-section.active {
    display: block;
}

.parts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.parts-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.parts-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Stats Legend */
.stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-icon {
    font-size: 1.25rem;
}

.legend-label {
    font-weight: 600;
    color: var(--text);
}

.legend-desc {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Parts Grid */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Part Card */
.part-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.part-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.part-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.part-name {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.part-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.part-type-badge.attack {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.part-type-badge.defense {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.part-type-badge.stamina {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.part-type-badge.balance {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.part-info {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Part Stats */
.part-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.part-stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.part-stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.part-stat-icon {
    font-size: 1rem;
}

.part-stat-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.part-stat-value {
    min-width: 40px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text);
    text-align: right;
}

/* Part Total */
.part-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.total-label {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

.total-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

/* Parts stat tile colors */
.rpg-stat-tile.contact_power .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.rpg-stat-tile.contact_power.filled,
.rpg-stat-tile.contact_power.partial {
    border-color: #ef4444;
}

.rpg-stat-tile.spin_control .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.rpg-stat-tile.spin_control.filled,
.rpg-stat-tile.spin_control.partial {
    border-color: #f59e0b;
}

.rpg-stat-tile.deflection .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.rpg-stat-tile.deflection.filled,
.rpg-stat-tile.deflection.partial {
    border-color: #3b82f6;
}

.rpg-stat-tile.burst_resistance .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.rpg-stat-tile.burst_resistance.filled,
.rpg-stat-tile.burst_resistance.partial {
    border-color: #8b5cf6;
}

.rpg-stat-tile.lock_stability .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

.rpg-stat-tile.lock_stability.filled,
.rpg-stat-tile.lock_stability.partial {
    border-color: #06b6d4;
}

.rpg-stat-tile.weight_efficiency .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.rpg-stat-tile.weight_efficiency.filled,
.rpg-stat-tile.weight_efficiency.partial {
    border-color: #10b981;
}

.rpg-stat-tile.tip_control .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}

.rpg-stat-tile.tip_control.filled,
.rpg-stat-tile.tip_control.partial {
    border-color: #ec4899;
}

.rpg-stat-tile.speed_rating .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.rpg-stat-tile.speed_rating.filled,
.rpg-stat-tile.speed_rating.partial {
    border-color: #f97316;
}

.rpg-stat-tile.stamina_output .rpg-stat-tile-fill {
    background: linear-gradient(90deg, #14b8a6, #2dd4bf);
}

.rpg-stat-tile.stamina_output.filled,
.rpg-stat-tile.stamina_output.partial {
    border-color: #14b8a6;
}

/* Parts Table Container */
.parts-table-container {
    margin-top: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.parts-table-container h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--text);
}

/* Parts Table */
.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.parts-table th,
.parts-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.parts-table th {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.parts-table tbody tr:hover {
    background: var(--bg);
}

.parts-table .highlight-max {
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.attack {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.type-badge.defense {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.type-badge.stamina {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.type-badge.balance {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Responsive for parts page */
@media (max-width: 768px) {
    .parts-tabs {
        flex-wrap: wrap;
    }
    
    .parts-tab {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
    
    .parts-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .parts-filters {
        width: 100%;
    }
    
    .parts-filters select {
        flex: 1;
    }
    
    .stats-legend {
        flex-direction: column;
        gap: 1rem;
    }
    
    .legend-item {
        flex-wrap: wrap;
    }
    
    .legend-desc {
        width: 100%;
        margin-left: 1.75rem;
    }
    
    .parts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   HOMEPAGE REDESIGN STYLES
============================================ */

/* Homepage Layout */
.homepage {
    padding: 0;
    max-width: none;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-tagline {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 1rem 0;
}

.hero-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 2rem 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.hero-btn.primary {
    background: white;
    color: #3d6e00;
}

.hero-btn.primary:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Section Titles */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 2rem 0;
    color: var(--text);
}

/* Featured Bey Section */
.featured-bey-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-bey-container {
    display: flex;
    justify-content: center;
}

.featured-bey-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent);
    width: 100%;
    max-width: 900px;
    transition: var(--transition);
}

.featured-bey-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.featured-bey-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.featured-bey-title-section {
    flex: 1;
    min-width: 200px;
}

.featured-bey-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 0.5rem 0;
}

.featured-bey-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.featured-bey-rank {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
}

.featured-bey-tier {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--gradient-primary);
    color: white;
}

.featured-bey-archetype-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.archetype-emoji {
    font-size: 1.5rem;
}

.archetype-name {
    font-weight: 600;
    color: var(--text);
}

.featured-bey-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.featured-bey-description {
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}

.featured-bey-description p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
}

.featured-bey-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.stat-trend {
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-subtext {
    font-size: 0.875rem;
    color: var(--text-light);
}

.featured-bey-rpg-stats {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.featured-bey-rpg-stats h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.rpg-stat-bar {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.rpg-stat-bar:last-child {
    margin-bottom: 0;
}

.rpg-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.rpg-stat-fill-container {
    height: 24px;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.rpg-stat-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.rpg-stat-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    text-align: right;
}

.featured-bey-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.featured-bey-btn {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.featured-bey-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.featured-bey-btn.secondary {
    background: var(--bg-alt);
    color: var(--accent);
    border: 2px solid var(--accent);
}

.featured-bey-btn.secondary:hover {
    background: var(--accent);
    color: white;
}

/* Meta Snapshot Section */
.meta-snapshot {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.snapshot-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.snapshot-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.snapshot-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.snapshot-link {
    display: block;
    text-align: right;
    margin-top: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.snapshot-link:hover {
    color: var(--accent-hover);
}

/* Top Beys List */
.top-beys-list, .trending-beys-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-bey-item, .trending-bey-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.top-bey-item:hover, .trending-bey-item:hover {
    background: var(--bg-alt);
    transform: translateX(4px);
}

.top-bey-rank, .trending-rank {
    font-size: 1rem;
    min-width: 28px;
    text-align: center;
}

.top-bey-name, .trending-name {
    flex: 1;
    font-weight: 600;
    color: var(--accent);
}

.top-bey-elo {
    font-weight: 700;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}

.top-bey-trend, .trending-value {
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 50px;
    text-align: right;
}

/* Recent Matches List */
.recent-matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    gap: 0.5rem;
}

.match-bey {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-bey:first-child {
    text-align: left;
}

.match-bey:last-child {
    text-align: right;
}

.match-bey.winner {
    color: #10b981;
    font-weight: 700;
}

.match-score {
    font-weight: 700;
    color: var(--text);
    font-family: 'Courier New', monospace;
    background: var(--card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 55px;
    text-align: center;
}

/* Loading and Error States */
.loading-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-style: italic;
}

.error-text, .no-data-text {
    text-align: center;
    color: var(--text-light);
    padding: 1rem;
    font-size: 0.875rem;
}

/* Giant Killers List */
.giant-killers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.giant-killer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.giant-killer-item:hover {
    background: var(--bg-alt);
    transform: translateX(4px);
}

.gk-rank {
    font-size: 1rem;
    min-width: 28px;
    text-align: center;
}

.gk-name {
    flex: 1;
    font-weight: 600;
    color: var(--accent);
}

.gk-score {
    font-weight: 700;
    color: #10b981;
    min-width: 45px;
    text-align: right;
}

.gk-upsets {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 35px;
    text-align: right;
}

/* Power Rankings Section */
.power-rankings-section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg);
}

.power-rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.power-rankings-card, .quick-stats-card, .meta-health-card {
    min-height: 280px;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: -0.5rem 0 1rem 0;
}

/* Power Rankings List */
.power-rankings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.power-ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.power-ranking-item:hover {
    background: var(--bg-alt);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pr-rank {
    font-size: 1.25rem;
    min-width: 32px;
    text-align: center;
}

.pr-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pr-name {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

.pr-credibility {
    font-size: 0.75rem;
    color: var(--text-light);
}

.pr-power {
    font-weight: 800;
    font-size: 1.25rem;
    color: #10b981;
    min-width: 55px;
    text-align: right;
}

/* Quick Stats */
.quick-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.qs-icon {
    font-size: 2rem;
    min-width: 48px;
    text-align: center;
}

.qs-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qs-value {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 1;
}

.qs-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Meta Health */
.meta-health-display {
    padding: 1rem 0;
}

.meta-health-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mh-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.mh-value {
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1;
}

.mh-value.health-good {
    color: #10b981;
}

.mh-value.health-medium {
    color: #f59e0b;
}

.mh-value.health-poor {
    color: #ef4444;
}

.mh-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.mh-diversity {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mh-bar {
    height: 24px;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mh-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 12px;
}

.mh-bar-fill.health-good {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.mh-bar-fill.health-medium {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.mh-bar-fill.health-poor {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.mh-status {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.mh-dominant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.mh-value-small {
    font-weight: 700;
    color: var(--accent);
}

/* Features Section */
.features-section {
    padding: 3rem 2rem;
    background: var(--bg);
    max-width: 1400px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Features Subsection Title */
.features-subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 2rem 0 1.25rem 0;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent);
}

.features-subsection-title:first-of-type {
    margin-top: 0;
}

/* Getting Started Section */
.getting-started {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.getting-started-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.info-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: var(--accent);
}

.info-card p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Changelog Section */
.changelog-section {
    padding: 3rem 2rem;
    background: var(--bg);
    max-width: 1400px;
    margin: 0 auto;
}

.changelog-list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.changelog-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.changelog-version {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent);
    background: var(--bg);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    white-space: nowrap;
}

.changelog-text {
    color: var(--text);
    font-size: 0.9375rem;
}

/* Newsfeed Section */
.newsfeed-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.newsfeed-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.newsfeed-section-header .section-title {
    margin-bottom: 0;
}

.view-all-news-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.view-all-news-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.newsfeed-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

.news-item-pinned {
    border-left: 4px solid var(--accent);
}

.news-item-header {
    margin-bottom: 0.5rem;
}

.news-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.news-category-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}

.news-category-announcement {
    background: rgba(61, 110, 0, 0.12);
    color: var(--accent);
}

.news-category-tournament {
    background: rgba(234, 179, 8, 0.15);
    color: #a16207;
}

.news-category-match {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.news-category-feature {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.news-category-system {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
}

body.dark .news-category-announcement {
    background: rgba(123, 198, 24, 0.15);
    color: var(--accent);
}

body.dark .news-category-tournament {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
}

body.dark .news-category-match {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark .news-category-feature {
    background: rgba(129, 140, 248, 0.15);
    color: #a5b4fc;
}

body.dark .news-category-system {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.news-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.news-pinned-badge {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.news-item-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.news-item-content {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.5rem 0 0.75rem;
}

.news-read-more {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.news-read-more:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.news-teaser {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    border: 1px dashed var(--border);
    box-shadow: var(--shadow);
    opacity: 0.75;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.news-teaser:hover {
    opacity: 1;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.news-teaser-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.news-teaser-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.news-teaser-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

/* Enhanced Footer */
.enhanced-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.footer-section p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.375rem 0;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.footer-section a:hover,
.footer-section a:focus-visible {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding-left: 0.75rem;
    outline: none;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Homepage Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1.125rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .snapshot-grid,
    .features-grid,
    .getting-started-content,
    .power-rankings-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    
    .meta-snapshot,
    .features-section,
    .getting-started,
    .changelog-section,
    .featured-bey-section,
    .power-rankings-section {
        padding: 2rem 1rem;
    }
    
    .featured-bey-card {
        padding: 1.5rem;
    }
    
    .featured-bey-name {
        font-size: 1.5rem;
    }
    
    .featured-bey-header {
        flex-direction: column;
    }
    
    .featured-bey-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rpg-stat-bar {
        grid-template-columns: 80px 1fr 40px;
        gap: 0.5rem;
    }
    
    .featured-bey-actions {
        flex-direction: column;
    }
    
    .featured-bey-btn {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2.5rem 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .featured-bey-name {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .recent-match-item {
        flex-wrap: wrap;
    }
    
    .match-bey {
        min-width: 40%;
    }
    
    .match-score {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Analytics Page Styles */
.analytics-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.analytics-hero {
    text-align: center;
    padding: 2rem 1rem 3rem;
}

.analytics-hero h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-description {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.analytics-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.analytics-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.analytics-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.analytics-tool-card .tool-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.analytics-tool-card .tool-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--accent);
}

.analytics-tool-card .tool-content p {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

/* Highlighted Feature Card with gradient/border*/
.feature-card-highlight {
    border: 1px solid var(--accent-hover-subtle);
    /* background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0)); */
}

/* .feature-card-highlight::before {
    transform: scaleX(1);
} */

@media (max-width: 768px) {
    .analytics-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-hero h2 {
        font-size: 1.75rem;
    }
    
    .analytics-description {
        font-size: 1rem;
    }
}

/* ============================================
   ELO SIMULATOR PAGE STYLES
============================================ */
.simulator-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.simulator-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.simulator-hero h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.simulator-description {
    color: var(--text-light);
    font-size: 1.0625rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.simulator-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Input Panel */
.input-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 6rem;
}

.input-panel h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    color: var(--text);
}

/* Player Input Groups */
.player-input-group {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.player-label {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

.player-a-label {
    color: #ef4444;
}

.player-b-label {
    color: #3b82f6;
}

.player-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.player-select {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
}

.player-select:focus {
    outline: none;
    border-color: var(--accent);
}

.manual-override {
    flex-shrink: 0;
}

.override-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    cursor: pointer;
}

.override-toggle input {
    cursor: pointer;
}

.elo-input-row,
.matches-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.elo-input-row label,
.matches-input-row label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.elo-input,
.matches-input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 0.875rem;
    text-align: right;
}

.elo-input:disabled,
.matches-input:disabled {
    background: var(--bg);
    color: var(--text-light);
}

.elo-input:focus,
.matches-input:focus {
    outline: none;
    border-color: var(--accent);
}

.player-stats {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.player-stats .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

/* Simulation Settings */
.simulation-settings {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.simulation-settings h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9375rem;
    color: var(--text);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.setting-row label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-light);
}

.range-slider {
    width: 100px;
    cursor: pointer;
}

.setting-row span {
    min-width: 40px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    text-align: right;
}

/* Simulate Button */
.simulate-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.simulate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.simulate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.simulator-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.result-card h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    color: var(--text);
}

/* Probability Display */
.probability-display {
    margin-bottom: 1.5rem;
}

.prob-bar-container {
    display: flex;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.prob-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.prob-bar-a {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.prob-bar-b {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.prob-labels {
    display: flex;
    justify-content: space-between;
}

.prob-label-a,
.prob-label-b {
    font-size: 1rem;
    font-weight: 700;
}

.prob-label-a {
    color: #ef4444;
}

.prob-label-b {
    color: #3b82f6;
}

/* Outcome Grid */
.outcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.outcome-section {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.outcome-title-a,
.outcome-title-b {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.outcome-title-a {
    color: #ef4444;
}

.outcome-title-b {
    color: #3b82f6;
}

.outcome-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.outcome-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.outcome-row span:first-child {
    color: var(--text-light);
}

.outcome-value {
    font-weight: 600;
}

.outcome-value.positive {
    color: #10b981;
}

.outcome-value.negative {
    color: #ef4444;
}

.k-factor-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
}

.k-factor-info strong {
    color: var(--accent);
}

/* Multi-Match Simulation */
.sim-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sim-stat {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.sim-stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.sim-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* Percentile Ranges */
.percentile-ranges {
    margin-bottom: 1.5rem;
}

.percentile-ranges h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9375rem;
    color: var(--text);
}

.percentile-bar-container {
    position: relative;
    height: 40px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.percentile-bar {
    position: relative;
    width: 100%;
    height: 100%;
}

.percentile-range {
    position: absolute;
    height: 100%;
    border-radius: var(--radius-sm);
}

.percentile-range.p5-p95 {
    background: rgba(239, 68, 68, 0.2);
}

.percentile-range.p25-p75 {
    background: rgba(239, 68, 68, 0.5);
}

.percentile-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: #ef4444;
    border-radius: 2px;
    transform: translateX(-50%);
}

.percentile-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.percentile-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-light);
}

.legend-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 0.375rem;
    vertical-align: middle;
}

.legend-box.p25-75 {
    background: rgba(239, 68, 68, 0.5);
}

.legend-box.p5-95 {
    background: rgba(239, 68, 68, 0.2);
}

/* Charts */
.chart-container {
    margin-top: 1.5rem;
}

.chart-container h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9375rem;
    color: var(--text);
}

.chart-container canvas {
    max-height: 250px;
}

/* Share Section */
.share-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.share-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.share-status {
    font-size: 0.875rem;
    color: #10b981;
    font-weight: 600;
}

/* Responsive Design for Simulator */
@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    
    .input-panel {
        position: static;
    }
    
    .sim-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .simulator-hero h2 {
        font-size: 1.5rem;
    }
    
    .simulator-description {
        font-size: 0.9375rem;
    }
    
    .outcome-grid {
        grid-template-columns: 1fr;
    }
    
    .sim-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .percentile-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Ensure simulator page is properly centered on mobile */
    .simulator-page {
        padding: 0.75rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .simulator-layout {
        width: 100%;
    }
    
    .input-panel,
    .result-card {
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .player-controls {
        flex-wrap: wrap;
    }
    
    .player-select {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }
}

/* ============================================
   MATCHUP PREDICTOR PAGE
============================================ */

.predictor-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.predictor-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.predictor-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.predictor-description {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.predictor-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Predictor Input Panel */
.predictor-inputs .input-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

.predictor-inputs .input-panel h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    color: var(--text);
}

.bey-input-group {
    margin-bottom: 1rem;
}

.bey-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.bey-a-label {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.bey-b-label {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.bey-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.bey-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-hover-subtle);
}

.bey-stats-preview {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    min-height: 80px;
}

.preview-placeholder {
    color: var(--text-light);
    font-size: 0.8125rem;
    text-align: center;
    padding: 1rem 0;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.preview-stat-label {
    color: var(--text-light);
}

.preview-stat-value {
    font-weight: 600;
    color: var(--text);
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    position: relative;
}

.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.vs-divider span {
    padding: 0.5rem 1rem;
    background: var(--gradient-secondary);
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.875rem;
    color: white;
    margin: 0 1rem;
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.swap-btn,
.random-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.swap-btn:hover,
.random-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Predictor Results */
.predictor-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.predictor-results .result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.predictor-results .result-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--text);
}

/* Win Probability Display */
.win-prob-display {
    margin-bottom: 1rem;
}

.win-prob-bar-container {
    display: flex;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}

.win-prob-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s ease;
    min-width: 50px;
}

.win-prob-bar-a {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.win-prob-bar-b {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.win-prob-percent {
    font-weight: 800;
    font-size: 1.125rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.win-prob-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0 0.25rem;
}

.win-prob-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* Confidence Indicator */
.confidence-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.confidence-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.confidence-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--border);
    color: var(--text-light);
}

.confidence-badge.confidence-high {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.confidence-badge.confidence-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.confidence-badge.confidence-low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Outcome Breakdown */
.outcome-description {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0 0 1rem 0;
}

.outcome-chart-container {
    height: 250px;
    margin-bottom: 1rem;
}

.outcome-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.outcome-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.outcome-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.outcome-dot.burst { background: #ef4444; }
.outcome-dot.pocket { background: #f59e0b; }
.outcome-dot.extreme { background: #8b5cf6; }
.outcome-dot.spin { background: #10b981; }
.outcome-dot.decision { background: #6b7280; }

/* Stat Comparison */
.stat-bars-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-comparison-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.75rem;
    align-items: center;
}

.stat-comparison-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.stat-comparison-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-bar-wrapper.stat-bar-a {
    flex-direction: row-reverse;
}

.stat-bar-wrapper.stat-bar-b {
    flex-direction: row;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-bg.reverse {
    direction: rtl;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 28px;
    text-align: center;
}

.stat-value.winner {
    color: var(--accent);
    font-weight: 700;
}

/* Upset Display */
.upset-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upset-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.upset-icon {
    font-size: 1.25rem;
}

.upset-text {
    font-size: 0.9375rem;
    color: var(--text);
}

.upset-indicator.upset-high {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.upset-indicator.upset-moderate {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.upset-indicator.upset-low {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.upset-indicator.upset-very_low {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.upset-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.upset-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    padding: 0.375rem 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.upset-stat span {
    color: var(--text-light);
}

.upset-stat strong {
    color: var(--text);
}

/* Model Details */
.model-details {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.model-details summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
}

.model-details summary:hover {
    background: var(--border);
}

.model-details[open] summary {
    border-bottom: 1px solid var(--border);
}

.model-details-content {
    padding: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.7;
}

.model-details-content p {
    margin: 0 0 1rem 0;
}

.model-details-content ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.model-details-content li {
    margin-bottom: 0.25rem;
}

/* Responsive Design for Predictor */
@media (max-width: 1024px) {
    .predictor-layout {
        grid-template-columns: 1fr;
    }
    
    .predictor-inputs .input-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .predictor-page {
        padding: 1rem;
    }
    
    .predictor-hero h2 {
        font-size: 1.5rem;
    }
    
    .predictor-description {
        font-size: 0.9375rem;
    }
    
    .stat-comparison-row {
        grid-template-columns: 80px 1fr;
    }
    
    .upset-details {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
}

/* ============================================
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS
   Breakpoints: 360px, 480px, 768px, 1024px, 1440px
============================================ */

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch-friendly tap targets - minimum 44px */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    nav a,
    nav button,
    .filter-btn,
    .filter-select,
    .toggle-label,
    .lb-expand-btn,
    .sort-button,
    .pagination-btn,
    .hero-btn,
    .profile-link-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Larger checkboxes and toggles for touch */
    .theme-switch {
        width: 54px;
        height: 28px;
    }
    
    .toggle-switch {
        width: 60px;
        height: 32px;
    }
    
    .toggle-slider:before {
        height: 24px;
        width: 24px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(28px);
    }
}

/* Extra small screens (360px and below) */
@media (max-width: 360px) {
    /* Header adjustments for very small screens */
    header {
        padding: 0.75rem 0.75rem;
        gap: 0.25rem;
    }
    
    header h1 {
        font-size: 0.875rem;
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .home-icon {
        font-size: 1.25rem;
        padding: 0.25rem;
    }
    
    /* Main content padding */
    main {
        padding: 1rem 0.75rem;
        overflow-x: hidden;
    }
    
    main h2 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    /* Hero section for very small screens */
    .hero-section {
        padding: 1.5rem 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.875rem;
    }
    
    .hero-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        width: 100%;
    }
    
    /* Search input for very small screens */
    #searchInput,
    #wikiSearch {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Filter controls stacked */
    .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
        min-width: unset;
    }
    
    /* Leaderboard cards for very small screens */
    .lb-card {
        padding: 0.875rem;
    }
    
    .lb-card-rank {
        font-size: 1.25rem;
        min-width: 2rem;
    }
    
    .lb-card-name {
        font-size: 1rem;
    }
    
    .lb-card-elo {
        font-size: 1.125rem;
    }
    
    .lb-card-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .lb-stat-label {
        font-size: 0.625rem;
    }
    
    .lb-stat-value {
        font-size: 0.875rem;
    }
    
    /* Wiki cards for very small screens */
    .wiki-grid {
        gap: 1rem;
    }
    
    .wiki-card-content {
        padding: 1rem;
    }
    
    .wiki-card-title {
        font-size: 1rem;
    }
    
    .wiki-card-description {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Footer for very small screens */
    footer,
    .footer-bottom {
        padding: 1rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .footer-content {
        padding: 1.5rem 0.75rem;
        gap: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 0.875rem;
    }
    
    /* Snapshot cards */
    .snapshot-card {
        padding: 1rem;
    }
    
    .snapshot-card h3 {
        font-size: 1rem;
    }
    
    .top-bey-item,
    .trending-bey-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .top-bey-name,
    .trending-name {
        font-size: 0.875rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.25rem;
    }
    
    /* Legend */
    .legend-header {
        padding: 0.75rem 1rem;
    }
    
    .legend-title {
        font-size: 0.875rem;
    }
    
    .legend-content {
        padding: 1rem;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .legend-abbr {
        min-width: 50px;
        font-size: 0.8125rem;
    }
}

/* Small screens (480px) */
@media (max-width: 480px) {
    /* Improved header spacing */
    header {
        padding: 0.75rem 1rem;
    }
    
    /* Navigation menu positioning */
    .nav-menu {
        top: 3.5rem;
        width: 100%;
        max-width: 100vw;
        right: -100%;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* Main content */
    main {
        padding: 1.25rem 1rem;
        overflow-x: hidden;
    }
    
    /* Hero buttons stack properly */
    .hero-buttons {
        gap: 0.75rem;
    }
    
    /* Stat grids for bey profiles */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.6875rem;
    }
    
    /* Key stats for profile page */
    .key-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .key-stat-card {
        padding: 1.5rem 1rem;
    }
    
    .key-stat-value {
        font-size: 2.5rem;
    }
    
    /* Profile header */
    .profile-header {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .profile-image-container {
        width: 120px;
        height: 120px;
    }
    
    .profile-name {
        font-size: 1.375rem;
    }
    
    /* Trophies wrapping */
    .profile-trophies {
        justify-content: center;
    }
    
    .profile-trophy {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .profile-season-badges {
        justify-content: center;
    }
    
    .season-badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* RPG stats */
    .rpg-stat-row {
        padding: 0.75rem;
    }
    
    .rpg-stat-label {
        font-size: 0.875rem;
    }
    
    /* History trends */
    .history-trends {
        grid-template-columns: 1fr;
    }
    
    .trend-card {
        padding: 1rem;
    }
    
    /* Timeline */
    .timeline-match {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .timeline-opponent {
        flex: 1 1 100%;
        order: 1;
    }
    
    /* Related beys */
    .related-beys-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-bey-card {
        padding: 0.75rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        order: -1;
    }
    
    #pageSize {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Medium screens (768px) - mostly already covered */
@media (min-width: 481px) and (max-width: 768px) {
    /* Filters in 2 columns */
    .filters-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .filter-group:last-child:nth-child(odd) {
        grid-column: span 2;
    }
    
    /* Wiki grid */
    .wiki-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Snapshot grid */
    .snapshot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .snapshot-card:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

/* Large screens (1024px+) */
@media (min-width: 1024px) {
    /* Full navigation visible */
    .hamburger {
        display: none;
    }
    
    .nav-menu {
        position: static;
        width: auto;
        max-width: none;
        background: transparent;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        border: none;
        gap: 0.5rem;
    }
    
    /* Better filter layouts */
    .filters-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Full table view on desktop */
    #leaderboardCards {
        display: none !important;
    }
    
    .table-wrapper {
        display: block !important;
    }
    
    .mobile-sort-controls {
        display: none !important;
    }
}

/* Extra large screens (1440px+) */
@media (min-width: 1440px) {
    main {
        max-width: 1800px;
    }
    
    .hero-content {
        max-width: 1000px;
    }
    
    .wiki-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .snapshot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Improved mobile navigation dropdown behavior */
@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .nav-dropdown-content {
        position: static;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-dropdown.active .nav-dropdown-content {
        max-height: 500px;
    }
    
    .nav-dropdown-content a {
        padding-left: 2rem;
    }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    footer,
    .footer-bottom {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    header {
        padding-left: calc(1rem + env(safe-area-inset-left));
        padding-right: calc(1rem + env(safe-area-inset-right));
    }
}

/* Allow horizontal scrolling for tables when needed */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile table scrolling - enable scroll on table containers */
@media (max-width: 768px) {
    /* Stats table container (compare page) - use parent container for scroll */
    .stats-table-container,
    .synergy-heatmap-container,
    .heatmap-container,
    .balance-section,
    .outlier-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fallback: tables without wrapper get scroll directly */
    .stats-table,
    .synergy-table,
    .synergy-heatmap,
    .outlier-table,
    .balance-table {
        min-width: max-content;
    }
    
    /* Generic table scroll wrapper */
    .table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }
}

/* Improved sort modal for mobile */
@media (max-width: 480px) {
    .sort-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .sort-option {
        padding: 1rem;
        min-height: 48px;
    }
    
    .direction-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Better touch scrolling for modals */
.sort-modal-body,
.legend-content.expanded {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Focus visible styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Enhanced navigation accessibility */
.nav-dropdown-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.nav-dropdown-content a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--bg);
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    z-index: 1000;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}



/* ============================================
   TOURNAMENTS PAGE
============================================ */
.tournaments-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.tournaments-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tournaments-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tournaments-description {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tournament Selector */
.tournaments-selection {
    margin-bottom: 2rem;
}

.tournament-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.tournament-selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}

.tournament-selector {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.tournament-selector:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-hover-subtle);
}

/* Tournament Cards Grid */
.tournaments-grid-section {
    margin-bottom: 3rem;
}

.section-subtitle {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tournament-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tournament-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tournament-card.selected {
    border-color: var(--accent);
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--accent-hover-subtle);
}

.tournament-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.tournament-format-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-swiss {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.format-de {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.format-se {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.format-rr {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.format-other {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.tournament-date {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.tournament-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.tournament-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.tournament-winner,
.tournament-players {
    color: var(--text-light);
}

.winner-label,
.players-label {
    font-weight: 500;
}

.winner-name {
    color: var(--accent);
    font-weight: 600;
}

.view-bracket-btn {
    margin-top: auto;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: "Inter", sans-serif;
}

.view-bracket-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Bracket Viewer Section */
.bracket-viewer-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.bracket-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.bracket-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75rem 0;
}

.bracket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.bracket-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

.bracket-format {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.bracket-winner {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
}

/* Challonge Embed */
.bracket-container {
    min-height: 400px;
}

.challonge-embed-wrapper {
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.challonge-embed-wrapper iframe {
    display: block;
    width: 100%;
    min-height: 600px;
}

.bracket-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.bracket-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.bracket-external-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.bracket-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-light);
}

/* Responsive Design for Tournaments */
@media (max-width: 768px) {
    .tournaments-page {
        padding: 1rem;
    }
    
    .tournaments-hero h2 {
        font-size: 1.5rem;
    }
    
    .tournaments-description {
        font-size: 0.9375rem;
    }
    
    .tournaments-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tournament-card {
        padding: 1.25rem;
    }
    
    .bracket-viewer-section {
        padding: 1rem;
    }
    
    .bracket-header h3 {
        font-size: 1.25rem;
    }
    
    .bracket-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .challonge-embed-wrapper iframe {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .tournament-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .challonge-embed-wrapper iframe {
        min-height: 400px;
    }
}


/* ============================================
   ROUNDS DETAIL STYLES (Match Page)
============================================ */

/* Rounds expand button in table */
.rounds-cell {
    text-align: center;
    padding: 0.5rem;
}

.rounds-expand-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.rounds-expand-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.rounds-cell.no-rounds {
    color: var(--text-light);
    font-size: 0.875rem;
}

.rounds-header {
    font-size: 0.8125rem;
    text-align: center;
}

/* Rounds detail row */
.rounds-detail-row {
    background: var(--bg);
}

.rounds-detail-cell {
    padding: 0 !important;
}

.rounds-detail-container {
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.rounds-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.rounds-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.rounds-count {
    font-size: 0.8125rem;
    color: var(--text-light);
    background: var(--card);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
}

/* Rounds table */
.rounds-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.rounds-table th {
    background: var(--card);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.rounds-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.rounds-table tbody tr:hover {
    background: var(--card);
}

.rounds-table tbody tr:last-child td {
    border-bottom: none;
}

.round-number {
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    min-width: 40px;
}

.round-winner {
    font-weight: 600;
    color: var(--text);
}

.round-winner.match-winner-round {
    color: var(--accent);
}

.round-points {
    font-weight: 700;
    color: #10b981;
    text-align: center;
}

.round-score {
    font-weight: 600;
    color: var(--text);
    font-family: 'Courier New', monospace;
    text-align: center;
}

/* Finish type badges */
.finish-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.finish-icon {
    font-size: 0.875rem;
}

/* Rounds summary */
.rounds-summary {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.finish-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.finish-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Mobile rounds section */
.card-rounds-section {
    display: block;
    width: 100%;
    clear: both;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.card-rounds-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.card-rounds-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.card-rounds-toggle.expanded {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.toggle-icon {
    font-size: 0.75rem;
}

.card-rounds-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.card-rounds-content.expanded {
    max-height: 4000px;
    margin-top: 0.75rem;
}

/* Mobile rounds list */
.mobile-rounds-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-round-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
}

.mobile-round-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.mobile-round-number {
    font-weight: 800;
    color: var(--accent);
    font-size: 0.875rem;
    min-width: 28px;
}

.mobile-round-points {
    margin-left: auto;
    font-weight: 700;
    color: #10b981;
    font-size: 0.875rem;
}

.mobile-round-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-round-winner {
    font-weight: 600;
    color: var(--text);
    font-size: 0.8125rem;
}

.mobile-round-score {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8125rem;
    font-family: 'Courier New', monospace;
}

.mobile-rounds-summary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Responsive adjustments for rounds */
@media (max-width: 768px) {
    .rounds-detail-container {
        padding: 0.75rem 1rem;
    }
    
    .rounds-table th,
    .rounds-table td {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .rounds-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .finish-summary {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .rounds-table {
        font-size: 0.75rem;
    }
    
    .finish-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .mobile-round-item {
        padding: 0.5rem;
    }
}

/* ========================================
   ELO Calculation Breakdown
   ======================================== */

.elo-breakdown {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

.elo-breakdown-header {
    margin-bottom: 0.625rem;
}

.calc-breakdown-details > .calc-breakdown-header {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
}

.calc-breakdown-details > .calc-breakdown-header::-webkit-details-marker {
    display: none;
}

.calc-breakdown-details > .calc-breakdown-header::before {
    content: "▸";
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.calc-breakdown-details[open] > .calc-breakdown-header {
    margin-bottom: 0.625rem;
}

.calc-breakdown-details[open] > .calc-breakdown-header::before {
    transform: rotate(90deg);
}

.elo-breakdown-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text);
}

.elo-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.elo-breakdown-table th {
    background: var(--card);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.elo-breakdown-table td {
    padding: 0.4375rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.elo-breakdown-table tbody tr:last-child td {
    border-bottom: none;
}

.elo-breakdown-table tbody tr:hover {
    background: var(--card);
}

.xp-event-row td {
    background: var(--bg-subtle);
}

.xp-event-row td:first-child {
    border-left: 3px solid var(--accent);
}

.xp-event-row.event-tournament td:first-child {
    border-left-color: var(--xp-event-tournament);
}

.xp-event-row.event-season td:first-child {
    border-left-color: var(--xp-event-season-end);
}

.xp-event-row.event-generic td:first-child {
    border-left-color: var(--accent);
}

.xp-history-calc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0 0 0.6rem 0;
}

.xp-calc-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
    white-space: nowrap;
}

.elo-param-label {
    color: var(--text-light);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.elo-param-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.elo-result-row td {
    font-weight: 700;
    background: var(--card);
}

.elo-gain {
    color: #10b981;
}

.elo-loss {
    color: #ef4444;
}

@media (max-width: 768px) {
    .elo-breakdown-table th,
    .elo-breakdown-table td {
        padding: 0.375rem 0.4rem;
        font-size: 0.8125rem;
    }

    .elo-breakdown-table th {
        max-width: 90px;
    }

    .elo-param-label {
        font-size: 0.75rem;
    }

    .xp-calc-cell {
        font-size: 0.68rem;
    }
}

/* ========================================
   Season Pages Styles
   ======================================== */

/* Season overview page */
.system-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.format-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.format-card h4 {
    margin: 0 0 1rem 0;
    color: var(--accent);
}

.format-card ul, .format-card ol {
    margin: 0;
    padding-left: 1.5rem;
}

.format-card li {
    margin-bottom: 0.5rem;
}

/* Season cards */
.season-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.season-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.season-header h3 {
    margin: 0;
    color: var(--accent);
}

.season-dates {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.season-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.highlight {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.highlight-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.highlight-value {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--text);
}

.tier-champions {
    margin-top: 1rem;
}

.tier-champions h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-champions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.tier-champion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.tier-badge {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.tier-badge-subtle {
    background: transparent;
    color: var(--text-light);
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.champion-name {
    font-weight: 500;
}

.season-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.season-details-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.season-details-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
}

.season-details-btn:active {
    transform: translateY(0);
}

/* Season status badges */
.season-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.season-status-badge.upcoming {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.season-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

body.dark .season-status-badge.upcoming {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
}

body.dark .season-status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.5);
}

/* Upcoming season card variant */
.season-card.upcoming-season {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(245, 158, 11, 0.04) 100%);
}

/* Individual season page */
.season-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.overview-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent-hover));
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.champion-card {
    border-color: #FFD700;
}

.champion-card::before {
    background: linear-gradient(to right, #FFD700, #FFA500);
}

.cup-card {
    border-color: #C0C0C0;
}

.cup-card::before {
    background: linear-gradient(to right, #C0C0C0, #A0A0A0);
}

.overview-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.champion-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.champion-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--text-light);
    font-weight: 500;
}

.stat-row span:last-child {
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Stats grid for detailed statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

/* View Statistics Button */
.view-stats-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    width: 100%;
    justify-content: center;
}

.view-stats-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}

.view-stats-button .button-icon {
    font-size: 1.1rem;
}

/* League tables */
.tier-section {
    margin-bottom: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

#tier-tables-container .section-header,
#promotion-relegation-container .section-header,
#relegation-matches-container .section-header,
#season-cup-container .section-header,
#matchdays-container .section-header {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent);
}

/* Collapsible sections */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.section-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.875em;
    color: var(--accent);
}

.collapsible-header.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
    transition: max-height 0.3s ease;
}

/* Table responsive wrapper for horizontal scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    border-radius: var(--radius-sm);
}

.league-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.league-table thead {
    background: linear-gradient(to bottom, var(--bg-alt), var(--bg));
}

.league-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}

.league-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.league-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.league-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.league-table tbody tr:hover {
    background: var(--bg-alt);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.league-table tbody tr:last-child {
    border-bottom: none;
}

.league-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.league-table td:first-child {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-light);
}

.league-table .bey-name {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.league-table .bey-name strong {
    color: var(--accent);
}

/* Position indicators */
.promotion-zone {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.15) 0%, transparent 100%);
    border-left: 4px solid #22c55e;
}

.relegation-zone {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
    border-left: 4px solid #ef4444;
}

.playoff-zone {
    background: linear-gradient(to right, rgba(251, 191, 36, 0.15) 0%, transparent 100%);
    border-left: 4px solid #fbbf24;
}

.qualification-zone {
    background: linear-gradient(to right, rgba(249, 115, 22, 0.15) 0%, transparent 100%);
    border-left: 4px solid #f97316;
}

.table-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-left: 3px solid var(--accent);
}

.table-legend strong {
    color: var(--text);
    font-weight: 700;
}

/* Position legend */
.position-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}

.position-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.position-legend-indicator {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.position-legend-indicator.promotion {
    background: #22c55e;
}

.position-legend-indicator.relegation {
    background: #ef4444;
}

.position-legend-indicator.playoff {
    background: #fbbf24;
}

.position-legend-indicator.qualification {
    background: #f97316;
}

/* New tier section with side-by-side layout */
.tier-section-new {
    margin-bottom: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.tier-content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.tier-table-column {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow table to shrink */
}

.tier-matches-column {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow matches to shrink */
}

.tier-subsection-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.matchday-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.matchday-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    text-align: center;
    flex: 1;
}

.matchday-nav-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
}

.matchday-nav-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.matchday-nav-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-arrow {
    font-size: 1rem;
}

/* Table snapshot navigator styles */
.table-header-with-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-snapshot-navigator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
}

.snapshot-matchday-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    min-width: 3.5rem;
    text-align: center;
}

.snapshot-nav-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
}

.snapshot-nav-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.snapshot-nav-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Position delta column styles */
.position-delta {
    font-weight: 600;
    text-align: center;
    font-size: 0.875rem;
}

.position-delta.delta-up {
    color: #10b981; /* Green for moving up */
}

.position-delta.delta-down {
    color: #ef4444; /* Red for moving down */
}

.position-delta.delta-same {
    color: var(--text-light); /* Gray for no change */
}

.tier-matches-container {
    flex: 1;
    overflow-y: auto;
    max-height: 800px;
}

.tier-matches-container .matches-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .tier-content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tier-matches-container {
        max-height: 600px;
    }
    
    /* Ensure table scrolls horizontally on mobile */
    .tier-table-column .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .matchday-navigator {
        padding: 0.75rem;
    }
    
    .matchday-title {
        font-size: 1rem;
    }
    
    .matchday-nav-btn {
        padding: 0.4rem 0.8rem;
        min-width: 2.5rem;
    }
    
    .tier-matches-container {
        max-height: 500px;
    }
    
    /* Better spacing for match cards on mobile */
    .tier-matches-container .matches-grid {
        gap: 1rem;
    }
}

/* Compact season match cards */
.season-match-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.season-match-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.season-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.season-card-match-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    width: 100%;
}

.season-compact-bey {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.season-compact-bey-left {
    justify-content: flex-start;
}

.season-compact-bey-right {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.season-compact-bey.winner {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.season-compact-bey.winner .bey-link {
    color: white;
    font-weight: 600;
}

.season-compact-bey.winner .bey-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.season-compact-bey.winner .elo-delta-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.compact-bey-name {
    font-weight: 500;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-bey-score {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.compact-bey-elo-change {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.compact-vs {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Mobile adjustments for compact cards */
@media (max-width: 768px) {
    .season-card-match-compact {
        gap: 0.5rem;
    }
    
    .season-compact-bey {
        padding: 0.35rem 0.5rem;
        gap: 0.35rem;
    }
    
    .compact-bey-name {
        font-size: 0.85rem;
    }
    
    .compact-bey-score {
        font-size: 1.1rem;
        min-width: 1.25rem;
    }
    
    .compact-bey-elo-change {
        font-size: 0.7rem;
    }
    
    .compact-vs {
        font-size: 0.75rem;
    }
}

/* Promotion/Relegation */
.pr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.pr-section {
    padding: 2rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.pr-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.promotion-section {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.relegation-section {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.pr-section h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.pr-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pr-section li {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.pr-section li:hover {
    background: var(--bg-alt);
    transform: translateX(4px);
}

.pr-section li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.pr-section li strong {
    color: var(--accent);
    font-weight: 700;
}

/* Qualification Pool */
.qualification-pool-section {
    margin-top: 1rem;
}

.qualification-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.qualification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.qualification-card {
    background: var(--card);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.qualification-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(251, 191, 36, 0.6);
}

.qualification-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.qualification-bey {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.qualification-elo {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Relegation matches */
.relegation-matches-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.relegation-match-card {
    background: var(--card-bg);
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 8px;
    padding: 1.5rem;
}

.match-header {
    text-align: center;
    margin-bottom: 1rem;
}

.match-participants {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 1.5rem 0;
}

.participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.position-badge {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.tier-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.match-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 1rem 0 0 0;
}

/* Season Cup */
.cup-winner-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid var(--gold, #FFD700);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cup-winner-banner h3 {
    margin: 0;
    color: var(--accent);
}

.bracket-info {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Matchdays */
#matchdays-container .matchday-section {
    margin-bottom: 2rem;
}

#matchdays-container .matchday-section h4 {
    margin: 0 0 1rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-subtle);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    position: sticky;
    top: 70px;
    z-index: 10;
}

#matchdays-container .matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

#matchdays-container .match-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: block;
}

#matchdays-container .match-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#matchdays-container .match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-light);
}

#matchdays-container .match-card-context {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#matchdays-container .match-card-context-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#matchdays-container .match-card-context-separator {
    color: var(--border-dark);
}

#matchdays-container .match-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ensure card-bey winner styles work in season context */
#matchdays-container .card-bey.winner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

#matchdays-container .card-bey.winner .bey-link {
    color: white;
}

#matchdays-container .card-bey.winner .bey-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

#matchdays-container .card-bey.winner .bey-elo {
    color: rgba(255, 255, 255, 0.95);
}

#matchdays-container .card-bey.winner .elo-change {
    color: rgba(255, 255, 255, 0.95);
}

#matchdays-container .card-bey.winner .elo-change.positive {
    color: #d1fae5;
}

#matchdays-container .card-bey.winner .elo-change.negative {
    color: #fecaca;
}

#matchdays-container .card-bey.loser {
    background: var(--bg-secondary);
    opacity: 0.75;
}

#matchdays-container .elo-change {
    font-weight: 600;
    font-size: 0.7rem;
}

#matchdays-container .elo-change.positive {
    color: #10b981;
}

#matchdays-container .elo-change.negative {
    color: #ef4444;
}

#matchdays-container .match-card-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-subtle);
}

#matchdays-container .match-card-footer .match-id {
    font-family: 'Courier New', monospace;
    opacity: 0.7;
}

#matchdays-container .match-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#matchdays-container .match-tag {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-subtle);
    color: var(--text-light);
}

/* Rounds section styling */
#matchdays-container .match-card-rounds {
    /* No border needed - rounds toggle is in footer */
}

#matchdays-container .rounds-toggle {
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

#matchdays-container .rounds-toggle:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--text);
}

#matchdays-container .rounds-toggle.expanded {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

#matchdays-container .rounds-toggle.expanded:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

#matchdays-container .toggle-icon {
    font-size: 0.65rem;
}

#matchdays-container .rounds-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#matchdays-container .rounds-content.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

#matchdays-container .rounds-list {
    padding: 1rem;
    background: var(--bg);
}

#matchdays-container .round-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

#matchdays-container .round-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

#matchdays-container .round-number {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 30px;
}

#matchdays-container .finish-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

#matchdays-container .finish-icon {
    font-size: 0.9rem;
}

#matchdays-container .finish-label {
    font-size: 0.75rem;
}

#matchdays-container .round-points {
    margin-left: auto;
    font-weight: 700;
    color: var(--accent);
}

#matchdays-container .round-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

#matchdays-container .round-winner {
    font-weight: 600;
    color: var(--text);
}

#matchdays-container .round-score {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.85rem;
}

#matchdays-container .rounds-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

#matchdays-container .finish-summary-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.no-data-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.error-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--danger, #ef4444);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .system-summary,
    .format-grid,
    .season-highlights,
    .tier-champions-grid,
    .season-overview-grid,
    .pr-grid,
    .relegation-matches-list {
        grid-template-columns: 1fr;
    }
    
    /* More compact spacing for mobile */
    .season-overview-grid {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .overview-card {
        padding: 1rem;
    }
    
    .overview-card h3 {
        margin: 0 0 0.75rem 0;
        font-size: 0.95rem;
    }
    
    .tier-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
    
    .tier-section h3 {
        margin: 0 0 0.75rem 0;
        font-size: 1.125rem;
        padding-bottom: 0.5rem;
    }
    
    #tier-tables-container .section-header,
    #promotion-relegation-container .section-header,
    #relegation-matches-container .section-header,
    #season-cup-container .section-header,
    #matchdays-container .section-header {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.125rem;
    }
    
    #matchdays-container .matches-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    #matchdays-container .matchday-section {
        margin-bottom: 1.5rem;
    }
    
    #matchdays-container .matchday-section h4 {
        font-size: 0.95rem;
        position: static;
        margin: 0 0 0.75rem 0;
        padding: 0.4rem 0.625rem;
    }
    
    #matchdays-container .match-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    #matchdays-container .match-card-context {
        flex-wrap: wrap;
        font-size: 0.7rem;
    }
    
    #matchdays-container .round-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #matchdays-container .finish-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    #matchdays-container .finish-label {
        display: none;
    }
    
    .match-participants {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs {
        transform: rotate(90deg);
    }
    
    /* Mobile-friendly league tables with horizontal scroll */
    .tier-section {
        padding: 1rem;
    }
    
    .tier-section h3 {
        font-size: 1.2rem;
    }
    
    /* Horizontal scrolling for wide tables */
    .table-responsive {
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem;
        border-radius: 0;
    }
    
    .league-table {
        font-size: 0.75rem;
        min-width: 600px; /* Ensure table doesn't squeeze too much */
    }
    
    .league-table th,
    .league-table td {
        padding: 0.5rem 0.35rem;
    }
    
    .league-table th {
        font-size: 0.65rem;
        letter-spacing: 0.02em;
    }
    
    .league-table td:first-child {
        font-size: 0.85rem;
    }
    
    .league-table .bey-name {
        font-size: 0.85rem;
    }
    
    /* Reduce hover effect on mobile for performance */
    .league-table tbody tr:hover {
        transform: none;
    }
    
    .table-legend {
        font-size: 0.7rem;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .position-legend {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
    
    #tier-tables-container .section-header,
    #promotion-relegation-container .section-header,
    #relegation-matches-container .section-header,
    #season-cup-container .section-header,
    #matchdays-container .section-header {
        font-size: 1.5rem;
    }
    
    .overview-card {
        padding: 1.5rem;
    }
    
    .champion-name {
        font-size: 1.4rem;
    }
    
    .stat-row {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - more aggressive sizing */
    .tier-section {
        padding: 0.75rem;
    }
    
    .tier-section h3 {
        font-size: 1.1rem;
    }
    
    .table-responsive {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
    
    .league-table {
        font-size: 0.7rem;
        min-width: 580px;
    }
    
    .league-table th,
    .league-table td {
        padding: 0.4rem 0.25rem;
    }
    
    .league-table th {
        font-size: 0.6rem;
    }
    
    .league-table td:first-child {
        font-size: 0.8rem;
    }
    
    .league-table .bey-name {
        font-size: 0.8rem;
    }
    
    #tier-tables-container .section-header,
    #promotion-relegation-container .section-header,
    #relegation-matches-container .section-header,
    #season-cup-container .section-header,
    #matchdays-container .section-header {
        font-size: 1.25rem;
        padding-bottom: 0.75rem;
    }
    
    .overview-card {
        padding: 1rem;
    }
    
    .champion-name {
        font-size: 1.2rem;
    }
    
    .stat-row {
        font-size: 0.8rem;
    }
    
    .table-legend,
    .position-legend {
        font-size: 0.65rem;
        gap: 0.5rem;
        padding: 0.6rem;
    }
}

/* ========================================
   Fixtures Section Styles
   ======================================== */

/* Fixtures Section */
#fixtures-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.fixtures-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
    text-align: center;
}

.fixtures-matchday {
    margin-bottom: 2rem;
}

.fixtures-matchday-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent);
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--accent);
}

.fixtures-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fixtures-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

.fixtures-table thead {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.05) 100%);
    border-bottom: 2px solid var(--accent);
}

.fixtures-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.fixtures-table th[colspan="3"] {
    text-align: center;
}

.fixture-row {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.fixture-row:hover {
    background: rgba(var(--accent-rgb), 0.03);
    transform: scale(1.01);
}

.fixture-row td {
    padding: 1rem;
    vertical-align: middle;
}

.fixture-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.fixture-tier {
    text-align: center;
}

.tier-badge-compact {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, rgba(var(--accent-rgb), 0.8) 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.fixture-bey-home {
    text-align: right;
    padding-right: 1.5rem !important;
}

.fixture-bey-away {
    text-align: left;
    padding-left: 1.5rem !important;
}

.fixture-bey {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.fixture-bey:hover {
    color: var(--accent);
}

.fixture-vs {
    text-align: center;
    font-weight: 400;
}

.vs-text {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.fixture-status {
    text-align: center;
}

.fixture-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, var(--warning) 0%, rgba(var(--warning-rgb), 0.8) 100%);
    color: var(--bg);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .fixtures-intro {
        font-size: 0.9rem;
    }
    
    .fixtures-table {
        font-size: 0.85rem;
    }
    
    .fixtures-table th,
    .fixture-row td {
        padding: 0.75rem 0.5rem;
    }
    
    .fixture-bey {
        font-size: 0.9rem;
    }
    
    .fixture-date {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .fixtures-table {
        font-size: 0.8rem;
    }
    
    .fixtures-table th,
    .fixture-row td {
        padding: 0.5rem 0.25rem;
    }
    
    .fixture-bey {
        font-size: 0.85rem;
    }
    
    .fixture-bey-home,
    .fixture-bey-away {
        padding-right: 0.5rem !important;
        padding-left: 0.5rem !important;
    }
}

/* Arena Badge Styles */
.arena-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.arena-badge.arena-xtreme {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
}

.arena-badge.arena-drop-attack {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

body.dark .arena-badge.arena-xtreme {
    background: rgba(139, 92, 246, 0.25);
}

body.dark .arena-badge.arena-drop-attack {
    background: rgba(245, 158, 11, 0.25);
}

.arena-cell {
    text-align: center;
}

/* Arena badge in mobile cards */
.card-header .arena-badge {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

/* Match type badges */
.match-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.match-type-badge.match-type-exhibition {
    background-color: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.2);
}

.match-type-badge.match-type-season {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.match-type-badge.match-type-relegation {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.match-type-badge.match-type-season_cup {
    background-color: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

body.dark .match-type-badge.match-type-exhibition {
    color: #9ca3af;
}

body.dark .match-type-badge.match-type-season {
    color: #60a5fa;
}

body.dark .match-type-badge.match-type-relegation {
    color: #fbbf24;
}

body.dark .match-type-badge.match-type-season_cup {
    color: #a78bfa;
}

/* Match metadata cells */
.match-type-cell,
.season-cell,
.tier-cell,
.matchday-cell {
    text-align: center;
    vertical-align: middle;
}

.season-cell,
.tier-cell,
.matchday-cell {
    font-size: 0.85rem;
    color: #6b7280;
}

body.dark .season-cell,
body.dark .tier-cell,
body.dark .matchday-cell {
    color: #9ca3af;
}

/* Card metadata */
.card-match-type {
    margin: 8px 0;
    text-align: center;
}

.card-metadata {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.card-metadata .meta-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

body.dark .card-metadata .meta-item {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}


/* ============================================
   RESPONSIVE: MATCH INDEX CONTROLS
============================================ */
@media (max-width: 768px) {
    .match-index-controls {
        padding: 1rem;
    }
    
    .match-index-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .match-index-value {
        font-size: 1.25rem;
        min-width: 3rem;
    }
    
    .match-index-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .match-index-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8125rem;
    }
    
    .match-index-input {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .match-index-title {
        font-size: 0.9375rem;
    }
    
    .toggle-text-small {
        font-size: 0.8125rem;
    }
    
    .match-index-info {
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    .match-index-value {
        font-size: 1.5rem;
    }
    
    .slider-markers {
        font-size: 0.7rem;
    }
    
    .match-index-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .match-index-btn {
        flex: 1;
        min-width: 70px;
    }
    
    .match-index-reset {
        flex: 1;
    }
    
    .match-details {
        padding: 0.5rem 0.75rem;
    }
    
    .match-details-header {
        font-size: 0.75rem;
    }
    
    .match-teams {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .match-score {
        font-size: 1rem;
    }
}

/* ============================================
   ARENA COMPARISON TABLE STYLES
============================================ */

/* Arena comparison headers - add visual grouping */
th[data-arena="xtreme"] {
    background: linear-gradient(135deg, rgba(61, 110, 0, 0.1) 0%, rgba(45, 82, 0, 0.15) 100%) !important;
    border-left: 2px solid #3d6e00 !important;
}

th[data-arena="drop_attack"] {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(234, 88, 12, 0.15) 100%) !important;
    border-left: 2px solid #f97316 !important;
}

th[data-arena="combined"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.15) 100%) !important;
    border-left: 2px solid #10b981 !important;
}

/* Arena comparison cells - subtle background tinting */
td[data-arena="xtreme"] {
    background-color: rgba(61, 110, 0, 0.02);
    border-left: 1px solid rgba(61, 110, 0, 0.2);
}

td[data-arena="drop_attack"] {
    background-color: rgba(249, 115, 22, 0.02);
    border-left: 1px solid rgba(249, 115, 22, 0.2);
}

td[data-arena="combined"] {
    background-color: rgba(16, 185, 129, 0.02);
    border-left: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dark mode adjustments for arena comparison */
body.dark th[data-arena="xtreme"] {
    background: linear-gradient(135deg, rgba(123, 198, 24, 0.15) 0%, rgba(101, 168, 20, 0.2) 100%) !important;
}

body.dark th[data-arena="drop_attack"] {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.2) 100%) !important;
}

body.dark th[data-arena="combined"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%) !important;
}

body.dark td[data-arena="xtreme"] {
    background-color: rgba(123, 198, 24, 0.05);
}

body.dark td[data-arena="drop_attack"] {
    background-color: rgba(249, 115, 22, 0.05);
}

body.dark td[data-arena="combined"] {
    background-color: rgba(16, 185, 129, 0.05);
}

/* Arena group labels for comparison view */
.arena-group-label {
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem;
    border-bottom: 2px solid;
}

.arena-group-label.xtreme {
    background: linear-gradient(135deg, rgba(61, 110, 0, 0.15) 0%, rgba(45, 82, 0, 0.2) 100%);
    border-color: #3d6e00;
    color: #2d5200;
}

.arena-group-label.drop-attack {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.2) 100%);
    border-color: #f97316;
    color: #ea580c;
}

.arena-group-label.combined {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: #10b981;
    color: #059669;
}

body.dark .arena-group-label.xtreme {
    color: #7bc618;
}

body.dark .arena-group-label.drop-attack {
    color: #fdba74;
}

body.dark .arena-group-label.combined {
    color: #6ee7b7;
}

/* ============================================
   RANDOM BEY DRAW STYLES
   ============================================ */

/* Hero Section */
.random-draw-hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.random-draw-hero h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: var(--text);
}

.random-draw-description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Controls Section */
.random-draw-controls {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.control-input {
    padding: 0.75rem;
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
    font-weight: 500;
}

.control-input:focus {
    outline: none;
    border-color: var(--accent);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.control-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    font-weight: 500;
}

.algorithm-options {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border);
    clear: both;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4a8000 0%, #2d5200 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 110, 0, 0.4);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border-dark);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--accent);
}

/* Results Section */
.random-draw-results {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    margin: 0;
    color: var(--text);
}

.results-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-light);
}

.results-info .separator {
    opacity: 0.5;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.results-table th {
    background: var(--bg-subtle);
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border-dark);
}

.results-table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.results-table tr:hover {
    background: var(--bg-subtle);
}

.col-seed {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
}

.col-bey {
    min-width: 150px;
}

.col-bey a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.col-bey a:hover {
    text-decoration: underline;
}

.col-elo, .col-rank {
    width: 80px;
    text-align: center;
}

.col-type {
    width: 100px;
}

.col-archetype {
    min-width: 150px;
}

.col-stats {
    width: 120px;
    text-align: center;
}

/* Export Options */
.export-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

/* Info Section */
.random-draw-info {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
}

.random-draw-info h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text);
    text-align: center;
}

.algorithm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.algorithm-card {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    border: 3px solid var(--border-dark);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.algorithm-card:hover {
    border-color: var(--accent);
    border-width: 3px;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.algorithm-card h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
}

.algorithm-card p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .random-draw-hero h2 {
        font-size: 1.5rem;
    }

    .random-draw-description {
        font-size: 1rem;
    }

    .controls-grid,
    .algorithm-options {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.625rem;
    }

    /* Hide some columns on mobile */
    .col-rank,
    .col-stats {
        display: none;
    }

    .algorithm-cards {
        grid-template-columns: 1fr;
    }

    .action-buttons,
    .export-options {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Specific Adjustments */
body.dark .random-draw-hero {
    background: linear-gradient(135deg, rgba(123, 198, 24, 0.15) 0%, rgba(0, 80, 0, 0.2) 100%);
}

body.dark .random-draw-controls {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-dark);
}

body.dark .control-input {
    border-color: var(--border-dark);
    background: var(--bg);
}

body.dark .control-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(123, 198, 24, 0.2);
}

body.dark .algorithm-card {
    background: var(--bg);
    border-color: var(--border-dark);
    box-shadow: var(--shadow-md);
}

body.dark .btn-primary {
    background: linear-gradient(135deg, #7bc618 0%, #3d6e00 100%);
    color: #000000;
}

body.dark .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(123, 198, 24, 0.4);
}

body.dark .algorithm-card:hover {
    box-shadow: 0 6px 16px rgba(123, 198, 24, 0.25);
    border-color: var(--accent);
}

/* Dark mode: bey image backgrounds */
body.dark .wiki-card-image,
body.dark .hover-card-image,
body.dark .profile-image-container {
    background: #1a1a1a;
}

body.dark .wiki-card-image img,
body.dark .hover-card-image img,
body.dark .profile-image {
    filter: brightness(0.75) contrast(1.1);
}

/* All-time standings legend */
.alltime-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.alltime-legend strong {
    color: var(--text);
    margin-right: 0.25rem;
}

.alltime-legend abbr {
    text-decoration: underline dotted;
    cursor: help;
    color: var(--accent);
    font-weight: 600;
}

/* Per-bey score distribution section */
.score-dist-bey-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 12px 0 4px;
}

.score-dist-bey-chart-container {
    height: 380px;
    position: relative;
}

.score-dist-bey-table-container {
    overflow-x: auto;
}

.score-dist-table {
    width: 100%;
}

.score-dist-table tfoot td {
    border-top: 2px solid var(--border);
    padding-top: 8px;
}

.inline-bar-outer {
    background: var(--border);
    border-radius: 4px;
    height: 10px;
    width: 100%;
    min-width: 60px;
    overflow: hidden;
}

.inline-bar-inner {
    background: var(--accent);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Generic data table used across pages */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, var(--border));
    white-space: nowrap;
}

.data-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary, var(--bg));
}
