/* RootWay FX layer — asosiy React build ustidan professional sayqal */

/* ---------- Global sayqal ---------- */
::selection { background: #1b1258; color: #fff; }
html { scrollbar-color: #1b2742 #06080b; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #06080b; }
::-webkit-scrollbar-thumb { background: linear-gradient(#141d31, #22335a); border-radius: 10px; border: 2px solid #06080b; }
::-webkit-scrollbar-thumb:hover { background: #8c7aff; }
:focus-visible { outline: 2px solid var(--acid, #8c7aff); outline-offset: 3px; border-radius: 4px; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---------- Scroll progress ---------- */
#rw-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0); z-index: 1000; pointer-events: none;
  background: linear-gradient(90deg, #1b1258, #8c7aff 60%, #c9c0ff);
  box-shadow: 0 0 12px rgba(140,122,255, .7);
}

/* ---------- Kursor ortidagi yorug'lik ---------- */
#rw-spotlight {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  transition: opacity .6s ease; mix-blend-mode: screen;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(140,122,255, .055), transparent 60%);
}
#rw-spotlight.on { opacity: 1; }
body.rw-light #rw-spotlight { display: none; }

/* ---------- Canvaslar ---------- */
#rw-binary-trail, #rw-rain { position: fixed; inset: 0; pointer-events: none; }
#rw-binary-trail { z-index: 999; }
#rw-rain { z-index: 2; opacity: .45; mix-blend-mode: screen; }
body.rw-light #rw-rain { display: none; }

/* ---------- Topbar ---------- */
.topbar { transition: background .35s ease, height .35s ease, box-shadow .35s ease; }
body.rw-scrolled .topbar { height: 64px; }
body.rw-scrolled .app-shell:not(.light-theme) .topbar {
  background: rgba(5,7,10, .86);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45), inset 0 -1px 0 rgba(140,122,255, .08);
}
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 1px;
  background: var(--acid); transform: scaleX(0); transform-origin: 50% 50%;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 10px var(--acid);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.logo-glyph { transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.logo:hover .logo-glyph { transform: rotate(-8deg) scale(1.06); box-shadow: 0 0 24px rgba(140,122,255, .5); }

/* ---------- Tugmalar ---------- */
.primary-action { position: relative; overflow: hidden; isolation: isolate; }
.primary-action::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.primary-action:hover::after { transform: translateX(120%); }
.primary-action:active, .secondary-action:active { transform: translateY(0) scale(.98); }
.secondary-action { transition: border-color .25s, background .25s, color .25s, transform .2s; }
.secondary-action:hover { border-color: rgba(140,122,255, .45); background: rgba(140,122,255, .06); color: #fff; transform: translateY(-2px); }

/* ---------- Kartalar: hover + yorug'lik ---------- */
.track-card, .catalog-card, .challenge-card, .path-card, .action-card,
.continue-card, .operator-card, .mission-panel, .terminal-card, .badge-card, .rank-row {
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), border-color .3s, box-shadow .45s, background .3s;
}
.track-card, .catalog-card, .challenge-card, .path-card, .action-card, .continue-card, .operator-card {
  position: relative;
}
.track-card::after, .catalog-card::after, .challenge-card::after, .path-card::after, .action-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(380px circle at var(--cx, 50%) var(--cy, 50%), rgba(140,122,255, .09), transparent 55%);
  opacity: 0; transition: opacity .35s;
}
.track-card:hover::after, .catalog-card:hover::after, .challenge-card:hover::after,
.path-card:hover::after, .action-card:hover::after { opacity: 1; }
.track-card:hover, .catalog-card:hover, .challenge-card:hover, .path-card:hover,
.action-card:hover, .continue-card:hover, .operator-card:hover {
  transform: translateY(-6px);
  border-color: rgba(140,122,255, .32) !important;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(140,122,255, .08), 0 0 40px -12px rgba(140,122,255, .25);
}
.badge-card:hover { transform: translateY(-4px); }
.rank-row:hover { background: rgba(140,122,255, .035); }
.mission-panel { box-shadow: 0 40px 120px -40px rgba(140,122,255, .18), 0 0 0 1px rgba(140,122,255, .06); }
.mission-panel:hover { box-shadow: 0 50px 140px -40px rgba(140,122,255, .28), 0 0 0 1px rgba(140,122,255, .14); }
.terminal-card { box-shadow: 0 40px 120px -50px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04); }

/* ---------- O'qilishi (juda mayda shriftlar kattalashtirildi) ---------- */
.badge-card small { font-size: 9px !important; }
.badge-card b { font-size: 15px !important; }
.badge-card p { font-size: 11.5px !important; color: #898d95 !important; }
.hero-copy > p { color: #a7abb2; }

/* ---------- Hero: matnga nur ---------- */
.hero-copy h1 { text-wrap: balance; }
.app-shell:not(.light-theme) .hero-copy h1 > span:first-child {
  -webkit-text-fill-color: transparent; background: linear-gradient(100deg, #ffffff 0%, #ffffff 40%, #c9c0ff 50%, #ffffff 60%, #ffffff 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  animation: rw-sheen 7s ease-in-out infinite;
}
@keyframes rw-sheen { 0%, 60% { background-position: 100% 0; } 100% { background-position: -50% 0; } }

/* ---------- CTA bo'limi ---------- */
.cta-section { position: relative; }
.cta-section::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  background: conic-gradient(from var(--rw-angle, 0deg), transparent 0 70%, rgba(140,122,255, .55) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
  animation: rw-spin 6s linear infinite;
}
@property --rw-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes rw-spin { to { --rw-angle: 360deg; } }

/* ---------- Toast (exit-intent / easter egg) ---------- */
#rw-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 1001; width: min(380px, calc(100vw - 32px));
  padding: 18px 18px 16px; border: 1px solid rgba(140,122,255, .28); border-radius: 12px;
  background: rgba(7,9,13, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: #e9ebf0; font-family: Manrope, sans-serif;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 50px -20px rgba(140,122,255, .4);
  transform: translateY(20px); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .45s;
}
#rw-toast.show { transform: none; opacity: 1; }
#rw-toast small { display: block; color: #8c7aff; font: 500 10px "DM Mono", monospace; letter-spacing: .14em; margin-bottom: 8px; }
#rw-toast b { display: block; font-size: 16px; margin-bottom: 6px; }
#rw-toast p { margin: 0 0 14px; color: #9498a1; font-size: 13px; line-height: 1.55; }
#rw-toast .rw-row { display: flex; gap: 8px; }
#rw-toast a, #rw-toast button {
  flex: 1; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font: 700 12px Manrope, sans-serif; cursor: pointer; border: 1px solid rgba(255, 255, 255, .12);
}
#rw-toast a { background: #1b1258; color: #fff; border-color: rgba(140,122,255,.55); }
#rw-toast button { background: transparent; color: #cacdd4; }
#rw-toast code { color: #8c7aff; font-family: "DM Mono", monospace; font-size: 12px; }

/* ---------- Konami: ACCESS GRANTED ---------- */
#rw-granted {
  position: fixed; inset: 0; z-index: 1002; display: grid; place-items: center; pointer-events: none;
  background: rgba(3,4,7, .82); opacity: 0; transition: opacity .3s;
  font: 700 clamp(28px, 6vw, 72px) "DM Mono", monospace; color: #8c7aff; letter-spacing: .08em;
  text-shadow: 0 0 30px rgba(140,122,255, .8);
}
#rw-granted.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #rw-rain, #rw-spotlight { display: none; }
  .app-shell .hero-copy h1 > span:first-child, .cta-section::before { animation: none; }
  * { scroll-behavior: auto !important; }
}
@media (hover: none) { #rw-spotlight, #rw-binary-trail { display: none; } }

/* Yorug' temada "Kirish" tugmasi ko'rinmay qolardi */
.light-theme .text-button:not(.join) { color: #0e121a; }

/* Sizning rangingiz (#1b1258) — tugmalar uchun */
.light-theme { --rw-edge: rgba(27, 18, 88, .55); }
.primary-action:hover, .join:hover, .launch-button:hover, .auth-submit:hover, .flag-console button:hover, .detail-actions > button:hover {
  background: #261a7a !important;
  box-shadow: inset 0 0 0 1px rgba(140, 122, 255, .7), 0 10px 35px -8px rgba(140, 122, 255, .45) !important;
}
/* Yorug' temada ham qorong'i qoladigan panellar ichida yorqin tus */
.light-theme .mission-panel, .light-theme .terminal-card { --acid: #8c7aff; }
