/* Quadra, quadrantes, mira, banners, ticket, cartões */
.camera > svg.court, .camera > canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.camera > canvas.fx { pointer-events: none; }
svg.court { touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; outline: none; transition: filter .4s; }
.app:not([data-state="aiming"]) svg.court { cursor: default; }
svg.court.is-dim { filter: saturate(.75) brightness(.8); }

/* quadrantes */
.zone-bg {
  fill: #fff; fill-opacity: .07; stroke: #fff; stroke-opacity: .4; stroke-width: 1; stroke-dasharray: 4 4;
  transition: fill .15s, fill-opacity .15s, stroke .15s, stroke-opacity .15s;
}
.zdot {
  fill: #fff; fill-opacity: .85; transform-box: fill-box; transform-origin: center;
  animation: zp 2s ease-in-out infinite;
}
@keyframes zp { 50% { transform: scale(1.7); opacity: .2; } }
.zone { outline: none; }
.zone.is-hover .zone-bg, .zone:focus-visible .zone-bg {
  fill: #E8192C; fill-opacity: .34; stroke: #E8192C; stroke-opacity: 1; stroke-width: 2; stroke-dasharray: none;
}
.zone:focus-visible .zone-bg { stroke: #fff; }
.zone.is-hover .zdot, .zone:focus-visible .zdot { opacity: 0; }
.zone.is-locked .zone-bg {
  fill: #E8192C; fill-opacity: .5; stroke: #E8192C; stroke-opacity: 1; stroke-width: 2; stroke-dasharray: none;
}
.zone.is-locked .zdot, .zone.is-gold .zdot, .zone.is-dim .zdot { opacity: 0; animation: none; }
.zone.is-dim .zone-bg { fill-opacity: .02; stroke-opacity: .12; }
.zone.is-gold .zone-bg {
  fill: #F5C542; fill-opacity: .55; stroke: #fff; stroke-opacity: 1; stroke-width: 2; stroke-dasharray: none;
  animation: gold .45s ease-in-out 3;
}
@keyframes gold { 50% { fill-opacity: .95; } }
.app[data-state="intro"] .zone .zone-bg { transition: none; }

/* toque: ripple via mira */
.reticle { opacity: 0; transition: opacity .15s; pointer-events: none; }
.reticle .rip { animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { r: 6; opacity: .9; } 100% { r: 26; opacity: 0; } }
.reticle.is-snap > g { animation: snap .25s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes snap { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
.aim-guide { opacity: 0; transition: opacity .15s; pointer-events: none; }
svg.court.is-serving .aim-guide { opacity: 0 !important; }
.line-flash { opacity: 0; pointer-events: none; }
.line-flash.is-on { animation: lineflash .9s ease-in-out; }
@keyframes lineflash { 0%, 40%, 80% { opacity: 1; } 20%, 60%, 100% { opacity: 0; } }
.server, .net { pointer-events: none; }

/* efeitos de tela */
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.flash.is-on { animation: flash .09s steps(1) 1; }
@keyframes flash { 0% { opacity: .75; } 100% { opacity: 0; } }
.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .35s;
  background: radial-gradient(circle at 50% 45%, #0000 30%, #000c 95%);
}
.vignette.is-on { opacity: 1; }

/* pílula de instrução */
.pill {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 24px);
  background: #000b; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid #ffffff22; border-radius: 99px; padding: 10px 18px;
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .2s, color .2s;
}
.pill i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 8px; animation: pulse 1.2s infinite; vertical-align: 1px; }
.pill.is-gold { border-color: #F5C54299; color: var(--gold); }
.pill.is-gold i { background: var(--gold); }
.pill.is-error { border-color: #ff3d4f99; }
.pill.is-busy i { background: #fff; }

/* banner do impacto */
.banner {
  position: absolute; left: -10px; right: -10px; top: 18%; z-index: 6; pointer-events: none;
  transform: rotate(-4deg) scale(.6); opacity: 0;
  padding: 10px 0; text-align: center; font-family: var(--display); font-size: clamp(30px, 9vw, 40px); letter-spacing: .04em;
  box-shadow: 0 12px 30px #0008; color: #fff; background: var(--red);
}
.banner.dark { background: #111; border-top: 2px solid #fff; border-bottom: 2px solid #fff; }
.banner.gold { background: var(--gold); color: #1a1205; }
.banner.is-on { animation: bannerIn .42s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes bannerIn { 0% { opacity: 0; transform: rotate(-4deg) scale(.6); } 100% { opacity: 1; transform: rotate(-4deg) scale(1); } }

/* ---------- resultado ---------- */
.result {
  position: absolute; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(18px + var(--safe-t)) 22px calc(22px + var(--safe-b));
  background: radial-gradient(circle at 50% 40%, #000a 0, #000e 75%);
  opacity: 0; transition: opacity .3s;
}
.result.is-on { opacity: 1; }
.r-inner { width: 100%; max-width: 360px; margin: auto 0; display: flex; flex-direction: column; }
.r-banner {
  align-self: stretch; margin: 0 -14px 18px; transform: rotate(-4deg); position: relative;
  padding: 10px 0; text-align: center; font-family: var(--display); font-size: clamp(30px, 9.5vw, 38px); letter-spacing: .04em;
  box-shadow: 0 12px 30px #0008; background: var(--red); color: #fff;
}
.r-banner::after { content: ""; position: absolute; right: 26px; bottom: -9px; width: 60px; height: 9px; background: var(--red-d); }
.r-banner.dark { background: #141418; border: 2px solid #fff; }
.r-banner.dark::after { background: #fff; }
.result.is-on .r-banner { animation: bannerIn .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.r-note { text-align: center; color: var(--dim); font-size: 14px; margin: -4px 0 12px; }

.ticket {
  position: relative; background: linear-gradient(180deg, #fff, #EDEDED); color: #0b0b0d;
  border-radius: var(--r-lg); padding: 18px 20px 16px; text-align: center; box-shadow: 0 24px 60px #000a;
}
.result.is-on .ticket { animation: ticketIn .6s cubic-bezier(.2, 1.4, .35, 1) .1s both; }
@keyframes ticketIn { 0% { opacity: 0; transform: translateY(40px) scale(.9) rotate(2deg); } 100% { opacity: 1; transform: none; } }
.t-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #666; }
.t-big { font-family: var(--display); font-size: clamp(96px, 30vw, 128px); line-height: 1; color: var(--red); margin-top: 6px; }
.t-big b { font-weight: 400; }
.t-big span { font-size: .5em; vertical-align: top; margin-left: 2px; }
.t-big.is-long { text-transform: uppercase; font-size: clamp(38px, 11.5vw, 52px); padding: 22px 0 8px; letter-spacing: .02em; }
.t-sub { font-family: var(--display); font-size: 26px; letter-spacing: .08em; margin-top: -4px; text-transform: uppercase; }
.t-perf { border-top: 2.5px dashed #bbb; margin: 18px -4px 14px; position: relative; }
.t-perf::before, .t-perf::after {
  content: ""; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: #070709;
}
.t-perf::before { left: -37px; }
.t-perf::after { right: -37px; }
.t-code { font: 800 24px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .16em; user-select: all; -webkit-user-select: all; }
.ticket small { display: block; margin-top: 8px; font-size: 12px; color: #555; line-height: 1.4; }

.actions { display: grid; gap: 10px; margin-top: 18px; }
.result.is-on .actions { animation: up .4s ease-out .35s both; }
@keyframes up { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
.btn.wa { background: linear-gradient(180deg, var(--red-l), var(--red)); }

.miss-card {
  background: var(--card); border: 1px solid #26262c; border-radius: 16px; padding: 20px 20px 18px; text-align: center;
}
.result.is-on .miss-card { animation: ticketIn .5s cubic-bezier(.2, 1.3, .35, 1) .08s both; }
.miss-title { font-family: var(--display); font-size: 30px; letter-spacing: .03em; text-transform: uppercase; }
.miss-lead { font-weight: 800; font-size: 18px; margin-top: 2px; }
.miss-lead:empty { display: none; }
.miss-body { color: var(--dim); font-size: 15px; line-height: 1.5; margin-top: 8px; }

/* toast e selo demo */
.toast {
  position: fixed; left: 50%; top: calc(64px + var(--safe-t)); z-index: 50; max-width: calc(100% - 32px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  background: #1f1f25; border: 1px solid #ffffff22; border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px #000a; text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.demo-badge {
  position: fixed; right: calc(0px + var(--safe-r)); top: 50%; transform: rotate(-90deg) translateY(-100%); transform-origin: 100% 0; z-index: 60; pointer-events: none;
  background: #F5C542; color: #1a1205; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px 6px 0 0; opacity: .8;
}

/* movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .zdot, .reticle .rip, .pill i { animation: none !important; }
  .banner.is-on, .result.is-on .r-banner, .result.is-on .ticket, .result.is-on .miss-card, .result.is-on .actions { animation-duration: .01s !important; }
  .flash { display: none; }
  .zone.is-gold .zone-bg { animation: none; }
}
