/* ===== Tokens ===== */
/* Identidade: preto, vermelho e branco (cores do logo public/img/logo.svg). */
:root {
  --bg: #050505;
  --bg-2: #0e0e0e;
  --surface: #151515;
  --surface-2: #1f1f1f;
  --border: #2c2c2c;
  --text: #ffffff;
  --muted: #a3a3a3;
  --accent: #d84040;
  --accent-text: #ffffff;
  --danger: #ef4444;
  --warn: #f59e0b;
  --live: #ff2d2d;
  /* Fallbacks; views/partials/head.ejs overrides them with the colours from Admin > Configurações. */
  --primary: #d03a3a;
  --primary-text: #ffffff;
  --secondary: #000000;
  --secondary-text: #ffffff;
  --win: #19c37d;
  --lose: #ef4444;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --side-w: 264px;
  --slip-w: 336px;
}
:root[data-theme="light"] {
  --bg: #f3f3f3;
  --bg-2: #eaeaea;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --border: #dddddd;
  --text: #0a0a0a;
  --muted: #666666;
  --accent: #c62828;
  --accent-text: #ffffff;
  /* Status colours darkened for white backgrounds (WCAG AA 4.5:1; the dark-theme values gave 2.2–3.8:1 here). */
  --win: #0f7a4d;
  --lose: #c62828;
  --danger: #c62828;
  --warn: #a15c00;
  --live: #d50000;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { --bg: #f3f3f3; --surface: #fff; --text: #0a0a0a; }
}

* { box-sizing: border-box; }
/* Scrollbars: thin, in the site's colours (Firefox and Chrome use scrollbar-color; older WebKit the pseudo-elements). */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 65%, var(--surface-2)) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 65%, var(--surface-2)); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--primary); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
p a, .prose a, .small a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input[type="color"] { padding: 2px; height: 40px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.neg { color: var(--lose) !important; }
.pos { color: var(--win); }
.show-sm, .show-md { display: none !important; }
/* read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 600;
  white-space: nowrap; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.1); color: inherit; }
.btn-sm { padding: 6px 11px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* A link drawn as a button keeps its own colours inside tables and texts, whose plain links are coloured
   (without this, "Validar" or "Analisar" showed red text on a red button until the mouse was over it). */
.btn.btn-primary, .btn.btn-primary:hover { color: var(--primary-text); }
.btn.btn-accent, .btn.btn-accent:hover { color: var(--accent-text); }
.btn.btn-danger, .btn.btn-danger:hover { color: #fff; }
.btn.btn-ghost, .btn.btn-ghost:hover { color: var(--text); }
.icon-btn { background: transparent; border: 0; padding: 8px; border-radius: 8px; color: inherit; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.link-btn { background: none; border: 0; color: var(--muted); padding: 4px; font-size: .85rem; }
.link-btn:hover { color: var(--text); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px; font-size: .75rem;
  font-weight: 700; background: var(--surface-2); color: var(--text); text-align: center;
}
.pill-live { background: var(--live); color: #fff; }
.pill-warn { background: var(--warn); color: #111; }

/* ===== Header ===== */
.topbar { background: var(--secondary); color: var(--secondary-text); border-bottom: 3px solid var(--primary); position: sticky; top: 0; z-index: 30; box-shadow: var(--shadow); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .5px; color: inherit; }
.brand:hover { color: inherit; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar .btn-ghost, .topbar .btn.btn-ghost, .topbar .btn.btn-ghost:hover { border-color: rgba(255, 255, 255, .35); color: var(--secondary-text); }
.login-inline { display: flex; gap: 6px; align-items: center; }
.login-inline input { width: 130px; padding: 7px 10px; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: var(--secondary-text); }
.login-inline input::placeholder { color: rgba(255, 255, 255, .7); }
.user-box { display: flex; align-items: center; gap: 8px; }
.user-box form { margin: 0; }
.balance { display: flex; flex-direction: column; line-height: 1.1; text-align: right; color: inherit; }
.balance small { opacity: .75; font-size: .75rem; }
.mainnav {
  display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; background: var(--secondary);
  color: var(--secondary-text); scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { padding: 11px 14px; white-space: nowrap; font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; display: flex; gap: 7px; align-items: center; color: inherit; opacity: .85; }
.mainnav a:hover { opacity: 1; color: inherit; }
.mainnav a.active { border-bottom-color: var(--accent); opacity: 1; }

.flash { max-width: 1600px; margin: 12px auto 0; padding: 11px 16px; border-radius: var(--radius); font-weight: 500; width: calc(100% - 32px); }
.flash-success { background: rgba(25, 195, 125, .15); border: 1px solid rgba(25, 195, 125, .4); }
.flash-error { background: rgba(239, 68, 68, .15); border: 1px solid rgba(239, 68, 68, .4); }

/* ===== Layout ===== */
.layout {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--slip-w);
  gap: 22px; padding: 22px 24px; max-width: 1720px; margin: 0 auto; align-items: start;
}
.layout.no-slip { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.layout.no-side { grid-template-columns: minmax(0, 1fr) var(--slip-w); }
.layout.no-side.no-slip { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
/* empty slip: hidden until the first selection (the board takes its room) */
body.slip-off .slip, body.slip-off .slip-fab { display: none !important; }
body.slip-off .layout:not(.no-slip):not(.no-side) { grid-template-columns: var(--side-w) minmax(0, 1fr); }
body.slip-off .layout.no-side:not(.no-slip) { grid-template-columns: minmax(0, 1fr); }
.content { min-width: 0; }

/* ===== Sidebar ===== */
.sidebar { position: sticky; top: 112px; max-height: calc(100vh - 128px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.widget-title { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 7px; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form > input, .inline-form > select { flex: 1 1 160px; }
.inline-form .field { flex: 1 1 140px; }
.day-list { display: flex; flex-wrap: wrap; gap: 8px; }
.day-list a { padding: 6px 12px; border-radius: 99px; background: var(--surface-2); font-size: .82rem; text-transform: capitalize; }
.day-list a.active { background: var(--primary); color: var(--primary-text); }
.side-link { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 7px; font-size: .88rem; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link i { width: 16px; color: var(--muted); }
.side-link .count { margin-left: auto; font-size: .75rem; color: var(--muted); }

/* ===== Board ===== */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 16px; flex-wrap: wrap; }
.board-head h1 { margin: 0; display: flex; align-items: center; gap: 8px; }
.board-head select { width: auto; }
.search { position: relative; flex: 0 1 320px; }
.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.search input { padding-left: 32px; }
.league { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.league-head {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 16px;
  background: var(--surface-2); font-weight: 700; font-size: .88rem; gap: 10px;
}
.league-head i { color: var(--muted); margin-right: 4px; }
.league-cols { display: grid; gap: 6px; width: 228px; margin-right: 0; text-align: center; color: var(--muted); font-size: .78rem; }
.league-cols.cols-2 { grid-template-columns: repeat(2, 1fr); width: 150px; }
.league-cols.cols-3 { grid-template-columns: repeat(3, 1fr); }
.match { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); scroll-margin-top: 130px; }
.match:target { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.match:hover { background: var(--surface-2); }
.match-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; }
.match-info:hover { color: inherit; }
.match-time { display: flex; flex-direction: column; font-size: .78rem; width: 52px; flex-shrink: 0; text-align: center; font-weight: 600; }
.match-teams { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-weight: 600; }
.match-teams span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; justify-content: space-between; }
.score { color: var(--accent); min-width: 18px; text-align: right; }
.match-odds { display: grid; gap: 6px; width: 228px; flex-shrink: 0; }
.match-odds.cols-2 { grid-template-columns: repeat(2, 1fr); width: 150px; }
.match-odds.cols-3 { grid-template-columns: repeat(3, 1fr); }
.match-side { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
/* "Mais mercados": a full-width button under the odds, easy to spot and to tap */
.match-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .78rem; font-weight: 600; }
.match-more b { color: var(--accent); }
.match-more i { font-size: .7rem; color: var(--muted); }
.match-more:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--surface-2)); color: var(--text); }
.live-badge { color: #fff; background: var(--live); border-radius: 4px; padding: 1px 5px; font-size: .65rem; font-weight: 800; letter-spacing: .4px; display: inline-block; }
.minute { color: var(--live); font-weight: 700; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ===== Odd buttons ===== */
.odd {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px;
  min-height: 40px; transition: background .12s, border-color .12s, transform .08s;
}
.odd small { color: var(--muted); font-size: .75rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.odd strong { font-weight: 700; }
.odd:hover:not(:disabled) { border-color: var(--primary); }
.odd:active:not(:disabled) { transform: scale(.97); }
.odd.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.odd.active small { color: inherit; opacity: .85; }
.odd:disabled { opacity: .45; cursor: not-allowed; }
.odd:disabled strong::after { content: "\f023"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .75rem; }
.odd.flash-up { animation: up 1.2s; }
.odd.flash-down { animation: down 1.2s; }
@keyframes up { 0%, 60% { box-shadow: inset 0 0 0 2px var(--win); } }
@keyframes down { 0%, 60% { box-shadow: inset 0 0 0 2px var(--lose); } }

/* Days of the board, scrolled sideways (phones and tablets; the sidebar has the same list on wide screens). */
.day-strip { display: none; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 4px 0 6px; padding-bottom: 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip .chip { white-space: nowrap; flex-shrink: 0; padding: 7px 14px; text-transform: capitalize; scroll-snap-align: start; }

/* ===== Featured ===== */
.featured-block .section-title { margin-top: 0; }
.featured { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 18px; scroll-snap-type: x mandatory; }
.feature-card {
  scroll-snap-align: start; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #000));
  color: var(--primary-text); border: 1px solid rgba(255, 255, 255, .08);
}
.feature-card .muted { color: inherit; opacity: .75; }
.feature-card .match-more { background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .18); color: inherit; }
.feature-card .match-more b, .feature-card .match-more i { color: inherit; }
.feature-top { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.feature-top:hover { color: inherit; }
.feature-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .95rem; }
.feature-teams em { opacity: .6; font-size: .75rem; font-style: normal; }
.feature-card .match-odds { width: 100%; }
.feature-card .odd { background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .12); color: inherit; flex-direction: column; gap: 0; }
.feature-card .odd small { color: inherit; opacity: .75; }
.feature-card .odd.active { background: var(--accent); color: var(--accent-text); }

/* ===== Live games on the home (dark cards with the score, unlike the red featured ones) ===== */
.live-block .row-between { align-items: center; margin-bottom: 12px; }
.live-block .section-title { margin: 0; }
.live-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 18px; scroll-snap-type: x mandatory; }
.live-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--live); box-shadow: var(--shadow); }
.live-card[hidden] { display: none; }
.live-top { display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.live-top:hover { color: var(--text); }
.live-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-meta .live-badge, .live-meta .minute { white-space: nowrap; flex-shrink: 0; }
.live-league { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }
.live-team { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.live-team .team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.live-team .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-score { font-size: 1.25rem; color: var(--live); min-width: 22px; text-align: right; }
.live-card .match-odds { width: 100%; }

/* ===== Next day's featured games (end of the board) ===== */
.next-day { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.next-day .section-title { margin: 0; }
.next-day .row-between { align-items: center; margin-bottom: 14px; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.next-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .15s; }
.next-card:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }
.next-teams { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.next-teams .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.next-time { font-size: .82rem; color: var(--accent); font-weight: 700; }

/* ===== Game page ===== */
.game-hero {
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px; color: var(--primary-text);
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 45%, #000));
}
.game-hero .muted { color: inherit; opacity: .8; }
.hero-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 14px 0 8px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 1rem; }
img.crest { object-fit: contain; padding: 6px; background: rgba(255, 255, 255, .9); }
.crest { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .15); font-weight: 800; }
.hero-center { text-align: center; }
.hero-score { font-size: 2rem; font-weight: 800; }
.hero-date { font-size: 1.1rem; font-weight: 700; }
.market-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.market-tools .search { flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 5px 12px; font-size: .82rem; }
.chip.active, .chip:hover { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.markets { display: flex; flex-direction: column; gap: 10px; }
.market { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.market summary { list-style: none; padding: 11px 14px; font-weight: 700; display: flex; justify-content: space-between; cursor: pointer; }
.market summary::-webkit-details-marker { display: none; }
.market[open] summary i { transform: rotate(180deg); }
.market-odds { display: grid; gap: 6px; padding: 0 12px 12px; }
.market-odds.grid-2 { grid-template-columns: repeat(2, 1fr); }
.market-odds.grid-3 { grid-template-columns: repeat(3, 1fr); }
.odd-wide { min-height: 42px; }
.odd-wide small { white-space: normal; font-size: .8rem; color: var(--text); }

/* ===== Bet slip ===== */
.slip {
  position: sticky; top: 112px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 128px);
}
.slip-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 800; background: var(--primary); color: var(--primary-text); border-radius: var(--radius) var(--radius) 0 0; }
.slip-head .pill { background: rgba(255, 255, 255, .2); color: inherit; }
.slip-kinds { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.slip-kinds span { text-align: center; padding: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.slip-kinds span.active { color: var(--text); border-bottom-color: var(--accent); }
.slip-items { overflow-y: auto; flex: 1; min-height: 80px; }
.slip-empty { text-align: center; color: var(--muted); padding: 24px 16px; }
.slip-empty i { font-size: 1.6rem; }
.slip-item { padding: 10px 14px; border-bottom: 1px solid var(--border); position: relative; }
.slip-item .teams { font-weight: 700; font-size: .88rem; padding-right: 24px; }
.slip-item .meta { color: var(--muted); font-size: .75rem; }
.slip-item .pick { display: flex; justify-content: space-between; margin-top: 4px; font-size: .85rem; gap: 8px; }
.slip-item .pick b { color: var(--accent); }
.slip-item .pick span { display: block; text-align: center; padding: 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .85rem; cursor: pointer; }
.slip-item .remove { position: absolute; top: 8px; right: 8px; }
.slip-item.bad { background: rgba(239, 68, 68, .08); }
.slip-item .reason { color: var(--lose); font-size: .75rem; }
.slip-item .changed { color: var(--warn); font-size: .75rem; }
.slip-foot { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); }
.field-sm { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.quick-stakes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick-stakes button { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px; font-size: .8rem; font-weight: 600; }
.slip-summary { margin: 0; display: grid; gap: 4px; font-size: .85rem; }
.slip-summary div { display: flex; justify-content: space-between; }
.slip-summary dt { color: var(--muted); }
.slip-summary dd { margin: 0; font-weight: 700; }
.slip-summary .prize dd { color: var(--accent); font-size: 1.05rem; }
.slip-errors { color: var(--lose); font-size: .8rem; }
.slip-actions { display: flex; justify-content: space-between; }
.slip-fab {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; border: 0; border-radius: 12px; padding: 13px 16px;
  background: var(--accent); color: var(--accent-text); font-weight: 800; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow);
}
.slip-fab .pill { background: rgba(0, 0, 0, .2); color: inherit; }
.slip-fab strong { margin-left: auto; }

/* ===== Cards, forms, tables ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cards .card { margin: 0; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { color: var(--text); font-size: .95rem; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.auth-card { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.alert { padding: 11px 14px; border-radius: var(--radius); background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .4); margin-bottom: 12px; }
.alert-error { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.compact td { padding: 5px 8px; }
.table a { color: var(--accent); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: .78rem; }
.kv dd { margin: 0; font-weight: 600; }
.status { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); text-transform: capitalize; }
.status-ganho { background: rgba(25, 195, 125, .18); color: var(--win); }
.status-perdido, .status-cancelado { background: rgba(239, 68, 68, .16); color: var(--lose); }
.status-aberto, .status-pendente { background: rgba(245, 158, 11, .16); color: var(--warn); }
.status-cashout { background: rgba(56, 189, 248, .18); color: #38bdf8; }
.status-devolvido { background: rgba(120, 120, 140, .2); }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state i { font-size: 2.2rem; margin-bottom: 10px; }
.empty-state h1 { color: var(--text); }
.section-title { margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; line-height: 1.65; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

/* ===== Ticket ===== */
.ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

/* ===== modal / toast ===== */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 14px; padding: 22px; width: 100%; max-width: 420px; position: relative; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 8px; right: 8px; }
.modal-box h2 { padding-right: 30px; }
.install-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.big-code { font: 800 1.8rem ui-monospace, Consolas, monospace; letter-spacing: 3px; text-align: center; padding: 12px; background: var(--surface-2); border-radius: 10px; margin: 10px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 10px; z-index: 200; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.error { background: var(--danger); color: #fff; }

/* ===== Footer ===== */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 28px 16px 90px; margin-top: 24px; }
.footer-cols { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.footer h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.footer-cols a { display: block; padding: 3px 0; font-size: .88rem; }
.socials { display: flex; gap: 12px; font-size: 1.3rem; }
.footer-legal { max-width: 1200px; margin: 20px auto 0; color: var(--muted); font-size: .8rem; text-align: center; }
/* ===== Resultados (/resultados): finished games of a day ===== */
.results-head { flex-direction: column; align-items: stretch; }
.results-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.results-filter input[type="date"] { width: auto; }
.results-filter input[name="q"] { flex: 1 1 180px; }
.results-league { margin-bottom: 16px; }
.results-league-head { margin: 0; padding: 10px 14px; font-size: .9rem; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.result-card { display: grid; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-top: 0; }
.result-teams { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 10px; text-align: center; }
.result-names { display: flex; flex-direction: column; gap: 2px; }
.result-names small { color: var(--muted); }
.result-scores { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: .85rem; }
.result-scores div { display: flex; flex-direction: column; align-items: center; }
.result-scores dt { color: var(--muted); font-size: .75rem; }
.result-scores dd { margin: 0; font-weight: 700; }
.result-final dd { color: var(--accent); }

/* visual switch at the top (views/partials/visual-bar.ejs): in the header on wide screens, its own first row below 1100px */
.visual-bar { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .82rem; }
.visual-bar-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; opacity: .85; }
.visual-seg { display: inline-flex; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 99px; overflow: hidden; }
.visual-seg button { background: none; border: 0; color: inherit; padding: 5px 13px; font-weight: 600; white-space: nowrap; }
.visual-seg button + button { border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
.visual-seg button:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.visual-seg button[aria-current="true"] { background: var(--primary); color: var(--primary-text); }
.visual-bar-row { display: none; justify-content: center; padding: 7px 10px; background: var(--bg-2); color: var(--text); border-bottom: 1px solid var(--border); }
@media (max-width: 1100px) {
  .visual-bar-inline { display: none; }
  .visual-bar-row { display: flex; }
}
@media print { .visual-bar { display: none !important; } }

/* visual switch (footer, and the side menus of the SA visual) */
.visual-switch { display: flex; flex-direction: column; margin: 0; }
.visual-switch button { display: flex; align-items: center; gap: 7px; background: none; border: 0; padding: 3px 0; text-align: left; font-size: .88rem; color: inherit; }
.visual-switch button:hover { color: var(--accent); }
.visual-switch button[aria-current="true"] { color: var(--accent); font-weight: 700; }
.age { border: 2px solid var(--lose); color: var(--lose); border-radius: 50%; padding: 3px 4px; font-weight: 800; font-size: .7rem; margin-right: 6px; }

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  :root { --side-w: 220px; --slip-w: 300px; }
  .league-cols, .match-odds.cols-3 { width: 198px; }
}
@media (max-width: 1100px) {
  .layout, .layout.no-slip, .layout.no-side { grid-template-columns: minmax(0, 1fr) var(--slip-w); }
  .layout.no-slip, .layout.no-side.no-slip, body.slip-off .layout:not(.no-slip):not(.no-side) { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .day-strip { display: flex; }
}
@media (max-width: 860px) {
  .show-sm { display: inline-flex !important; }
  .hide-sm { display: none !important; }
  .layout, .layout.no-slip, .layout.no-side { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .login-inline { display: none; }
  .slip {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 60; max-height: 88vh; border-radius: 16px 16px 0 0;
    transform: translateY(105%); transition: transform .25s; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  }
  .slip.open { transform: none; }
  .slip-head { border-radius: 16px 16px 0 0; }
  .balance small { display: none; }
  .user-box .btn { padding: 6px 9px; }
}
@media (max-width: 600px) {
  .hide-xs { display: none; }
  .topbar-inner { gap: 6px; padding: 8px 10px; }
  .topbar-right, .user-box { gap: 4px; min-width: 0; }
  .balance strong { font-size: .9rem; }
  .match { flex-wrap: wrap; padding: 12px 14px; }
  .board-head .search { flex: 1 1 100%; }
  .match-info { flex: 1 1 100%; }
  .match-side { flex: 1 1 100%; }
  .match-odds, .match-odds.cols-3, .match-odds.cols-2 { flex: 1; width: auto; }
  .league-cols { display: none; }
  .grid-form, .grid-form.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .market-odds.grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-score { font-size: 1.6rem; }
}

@media print {
  .topbar, .sidebar, .slip, .footer, .ticket-actions, .board-head form, .slip-fab, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; }
}

/* ===== Ticket receipt ("Conferir bilhete"): the same coupon on screen and on paper ===== */
.receipt-wrap { max-width: 500px; margin: 0 auto; }
.receipt-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.receipt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.receipt-buttons form { margin: 0; }
.receipt-btn { width: 100%; justify-content: center; padding: 13px 14px; font-size: .95rem; border: 0; color: #fff; }
.receipt-green { background: #5cb85c; }
.receipt-green:hover { background: #4cae4c; color: #fff; }
.receipt-blue { background: #3b5fc9; }
.receipt-blue:hover { background: #2f4fb0; color: #fff; }
.receipt-red { background: #ef4444; }
.receipt-red:hover { background: #dc2626; color: #fff; }
.receipt { background: #f7ebc4; color: #111; padding: 18px 20px; border-radius: 2px; font: 15px/1.45 Helvetica, Arial, sans-serif; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.receipt p { margin: 0; color: #111; }
.receipt hr { border: 0; border-top: 1px dashed #333; margin: 9px 0; }
.receipt-center { text-align: center; display: flex; flex-direction: column; }
.receipt-site { font-size: 1.05rem; letter-spacing: .3px; }
.receipt-line { display: flex; justify-content: space-between; gap: 12px; }
.receipt-line span:last-child { text-align: right; white-space: nowrap; }
.receipt-item.item-ganho .receipt-status-ganho { color: #0a7d45; font-weight: 700; }
.receipt-item.item-perdido .receipt-status-perdido { color: #c62828; font-weight: 700; }
.receipt-score { color: #444; }
.receipt-note { font-size: .82rem; color: #0a7d45; }
.receipt-code { font-weight: 800; font-size: 1.1rem; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; }
.receipt-small { font-size: .85rem; }
.receipt-state { margin: 14px 0; padding: 13px; text-align: center; color: #fff; border-radius: 2px; font-weight: 600; background: #3b5fc9; }
.receipt-state-pendente { background: #d97706; }
.receipt-state-ganho { background: #15803d; }
.receipt-state-perdido, .receipt-state-cancelado { background: #b91c1c; }
.receipt-state-devolvido { background: #6b7280; }
.receipt-state-cashout { background: #0e7490; }
.ticket-page-head form .btn { white-space: nowrap; }

/* printing a receipt: only the coupon goes to the paper, in black on white */
@media print {
  /* everything but the path down to the coupon is left out, so nothing else takes paper */
  body.print-normal > *:not(.layout), body.print-thermal > *:not(.layout),
  body.print-normal .layout > *:not(.content), body.print-thermal .layout > *:not(.content),
  body.print-normal .content > *:not(.receipt-wrap), body.print-thermal .content > *:not(.receipt-wrap),
  body.print-normal .receipt-wrap > *:not(#ticket-print), body.print-thermal .receipt-wrap > *:not(#ticket-print) { display: none !important; }
  body.print-normal .layout, body.print-thermal .layout, body.print-normal .content, body.print-thermal .content,
  body.print-normal .receipt-wrap, body.print-thermal .receipt-wrap { display: block; padding: 0; margin: 0; max-width: none; width: auto; }
  body.print-normal #ticket-print, body.print-thermal #ticket-print { background: #fff !important; box-shadow: none; border-radius: 0; color: #000; margin: 0; }
  body.print-normal #ticket-print { width: 120mm; padding: 4mm 6mm; font-size: 12.5pt; }
  body.print-thermal #ticket-print { page: thermal; width: 72mm; padding: 0; font: 9.5pt/1.3 ui-monospace, Consolas, "Courier New", monospace; }
  body.print-thermal #ticket-print .receipt-small, body.print-thermal #ticket-print .receipt-note { font-size: 8.5pt; }
  body.print-normal #ticket-print p, body.print-thermal #ticket-print p, body.print-normal #ticket-print *, body.print-thermal #ticket-print * { color: #000 !important; }
  body.print-normal #ticket-print hr, body.print-thermal #ticket-print hr { border-top-color: #000; }
  body.print-normal, body.print-thermal { background: #fff !important; }
}
@page thermal { size: 80mm auto; margin: 2mm 3mm; }

/* ===== Super Dicas ===== */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tip h3 { display: flex; gap: 8px; align-items: center; }
.tip-items { list-style: none; padding: 0; margin: 8px 0; }
.tip-items li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tip-items li.closed { opacity: .5; }


/* ===== Logo & banners ===== */
.brand-logo { height: 38px; width: auto; max-width: 200px; object-fit: contain; }
/* Built-in logo has white letters on transparent: keep it on black where the background may be light. */
.brand-logo.on-dark { background: #000; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }
.brand-logo.big { height: 64px; max-width: 280px; margin-bottom: 12px; }
@media (max-width: 600px) { .topbar .brand-logo { height: 30px; } }
.banners { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 14px; border-radius: var(--radius); }
.banners > * { scroll-snap-align: start; }
.banners img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; border-radius: var(--radius); display: block; }

/* ---------- pagamento antecipado ---------- */
.early-badge { margin: 10px auto 0; width: fit-content; max-width: 100%; display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--win); color: var(--text); border-radius: 99px; padding: 5px 12px; font-size: .82rem; font-weight: 600; }
.early-badge i, .early-tag i, .early-note i, .badge-early i { color: var(--win); }
/* the early payout tag: icon and "PA +2" together, as one small pill */
.early-tag { font-size: .68rem; font-weight: 700; color: var(--win); display: inline-flex; gap: 3px; align-items: center; padding: 1px 7px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--win) 45%, transparent); background: color-mix(in srgb, var(--win) 12%, transparent); width: fit-content; line-height: 1.5; }
.match-teams .early-tag { display: inline-flex; justify-content: flex-start; gap: 3px; margin-top: 2px; }
.early-note { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.badge-early { display: inline-flex; gap: 5px; align-items: center; font-size: .72rem; font-weight: 600; color: var(--muted); }

/* ---------- criar aposta ---------- */
.builder-toggle { align-self: flex-start; }
.builder-toggle[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.builder-mode .market[data-builder-ok="0"] { opacity: .45; }
.odd.builder-picked { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.odd.builder-picked small { color: inherit; opacity: .85; }
.builder-bar { position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin-top: 12px; }
.builder-bar[hidden] { display: none; }
.builder-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.builder-info [data-builder-legs] { overflow-wrap: anywhere; }
.builder-actions { display: flex; gap: 10px; align-items: center; }
.builder-price { font-size: 1.2rem; font-weight: 800; min-width: 48px; text-align: right; }

/* ---------- escudos e ligas favoritas ---------- */
.league-head .league-name { flex: 1; min-width: 0; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-head .league-name:hover { color: var(--accent); }
.fav-btn { background: none; border: 0; padding: 4px 6px; color: var(--muted); font-size: .95rem; line-height: 1; border-radius: 6px; flex-shrink: 0; }
.fav-btn:hover { color: var(--warn); }
.fav-btn[aria-pressed="true"] { color: var(--warn); }
.fav-btn[aria-pressed="true"] i { font-weight: 900; }
.league-head .fav-btn i { margin-right: 0; color: inherit; }
.match-teams .team { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.match-teams .team-name { overflow: hidden; text-overflow: ellipsis; }
.crest-sm { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
/* team without a crest (or a broken image): a grey shield of the same size */
.crest-none { display: inline-grid; place-items: center; color: #8a8a8a; flex-shrink: 0; }
.crest-sm.crest-none { font-size: .85rem; }
.crest.crest-none { font-size: 1.5rem; background: rgba(255, 255, 255, .9); color: #9a9a9a; }
