:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e7ece9;
  --soft: #eef3f0;
  --green: #16a34a;
  --green-d: #15803d;
  --green-l: #dcfce7;
  --amber: #b45309;
  --amber-l: #fef3c7;
  --gold: #f59e0b;
  --red: #dc2626;
  --red-l: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px rgba(15, 23, 42, .05);
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1110;
    --card: #131b19;
    --text: #e8eeeb;
    --muted: #8a9a93;
    --line: #22302c;
    --soft: #1a2522;
    --green-l: #12341f;
    --amber-l: #3a2a0c;
    --red-l: #3b1616;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
[v-cloak] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h2 { font-size: 22px; letter-spacing: -.3px; }
h3 { font-size: 17px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 22px 0 10px; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.center-text { text-align: center; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--red); font-size: 14px; margin: 10px 0 0; }
.ok-text { color: var(--green); font-weight: 600; }
.warn-text { color: var(--amber); font-weight: 600; }

/* ---------- layout ---------- */
.shell { max-width: 560px; margin: 0 auto; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 14px; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 2px 10px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.logo img { width: 32px; height: 32px; border-radius: 9px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.me-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); padding: 0; overflow: hidden; background: var(--green-l); cursor: pointer; }
.me-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-btn .ini { font-size: 13px; font-weight: 700; color: var(--green-d); }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn:active { background: var(--soft); }
.badge { position: absolute; top: 2px; right: 0; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.foot { text-align: center; font-size: 12px; margin-top: 18px; opacity: .7; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 16px; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background .2s; background: var(--soft); color: var(--text);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--green-d); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.soft { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost-danger { background: transparent; border: 1px solid var(--red-l); color: var(--red); }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.btn.xl { width: 100%; padding: 18px; font-size: 19px; border-radius: 18px; letter-spacing: .2px; }
.btn.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ---------- formulários ---------- */
.form label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.form label:first-child { margin-top: 0; }
input:not([type=file]):not([type=checkbox]) {
  width: 100%; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg);
  outline: none; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
input.code { font-size: 28px; letter-spacing: 10px; text-align: center; font-weight: 700; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 4px; }
.hint.strong { color: var(--text); font-weight: 600; margin: 0 0 12px; }

/* ---------- login ---------- */
.splash { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 20px; }
.splash img { width: 72px; height: 72px; border-radius: 20px; }
.auth { max-width: 400px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top)) 18px 40px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand img { width: 76px; height: 76px; border-radius: 22px; box-shadow: 0 10px 30px rgba(22, 163, 74, .3); }
.brand h1 { font-size: 30px; letter-spacing: -.6px; margin-top: 14px; }
.brand p { color: var(--muted); margin-top: 4px; }

/* ---------- onboarding ---------- */
.onboard h2 { margin-bottom: 8px; }
.onboard .muted { margin-bottom: 16px; }
.photo-drop {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 10px; border-radius: 18px;
  border: 2px dashed color-mix(in srgb, var(--green) 45%, var(--line)); background: var(--green-l); color: var(--green-d); font-weight: 700; cursor: pointer;
}
.photo-drop svg { width: 38px; height: 38px; }
.big-av { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; display: block; margin: 4px auto 14px; box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line); }
.big-av.ini { display: grid; place-items: center; background: var(--green-l); color: var(--green-d); font-size: 36px; font-weight: 800; }

/* ---------- avisos ---------- */
.push-card { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; }
.push-card > svg { color: var(--green); width: 26px; height: 26px; }
.push-card b { font-size: 15px; }
.push-card p { font-size: 13px; color: var(--muted); }
.alert { display: flex; gap: 10px; background: var(--amber-l); color: var(--amber); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 14px 0; text-align: left; }
.alert svg { margin-top: 2px; }

/* ---------- pelada ---------- */
.hero { padding: 22px 20px; }
.hero.empty { text-align: center; padding: 36px 20px; }
.hero.empty .ball { font-size: 44px; margin-bottom: 8px; }
.hero.empty .btn { margin-top: 16px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chip { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--soft); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.chip.open { background: var(--green-l); color: var(--green-d); }
.chip.closed, .chip.done { background: var(--amber-l); color: var(--amber); }
.chip.open::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.count { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.date { font-size: 25px; letter-spacing: -.5px; }
.when { color: var(--muted); margin-top: 4px; font-size: 16px; }
.countdown { margin: 22px 0 18px; text-align: center; background: var(--soft); border-radius: 18px; padding: 16px 10px 14px; }
.countdown small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.digits { display: flex; justify-content: center; align-items: baseline; gap: 2px; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.digits b { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.digits i { font-style: normal; color: var(--muted); font-size: 15px; font-weight: 600; margin: 0 9px 0 2px; }
.digits i:last-child { margin-right: 0; }
.cta { margin-top: 6px; }
.mine { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--green-l); color: var(--green-d); cursor: pointer; }
.mine.wait { background: var(--amber-l); color: var(--amber); }
.mine img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.mine > div { flex: 1; }
.mine small { display: block; font-size: 13px; font-weight: 600; opacity: .85; }
.mine b { font-size: 21px; letter-spacing: -.3px; }
.mine .tap { font-size: 13px; font-weight: 700; opacity: .7; }

/* ---------- lista ---------- */
.list-card { padding: 16px 10px 12px; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 10px 8px; }
.wait-head { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; cursor: pointer; }
.plist li:active { background: var(--soft); }
.plist li.me { background: var(--green-l); }
.plist.waiting li.me { background: var(--amber-l); }
.pos { width: 22px; text-align: center; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; font-size: 15px; }
.waiting .pos { color: var(--amber); }
.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--soft); }
.av.lg { width: 56px; height: 56px; }
.av.ini { display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--green-d); background: var(--green-l); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nm { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.em { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backup p { font-size: 15px; margin-bottom: 8px; }
.crown { color: var(--gold); width: 17px; height: 17px; flex: none; }
.flag { color: var(--amber); width: 17px; height: 17px; }
.tm { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.empty-list { padding: 8px 10px 14px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--muted); padding: 12px 10px 2px; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- sheets ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(2, 6, 23, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 24px 24px 0 0; padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet.tall { height: 92dvh; max-height: 92dvh; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; cursor: pointer; }
.close { position: absolute; top: 10px; right: 10px; }
.sheet h2 { margin-bottom: 6px; padding-right: 36px; }
.player { text-align: center; }
.player h2 { padding: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.tag.mensalista { background: #fff7e0; color: #a16207; }
@media (prefers-color-scheme: dark) { .tag.mensalista { background: #33290f; color: #fcd34d; } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; text-align: left; margin: 20px 0 6px; background: var(--soft); border-radius: 16px; padding: 14px 16px; }
.facts:empty { display: none; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; word-break: break-word; }
.mini-log { text-align: left; margin-top: 8px; }
.mini-log p { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mini-log .mono { color: var(--muted); margin-right: 6px; }
.stars { display: inline-flex; gap: 2px; color: var(--line); }
.stars svg { width: 18px; height: 18px; }
.stars .on { color: var(--gold); }
.stars.sm svg { width: 13px; height: 13px; }
.stars.big { display: flex; gap: 6px; margin-bottom: 10px; }
.stars.big button { border: 0; background: var(--soft); border-radius: 12px; padding: 9px; color: var(--line); cursor: pointer; }
.stars.big button svg { width: 26px; height: 26px; }
.stars.big button.on { color: var(--gold); background: #fff7e0; }
@media (prefers-color-scheme: dark) { .stars.big button.on { background: #33290f; } }

.log { list-style: none; padding: 0; margin: 14px 0 0; }
.log li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.log .when { font-size: 12px; color: var(--muted); }
.log .who, .log .dev { font-size: 12px; }

.share-preview { width: 100%; border-radius: 14px; border: 1px solid var(--line); margin: 10px 0 4px; display: block; }

/* ---------- admin ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.tabs button { border: 0; background: var(--soft); padding: 8px 13px; border-radius: 99px; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { background: var(--text); color: var(--card); }
.tabs i { font-style: normal; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 6px; }
.pend { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pend b, .pend small { display: block; }
.row-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.search { margin-bottom: 8px; }
.ulist, .glist, .devs { list-style: none; padding: 0; margin: 0; }
.ulist li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ulist b { display: flex; align-items: center; gap: 5px; font-size: 15px; }
.pill { font-style: normal; font-size: 11px; font-weight: 700; background: var(--green-l); color: var(--green-d); padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .3px; }
.pill.gray { background: var(--soft); color: var(--muted); }
.adm-head { text-align: center; margin: 8px 0 4px; }
.adm-head h2 { padding: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 11px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.seg button.on { background: var(--card); box-shadow: var(--shadow); }
.card.inset { background: var(--soft); box-shadow: none; border: 0; }
.card.inset input { background: var(--card); }
.card.inset h4 { margin-top: 0; }
.glist li { display: flex; align-items: center; gap: 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.glist li.cur b { color: var(--green-d); }
.glist small { display: block; }
.devs li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dgroup { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dgroup p { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.link { color: var(--green-d); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- toast / spinner ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  background: var(--text); color: var(--card); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: up .2s;
}
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.fg { display: contents; }
.dd { display: contents; }

/* cadastro com foto */
.reg-photo { width: 148px; height: 148px; margin: 4px auto 0; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--green) 45%, var(--line)); background: var(--green-l); color: var(--green-d); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.reg-photo.ok { border: 3px solid var(--green); }
.reg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-photo .ph { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.reg-photo .ph svg { width: 32px; height: 32px; }
/* chave liga/desliga */
.switch-row { display: flex; align-items: center; gap: 14px; cursor: pointer; margin-bottom: 8px; }
.switch-row b { display: block; font-size: 15px; }
.switch-row small { display: block; font-size: 13px; margin-top: 2px; }
.switch-row input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 99px; background: #cbd5d1; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch-row input.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch-row input.switch:checked { background: var(--green); }
.switch-row input.switch:checked::before { transform: translateX(20px); }

.window { font-size: 13px; color: var(--muted); margin-top: 6px; }
.closed-msg { text-align: center; font-weight: 700; color: var(--amber); background: var(--amber-l); border-radius: 14px; padding: 14px; }
.form label small { font-weight: 500; }

.log .mask { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* diálogo do app */
.dlg-back { position: fixed; inset: 0; z-index: 30; background: rgba(2, 6, 23, .5); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.dlg { width: 100%; max-width: 360px; background: var(--card); border-radius: 22px; padding: 22px 20px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: scale(.94); opacity: .5; } }
.dlg h3 { font-size: 19px; margin-bottom: 8px; }
.dlg p { color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.dlg input { margin-top: 6px; }
.dlg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* goleiros */
.glove { color: #0284c7; width: 17px; height: 17px; flex: none; }
.pos.gk { display: grid; place-items: center; }
.pos.gk .glove { width: 18px; height: 18px; }
.keepers.waiting .glove { color: var(--amber); }
.gk-head h3 { display: flex; align-items: center; gap: 6px; }
.gk-head h3 .glove { width: 19px; height: 19px; }
.sub-head { padding-top: 10px; }
.gk-count { display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; }
.gk-count .glove { width: 15px; height: 15px; }
.btn.xl.keeper { background: #0284c7; }
.btn.xl.keeper.pulse { animation-name: pulse-gk; }
@keyframes pulse-gk { 0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, .45); } 70% { box-shadow: 0 0 0 14px rgba(2, 132, 199, 0); } 100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); } }
.btn.xl .glove { color: #fff; width: 22px; height: 22px; }
.mine.keeper { background: #e0f2fe; color: #0369a1; }
@media (prefers-color-scheme: dark) { .mine.keeper { background: #0c2a3d; color: #7dd3fc; } }
.tag.goleiro { background: #e0f2fe; color: #0369a1; }
