:root {
  color-scheme: dark;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --panel: rgba(12, 16, 24, 0.72);
  --panel-strong: rgba(12, 16, 24, 0.9);
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --accent: #32f5c8;
  --accent-2: #ff4fd8;
  --accent-3: #ffdd57;
  --route-progress: #25f7c4;
  --route-passed: #22c55e;
  --route-current: #facc15;
  --points-bonus: #25f7c4;
  --points-malus: #ff4fba;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: transparent;
  overflow: hidden;
  font-family: var(--font);
  letter-spacing: 0;
}

body {
  color: var(--text);
}

#overlay-root {
  width: 100vw;
  height: 100vh;
  padding: clamp(12px, 2.1vw, 34px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.stack {
  display: grid;
  gap: clamp(10px, 1.25vw, 18px);
  width: min(720px, 94vw);
}

.widget {
  position: relative;
  overflow: hidden;
  width: min(520px, 94vw);
  min-height: 136px;
  padding: clamp(16px, 1.8vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);

  isolation: isolate;
  transform-origin: left center;
}

.all-stack .widget {
  width: min(640px, 94vw);
}

.widget-glow {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  filter: blur(34px);
  opacity: 0.78;
  z-index: -1;
}

.goal-head,
.route-topline,
.route-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.metric-title {
  color: var(--muted);
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-subtitle,
.total-line,
.route-title,
.route-bottom {
  color: var(--muted);
  font-size: clamp(12px, 1.25vw, 15px);
  font-weight: 700;
}

.bonus-pill {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 58%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 16%, transparent);
  color: var(--text);
  font-size: clamp(12px, 1.15vw, 14px);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.goal-main {
  margin-top: 10px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 950;
  line-height: 0.96;
  font-variant-numeric: tabular-nums;
}

.metric-value small {
  color: var(--muted);
  font-size: 0.36em;
  font-weight: 850;
}

.progress-track,
.route-line {
  position: relative;
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: visible;
}

.progress-fill,
.route-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width 520ms cubic-bezier(.2, .8, .2, 1);
}

.goal-widget[data-goal="bits"] .progress-fill {
  background: var(--accent-2);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent-2) 70%, transparent);
}

.route-widget {
  width: min(1080px, 96vw);
  min-height: 108px;
  padding: 6px 14px 14px;
  overflow: visible;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.route-widget::before {
  content: "";
  position: fixed;
  top: -70px;
  left: 50%;
  width: min(1500px, 125vw);
  height: 300px;
  z-index: -1;
  border-radius: 0 0 999px 999px;
  background:
	  radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.68) 42%, rgba(0, 0, 0, 0.34) 72%, transparent 92%),
	  linear-gradient(180deg, rgba(0, 0, 0, 0.56), transparent 88%);
  filter: blur(28px);
  opacity: 0.95;
  transform: translateX(-50%);
  pointer-events: none;
}

.route-widget::after {
  display: none !important;
}

.route-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: clamp(18px, 3vw, 44px);
  min-width: 0;
  padding-bottom: 8px;
}

.route-distance,
.route-speed,
.route-percent {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.route-distance span,
.route-speed span,
.route-percent span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.route-distance strong,
.route-speed strong,
.route-percent strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 950;
  line-height: 0.86;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.route-distance strong {
  font-size: clamp(44px, 5.2vw, 72px);
}

.route-speed strong,
.route-percent strong {
  font-size: clamp(30px, 3.2vw, 44px);
}

.route-distance small,
.route-speed small,
.route-percent small {
  color: var(--muted);
  font-size: 0.28em;
  font-weight: 850;
}

.route-progress-wrap {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0 clamp(58px, 7vw, 88px);
}

.route-line {
  height: 14px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.route-fill {
  background: var(--route-progress);
  box-shadow: 0 0 20px color-mix(in srgb, var(--route-progress) 70%, transparent);
}

.route-bottom {
  align-items: center;
  color: var(--text);
  font-size: clamp(13px, 1.35vw, 18px);
  white-space: nowrap;
}

.route-bottom span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 108px;
  pointer-events: none;
}

.stage-dot .dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.stage-dot.is-active .dot {
  background: var(--route-passed);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--route-passed) 42%, transparent), 0 0 18px var(--route-passed);
}

.stage-dot strong {
  position: absolute;
  top: 23px;
  max-width: 130px;
  color: var(--text);
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
  white-space: normal;
}

.route-current-dot {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 18px;
  height: 18px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--route-current);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--route-current) 42%, transparent), 0 0 20px var(--route-current);
  transform: translate(-50%, -50%);
}

.twitch-widget {
  width: min(520px, 96vw);
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.twitch-rings-grid,
.twitch-vertical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.twitch-ring-card,
.twitch-vertical-card,
.twitch-duo-row {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 44%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.twitch-bits {
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 44%),
    rgba(255, 255, 255, 0.045);
}

.twitch-ring-card {
  display: grid;
  place-items: center;
  height: 192px;
}

.twitch-ring {
  width: 124px;
  transform: translateY(-15px) rotate(-90deg);
  overflow: visible;
}

.twitch-ring .ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 100;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 72%, transparent));
}

.twitch-bits .ring-fill {
  stroke: var(--accent-2);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent-2) 72%, transparent));
}

.twitch-ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: 82%;
  transform: translate(-50%, -50%) translateY(-15px);
  text-align: center;
}

.twitch-ring-center span,
.vertical-copy span,
.duo-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.twitch-ring-center strong,
.vertical-copy strong,
.duo-main strong {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  color: var(--text);
  font-size: 34px;
  font-weight: 950;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.twitch-ring-center small,
.vertical-copy small,
.duo-main small {
  color: var(--muted);
  font-size: 0.42em;
  font-weight: 900;
}

.twitch-chip {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 15%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

.twitch-vertical-grid {
  width: min(330px, 96vw);
}

.twitch-vertical-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  height: 286px;
  padding: 14px 12px 11px;
}

.vertical-copy {
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.vertical-copy strong {
  font-size: 30px;
}

.vertical-tube {
  position: relative;
  width: 42px;
  height: 148px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.vertical-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 8px;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: height 520ms cubic-bezier(.2, .8, .2, 1);
}

.twitch-bits .vertical-fill {
  background: var(--accent-2);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent-2) 70%, transparent);
}

.twitch-vertical-card .twitch-chip {
  position: static;
  width: 100%;
  margin-top: 10px;
}

.twitch-duo {
  width: min(500px, 96vw);
}

.twitch-duo-grid {
  display: grid;
  gap: 8px;
}

.twitch-duo-row {
  display: grid;
  grid-template-columns: 126px 1fr 84px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
}

.duo-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.duo-main strong {
  justify-content: flex-start;
  font-size: 32px;
}

.duo-progress {
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.duo-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width 520ms cubic-bezier(.2, .8, .2, 1);
}

.twitch-bits .duo-fill {
  background: var(--accent-2);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent-2) 70%, transparent);
}

.duo-bonus {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

body[data-show-bonus-counts="false"] .twitch-duo-row {
  grid-template-columns: 126px 1fr;
}

.points-widget {
  width: min(390px, 96vw);
  min-height: 188px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.points-widget::before {
  content: "";
  position: fixed;
  left: -58px;
  bottom: -58px;
  width: min(620px, 74vw);
  height: 340px;
  z-index: -1;
  border-radius: 0 999px 0 0;
  background:
    radial-gradient(ellipse at 18% 82%, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.58) 42%, rgba(0, 0, 0, 0.24) 68%, transparent 84%),
    linear-gradient(35deg, rgba(0, 0, 0, 0.52), transparent 72%);
  filter: blur(30px);
  opacity: 0.94;
  pointer-events: none;
}

.points-widget::after,
.twitch-widget::after {
  display: none;
}

.points-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
}

.points-chain-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 188px;
  pointer-events: none;
}

.points-chain-icon img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.72));
}

.circle-pot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 188px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.circle-pot.points-malus {
  background: transparent;
}

.pot-ring {
  width: 64%;
  max-width: 138px;
  transform: rotate(-90deg);
  overflow: visible;
}

.ring-bg,
.ring-fill {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.36);
}

.ring-fill {
  stroke: var(--points-bonus);
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset 540ms cubic-bezier(.2, .8, .2, 1);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--points-bonus) 72%, transparent));
}

.points-malus .ring-fill {
  stroke: var(--points-malus);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--points-malus) 72%, transparent));
}

.pot-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 82%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: 1px;
  text-align: center;
}

.pot-center span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.76);
}

.pot-center strong {
  font-size: 30px;
  font-weight: 950;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.92), 0 0 22px rgba(0, 0, 0, 0.84);
}

.pot-center em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.76);
}

.pot-footer {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 15%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

.pulse {
  animation: pulse-in 700ms ease-out;
}

@keyframes pulse-in {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  28% {
    transform: scale(1.035);
    filter: brightness(1.28);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

body[data-kind="subs"] #overlay-root,
body[data-kind="bits"] #overlay-root,
body[data-kind="twitch"] #overlay-root {
  align-items: flex-start;
}

body[data-kind="points"] #overlay-root {
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 clamp(8px, 1.8vh, 20px) clamp(8px, 1.4vw, 18px);
}

body[data-kind="route"] #overlay-root {
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(4px, 1.2vh, 14px);
}

body[data-kind="route"] .widget {
  width: min(1120px, 96vw);
}

body[data-kind="all"] #overlay-root {
  padding: clamp(12px, 1.4vw, 20px);
}

body[data-kind="all"] .stack {
  gap: 10px;
  width: min(580px, 94vw);
}

body[data-kind="all"] .all-stack .widget {
  width: min(580px, 94vw);
  min-height: 142px;
  padding: clamp(14px, 1.25vw, 18px);
}

body[data-kind="all"] .metric-value {
  font-size: clamp(42px, 4.6vw, 60px);
}

body[data-kind="all"] .goal-main {
  margin-top: 6px;
}

body[data-kind="all"] .progress-track {
  margin-top: 12px;
}

body[data-kind="all"] .route-widget {
  min-height: 130px;
}

body[data-kind="all"] .route-strip {
  gap: 18px;
  padding-bottom: 12px;
}

body[data-kind="all"] .route-distance strong {
  font-size: clamp(34px, 4vw, 50px);
}

body[data-kind="all"] .route-speed strong,
body[data-kind="all"] .route-percent strong {
  font-size: clamp(24px, 2.9vw, 34px);
}

body[data-kind="all"] .route-distance span,
body[data-kind="all"] .route-speed span,
body[data-kind="all"] .route-percent span {
  font-size: 9px;
}

body[data-kind="all"] .route-progress-wrap {
  margin: 0 0 24px;
  padding: 0 42px;
}

body[data-kind="all"] .route-line {
  height: 10px;
}

body[data-kind="all"] .route-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 12px;
}

body[data-kind="all"] .stage-dot .dot {
  width: 12px;
  height: 12px;
}

body[data-kind="all"] .stage-dot strong {
  top: 17px;
  max-width: 92px;
  font-size: 10px;
}

body[data-style="neon"] {
  --panel: linear-gradient(135deg, rgba(8, 11, 18, 0.82), rgba(23, 24, 33, 0.7));
  --panel-strong: rgba(6, 8, 14, 0.96);
  --text: #f9fbff;
  --muted: rgba(235, 244, 255, 0.72);
  --line: rgba(72, 245, 205, 0.32);
  --accent: #25f7c4;
  --accent-2: #ff4fba;
  --accent-3: #f7d154;
}

body[data-style="neon"] .widget::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 26%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px);
  opacity: 0.22;
  pointer-events: none;
}

body[data-style="atlas"] {
  --panel: rgba(248, 250, 247, 0.92);
  --panel-strong: rgba(248, 250, 247, 1);
  --text: #111827;
  --muted: rgba(17, 24, 39, 0.62);
  --line: rgba(17, 24, 39, 0.14);
  --accent: #05a8aa;
  --accent-2: #f26d5b;
  --accent-3: #f2bd42;
  --shadow: 0 18px 64px rgba(17, 24, 39, 0.18);
}

body[data-style="atlas"] .widget {
  backdrop-filter: blur(12px);
}

body[data-style="atlas"] .bonus-pill {
  color: #111827;
}

body[data-style="signal"] {
  --panel: rgba(17, 18, 16, 0.86);
  --panel-strong: rgba(17, 18, 16, 0.98);
  --text: #fbfff5;
  --muted: rgba(251, 255, 245, 0.68);
  --line: rgba(203, 255, 64, 0.25);
  --accent: #caff40;
  --accent-2: #34d3ff;
  --accent-3: #ff7a3d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

body[data-style="signal"] .widget {
  border-left: 8px solid var(--accent);
}

body[data-style="signal"] .metric-title {
  color: var(--accent);
}

@media (max-width: 640px) {
  #overlay-root {
    padding: 10px;
  }

  .widget {
    min-height: 128px;
    padding: 14px;
  }

  .metric-value {
    font-size: 46px;
  }

  .goal-head,
  .route-topline,
  .route-bottom {
    align-items: flex-start;
  }

  .stage-dot strong {
    max-width: 82px;
    font-size: 10px;
  }

  .route-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .route-progress-wrap {
    margin-bottom: 28px;
  }

  .points-grid {
    grid-template-columns: 1fr;
  }

  .points-widget {
    min-height: auto;
  }
}
