/* Preto e Vermelho: mesa de jogo noturna. Vermelho saturado só existe na face da carta. */
.pv { --felt: #0f0b15; --felt-2: #1b1426; --ink: #141418; --red: #d91f3d; --paper: #f6efe4; --gold-dim: #ffd36e55; }
.pv button { -webkit-tap-highlight-color: transparent; }

/* ---------- Setup ---------- */
.pv-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pv-hero h1 { font-size: clamp(2.3rem, 10vw, 4rem); font-weight: 800; font-stretch: 75%; line-height: .95; }
.pv-hero h1 span { display: block; color: var(--pink); }
.pv-emblem { flex: none; width: 76px; height: 70px; }
.pv-resume { display: grid; gap: 10px; margin-bottom: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--gold-dim); background: radial-gradient(120% 120% at 0 0, #ffd36e22, transparent 60%), var(--plum); }
.pv-resume p { font-size: .92rem; color: var(--muted); }
.pv-resume strong { color: var(--cream); font-size: 1.05rem; }
.pv-resume .pv-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-box { display: grid; gap: 12px; margin-bottom: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: #ffffff08; }
.pv-box > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 1.25rem; }
.pv-box > h2 small { color: var(--muted); font-size: .82rem; font-weight: 600; font-family: inherit; }
.pv-add { display: flex; gap: 8px; }
.pv-add input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--night); }
.pv-add input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.pv-add button { min-width: 48px; min-height: 48px; border-radius: 14px; border: 0; background: var(--gold); color: #2a1530; font-size: 1.5rem; font-weight: 800; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 4px 0 14px; border-radius: 99px; background: var(--plum-2); font-weight: 700; }
.pv-chip button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.2rem; }
.pv-chip button:hover { color: var(--cream); background: #ffffff12; }
.pv-empty { color: var(--muted); font-size: .9rem; }
.pv-tropa summary { cursor: pointer; color: var(--gold); font-weight: 700; font-size: .92rem; min-height: 40px; display: flex; align-items: center; }
.pv-tropa .pv-chips { padding-top: 6px; }
.pv-quick { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px dashed #ffffff33; background: transparent; font-weight: 600; }
.pv-quick::before { content: '+ '; color: var(--gold); }
.pv-stepper { display: flex; align-items: center; gap: 14px; }
.pv-stepper button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--plum-2); font-size: 1.6rem; font-weight: 700; }
.pv-stepper button:disabled { opacity: .35; }
.pv-stepper output { min-width: 2ch; text-align: center; font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 2.6rem; line-height: 1; color: var(--cream); }
.pv-rec { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 700; }
.pv-rec.on { border-color: transparent; background: var(--gold); color: #2a1530; }
.pv-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--night); border: 1px solid var(--line); }
.pv-seg button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 700; }
.pv-seg button[aria-pressed='true'] { background: var(--cream); color: var(--night); }
.pv-hint { color: var(--muted); font-size: .85rem; }
.pv-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; cursor: pointer; }
.pv-toggle span small { display: block; color: var(--muted); font-size: .8rem; }
.pv-toggle input { appearance: none; flex: none; width: 52px; height: 30px; border-radius: 99px; background: #ffffff22; position: relative; cursor: pointer; transition: background .2s; }
.pv-toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: translate .2s; }
.pv-toggle input:checked { background: var(--gold); }
.pv-toggle input:checked::after { translate: 22px 0; }
.pv-toggle input:disabled { opacity: .4; }
.pv-more summary { cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 1.25rem; list-style: none; display: flex; justify-content: space-between; }
.pv-more summary::after { content: '+'; color: var(--gold); }
.pv-more[open] summary::after { content: '−'; }
.pv-more[open] > div { display: grid; gap: 12px; margin-top: 12px; }
.pv-sub { display: grid; gap: 6px; }
.pv-sub > b { font-size: .9rem; }
.pv-start { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 2; display: grid; gap: 6px; margin: 16px -16px 0; padding: 22px 16px 12px; background: linear-gradient(transparent, var(--night) 34%); }
.pv-how { margin-left: auto; align-self: flex-start; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #ffffff0a; color: var(--gold); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.pv-go { min-height: 58px; border: 0; border-radius: 18px; background: var(--gold); color: #2a1530; font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 1.5rem; box-shadow: 0 10px 30px #0009; }
.pv-go:disabled { background: var(--plum-2); color: var(--muted); box-shadow: none; }
.pv-link { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--gold); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pv-err { text-align: center; color: var(--muted); font-size: .85rem; }

/* Como jogar */
.pv-steps { counter-reset: p; display: grid; gap: 12px; }
.pv-steps li { counter-increment: p; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.pv-steps li::before { content: counter(p); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #2a1530; font-family: var(--display); font-weight: 800; }
.pv-steps b { display: block; }
.pv-steps span { color: var(--muted); font-size: .92rem; }

/* ---------- Mesa (partida em tela cheia) ---------- */
body.pv-jogando { overflow: hidden; }
body.pv-jogando .top, body.pv-jogando .tabbar, body.pv-jogando .foot, body.pv-jogando .lzk-menu, body.pv-jogando .skip { display: none !important; }
.pv-mesa { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); overflow: hidden auto; color: var(--cream);
  background: radial-gradient(90% 60% at 50% 30%, var(--felt-2), var(--felt) 70%), var(--felt);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.pv-mesa::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-radial-gradient(circle at 50% 40%, #ffffff03 0 2px, transparent 2px 5px); }
.pv-bar { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; height: 60px; padding: 0 6px; }
.pv-x { width: 48px; height: 48px; border: 0; border-radius: 50%; background: #ffffff0d; color: var(--muted); font-size: 1.4rem; }
.pv-bar p { text-align: center; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pv-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 8px 20px 28px; min-height: 0; text-align: center; }
.pv-stage > * { max-width: 520px; width: 100%; min-width: 0; }
/* Centraliza quando cabe; quando não cabe, rola sem cortar o topo. */
.pv-stage > :first-child { margin-top: auto; }
.pv-stage > :last-child { margin-bottom: auto; }
.pv-kicker { color: var(--muted); font-size: .85rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.pv-big { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(3.2rem, 17vw, 6.5rem); line-height: .9; text-transform: uppercase; overflow-wrap: anywhere; }
.pv-mid { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: clamp(2rem, 9vw, 3rem); line-height: 1; }
.pv-sub-txt { color: var(--muted); max-width: 34ch; margin-inline: auto; }
.pv-cta { min-height: 60px; border-radius: 18px; border: 1px solid #fff3ea33; background: #fff3ea14; color: var(--cream); font-weight: 800; font-size: 1.1rem; }
.pv-cta.solid { border: 0; background: var(--cream); color: var(--night); }
.pv-cta.gold { border: 0; background: var(--gold); color: #2a1530; }
.pv-cta:disabled { opacity: .4; }
.pv-actions { display: grid; gap: 10px; }
.pv-actions.duo { grid-template-columns: 1fr 1fr; }
.pv-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pv-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ffffff22; }
.pv-dots i.on { background: var(--cream); }
.pv-dots i.done { background: #ffffff66; }

/* ---------- Carta ---------- */
.pv-card { --rx: 0deg; --ry: 0deg; position: relative; width: min(66vw, 280px, 42vh); aspect-ratio: 5 / 7; perspective: 1100px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; outline: none; }
.pv-card:focus-visible .pv-back { box-shadow: 0 0 0 3px var(--cream), 0 24px 50px #000c; }
.pv-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; }
.pv-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.3, 1.45, .45, 1); }
.pv-card.virada .pv-inner { transform: rotateY(180deg); }
.pv-card.instant .pv-inner, .pv-card.instant .pv-tilt { transition: none; }
.pv-back, .pv-face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pv-back { display: grid; place-items: center; background: #17121f; border: 1px solid #ffffff1a; box-shadow: 0 24px 50px #000c; overflow: hidden; }
.pv-back::before { content: ''; position: absolute; inset: 10px; border-radius: 12px; border: 1px solid var(--gold-dim);
  background: repeating-linear-gradient(45deg, #ffd36e0f 0 1px, transparent 1px 12px), repeating-linear-gradient(-45deg, #ffd36e0f 0 1px, transparent 1px 12px); }
.pv-back b { position: relative; display: grid; place-items: center; width: 44%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--gold-dim); background: #17121f; font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(1.4rem, 7vw, 2.2rem); color: #ffd36ecc; letter-spacing: .04em; }
.pv-face { transform: rotateY(180deg); display: grid; grid-template-rows: auto 1fr auto; padding: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 50px #000c; overflow: hidden; }
.pv-face:empty { background: #17121f; }
.pv-face.vermelho { color: var(--red); }
.pv-idx { display: grid; justify-items: center; width: max-content; line-height: .9; font-family: var(--display); font-weight: 800; }
.pv-idx b { font-size: 1.6rem; } .pv-idx i { font-style: normal; font-size: 1.3rem; }
.pv-idx.bottom { justify-self: end; rotate: 180deg; }
.pv-center { display: grid; place-content: center; justify-items: center; gap: 4px; }
.pv-suit { font-size: clamp(4.5rem, 26vw, 7rem); line-height: 1; }
.pv-role { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(1.7rem, 8.5vw, 2.4rem); letter-spacing: .02em; }
.pv-extra { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #0000000d; color: var(--ink); font-size: .88rem; font-weight: 600; max-width: 92%; }
.pv-extra strong { display: block; font-family: var(--display); font-size: 1.35rem; line-height: 1.05; }
.pv-holdhint { color: var(--muted); font-size: .9rem; font-weight: 600; min-height: 1.4em; }
@media (prefers-reduced-motion: reduce) {
  .pv-inner { transition: none; }
  .pv-card .pv-face, .pv-card .pv-back { transition: opacity .18s linear; }
  .pv-card .pv-inner { transform: none !important; }
  .pv-card .pv-face { transform: none; opacity: 0; }
  .pv-card.virada .pv-face { opacity: 1; }
  .pv-card.virada .pv-back { opacity: 0; }
  .pv-tilt { transform: none; }
}

/* ---------- Dicas ---------- */
.pv-order { display: grid; gap: 6px; text-align: left; }
.pv-order li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: #ffffff08; color: var(--muted); font-weight: 700; }
.pv-order li span { width: 26px; color: #ffffff55; font-family: var(--display); }
.pv-order li.on { background: var(--cream); color: var(--night); }
.pv-order li.on span { color: var(--night); }
.pv-order li.done { text-decoration: line-through; opacity: .55; }

/* ---------- Discussão ---------- */
.pv-timer { position: relative; width: min(64vw, 260px); aspect-ratio: 1; margin-inline: auto; }
.pv-timer svg { width: 100%; height: 100%; rotate: -90deg; }
.pv-timer circle { fill: none; stroke-width: 9; }
.pv-timer .trilho { stroke: #ffffff12; }
.pv-timer .anel { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.pv-timer div { position: absolute; inset: 0; display: grid; place-content: center; }
.pv-timer b { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: clamp(3rem, 16vw, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.pv-timer small { color: var(--muted); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.pv-timer.fim .anel { stroke: var(--cream); }
.pv-timer.fim b { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .pv-timer.urgente b { animation: pv-pulse 1s ease-in-out infinite; } }
@keyframes pv-pulse { 50% { opacity: .45; } }
.pv-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pv-people span { padding: 6px 12px; border-radius: 99px; background: #ffffff0f; font-weight: 700; font-size: .9rem; }
.pv-people span.fora { background: transparent; border: 1px solid #ffffff1a; color: #ffffff55; text-decoration: line-through; }
.pv-people span.fora em { font-style: normal; text-decoration: none; display: inline-block; margin-left: 4px; }
.pv-people span.fora em.r { color: var(--red); }

/* ---------- Votação ---------- */
.pv-vote { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pv-v { position: relative; display: grid; align-content: center; gap: 2px; min-height: 84px; padding: 10px 12px; border-radius: 16px; border: 1px solid #ffffff14; background: #ffffff0a; text-align: left; font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.pv-v:active { transform: scale(.98); }
.pv-v .n { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; color: #ffffff33; }
.pv-v.tem .n { color: var(--gold); }
.pv-v.tem { border-color: var(--gold-dim); background: #ffd36e12; }
.pv-v.sel { border-color: var(--cream); background: #fff3ea1c; box-shadow: inset 0 0 0 1px var(--cream); }
.pv-v.eu { opacity: .35; pointer-events: none; }
.pv-minus { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: #00000040; color: var(--cream); font-size: 1.3rem; font-weight: 800; }
.pv-tally { color: var(--muted); font-weight: 700; }
.pv-tally b { color: var(--cream); }

/* ---------- Folhas (confirmação, sair, como jogar) ---------- */
dialog.pv-sheet { width: min(520px, 100%); margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: #1b1426; color: var(--cream); z-index: 50; }
dialog.pv-sheet::backdrop { background: #06040acc; backdrop-filter: blur(3px); }
.pv-sheet-in { display: grid; gap: 14px; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); }
.pv-sheet-in h2 { font-size: 1.6rem; line-height: 1.05; }
.pv-sheet-in p { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  dialog.pv-sheet[open] { animation: pv-up .28s cubic-bezier(.2, 1, .4, 1); }
  @keyframes pv-up { from { translate: 0 40px; opacity: 0; } }
}

/* ---------- Resultado ---------- */
.pv-result { display: grid; justify-items: center; gap: 14px; }
.pv-result .pv-card { width: min(52vw, 220px, 34vh); }
.pv-result .pv-kicker + .pv-big, .pv-result .pv-suspense + .pv-mid { margin-top: -8px; }
.pv-suspense { color: var(--muted); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; }
@media (prefers-reduced-motion: no-preference) {
  .pv-result.esperando .pv-card { animation: pv-breathe 1.1s ease-in-out infinite; }
  @keyframes pv-breathe { 50% { scale: 1.035; } }
  .pv-verdict { animation: pv-in .45s cubic-bezier(.2, 1.3, .4, 1) backwards; }
  @keyframes pv-in { from { opacity: 0; translate: 0 14px; } }
}
.pv-verdict { display: grid; gap: 6px; }
.pv-verdict .pv-mid.r { color: var(--red); }
.pv-verdict .pv-mid.p { color: var(--cream); }
.pv-result:not(.revelado) .pv-verdict, .pv-result:not(.revelado) .pv-after { visibility: hidden; }

/* ---------- Fim de jogo ---------- */
.pv-win { display: grid; gap: 6px; }
.pv-win .pv-big { font-size: clamp(2.8rem, 15vw, 5.5rem); }
.pv-win.vermelhos .pv-big { color: var(--red); text-shadow: 0 0 40px #d91f3d66; }
.pv-win.pretos .pv-big { color: var(--paper); text-shadow: 0 0 40px #f6efe444; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.pv-mini { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; background: var(--paper); color: var(--ink); aspect-ratio: 5 / 7; align-content: center; }
.pv-mini.vermelho { color: var(--red); }
.pv-mini i { font-style: normal; font-size: 2rem; line-height: 1; }
.pv-mini b { font-size: .82rem; color: var(--ink); overflow-wrap: anywhere; line-height: 1.1; }
.pv-mini small { font-size: .62rem; font-weight: 800; letter-spacing: .06em; }
.pv-mini.fora { opacity: .55; }
.pv-mini.fora b { text-decoration: line-through; }
.pv-mini.venceu { box-shadow: 0 0 0 3px var(--gold); }
