/* Cores e tipografia do site nonstop.opa-sjm.com (tokens do OPA). Sempre modo claro. */
:root {
  color-scheme: light;
  --opa-cyan: #00b4e5;
  --opa-cyan-dark: #0096c0;
  --opa-cyan-light: #e6f8fd;
  --opa-black: #0a0a0a;
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --text: #0a0a0a;
  --muted: #495057;
  --subtle: #868e96;
  --line: #e6e8eb;
  --accent: #00b4e5;
  --accent-ink: #007aa0; /* azul OPA escurecido para texto legível em fundo branco */
  --accent-soft: #e6f8fd;
  --warn: #8a5a00;
  --warn-soft: #fdf1d8;
  --bad: #b3261e;
  --bad-soft: #fbe4e2;
  --whatsapp: #25d366;
  --radius: 6px;
  --radius-sm: 3px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .05);
  --shadow-md: 0 8px 24px rgba(10, 10, 10, .1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
h1 { font-size: 24px; line-height: 1.15; margin: 0 0 4px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 13px; margin: 0 0 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
h3 { font-size: 11px; margin: 18px 0 8px; color: var(--subtle); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- topo + menu (lona preta como no site) ---------- */
.bg-lona {
  background-color: #090909;
  background-image: url("/img/lona.svg");
  background-size: 56px 64px;
  background-repeat: repeat;
}
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.brand-logo { display: grid; place-items: center; background: #fff; padding: 2px 4px; border-radius: var(--radius-sm); }
.brand-logo img { height: 30px; width: auto; display: block; }
.brand-lockup { display: flex; flex-direction: column; line-height: 1.15; }
.brand-product { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.brand-product span { color: var(--opa-cyan); }
.brand-place { font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: #adb5bd; }
nav { display: flex; gap: 2px; }
nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: #adb5bd; font-weight: 500; font-size: 14px; }
nav a.active, nav a:hover { color: #fff; }
nav a.active { box-shadow: inset 0 -2px 0 var(--opa-cyan); }
.burger {
  display: none; position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  cursor: pointer; min-height: 0;
}
/* As 3 linhas partem do mesmo centro: o X fica sempre simétrico. */
.burger span {
  position: absolute; left: 11px; right: 11px; top: 50%; height: 2px; margin-top: -1px;
  border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease;
}
.burger span:nth-child(1) { transform: translateY(-7px); }
.burger span:nth-child(3) { transform: translateY(7px); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }

@media (max-width: 760px) {
  .burger { display: block; }
  nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 4px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: var(--shadow-md);
    display: none;
  }
  nav.open { display: flex; }
  nav a { padding: 14px 4px; font-size: 17px; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  nav a:last-child { border-bottom: 0; }
  nav a.active { box-shadow: none; color: var(--opa-cyan); }
}

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 96px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.back { display: inline-block; font-size: 14px; margin-bottom: 4px; padding: 4px 0; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stack > * + * { margin-top: 14px; }

/* ---------- listas (em vez de tabelas) ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; min-width: 0;
}
.row:last-child { border-bottom: 0; }
a.row:active, .row.click:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.row .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row .side { text-align: right; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.row.wrap { flex-wrap: wrap; }
.row .controls { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.row .controls select, .row .controls input { flex: 1 1 calc(50% - 3px); width: auto; min-width: 0; }
.badge {
  flex-shrink: 0; min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--opa-black); color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: var(--radius-sm);
}
.badge.low { background: var(--surface-2); color: var(--muted); }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); margin: 2px 3px 2px 0; white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); color: var(--accent-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- botões e formulários ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font: inherit; font-weight: 600; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
button.primary, .btn.primary { background: var(--opa-black); color: #fff; border-color: var(--opa-black); }
button.primary:active, .btn.primary:active { background: var(--opa-cyan-dark); border-color: var(--opa-cyan-dark); }
button.danger { color: var(--bad); }
button.sm, .btn.sm { min-height: 34px; padding: 5px 11px; font-size: 14px; }
.btn.wa { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; }
.btn.block, button.block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
label, .label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.form { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.form .wide { grid-column: 1 / -1; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; margin: 0; padding: 9px 14px; min-height: 42px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-weight: 500; font-size: 15px;
  cursor: pointer; user-select: none; background: var(--surface);
}
.checks input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.checks label:has(input:checked) { background: var(--opa-cyan); border-color: var(--opa-cyan); color: var(--opa-black); font-weight: 600; }

.toolbar { display: grid; gap: 8px; margin-bottom: 12px; }
.filters { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }

.sticky-save {
  position: sticky; bottom: 0; margin: 0 -16px -16px; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface) 75%, rgba(255, 255, 255, 0));
}
.sticky-save button { min-height: 52px; font-size: 17px; }

/* ---------- viabilidade ---------- */
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; position: relative; overflow: hidden; margin: 8px 0; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--warn); border-radius: 999px; }
.bar.ok > span { background: var(--opa-cyan); }
.bar .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .35; }
.big { font-size: 22px; font-weight: 800; }

.reasons { font-size: 12px; color: var(--muted); margin-top: 2px; }
.reasons .neg { color: var(--bad); }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); }

details > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "▾"; color: var(--muted); }
details[open] > summary::after { content: "▴"; }
details[open] > summary { margin-bottom: 12px; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 50;
  max-width: calc(100% - 32px);
}
.quick { max-width: 640px; margin: 0 auto; }

@media (min-width: 761px) {
  a.row:hover, .row.click:hover { background: var(--surface-2); }
  button:hover, .btn:hover { filter: brightness(.97); }
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--opa-cyan); outline-offset: -1px; border-color: var(--opa-cyan); }
.card { box-shadow: var(--shadow-sm); }

/* Vencedores: na mesma linha no computador, linha própria no telemóvel. */
.winners::before { content: " · "; }
@media (max-width: 760px) {
  .winners { display: block; margin-top: 2px; }
  .winners::before { content: none; }
}

/* Nível dos NonStops já jogados, junto ao nome. */
.pill.lvl { background: var(--opa-black); color: #fff; font-weight: 700; letter-spacing: .02em; vertical-align: 2px; }
h1 .pill.lvl { font-size: 12px; vertical-align: 4px; letter-spacing: 0; }

/* Camadas da convocatória */
.tier-summary { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.tier-summary .pill { font-weight: 600; cursor: pointer; }
.tier-title { scroll-margin-top: 76px; }
.tier-title { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--opa-black); color: var(--text); font-size: 12px; }
.tier-title span { background: var(--opa-black); color: #fff; border-radius: var(--radius-sm); padding: 1px 7px; font-size: 12px; }
details.tier { margin-top: 18px; }
details.tier > summary.tier-title { margin: 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
details.tier > summary.tier-title::after { content: none; }

/* Sugestões de NonStop */
.sugg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sugg-title { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.sugg-count { text-align: center; flex-shrink: 0; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px 10px; }
.sugg-count b { display: block; font-size: 24px; line-height: 1; }
.sugg-count span { font-size: 11px; color: var(--muted); }
.sugg-count.ok { background: var(--opa-cyan); }
.sugg-count.ok span { color: var(--opa-black); }
.sugg-names { margin-top: 8px; font-size: 13px; color: var(--text); }
a.pill { cursor: pointer; }
