body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji"; }
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;background:#f0f2f5;color:#0f172a;min-height:100vh}
.navbar{position:sticky;top:0;z-index:50;background:linear-gradient(135deg,#0f172a,#1e293b);display:flex;align-items:center;padding:0 12px;height:48px;gap:8px}
.nav-brand{display:flex;align-items:center;gap:8px;cursor:pointer;flex-shrink:0}
.nav-icon{width:28px;height:28px;border-radius:6px}
.nav-brand-text{display:flex;flex-direction:column;line-height:1.1}
.nav-title{color:#fff;font-size:14px;font-weight:800;letter-spacing:-.02em}
.nav-subtitle{color:#64748b;font-size:8px;font-weight:600;letter-spacing:.08em}
.nav-tabs{display:flex;gap:4px;margin:0 auto;flex-shrink:1;overflow-x:auto}
.nav-tab{background:none;border:none;color:#94a3b8;font-size:11px;font-weight:600;padding:6px 10px;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .15s}
.nav-tab:hover{color:#cbd5e1}
.nav-tab.active{background:rgba(255,255,255,.12);color:#fff}
.nav-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.nav-sync{display:flex;align-items:center;gap:4px;background:#166534;color:#fff;border:none;padding:5px 10px;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap}
.nav-sync:hover{background:#15803d}
.nav-sync:disabled{opacity:.5;cursor:wait}
.sync-icon{font-size:12px}
.sync-label{font-variant-numeric:tabular-nums}
.nav-menu-btn{background:rgba(255,255,255,.08);border:none;color:#94a3b8;font-size:18px;font-weight:700;width:32px;height:32px;border-radius:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}
.nav-menu-btn:hover{background:rgba(255,255,255,.15);color:#fff}
.nav-dropdown{position:fixed;top:48px;right:8px;width:260px;background:#fff;border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.18);z-index:60;display:none;overflow:hidden}
.nav-dropdown.open{display:block}
.dd-backdrop{position:fixed;inset:0;z-index:55;display:none}
.dd-backdrop.open{display:block}
.dd-section{padding:10px 14px;border-bottom:1px solid #f1f5f9}
.dd-section:last-child{border-bottom:none}
.dd-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:#94a3b8;margin-bottom:6px}
.dd-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0;font-size:12px;color:#334155}
.dd-muted{font-size:11px;color:#94a3b8}
.dd-test-btn{font-size:10px;padding:3px 8px;background:#f59e0b;color:#fff;border:none;border-radius:5px;cursor:pointer;font-weight:600}
.dd-install{width:100%;background:#e2e8f0;border:none;padding:8px;border-radius:6px;font-size:12px;font-weight:600;color:#334155;cursor:pointer}
.dd-install:hover{background:#cbd5e1}
.dd-footer-row{display:flex;justify-content:space-between;align-items:center;padding:8px 14px}
.dd-help{background:none;border:1px solid #e2e8f0;padding:4px 10px;border-radius:5px;font-size:11px;color:#64748b;cursor:pointer;font-weight:600}
.dd-version{font-size:9px;color:#94a3b8}
.footer{text-align:center;padding:6px 16px;font-size:9px;color:#b0b8c8}
@media(max-width:600px){
.nav-brand-text{display:none}
.nav-tab{font-size:10px;padding:5px 7px}
.sync-label{display:none}
.nav-sync{padding:5px 8px}
}
.btn{padding:6px 14px;border-radius:6px;border:none;font-size:12px;font-weight:600;cursor:pointer;transition:all .15s}
.btn-dark{background:#0f172a;color:#fff}
.btn-light{background:#e2e8f0;color:#64748b}
.btn-green{background:#166534;color:#fff}
.btn-green:hover{background:#15803d}
.btn-red{background:#dc2626;color:#fff;font-size:11px;padding:4px 10px}
.btn:disabled{opacity:.5;cursor:wait}
.toast{position:fixed;top:12px;left:50%;transform:translateX(-50%);padding:8px 16px;border-radius:8px;font-size:12px;font-weight:600;z-index:100;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s;pointer-events:none}
.toast-ok{background:#166534;color:#fff}
.toast-err{background:#dc2626;color:#fff}
.detail{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:14px 16px;margin:8px 12px;position:relative}
.detail-close{position:absolute;top:6px;right:8px;background:none;border:none;font-size:20px;color:#94a3b8;cursor:pointer}
.detail-round{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:#94a3b8;margin-bottom:10px}
.detail-teams{display:flex;align-items:center;justify-content:center;gap:14px}
.detail-team{text-align:center}
.detail-team.loser{opacity:.35}
.detail-flag{font-size:38px}
.detail-name{font-size:12px;font-weight:600;margin-top:2px}
.detail-score{font-size:28px;font-weight:800;font-variant-numeric:tabular-nums;min-width:70px;text-align:center;line-height:1}
.detail-pen{font-size:11px;color:#64748b;font-weight:500;margin-top:4px}
.score-form{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:12px;padding-top:10px;border-top:1px solid #f1f5f9}
.score-input{width:40px;text-align:center;border:1px solid #d1d5db;border-radius:4px;padding:4px;font-size:14px;font-weight:700}
.score-input:focus{outline:none;border-color:#3b82f6}
.pen-row{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:6px}
.pen-label{font-size:10px;color:#94a3b8;font-weight:600}
.pen-input{width:32px;text-align:center;border:1px solid #e2e8f0;border-radius:4px;padding:3px;font-size:12px}
.bracket-wrap{padding:4px 4px 20px}
.bracket-wrap svg{width:100%;max-width:760px;display:block;margin:0 auto}
.list-view{padding:8px 8px 32px}
.round-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:#94a3b8;text-align:center;padding:4px 0}
.round-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-bottom:14px}
.card{background:#fff;border:1px solid #d1d5db;border-radius:10px;padding:8px 10px;cursor:pointer;width:180px;flex-shrink:0;transition:all .15s}
.card.pending{border-color:#93c5fd}
.card.selected{border:2px solid #ca8a04;background:#fefce8}
.card-row{display:flex;align-items:center;gap:6px;padding:3px 0}
.card-row:first-child{border-bottom:1px solid #f1f5f9}
.card-row.loser{opacity:.4}
.card-flag{font-size:16px}
.card-name{font-size:12px;font-weight:500;flex:1;color:#334155}
.card-name.winner{font-weight:700;color:#166534}
.card-score{font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;color:#64748b}
.card-score.winner{color:#166534}
.card-meta{font-size:9px;color:#94a3b8;margin-top:4px;text-align:center}
.card.today{border:2px solid #f59e0b;background:linear-gradient(135deg,#fffbeb,#fef3c7);box-shadow:0 0 12px rgba(245,158,11,.18)}
.card.live{border:2px solid #dc2626;background:linear-gradient(135deg,#fef2f2,#fee2e2);box-shadow:0 0 12px rgba(220,38,38,.18)}
.card.today .card-meta{color:#92400e;font-weight:600}
.today-badge{display:inline-block;background:#f59e0b;color:#fff;font-size:7px;font-weight:800;padding:1px 5px;border-radius:3px;letter-spacing:.06em;text-transform:uppercase;vertical-align:middle;margin-left:3px}
.live-badge{display:inline-flex;align-items:center;gap:3px;background:#dc2626;color:#fff;font-size:7px;font-weight:800;padding:2px 6px;border-radius:3px;letter-spacing:.06em;text-transform:uppercase;vertical-align:middle;margin-left:4px}
.live-dot{width:6px;height:6px;border-radius:50%;background:#fff;animation:liveDot 1.2s ease-in-out infinite}
@keyframes liveDot{0%,100%{opacity:1}50%{opacity:.3}}
.done-badge{display:inline-block;background:#64748b;color:#fff;font-size:7px;font-weight:800;padding:1px 5px;border-radius:3px;letter-spacing:.06em;text-transform:uppercase;vertical-align:middle;margin-left:4px}
.today-banner{margin:6px 12px 2px;padding:10px 14px;background:linear-gradient(135deg,#fffbeb,#fef3c7);border:1px solid #fde68a;border-radius:10px}
.today-banner-title{font-size:10px;font-weight:700;color:#92400e;text-transform:uppercase;letter-spacing:.1em;margin-bottom:6px;display:flex;align-items:center;gap:6px}
.banner-tabs{display:flex;gap:4px;margin-bottom:8px}
.banner-tab{padding:4px 10px;border-radius:5px;border:none;font-size:10px;font-weight:700;cursor:pointer;transition:all .15s;letter-spacing:.04em}
.banner-tab.active{background:#92400e;color:#fff}
.banner-tab.inactive{background:rgba(146,64,14,.12);color:#92400e}
.banner-date-sep{font-size:9px;font-weight:700;color:#92400e;opacity:.6;letter-spacing:.08em;padding:5px 0 2px;text-align:center;text-transform:uppercase}
.stat-card{background:rgba(146,64,14,.06);border-radius:8px;padding:8px 12px;margin-bottom:6px}
.stat-row{display:flex;align-items:center;gap:8px}
.stat-icon{font-size:16px}
.stat-label{font-size:9px;font-weight:700;color:#92400e;text-transform:uppercase;letter-spacing:.06em}
.stat-value{font-size:15px;font-weight:800;color:#0f172a}
.stat-sub{font-size:10px;color:#64748b;margin-top:1px}
.stat-match{font-size:12px;font-weight:600;margin-top:3px}
.ranking-list{margin-top:4px}
.ranking-row{display:flex;align-items:center;gap:5px;padding:3px 0;font-size:11px;border-bottom:1px solid rgba(146,64,14,.06)}
.ranking-row:last-child{border-bottom:none}
.ranking-pos{font-weight:800;color:#92400e;width:16px;text-align:right;font-size:10px}
.ranking-flag{font-size:13px}
.ranking-name{flex:1;font-weight:500;color:#334155;font-size:11px}
.ranking-pts{font-weight:800;color:#0f172a;font-size:11px}
.ranking-detail{font-size:9px;color:#94a3b8;width:70px;text-align:right}
.today-banner-match{display:flex;align-items:center;justify-content:center;gap:8px;padding:4px 0;font-size:13px;font-weight:600;cursor:pointer;border-radius:6px;transition:background .15s}
.today-banner-match:hover{background:rgba(245,158,11,.12)}
.today-banner-vs{color:#b45309;font-size:11px;font-weight:700}
.today-banner-city{font-size:9px;color:#b45309;font-weight:500}
.today-pulse{animation:todayPulse 2s ease-in-out infinite}
@keyframes todayPulse{0%,100%{opacity:.5}50%{opacity:.15}}
.history-view{padding:8px 12px 32px}
.history-filter{display:flex;align-items:center;gap:8px;justify-content:center;margin-bottom:10px;flex-wrap:wrap}
.history-filter select{padding:5px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:12px;font-weight:500;background:#fff;color:#0f172a;cursor:pointer}
.history-filter select:focus{outline:none;border-color:#3b82f6}
.history-filter-label{font-size:11px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.08em}
.history-count{font-size:11px;color:#94a3b8;text-align:center;margin-bottom:8px}
.history-group-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:#94a3b8;text-align:center;padding:8px 0 4px}
.history-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-bottom:10px}
.hcard{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:8px 10px;width:200px;flex-shrink:0;transition:all .15s}
.hcard.draw-card{border-left:3px solid #94a3b8}
.hcard-row{display:flex;align-items:center;gap:6px;padding:3px 0}
.hcard-row:first-child{border-bottom:1px solid #f1f5f9}
.hcard-row.loser{opacity:.4}
.hcard-flag{font-size:16px}
.hcard-name{font-size:12px;font-weight:500;flex:1;color:#334155}
.hcard-name.winner{font-weight:700;color:#166534}
.hcard-score{font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;color:#64748b}
.hcard-score.winner{color:#166534}
.hcard-meta{font-size:9px;color:#94a3b8;margin-top:4px;text-align:center}
.history-empty{text-align:center;padding:40px 20px;color:#94a3b8}
.history-empty-icon{font-size:36px;margin-bottom:8px}
.history-empty-text{font-size:13px;font-weight:500}
.history-empty-sub{font-size:11px;margin-top:4px}
.map-view{padding:8px 12px 32px}
.map-svg-wrap{max-width:700px;margin:0 auto 12px}
.map-svg-wrap svg{width:100%;display:block}
.map-dot{cursor:pointer;transition:opacity .15s}
.map-dot:hover{opacity:.8}
.map-filter{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-bottom:10px}
.map-pill{padding:3px 9px;border-radius:12px;border:1px solid #d1d5db;font-size:10px;font-weight:600;cursor:pointer;transition:all .15s;background:#fff;color:#334155}
.map-pill.active{background:#0f172a;color:#fff;border-color:#0f172a}
.map-pill .mp-flag{margin-right:2px}
.map-pill .mp-count{font-size:9px;color:#94a3b8;margin-left:2px}
.map-pill.active .mp-count{color:#94a3b8}
.map-city-section{margin-bottom:12px}
.map-city-title{font-size:11px;font-weight:700;color:#0f172a;padding:6px 0 4px;display:flex;align-items:center;gap:6px;border-bottom:1px solid #e2e8f0;margin-bottom:4px}
.map-city-flag{font-size:14px}
.map-city-count{font-size:9px;color:#94a3b8;font-weight:500}
.map-match{display:flex;align-items:center;gap:6px;padding:4px 0;font-size:12px;border-bottom:1px solid #f8fafc}
.map-match-teams{flex:1;font-weight:500}
.map-match-score{font-weight:700;color:#0f172a;font-size:12px}
.map-match-meta{font-size:9px;color:#94a3b8;white-space:nowrap}

.countdown{font-size:9px;color:#b45309;font-weight:700;margin-left:4px}

.journey-timeline{max-width:400px;margin:0 auto;padding:8px 0 20px}
.journey-line{position:relative;padding-left:28px;border-left:2px solid #e2e8f0;margin-left:10px}
.journey-node{position:relative;padding:6px 0 18px}
.journey-node:last-child{padding-bottom:0}
.journey-dot{position:absolute;left:-33px;top:10px;width:12px;height:12px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #e2e8f0}
.journey-dot.win{background:#16a34a}
.journey-dot.draw{background:#94a3b8}
.journey-dot.loss{background:#dc2626}
.journey-dot.pending{background:#f1f5f9;border-color:#d1d5db}
.journey-round{font-size:9px;font-weight:700;color:#94a3b8;text-transform:uppercase;letter-spacing:.08em}
.journey-match{font-size:13px;font-weight:600;color:#0f172a;margin:2px 0}
.journey-score{font-weight:800;color:#16a34a}
.journey-score.loss{color:#dc2626}
.journey-score.draw{color:#94a3b8}
.journey-meta{font-size:10px;color:#64748b}
.journey-header{text-align:center;padding:8px 0 12px;font-size:16px;font-weight:700}
.btn-notif{font-size:14px;padding:6px 8px;min-width:auto}
.btn-notif.active{background:#16a34a;color:#fff;border-color:#16a34a}
.detail-actions{display:flex;gap:6px;justify-content:center;margin-top:8px}
.btn-share{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;border:1px solid #d1d5db;background:#fff;font-size:10px;font-weight:600;color:#64748b;cursor:pointer;transition:all .15s}
.btn-share:hover{background:#f1f5f9;color:#0f172a}
.btn-share:active{transform:scale(.95)}
.btn-help{font-size:13px;padding:6px 8px;min-width:auto}
.btn-install{font-size:10px;padding:5px 8px;min-width:auto;display:none}
.btn-install.visible{display:inline-flex;align-items:center;gap:3px}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;display:flex;align-items:center;justify-content:center;padding:16px;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-overlay.open{opacity:1;pointer-events:auto}
.modal{background:#fff;border-radius:14px;max-width:440px;width:100%;max-height:85vh;overflow-y:auto;padding:20px;position:relative}
.modal-close{position:absolute;top:10px;right:14px;background:none;border:none;font-size:22px;color:#94a3b8;cursor:pointer;padding:4px}
.modal-title{font-size:16px;font-weight:800;color:#0f172a;margin-bottom:12px}
.modal-section{margin-bottom:14px}
.modal-section-title{font-size:12px;font-weight:700;color:#0f172a;margin-bottom:3px;display:flex;align-items:center;gap:6px}
.modal-section-text{font-size:11px;color:#64748b;line-height:1.5}
.modal-divider{border:none;border-top:1px solid #f1f5f9;margin:12px 0}
.notif-settings{background:#f8fafc;border-radius:8px;padding:10px 12px;margin-top:6px}
.notif-row{display:flex;align-items:center;justify-content:space-between;padding:4px 0;font-size:11px;color:#334155}
.notif-status{font-size:10px;font-weight:600;padding:2px 8px;border-radius:4px}
.notif-status.on{background:#dcfce7;color:#166534}
.notif-status.off{background:#fee2e2;color:#991b1b}
.notif-status.denied{background:#fef3c7;color:#92400e}
.toggle{position:relative;width:36px;height:20px;background:#d1d5db;border-radius:10px;cursor:pointer;transition:background .2s;border:none;padding:0}
.toggle.on{background:#16a34a}
.toggle::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:50%;transition:transform .2s}
.toggle.on::after{transform:translateX(16px)}

/* ═══════════════════════════════════════
   MATCH EVENTS (v2.4.0)
   ═══════════════════════════════════════ */

.ev-section {
	margin-top: 12px;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
}
.ev-title {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: 8px;
}
.ev-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
	font-size: 12px;
	border-bottom: 1px solid #f1f5f9;
}
.ev-row:last-child { border-bottom: none; }
.ev-icon { font-size: 13px; flex-shrink: 0; width: 18px; text-align: center; }
.ev-min {
	font-size: 10px;
	font-weight: 700;
	color: #94a3b8;
	min-width: 32px;
	text-align: right;
	flex-shrink: 0;
}
.ev-flag { font-size: 13px; flex-shrink: 0; }
.ev-text { color: #1e293b; flex: 1; min-width: 0; }
.ev-assist { color: #94a3b8; font-size: 11px; margin-left: 2px; }
.ev-tag {
	display: inline-block;
	font-size: 9px;
	font-weight: 700;
	padding: 1px 4px;
	border-radius: 3px;
	vertical-align: middle;
	margin-left: 2px;
}
.ev-tag.pen { background: #dbeafe; color: #2563eb; }
.ev-tag.csc { background: #fee2e2; color: #dc2626; }

.ev-goal { background: rgba(34,197,94,.04); }
.ev-card { }

/* Goal scorers in cards */
.card-scorers {
	padding: 4px 10px 0;
}
.card-scorer-line {
	font-size: 10px;
	color: #64748b;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.card-red-badge {
	font-size: 10px;
}

/* Journey scorers */
.journey-scorers {
	font-size: 11px;
	color: #64748b;
	margin-top: 2px;
}

/* ═══════════════════════════════════════
   TOP SCORERS (v2.4.0)
   ═══════════════════════════════════════ */

.scorers-list { margin-top: 6px; }
.scorer-row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 0;
	font-size: 12px;
	border-bottom: 1px solid #f1f5f9;
}
.scorer-row:last-child { border-bottom: none; }
.scorer-pos { font-weight: 700; color: #94a3b8; width: 22px; text-align: right; flex-shrink: 0; }
.scorer-flag { font-size: 14px; flex-shrink: 0; }
.scorer-name { flex: 1; font-weight: 600; color: #1e293b; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer-goals { font-weight: 800; color: #0f172a; font-size: 13px; min-width: 20px; text-align: right; }
.scorer-pen { font-size: 10px; color: #94a3b8; font-weight: 500; }
.scorer-detail { font-size: 10px; color: #94a3b8; min-width: 60px; text-align: right; white-space: nowrap; }

/* ═══════════════════════════════════════
   GROUP STANDINGS (v2.4.0)
   ═══════════════════════════════════════ */

.standings-wrap {
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid #e2e8f0;
}
.standings-title {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 10px;
}
.standings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 10px;
}
.standings-group {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}
.standings-group-name {
	background: #0f172a;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 5px 10px;
	letter-spacing: .03em;
}
.standings-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
}
.standings-table thead th {
	padding: 3px 4px;
	color: #94a3b8;
	font-weight: 600;
	font-size: 10px;
	text-align: center;
	border-bottom: 1px solid #e2e8f0;
}
.standings-table thead th:nth-child(2) { text-align: left; }
.st-row td {
	padding: 4px 4px;
	text-align: center;
	border-bottom: 1px solid #f8fafc;
}
.st-row:last-child td { border-bottom: none; }
.st-row.qualified { background: rgba(34,197,94,.06); }
.st-row.third { background: rgba(234,179,8,.06); }
.st-row.eliminated { opacity: .55; }
.st-pos { font-weight: 700; color: #64748b; width: 20px; }
.st-team { text-align: left !important; font-weight: 600; white-space: nowrap; }
.st-pts { font-weight: 800; color: #0f172a; }
.st-diff { color: #64748b; font-weight: 600; }

/* ═══════════════════════════════════════
   REFEREE (v2.4.0)
   ═══════════════════════════════════════ */

.detail-referee {
	text-align: center;
	font-size: 11px;
	color: #64748b;
	margin-top: 6px;
}
.ref-nat { color: #94a3b8; }

/* ═══════════════════════════════════════
   FLAG IMAGES (v2.4.3)
   ═══════════════════════════════════════ */

.fi {
	display: inline-block;
	vertical-align: middle;
	object-fit: contain;
}
.fi-20 { width: 18px; height: 13px; }
.fi-40 { width: 32px; height: 24px; }
.detail-flag .fi-40 { width: 40px; height: 30px; }
.card-flag .fi { vertical-align: -1px; }
.hcard-flag .fi { vertical-align: -1px; }
.scorer-flag .fi { vertical-align: -2px; }
.ranking-flag .fi { vertical-align: -2px; }
.ev-flag .fi { vertical-align: -2px; }
.st-team .fi { vertical-align: -2px; margin-right: 2px; }

/* Detail live sync countdown */
.detail-live-sync {
	display: flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
	background: linear-gradient(135deg,#fef2f2,#fee2e2);
	border: 1px solid #fecaca;
	border-radius: 6px;
	padding: 6px 12px;
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 600;
	color: #991b1b;
}
.live-dot-sm {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #dc2626;
	animation: liveDot 1.2s ease-in-out infinite;
	flex-shrink: 0;
}
#detail-sync-timer {
	font-variant-numeric: tabular-nums;
}

.thirds-wrap {
	margin-top: 12px;
}
.thirds-table {
	max-width: 400px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}

.detail-timeline {
	display: flex;
	align-items: center;
	gap: 4px;
	justify-content: center;
	flex-wrap: wrap;
	margin: 6px 0;
	font-size: 12px;
}
.timeline-label { color: #94a3b8; font-size: 10px; font-weight: 600; margin-right: 2px; }
.timeline-step { font-weight: 700; color: #1e293b; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.timeline-arrow { color: #cbd5e1; font-size: 10px; }

/* ═══════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════ */

body[data-theme="dark"] { background: #0b1120; color: #e2e8f0; }
body[data-theme="dark"] .detail,
body[data-theme="dark"] .card { background: #1e293b; border-color: #334155; }
body[data-theme="dark"] .card-name { color: #cbd5e1; }
body[data-theme="dark"] .card-name.winner { color: #4ade80; }
body[data-theme="dark"] .card-score { color: #94a3b8; }
body[data-theme="dark"] .card-score.winner { color: #4ade80; }
body[data-theme="dark"] .card-meta { color: #64748b; }
body[data-theme="dark"] .card-row:first-child { border-color: #334155; }
body[data-theme="dark"] .card.today { background: linear-gradient(135deg,#422006,#451a03); border-color: #b45309; }
body[data-theme="dark"] .card.today .card-meta { color: #fbbf24; }
body[data-theme="dark"] .card.live { background: linear-gradient(135deg,#450a0a,#7f1d1d); border-color: #dc2626; }
body[data-theme="dark"] .detail-round { color: #64748b; }
body[data-theme="dark"] .detail-score { color: #f8fafc; }
body[data-theme="dark"] .detail-name { color: #cbd5e1; }
body[data-theme="dark"] .detail-pen { color: #94a3b8; }
body[data-theme="dark"] .detail-close { color: #64748b; }
body[data-theme="dark"] .detail-referee { color: #64748b; }
body[data-theme="dark"] .score-form { border-color: #334155; }
body[data-theme="dark"] .score-input,
body[data-theme="dark"] .pen-input { background: #0f172a; color: #e2e8f0; border-color: #475569; }
body[data-theme="dark"] .round-label { color: #64748b; }
body[data-theme="dark"] .today-banner { background: linear-gradient(135deg,#422006,#451a03); border-color: #78350f; }
body[data-theme="dark"] .today-banner-title { color: #fbbf24; }
body[data-theme="dark"] .banner-tab.inactive { background: rgba(251,191,36,.12); color: #fbbf24; }
body[data-theme="dark"] .stat-card { background: rgba(251,191,36,.06); }
body[data-theme="dark"] .stat-value { color: #f8fafc; }
body[data-theme="dark"] .stat-label { color: #fbbf24; }
body[data-theme="dark"] .today-badge { background: #b45309; }
body[data-theme="dark"] .done-badge { background: #475569; }
body[data-theme="dark"] .footer { color: #475569; }
body[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.7); }
body[data-theme="dark"] .modal { background: #1e293b; color: #e2e8f0; }
body[data-theme="dark"] .modal-section-title { color: #f8fafc; }
body[data-theme="dark"] .modal-section-text { color: #94a3b8; }
body[data-theme="dark"] .modal-close { color: #64748b; }
body[data-theme="dark"] .modal-divider { border-color: #334155; }
body[data-theme="dark"] .list-view { color: #e2e8f0; }
body[data-theme="dark"] .ev-section { background: #0f172a; border-color: #334155; }
body[data-theme="dark"] .ev-text { color: #cbd5e1; }
body[data-theme="dark"] .ev-row { border-color: #1e293b; }
body[data-theme="dark"] .ev-goal { background: rgba(34,197,94,.08); }
body[data-theme="dark"] .detail-live-sync { background: linear-gradient(135deg,#450a0a,#7f1d1d); border-color: #991b1b; color: #fca5a5; }
body[data-theme="dark"] .detail-actions button { background: #334155; color: #cbd5e1; border-color: #475569; }
body[data-theme="dark"] .card-scorers { color: #64748b; }
body[data-theme="dark"] .standings-group { background: #1e293b; border-color: #334155; }
body[data-theme="dark"] .standings-table thead th { color: #64748b; border-color: #334155; }
body[data-theme="dark"] .st-row td { border-color: #0f172a; color: #94a3b8; }
body[data-theme="dark"] .st-team { color: #cbd5e1; }
body[data-theme="dark"] .st-pts { color: #f8fafc; }
body[data-theme="dark"] .st-row.qualified { background: rgba(34,197,94,.1); }
body[data-theme="dark"] .st-row.third { background: rgba(234,179,8,.08); }
body[data-theme="dark"] .st-row.eliminated { opacity: .4; }
body[data-theme="dark"] .thirds-table { background: #1e293b; border-color: #334155; }
body[data-theme="dark"] .hcard { background: #1e293b; border-color: #334155; }
body[data-theme="dark"] .hcard-name { color: #cbd5e1; }
body[data-theme="dark"] .hcard-score { color: #94a3b8; }
body[data-theme="dark"] .hcard-meta { color: #64748b; }
body[data-theme="dark"] .scorer-row { border-color: #1e293b; }
body[data-theme="dark"] .scorer-name { color: #cbd5e1; }
body[data-theme="dark"] .scorer-goals { color: #f8fafc; }
body[data-theme="dark"] .ranking-row { border-color: rgba(251,191,36,.06); }
body[data-theme="dark"] .ranking-name { color: #cbd5e1; }
body[data-theme="dark"] .ranking-pts { color: #f8fafc; }
body[data-theme="dark"] .timeline-step { background: #334155; color: #e2e8f0; }
body[data-theme="dark"] .dd-theme { background: none; border: 1px solid #e2e8f0; padding: 4px 8px; border-radius: 5px; font-size: 13px; cursor: pointer; }
body[data-theme="dark"] .nav-dropdown { background: #1e293b; }
body[data-theme="dark"] .dd-section { border-color: #334155; }
body[data-theme="dark"] .dd-row { color: #cbd5e1; }
body[data-theme="dark"] .dd-install { background: #334155; color: #cbd5e1; }
body[data-theme="dark"] .dd-help { border-color: #475569; color: #94a3b8; }
.dd-theme { background: none; border: 1px solid #334155; padding: 4px 8px; border-radius: 5px; font-size: 13px; cursor: pointer; }

/* SVG bracket dark mode */
body[data-theme="dark"] .bracket-wrap svg > rect:first-of-type { fill: #1e293b; }
body[data-theme="dark"] .bracket-wrap svg text { fill: #94a3b8; }
body[data-theme="dark"] .bracket-wrap svg line { stroke: #475569; }
body[data-theme="dark"] .bracket-wrap svg circle[fill="#fff"] { fill: #1e293b; }
body[data-theme="dark"] .bracket-wrap svg circle[fill="none"] { stroke: #475569; }

/* Match progress bar */
.match-progress {
	display: flex;
	gap: 2px;
	margin: 6px 0 8px;
	border-radius: 6px;
	overflow: hidden;
	height: 22px;
}
.mp-seg {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all .3s;
}
.mp-seg.done {
	background: #1e293b;
	color: #fff;
}
.mp-seg.active {
	background: #dc2626;
	color: #fff;
	animation: mpPulse 1.5s ease-in-out infinite;
}
.mp-seg.upcoming {
	background: #e2e8f0;
	color: #94a3b8;
}
.mp-label {
	font-size: 8px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}
@keyframes mpPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .7; }
}
body[data-theme="dark"] .mp-seg.done { background: #475569; }
body[data-theme="dark"] .mp-seg.upcoming { background: #334155; color: #64748b; }

.match-progress-wrap { position: relative; margin: 6px 0 8px; }
.mp-time { text-align: center; font-size: 20px; font-weight: 800; color: #dc2626; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.mp-cursor { position: absolute; bottom: 0; width: 3px; height: 28px; background: #dc2626; border-radius: 2px; transform: translateX(-1px); box-shadow: 0 0 6px rgba(220,38,38,.4); transition: left .5s ease; }
.mp-cursor::after { content: ''; position: absolute; bottom: -4px; left: -3px; width: 9px; height: 9px; background: #dc2626; border-radius: 50%; }
body[data-theme="dark"] .mp-time { color: #f87171; }
body[data-theme="dark"] .mp-cursor { background: #f87171; }
body[data-theme="dark"] .mp-cursor::after { background: #f87171; }

/* ═══ Stats View ═══ */
.stats-view-wrap { padding: 0 8px 20px; }
.stats-view { max-width: 480px; margin: 0 auto; }
.stats-tabs {
	display: flex; gap: 4px; margin-bottom: 12px; padding: 3px;
	background: #f1f5f9; border-radius: 10px; overflow-x: auto;
}
.stats-tab {
	flex: 1; padding: 7px 6px; border: none; border-radius: 8px;
	background: transparent; font-size: 11px; font-weight: 600;
	color: #64748b; cursor: pointer; white-space: nowrap; transition: all .2s;
}
.stats-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.stats-grid {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px;
}
.stats-kpi {
	background: linear-gradient(135deg, #fefce8, #fff7ed); border-radius: 10px;
	padding: 12px; text-align: center; border: 1px solid rgba(146,64,14,.08);
}
.stats-kpi-value { font-size: 24px; font-weight: 900; color: #0f172a; line-height: 1.1; }
.stats-kpi-label { font-size: 10px; font-weight: 600; color: #92400e; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.scoreline-list { margin-top: 6px; }
.scoreline-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.scoreline-score { font-weight: 800; color: #0f172a; width: 30px; text-align: center; font-size: 11px; }
.scoreline-bar-bg { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.scoreline-bar { height: 100%; background: linear-gradient(90deg, #f59e0b, #f97316); border-radius: 4px; min-width: 2px; transition: width .4s; }
.scoreline-count { font-size: 10px; color: #64748b; min-width: 55px; text-align: right; white-space: nowrap; }
.conf-list { margin-top: 6px; }
.conf-row { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid rgba(146,64,14,.06); font-size: 11px; }
.conf-row:last-child { border-bottom: none; }
.conf-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.conf-name { font-weight: 600; color: #334155; min-width: 0; white-space: nowrap; }
.conf-detail { margin-left: auto; font-size: 10px; color: #94a3b8; white-space: nowrap; }

/* Dark mode stats */
body[data-theme="dark"] .stats-tabs { background: #1e293b; }
body[data-theme="dark"] .stats-tab { color: #94a3b8; }
body[data-theme="dark"] .stats-tab.active { background: #334155; color: #f8fafc; box-shadow: none; }
body[data-theme="dark"] .stats-kpi { background: linear-gradient(135deg, #1c1917, #1e293b); border-color: rgba(251,191,36,.1); }
body[data-theme="dark"] .stats-kpi-value { color: #f8fafc; }
body[data-theme="dark"] .stats-kpi-label { color: #fbbf24; }
body[data-theme="dark"] .scoreline-score { color: #f8fafc; }
body[data-theme="dark"] .scoreline-bar-bg { background: #334155; }
body[data-theme="dark"] .conf-row { border-color: #1e293b; }
body[data-theme="dark"] .conf-name { color: #e2e8f0; }

/* Conf team sub-list */
.fi-16 { width: 16px; height: 12px; }
.conf-group { border-bottom: 1px solid rgba(146,64,14,.06); padding-bottom: 6px; margin-bottom: 2px; }
.conf-group:last-child { border-bottom: none; margin-bottom: 0; }
.conf-teams { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 2px 26px; }
.conf-team {
	display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 50%;
	border: 1.5px solid #10b981; background: rgba(16,185,129,.06);
	transition: opacity .2s;
}
.conf-team--elim { border-color: #ef4444; background: rgba(239,68,68,.06); opacity: .4; }
.conf-team--group { border-color: #94a3b8; background: rgba(148,163,184,.06); opacity: .35; }
.conf-team .fi { vertical-align: -1px; }
.conf-row { border-bottom: none; }
body[data-theme="dark"] .conf-group { border-color: #1e293b; }
body[data-theme="dark"] .conf-team { background: rgba(16,185,129,.1); }
body[data-theme="dark"] .conf-team--elim { background: rgba(239,68,68,.1); }
body[data-theme="dark"] .conf-team--group { background: rgba(148,163,184,.1); }

/* Conf team tooltip */
.conf-tip {
	position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
	background: #1e293b; color: #f8fafc; font-size: 10px; font-weight: 600;
	padding: 3px 7px; border-radius: 5px; white-space: nowrap; z-index: 10;
	pointer-events: none; animation: confTipIn .15s ease;
}
.conf-tip::after {
	content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
	border: 4px solid transparent; border-top-color: #1e293b;
}
@keyframes confTipIn { from { opacity: 0; transform: translateX(-50%) translateY(3px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
