/* ==========================================================
   Central Vazamentos - Preview (CSS isolado)
   (Base: index4, com menu/scroll/graph/controles coloridos)
   ========================================================== */

/* Pequeno reset global (mínimo) */
html, body { height: 100%; }
body { margin: 0; background: #050814; }

/* Root isolado */
#cvAppRoot{
  --bg0:#050814;
  --bg2:#0b1020;

  --card: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);

  --text:#f3f6ff;
  --muted:#a3b3d9;

  /* Equalizer colors (gráfico/controles/scroll) */
  --eqG: rgba(0,255,76,.98);
  --eqY: rgba(255,230,0,.98);
  --eqO: rgba(255,154,0,.98);
  --eqR: rgba(255,42,42,.98);

  --shadow: 0 18px 60px rgba(0,0,0,.55);

  --r16: 16px;
  --r18: 18px;

  --pad: clamp(12px, 3.5vw, 22px);
  --gap: clamp(10px, 2.6vw, 14px);

  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  background:
    radial-gradient(1100px 620px at 50% 0%, rgba(43,123,255,.20), rgba(0,0,0,0) 60%),
    radial-gradient(900px 520px at 10% 18%, rgba(52,217,255,.16), rgba(0,0,0,0) 60%),
    radial-gradient(900px 520px at 90% 22%, rgba(168,92,255,.12), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, var(--bg2), var(--bg0));
}

/* Reset somente dentro do app */
#cvAppRoot, #cvAppRoot *{ box-sizing: border-box; }

/* Layout base */
.cv-app{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
  gap: var(--gap);
}

/* ---------------------------
   Topbar
---------------------------- */
.cv-topbar{
  position: sticky;
  top: calc(env(safe-area-inset-top));
  z-index: 5;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  padding: 10px 10px;
  border-radius: var(--r18);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.55));
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.cv-menuBtn{
  width:44px;height:44px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  display:grid; place-items:center;
  cursor:pointer;
  flex: 0 0 auto;
}
.cv-menuBtn:active{ background: rgba(255,255,255,.08); }

.cv-brandTitle{
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.cv-brandLogo{
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  padding: 3px;
}
.cv-brandName{
  font-size: 15px;
  font-weight: 950;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cv-statusChip{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  user-select:none;
  min-width: 120px;
  justify-content:center;
}
.cv-dot{
  width:8px; height:8px; border-radius:50%;
  background: rgba(255,255,255,.28);
}
.cv-dot.cv-on{
  background: var(--eqG);
  box-shadow: 0 0 16px rgba(0,255,76,.38);
}
.cv-chipText{
  font-size: 12px;
  color: var(--muted);
  white-space:nowrap;
  letter-spacing:.2px;
  font-weight: 800;
}

/* ---------------------------
   Content + Scroll colorida
---------------------------- */
.cv-content{
  flex:1 1 auto;
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  display:flex;
  flex-direction:column;
  gap: var(--gap);

  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,255,76,.65) rgba(255,255,255,.08);
}

/* Webkit (Chrome/Edge/Android) */
.cv-content::-webkit-scrollbar{ width: 10px; }
.cv-content::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
.cv-content::-webkit-scrollbar-thumb{
  border-radius: 999px;
  background: linear-gradient(180deg, var(--eqG), var(--eqY), var(--eqO), var(--eqR));
  border: 2px solid rgba(0,0,0,.35);
}

/* ---------------------------
   Cards
---------------------------- */
.cv-card{
  border-radius: var(--r18);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: 0 14px 50px rgba(0,0,0,.28);
  padding: 12px;
}

.cv-subTitle{
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 950;
  letter-spacing:.2px;
  color: rgba(255,255,255,.90);
}

/* ---------------------------
   Visualizer (mesmo layout, agora colorido)
---------------------------- */
.cv-vizWrap{ display:flex; flex-direction:column; gap:10px; }
.cv-vizHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cv-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.20);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing:.2px;
}
.cv-timer{
  color: var(--text);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing:.4px;
}

.cv-viz{
  position:relative;
  width:100%;
  height: clamp(190px, 32vh, 320px);
  border-radius: var(--r16);
  overflow:hidden;
  border:1px solid var(--stroke);
  background:
    radial-gradient(900px 260px at 50% 0%, rgba(0,255,76,.12), rgba(0,0,0,0) 60%),
    radial-gradient(900px 260px at 30% 0%, rgba(255,230,0,.09), rgba(0,0,0,0) 65%),
    radial-gradient(900px 260px at 70% 0%, rgba(255,42,42,.08), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.72));
  cursor:pointer;
  touch-action: manipulation;
}
#cvVizCanvas{ display:block; width:100%; height:100%; }

.cv-vizHint{
  position:absolute;
  left: 10px; right: 10px; bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(3,7,18,.45);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing:.2px;
}

/* ---------------------------
   Controles (coloridos)
---------------------------- */
.cv-controlsRow{
  display:flex;
  gap:10px;
  margin-top: 2px;
}
.cv-btn{
  flex:1;
  height: 46px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
  letter-spacing:.2px;
}
.cv-btn:active{ background: rgba(255,255,255,.08); }

.cv-btnPrimary{
  background: linear-gradient(90deg,
    rgba(0,255,76,.22),
    rgba(255,230,0,.16),
    rgba(255,154,0,.14),
    rgba(255,42,42,.12)
  );
  border-color: rgba(0,255,76,.18);
  box-shadow: 0 10px 30px rgba(0,255,76,.06);
}

/* ---------------------------
   Grid responsivo
---------------------------- */
.cv-twoCols{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 640px){
  .cv-twoCols{ grid-template-columns: 1fr 1fr; }
}

/* ---------------------------
   Toggles
---------------------------- */
.cv-toggleList{ display:flex; flex-direction:column; gap:8px; }
.cv-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.cv-row span{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing:.2px;
}
.cv-row input[type="checkbox"]{
  width: 46px;
  height: 24px;
  cursor:pointer;
  appearance:none;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.10);
  position:relative;
  outline:none;
}
.cv-row input[type="checkbox"]::after{
  content:"";
  position:absolute;
  top:50%; left:3px;
  transform: translateY(-50%);
  width:18px; height:18px;
  border-radius:50%;
  background: rgba(255,255,255,.80);
  transition: left .18s ease, background .18s ease;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
}
.cv-row input[type="checkbox"]:checked{
  background: rgba(0,255,76,.16);
  border-color: rgba(0,255,76,.18);
}
.cv-row input[type="checkbox"]:checked::after{
  left:25px;
  background: rgba(0,255,76,.95);
}

/* ---------------------------
   Presets (coloridos)
---------------------------- */
.cv-presetGrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:8px;
  margin-bottom: 10px;
}
.cv-preset{
  height: 38px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.84);
  font-size: 12px;
  font-weight: 950;
  cursor:pointer;
  letter-spacing:.2px;
}
.cv-preset.cv-active{
  background: linear-gradient(90deg,
    rgba(0,255,76,.18),
    rgba(255,230,0,.12),
    rgba(255,42,42,.08)
  );
  border-color: rgba(255,230,0,.16);
  color: rgba(255,255,255,.96);
}

/* ---------------------------
   Sliders (track colorida)
---------------------------- */
.cv-sliders{ display:flex; flex-direction:column; gap:8px; }
.cv-sliderRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.cv-sliderRow label{
  min-width: 54px;
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
  letter-spacing:.2px;
}

/* Range: WebKit */
.cv-range{
  width: 100%;
  appearance: none;
  background: transparent;
  height: 22px;
}
.cv-range::-webkit-slider-runnable-track{
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--eqG), var(--eqY), var(--eqO), var(--eqR));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.20);
}
.cv-range::-webkit-slider-thumb{
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.35);
  margin-top: -4px;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
}
.cv-range:active::-webkit-slider-thumb{
  background: rgba(255,255,255,1);
}

/* Range: Firefox */
.cv-range::-moz-range-track{
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--eqG), var(--eqY), var(--eqO), var(--eqR));
  border: 1px solid rgba(255,255,255,.10);
}
.cv-range::-moz-range-thumb{
  width: 18px; height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.35);
}

/* ---------------------------
   About
---------------------------- */
.cv-aboutText{
  color: rgba(255,255,255,.72);
  font-size:12px;
  line-height:1.45;
  font-weight:700;
}

/* ---------------------------
   Drawer / Menu (AJUSTADO: mesmas cores do app)
---------------------------- */
.cv-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
  opacity:0;
  pointer-events:none;
  transition: opacity .22s ease;
  z-index: 30;
}
.cv-backdrop.cv-open{ opacity:1; pointer-events:auto; }

.cv-drawer{
  position:absolute;
  top:0; left:0;
  height:100%;
  width: min(82vw, 340px);

  /* MESMAS CORES DO APP */
  background:
    radial-gradient(700px 520px at 20% 0%, rgba(52,217,255,.14), rgba(0,0,0,0) 60%),
    radial-gradient(700px 520px at 90% 10%, rgba(168,92,255,.10), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(9,12,24,.98), rgba(5,8,20,.98));

  border-right: 1px solid rgba(255,255,255,.10);

  transform: translateX(-102%);
  transition: transform .22s ease;
  z-index: 40;

  display:flex;
  flex-direction:column;

  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    var(--pad)
    calc(var(--pad) + env(safe-area-inset-bottom))
    var(--pad);
  gap: 14px;

  box-shadow: 24px 0 70px rgba(0,0,0,.55);
  overflow-y:auto;

  scrollbar-width: thin;
  scrollbar-color: rgba(0,255,76,.65) rgba(255,255,255,.10);
}
.cv-drawer::-webkit-scrollbar{ width: 10px; }
.cv-drawer::-webkit-scrollbar-track{
  background: rgba(255,255,255,.08);
  border-radius: 999px;
}
.cv-drawer::-webkit-scrollbar-thumb{
  border-radius: 999px;
  background: linear-gradient(180deg, var(--eqG), var(--eqY), var(--eqO), var(--eqR));
  border: 2px solid rgba(0,0,0,.35);
}

.cv-drawer.cv-open{ transform: translateX(0); }

.cv-drawerHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.cv-drawerBrand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}
.cv-drawerLogo{
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  padding: 6px;
  flex: 0 0 auto;
}
.cv-drawerTitle{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.cv-drawerTitle strong{
  font-size: 13px;
  font-weight: 950;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cv-drawerTitle span{
  font-size: 11px;
  color: rgba(255,255,255,.55);
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cv-closeBtn{
  width:40px;height:40px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.cv-closeBtn:active{ background: rgba(255,255,255,.08); }

.cv-helloPill{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  font-weight: 900;
  letter-spacing:.2px;
  color: rgba(255,255,255,.92);
}
.cv-userIcon{
  width:22px; height:22px;
  display:grid; place-items:center;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}
.cv-helloText{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size: 13px;
}

.cv-menuLabel{
  text-align:center;
  font-size: 13px;
  font-weight: 950;
  letter-spacing:.25px;
  color: rgba(255,255,255,.78);
  margin-top: -4px;
}

.cv-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cv-navBtn{
  text-decoration:none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  color: rgba(255,255,255,.90);
  font-weight: 950;
  letter-spacing:.2px;
  padding: 11px 12px;
  border-radius: 8px;
  border:1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:center;
}
.cv-navBtn:active{ background: rgba(255,255,255,.08); }

.cv-drawerFooter{
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  padding: 12px;
}

.cv-balanceBox{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 6px 6px 10px;
}
.cv-balanceLabel{
  text-align:center;
  font-size: 12px;
  font-weight: 950;
  color: rgba(255,255,255,.72);
  letter-spacing:.2px;
}
.cv-balanceRow{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.cv-moneyIcon{
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  display:grid; place-items:center;
}
.cv-balanceValue{
  font-size: 18px;
  font-weight: 1000;
  letter-spacing:.3px;
  color: rgba(255,255,255,.92);
}

.cv-rechargeBtn{
  width:100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(0,255,76,.22);
  background: rgba(255,255,255,.05);
  color: rgba(0,255,76,.95);
  font-weight: 1000;
  letter-spacing:.35px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.cv-rechargeBtn:active{ background: rgba(255,255,255,.08); }

.cv-rechargeIcon{
  display:inline-grid;
  place-items:center;
  width:22px;height:22px;
  border-radius:6px;
  background: rgba(0,255,76,.12);
  border: 1px solid rgba(0,255,76,.18);
}

.cv-help{
  margin-top: auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding-top: 12px;
}
.cv-helpIcon{
  width: 64px; height: 64px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  display:grid;
  place-items:center;
}
.cv-helpLabel{
  font-size: 12px;
  font-weight: 950;
  color: rgba(255,255,255,.78);
  letter-spacing:.25px;
}

/* ---------------------------
   Splash
---------------------------- */
.cv-splash{
  position:absolute; inset:0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap: 14px;
  padding: 26px;

  background:
    radial-gradient(900px 520px at 50% 18%, rgba(52,217,255,.18), rgba(0,0,0,0) 60%),
    radial-gradient(900px 520px at 85% 22%, rgba(168,92,255,.14), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #070b18, #040611);

  transition: opacity .35s ease, transform .35s ease;
}
.cv-splash.cv-hide{ opacity:0; pointer-events:none; transform: translateY(-8px); }

.cv-logoWrap{
  width: 104px;
  height: 104px;
  border-radius: 26px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  display:grid;
  place-items:center;
  overflow:hidden;
  position:relative;
}
.cv-logoWrap::before{
  content:"";
  position:absolute; inset:-45%;
  background: conic-gradient(
    from 180deg,
    rgba(43,123,255,0),
    rgba(43,123,255,.72),
    rgba(52,217,255,.75),
    rgba(168,92,255,.70),
    rgba(43,123,255,.72),
    rgba(43,123,255,0)
  );
  filter: blur(14px);
  opacity:.52;
  animation: cvSpin 3.2s linear infinite;
}
@keyframes cvSpin{ to{ transform: rotate(360deg); } }

.cv-logoPng{
  width: 74px;
  height: 74px;
  object-fit: contain;
  position:relative;
  z-index:1;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));
}

.cv-splashTitle{
  margin:0;
  font-size: 18px;
  font-weight: 950;
  letter-spacing:.25px;
  text-align:center;
}
.cv-splashText{
  margin:0;
  max-width: 320px;
  text-align:center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.cv-progress{
  width: min(280px, 78vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  margin-top: 4px;
}
.cv-progress > span{
  display:block;
  height:100%;
  width:0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--eqG), var(--eqY), var(--eqO), var(--eqR));
  box-shadow: 0 0 18px rgba(0,255,76,.18);
}
