:root {
    --bg-dark: #08121f;
    --bg-dark-2: #040b16;
    --primary: #1ca3ff;
    --primary-glow: rgba(28, 163, 255, 0.48);
    --secondary: #14c6a3;
    --accent: #ff6a3d;
    --text-main: #f8fbff;
    --text-muted: #92a6bf;
    --glass-border: rgba(148, 182, 219, 0.2);
    --glass-bg: rgba(18, 33, 53, 0.48);
    --glass-shadow: 0 14px 38px -14px rgba(1, 9, 20, 0.8);
    --gradient-1: linear-gradient(128deg, #1ca3ff 0%, #14c6a3 62%, #f59e0b 100%);
    --gradient-text: linear-gradient(115deg, #f8fbff 0%, #d6e4f5 100%);
    --liquid-sheen: rgba(255, 255, 255, 0.18);
    --liquid-specular: rgba(187, 228, 255, 0.28);
    --liquid-shadow: 0 16px 44px -24px rgba(2, 8, 20, 0.88);
    --bg-focus-x: 12%;
    --bg-focus-y: 18%;
    --bg-drift-x: 0%;
    --bg-drift-y: 0%;
    --bg-parallax-x: 0px;
    --bg-parallax-y: 0px;
    --overlay-shift-x: 0px;
    --overlay-shift-y: 0px;
    --overlay-shift-x-inv: 0px;
    --overlay-shift-y-inv: 0px;
}

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

body {
    font-family: 'Manrope', 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* --- Background & Overlay --- */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(60% 45% at var(--bg-focus-x) var(--bg-focus-y), rgba(28, 163, 255, 0.22), transparent 60%),
        radial-gradient(40% 30% at calc(86% + var(--bg-drift-x)) calc(14% + var(--bg-drift-y)), rgba(20, 198, 163, 0.2), transparent 70%),
        radial-gradient(38% 34% at calc(80% - var(--bg-drift-x)) calc(78% - var(--bg-drift-y)), rgba(245, 158, 11, 0.14), transparent 72%),
        linear-gradient(155deg, #060f1d 0%, #0b1d34 47%, #071423 100%);
    transform: translate3d(var(--bg-parallax-x), var(--bg-parallax-y), 0) scale(1.03);
    will-change: transform;
    transition: transform 150ms linear;
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(124, 164, 212, 0.02) 1px, transparent 1px),
        linear-gradient(0deg, rgba(124, 164, 212, 0.02) 1px, transparent 1px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    background-size: 36px 36px, 36px 36px, auto;
    background-position:
        var(--overlay-shift-x) var(--overlay-shift-y),
        var(--overlay-shift-x-inv) var(--overlay-shift-y-inv),
        center;
    will-change: background-position;
    pointer-events: none;
    z-index: -1;
}

/* --- Layout --- */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

/* --- Header --- */
.main-header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 90vw);
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(28, 163, 255, 0.25) 0%, rgba(20, 198, 163, 0.16) 45%, transparent 75%);
    filter: blur(26px);
    z-index: -1;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.main-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint ID: b6831e21-824b-423f-9038-e18df5b32d5e */
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.2px;
    margin: 0;
}

.badge {
    background: linear-gradient(135deg, rgba(28, 163, 255, 0.22), rgba(20, 198, 163, 0.18));
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    color: var(--secondary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

/* --- Navigation --- */
.main-nav {
    display: inline-flex;
    background: linear-gradient(135deg, rgba(10, 26, 44, 0.88), rgba(7, 21, 38, 0.84));
    padding: 0.45rem;
    border-radius: 100px;
    border: 1px solid rgba(138, 177, 220, 0.24);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
    gap: 0.5rem;
}

.main-nav,
.config-card,
.match-card,
.insights-panel,
.result-card,
.round-selector,
.lang-btn,
.analysis-panel,
.team-card,
.scoreline-perspective-card,
.confidence-indicator {
    isolation: isolate;
    overflow: hidden;
    box-shadow: var(--liquid-shadow), inset 0 1px 0 var(--liquid-sheen);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    --lg-local-x: 50%;
    --lg-local-y: 34%;
    --lg-pointer-x: 70%;
    --lg-pointer-y: 24%;
    --lg-shift-x: 0px;
    --lg-shift-y: 0px;
    --lg-scale: 1.05;
    --lg-blur: 7px;
    --lg-tilt: 156deg;
    --lg-gloss-opacity: 0.48;
}

.main-nav::after,
.config-card::after,
.match-card::after,
.insights-panel::after,
.result-card::after,
.round-selector::after,
.lang-btn::after,
.analysis-panel::after,
.team-card::after,
.scoreline-perspective-card::after,
.confidence-indicator::after {
    content: '';
    position: absolute;
    inset: -40% -22%;
    border-radius: inherit;
    background:
        radial-gradient(52% 40% at var(--lg-local-x) var(--lg-local-y), rgba(255, 255, 255, 0.24), transparent 72%),
        radial-gradient(34% 26% at var(--lg-pointer-x) var(--lg-pointer-y), var(--liquid-specular), transparent 78%),
        radial-gradient(30% 24% at calc(100% - var(--lg-local-x)) calc(100% - var(--lg-local-y)), rgba(20, 198, 163, 0.18), transparent 80%),
        linear-gradient(var(--lg-tilt), rgba(255, 255, 255, 0.14), transparent 56%);
    opacity: var(--lg-gloss-opacity);
    pointer-events: none;
    z-index: 0;
    transform: translate3d(var(--lg-shift-x), var(--lg-shift-y), 0) scale(var(--lg-scale));
    filter: blur(var(--lg-blur));
    transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
}

.main-nav>*,
.config-card>*,
.match-card>*,
.insights-panel>*,
.result-card>*,
.round-selector>*,
.lang-btn>*,
.analysis-panel>*,
.team-card>*,
.scoreline-perspective-card>*,
.confidence-indicator>* {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .app-background {
        transform: none;
        transition: none;
    }

    .overlay {
        background-position: center, center, center;
    }

    .main-nav::after,
    .config-card::after,
    .match-card::after,
    .insights-panel::after,
    .result-card::after,
    .round-selector::after,
    .lang-btn::after,
    .analysis-panel::after,
    .team-card::after,
    .scoreline-perspective-card::after,
    .confidence-indicator::after {
        transform: none;
        filter: none;
        transition: none;
    }
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    color: #fff;
    background: rgba(124, 164, 212, 0.12);
    border-color: rgba(124, 164, 212, 0.24);
}

.nav-btn.active {
    background: linear-gradient(132deg, rgba(28, 163, 255, 0.34), rgba(20, 198, 163, 0.3));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(148, 198, 247, 0.36), 0 8px 20px -12px rgba(28, 163, 255, 0.65);
    border-color: rgba(158, 212, 255, 0.36);
    font-weight: 700;
}

/* --- Sections --- */
.view-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    display: none;
}

.view-section.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Utilities */
.hidden {
    display: none !important;
}

.view-section.hidden {
    display: none;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--text-muted);
}

/* --- Comparison Interface --- */
.comparison-interface {
    display: flex;
    justify-content: center;
    /* Center items instead of space-between */
    align-items: center;
    /* Align items vertically center */
    gap: 0;
    /* Removing gap, using margins or specific spacing logic */
    position: relative;
    margin: 4rem 0;
    width: 100%;
    /* Ensure full width utilisation */
}

.team-card {
    position: relative;
    width: 300px;
    /* Fixed width for consistency */
    aspect-ratio: 4/5;
    border-radius: 24px;
    padding: 2px;
    /* For border gradient */
    background: linear-gradient(170deg, rgba(73, 138, 210, 0.42), rgba(10, 28, 51, 0.12));
    overflow: hidden;
    transition: transform 0.4s ease;
    /* Flex item properties */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 36px -20px rgba(20, 198, 163, 0.5);
}

.card-glass {
    position: absolute;
    inset: 1px;
    background: var(--glass-bg);
    border-radius: 23px;
    backdrop-filter: blur(20px);
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.team-card label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
    align-self: flex-start;
    width: 100%;
}

.team-info-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.team-info-display .team-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.team-info-display h2 {
    font-size: 2rem;
    text-align: center;
    line-height: 1.1;
    margin: 0;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint ID: cdda312f-57e5-4c90-9540-7b05abeeceec */
    -webkit-text-fill-color: transparent;
}

/* Special VS Badge */
.vs-badge {
    position: relative;
    /* Changed from absolute to flow in flex */
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    margin: 0 2rem;
    /* Add specific margin to separate cards */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.vs-badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--gradient-1);
    z-index: -1;
    animation: spin 7s linear infinite;
}

.vs-badge span {
    font-weight: 900;
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint ID: 62965aaf-5a25-41dc-8ede-ad3ee35d0bb0 */
    -webkit-text-fill-color: transparent;
}

/* Select Styling */
.select-wrapper {
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
}

/* Improve Select Visibility */
.team-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    /* Darker background */
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all 0.2s;
}

.team-select option {
    background-color: var(--bg-dark);
    /* Ensure options are readable */
    color: #fff;
}

.team-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Stats Comparison */
.stats-grid {
    max-width: 800px;
    margin: 3rem auto 0;
    display: grid;
    gap: 1.5rem;
}

.stat-row {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.stat-label {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-value {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 700;
    width: 60px;
}

.stat-value.left {
    text-align: right;
    color: var(--primary);
}

.stat-value.right {
    text-align: left;
    color: var(--accent);
}

.bar-wrapper {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    display: flex;
}

.bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px currentColor;
    /* Glow effect */
}

.bar-fill.left {
    background: var(--primary);
    color: var(--primary-glow);
    margin-left: auto;
}

.bar-fill.right {
    background: var(--accent);
    color: rgba(244, 63, 94, 0.5);
    margin-right: auto;
}

/* --- Simulation Section --- */
.simulation-layout {
    display: grid;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.config-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
}

.config-card h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modern-select {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(160deg, rgba(12, 28, 47, 0.76), rgba(10, 23, 39, 0.62));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    appearance: none;
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modern-select:focus {
    border-color: rgba(103, 193, 255, 0.7);
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 163, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modern-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sim-toggle-group {
    margin-top: -0.3rem;
}

.sim-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sim-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.sim-mode-group {
    margin-top: -0.2rem;
}

.sim-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.sim-mode-btn {
    border: 1px solid rgba(148, 182, 219, 0.28);
    background: linear-gradient(155deg, rgba(11, 26, 44, 0.75), rgba(9, 20, 35, 0.7));
    color: var(--text-muted);
    border-radius: 12px;
    padding: 0.62rem 0.75rem;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sim-mode-btn:hover {
    color: var(--text-main);
    border-color: rgba(103, 193, 255, 0.46);
}

.sim-mode-btn.active {
    color: #fff;
    border-color: rgba(117, 201, 255, 0.64);
    box-shadow: inset 0 0 0 1px rgba(117, 201, 255, 0.2);
    transform: translateY(-1px);
}

.sim-advanced-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.sim-advanced-column {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.sim-advanced-column h4 {
    margin: 0 0 0.15rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.sim-advanced-slider-card {
    padding: 0.65rem 0.7rem 0.45rem;
    border: 1px solid rgba(148, 182, 219, 0.2);
    border-radius: 12px;
    background: linear-gradient(155deg, rgba(8, 21, 35, 0.64), rgba(8, 18, 31, 0.6));
}

.sim-advanced-slider-card label {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    font-size: 0.77rem;
}

.sim-advanced-slider-card .adjustment-slider {
    margin: 0.25rem 0 0.1rem;
}

/* Adjustment Sliders */
.adjustment-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    outline: none;
    margin: 0.5rem 0;
}

.adjustment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-1);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: all 0.2s;
}

.adjustment-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.adjustment-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-1);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: all 0.2s;
}

.adjustment-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-group label span {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 900px) {
    .sim-advanced-columns {
        grid-template-columns: 1fr;
    }
}


.btn-action {
    position: relative;
    width: 100%;
    padding: 1.25rem;
    background: var(--gradient-1);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: 0 14px 30px -16px rgba(20, 198, 163, 0.7);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -16px rgba(28, 163, 255, 0.8);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

/* Simulation Results */
#sim-results {
    width: 100%;
    margin-top: 2rem;
    animation: slideUp 0.5s ease;
}

#sim-results .loading {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: 2rem;
}

#sim-results .error {
    color: var(--accent);
    text-align: center;
    padding: 2rem;
    background: rgba(244, 63, 94, 0.1);
    border-radius: 12px;
}

.result-card {
    background: linear-gradient(160deg, rgba(5, 16, 30, 0.95), rgba(8, 24, 44, 0.92));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-images-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.img-wrapper {
    flex: 1;
    min-width: 250px;
}

.img-wrapper h4 {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.result-img:hover {
    transform: scale(1.02);
}

.prob-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(9, 26, 45, 0.55);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.prob-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prob-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.predicted-score {
    font-size: 1.2rem;
}

.score-val {
    font-size: 2rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix lint ID: f537f7a2-d93f-419e-ac24-0342ba303969 */
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* --- Player Scout --- */
.scout-interface {
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.search-input:focus {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary);
    outline: none;
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.dropdown-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    list-style: none;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-results li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.dropdown-results li:hover {
    background: var(--primary);
}

.player-profile-card {
    background: var(--bg-dark-2);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    animation: slideUp 0.4s ease;
}

.profile-header-sm {
    text-align: center;
    margin-bottom: 2rem;
}

.team-chip {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.p-stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.p-stat-box.highlight {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.p-stat-box .val {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.chart-area {
    position: relative;
    height: 300px;
    /* Reduced height */
    width: 100%;
}

/* --- Explore Tab --- */
.explore-interface {
    max-width: 1000px;
    margin: 0 auto;
}

.team-selector-wrapper {
    max-width: 400px;
    margin: 0 auto 3rem;
    text-align: center;
}

.team-selector-wrapper label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.team-select-explore {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: all 0.3s;
    backdrop-filter: blur(12px);
}

.team-select-explore:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.team-select-explore option {
    background-color: var(--bg-dark);
    color: #fff;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.player-card-explore {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.player-card-explore::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.player-card-explore:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.player-card-explore:hover::before {
    transform: scaleX(1);
}

.player-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.player-card-overall {
    display: inline-block;
    background: var(--gradient-1);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.player-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.85rem;
}

.player-card-stat {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.player-card-stat span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

/* Player Modal */
.player-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-dark-2);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    padding: 2.5rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

.player-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.player-basic-info h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.player-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.overall-badge {
    background: var(--gradient-1);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    min-width: 100px;
}

.overall-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.overall-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 0.25rem;
}

.player-detail-body {
    display: grid;
    gap: 2rem;
}

.main-attributes h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.attr-grid {
    display: grid;
    gap: 1rem;
}

.attr-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.attr-label {
    min-width: 100px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.attr-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    height: 24px;
    position: relative;
    overflow: hidden;
}

.attr-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.attr-value {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 0.9rem;
    margin-left: auto;
    padding-right: 0.75rem;
}

.detailed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-category {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.stat-category h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--primary);
}

.stat-list {
    display: grid;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.stat-item span:first-child {
    color: var(--text-muted);
}

.stat-item span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

.radar-chart-container {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.radar-chart-container h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.radar-chart-container canvas {
    max-height: 300px;
}


/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(2, 6, 23, 0.5);
}

/* --- Animations --- */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

    100% {
        left: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile Responsibility --- */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
    }

    .comparison-interface {
        flex-direction: column;
        /* Stack vertically on mobile */
        gap: 2rem;
        margin: 2rem 0;
    }

    .vs-badge {
        margin: -1rem 0;
        /* Overlap slightly vertically */
        z-index: 20;
    }

    .team-card {
        width: 100%;
        /* Full width cards on mobile */
        max-width: 320px;
        /* But keep a reasonable max width */
    }

    .bar-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-value {
        width: 100%;
        text-align: center !important;
    }

    .prob-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Modal Adjustments */
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .player-detail-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .overall-badge {
        width: 100%;
        min-width: auto;
    }

    .attr-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .attr-label {
        min-width: auto;
    }

    .attr-bar-container {
        width: 100%;
    }

    .detailed-stats {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ENHANCED SIMULATION INSIGHTS STYLES
   ============================================ */

/* Insights Container */
.insights-container {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Insights Panel - Glassmorphism Card */
.insights-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.insights-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 20px 20px 0 0;
}

.insights-panel h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-panel h4 .icon {
    font-size: 1rem;
}

/* Score Probabilities Section */
.score-probabilities {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scoreline-perspective-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.scoreline-perspective-card {
    background: rgba(15, 23, 42, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.9rem;
}

.scoreline-perspective-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    font-weight: 700;
}

.scoreline-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scoreline-label {
    font-weight: 700;
    font-size: 1rem;
    min-width: 50px;
    color: #fff;
    font-family: 'Outfit', monospace;
}

.scoreline-bar-wrapper {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.scoreline-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    min-width: 40px;
}

.scoreline-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.scoreline-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Form Indicators */
.form-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-team {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-team-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-badge {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-badge.hot {
    color: #f97316;
}

.form-badge.neutral {
    color: #a3a3a3;
}

.form-badge.cold {
    color: #3b82f6;
}

.form-probs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-prob-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-prob-item .prob-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.form-prob-item .prob-value {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

/* Team Ratings Comparison */
.ratings-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-team-name {
    min-width: 120px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-bar-wrapper {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
}

.rating-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-bar.team1 {
    background: linear-gradient(90deg, var(--primary), #60a5fa);
}

.rating-bar.team2 {
    background: linear-gradient(90deg, var(--accent), #fb7185);
}

.rating-value {
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 40px;
    text-align: right;
}

.rating-value.team1 {
    color: var(--primary);
}

.rating-value.team2 {
    color: var(--accent);
}

/* Simulation Meta Info */
.sim-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-top: 1rem;
}

.sim-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sim-meta-item .meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.sim-meta-item .meta-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.heatmaps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.heatmap-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.75rem;
}

.heatmap-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.55rem;
}

.heatmap-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Responsive Adjustments for Insights */
@media (max-width: 768px) {
    .form-indicators {
        grid-template-columns: 1fr;
    }

    .scoreline-perspective-grid {
        grid-template-columns: 1fr;
    }

    .scoreline-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .scoreline-bar-wrapper {
        width: 100%;
    }

    .sim-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .rating-team-name {
        min-width: 80px;
        font-size: 0.8rem;
    }

    .state-profiles-grid {
        grid-template-columns: 1fr;
    }

    .heatmaps-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   HMM STATE PROFILES STYLES
   ============================================ */

/* Form Meta Info */
.form-meta {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Panel Subtitle */
.panel-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* State Profiles Grid */
.state-profiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.team-states h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.states-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* State Profile Card */
.state-profile-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.state-profile-empty {
    background: rgba(15, 23, 42, 0.45);
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 0.9rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

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

.state-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.state-matches {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
}

/* State Probability Bars */
.state-probs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.state-prob {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 20px;
    position: relative;
}

.state-prob .prob-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.state-prob.win .prob-bar {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.state-prob.draw .prob-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.state-prob.loss .prob-bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.state-prob .prob-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    min-width: 55px;
    text-align: right;
}

/* State Label Colors based on form */
.state-profile-card:has(.state-label:contains("Peak")) .state-label {
    color: #22c55e;
}

/* ============================================
   ENHANCED ANALYSIS TAB STYLES
   ============================================ */

/* Analysis Charts Container */
.analysis-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    animation: slideUp 0.5s ease;
}

.analysis-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.analysis-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-panel h3 .icon {
    font-size: 1.25rem;
}

/* Full Width Panels */
.analysis-panel.h2h-panel,
.analysis-panel.form-panel {
    grid-column: span 2;
}

/* Chart Wrapper */
.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-wrapper.radar-wrapper {
    height: 350px;
}

/* Head-to-Head Styles */
.h2h-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.h2h-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.h2h-team {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 30%;
}

.h2h-team:last-child {
    align-items: flex-end;
    text-align: right;
}

.h2h-team .team-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.h2h-wins {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.h2h-team:last-child .h2h-wins {
    color: var(--accent);
}

.h2h-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.h2h-draws {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.h2h-matches {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.h2h-goals {
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Form Display */
.form-display-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.form-team-label {
    min-width: 120px;
    font-weight: 600;
}

.form-icons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.form-icon.win {
    background: #22c55e;
    color: #fff;
}

.form-icon.draw {
    background: #f59e0b;
    color: #fff;
}

.form-icon.loss {
    background: #ef4444;
    color: #fff;
}

/* Match History Table */
.match-history-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.history-grid {
    display: grid;
    gap: 2rem;
}

.history-table-wrapper h5 {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    text-align: left;
    padding: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-w td:nth-child(3) {
    color: #22c55e;
    font-weight: 700;
}

.result-d td:nth-child(3) {
    color: #f59e0b;
    font-weight: 700;
}

.result-l td:nth-child(3) {
    color: #ef4444;
    font-weight: 700;
}

/* Rankings Grid */
.rankings-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-header {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
}

.ranking-item {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    align-items: center;
}

.ranking-metric {
    font-weight: 600;
    color: #fff;
}

.ranking-values {
    display: contents;
    /* Allows children to participate in parent grid */
}

.rank {
    text-align: center;
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
}

.rank.team1 {
    color: var(--primary);
}

.rank.team2 {
    color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .analysis-charts {
        grid-template-columns: 1fr;
    }

    .analysis-panel.h2h-panel,
    .analysis-panel.form-panel {
        grid-column: span 1;
    }

    .h2h-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .h2h-team {
        width: 100%;
        align-items: center !important;
        text-align: center !important;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   LANGUAGE SWITCHER STYLES
   ============================================ */

.header-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-menu {
    position: absolute;
    top: 120%;
    right: 0;
    width: 140px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.language-dropdown:hover .lang-menu,
.lang-menu.show {
    display: flex;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.lang-option.active {
    background: var(--primary);
    color: #fff;
}

.lang-option span {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .header-controls {
        position: static;
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
    }
}

/* ============================================
   SIMULATION LOADER ANIMATION
   ============================================ */

.sim-loader {
    position: relative;
    width: 100%;
    padding: 3rem 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 200, 255, 0.05));
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.sim-loader.hidden {
    display: none;
}

.loader-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.loader-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.football-icon {
    font-size: 3rem;
    animation: roll-football 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 255, 65, 0.3));
}

@keyframes roll-football {

    0%,
    100% {
        transform: translateX(-20px) rotate(0deg);
    }

    50% {
        transform: translateX(20px) rotate(360deg);
    }
}

.loader-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 255, 65, 0.3);
}

/* Progress Bar */
.progress-wrapper {
    position: relative;
    margin: 2rem auto;
    max-width: 500px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff41, #00c8ff);
    border-radius: 10px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.progress-glow {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 10px;
    filter: blur(8px);
    animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.progress-percentage {
    position: absolute;
    right: 0;
    top: -30px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ff41;
    text-shadow: 0 2px 8px rgba(0, 255, 65, 0.5);
}

.loader-subtitle {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Decorative Field Lines */
.field-lines {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    opacity: 0.3;
    pointer-events: none;
}

.field-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to top, #00ff41, transparent);
    animation: field-wave 2s ease-in-out infinite;
}

.field-line:nth-child(1) {
    animation-delay: 0s;
}

.field-line:nth-child(2) {
    animation-delay: 0.3s;
}

.field-line:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes field-wave {

    0%,
    100% {
        transform: scaleY(0.5);
        opacity: 0.2;
    }

    50% {
        transform: scaleY(1);
        opacity: 0.6;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sim-loader {
        padding: 2rem 1rem;
    }

    .football-icon {
        font-size: 2.5rem;
    }

    .loader-title {
        font-size: 1.2rem;
    }

    .progress-wrapper {
        max-width: 100%;
    }
}

/* ===== RECENT GAMES TAB ===== */
.recent-games-interface {
    max-width: 900px;
    margin: 0 auto;
}

.round-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.round-display {
    min-width: 170px;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.02em;
}

.round-nav-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-nav-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.matches-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.date-header {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary);
}

.match-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.match-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.match-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team.home {
    justify-content: flex-end;
    text-align: right;
}

.team.away {
    justify-content: flex-start;
}

.team-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.team-logo-wrap {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.team-logo-fallback {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 0.95rem;
    line-height: 1;
}

.team-logo-fallback.visible {
    display: inline-flex;
}

.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.predicted-score {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.match-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.confidence-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.confidence-badge.high {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.confidence-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.confidence-badge.low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.expand-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expand-btn:hover {
    background: var(--primary);
    color: #fff;
}

.probabilities-bar {
    display: flex;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.prob {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.prob.home {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.prob.draw {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.prob.away {
    background: linear-gradient(135deg, #f43f5e, #dc2626);
}

.hmm-adjust-summary {
    margin-top: 0.75rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
}

.hmm-adjust-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.hmm-adjust-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.2rem;
    font-size: 0.88rem;
}

.match-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.match-card.expanded .match-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.detail-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.xg-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.xg.home {
    color: var(--primary);
}

.xg.away {
    color: var(--accent);
}

.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== CONFIDENCE EXPLANATION PANEL ===== */
.confidence-explanation-panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

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

.confidence-icon {
    font-size: 2rem;
    line-height: 1;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.confidence-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.confidence-reason {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.confidence-evidence {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    margin: -0.35rem 0 1.1rem;
    font-size: 0.9rem;
}

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

.confidence-indicator {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.confidence-indicator:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.indicator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.indicator-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.indicator-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.indicator-help {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    line-height: 1;
    padding: 0;
}

.indicator-help:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.75);
    outline-offset: 2px;
}

.indicator-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: -6px;
    width: 240px;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.96);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.55);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 10;
}

.indicator-help-wrap:hover .indicator-tooltip,
.indicator-help-wrap:focus-within .indicator-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.indicator-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.indicator-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
}

.indicator-value.good {
    color: #22c55e;
}

.indicator-value.ok {
    color: #eab308;
}

.indicator-value.warn {
    color: #ef4444;
}

.indicator-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.indicator-status.good {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.indicator-status.ok {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.indicator-status.warn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@media (max-width: 600px) {
    .confidence-indicators {
        grid-template-columns: 1fr;
    }

    .confidence-explanation-panel {
        padding: 1rem;
    }

    .indicator-tooltip {
        right: 0;
        top: calc(100% + 8px);
        width: min(260px, 72vw);
    }
}

/* ============================================================================

/* ============================================================================
   FORMATION PITCH VISUALIZATION - DUAL VERTICAL PITCHES
   ============================================================================ */

.pitch-container {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.pitch-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dual Pitch Layout */
.dual-pitch-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.single-pitch-wrapper {
    flex: 1;
    max-width: 400px;
}

.pitch-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.home-pitch .pitch-header {
    border-left: 3px solid #3b82f6;
}

.away-pitch .pitch-header {
    border-left: 3px solid #f43f5e;
}

.pitch-view-single {
    width: 100%;
    aspect-ratio: 68 / 100;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.pitch-view-single svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* VS Divider */
.vs-divider-center {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 15px;
    flex-shrink: 0;
}

/* Team Players */
.player-node {
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-node:hover {
    transform: scale(1.15);
}

.player-node:hover .player-circle {
    filter: brightness(1.3);
}

.player-circle {
    transition: all 0.2s ease;
}

.home-team .player-circle {
    fill: #3b82f6;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 0.4;
}

.away-team .player-circle {
    fill: #f43f5e;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 0.4;
}

.player-number {
    fill: white;
    font-size: 2.8px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    user-select: none;
}

.player-name {
    fill: white;
    font-size: 2px;
    text-anchor: middle;
    opacity: 0.95;
    pointer-events: none;
    user-select: none;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Team Info */
.team-badge {
    font-size: 2rem;
    margin-bottom: 8px;
}

.team-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-main);
}

.team-formation {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.pitch-formation-select {
    width: 140px;
    max-width: 100%;
    margin: 6px auto 0;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    background: rgba(15, 23, 42, 0.55);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dual-pitch-layout {
        gap: 20px;
    }

    .single-pitch-wrapper {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .pitch-container {
        padding: 15px;
        margin: 20px auto;
    }

    .pitch-title {
        font-size: 1.2rem;
    }

    .dual-pitch-layout {
        flex-direction: column;
        gap: 30px;
    }

    .single-pitch-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .vs-divider-center {
        transform: rotate(90deg);
        padding: 10px 0;
        font-size: 1.2rem;
    }

    .player-name {
        font-size: 1.8px;
    }
}

/* Hidden by default */
.pitch-container.hidden {
    display: none;
}


/* 3-Column Grid Layout for Simulation Tab */
.simulation-layout-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* When both pitches are hidden, center the entire grid layout */
.simulation-layout-grid:has(.pitch-column.hidden:nth-child(1)):has(.pitch-column.hidden:nth-child(3)) {
    justify-content: center;
    grid-template-columns: auto;
}

.pitch-column {
    width: 100%;
    max-width: 300px;
    /* Reduced from 350px to give more space */
    justify-self: center;
}

.sim-config {
    width: 100%;
    min-width: 400px;
    /* Ensure minimum width */
    max-width: 450px;
    justify-self: center;
}

.pitch-column.hidden {
    display: none;
}

/* Responsive: stack vertically on tablet/mobile */
@media (max-width: 1200px) {
    .simulation-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pitch-column {
        max-width: 100%;
    }

    .sim-config {
        order: -1;
        /* Put match setup first on mobile */
    }
}

/* Team logo in pitch header */
.pitch-team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.pitch-cluster-overlay {
    pointer-events: none;
}

.pitch-cluster-zone {
    stroke: rgba(255, 255, 255, 0.36);
    stroke-width: 0.35;
    stroke-dasharray: 1.2 0.9;
}

.pitch-cluster-label {
    fill: rgba(255, 255, 255, 0.9);
    font-size: 2.4px;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: rgba(4, 13, 25, 0.72);
    stroke-width: 0.28;
    letter-spacing: 0.15px;
}

/* ============================================================================
   DRAWING BOARD TAB
   ============================================================================ */

.drawing-board-shell {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    width: 100%;
}

.db-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.db-selector-card {
    padding: 1rem 1.1rem;
}

.db-selector-card h3 {
    margin-bottom: 0.7rem;
    font-size: 1rem;
}

.db-selector-card .form-group {
    margin-bottom: 0;
}

.drawing-board-main-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.74fr) minmax(220px, 0.74fr) minmax(260px, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.db-team-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.db-team-panel.hidden {
    display: none;
}

.db-adjustment-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.db-adjustment-title {
    padding: 0.9rem 1rem;
}

.db-adjustment-title h3 {
    margin: 0;
    font-size: 1rem;
}

.db-slider-card {
    padding: 0.85rem 0.95rem;
}

.db-slider-card label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.4rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.db-slider-card label span {
    color: var(--primary);
    font-weight: 700;
}

.db-slider-card .adjustment-slider {
    margin: 0.25rem 0 0.1rem;
}

@media (max-width: 1480px) {
    .drawing-board-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .db-adjustment-column {
        order: 2;
    }

    .db-team-panel {
        order: 1;
    }

    .db-team-panel.away-panel {
        order: 3;
    }

    .db-adjustment-column.away-column {
        order: 4;
    }
}

@media (max-width: 1100px) {
    .db-selector-grid {
        grid-template-columns: 1fr;
    }

    .drawing-board-main-grid {
        grid-template-columns: 1fr;
    }

    .db-team-panel,
    .db-adjustment-column,
    .db-team-panel.away-panel,
    .db-adjustment-column.away-column {
        order: initial;
    }
}
/* ============================================================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS - Phase 1
   ============================================================================ */

/* Mobile-First Typography System */
@media (max-width: 600px) {
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
    }
    
    /* Header Optimizations */
    .main-header {
        padding: 2rem 0.75rem 1.5rem;
    }
    
    .main-header h1 {
        font-size: 2rem !important;
        letter-spacing: -1px;
    }
    
    .logo-area img {
        height: 40px !important;
        margin-right: 10px !important;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        line-height: 1.4;
    }
    
    /* Navigation - Stack Icons */
    .main-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.4rem;
        border-radius: 16px;
        gap: 0.4rem;
        width: 100%;
        max-width: 100%;
    }
    
    .nav-btn {
        flex-direction: column;
        padding: 0.6rem 1rem;
        gap: 0.25rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .nav-btn .icon {
        font-size: 1.25rem;
    }
    
    /* Header Controls */
    .header-controls {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .lang-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Content Container */
    .content-container {
        padding: 15px;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    /* Comparison Interface - Fix VS Badge Overlap */
    .comparison-interface {
        flex-direction: column;
        gap: 1.5rem;
        margin: 2rem 0;
    }
    
    .vs-badge {
        margin: 0;
        width: 70px;
        height: 70px;
        order: 2;
    }
    
    .vs-badge span {
        font-size: 1.25rem;
    }
    
    .team-card.home {
        order: 1;
    }
    
    .team-card.away {
        order: 3;
    }
    
    .team-card {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 5/6;
    }
    
    .card-content {
        padding: 1.25rem;
    }
    
    .team-card label {
        font-size: 0.65rem;
    }
    
    /* Improved Select Touch Targets */
    .team-select,
    .modern-select {
        padding: 1rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    /* Simulation Layout */
    .simulation-layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Keep pitch visualizations visible on mobile (stacked under setup card) */
    .pitch-column {
        display: block;
        max-width: 100%;
    }
    
    .sim-config {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .config-card {
        padding: 1.5rem;
    }
    
    .config-card h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    /* Improved Slider Touch Targets */
    .adjustment-slider {
        height: 12px;
        margin: 1rem 0;
    }
    
    .adjustment-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }
    
    .adjustment-slider::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
    
    /* Button Touch Targets */
    .btn-action {
        padding: 1.25rem 1.5rem;
        font-size: 1.05rem;
        min-height: 56px;
    }
    
    /* Analysis Charts */
    .analysis-charts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analysis-panel {
        padding: 1.25rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    /* Prevent Horizontal Scroll */
    .main-wrapper,
    .content-container,
    .view-section {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Deep Player Analysis */
.player-analysis-shell {
    display: grid;
    gap: 1rem;
}

.player-analysis-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    background: linear-gradient(135deg, rgba(14, 30, 63, 0.6), rgba(21, 48, 76, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 1rem;
}

.pa-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pa-field label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.85);
}

.pa-compare-toggle {
    align-items: center;
    justify-content: center;
}

.pa-compare-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #38bdf8;
}

.pa-status {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.45);
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.95rem;
}

.pa-status.error {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
}

.pa-content {
    display: grid;
    gap: 1rem;
}

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

.pa-cards.single {
    grid-template-columns: 1fr;
}

.pa-player-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.62));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

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

.pa-card-header h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.pa-subtitle {
    margin: 0.2rem 0 0;
    color: rgba(148, 163, 184, 0.95);
    font-size: 0.95rem;
}

.pa-slot {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #67e8f9;
}

.pa-chip {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(12, 74, 110, 0.35);
    font-weight: 600;
    font-size: 0.9rem;
}

.pa-profile-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.pa-profile-pill {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.55);
    border-radius: 11px;
    padding: 0.45rem 0.55rem;
    display: grid;
    gap: 0.1rem;
    min-height: 56px;
}

.pa-profile-label {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pa-profile-value {
    font-size: 0.83rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.25;
}

.pa-position-strip {
    display: flex;
    justify-content: center;
}

.pa-position-pitch {
    width: 180px;
}

.mini-pitch {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4.2;
    border-radius: 10px;
    border: 2px solid rgba(30, 64, 175, 0.45);
    background: linear-gradient(180deg, #386f44, #2f613b);
    overflow: hidden;
}

.mini-pitch-lines {
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(15, 23, 42, 0.85);
    border-radius: 3px;
}

.mini-pitch-lines::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(15, 23, 42, 0.85);
    transform: translateY(-50%);
}

.mini-pitch-lines::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 26px;
    border: 2px solid rgba(15, 23, 42, 0.85);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.mini-pos {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.4);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(15, 23, 42, 0.65);
}

.mini-pos.active {
    color: #fff;
    background: radial-gradient(circle at 30% 20%, #ef4444, #7f1d1d);
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.mini-pos-st {
    left: 50%;
    top: 10%;
    transform: translateX(-50%);
}

.mini-pos-rw {
    right: 12%;
    top: 20%;
}

.mini-pos-lw {
    left: 12%;
    top: 20%;
}

.mini-pos-am {
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
}

.mini-pos-cm {
    left: 50%;
    top: 46%;
    transform: translateX(-50%);
}

.mini-pos-dm {
    left: 50%;
    top: 58%;
    transform: translateX(-50%);
}

.mini-pos-rb {
    right: 16%;
    top: 72%;
}

.mini-pos-cb {
    left: 50%;
    top: 74%;
    transform: translateX(-50%);
}

.mini-pos-lb {
    left: 16%;
    top: 72%;
}

.mini-pos-gk {
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
}

.pa-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.pa-kpi {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.45);
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    display: grid;
    gap: 0.15rem;
}

.pa-kpi-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.pa-kpi-value {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
}

.pa-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.pa-chart-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(160deg, rgba(2, 6, 23, 0.46), rgba(15, 23, 42, 0.5));
    border-radius: 14px;
    padding: 0.75rem;
    display: grid;
    gap: 0.5rem;
}

.pa-chart-card h4 {
    margin: 0;
    font-size: 0.82rem;
    color: #bae6fd;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pa-chart-card-wide {
    grid-column: 1 / -1;
}

.pa-chart-wrap {
    height: 220px;
}

.pa-section {
    display: grid;
    gap: 0.55rem;
}

.pa-section h4 {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    color: #bae6fd;
}

.pa-kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.pa-kv-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.pa-kv-key {
    color: rgba(148, 163, 184, 0.96);
    font-size: 0.8rem;
}

.pa-kv-value {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: right;
}

.pa-empty {
    margin: 0;
    color: rgba(148, 163, 184, 0.95);
    font-size: 0.9rem;
}

.pa-raw-details {
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.35);
    overflow: hidden;
}

.pa-raw-details summary {
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
    list-style: none;
}

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

.pa-raw-grid {
    padding: 0.25rem 0.8rem 0.8rem;
    display: grid;
    gap: 0.8rem;
}

.pa-compare {
    background: linear-gradient(160deg, rgba(7, 20, 38, 0.9), rgba(15, 38, 62, 0.7));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1rem;
}

.pa-compare-panel h3 {
    margin: 0;
}

.pa-callout-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.9rem 0 1rem;
}

.pa-callout {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    display: grid;
    gap: 0.2rem;
}

.pa-callout-metric {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.pa-callout-winner {
    font-size: 0.86rem;
    font-weight: 700;
    color: #67e8f9;
}

.pa-callout-values {
    font-size: 0.78rem;
    color: #cbd5e1;
}

.pa-compare-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

@media (max-width: 1180px) {
    .player-analysis-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pa-cards {
        grid-template-columns: 1fr;
    }

    .pa-profile-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pa-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pa-callout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .player-analysis-toolbar {
        grid-template-columns: 1fr;
    }

    .pa-profile-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pa-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pa-chart-grid {
        grid-template-columns: 1fr;
    }

    .pa-chart-wrap {
        height: 210px;
    }

    .pa-kv-grid {
        grid-template-columns: 1fr;
    }

    .pa-callout-grid {
        grid-template-columns: 1fr;
    }

    .pa-compare-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet Adjustments (601px - 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
    }
    
    .nav-btn {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .vs-badge {
        width: 75px;
        height: 75px;
    }
}
