/* ---------- Design tokens ---------- */
:root {
  --bg: #000000;
  --card: #ffffff;
  --text-primary: #000000;
  --text-secondary: #6e6e73;
  --accent: #007aff;
  --divider: #e5e5ea;
  --badge: #ff3b30;
  --icon-bg: #1a1128;
  --icon-line: #a78bfa;
  --icon-node: #c4b5fd;
  --icon-center: #7c3aed;
  --dot-size: 13px;
  --ring-radius: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 46px;
}

/* ---------- Modal ---------- */
.modal {
  background: var(--card);
  width: 300px;
  max-width: 100%;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  padding: 34px 26px 0;
  text-align: center;
}

.icon-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
}

.icon-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: -5px;
  right: -6px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--badge);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  border: 2px solid #ffffff;
}

h1 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.3px;
}

.subtitle {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #000000;
}

.divider {
  margin-top: 24px;
  height: 1px;
  background: var(--divider);
}

/* ---------- Action area ---------- */
.action-area {
  display: flex;
  flex-direction: column;
}

.install-btn {
  display: block;
  width: 100%;
  padding: 13px 0 16px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
}

.install-btn:hover:not(:disabled) { background: rgba(0, 122, 255, 0.06); }
.install-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.install-btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- Loading dots ---------- */
.loader {
  position: relative;
  width: 80px;
  height: 80px;
  flex: none;
}

.dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot-size);
  height: var(--dot-size);
  margin-left: -6.5px; /* -dot-size / 2 */
  margin-top: -6.5px;  /* -dot-size / 2 */
  border-radius: 50%;
  background-color: rgb(82, 201, 82);
  box-shadow: 0 0 6px rgba(82, 201, 82, 0.28);
  will-change: background-color;
}

/* Static solid dots: top bright green -> clockwise to bottom deep green -> back to bright.
   All shades stay visible on the black page background.
   Explicit rotation (ring radius 24px) for maximum browser compatibility. */
.dot:nth-child(1) { background-color: #c8f7c0; transform: rotate(0deg) translateY(-24px); }
.dot:nth-child(2) { background-color: #7ce07c; transform: rotate(45deg) translateY(-24px); }
.dot:nth-child(3) { background-color: #4ec94e; transform: rotate(90deg) translateY(-24px); }
.dot:nth-child(4) { background-color: #2fae2f; transform: rotate(135deg) translateY(-24px); }
.dot:nth-child(5) { background-color: #1f8f1f; transform: rotate(180deg) translateY(-24px); }
.dot:nth-child(6) { background-color: #2fae2f; transform: rotate(225deg) translateY(-24px); }
.dot:nth-child(7) { background-color: #4ec94e; transform: rotate(270deg) translateY(-24px); }
.dot:nth-child(8) { background-color: #7ce07c; transform: rotate(315deg) translateY(-24px); }

/* Alternating bright/dim chasing wave while installing.
   Explicit per-dot delays (2.5s / 8 = 0.3125s) for maximum browser compatibility. */
.loader.loading .dot {
  animation: flow 2.5s linear infinite;
}
.loader.loading .dot:nth-child(1) { animation-delay: 0s; }
.loader.loading .dot:nth-child(2) { animation-delay: -0.3125s; }
.loader.loading .dot:nth-child(3) { animation-delay: -0.625s; }
.loader.loading .dot:nth-child(4) { animation-delay: -0.9375s; }
.loader.loading .dot:nth-child(5) { animation-delay: -1.25s; }
.loader.loading .dot:nth-child(6) { animation-delay: -1.5625s; }
.loader.loading .dot:nth-child(7) { animation-delay: -1.875s; }
.loader.loading .dot:nth-child(8) { animation-delay: -2.1875s; }

@keyframes flow {
  0%, 100% { background-color: #c8f7c0; }
  50% { background-color: #1f8f1f; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #ffffff; }
  .modal { box-shadow: none; border: 1px solid #dddddd; }
}
