/*
 * Visor de replay 3D (public/js/visor-replay.js). Classes vr-*; cores só por
 * variável do site (--c-white, --c-slate-*, --c-surface-*): no modo claro
 * trocam sozinhas. O palco (a cena 3D) tem a cor dele, decidida pelo JS.
 */
.vr-caixa { container-type: inline-size; }
.vr {
  --vr-borda: rgb(var(--c-white) / .09);
  display: grid; gap: 0;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  grid-template-areas: "palco lado" "barra lado" "camera lado";
  grid-template-rows: auto auto auto;
  border: 1px solid var(--vr-borda); border-radius: 1rem; overflow: hidden;
  background: rgb(var(--c-surface-900));
  color: rgb(var(--c-slate-200));
}
.vr-caixa:fullscreen { background: rgb(var(--c-surface-900)); }
.vr-caixa:fullscreen .vr { border-radius: 0; border: 0; grid-template-rows: 1fr auto auto; height: 100vh; }
.vr-caixa:fullscreen .vr-palco { aspect-ratio: auto; height: 100%; min-height: 0; }
.vr svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }

/* Palco */
.vr-palco { grid-area: palco; position: relative; aspect-ratio: 16 / 9; min-height: 14rem; background: #0e1424; outline: none; overflow: hidden; }
:root[data-modo="claro"] .vr-palco { background: #bfd9f2; }
.vr-palco:focus-visible { box-shadow: inset 0 0 0 2px rgb(var(--c-babyblue-400)); }
.vr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.vr-canvas:active { cursor: grabbing; }
.vr-carregando { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 1rem; text-align: center;
  font-size: .9rem; font-weight: 600; color: #cbd5e1; background: radial-gradient(circle at 50% 40%, #1b2440, #0b0f1c); z-index: 3; }
:root[data-modo="claro"] .vr-carregando { color: #1e293b; background: radial-gradient(circle at 50% 40%, #e6f1fb, #bfd9f2); }
.vr-carregando[hidden] { display: none; }
.vr-girar { width: 1.3rem; height: 1.3rem; border-radius: 999px; border: 2px solid rgb(126 203 255 / .25); border-top-color: #7ecbff; animation: vr-giro .8s linear infinite; flex-shrink: 0; }
@keyframes vr-giro { to { transform: rotate(360deg); } }
.vr-erro { color: #fda4af; max-width: 26rem; }
:root[data-modo="claro"] .vr-erro { color: #be123c; }

.vr-etiqueta { position: absolute; left: .7rem; top: .7rem; z-index: 2; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; pointer-events: none; max-width: calc(100% - 4rem); }
.vr-etiqueta b, .vr-etiqueta span { border-radius: .5rem; padding: .22rem .55rem; font-size: .72rem; background: rgb(8 12 22 / .62); color: #fff; backdrop-filter: blur(4px); }
.vr-etiqueta span { font-weight: 600; color: #fcd34d; pointer-events: auto; }
.vr-chat { position: absolute; left: .7rem; bottom: .7rem; z-index: 2; display: flex; flex-direction: column; gap: .2rem; max-width: min(24rem, 70%); pointer-events: none; }
.vr-chat p { font-size: .74rem; line-height: 1.3; padding: .2rem .5rem; border-radius: .4rem; background: rgb(0 0 0 / .5); color: #f1f5f9; overflow-wrap: anywhere; animation: vr-entra .2s ease-out; }
.vr-chat b { color: #93c5fd; font-weight: 700; }
@keyframes vr-entra { from { opacity: 0; transform: translateY(4px); } }
.vr-aviso { position: absolute; inset: auto .7rem .7rem auto; z-index: 2; }
.vr-btn-tela { position: absolute !important; right: .6rem; top: .6rem; z-index: 2; background: rgb(8 12 22 / .55) !important; color: #fff !important; border-color: rgb(255 255 255 / .15) !important; }
.vr-grande { position: absolute; left: 50%; top: 50%; z-index: 2; width: 4rem; height: 4rem; margin: -2rem 0 0 -2rem; border-radius: 999px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, rgb(var(--c-brand-500) / .9), rgb(var(--c-babyblue-500) / .9)); border: 0; cursor: pointer; box-shadow: 0 10px 40px rgb(0 0 0 / .45);
  transition: transform .15s; }
.vr-grande:hover { transform: scale(1.07); }
.vr-grande svg { width: 1.7rem; height: 1.7rem; margin-left: .2rem; }
.vr-grande[hidden] { display: none; }

/* Barra: play, tempo, linha do tempo, velocidade */
.vr-barra { grid-area: barra; display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-top: 1px solid var(--vr-borda); }
.vr-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 2.1rem; height: 2.1rem; padding: 0 .55rem; border-radius: .6rem;
  border: 1px solid rgb(var(--c-white) / .12); background: rgb(var(--c-white) / .04); color: rgb(var(--c-slate-200)); cursor: pointer; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.vr-btn:hover { background: rgb(var(--c-white) / .09); border-color: rgb(var(--c-babyblue-400) / .5); }
.vr-btn[hidden] { display: none; }
.vr-btn-play { color: #fff; border-color: transparent; background: linear-gradient(90deg, rgb(var(--c-brand-500)), rgb(var(--c-babyblue-500))); }
.vr-btn-play:hover { filter: brightness(1.1); }
.vr-tempo { font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; color: rgb(var(--c-slate-400)); white-space: nowrap; min-width: 5.6rem; text-align: center; }
.vr-sel { height: 2.1rem; border-radius: .6rem; border: 1px solid rgb(var(--c-white) / .12); background: rgb(var(--c-surface-950) / .55); color: rgb(var(--c-slate-200)); font-size: .78rem; padding: 0 .45rem; min-width: 0; }
.vr-sel option { background: rgb(var(--c-surface-900)); color: rgb(var(--c-slate-200)); }
.vr-vel { width: 4.3rem; }

.vr-linha { position: relative; flex: 1; min-width: 6rem; height: 2.1rem; cursor: pointer; touch-action: none; outline: none; }
.vr-linha:focus-visible .vr-trilho { box-shadow: 0 0 0 2px rgb(var(--c-babyblue-400) / .6); }
.vr-trilho, .vr-progresso { position: absolute; left: 0; top: 50%; height: .36rem; margin-top: -.18rem; border-radius: 999px; pointer-events: none; }
.vr-trilho { right: 0; background: rgb(var(--c-white) / .12); }
.vr-progresso { width: 0; background: linear-gradient(90deg, rgb(var(--c-brand-500)), rgb(var(--c-babyblue-400))); }
.vr-pino { position: absolute; top: 50%; width: .95rem; height: .95rem; margin: -.475rem 0 0 -.475rem; border-radius: 999px; background: #fff; box-shadow: 0 0 0 3px rgb(var(--c-babyblue-400) / .45), 0 2px 6px rgb(0 0 0 / .4); pointer-events: none; z-index: 2; }
.vr-marcas { position: absolute; inset: 0; pointer-events: none; }
.vr-marca { position: absolute; top: 50%; pointer-events: auto; border: 0; padding: 0; cursor: pointer; transform: translateX(-50%); z-index: 1; }
.vr-m-f { width: 3px; height: 1.15rem; margin-top: -.575rem; border-radius: 2px; background: #f43f5e; box-shadow: 0 0 6px rgb(244 63 94 / .8); }
.vr-m-k { width: .55rem; height: .55rem; margin-top: -.275rem; border-radius: 999px; background: rgb(var(--c-white)); border: 2px solid #1e293b; }
:root[data-modo="claro"] .vr-m-k { background: #1e293b; border-color: #fff; }
.vr-m-r { width: .5rem; height: .5rem; margin-top: -.25rem; border-radius: 2px; background: #f59e0b; transform: translateX(-50%) rotate(45deg); }
.vr-m-e { width: 2px; height: .7rem; margin-top: -.35rem; background: rgb(var(--c-slate-400)); }
.vr-m-momento { width: .85rem; height: .85rem; margin-top: -1.2rem; background: rgb(var(--c-babyblue-400)); clip-path: polygon(50% 100%, 0 0, 100% 0); }
.vr-marca:hover { filter: brightness(1.25); }
.vr-dica { position: absolute; bottom: 100%; margin-bottom: .2rem; z-index: 5; max-width: 18rem; padding: .3rem .55rem; border-radius: .5rem; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgb(var(--c-surface-950)); color: rgb(var(--c-slate-200)); border: 1px solid rgb(var(--c-white) / .14); box-shadow: 0 8px 20px rgb(0 0 0 / .35); pointer-events: none; }
.vr-dica[hidden] { display: none; }

/* Câmera */
.vr-camera { grid-area: camera; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 0 .7rem .65rem; }
.vr-modos { display: inline-flex; padding: .2rem; gap: .15rem; border-radius: .7rem; background: rgb(var(--c-white) / .05); border: 1px solid rgb(var(--c-white) / .08); }
.vr-modo { display: inline-flex; align-items: center; gap: .35rem; height: 1.8rem; padding: 0 .65rem; border-radius: .5rem; border: 0; background: none; color: rgb(var(--c-slate-400)); font-size: .76rem; font-weight: 700; cursor: pointer; }
.vr-modo svg { width: .95rem; height: .95rem; }
.vr-modo:hover { color: rgb(var(--c-white)); }
.vr-modo.ativo { color: #fff; background: linear-gradient(90deg, rgb(var(--c-brand-500)), rgb(var(--c-babyblue-500))); }
.vr-jog { width: 10rem; }
.vr-jog[hidden] { display: none; }
.vr-momento { margin-left: auto; color: rgb(var(--c-babyblue-300)); }
:root[data-modo="claro"] .vr-momento { color: rgb(var(--c-brand-600)); }

/* Lateral: acontecimentos */
.vr-lado { grid-area: lado; display: flex; flex-direction: column; min-height: 100%; height: 0; overflow: hidden; border-left: 1px solid var(--vr-borda); background: rgb(var(--c-surface-950) / .35); }
.vr-lado-topo { padding: .75rem .8rem .55rem; border-bottom: 1px solid var(--vr-borda); }
.vr-lado-topo > b { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c-slate-400)); }
.vr-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.vr-chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .18rem .55rem; font-size: .7rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgb(var(--c-white) / .12); background: none; color: rgb(var(--c-slate-500)); }
.vr-chip b { font-variant-numeric: tabular-nums; }
.vr-chip.ligado { color: rgb(var(--c-slate-200)); background: rgb(var(--c-white) / .06); }
.vr-c-deteccao.ligado { color: #fb7185; border-color: rgb(244 63 94 / .5); background: rgb(244 63 94 / .1); }
:root[data-modo="claro"] .vr-c-deteccao.ligado { color: #e11d48; }
.vr-lista { flex: 1; overflow-y: auto; min-height: 0; padding: .3rem; }
.vr-vazio { padding: 1.5rem .8rem; text-align: center; font-size: .78rem; color: rgb(var(--c-slate-500)); }
.vr-item { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .45rem; width: 100%; text-align: left; padding: .45rem .5rem; border-radius: .6rem; border: 1px solid transparent; background: none; cursor: pointer; color: inherit; font: inherit; position: relative; }
.vr-item:hover { background: rgb(var(--c-white) / .05); }
.vr-item.agora { background: rgb(var(--c-babyblue-400) / .1); border-color: rgb(var(--c-babyblue-400) / .35); }
.vr-item-t { font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; color: rgb(var(--c-slate-500)); padding-top: .05rem; }
.vr-item-c { min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.vr-item-c small { font-size: .64rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: rgb(var(--c-slate-500)); }
.vr-item-c b { font-size: .8rem; font-weight: 600; color: rgb(var(--c-white)); overflow-wrap: anywhere; line-height: 1.3; }
.vr-item-c span { font-size: .72rem; color: rgb(var(--c-slate-400)); overflow-wrap: anywhere; }
.vr-i-deteccao { box-shadow: inset 3px 0 0 #f43f5e; }
.vr-i-deteccao small { color: #fb7185; }
:root[data-modo="claro"] .vr-i-deteccao small { color: #e11d48; }
.vr-i-morte small { color: rgb(var(--c-slate-300)); }
.vr-i-momento { box-shadow: inset 3px 0 0 rgb(var(--c-babyblue-400)); }
.vr-i-momento small { color: rgb(var(--c-babyblue-300)); }
:root[data-modo="claro"] .vr-i-momento small { color: rgb(var(--c-brand-600)); }

/* Coluna estreita (celular, página da punição): tudo empilhado */
@container (max-width: 820px) {
  .vr { grid-template-columns: minmax(0, 1fr); grid-template-areas: "palco" "barra" "camera" "lado"; grid-template-rows: auto; }
  .vr-lado { border-left: 0; border-top: 1px solid var(--vr-borda); height: auto; min-height: 0; }
  .vr-lista { max-height: 15rem; }
}
@container (max-width: 560px) {
  .vr-palco { aspect-ratio: 4 / 3; min-height: 0; }
  .vr-barra { flex-wrap: wrap; gap: .4rem; padding: .5rem; }
  .vr-linha { order: -1; flex: 1 1 100%; height: 1.7rem; }
  .vr-so-largo { display: none; }
  .vr-tempo { min-width: 0; margin-right: auto; }
  .vr-camera { padding: 0 .5rem .55rem; gap: .4rem; }
  .vr-modo { padding: 0 .5rem; }
  .vr-jog { width: auto; flex: 1 1 7rem; }
  .vr-momento { margin-left: 0; }
  .vr-momento span { display: none; }
  .vr-etiqueta b, .vr-etiqueta span { font-size: .66rem; }
}
