/* ============================================================
   MBC — design system (base: TPC / NôStudy)
   Neutros, tipografia, raios e semáforo são FIXOS.
   Só o acento (--p-*, --btn, --acc-text) e a sombra são do clube:
   js/theme.js gera-os a partir das cores definidas em «Identidade do clube».
   ============================================================ */

:root {
  --bg: #FAF9F7; --surface: #FFFFFF; --surface-2: #F4F3F0; --border: #E8E8E8;
  --text: #1F2937; --text-2: #6B7280; --text-3: #9CA3AF;

  /* acento (valores por omissão = azul petróleo; substituídos por theme.js) */
  --p-50: #EEF6F8; --p-100: #D7EAF0; --p-200: #B7D8E3; --p-300: #92C2D2; --p-400: #69AABF; --p-500: #3B82A0; --p-600: #316D86; --p-700: #28576B;
  --btn: #316D86; --acc-text: #316D86; --chip-fg: #28576B; --on-btn: #FFFFFF;

  /* semáforo (fixo) */
  --ok: #8CDEC5; --ok-text: #0F5040; --warn: #E7C87A; --warn-text: #7A5500; --alert: #E7A4A4; --alert-text: #7A1E1E;

  --shadow-1: 0 2px 8px rgba(0, 0, 0, .06); --shadow-2: 0 4px 16px rgba(0, 0, 0, .08);
  --r-btn: 12px; --r-card: 16px; --r-modal: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[data-theme="dark"] {
  --bg: #111827; --surface: #1F2937; --surface-2: #273244; --border: #374151;
  --text: #F9FAFB; --text-2: #9CA3AF; --text-3: #6B7280;
  --p-50: #1C2F38; --p-100: #234150; --p-200: #2F5D72; --p-300: #92C2D2; --acc-text: #92C2D2; --chip-fg: #E6F2F6;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, .35); --shadow-2: 0 4px 16px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--p-400); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 8px 16px calc(100px + var(--safe-b)); outline: none; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.page { display: flex; flex-direction: column; gap: 20px; }

/* ---------- ícones ---------- */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 20px; height: 20px; } .ic.xs { width: 16px; height: 16px; } .ic.lg { width: 32px; height: 32px; } .ic.xl { width: 48px; height: 48px; }
.ic.fill { fill: currentColor; }

/* ---------- tipografia ---------- */
.h1 { font-size: 28px; font-weight: 700; line-height: 1.25; }
.h2 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.b600 { font-weight: 600; } .b500 { font-weight: 500; }
.sec { font-size: 14px; color: var(--text-2); }
.cap { font-size: 13px; color: var(--text-2); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.link { font-size: 14px; font-weight: 600; color: var(--acc-text); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.muted { color: var(--text-2); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- layout utilitário ---------- */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack.g12 { gap: 12px; } .stack.g16 { gap: 16px; } .stack.g24 { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.g8 { gap: 8px; } .row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- cabeçalhos de página ---------- */
.hdr { display: flex; align-items: center; gap: 12px; padding: 8px 0 8px; min-height: 60px; }
.hdr .brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--p-50); color: var(--acc-text); }
.icon-btn.fill { background: var(--surface); border: 1px solid var(--border); }
.dot { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: #D95C5C; border: 2px solid var(--bg); }
.count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #D95C5C; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

/* ---------- logótipos ---------- */
.logo { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--btn); color: var(--on-btn); font-weight: 700; font-size: 13px; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.logo.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.logo.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 17px; }
.logo.xl { width: 72px; height: 72px; border-radius: 20px; font-size: 21px; }
.tlogo { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.tlogo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tlogo.sm { width: 28px; height: 28px; font-size: 9px; } .tlogo.lg { width: 56px; height: 56px; font-size: 15px; } .tlogo.xl { width: 72px; height: 72px; font-size: 19px; }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.shadow { box-shadow: var(--shadow-1); }
.card.tint { background: var(--p-50); border-color: var(--p-100); }
.card.tap { cursor: pointer; transition: border-color .15s; display: block; }
.card.tap:hover { border-color: var(--p-300); }
.game { display: flex; flex-direction: column; gap: 12px; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.25; min-width: 0; }
.score { font-size: 30px; font-weight: 700; line-height: 1; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.score .lose { color: var(--text-2); font-weight: 600; }
.score .sep { color: var(--text-3); font-weight: 400; }
.score.big { font-size: 44px; }
.vs { font-size: 20px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.vs small { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }

/* linhas de jogo */
.day { font-size: 13px; font-weight: 600; color: var(--text-2); }
.gl { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.gl:first-child { border-top: none; }
a.gl:hover, button.gl:hover { background: var(--p-50); }
.gl-time { width: 50px; flex: none; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gl-teams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gl-t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; min-width: 0; }
.gl-t > .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-t.strong { font-weight: 700; }
.gl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.gl-score { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }

/* ---------- badges e chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge.ok { background: var(--ok); color: var(--ok-text); }
.badge.warn { background: var(--warn); color: var(--warn-text); }
.badge.alert { background: var(--alert); color: var(--alert-text); }
.badge.neutral { background: var(--p-50); color: var(--chip-fg); }
.badge.muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--alert-text); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; flex: none; cursor: pointer; }
.chip.active { background: var(--p-200); border-color: var(--p-200); color: var(--chip-fg); font-weight: 600; }

/* ---------- botões ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; padding: 0 24px; border: none; border-radius: var(--r-btn); background: var(--btn); color: var(--on-btn); font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.secondary { background: transparent; color: var(--acc-text); border: 1px solid var(--p-300); }
.btn.ghost { background: var(--p-50); color: var(--acc-text); }
.btn.danger { background: transparent; color: var(--alert-text); border: 1px solid var(--alert); }
[data-theme="dark"] .btn.danger { color: var(--alert); }
.btn.sm { height: 44px; width: auto; font-size: 14px; padding: 0 16px; }
.btn.inline { width: auto; }

/* ---------- tab bar (telemóvel) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; padding: 8px 8px calc(10px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--border); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 12px; font-size: 11px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.tab.active { color: var(--acc-text); font-weight: 600; }
.topnav, .sidenav { display: none; }

/* ---------- tabela de classificação ---------- */
.tbl { display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: 24px minmax(0, 1fr) 22px 22px 22px 40px 32px; align-items: center; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 14px; font-variant-numeric: tabular-nums; }
.tr.th { border-top: none; background: var(--surface-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-2); padding-top: 8px; padding-bottom: 8px; }
.tr.me { background: var(--p-50); font-weight: 600; }
.tr .c { text-align: center; } .tr .r { text-align: right; }
.tr .tn { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.tr.me .tn { font-weight: 700; }
.tr .tn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .tn .tlogo, .tr .tn .logo { display: none; }
.pos { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.pos.q { background: var(--p-100); color: var(--chip-fg); }
.pts { font-weight: 700; }

/* ---------- separadores ---------- */
.seg { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.seg > * { flex: 1; min-width: max-content; padding: 0 14px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.seg > .active { color: var(--acc-text); font-weight: 600; border-bottom-color: var(--btn); }
.pills { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.pills > * { flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); text-align: center; cursor: pointer; padding: 0 8px; }
.pills > .on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }

/* ---------- listas ---------- */
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); width: 100%; text-align: left; }
.lrow:first-child { border-top: none; }
a.lrow:hover, button.lrow:hover { background: var(--p-50); }
.lrow .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--p-50); color: var(--acc-text); display: inline-flex; align-items: center; justify-content: center; }
.lrow .ico.warn { background: var(--warn); color: var(--warn-text); }
.lrow .ico.ok { background: var(--ok); color: var(--ok-text); }
.lrow .t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.unread { width: 10px; height: 10px; border-radius: 50%; background: var(--btn); flex: none; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.input { display: flex; align-items: center; gap: 8px; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: 16px; color: var(--text); }
.input:focus, .input:focus-within { border-color: var(--p-400); outline: 3px solid var(--p-100); }
.input .ic { color: var(--text-2); }
.input input { flex: 1; min-width: 0; border: none; background: none; font: inherit; color: inherit; height: 100%; outline: none; }
input.input, select.input { display: block; }
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; line-height: 1.4; display: block; resize: vertical; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type="color"].input { padding: 4px; }
.input.readonly { background: var(--surface-2); color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-2); }
.err { font-size: 13px; color: var(--alert-text); background: color-mix(in srgb, var(--alert) 30%, transparent); border: 1px solid var(--alert); border-radius: 12px; padding: 10px 12px; }
[data-theme="dark"] .err { color: var(--alert); }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--border); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.switch.on { background: var(--btn); }
.switch.on::after { left: 21px; }
.avatar { position: relative; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--p-100); color: var(--chip-fg); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar .n { position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }
.avatar.lg .n { min-width: 32px; height: 32px; font-size: 15px; right: -6px; bottom: -2px; }
.avatar.priv { background: var(--surface-2); color: var(--text-3); }
.info { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--p-50); border: 1px solid var(--p-100); font-size: 13px; }
.info .ic { color: var(--acc-text); margin-top: 1px; }
.info.warn { background: color-mix(in srgb, var(--warn) 25%, transparent); border-color: var(--warn); }
.info.warn .ic { color: var(--warn-text); }
[data-theme="dark"] .info.warn .ic { color: var(--warn); }
.pergame { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.pergame th { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-2); text-align: center; padding: 6px 4px; }
.pergame td { padding: 8px 4px; text-align: center; border-top: 1px solid var(--border); }
.pergame td:first-child, .pergame th:first-child { text-align: left; }
.pergame .tot { font-weight: 700; }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty .ic { width: 48px; height: 48px; color: var(--p-300); margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- resultado (ecrã de campo) ---------- */
.big { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.step { display: flex; gap: 8px; width: 100%; }
.step button { flex: 1; height: 52px; border-radius: 12px; border: 1px solid var(--p-300); background: var(--surface); color: var(--acc-text); font-size: 17px; font-weight: 700; }
.step button.neg { border-color: var(--border); color: var(--text-2); }
.step button:active { transform: scale(.96); }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 16px 16px calc(20px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.actionbar > * { max-width: 448px; margin: 0 auto; width: 100%; }

/* ---------- modais, folhas e avisos ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s; }
.modal { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: var(--r-modal) var(--r-modal) 0 0; padding: 20px 20px calc(24px + var(--safe-b)); box-shadow: var(--shadow-2); }
.modal h3 { margin-right: 8px; }
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #1F2937; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-2); animation: fadein .15s; max-width: 420px; }
.toast.err { background: #7A1E1E; } .toast.ok { background: #0F5040; }

/* ---------- gestão: tabelas largas ---------- */
.dtable { display: flex; flex-direction: column; }
.drow { display: grid; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 14px; }
.drow.dth { border-top: none; background: var(--surface-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); padding-top: 10px; padding-bottom: 10px; }
a.drow:hover, button.drow:hover { background: var(--p-50); }
.swatch { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--border); }
.phone { width: 236px; height: 470px; border-radius: 28px; border: 1px solid var(--border); overflow: hidden; position: relative; }

/* ============================================================
   Tablet (≥ 768px): navegação com ÍCONES + texto no topo
   ============================================================ */
@media (min-width: 768px) {
  .tabbar { display: none; }
  .view { max-width: 920px; padding: 24px 32px 64px; }
  .brand-hdr { display: none; }   /* a marca está na barra do topo */
  .hdr { min-height: 0; padding-top: 0; }
  .topnav { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 40; height: 64px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topnav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-right: 12px; min-width: 0; }
  .topnav .brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
  .topnav nav { display: flex; align-items: center; gap: 4px; flex: 1; }
  .tnl { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--text-2); cursor: pointer; }
  .tnl:hover { background: var(--p-50); color: var(--acc-text); }
  .tnl.active { background: var(--p-100); color: var(--acc-text); font-weight: 600; }
  .tnl .ic { width: 22px; height: 22px; }
  .topnav .actions { display: flex; align-items: center; gap: 4px; }
  .grid2.md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: var(--r-modal); }
  .actionbar { left: auto; right: auto; position: static; border-top: none; background: none; padding: 0; }
  #toast-root { bottom: 32px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tnl span.lbl-t { display: none; }   /* tablet estreito: só ícones + texto curto abaixo */
}
@media (min-width: 900px) { .tnl span.lbl-t { display: inline; } }

/* Tablet estreito (768–899): mostra ícone + rótulo curto */
@media (min-width: 768px) and (max-width: 899px) {
  .tnl { padding: 0 10px; gap: 6px; font-size: 14px; }
  .tnl .lbl-t { display: inline !important; }
  .topnav .brand span:last-child { display: none; }
}

/* ============================================================
   Desktop (≥ 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .view { max-width: 1200px; padding: 32px 48px 72px; }
  .topnav { padding: 0 48px; }
  .cols { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
  .cols.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tr .tn .tlogo, .tr .tn .logo { display: inline-flex; }
  .tr { grid-template-columns: 28px minmax(0, 1fr) 36px 36px 36px 56px 44px; padding: 12px 16px; gap: 8px; }
}

/* ============================================================
   Gestão: barra lateral (tablet/desktop) e tab bar própria (telemóvel)
   ============================================================ */
.mg-only { display: none; }
body.mg .mg-only { display: block; }
body.mg .fan-only { display: none !important; }
@media (min-width: 768px) {
  body.mg .topnav { display: none; }
  body.mg #app { padding-left: 232px; }
  body.mg .sidenav { display: flex; flex-direction: column; gap: 4px; position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 40; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 12px; overflow-y: auto; }
  body.mg .sidenav .brandrow { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; }
  body.mg .sidenav .brandrow span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.mg .snl { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 500; cursor: pointer; flex: none; }
  body.mg .snl .ic { color: var(--text-2); }
  body.mg .snl:hover { background: var(--p-50); }
  body.mg .snl.active { background: var(--p-100); font-weight: 600; }
  body.mg .snl.active .ic { color: var(--acc-text); }
  body.mg .sidenav .sep { height: 1px; background: var(--border); margin: 8px 4px; flex: none; }
  body.mg .sidenav .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--border); }
  body.mg .sidenav .foot .grow { min-width: 0; }
  body.mg .view { max-width: 1100px; }
}
@media (min-width: 1024px) { body.mg #app { padding-left: 248px; } body.mg .sidenav { width: 248px; } }
@media (min-width: 768px) { body.mg .actionbar { position: static; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .tabbar, .topnav, .sidenav { display: none !important; } }

/* ---- importação da FPB ---- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--p-500); border-radius: inherit; transition: width .3s ease; }
.progress.indet > i { width: 40%; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.spin { animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pick-list { max-height: 340px; overflow: auto; }
.lrow.sel { background: var(--p-50); }
.lrow.sel .t { color: var(--acc-text); }
