/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --bg4: #2b333d;
  --border: #30363d;
  --text: #f0f6fc;
  --text2: #aeb9c4;
  --green: #00e676;
  --red: #ff5c52;
  --yellow: #ffd23f;
  --blue: #58a6ff;
  --purple: #c77dff;
  --orange: #ff9d4d;
  --home: #58a6ff;
  --away: #ff5c52;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: 1700px; margin: 0 auto;
}
header h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
header h1 span { color: var(--green); }
.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg4); }
.icon-btn.muted { opacity: .5; }
.live-badge {
  background: #3a1a1a; color: var(--red); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; border: 1px solid var(--red);
  letter-spacing: 0.5px; animation: pulse 2s infinite; cursor: pointer;
  transition: background .15s, transform .12s;
}
.live-badge:hover { background: #5a2424; transform: translateY(-1px); }
.live-badge.loading { opacity: .6; pointer-events: none; }
.live-badge.flash-none { animation: none; background: var(--bg3); color: var(--text2); border-color: var(--border); }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.55 } }
.update-clock { color: var(--text2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ===== LAYOUT ===== */
.main-layout {
  display: grid; grid-template-columns: 230px 1fr 350px;
  max-width: 1700px; margin: 0 auto; min-height: calc(100vh - 52px);
}
@media (max-width: 1200px) { .main-layout { grid-template-columns: 210px 1fr 310px; } }
@media (max-width: 980px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar-left { display: none; }
  .sidebar-right { border-left: none !important; border-top: 1px solid var(--border); height: auto !important; position: static !important; }
}

/* ===== SIDEBARS ===== */
.sidebar-left, .sidebar-right {
  background: var(--bg2); padding: 12px; overflow-y: auto;
  height: calc(100vh - 52px); position: sticky; top: 52px;
}
.sidebar-left { border-right: 1px solid var(--border); }
.sidebar-right { border-left: 1px solid var(--border); }

.panel-title {
  font-size: 10px; font-weight: 700; color: var(--text2); letter-spacing: 1px;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ===== MATCH LIST ===== */
.match-list { display: flex; flex-direction: column; gap: 5px; }
.league-header {
  font-size: 9px; font-weight: 700; color: var(--text2); letter-spacing: 1px;
  text-transform: uppercase; padding: 10px 2px 4px; border-top: 1px solid var(--border); margin-top: 4px;
}
.league-header:first-child { border-top: none; margin-top: 0; }
.league-header.live-now {
  color: var(--red); background: linear-gradient(90deg, rgba(255,92,82,.16), transparent);
  border-radius: 5px; padding: 7px 6px; margin: 0 0 4px; border-top: none;
  display: flex; align-items: center; gap: 5px; font-size: 10px;
}
.league-header.live-now small { color: var(--text2); font-weight: 600; }
.match-card.is-live { border-color: rgba(255,92,82,.5); }
.match-card.is-live:hover { border-color: var(--red); }
.match-card.is-live.active { border-color: var(--green); }

.match-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px; cursor: pointer; transition: border-color .15s, background .15s;
}
.match-card:hover { border-color: var(--blue); background: #1c2333; }
.match-card.active { border-color: var(--green); background: #133024; }

.match-card-teams { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.match-card-team { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; flex: 1; min-width: 0; }
.match-card-team.away { flex-direction: row-reverse; text-align: right; }
.match-card-team img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.match-card-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-card-center { text-align: center; min-width: 56px; }
.match-card-score { font-size: 16px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.match-card-clock { font-size: 9px; color: var(--text2); margin-top: 2px; }
.live-dot { color: var(--red); font-size: 8px; animation: pulse 1.5s infinite; }
.wc-badge { font-size: 8px; color: var(--yellow); }

.loading-state { color: var(--text2); text-align: center; padding: 20px 8px; font-size: 13px; }
.loading-state.err { color: var(--red); }

/* ===== CENTER ===== */
.center-area { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ===== SCOREBOARD (maior + bandeiras) ===== */
.scoreboard {
  background: linear-gradient(135deg, #161b22 0%, #1c2333 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.sb-clock { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sb-status { font-size: 11px; color: var(--text2); letter-spacing: 1.4px; text-transform: uppercase; }
.sb-time-wrap { display: flex; align-items: baseline; gap: 8px; }
.sb-time {
  font-size: 34px; font-weight: 900; color: var(--red); line-height: 1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255,92,82,.35);
}
.sb-extra { font-size: 22px; font-weight: 900; color: var(--yellow); font-variant-numeric: tabular-nums; }
.sb-main { display: flex; align-items: center; gap: 22px; }
.sb-team { display: flex; align-items: center; gap: 14px; }
.sb-badge-wrap {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.4); flex-shrink: 0;
}
.sb-badge { width: 56px; height: 56px; object-fit: contain; }
.sb-team-name { font-size: 23px; font-weight: 800; min-width: 100px; }
.sb-team.home .sb-team-name { text-align: right; order: -1; }
.sb-team.away .sb-team-name { text-align: left; }
/* escudo do visitante junto ao placar (igual ao mandante); a sobra do min-width
   do nome vai p/ a borda externa, nunca fica entre o nome e a bandeira */
.sb-team.away .sb-badge-wrap { order: -1; }
.sb-score {
  font-size: 50px; font-weight: 900; color: var(--green); font-variant-numeric: tabular-nums;
  min-width: 130px; text-align: center; text-shadow: 0 0 26px rgba(0,230,118,.35); line-height: 1;
}
.sb-score em { font-size: 28px; font-style: normal; color: var(--text2); vertical-align: middle; margin: 0 6px; }
.sb-meta { font-size: 12px; color: var(--text2); }

/* ===== ÍNDICE DE DOMÍNIO ===== */
.dominance { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.dom-head { font-size: 11px; color: var(--text2); margin-bottom: 6px; text-align: center; }
.dom-head small { opacity: .7; }
.dom-bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; font-size: 13px; font-weight: 800; }
.dom-home, .dom-away { display: flex; align-items: center; padding: 0 10px; color: #fff; transition: width .8s ease; }
.dom-home { justify-content: flex-start; }
.dom-away { justify-content: flex-end; }

/* ===== APOSTAS ===== */
.betting {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px;
}
.bet-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.bet-btn {
  font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 6px;
  text-decoration: none; color: #fff; transition: transform .15s, filter .15s;
}
.bet-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.bet-btn.bet365 { background: #027b5b; }
.bet-btn.betfair { background: #ffb80c; color: #1a1a1a; }
.bet-disclaimer { font-size: 10px; color: var(--text2); margin-left: auto; opacity: .8; }

/* ===== CAMPO ===== */
.pitch-wrapper {
  position: relative; background: #1a3a18; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; align-items: center;
  justify-content: center; width: 100%; min-height: 300px;
}
#pitch-canvas { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.no-match-msg { text-align: center; color: var(--text2); padding: 60px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.no-match-icon { font-size: 64px; opacity: .3; }
.no-match-msg p { font-size: 15px; line-height: 1.6; }

.btn-cazetv {
  position: absolute; top: 10px; right: 10px; z-index: 8;
  background: rgba(220,38,38,.92); color: #fff; border: none; padding: 8px 13px;
  border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: transform .15s, background .15s; backdrop-filter: blur(4px);
}
.btn-cazetv:hover { background: rgba(239,68,68,1); transform: scale(1.05); }
.cazetv-dot { color: #fff; font-size: 9px; animation: pulse 1.3s infinite; }

/* CazéTV player */
.cazetv-player { position: relative; width: 100%; background: #000; }
.cazetv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.cazetv-iframe-wrap { position: relative; width: 100%; padding-bottom: 56.25%; }
.cazetv-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.btn-back-field { background: var(--bg3); color: var(--text); border: 1px solid var(--border); padding: 7px 12px; border-radius: 18px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-back-field:hover { background: var(--bg4); }
.cazetv-yt-link { color: var(--blue); font-size: 11px; text-decoration: none; }
.cazetv-yt-link:hover { text-decoration: underline; }

/* Comemoração de gol */
.goal-celebration {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(0,230,118,.28) 0%, rgba(13,17,23,.88) 75%);
  backdrop-filter: blur(2px);
}
.goal-text {
  font-size: clamp(44px, 9vw, 96px); font-weight: 900; color: var(--green); letter-spacing: 4px;
  text-shadow: 0 0 34px rgba(0,230,118,.85), 0 4px 10px rgba(0,0,0,.6); text-transform: uppercase;
  animation: goalPop .6s cubic-bezier(.18,.89,.32,1.28), goalShake 1.2s ease-in-out .6s;
}
.goal-scorer {
  font-size: clamp(18px, 3vw, 30px); font-weight: 800; color: #fff; margin-top: 10px;
  text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,.7);
  animation: fadeUp .5s ease .25s both;
}
@keyframes goalPop { 0% { transform: scale(0) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes goalShake { 0%,100% { transform: translateX(0) } 20% { transform: translateX(-8px) rotate(-2deg) } 40% { transform: translateX(8px) rotate(2deg) } 60% { transform: translateX(-5px) } 80% { transform: translateX(5px) } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ===== TABS ===== */
.tabs-area { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tab-buttons { display: flex; border-bottom: 1px solid var(--border); background: var(--bg3); }
.tab-btn { flex: 1; background: none; border: none; color: var(--text2); padding: 12px 0; font-size: 14px; font-weight: 600; cursor: pointer; transition: color .15s, background .15s; border-bottom: 2px solid transparent; }
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== NARRAÇÃO (fontes maiores + destaque) ===== */
.filter-btns { display: flex; gap: 4px; }
.filter-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 12px; cursor: pointer; }
.filter-btn.active { background: var(--green); color: #07120b; border-color: var(--green); }

.commentary-feed { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; height: calc(100vh - 120px); padding-right: 4px; scroll-behavior: smooth; }
.event-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 7px;
  background: var(--bg3); border-left: 3px solid var(--border); animation: slideIn .35s ease;
}
@keyframes slideIn { from { opacity:0; transform: translateY(-8px) } to { opacity:1; transform:none } }
.event-item.major { border-left-width: 5px; padding: 13px 14px; background: var(--bg4); }
.event-item.goal {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(0,230,118,.20) 0%, var(--bg4) 90%);
  box-shadow: inset 4px 0 16px rgba(0,230,118,.14);
}
.event-item.redcard { border-left-color: var(--red); background: rgba(255,92,82,.12); }
.event-item.yellowcard { border-left-color: var(--yellow); background: rgba(255,210,63,.10); }
.event-item.penalty { border-left-color: var(--orange); background: rgba(255,157,77,.12); }
.event-item.var { border-left-color: var(--purple); background: rgba(199,125,255,.12); }
.event-item.substitution { border-left-color: var(--blue); }
.event-item.foul { border-left-color: #d98a4a; }
.event-item.corner { border-left-color: #4db8a8; }
.event-item.offside { border-left-color: #d97aff; }
.event-item.throwin { border-left-color: var(--text2); }
.event-item.save { border-left-color: #5ad1c4; }

.event-minute { font-size: 13px; font-weight: 800; color: var(--text2); min-width: 34px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.event-icon { font-size: 19px; flex-shrink: 0; line-height: 1.2; }
.event-item.major .event-icon { font-size: 24px; }
.event-text { flex: 1; min-width: 0; }
.event-desc { font-size: 14px; line-height: 1.45; }
.event-item.major .event-desc { font-size: 15.5px; font-weight: 600; }
.event-item.goal .event-desc { font-weight: 800; color: var(--green); font-size: 16px; }
.event-tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,.12); margin-bottom: 4px;
}
.event-item.goal .event-tag { background: var(--green); color: #07120b; }
.event-item.redcard .event-tag { background: var(--red); color: #fff; }
.event-item.yellowcard .event-tag { background: var(--yellow); color: #1a1a1a; }
.event-item.penalty .event-tag { background: var(--orange); color: #1a1a1a; }
.event-item.var .event-tag { background: var(--purple); color: #fff; }

/* ===== STATS (fontes maiores + contraste) ===== */
.stats-container { padding: 14px 16px; display: flex; flex-direction: column; gap: 13px; }
.stats-team-labels { display: flex; justify-content: space-between; font-size: 15px; font-weight: 800; padding: 0 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.stat-row { display: flex; flex-direction: column; gap: 5px; }
.stat-label { display: flex; justify-content: space-between; font-size: 15px; align-items: center; }
.stat-home-val { font-weight: 800; min-width: 38px; font-size: 16px; }
.stat-away-val { font-weight: 800; min-width: 38px; text-align: right; font-size: 16px; }
.stat-name { color: var(--text); font-weight: 600; flex: 1; text-align: center; font-size: 13px; }
.stat-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--bg); }
.stat-bar-home { height: 100%; transition: width .8s ease; }
.stat-bar-away { height: 100%; margin-left: auto; transition: width .8s ease; }

/* ===== JOGADORES (com stats) ===== */
.players-container { padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
@media (max-width: 1200px) { .players-container { grid-template-columns: 1fr; } }
.players-team-title { font-size: 14px; font-weight: 800; letter-spacing: .3px; margin: 4px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 7px; }
.players-team-title .dot { width: 12px; height: 12px; border-radius: 50%; }
.players-sub-title { font-size: 11px; color: var(--text2); font-weight: 700; letter-spacing: .5px; padding: 8px 2px 2px; border-top: 1px solid var(--border); margin-top: 6px; }

.ptable-head, .player-row2 { display: grid; grid-template-columns: 24px minmax(0,1fr) repeat(6, 25px); gap: 2px; align-items: center; }
.ptable-head { font-size: 9.5px; color: var(--text2); font-weight: 700; padding: 2px 4px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.ptable-head span:nth-child(n+3) { text-align: center; }
.ptable-head .sortable { cursor: pointer; user-select: none; border-radius: 3px; transition: color .12s, background .12s; position: relative; }
.ptable-head .sortable:hover { color: var(--text); background: rgba(255,255,255,.06); }
.ptable-head .sortable.sorted { color: var(--green); }
.ptable-head .ph-name { text-align: left; }
.ph-arrow { font-size: 8px; margin-left: 1px; }
.player-row2 { padding: 5px 4px; border-radius: 5px; transition: background .15s; font-size: 13px; }
.player-row2:hover { background: var(--bg3); }
.player-row2.best { background: linear-gradient(90deg, rgba(255,210,63,.12), transparent 70%); }
.pr-num { color: var(--text2); font-weight: 700; text-align: right; }
.pr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.pr-name small { color: var(--text2); font-size: 10px; font-weight: 400; }
.pr-star { color: var(--yellow); font-size: 11px; flex-shrink: 0; }
.pr-stat { text-align: center; font-variant-numeric: tabular-nums; color: var(--text2); }
.pr-stat.hot { color: var(--green); font-weight: 800; }
.sub-in { color: var(--green); } .sub-out { color: var(--red); }

/* ===== TOASTS DE GOL ===== */
.toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: linear-gradient(135deg, #0d2618, #133024); border: 1px solid var(--green);
  border-radius: 10px; padding: 12px 16px; min-width: 260px; box-shadow: 0 6px 24px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 12px; animation: toastIn .4s cubic-bezier(.18,.89,.32,1.28);
}
.toast.out { animation: toastOut .4s ease forwards; }
@keyframes toastIn { from { transform: translateX(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(-120%); opacity: 0; } }
.toast-icon { font-size: 30px; animation: toastBall .8s ease infinite alternate; }
@keyframes toastBall { to { transform: translateY(-4px) rotate(15deg); } }
.toast-body { flex: 1; }
.toast-title { font-size: 12px; font-weight: 800; color: var(--green); letter-spacing: 1px; }
.toast-score { font-size: 15px; font-weight: 700; margin-top: 2px; }
.toast-league { font-size: 10px; color: var(--text2); margin-top: 1px; }

/* ===== REPLAY ===== */
.btn-replay {
  position: absolute; top: 10px; right: 10px; z-index: 8;
  background: rgba(0,230,118,.92); color: #07120b; border: none; padding: 8px 14px;
  border-radius: 20px; font-size: 12px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.45);
  backdrop-filter: blur(4px); transition: transform .15s, filter .15s;
}
.btn-replay:hover { transform: scale(1.05); filter: brightness(1.08); }
.btn-report {
  position: absolute; top: 10px; left: 10px; z-index: 8;
  background: rgba(13,17,23,.82); color: var(--text); border: 1px solid var(--border);
  padding: 8px 13px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px; backdrop-filter: blur(4px); transition: background .15s, transform .15s;
}
.btn-report:hover { background: rgba(43,51,61,.95); transform: scale(1.04); }

.replay-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  background: linear-gradient(0deg, rgba(13,17,23,.96) 60%, rgba(13,17,23,0));
  padding: 22px 12px 10px; display: flex; flex-direction: column; gap: 7px;
}
.rp-caption {
  font-size: 12.5px; color: var(--text); min-height: 17px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92;
}
.rp-bar { display: flex; align-items: center; gap: 10px; }
.rp-play, .rp-exit {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px;
  flex-shrink: 0; transition: background .15s; display: flex; align-items: center; justify-content: center;
}
.rp-play:hover, .rp-exit:hover { background: var(--bg4); }
.rp-play { background: var(--green); color: #07120b; border-color: var(--green); font-size: 15px; }
.rp-clock { font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; min-width: 44px; flex-shrink: 0; }
.rp-progress {
  position: relative; flex: 1; height: 8px; background: var(--bg4); border-radius: 5px;
  cursor: pointer; min-width: 60px;
}
.rp-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); border-radius: 5px; width: 0; pointer-events: none; }
.rp-markers { position: absolute; inset: 0; pointer-events: none; }
.rp-marker { position: absolute; top: -9px; transform: translateX(-50%); font-size: 11px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); }
.rp-speeds { display: flex; gap: 3px; flex-shrink: 0; }
.rp-speed {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  padding: 4px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all .12s;
}
.rp-speed:hover { color: var(--text); }
.rp-speed.active { background: var(--green); color: #07120b; border-color: var(--green); }
@media (max-width: 620px) {
  .rp-speed { padding: 3px 5px; font-size: 10px; }
  .rp-clock { min-width: 38px; font-size: 12px; }
}

/* ===== ALERTA REGRA 3.1 ===== */
.regra31-alert {
  --r31-color: var(--orange);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, rgba(255,157,77,.18), var(--bg2) 80%);
  border: 1px solid var(--r31-color); border-left: 5px solid var(--r31-color);
  border-radius: var(--radius); padding: 11px 16px;
}
.regra31-alert.r31-pulse { animation: r31pulse 1.1s ease 3; }
@keyframes r31pulse { 0%,100% { box-shadow: 0 0 0 rgba(255,157,77,0); } 50% { box-shadow: 0 0 18px rgba(255,157,77,.55); } }
.r31-icon { font-size: 26px; flex-shrink: 0; }
.r31-body { flex: 1; min-width: 0; }
.r31-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--r31-color); text-transform: uppercase; }
.r31-text { font-size: 14px; margin-top: 2px; color: var(--text); }
.r31-prob {
  font-size: 26px; font-weight: 900; color: var(--r31-color); font-variant-numeric: tabular-nums;
  flex-shrink: 0; text-shadow: 0 0 14px rgba(255,157,77,.4);
}

/* ===== MODAL HISTÓRICO ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.66);
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 640px; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.6); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 800; }
.modal-close { background: var(--bg3); border: 1px solid var(--border); color: var(--text); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.modal-close:hover { background: var(--bg4); }
.history-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.history-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text2); font-weight: 600; }
.history-filters input, .history-filters select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 7px 9px; font-size: 13px; font-family: inherit;
}
.history-filters input[type="text"] { min-width: 150px; }
.hist-btn { background: var(--green); color: #07120b; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 800; cursor: pointer; transition: filter .15s; }
.hist-btn:hover { filter: brightness(1.08); }
.hist-results { overflow-y: auto; padding: 10px 18px 18px; }
.hist-count { font-size: 12px; color: var(--text2); margin: 4px 0 10px; }
.hist-league-h { font-size: 10px; font-weight: 700; color: var(--text2); letter-spacing: 1px; text-transform: uppercase; margin: 12px 0 6px; }
.hist-card {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  margin-bottom: 6px; cursor: pointer; transition: border-color .15s, background .15s;
}
.hist-card:hover { border-color: var(--blue); background: #1c2333; }
.hist-team { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; min-width: 0; }
.hist-team.away { flex-direction: row-reverse; }
.hist-team img { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.hist-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-score { text-align: center; font-size: 17px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; min-width: 70px; }
.hist-score small { font-size: 9px; color: var(--text2); font-weight: 600; margin-top: 2px; }
@media (max-width: 560px) { .history-filters input[type="text"] { min-width: 110px; } }

/* ===== MODAL CONSULTA (IA local) ===== */
.ai-conv { padding: 16px 18px; overflow-y: auto; max-height: 50vh; display: flex; flex-direction: column; gap: 10px; min-height: 180px; }
.ai-msg { max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.ai-msg.bot { background: var(--bg3); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 3px; }
.ai-msg.user { background: var(--green); color: #07120b; font-weight: 600; align-self: flex-end; border-bottom-right-radius: 3px; }
.ai-input-row { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.ai-input-row input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.ai-input-row input:focus { outline: none; border-color: var(--green); }

/* ===== UTILS ===== */
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }
