/* ==========================================================
LOCAL ROBOTO FONTS
========================================================== */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
font-display: swap;
src: url('fonts/Roboto-Thin.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 100;
font-display: swap;
src: url('fonts/Roboto-ThinItalic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
font-display: swap;
src: url('fonts/Roboto-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 300;
font-display: swap;
src: url('fonts/Roboto-LightItalic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('fonts/Roboto-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 400;
font-display: swap;
src: url('fonts/Roboto-Italic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('fonts/Roboto-Medium.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 500;
font-display: swap;
src: url('fonts/Roboto-MediumItalic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('fonts/Roboto-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 700;
font-display: swap;
src: url('fonts/Roboto-BoldItalic.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url('fonts/Roboto-Black.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: italic;
font-weight: 900;
font-display: swap;
src: url('fonts/Roboto-BlackItalic.ttf') format('truetype');
}

/* ==========================================================
THEME VARIABLES
========================================================== */
:root {
--font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
--bg-body: #0a1225;
--bg-card: #0b152d;
--bg-card-hover: #18284d;
--bg-input: #0a1225;
--border-card: #1f305c;
--border-muted: rgba(31, 48, 92, 0.7);
--text-main: #ffffff;
--text-sub: #cbd5e1;
--text-muted: #8494b2;

/* Rich Royal Dark Blue */
--sky-primary: #2563eb;
--sky-light: #60a5fa;
--sky-glow: rgba(37, 99, 235, 0.35);

/* Status Colors */
--live-green: #10b981;
--live-green-glow: rgba(16, 185, 129, 0.4);
--live-green-bg: rgba(16, 185, 129, 0.12);
--live-green-border: rgba(16, 185, 129, 0.45);

--emerald-color: #10b981;
--emerald-text: #34d399;
--rose-color: #f43f5e;
--rose-text: #fb7185;
--amber-color: #f59e0b;
--amber-text: #fbbf24;
--orange-color: #f97316;
--orange-text: #fb923c;
--blue-color: #3b82f6;
--blue-text: #60a5fa;
}

body.light-mode {
--bg-body: #f4f6f9;
--bg-card: #ffffff;
--bg-card-hover: #f1f5f9;
--bg-input: #ffffff;
--border-card: #e2e8f0;
--border-muted: #cbd5e1;
--text-main: #0f172a;
--text-sub: #334155;
--text-muted: #64748b;
--sky-primary: #1d4ed8;
--sky-light: #2563eb;
--sky-glow: rgba(37, 99, 235, 0.12);
--emerald-text: #059669;
--rose-text: #e11d48;
--amber-text: #d97706;
--orange-text: #ea580c;
--blue-text: #1d4ed8;
}

/* ==========================================================
LIGHT MODE COMPREHENSIVE OVERRIDES
========================================================== */
body.light-mode .app-header { background-color: var(--bg-body); }
body.light-mode .brand-logo-box { background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(37, 99, 235, 0.08)); border-color: rgba(29, 78, 216, 0.2); }
body.light-mode .single-toggle-btn { background-color: #ffffff; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .single-toggle-btn:hover { border-color: var(--sky-primary); background-color: #f1f5f9; }
body.light-mode .scroll-arrow { background-color: #ffffff; border-color: #cbd5e1; color: #334155; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
body.light-mode .scroll-arrow:hover:not(:disabled) { background-color: var(--sky-primary); border-color: var(--sky-primary); color: #ffffff; }

body.light-mode .league-card { background-color: #ffffff; border-color: #e2e8f0; }
body.light-mode .league-card:hover { background-color: #f8fafc; border-color: var(--sky-primary); }
body.light-mode .league-card.active-card { 
background-color: #eff6ff; 
border: 1.5px solid var(--sky-primary); 
box-shadow: none; 
}
body.light-mode .card-live-indicator { background: #dcfce7; border-color: #86efac; color: #15803d; }

body.light-mode .active-banner { background-color: #e0f2fe; border-color: #bae6fd; color: #0369a1; }
body.light-mode .my-team-focus-box { 
background: #ffffff; 
border: 1.5px solid var(--sky-primary); 
box-shadow: none; 
}
body.light-mode .my-team-badge { color: #0369a1; }

body.light-mode .my-team-logo-slot { background: #ffffff; border-color: #cbd5e1; }
body.light-mode .team-filter-active-bar { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

body.light-mode .tabs-navigation { background-color: var(--bg-body); border-color: #e2e8f0; }
body.light-mode .tab-btn { color: #64748b; }
body.light-mode .tab-btn:hover { color: #0f172a; }
body.light-mode .tab-btn.tab-active { color: #0f172a; border-bottom-color: var(--sky-primary); }

body.light-mode .table-card { background-color: #ffffff; border-color: #e2e8f0; }
body.light-mode .sports-table thead { background-color: #f1f5f9; color: #64748b; }
body.light-mode .sports-table td { border-top-color: #f1f5f9; }
body.light-mode .sports-table tbody tr:hover td { background-color: #f8fafc; }
body.light-mode tr.row-highlight-team td { background-color: rgba(37, 99, 235, 0.08) !important; }
body.light-mode tr.row-highlight-team .team-title { color: #1d4ed8 !important; font-weight: 500 !important; }

body.light-mode .match-row { background-color: #ffffff; border-color: #e2e8f0; }
body.light-mode .match-row:hover { background-color: #f8fafc; border-color: var(--sky-primary); }
body.light-mode .score-box, 
body.light-mode .time-box { background-color: #f1f5f9; border-color: #cbd5e1; }
body.light-mode .time-box { color: #0284c7; }
body.light-mode .team-high { color: var(--text-main); }
body.light-mode .score-box .score-val.score-win { color: var(--text-main); }
body.light-mode .team-muted { color: #64748b; opacity: 1; font-weight: 500; }

body.light-mode .match-row-live-wrapper { 
background: #ffffff; 
border: 1.5px solid #86efac; 
box-shadow: none; 
}
body.light-mode .match-live-subbar { border-bottom-color: rgba(16, 185, 129, 0.25); }
body.light-mode .live-badge-pill { background: #dcfce7; border-color: #86efac; color: #15803d; }
body.light-mode .live-period-tag { color: #15803d; }
body.light-mode .score-box.live-score { 
background: #dcfce7; 
border-color: #86efac; 
box-shadow: none; 
}
body.light-mode .score-box.live-score .score-val { color: #15803d; }
body.light-mode .score-box.live-score .score-sep { color: #22c55e; }

body.light-mode .pill-btn { background-color: #ffffff; border-color: #cbd5e1; color: #475569; }
body.light-mode .pill-btn:hover { background-color: #f1f5f9; color: #0f172a; }
body.light-mode .pill-btn.active { background-color: var(--sky-primary); color: #ffffff !important; border-color: var(--sky-primary); }

body.light-mode .transfer-card-item { background-color: #ffffff; border-color: #e2e8f0; }
body.light-mode .transfer-search-input { background-color: #ffffff; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .filter-panel { background-color: #ffffff; border-color: #e2e8f0; }
body.light-mode .form-select { background-color: #ffffff; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .form-select option { background-color: #ffffff; color: #0f172a; }

body.light-mode .match-hero-card { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .match-hero-score { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .match-hero-pill { background: #f8fafc; border-color: #e2e8f0; color: #475569; }
body.light-mode .timeline-event-row { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .timeline-icon { background: #f8fafc; border-color: #cbd5e1; }
body.light-mode .timeline-comment-body { background: #f1f5f9; border-left-color: #cbd5e1; color: #334155; }
body.light-mode .stats-container, 
body.light-mode .h2h-stat-box, 
body.light-mode .bench-container { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .stat-bar-track { background-color: #e2e8f0; border-color: #cbd5e1; }
body.light-mode .player-modal-card { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .player-modal-grid { background: #f8fafc; border-color: #e2e8f0; }
body.light-mode .app-footer { background-color: var(--bg-body); border-top-color: #e2e8f0; }

body.light-mode .logo img {
content: url('img/logo_light.svg');
}

/* ==========================================================
BASE SYSTEM
========================================================== */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
body { 
margin: 0; 
padding: 0; 
min-height: 100vh; 
background-color: var(--bg-body); 
color: var(--text-main); 
font-family: var(--font-sans) !important; 
-webkit-font-smoothing: antialiased; 
-moz-osx-font-smoothing: grayscale; 
}

button,
input,
select,
textarea,
optgroup,
option {
font-family: inherit;
}

.form-select,
.form-select option,
.team-filter-select,
.team-filter-select option,
.transfer-search-input {
font-family: var(--font-sans) !important;
}

::-webkit-scrollbar { height: 6px; width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #263863; border-radius: 4px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sky { color: var(--sky-light); }
.text-emerald { color: var(--emerald-text); }
.text-rose { color: var(--rose-text); }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.font-bold { font-weight: 500; }
.font-medium { font-weight: 500; }
.mt-3 { margin-top: 1rem; }

#toast { 
position: fixed; 
bottom: 1.5rem; 
right: 1.5rem; 
background-color: #2563eb; 
color: #ffffff; 
padding: 0.65rem 1.15rem; 
border-radius: 0.5rem; 
box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5); 
font-size: 0.85rem; 
font-weight: 500; 
z-index: 999; 
pointer-events: none; 
opacity: 0; 
transform: translateY(8px); 
transition: opacity 0.25s ease, transform 0.25s ease; 
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ==========================================================
HEADER SECTION (Seamless #0a1225 with NO bottom border)
========================================================== */
.app-header { 
background-color: var(--bg-body); 
border-bottom: none !important; 
box-shadow: none; 
padding-top: 0.5rem; 
}
.header-container { max-width: 80rem; margin: 0 auto; padding: 0.5rem 1rem; }
.header-top { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; margin-bottom: 1rem;}
@media (min-width: 640px) { .header-top { flex-direction: row; align-items: center; justify-content: space-between; } }

.brand-section { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo-box { 
padding: 0.45rem; 
background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(30, 64, 175, 0.2)); 
border: 1px solid var(--sky-glow); 
border-radius: 0.65rem; 
display: flex; 
align-items: center; 
justify-content: center; 
}
.logo img { height: 25px; width: auto; display: block; 
}
.brand-text h1 { margin: 0; font-size: 1.2rem; font-weight: 500; display: flex; align-items: center; gap: 0.45rem; }
.live-badge { 
font-size: 9px; 
text-transform: uppercase; 
font-weight: 800; 
padding: 1px 6px; 
background-color: var(--live-green-bg); 
color: var(--live-green); 
border-radius: 9999px; 
border: 1px solid var(--live-green-border); 
}
.brand-text p { margin: 2px 0 0 0; font-size: 0.74rem; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; }

/* Single-Click Toggle Buttons */
.single-toggle-btn {
height: 30px;
min-width: 36px;
padding: 0 0.55rem;
display: inline-flex;
align-items: center;
justify-content: center;
background-color: var(--bg-card);
border: 1px solid var(--border-card);
color: var(--text-main);
border-radius: 0.45rem;
font-size: 0.74rem;
font-weight: 500;
cursor: pointer;
transition: all 0.15s ease;
user-select: none;
}
.single-toggle-btn:hover { border-color: var(--sky-primary); background-color: var(--bg-card-hover); }
.single-toggle-btn:active { transform: scale(0.96); }

.theme-toggle-btn { 
height: 30px; 
width: 30px; 
display: inline-flex; 
align-items: center; 
justify-content: center; 
background-color: var(--bg-card); 
border: 1px solid var(--border-card); 
border-radius: 0.45rem; 
font-size: 0.85rem; 
cursor: pointer; 
color: var(--text-main); 
padding: 0; 
flex-shrink: 0; 
transition: all 0.15s ease;
}
.theme-toggle-btn:hover { border-color: var(--sky-primary); background-color: var(--bg-card-hover); }
.theme-toggle-btn.inactive-icon { opacity: 0.45; }

/* ==========================================================
TOP LEAGUE CARDS
========================================================== */
.carousel-container { position: relative; margin-top: 0.65rem; }
.scroll-arrow { 
position: absolute; 
top: 50%; 
transform: translateY(-50%); 
z-index: 20; 
width: 28px; 
height: 28px; 
border-radius: 50%; 
background-color: rgba(17, 28, 56, 0.95); 
border: 1px solid var(--border-card); 
color: #e2e8f0; 
display: flex; 
align-items: center; 
justify-content: center; 
cursor: pointer; 
transition: all 0.15s ease; 
}
.scroll-arrow:hover:not(:disabled) { background-color: var(--sky-primary); border-color: var(--sky-primary); }
.scroll-arrow:disabled { opacity: 0; pointer-events: none; }
.scroll-arrow.left { left: -0.4rem; }
.scroll-arrow.right { right: -0.4rem; }
.scroll-arrow svg { width: 15px; height: 15px; }

.carousel-track { 
display: flex; 
overflow-x: auto; 
gap: 0.45rem; 
padding: 0.35rem 0.1rem; 
scroll-snap-type: x mandatory; 
padding-left: 2px;
}
.league-card { 
scroll-snap-align: start; 
flex-shrink: 0; 
width: 6.8rem; 
background-color: var(--bg-card); 
border: 1px solid var(--border-card); 
border-radius: 0.55rem; 
padding: 0.45rem 0.5rem; 
text-align: left; 
cursor: pointer; 
transition: all 0.15s ease; 
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.league-card:hover { background-color: var(--bg-card-hover); border-color: var(--sky-primary); }
.league-card.active-card { 
border-color: var(--sky-primary); 
box-shadow: none; 
background-color: var(--bg-card-hover); 
}
.league-card-header { display: flex; align-items: center; justify-content: space-between; }
.league-card-flag { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; }
.league-card-title { 
display: block;
font-weight: 500;
font-size: 0.75rem;
color: var(--sky-light);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.2;
font-family: var(--font-sans);
padding-top: 0.25rem;
}
.card-live-indicator {
display: inline-flex;
align-items: center;
gap: 3px;
font-size: 8px;
font-weight: 800;
color: var(--live-green);
background: var(--live-green-bg);
border: 1px solid var(--live-green-border);
padding: 1px 4px;
border-radius: 9999px;
line-height: 1;
}

/* ==========================================================
FILTER PANEL
========================================================== */
.main-wrapper { max-width: 80rem; margin: 0.75rem auto 0 auto; padding: 0 0.75rem; }
.filter-panel { 
display: grid; 
grid-template-columns: 1fr; 
gap: 0.6rem; 
margin-bottom: 1rem; 
background-color: var(--bg-card); 
padding: 0.75rem; 
border-radius: 0.65rem; 
border: 1px solid var(--border-card); 
}
@media (min-width: 768px) { .filter-panel { grid-template-columns: repeat(3, 1fr); padding: 0.85rem; } }
.filter-group label { display: block; font-size: 0.74rem; color: var(--text-muted); margin-bottom: 0.25rem; font-weight: 500; }
.select-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.flag-preview { position: absolute; left: 0.65rem; pointer-events: none; display: none; align-items: center; }
.flag-preview.visible { display: flex; }
.flag-preview img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.form-select {
width: 100%;
background-color: var(--bg-input);
border: 1px solid var(--border-card);
color: var(--text-main);
border-radius: 0.5rem;
padding: 0.5rem 2.2rem 0.5rem 0.75rem; /* 2.2rem on the right protects text from touching the arrow */
font-size: 0.8rem;
font-family: inherit;
outline: none;
cursor: pointer;

/* Remove native browser arrow */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;

/* Crisp white chevron */
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: 13px;

/* Increase or decrease '14px' to adjust arrow distance from the right edge */
background-position: right 14px center;
}
.form-select:focus { border-color: var(--sky-primary); }
.form-select.has-flag { padding-left: 2.3rem; }

/* Loader */
#loader { text-align: center; padding: 3rem 0; }
.spinner { 
display: inline-block; 
border-radius: 50%; 
width: 1.75rem; 
height: 1.75rem; 
border: 2px solid var(--sky-light); 
border-top-color: transparent; 
animation: spin 0.8s linear infinite; 
}
.loader-msg { margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
ACTIVE BANNER & MY TEAM
========================================================== */
.active-banner {
font-size: 0.85rem;
font-weight: 500;
color: var(--sky-light);
background-color: var(--bg-card);
border: 1px solid var(--border-card);
padding: 0.45rem 0.75rem;
border-radius: 0.65rem;
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
margin-bottom: 0.75rem;
gap: 0.75rem;
}
.banner-info { display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }
#activeStageFlag { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
#activeStageTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.84rem; font-weight: 500; }

.banner-actions { display: flex; align-items: center; justify-content: flex-end; }
.refresh-btn { 
display: inline-flex; 
align-items: center; 
gap: 4px; 
background: transparent; 
border: 1px solid var(--border-card); 
color: var(--sky-light); 
padding: 3px 8px; 
border-radius: 6px; 
cursor: pointer; 
font-size: 0.75rem; 
font-weight: 500;
}
.refresh-btn:hover { background: var(--bg-card-hover); border-color: var(--sky-primary); }

.my-team-focus-box {
display: inline-flex;
align-items: center;
gap: 0.45rem;
background: var(--bg-body);
border: 1.5px solid var(--sky-primary);
padding: 2px 8px 2px 8px;
border-radius: 9999px;
}
.my-team-badge { font-size: 0.72rem; font-weight: 800; color: var(--sky-light); white-space: nowrap; }

/* ==========================================================
MY TEAM DROPDOWN (SEAMLESS PILL INTEGRATION)
========================================================== */
.team-filter-select {
background-color: transparent;
border: none;
color: var(--text-main);
font-size: 0.78rem;
font-weight: 500;
outline: none;
cursor: pointer;
max-width: 150px;
padding: 3px 1.6rem 3px 6px;

/* Remove default browser styling */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;

/* Custom chevron matching the blue theme */
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2360a5fa' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: 10px;
background-position: right 6px center;
}

/* Dropdown menu items when opened */
.team-filter-select option {
background-color: var(--bg-card);
color: var(--text-main);
}

/* Light mode adjustments */
body.light-mode .team-filter-select {
background-color: transparent;
color: #0f172a;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}
body.light-mode .team-filter-select option {
background-color: #ffffff;
color: #0f172a;
}

.my-team-logo-slot { width: 35px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.my-team-crest { width: 32px; height: 22px; object-fit: contain; }

@media (max-width: 768px) {
.active-banner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 0.5rem; }
.banner-info { justify-content: center; }
.banner-actions { justify-content: center; order: 3; }
.my-team-focus-box { order: 2; }
}

/* Match Feed Active Filter Bar */
.team-filter-active-bar {
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(37, 99, 235, 0.1);
border: 1px solid rgba(37, 99, 235, 0.3);
padding: 0.45rem 0.85rem;
border-radius: 6px;
font-size: 0.78rem;
color: var(--sky-light);
font-weight: 500;
margin-bottom: 0.75rem;
}
.clear-team-filter-btn {
background: var(--sky-primary);
border: none;
color: #ffffff;
padding: 3px 9px;
border-radius: 4px;
font-size: 0.72rem;
font-weight: 500;
cursor: pointer;
}
.clear-team-filter-btn:hover { background: #1d4ed8; }

/* ==========================================================
TABS NAVIGATION
========================================================== */
.tabs-navigation { 
position: sticky; 
top: 0; 
z-index: 35; 
background-color: var(--bg-body); 
padding: 0.2rem 0; 
border-bottom: 1px solid var(--border-card); 
margin-bottom: 0.85rem; 
}
.tabs-carousel-wrapper { position: relative; display: flex; align-items: center; width: 100%; padding: 0 24px; }
.tab-links { display: flex; gap: 1.25rem; overflow-x: auto; width: max-content; margin: 0 auto; }
.tab-btn { 
background: transparent; 
border: none; 
border-bottom: 3px solid transparent; 
color: var(--text-muted); 
padding: 0.55rem 0; 
font-size: 0.85rem; 
font-weight: 500; 
white-space: nowrap; 
cursor: pointer; 
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.tab-active { border-bottom-color: var(--sky-primary); color: var(--text-main); font-weight: 500; }
.tabs-arrow { width: 22px; height: 22px; }
.tabs-arrow svg { width: 12px; height: 12px; }
.tabs-arrow.left { left: 0; }
.tabs-arrow.right { right: 0; }

.live-tab-btn { display: inline-flex; align-items: center; gap: 5px; }
.live-dot-pulse { 
width: 7px; 
height: 7px; 
background-color: var(--live-green); 
border-radius: 50%; 
display: inline-block; 
box-shadow: 0 0 0 0 var(--live-green-glow); 
animation: livePulseGreen 1.6s infinite; 
}
@keyframes livePulseGreen { 
0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--live-green-glow); } 
70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); } 
100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } 
}
.live-count-badge { 
background-color: var(--live-green); 
color: #ffffff; 
font-size: 0.65rem; 
font-weight: 800; 
padding: 1px 5px; 
border-radius: 9999px; 
line-height: 1.2; 
}

/* ==========================================================
STANDINGS TABLE & POSITION CHANGE / LIVE BADGE
========================================================== */
.table-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.table-card { overflow-x: auto; border-radius: 0.65rem; border: 1px solid var(--border-card); background-color: var(--bg-card); }
.sports-table { width: 100%; text-align: left; font-size: 0.8rem; white-space: nowrap; border-collapse: collapse; }
.sports-table thead { background-color: rgba(10, 18, 37, 0.7); font-size: 0.7rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sports-table th { padding: 0.55rem 0.5rem; }
.sports-table td { padding: 0.5rem 0.5rem; border-top: 1px solid var(--border-card); }
.sports-table tbody tr:hover td { background-color: var(--bg-card-hover); }
.w-12 { width: 2.2rem; }

.team-cell { display: flex; align-items: center; gap: 0.45rem; }
.team-logo { width: 1.15rem; height: 1.15rem; object-fit: contain; }
.team-title { font-weight: 500; color: var(--text-sub); }
.empty-table-msg { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.8rem; }

tr.row-highlight-team td { background-color: rgba(37, 99, 235, 0.22) !important; }
tr.row-highlight-team .team-title { color: #ffffff !important; font-weight: 500 !important; }

/* Position Change (+/-) Column */
.col-change { width: 4.8rem; }
.pos-change-wrapper { display: flex; align-items: center; justify-content: center; gap: 5px; }
.pos-up { color: #10b981; font-weight: 800; font-size: 0.72rem; }
.pos-down { color: #f43f5e; font-weight: 800; font-size: 0.72rem; }
.pos-unchanged { color: var(--text-muted); font-size: 0.75rem; font-weight: 500; }

.table-live-pill {
background-color: #e11d48;
color: #ffffff;
font-size: 0.7rem;
font-weight: 800;
padding: 1px 5px;
border-radius: 4px;
border: none;
cursor: pointer;
letter-spacing: 0.02em;
line-height: 1.2;
box-shadow: 0 0 6px rgba(225, 29, 72, 0.45);
}
.table-live-pill:hover { background-color: #be123c; }

.col-p-mobile { display: table-cell; }
.col-p-desktop { display: none; }
@media (min-width: 768px) { .col-p-mobile { display: none; } .col-p-desktop { display: table-cell; } }

@media (max-width: 640px) {
.col-last5, .col-form { display: none !important; }

/* Fix for +/- width and team name collision */
.sports-table th, 
.sports-table td { 
padding: 0.45rem 0.25rem !important; 
}
.col-change { 
width: 2.6rem !important; 
max-width: 2.8rem !important; 
}
.pos-change-wrapper { 
gap: 2px !important; 
}
.team-cell { 
min-width: 0; 
overflow: hidden; 
}
.team-title { 
max-width: 95px; 
overflow: hidden; 
text-overflow: ellipsis; 
white-space: nowrap; 
display: inline-block; 
vertical-align: middle; 
}
}

/* ==========================================================
DYNAMIC COMPETITION & PROMOTION / RELEGATION ZONES
========================================================== */
.zone-cl { border-left: 4px solid var(--blue-color) !important; }
.zone-el { border-left: 4px solid var(--amber-color) !important; }
.zone-ecl { border-left: 4px solid var(--emerald-color) !important; }
.zone-prom { border-left: 4px solid var(--emerald-color) !important; }
.zone-po-prom { border-left: 4px solid var(--amber-color) !important; }
.zone-po-rel { border-left: 4px solid var(--orange-color) !important; }
.zone-rel { border-left: 4px solid var(--rose-color) !important; }
.zone-none { border-left: 4px solid transparent !important; }

.badge-cl { color: var(--blue-text); font-weight: 500; }
.badge-el { color: var(--amber-text); font-weight: 500; }
.badge-ecl { color: var(--emerald-text); font-weight: 500; }
.badge-prom { color: var(--emerald-text); font-weight: 500; }
.badge-po-prom { color: var(--amber-text); font-weight: 500; }
.badge-po-rel { color: var(--orange-text); font-weight: 500; }
.badge-rel { color: var(--rose-text); font-weight: 500; }
.badge-muted { color: var(--text-sub); font-weight: 500; }

.legend-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 0.4rem 0.5rem; font-size: 0.72rem; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; }
.bg-blue { background-color: var(--blue-color); }
.bg-amber { background-color: var(--amber-color); }
.bg-emerald { background-color: var(--emerald-color); }
.bg-orange { background-color: var(--orange-color); }
.bg-rose { background-color: var(--rose-color); }

/* Form Track */
.form-track { display: inline-flex; align-items: center; gap: 0.25rem; }
.form-badge-wrapper { position: relative; display: inline-block; }
.form-pill { width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.form-pill.win { background-color: #059669; }
.form-pill.draw { background-color: #475569; }
.form-pill.loss { background-color: #e11d48; }
.form-pill.latest { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 1px; }
.badge-svg { width: 8px; height: 8px; stroke: #ffffff; }

.tooltip-container { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 0.35rem; display: none; flex-direction: column; align-items: center; z-index: 50; pointer-events: none; }
.form-badge-wrapper:hover .tooltip-container { display: flex; }
.tooltip-bubble { background-color: rgba(2, 6, 23, 0.95); border: 1px solid var(--border-card); color: #ffffff; border-radius: 0.35rem; padding: 0.25rem 0.5rem; white-space: nowrap; font-size: 10px; }
.tooltip-date { font-size: 8px; color: #94a3b8; }
.tooltip-result { font-weight: 500; text-transform: uppercase; }
.trend-wrapper { display: inline-block; }

/* ==========================================================
PLAYER AVATAR & STATS CELLS (FIXED STRICT DIMENSIONS)
========================================================== */
.player-photo-cell {
display: flex;
align-items: center;
gap: 0.65rem;
}
.player-avatar {
width: 34px !important;
height: 34px !important;
max-width: 34px !important;
max-height: 34px !important;
border-radius: 50%;
object-fit: cover;
background-color: #1e293b;
flex-shrink: 0;
display: block;
}
.player-details-col {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.player-name-text {
font-weight: 500;
color: var(--text-main);
font-size: 0.82rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.player-team-line {
display: flex;
align-items: center;
gap: 0.35rem;
font-size: 0.72rem;
color: var(--text-muted);
}
.player-sub-crest {
width: 12px;
height: 12px;
object-fit: contain;
flex-shrink: 0;
opacity: 0.85;
}
.player-country-flag {
width: 14px;
height: 10px;
object-fit: cover;
border-radius: 2px;
margin-left: 6px;
}
.stat-team-cell {
display: flex;
align-items: center;
gap: 0.4rem;
font-weight: 500;
color: var(--text-sub);
}
.stat-team-crest {
width: 18px;
height: 18px;
object-fit: contain;
flex-shrink: 0;
}
.stat-nat-cell {
display: flex;
align-items: center;
gap: 0.4rem;
color: var(--text-muted);
font-size: 0.78rem;
}
.stat-country-flag {
width: 16px;
height: 11px;
object-fit: cover;
border-radius: 2px;
border: 1px solid var(--border-muted);
flex-shrink: 0;
}
.card-icon {
display: inline-block;
width: 10px;
height: 14px;
border-radius: 2px;
vertical-align: middle;
margin-right: 3px;
}
.yellow-card-icon { background-color: #facc15; }
.red-card-icon { background-color: #ef4444; }

/* ==========================================================
MATCH FEED: LIVE GAMES GREEN & CLEAN GRID
========================================================== */
.match-groups { display: flex; flex-direction: column; gap: 1rem; }
.match-group { display: flex; flex-direction: column; gap: 0.4rem; }
.group-header { text-align: center; margin-bottom: 0.2rem; }
.group-date { font-size: 0.82rem; font-weight: 500; color: var(--text-main); }
.group-round { font-size: 0.7rem; color: var(--text-muted); }

.match-row { 
display: grid; 
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); 
grid-template-rows: auto auto;
align-items: center; 
background-color: var(--bg-card); 
border: 1px solid var(--border-card); 
border-radius: 8px; 
padding: 0.55rem 0.8rem; 
cursor: pointer; 
}
.match-row:hover { background-color: var(--bg-card-hover); border-color: var(--sky-primary); }

.match-row .team-home { grid-column: 1; grid-row: 1; justify-content: flex-end; text-align: right; }
.match-row .score-box, .match-row .time-box { grid-column: 2; grid-row: 1; justify-self: center; margin: 0 0.5rem; }
.match-row .team-away { grid-column: 3; grid-row: 1; justify-content: flex-start; text-align: left; }
.match-row .live-score-ht { grid-column: 2; grid-row: 2; justify-self: center; font-size: 0.68rem; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.team-col { min-width: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 500; }
.team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-crest-slot { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.team-crest { max-width: 22px; max-height: 22px; object-fit: contain; }
.team-high { color: var(--text-main); font-weight: 500; }
.team-standard { color: var(--text-sub); }
.team-muted { color: var(--text-muted); font-weight: 500; }
.winner-pill-dot { width: 5px; height: 5px; border-radius: 50%; background-color: var(--emerald-color); flex-shrink: 0; }
.team-home .winner-pill-dot { margin-right: auto; }
.team-away .winner-pill-dot { margin-left: auto; }

.score-box, .time-box { 
display: inline-flex; 
align-items: center; 
justify-content: center; 
width: 72px; 
height: 30px; 
border-radius: 6px; 
background-color: var(--bg-body); 
border: 1px solid var(--border-card); 
}
.score-box .score-val { font-size: 1rem; font-weight: 800; color: var(--text-sub); min-width: 16px; text-align: center; }
.score-box .score-val.score-win { color: var(--text-main); font-weight: 900; }
.score-box .score-sep { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin: 0 3px; }
.time-box { color: var(--sky-light); font-size: 0.8rem; font-weight: 500; }

/* LIVE MATCH: GREEN STYLING */
.match-row-live-wrapper { 
background-color: var(--bg-card); 
border: 1px solid var(--live-green-border); 
border-radius: 8px; 
padding: 0.5rem 0.8rem; 
display: flex; 
flex-direction: column; 
gap: 0.35rem; 
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
cursor: pointer; 
}
.match-row-live-wrapper:hover { border-color: var(--live-green); }

.match-live-subbar { 
display: flex; 
align-items: center; 
justify-content: space-between; 
padding-bottom: 0.25rem; 
border-bottom: 1px solid rgba(16, 185, 129, 0.2); 
}
.live-period-tag { font-size: 0.72rem; font-weight: 800; color: var(--live-green); text-transform: uppercase; }
.live-badge-pill { 
display: inline-flex; 
align-items: center; 
gap: 4px; 
background: var(--live-green-bg); 
border: 1px solid var(--live-green-border); 
color: var(--live-green); 
padding: 1px 7px; 
border-radius: 9999px; 
font-size: 0.68rem; 
font-weight: 800; 
text-transform: uppercase; 
}

.score-box.live-score { 
background: var(--live-green-bg); 
border-color: var(--live-green-border); 
}
.score-box.live-score .score-val { color: #a7f3d0; font-weight: 900; }
.score-box.live-score .score-sep { color: var(--live-green); }

.live-clock-google {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.9rem;
font-weight: 800;
color: var(--live-green);
display: inline-flex;
align-items: center;
gap: 4px;
}
.live-clock-stoppage { color: var(--amber-text); }

/* ==========================================================
BOTTOM FOOTER
========================================================== */
.app-footer {
margin-top: 3rem;
padding: 1.5rem 1rem;
text-align: center;
border-top: 1px solid var(--border-card);
background-color: var(--bg-body);
}
.footer-update-text {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 500;
}

/* ==========================================================
MATCH DETAILS, STATS, ROSTERS & TRANSFERS
========================================================== */
.match-details-container { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.back-to-league-btn { 
display: inline-flex; 
align-items: center; 
gap: 5px; 
background: transparent; 
border: none; 
color: var(--text-muted); 
font-size: 0.82rem; 
font-weight: 500; 
cursor: pointer; 
}
.back-to-league-btn:hover { color: var(--sky-primary); }

.match-hero-card { 
padding: 1.25rem 1rem; 
background: var(--bg-card); 
border: 1px solid var(--border-card); 
border-radius: 12px; 
text-align: center; 
margin-bottom: 1rem; 
}
.match-hero-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; }
.match-hero-team { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.match-hero-team-crest { width: 56px; height: 56px; object-fit: contain; }
@media (min-width: 768px) { .match-hero-team-crest { width: 72px; height: 72px; } }
.match-hero-team-name { font-weight: 500; font-size: 0.95rem; }
.match-hero-score-box { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.match-hero-score { font-size: 1.9rem; font-weight: 900; background: var(--bg-body); border: 1px solid var(--border-card); padding: 0.2rem 1.1rem; border-radius: 8px; }
.match-hero-ht { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.match-hero-events-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-card); font-size: 0.74rem; }
.hero-events-home { text-align: left; align-items: flex-start; }
.hero-events-away { text-align: right; align-items: flex-end; }
.hero-event-item { display: inline-flex; align-items: center; gap: 4px; }
.hero-event-item.is-goal { font-weight: 500; color: var(--text-main); }
.hero-event-item.is-card { color: var(--text-muted); }

.match-hero-extra-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-card); }
@media (min-width: 640px) { .match-hero-extra-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
.match-hero-pill { background: var(--bg-body); border: 1px solid var(--border-card); padding: 5px 8px; border-radius: 6px; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

.match-tabs-bar { justify-content: center; }
.modal-tab-btn { background: transparent; border: none; border-bottom: 3px solid transparent; color: var(--text-muted); padding: 0.55rem 0.85rem; font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.modal-tab-btn:hover { color: var(--text-main); }
.modal-tab-btn.tab-active, .modal-tab-btn.active { border-bottom-color: var(--sky-primary) !important; color: var(--text-main) !important; font-weight: 500; }

.timeline-container { max-width: 34rem; margin: 0 auto; display: flex; flex-direction: column; gap: 0.45rem; }
.timeline-event-row { display: grid; grid-template-columns: 42px 32px 1fr auto; align-items: flex-start; gap: 0.5rem; padding: 0.65rem 0.75rem; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 8px; font-size: 0.82rem; }
.timeline-event-row.timeline-goal-row { background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), var(--bg-card)) !important; border-left: 3px solid var(--emerald-color) !important; }
.timeline-min { font-weight: 800; color: var(--sky-light); text-align: right; }
.timeline-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-body); border: 1px solid var(--border-card); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.goal-pill-badge { background: rgba(16, 185, 129, 0.2); color: var(--emerald-text); border: 1px solid rgba(16, 185, 129, 0.4); padding: 2px 6px; border-radius: 9999px; font-size: 0.72rem; font-weight: 800; }
.timeline-desc { display: flex; flex-direction: column; gap: 2px; }
.timeline-primary { font-weight: 500; color: var(--text-main); }
.timeline-sub { font-size: 0.72rem; color: var(--text-muted); }
.timeline-comment-body { margin-top: 4px; font-size: 0.78rem; line-height: 1.4; color: var(--text-sub); background: rgba(0, 0, 0, 0.2); border-left: 2px solid var(--border-card); padding: 4px 6px; border-radius: 0 4px 4px 0; }

.stats-container { max-width: 34rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; background: var(--bg-card); padding: 1.15rem; border-radius: 8px; border: 1px solid var(--border-card); }
.stat-row { display: flex; flex-direction: column; gap: 0.35rem; }
.stat-labels { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 500; }
.stat-bar-track { height: 8px; background-color: var(--bg-body); border-radius: 4px; display: flex; overflow: hidden; border: 1px solid var(--border-card); }
.stat-bar-home { background-color: var(--sky-primary); height: 100%; transition: width 0.3s ease; }
.stat-bar-away { background-color: var(--emerald-color); height: 100%; transition: width 0.3s ease; }

.sub-tabs-container { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; }
.pill-btn { background-color: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border-card); border-radius: 6px; padding: 0.3rem 0.85rem; font-size: 0.78rem; font-weight: 500; cursor: pointer; }
.pill-btn:hover { background-color: var(--bg-card-hover); color: var(--text-main); }
.pill-btn.active { background-color: var(--sky-primary); color: #ffffff !important; border-color: var(--sky-primary); }

.transfer-filter-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; gap: 0.75rem; }
.transfer-search-input { flex: 1; max-width: 20rem; background-color: var(--bg-input); border: 1px solid var(--border-card); color: var(--text-main); padding: 0.4rem 0.65rem; border-radius: 6px; font-size: 0.8rem; outline: none; }
.transfer-search-input:focus { border-color: var(--sky-primary); }
.transfer-count-badge { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.transfer-cards-list { display: flex; flex-direction: column; gap: 0.45rem; }
.transfer-card-item { display: grid; grid-template-columns: 90px 1.4fr 2fr; align-items: center; background-color: var(--bg-card); border: 1px solid var(--border-card); border-radius: 8px; padding: 0.55rem 0.75rem; gap: 0.75rem; }
@media (max-width: 640px) { .transfer-card-item { grid-template-columns: 1fr; gap: 0.35rem; } }

.player-modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.player-modal-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 12px; width: 100%; max-width: 22rem; padding: 1.15rem; position: relative; display: flex; flex-direction: column; gap: 0.85rem; }
.player-modal-close { position: absolute; top: 0.65rem; right: 0.65rem; background: transparent; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.player-modal-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: var(--bg-body); border: 2px solid var(--border-card); }
.player-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; background: var(--bg-body); padding: 0.65rem; border-radius: 8px; border: 1px solid var(--border-card); font-size: 0.78rem; }
.player-modal-stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.player-modal-stat-value { font-weight: 500; color: var(--text-main); margin-top: 1px; }

.pitch-wrapper {
background: repeating-linear-gradient(180deg, #1b5e20 0px, #1b5e20 32px, #237a38 32px, #237a38 64px);
border: 3px solid #2e8b46;
border-radius: 12px;
position: relative;
height: 620px;
width: 100%;
max-width: 34rem;
margin: 0 auto 1.25rem auto;
overflow: hidden;
}
.pitch-half-line { position: absolute; top: 50%; left: 0; right: 0; height: 1.5px; background: rgba(255, 255, 255, 0.65); }
.pitch-center-circle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 85px; height: 85px; border: 1.5px solid rgba(255, 255, 255, 0.65); border-radius: 50%; }
.pitch-player-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 5; cursor: pointer; }
.pitch-shirt-circle { width: 25px; height: 25px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; color: #ffffff; border: 1.5px solid rgba(255, 255, 255, 0.85); }
.pitch-player-name { font-size: 0.65rem; font-weight: 500; color: #ffffff; text-shadow: 0 1px 3px #000000; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; text-align: center; margin-top: 2px; }

/* ==========================================================
FINISHED MATCH STATE: DIRECTIONAL WINNER GLOW (MATCH HERO)
========================================================== */
.match-hero-finished {
border-color: rgba(16, 185, 129, 0.45) !important;
}

/* Dark Mode: Home Win (shines from top-left Home crest) */
.match-hero-finished.match-hero-win-home {
background: linear-gradient(135deg, rgba(6, 78, 59, 0.45) 0%, rgba(5, 150, 105, 0.15) 35%, var(--bg-card) 70%) !important;
box-shadow: inset 1px 1px 0 rgba(16, 185, 129, 0.25), 0 4px 20px rgba(6, 78, 59, 0.25);
}

/* Dark Mode: Away Win (shines from top-right Away crest) */
.match-hero-finished.match-hero-win-away {
background: linear-gradient(225deg, rgba(6, 78, 59, 0.45) 0%, rgba(5, 150, 105, 0.15) 35%, var(--bg-card) 70%) !important;
box-shadow: inset -1px 1px 0 rgba(16, 185, 129, 0.25), 0 4px 20px rgba(6, 78, 59, 0.25);
}

/* Dark Mode: Draw */
.match-hero-finished.match-hero-draw {
background: linear-gradient(180deg, rgba(6, 78, 59, 0.35) 0%, rgba(5, 150, 105, 0.1) 40%, var(--bg-card) 80%) !important;
box-shadow: inset 0 1px 0 rgba(16, 185, 129, 0.2), 0 4px 20px rgba(6, 78, 59, 0.2);
}

/* Light Mode: Home Win (sharp border, no blurry shadows) */
body.light-mode .match-hero-finished.match-hero-win-home {
background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.03) 40%, #ffffff 75%) !important;
border-color: rgba(16, 185, 129, 0.45) !important;
box-shadow: none;
}

/* Light Mode: Away Win (sharp border, no blurry shadows) */
body.light-mode .match-hero-finished.match-hero-win-away {
background: linear-gradient(225deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.03) 40%, #ffffff 75%) !important;
border-color: rgba(16, 185, 129, 0.45) !important;
box-shadow: none;
}

/* Light Mode: Draw */
body.light-mode .match-hero-finished.match-hero-draw {
background: #ffffff !important;
border-color: var(--border-card) !important;
box-shadow: none;
}


/* ==========================================================
TRANSFER CARDS: LOGO SIZING & ALIGNMENT
========================================================== */
.player-team-crest {
width: 20px !important;
height: 20px !important;
max-width: 20px !important;
max-height: 20px !important;
object-fit: contain;
flex-shrink: 0;
display: inline-block;
}

.transfer-meta { 
font-size: 0.72rem; 
color: var(--text-muted); 
display: flex; 
flex-direction: column; 
gap: 0.15rem; 
}

.transfer-type { 
display: flex; 
align-items: center; 
gap: 0.35rem; 
color: var(--sky-light); 
font-weight: 500; 
}

/* Restricts the transfer/loan arrows to icon size */
.transfer-type svg,
.type-icon { 
width: 14px !important; 
height: 14px !important; 
flex-shrink: 0;
}

.transfer-loan-end {
font-size: 0.68rem;
color: var(--text-muted);
}

.transfer-route { 
display: flex; 
align-items: center; 
gap: 0.5rem; 
font-size: 0.8rem; 
font-weight: 500; 
}

.transfer-team { 
display: inline-flex; 
align-items: center; 
gap: 0.4rem; 
min-width: 0;
}

.transfer-arrow { 
display: inline-flex; 
align-items: center; 
justify-content: center; 
line-height: 1; 
color: var(--sky-light); 
font-weight: 500; 
user-select: none; 
}

.player-country-line {
display: flex;
align-items: center;
gap: 0.35rem;
font-size: 0.72rem;
color: var(--text-muted);
}

/* ==========================================================
SUMMARY VIEW (3 COLUMNS - DESKTOP ONLY)
========================================================== */
.summary-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
align-items: stretch; /* Forces all 3 outer cards to identical height */
}

.summary-col {
background-color: var(--bg-card);
border: 1px solid var(--border-card);
border-radius: 0.65rem;
padding: 0.75rem;
display: flex;
flex-direction: column;
min-width: 0;
height: 100%;
}

.summary-col-header {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 0.82rem;
font-weight: 600;
color: var(--sky-light);
padding-bottom: 0.45rem;
margin-bottom: 0.5rem;
border-bottom: 1px solid var(--border-card);
flex-shrink: 0;
}

.summary-col-body {
flex: 1 1 auto;
min-height: 0;
}

.summary-scrollable {
overflow-y: auto;
overflow-x: hidden;
padding-right: 4px;
}

/* Custom scrollbars for clean look */
.summary-scrollable::-webkit-scrollbar {
width: 5px;
}
.summary-scrollable::-webkit-scrollbar-track {
background: rgba(10, 18, 37, 0.4);
border-radius: 4px;
}
.summary-scrollable::-webkit-scrollbar-thumb {
background: #1f305c;
border-radius: 4px;
}
.summary-scrollable::-webkit-scrollbar-thumb:hover {
background: var(--sky-primary);
}

/* Light mode scrollbar overrides for Summary columns */
body.light-mode .summary-scrollable::-webkit-scrollbar-track {
background: rgba(226, 232, 240, 0.5); /* Soft slate-200 */
}
body.light-mode .summary-scrollable::-webkit-scrollbar-thumb {
background: #cbd5e1; /* slate-300 */
}
body.light-mode .summary-scrollable::-webkit-scrollbar-thumb:hover {
background: #94a3b8; /* slate-400 */
}

.summary-col .match-group { margin-bottom: 0.5rem; }
.summary-col .match-row { padding: 0.45rem 0.6rem; }
.summary-col .team-col { font-size: 0.76rem; }
.summary-col .team-crest-slot { width: 22px; height: 22px; }
.summary-col .team-crest { max-width: 18px; max-height: 18px; }
.summary-col .score-box,
.summary-col .time-box { width: 62px; height: 26px; }
.summary-col .score-box .score-val { font-size: 0.88rem; }

/* Hide Summary tab and grid on small screens */
@media (max-width: 800px) {
.summary-tab-btn,
#panel-summary {
display: none !important;
}
}

/* ==========================================================
MOBILE FIX: +/- COLUMN OVERSIZED & TEAM NAME COLLISION
========================================================== */
@media (max-width: 640px) {
.sports-table th, 
.sports-table td { 
padding: 0.5rem 0.25rem !important; 
}
.col-change { 
width: 2.6rem !important; 
max-width: 2.8rem !important; 
}
.pos-change-wrapper { 
gap: 2px !important; 
}
.team-cell { 
min-width: 0; 
overflow: hidden; 
}
.team-title { 
max-width: 100px; 
overflow: hidden; 
text-overflow: ellipsis; 
white-space: nowrap; 
display: inline-block; 
vertical-align: middle; 
}
}

/* ==========================================================
MY TEAM HIGHLIGHT IN MATCH FEED & SUMMARY
========================================================== */
.match-row.match-row-highlight-team {
background-color: rgba(37, 99, 235, 0.18) !important;
border-color: rgba(37, 99, 235, 0.45) !important;
}

.match-row-live-wrapper.match-row-highlight-team {
background-color: rgba(37, 99, 235, 0.14) !important;
border-color: var(--sky-primary) !important;
box-shadow: 0 0 10px rgba(37, 99, 235, 0.25) !important;
}

.team-col.team-highlight-myteam .team-name {
color: #ffffff !important;
font-weight: 600 !important;
}

body.light-mode .match-row.match-row-highlight-team {
background-color: rgba(37, 99, 235, 0.08) !important;
border-color: rgba(37, 99, 235, 0.35) !important;
}

body.light-mode .match-row-live-wrapper.match-row-highlight-team {
background-color: rgba(37, 99, 235, 0.06) !important;
border-color: var(--sky-primary) !important;
}

body.light-mode .team-col.team-highlight-myteam .team-name {
color: #1d4ed8 !important;
font-weight: 600 !important;
}

/* ==========================================================
LINEUPS: MATCH ROSTERS & NATIONAL FLAGS FIX
========================================================== */
.match-roster-container {
max-width: 34rem;
margin: 0 auto;
background-color: var(--bg-card);
border: 1px solid var(--border-card);
border-radius: 10px;
overflow: hidden;
}

.roster-team-tabs {
display: flex;
background: var(--bg-body);
border-bottom: 1px solid var(--border-card);
}

.roster-tab-btn {
flex: 1;
background: transparent;
border: none;
border-bottom: 2px solid transparent;
padding: 0.65rem;
font-size: 0.82rem;
font-weight: 500;
color: var(--text-muted);
cursor: pointer;
transition: all 0.15s ease;
}

.roster-tab-btn:hover {
color: var(--text-main);
}

.roster-tab-btn.active {
color: var(--sky-light);
border-bottom-color: var(--sky-primary);
background-color: rgba(37, 99, 235, 0.08);
}

.roster-team-panel {
padding: 0.75rem;
}

.roster-section-header {
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-muted);
padding: 0.4rem 0.25rem;
border-bottom: 1px solid var(--border-card);
margin-bottom: 0.25rem;
}

.roster-section-header:not(:first-child) {
margin-top: 0.75rem;
}

.roster-list {
display: flex;
flex-direction: column;
}

.roster-player-row {
display: grid;
grid-template-columns: 28px 1fr auto;
align-items: center;
padding: 0.45rem 0.4rem;
border-radius: 6px;
font-size: 0.8rem;
cursor: pointer;
transition: background-color 0.15s ease;
}

.roster-player-row:hover {
background-color: var(--bg-card-hover);
}

.roster-num {
font-weight: 700;
color: var(--text-muted);
font-size: 0.75rem;
}

.roster-name-cell {
display: flex;
align-items: center;
gap: 0.45rem;
font-weight: 500;
color: var(--text-main);
min-width: 0;
}

.roster-name-cell span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

/* Hard constraints: prevents giant SVG flag explosions */
.roster-flag {
width: 16px !important;
height: 11px !important;
max-width: 16px !important;
max-height: 11px !important;
object-fit: cover;
border-radius: 2px;
border: 1px solid var(--border-muted);
flex-shrink: 0;
display: inline-block;
}

.roster-events-cell {
display: flex;
align-items: center;
gap: 0.35rem;
font-size: 0.75rem;
}

.roster-sub-tag {
font-size: 0.7rem;
font-weight: 500;
color: var(--text-muted);
background: var(--bg-body);
border: 1px solid var(--border-card);
padding: 1px 6px;
border-radius: 4px;
}

/* ==========================================================
PITCH MARKINGS
========================================================== */
.pitch-box-top, .pitch-box-bottom {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 180px;
height: 80px;
border: 1.5px solid rgba(255, 255, 255, 0.65);
}
.pitch-box-top { top: 0; border-top: none; }
.pitch-box-bottom { bottom: 0; border-bottom: none; }

.pitch-sixyard-top, .pitch-sixyard-bottom {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 90px;
height: 35px;
border: 1.5px solid rgba(255, 255, 255, 0.65);
}
.pitch-sixyard-top { top: 0; border-top: none; }
.pitch-sixyard-bottom { bottom: 0; border-bottom: none; }

.pitch-pen-spot-top, .pitch-pen-spot-bottom {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 4px;
height: 4px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.85);
}
.pitch-pen-spot-top { top: 58px; }
.pitch-pen-spot-bottom { bottom: 58px; }

.pitch-center-spot {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 5px;
height: 5px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.85);
}

.pitch-goal-top, .pitch-goal-bottom {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 6px;
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.8);
}
.pitch-goal-top { top: -6px; }
.pitch-goal-bottom { bottom: -6px; }

.pitch-corner {
position: absolute;
width: 14px;
height: 14px;
border: 1.5px solid rgba(255, 255, 255, 0.65);
}
.pitch-corner.top-left { top: 0; left: 0; border-top: none; border-left: none; border-bottom-right-radius: 14px; }
.pitch-corner.top-right { top: 0; right: 0; border-top: none; border-right: none; border-bottom-left-radius: 14px; }
.pitch-corner.bottom-left { bottom: 0; left: 0; border-bottom: none; border-left: none; border-top-right-radius: 14px; }
.pitch-corner.bottom-right { bottom: 0; right: 0; border-bottom: none; border-right: none; border-top-left-radius: 14px; }

/* ==========================================================
HEAD TO HEAD (H2H) SECTION
========================================================== */
.h2h-container {
max-width: 34rem;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 1rem;
}

.h2h-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.75rem;
}

.h2h-stat-box {
background: var(--bg-card);
border: 1px solid var(--border-card);
border-radius: 10px;
padding: 0.85rem 0.5rem;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.25rem;
}

.h2h-stat-val {
font-size: 1.6rem;
font-weight: 800;
line-height: 1;
}

.h2h-stat-lbl {
font-size: 0.72rem;
font-weight: 500;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.04em;
}

.bench-header {
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--sky-light);
margin-bottom: 0.5rem;
}

/* ==========================================================
LIGHT MODE OVERRIDES FOR ROSTER & H2H
========================================================== */
body.light-mode .match-roster-container { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .roster-team-tabs { background: #f8fafc; border-color: #e2e8f0; }
body.light-mode .roster-tab-btn { color: #64748b; }
body.light-mode .roster-tab-btn:hover { color: #0f172a; }
body.light-mode .roster-tab-btn.active { color: #1d4ed8; background: #eff6ff; border-bottom-color: var(--sky-primary); }
body.light-mode .roster-section-header { border-color: #e2e8f0; color: #64748b; }
body.light-mode .roster-player-row:hover { background-color: #f1f5f9; }
body.light-mode .roster-name-cell { color: #0f172a; }
body.light-mode .roster-sub-tag { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
body.light-mode .h2h-stat-box { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .h2h-stat-lbl { color: #64748b; }

/* ==========================================================
COOKIE & LOCAL STORAGE NOTICE BANNER
========================================================== */
.cookie-banner {
position: fixed;
bottom: 1.5rem;
left: 1.5rem;
z-index: 990;
max-width: 440px;
background-color: var(--bg-card);
border: 1px solid var(--border-card);
border-radius: 0.75rem;
padding: 1rem 1.15rem;
box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
display: flex;
flex-direction: column;
gap: 0.75rem;
opacity: 0;
transform: translateY(12px);
transition: opacity 0.3s ease, transform 0.3s ease;
pointer-events: none;
}

.cookie-banner.show {
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}

.cookie-banner-content {
display: flex;
align-items: flex-start;
gap: 0.75rem;
}

.cookie-icon-wrapper {
font-size: 1.35rem;
line-height: 1;
flex-shrink: 0;
padding-top: 2px;
}

.cookie-text-col {
flex: 1;
}

.cookie-banner-text {
margin: 0;
font-size: 0.78rem;
line-height: 1.45;
color: var(--text-sub);
}

.cookie-banner-actions {
display: flex;
justify-content: flex-end;
}

.cookie-accept-btn {
background-color: var(--sky-primary);
color: #ffffff;
border: 1px solid var(--sky-primary);
border-radius: 0.45rem;
padding: 0.4rem 0.95rem;
font-size: 0.76rem;
font-weight: 500;
cursor: pointer;
transition: all 0.15s ease;
}

.cookie-accept-btn:hover {
background-color: #1d4ed8;
border-color: #1d4ed8;
}

.cookie-accept-btn:active {
transform: scale(0.97);
}

/* Light Mode Card Shadows */
body.light-mode .cookie-banner {
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Mobile Breakpoint */
@media (max-width: 640px) {
.cookie-banner {
left: 0.75rem;
right: 0.75rem;
bottom: 0.75rem;
max-width: none;
}
}