/* ============ VoleiApp — estilos ============ */
:root {
  --bg: #04202f;
  --page: linear-gradient(160deg, #04202f, #07334a 55%, #0b4d68);
  --surface: rgba(255, 255, 255, .07);
  --surface-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .2);
  --text: #f7f3ea;
  --muted: #a9c0cc;
  --a: #ee6a1c;
  --b: #4cc3f1;
  --accent: #f2d49b;
  --on-accent: #06202e;
  --g1: rgba(255, 255, 255, .15);
  --g2: rgba(255, 255, 255, .06);
  --gb: rgba(255, 255, 255, .2);
  --bar: rgba(4, 32, 47, .35);
  --dlg: rgba(8, 44, 64, .6);
  --bgfx: .75;
  --radius: 22px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4e6c8;
  --page: linear-gradient(160deg, #f8ecd0, #f0dcae 55%, #bfe1ea);
  --surface: rgba(255, 255, 255, .5);
  --surface-2: rgba(255, 255, 255, .55);
  --line: rgba(255, 255, 255, .85);
  --text: #12303f;
  --muted: #55707d;
  --a: #e25a10;
  --b: #0a7ea4;
  --accent: #9a6b12;
  --g1: rgba(255, 255, 255, .8);
  --g2: rgba(255, 255, 255, .35);
  --gb: rgba(255, 255, 255, .95);
  --bar: rgba(248, 236, 208, .5);
  --dlg: rgba(255, 250, 238, .75);
  --bgfx: .5;
  --on-accent: #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
  overflow-x: hidden;
  background-image: var(--page);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---- Views ---- */
#app { min-height: 100dvh; }
.view { min-height: 100dvh; display: flex; flex-direction: column; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---- Botões ---- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .ico { width: 22px; height: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 46px; padding: 0 1.1rem; border-radius: 14px; font-weight: 700;
  transition: transform .15s var(--ease), filter .2s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--a); color: #fff; }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn--accent { background: var(--b); color: #04141b; }
:root[data-theme="light"] .btn--accent { color: #fff; }
.btn--accent:hover:not(:disabled) { filter: brightness(1.08); }
.btn--ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn--square { width: 46px; padding: 0; }
.btn--xl { width: 100%; min-height: 58px; font-size: 1.15rem; border-radius: 18px; }
.btn--wa { font-size: 1.05rem; }
.btn--wa .ico { width: 1.55em; height: 1.55em; color: #25d366; }

/* ---- Início ---- */
.home-top { display: flex; justify-content: flex-end; padding: max(16px, env(safe-area-inset-top)) 16px 0; }
.home-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px 20px 48px; gap: 10px;
}
/* Assinatura do time, no rodapé: "By" + logo */
.team-by { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 1.05rem; }
.team-logo { width: clamp(48px, 12dvh, 96px); height: auto; filter: drop-shadow(0 8px 14px rgba(0, 10, 20, .45)); }

/* A tela inicial cabe inteira, sem rolagem: tamanhos e espaços acompanham a altura */
#view-home { animation-name: fadeIn; } /* só opacidade: o deslocamento padrão criaria rolagem por um instante */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#view-home .home-center { padding-bottom: min(48px, 4dvh); }
#view-home .brand { font-size: clamp(2.4rem, min(15vw, 12dvh), 6.5rem); }
#view-home .home-actions { margin-top: min(30px, 3.5dvh); }
#view-home .big-btn { min-height: clamp(48px, 10dvh, 76px); }
.brand { font-size: clamp(3.4rem, 15vw, 6.5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; display: flex; }
.brand span { color: var(--text); }
.brand .app { color: var(--a); }
.tagline { margin-top: 4px; }

/* Abertura: escreve VoleiApp no centro, brilha e revela as opções */
.intro .brand { animation: brandRise .9s var(--ease) 1.9s backwards; }
.intro .brand span { animation: write .35s var(--ease) calc(var(--n) * .13s + .2s) backwards, shine 1s ease-in-out 1.1s; }
.intro .tagline { animation: fadeUp .6s var(--ease) 2.3s backwards; }
.intro .home-actions { animation: fadeUp .6s var(--ease) 2.5s backwards; }
.intro .credits { animation: fadeUp .6s var(--ease) 2.7s backwards; }
@keyframes write { from { opacity: 0; transform: translateY(14px) scale(.7); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes shine { 50% { text-shadow: 0 0 22px currentColor, 0 0 60px currentColor; transform: scale(1.06); } }
@keyframes brandRise { from { transform: translateY(var(--shift, 110px)) scale(1.3); } to { transform: none; } }
html.no-scroll, html.no-scroll body { overflow: hidden; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.intro .brand { --shift: 110px; }
.intro .team-by { animation: fadeUp .6s var(--ease) 2.7s backwards; }

/* Telas baixas e largas (celular deitado): nome, frase e logo à esquerda, botões à direita */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  #view-home {
    position: relative; display: grid; padding: 0 20px; column-gap: 24px; justify-items: center;
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr auto auto auto 1fr auto;
  }
  /* o botão de tema flutua no canto para não gastar uma linha inteira */
  #view-home .home-top { position: absolute; top: 0; right: 0; z-index: 1; }
  #view-home .home-center { display: contents; } /* nome, frase e botões entram direto na grade */
  #view-home .brand { grid-area: 2 / 1; font-size: clamp(2rem, min(8vw, 15dvh), 5rem); }
  #view-home .tagline { grid-area: 3 / 1; text-align: center; }
  #view-home .team-by { grid-area: 4 / 1; margin-top: min(14px, 3dvh); }
  #view-home .team-logo { width: clamp(56px, 22dvh, 120px); }
  #view-home .home-actions { grid-area: 2 / 2 / span 3; align-self: center; margin-top: 0; }
  #view-home .big-btn { min-height: clamp(48px, 17dvh, 76px); }
  #view-home .credits { grid-area: 6 / 1 / auto / -1; text-align: center; padding-block: 4px max(8px, env(safe-area-inset-bottom)); }
  .intro .brand { --shift: 24px; }
}
.tagline { color: var(--muted); font-size: clamp(1rem, 3.6vw, 1.25rem); }
.home-actions { margin-top: 30px; width: min(100%, 420px); display: grid; gap: 14px; }
.big-btn {
  display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 76px; padding: 0 22px;
  border-radius: 24px; font-size: 1.3rem; font-weight: 800; color: #fff;
  transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
}
.big-btn .ico { width: 30px; height: 30px; }
.big-btn { letter-spacing: .01em; }
.big-btn--a { background: var(--a); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -14px rgba(0, 0, 0, .6); }
.big-btn--b { background: var(--surface); color: var(--text); border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent); }
.big-btn--b:hover { border-color: var(--b); }
.big-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.big-btn:active { transform: scale(.97); }

.credits { display: grid; gap: 2px; text-align: center; color: var(--muted); font-size: .8rem; padding: 12px 16px max(20px, env(safe-area-inset-bottom)); }
.credits span:first-child:not(:last-child) { font-weight: 700; }

/* ---- Barra superior ---- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(var(--bg) 60%, transparent);
}
.topbar h2 { flex: 1; font-size: 1.25rem; font-weight: 800; text-align: center; }
.topbar-spacer { width: 44px; }
.topbar-brand { flex: 1; text-align: center; font-weight: 900; letter-spacing: -.02em; color: var(--muted); }
.topbar-brand span { color: var(--a); }

/* ---- Sorteio ---- */
.sorteio-body { width: min(100%, 760px); margin: 0 auto; padding: 4px 16px max(32px, env(safe-area-inset-bottom)); display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.card h3, .result h3 { font-size: 1.05rem; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { font-size: .8rem; font-weight: 700; padding: 5px 12px; border-radius: 99px; background: var(--surface-2); color: var(--accent); }
.add-row { display: flex; gap: 10px; }
.add-row input, .dlg-field input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .2s;
}
.add-row input:focus, .dlg-field input:focus { border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 25%, transparent); }
.mini-actions { display: flex; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted); transition: color .2s, transform .15s; }
.chip:hover { color: var(--text); }
.chip:active { transform: scale(.94); }
.chip:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.player-list { list-style: none; display: grid; gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.player { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; animation: pop .3s var(--ease); }
.player.off .p-name { opacity: .45; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.check { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; min-height: 40px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; transition: all .18s var(--ease); }
.box::after { content: ""; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0) translateY(-1px); transition: transform .18s var(--ease); }
.check input:checked + .box { background: var(--a); border-color: var(--a); }
.check input:checked + .box::after { transform: rotate(-45deg) scale(1) translateY(-1px); }
.check input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mini-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); transition: color .2s, background .2s, transform .15s; }
.mini-btn:hover { background: var(--surface); color: var(--text); }
.mini-btn.danger:hover { color: #ff5470; }
.mini-btn:active { transform: scale(.9); }
.empty { color: var(--muted); text-align: center; padding: 8px 0; font-size: .95rem; }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg { height: 54px; border-radius: 16px; background: var(--surface-2); border: 2px solid transparent; font-size: 1.4rem; font-weight: 800; color: var(--muted); transition: all .2s var(--ease); }
.seg:hover { color: var(--text); }
.seg[aria-checked="true"] { border-color: var(--a); color: var(--a); background: color-mix(in srgb, var(--a) 14%, var(--surface-2)); transform: translateY(-2px); }

.result { display: grid; gap: 14px; }
.hint { color: var(--muted); font-size: .9rem; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.team {
  --c: var(--a); position: relative; padding: 16px; border-radius: 22px; text-align: left;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 26%, var(--surface)), var(--surface) 70%);
  border: 2px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.team-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.team-title strong { color: var(--c); font-size: 1.15rem; font-weight: 900; }
.team-tag { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--c); color: #0b0d14; opacity: 0; transform: scale(.7); transition: all .2s var(--ease); }
.team[aria-pressed="true"] .team-tag { opacity: 1; transform: none; }
.team ul { list-style: none; display: grid; gap: 6px; }
.team li { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team--bench { --c: var(--muted); cursor: default; }
.team--bench:hover { transform: none; }
.teams-grid.shuffling .team { animation: wobble .18s linear infinite; }
.teams-grid.shuffling .team:nth-child(even) { animation-direction: reverse; }
@keyframes wobble { 0% { transform: rotate(-1.2deg) scale(1.01); } 50% { transform: rotate(1.2deg) scale(.99); } 100% { transform: rotate(-1.2deg) scale(1.01); } }
.teams-grid.reveal .team { animation: reveal .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(26px) scale(.85) rotate(-3deg); } to { opacity: 1; transform: none; } }

/* ---- Placar ---- */
#view-placar { height: 100dvh; min-height: 0; overflow: hidden; }
.topbar--slim { padding-bottom: 4px; background: none; position: static; }
.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 2vw, 18px); padding: 6px clamp(8px, 2vw, 18px); }
.side {
  --c: var(--a); min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), var(--surface);
  border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
  position: relative; isolation: isolate;
}
#side-b { --c: var(--b); }
.side::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none;
  box-shadow: inset 0 0 90px 10px var(--c); background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--c) 35%, transparent), transparent 65%);
}
.side.glow::after { animation: glow .45s ease-out; }
@keyframes glow { 0% { opacity: .9; } 100% { opacity: 0; } }
.side-name {
  padding: 14px 10px 4px; text-align: center; font-weight: 800; color: var(--c);
  font-size: clamp(1rem, 4.5vw, 2.1rem); letter-spacing: .02em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.score-btn { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; user-select: none; -webkit-user-select: none; border-radius: 0; }
.score-btn:focus-visible { outline-offset: -6px; }
.score-num {
  --fs: min(29vw, 52vh);
  font-size: var(--fs); font-weight: 900; line-height: 1; color: var(--c);
  font-variant-numeric: tabular-nums; letter-spacing: -.04em;
  text-shadow: 0 0 40px color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform .12s var(--ease); display: block;
}
.score-num[data-len="3"] { --fs: min(23vw, 40vh); }
.score-btn:active .score-num { transform: scale(.94); }
.score-num.bump { animation: bump .28s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }

.controls { display: flex; justify-content: center; gap: clamp(4px, 2vw, 14px); padding: 8px 8px max(12px, env(safe-area-inset-bottom)); }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 8px 10px; border-radius: 14px; color: var(--muted); font-size: .72rem; font-weight: 600; transition: color .2s, background .2s, transform .15s; }
.ctrl:hover { color: var(--text); background: var(--surface); }
.ctrl:active { transform: scale(.92); }
.ctrl:disabled { opacity: .35; cursor: not-allowed; }
.ctrl .ico { width: 22px; height: 22px; }

@media (max-height: 460px) {
  .topbar--slim { padding-top: 6px; }
  .topbar--slim .icon-btn { width: 36px; height: 36px; }
  .side-name { padding-top: 8px; }
  .score-num { --fs: min(26vw, 58vh); }
  .score-num[data-len="3"] { --fs: min(19vw, 46vh); }
  .ctrl { flex-direction: row; gap: 6px; padding: 6px 10px; }
}

/* ---- Diálogo ---- */
dialog { margin: auto; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--text); width: min(92vw, 400px); padding: 0; }
dialog::backdrop { background: rgba(5, 7, 14, .65); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s var(--ease); }
#dlg-form { padding: 22px; display: grid; gap: 14px; }
#dlg-title { font-size: 1.2rem; font-weight: 800; }
.dlg-msg { color: var(--muted); }
.dlg-msg:empty { display: none; }
.dlg-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.dlg-field input { flex: none; width: 100%; color: var(--text); font-size: 1rem; }
#dlg-fields { display: grid; gap: 12px; }
#dlg-fields:empty { display: none; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dlg-actions .btn { flex: 1; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-weight: 700; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ TEMA GLASS — vôlei de praia ============ */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("fundo.svg") center / cover no-repeat; opacity: var(--bgfx);
}

/* Rede de vôlei: desenhada em canvas por js/rede.js (ondula nó a nó) */
#net {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: calc(.34 * var(--bgfx));
  -webkit-mask-image: linear-gradient(#000, transparent 62%); mask-image: linear-gradient(#000, transparent 62%);
}

.card, .team, .side, dialog, .icon-btn, .btn--ghost, .big-btn--b {
  background: linear-gradient(135deg, var(--g1), var(--g2));
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--gb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 20px 44px -20px rgba(0, 20, 35, .6);
}

.team {
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 34%, transparent), rgba(255, 255, 255, .06));
  border: 1px solid color-mix(in srgb, var(--c) 55%, rgba(255, 255, 255, .35));
}
.team[aria-pressed="true"] {
  border-color: var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 22px 44px -18px var(--c);
}
.team li { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14); }
.team-tag { color: #06202e; }

.side {
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 28%, transparent), rgba(255, 255, 255, .05) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 60%, rgba(255, 255, 255, .3));
}

.player, .chip, .seg, .mini-btn:hover, .add-row input, .dlg-field input {
  background: rgba(255, 255, 255, .09); border: 1px solid var(--gb);
}
:root[data-theme="light"] .player, :root[data-theme="light"] .chip, :root[data-theme="light"] .seg,
:root[data-theme="light"] .add-row input, :root[data-theme="light"] .dlg-field input { background: rgba(255, 255, 255, .6); }
.seg[aria-checked="true"] { border-color: var(--a); background: color-mix(in srgb, var(--a) 22%, rgba(255, 255, 255, .08)); }
.badge { background: rgba(255, 255, 255, .14); border: 1px solid var(--gb); }
.add-row input::placeholder { color: var(--muted); }

.topbar { background: var(--bar); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.topbar--slim { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

.big-btn--a, .btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--a) 78%, #fff), var(--a));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 16px 30px -14px var(--a);
  border: 1px solid rgba(255, 255, 255, .3);
}
.btn--accent {
  background: linear-gradient(180deg, color-mix(in srgb, var(--b) 78%, #fff), var(--b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 16px 30px -14px var(--b);
  border: 1px solid rgba(255, 255, 255, .3);
}

dialog { background: var(--dlg); }
dialog::backdrop { background: rgba(2, 16, 26, .5); }
.toast { background: var(--dlg); color: var(--text); border: 1px solid var(--gb); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* Refino: vidro fosco estilo visionOS (referência do vídeo) */
.card, .team, .side, dialog, .icon-btn, .btn--ghost, .big-btn--b {
  background-color: rgba(28, 44, 56, .32);
  -webkit-backdrop-filter: blur(44px) saturate(125%);
  backdrop-filter: blur(44px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 24px 50px -26px rgba(0, 10, 20, .7);
}
:root[data-theme="light"] .card, :root[data-theme="light"] .team, :root[data-theme="light"] .side,
:root[data-theme="light"] dialog, :root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .btn--ghost, :root[data-theme="light"] .big-btn--b { background-color: rgba(255, 255, 255, .2); }
.card { border-radius: 32px; }
.team { border-radius: 28px; }
.side { border-radius: 34px; }
.seg[aria-checked="true"] { background: rgba(255, 255, 255, .92); color: #06202e; border-color: #fff; transform: none; }

/* Evita tremor no hover: a borda existe sempre (transparente), então o layout não muda */
.ctrl, .mini-btn { border: 1px solid transparent; }

/* Hover nos botões de vidro: muda só a cor. Aplicar filter, mover o botão ou ligar o desfoque
   sobre um backdrop-filter faz o navegador redesenhar errado partes da tela. */
.topbar .icon-btn { -webkit-backdrop-filter: none; backdrop-filter: none; } /* a barra já é desfocada */
.big-btn--b:hover { transform: none; filter: none; }
.icon-btn:hover, .btn--ghost:hover, .big-btn--b:hover { background-color: rgba(120, 160, 185, .38); }
:root[data-theme="light"] .icon-btn:hover, :root[data-theme="light"] .btn--ghost:hover,
:root[data-theme="light"] .big-btn--b:hover { background-color: rgba(255, 255, 255, .65); }
.ctrl:hover { border-color: var(--gb); }
.ctrl--finish:hover { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }

/* Vidro dentro de vidro falha ao redesenhar: o que já está num painel desfocado não desfoca de novo */
.card .team, .card .btn--ghost { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Com mouse, a barra do topo é quase opaca em vez de desfocada: o hover no "voltar" não recalcula os cards */
@media (hover: hover) {
  .topbar:not(.topbar--slim) {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* iPhone instalado como app: o iOS abre medindo a tela sem a barra de status (100% e 100dvh ficam curtos)
   e sobra uma faixa embaixo até o usuário rolar. 100vh já é a altura real da tela.
   O @supports limita a regra ao iOS. */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) and (orientation: portrait) {
    html, body { height: 100vh; }
    #app, .view { min-height: 100vh; }
    #view-placar { height: 100vh; }
    body::before { bottom: auto; height: 100vh; }
  }
}
