/* Gate styles — every selector is scoped to #tk-gate / #tk-dl / html[data-gate]. */
#tk-gate,
#tk-dl {
  --tk-bg: #fffee5;
  --tk-fg: #17181b;
  --tk-accent: #dda62a;
  --tk-accent-2: #f3c75b;
  --tk-muted: rgba(23, 24, 27, .58);
  --tk-dim: rgba(23, 24, 27, .36);
  --tk-line: rgba(20, 20, 24, .12);
  --tk-card: rgba(255, 255, 255, .8);
  --tk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
  font-family: var(--tk-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#tk-gate *,
#tk-gate *::before,
#tk-gate *::after,
#tk-dl *,
#tk-dl *::before,
#tk-dl *::after { box-sizing: border-box; }

#tk-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  color: var(--tk-fg);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tk-accent) 18%, transparent), transparent 60%),
    var(--tk-bg);
  opacity: 0;
  animation: tk-gate-in .28s ease .9s forwards;
  -webkit-tap-highlight-color: transparent;
}
html[data-gate-ready] #tk-gate { opacity: 1; animation: none; }
html:not([data-gate]) #tk-gate { display: none; }
html[data-gate="pass"] #tk-gate[data-state="pass"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
html[data-gate="loading"] body > *:not(#tk-gate):not(script):not(style):not(noscript),
html[data-gate="block"] body > *:not(#tk-gate):not(script):not(style):not(noscript) { visibility: hidden; }

@keyframes tk-gate-in { to { opacity: 1; } }

.tk-gate-panel {
  width: min(392px, calc(100vw - 36px));
  padding: 26px 24px 22px;
  border: 1px solid var(--tk-line);
  border-radius: 18px;
  background: var(--tk-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 18px 50px rgba(10, 12, 20, .14);
  text-align: center;
}
.tk-gate-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  object-fit: contain;
  border-radius: 16px;
}
.tk-gate-brand {
  margin: 0 0 2px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tk-muted);
}
.tk-gate-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .01em;
}
.tk-gate-sub {
  margin: 8px 0 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--tk-muted);
}

.tk-gate-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 9px;
  text-align: start;
}
html[data-gate="loading"] .tk-gate-steps { display: grid; }
.tk-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  font-size: 12.5px;
  color: var(--tk-dim);
  transition: color .2s ease;
}
.tk-step.is-active { color: var(--tk-fg); }
.tk-step.is-done { color: var(--tk-muted); }
.tk-step-dot {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--tk-line);
  background: transparent;
}
.tk-step.is-active .tk-step-dot {
  border-color: var(--tk-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tk-accent) 18%, transparent);
}
.tk-step.is-active .tk-step-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--tk-accent);
  animation: tk-pulse 1s ease-in-out infinite;
}
.tk-step.is-done .tk-step-dot { border-color: var(--tk-accent); background: var(--tk-accent); }
.tk-step.is-done .tk-step-dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}
@keyframes tk-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.tk-gate-progress {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tk-fg) 10%, transparent);
  overflow: hidden;
}
.tk-gate-bar { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--tk-accent), var(--tk-accent-2)); transition: width .1s linear; }
.tk-gate-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--tk-muted);
  font-variant-numeric: tabular-nums;
}

.tk-gate-unsupported { display: grid; gap: 10px; justify-items: center; padding: 6px 0 2px; }
.tk-gate-unsupported[hidden] { display: none; }
.tk-unsupported-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--tk-accent);
  background: color-mix(in srgb, var(--tk-accent) 14%, transparent);
  font-size: 22px;
  font-weight: 700;
}
.tk-unsupported-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.tk-unsupported-body { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--tk-muted); }

.tk-gate-enter,
.tk-gate-download,
#tk-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tk-accent), var(--tk-accent-2));
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--tk-accent) 28%, transparent);
}
.tk-gate-enter[hidden],
.tk-gate-download[hidden] { display: none; }

#tk-dl {
  position: fixed;
  right: 18px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 2147482990;
  display: none;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  box-shadow: 0 10px 26px rgba(10, 12, 20, .28);
}
html[data-gate="pass"] #tk-dl:not([hidden]) { display: inline-flex; }
#tk-dl:hover { filter: brightness(1.04); }
#tk-gate[data-state="blocked"] .tk-gate-title,
#tk-gate[data-state="blocked"] .tk-gate-sub,
#tk-gate[data-state="blocked"] .tk-gate-steps,
#tk-gate[data-state="blocked"] .tk-gate-progress,
#tk-gate[data-state="blocked"] .tk-gate-status { display: none; }

.tk-gate-toast {
  position: fixed;
  left: 50%;
  bottom: 150px;
  transform: translate(-50%, 8px);
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(20, 20, 24, .9);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 2147483001;
}
.tk-gate-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

#tk-gate[dir="rtl"] .tk-gate-panel { text-align: center; }
#tk-gate[dir="rtl"] .tk-gate-steps { text-align: right; }
#tk-gate[dir="rtl"] .tk-step { flex-direction: row-reverse; }

@media (max-width: 420px) {
  .tk-gate-panel { padding: 22px 18px 18px; border-radius: 16px; }
  .tk-gate-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #tk-gate, #tk-gate * { animation: none !important; transition: none !important; }
  #tk-gate { opacity: 1; }
}

/* marketing / announcement popups are mobile art and break the page; keep the site clean */
.popup-mask { display: none !important; }

/* The captured close asset is white-on-white; draw a visible X instead. */
.auth-popup__close-pill {
  position: relative !important;
  width: 48px !important;
  height: 48px !important;
  margin: 12px auto 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
  overflow: hidden !important;
  cursor: pointer;
}
.auth-popup__close-pill > div,
.auth-popup__close-pill > img,
.auth-popup__close-pill > span { display: none !important; }
.auth-popup__close-pill::before,
.auth-popup__close-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #b4212a;
}
.auth-popup__close-pill::before { transform: translate(-50%, -50%) rotate(45deg); }
.auth-popup__close-pill::after { transform: translate(-50%, -50%) rotate(-45deg); }

