/* ==========================================================================
   Speedtest UI – Monochrome Grey Glass (wie live-token-tron.php)
   Ziel: Speedtest ist ein normaler Seiten-Block (kein eigenes "Window"):
   - Card + S-Icon sind im DOM-Flow (scrollen mit der Seite)
   - Kein internes Scroll-Verhalten / kein "fixed floating"
   - Kein Horizontal-Scroll durch übergroße Glows
   ========================================================================== */

/* Nur Horizontal-Overflow verhindern (nicht alles global "killen") */
html, body{
  overflow-x: hidden;
  background: #fff; /* verhindert "schwarze Ecken" beim Overscroll auf manchen Browsern */
}

/* Stage */
.bpst-stage{
  position: relative;
  width: 100%;
}

/* Background Glow: KEIN negativer inset -> verhindert Horizontal-Overflow */
.bpst-pagebg{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(circle at 82% 22%, rgba(240,240,240,0.18), transparent 58%),
    radial-gradient(circle at 55% 88%, rgba(255,255,255,0.14), transparent 62%);
}

/* Wrapper: Variablen wie vorher + z-index über bg */
.bpst-wrap{
  --txt: #56585e;
  --alpha: 0.85;
  --panel: rgba(230,230,230,var(--alpha));
  --panelSub: rgba(245,245,245,calc(var(--alpha)*0.95));
  --panelAlt: rgba(235,235,235,calc(var(--alpha)*0.90));
  --border: rgba(255,255,255,0.55);

  --round: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.12);
  --shadowSoft: 0 14px 34px rgba(0,0,0,0.20);

  --icon: 56px;
  --gap: 12px;

  position: relative;
  z-index: 1;

  width: 100%;
  max-width: 1180px;   /* S + Card sind "gebunden" (gleiche Breite) */
  margin: 0 auto;

  padding-top: calc(var(--icon) + var(--gap)); /* Platz für S oben */
  font-family: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--txt);
}

/* Saubere Box-Sizing nur im Modul */
.bpst-wrap,
.bpst-wrap *{
  box-sizing: border-box;
}

/* Trigger (S) – NICHT fixed: scrollt mit der Seite / mit der Card */
.bpstTrigger{
  position: absolute;
  top: var(--gap);
  left: var(--gap);

  width: var(--icon);
  height: var(--icon);
  z-index: 5;

  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);

  display: grid;
  place-items: center;
  cursor: pointer;

  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(120%);
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
  color: var(--txt);
}

.bpstTrigger:hover{
  transform: translateY(-1px) scale(1.02);
}

@keyframes bpstFloatY{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes bpstPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}

.bpstTrigger .pulse{
  animation: bpstFloatY 2.6s ease-in-out infinite, bpstPulse 3.2s ease-in-out infinite;
}

.bpstTrigger .ico{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;

  background: var(--txt);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* Drawer */
.bpstDrawer{
  width: 100%;
  margin: 0;

  position: relative;

  border: 1px solid var(--border);
  border-radius: var(--round);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panelSub) 100%);
  backdrop-filter: blur(12px) saturate(120%);

  /* ✅ wieder echter Außen-Schatten, damit unten nicht "abgeschnitten" wirkt */
  box-shadow: var(--shadow);

  overflow: hidden; /* damit innere Glows sauber in der Rundung bleiben */
  color: var(--txt);

  max-height: 0;
  opacity: 0;
  transition: max-height .32s ease, opacity .22s ease;
}

.bpstDrawer.open{
  max-height: 9999px;
  opacity: 1;
}

/* Innerer Glow: bleibt im Drawer (Drawer hat overflow hidden) */
.bpstGlow{
  position: absolute;
  inset: -120px;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.28), transparent 60%),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.18), transparent 62%),
    radial-gradient(circle at 55% 85%, rgba(255,255,255,0.14), transparent 64%);
}

/* Top bar */
.bpstTop{
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;

  padding: 14px 16px;
  background: var(--panelAlt);
  border-bottom: 1px solid var(--border);
}

.bpstTopLeft{ min-width: 0; }

.bpstBadge{
  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;

  padding: 2px 10px;
  border-radius: 999px;

  background: rgba(255,255,255,.25);
  border: 1px solid var(--border);
  color: var(--txt);
}

.bpstTitle{
  margin: 10px 0 6px;
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--txt);
}

.bpstAccent{
  color: var(--txt);
  font-weight: 900;
}

.bpstSubtitle{
  margin: 0;
  max-width: 760px;
  color: rgba(86,88,94,0.92);
  line-height: 1.45;
  font-weight: 500;

  /* schützt vor Überlauf bei langen Wörtern/URLs */
  overflow-wrap: anywhere;
}

.bpstTopRight{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 220px;
}

.bpstBtn{
  position: relative;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 12px 16px;

  font-weight: 800;
  cursor: pointer;

  color: #fff;
  background: linear-gradient(180deg, rgba(140,143,149,0.95), rgba(86,88,94,0.95));
  box-shadow: 0 18px 38px rgba(0,0,0,0.28), inset 0 2px 0 rgba(255,255,255,0.18);

  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  min-width: 220px;
  text-align: center;
  user-select: none;

  max-width: 100%;
}

.bpstBtn:hover{
  transform: translateY(-1px);
  filter: saturate(1.02);
  box-shadow: 0 24px 52px rgba(0,0,0,0.32), inset 0 2px 0 rgba(255,255,255,0.18);
}

.bpstBtn:disabled{
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.bpstBtnShine{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(120px 40px at 25% 20%, rgba(255,255,255,0.35), transparent 65%);
}

.bpstNote{
  font-size: 13px;
  color: rgba(86,88,94,0.90);
  text-align: right;
  min-height: 18px;
}

.bpstGrid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  padding: 14px 16px 12px;
}

@media (max-width: 980px){
  .bpstGrid{ grid-template-columns: 1fr; }
  .bpstTop{ flex-wrap: wrap; }
  .bpstTopRight{ align-items: flex-start; min-width: auto; width: 100%; }
  .bpstNote{ text-align: left; }
  .bpstBtn{ width: 100%; min-width: 0; }
}

/* Panels */
.bpstPanel{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(245,245,245,0.55);
  box-shadow: var(--shadowSoft), inset 0 0 0 1px rgba(255,255,255,0.12);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.bpstPanel::after{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(240px 90px at 30% 0%, rgba(255,255,255,0.26), transparent 62%);
}

.bpstPanelPrimary{ min-height: 220px; }

.bpstPanelMetrics{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Verdict */
.bpstVerdict{
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--txt);
  text-shadow: 0 1px 10px rgba(0,0,0,0.10);
}

.bpstVerdictSub{
  margin-top: 6px;
  color: rgba(86,88,94,0.92);
  line-height: 1.45;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Progressbar */
.bpstProgressRow{
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bpstProgressbar{
  position: relative;
  height: 14px;
  border-radius: 999px;
  flex: 1 1 280px;
  overflow: hidden;

  background: rgba(86,88,94,0.10);
  border: 1px solid rgba(0,0,0,0.10);

  min-width: 0;
}

.bpstProgressFill{
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;

  background: linear-gradient(180deg, rgba(86,88,94,.78), rgba(86,88,94,.48));
  box-shadow: 0 10px 18px rgba(86,88,94,.28);
  transition: width .18s ease;
}

.bpstProgressGloss{
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 34px at 25% 18%, rgba(255,255,255,0.38), transparent 70%);
  pointer-events: none;
}

.bpstStep{
  font-weight: 800;
  color: rgba(86,88,94,0.90);
}

/* Hint box */
.bpstHints{
  margin-top: 12px;
  color: rgba(86,88,94,0.92);
  line-height: 1.45;
  padding: 12px 12px;
  border-radius: 14px;

  border: 1px dashed rgba(86,88,94,0.22);
  background: rgba(255,255,255,0.32);

  overflow-wrap: anywhere;
}

/* Metrics */
.bpstMetric{
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(245,245,245,0.55);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.12);
}

.bpstMetricLabel{
  font-weight: 800;
  color: rgba(86,88,94,0.95);
}

.bpstMetricValue{
  margin-top: 8px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--txt);
  text-shadow: 0 1px 10px rgba(0,0,0,0.10);
}

.bpstUnit{
  font-size: 14px;
  font-weight: 800;
  color: rgba(86,88,94,0.90);
  margin-left: 4px;
}

.bpstMetricNote{
  margin-top: 6px;
  color: rgba(86,88,94,0.88);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* Footer */
.bpstFooter{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 16px;
  background: var(--panelAlt);
  border-top: 1px solid var(--border);
}

.bpstFootnote{
  color: rgba(86,88,94,0.92);
  font-size: 13px;
}

/* Verdict states: NICHT bunt. Nur minimal heller/dunkler */
.bpstDrawer.is-good .bpstVerdict{ color: #3f4046; }
.bpstDrawer.is-mid  .bpstVerdict{ color: #56585e; }
.bpstDrawer.is-bad  .bpstVerdict{ color: #2f3036; }

@media (prefers-reduced-motion: reduce){
  .bpstBtn, .bpstProgressFill, .bpstDrawer{ transition: none; }
  .bpstTrigger .pulse{ animation: none; }
}
