/* ==============================================================
   LUDA EKIPA · NEXUS v3 — premium launcher aesthetics
   Steam / FACEIT / Battle.net energy: layered gradients, soft
   glows, translucent panels, refined motion. No WebGL.
   Worlds: hq (red) · cs16 (amber) · esports (blue) · ts (teal)
   ============================================================== */

:root {
  --w-hq:     #e0252e;
  --w-cs16:   #e8923a;
  --w-esport: #3aa0ff;
  --w-ts:     #2fd4c2;
  --w-accent: var(--w-hq);
  --amb:      224, 37, 46;        /* ambient hue as rgb triplet */
}
[data-world="hq"]      { --w-accent: var(--w-hq); }
[data-world="cs16"]    { --w-accent: var(--w-cs16); }
[data-world="esports"] { --w-accent: var(--w-esport); }
[data-world="ts"]      { --w-accent: var(--w-ts); }
body[data-world="hq"]      { --amb: 224, 37, 46; }
body[data-world="cs16"]    { --amb: 232, 146, 58; }
body[data-world="esports"] { --amb: 58, 160, 255; }
body[data-world="ts"]      { --amb: 47, 212, 194; }

/* ---------- layered ambient atmosphere (pure CSS, GPU-cheap) ---------- */
#ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#ambient .g1, #ambient .g2, #ambient .g3 {
  position: absolute; border-radius: 50%; filter: blur(90px);
  transition: background-color 1.6s ease;
  will-change: background-color;
}
#ambient .g1 { width: 66vw; height: 52vh; right: -16vw; top: -14vh;
  background: rgba(var(--amb), .105); }
#ambient .g2 { width: 50vw; height: 44vh; left: -14vw; bottom: -16vh;
  background: rgba(var(--amb), .055); }
#ambient .g3 { width: 34vw; height: 30vh; left: 36vw; top: 36vh;
  background: rgba(255, 255, 255, .018); }
#ambient::after { /* fine texture so gradients don't band */
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: radial-gradient(75% 65% at 50% 38%, #000, transparent 80%);
}
#dust { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- hero: clean cinematic ---------- */
body.nexus .hero { isolation: isolate; }
body.nexus .hero-video { filter: saturate(.94) contrast(1.04) brightness(.92); }
body.nexus .hero-video-wrap::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(125% 95% at 50% 28%, transparent 38%, rgba(10,11,13,.62) 100%);
}
.hero-inner { position: relative; z-index: 3; }
.hero-emblem { width: 78px; height: 78px; margin: 0 auto 16px; display: block;
  filter: drop-shadow(0 6px 22px rgba(224,37,46,.35)); }
.hero-typed {
  margin-top: 24px; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 10px;
  background: rgba(13,14,18,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.hero-typed .prompt { color: var(--red-2); }
.hero-typed .caret { width: 7px; height: 14px; background: var(--red-2); display: inline-block; animation: caretBlink 1.1s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }

/* ---------- connection tag (refined) ---------- */
.sec-conn {
  display: block; font-family: var(--f-mono); font-size: .6rem; letter-spacing: .26em;
  color: var(--w-accent); min-height: 1.1em; margin-bottom: 10px; opacity: 0;
  transition: opacity .4s; text-transform: uppercase;
}
.world-live .sec-conn { opacity: .75; }
.sec-conn .ok { color: var(--live); }
section[data-world] { position: relative; }
section[data-world] > .wrap { position: relative; z-index: 2; }

/* ---------- typography & spacing polish ---------- */
body.nexus .sec-head h2 { text-transform: uppercase; letter-spacing: .01em; }
body.nexus .section { padding-block: 104px; }

/* ==============================================================
   PANELS — launcher-style translucent surfaces (no boxes)
   ============================================================== */
body.nexus .card {
  background: linear-gradient(180deg, rgba(20,22,28,.55), rgba(12,13,16,.42));
  border: 0; border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.055), 0 14px 40px -22px rgba(0,0,0,.7);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
body.nexus .card::before { /* soft accent hairline on top */
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--w-accent, var(--red)) 55%, transparent), transparent);
  opacity: .35; transition: opacity .3s;
}
body.nexus .card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w-accent, var(--red)) 28%, rgba(255,255,255,.06)),
              0 22px 54px -26px color-mix(in srgb, var(--w-accent, var(--red)) 45%, rgba(0,0,0,.7));
}
body.nexus .card:hover::before { opacity: .85; }
body.nexus .ipcopy {
  background: rgba(8,9,11,.65); border: 0; border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  font-family: var(--f-mono);
  transition: box-shadow .2s;
}
body.nexus .ipcopy:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w-accent, var(--red)) 50%, transparent); }
body.nexus .srv-card .srv-top { font-family: var(--f-mono); letter-spacing: .13em; }

/* ---------- worlds band: minimal gates ---------- */
.worlds { padding: 92px 0 8px; }
.worlds-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.wpanel {
  --wa: var(--w-hq);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  align-items: center; text-align: center;
  min-height: 240px; padding: 30px 20px 20px;
  background: linear-gradient(180deg, rgba(20,22,28,.5), rgba(12,13,16,.35));
  border-radius: 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.wpanel[data-w="cs16"]    { --wa: var(--w-cs16); }
.wpanel[data-w="esports"] { --wa: var(--w-esport); }
.wpanel[data-w="ts"]      { --wa: var(--w-ts); }
.wpanel[data-w="hq"]      { --wa: var(--w-hq); }
.wpanel::before {
  content: ""; position: absolute; inset: 0; opacity: .4; transition: opacity .35s;
  background: radial-gradient(110% 70% at 50% -10%, color-mix(in srgb, var(--wa) 17%, transparent), transparent 62%);
}
.wpanel:hover { transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wa) 35%, transparent),
              0 24px 56px -28px color-mix(in srgb, var(--wa) 55%, transparent); }
.wpanel:hover::before { opacity: .85; }
.wpanel .wnum {
  position: relative; font-family: var(--f-mono); font-weight: 700; font-size: 2.5rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--wa) 80%, transparent);
}
.wpanel h3 { position: relative; font-size: 1.04rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.wpanel p { position: relative; font-size: .84rem; color: var(--ink-3); line-height: 1.55; flex: 1; }
.wpanel .wstat {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .14em; color: var(--ink-2);
  border-radius: 99px; padding: 4px 12px;
  background: rgba(10,11,13,.5); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.wpanel .wstat b { color: var(--wa); font-weight: 700; }
.wpanel .wgo {
  position: relative; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wa); display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
}
.wpanel .wgo::after { content: "→"; transition: transform .25s var(--ease); }
.wpanel:hover .wgo::after { transform: translateX(4px); }
@media (max-width: 1080px) { .worlds-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .worlds-grid { grid-template-columns: 1fr; } .wpanel { min-height: 0; } }

/* ---------- TS comms ---------- */
.com-grid .comms-card { grid-column: span 8; }
@media (max-width: 1024px) { .com-grid .comms-card { grid-column: span 6; } }
@media (max-width: 720px)  { .com-grid .comms-card { grid-column: span 12; } }
.comms-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.comms-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-family: var(--f-disp); text-transform: uppercase; letter-spacing: .04em; }
.comms-live { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .22em; color: var(--w-ts); display: inline-flex; align-items: center; gap: 7px; }
.comms-live .ld { width: 7px; height: 7px; }
.comms-tree { display: flex; flex-direction: column; gap: 4px; }
.comms-ch {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2);
  transition: background .2s;
}
.comms-ch:hover { background: rgba(255,255,255,.035); }
.comms-ch .chico { color: var(--w-ts); opacity: .8; width: 14px; }
.comms-ch .chname { flex: 1; letter-spacing: .04em; }
.comms-ch .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; opacity: 0; transition: opacity .4s; }
.comms-ch.talk .eq { opacity: 1; }
.comms-ch .eq i { width: 2.5px; background: var(--w-ts); height: 3px; animation: eqB 1s ease-in-out infinite; }
.comms-ch .eq i:nth-child(2) { animation-delay: .15s; } .comms-ch .eq i:nth-child(3) { animation-delay: .3s; }
.comms-ch .eq i:nth-child(4) { animation-delay: .45s; }
@keyframes eqB { 0%,100% { height: 3px; } 50% { height: 12px; } }
.comms-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- chrome polish ---------- */
body.nexus .ticker { border-block: 1px solid var(--line); background: rgba(10,11,13,.55); backdrop-filter: blur(6px); }
body.nexus #nav.solid { background: rgba(10,11,13,.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
::selection { background: rgba(224,37,46,.36); color: #fff; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #dust, .hero-typed .caret { display: none !important; }
  #ambient .g1, #ambient .g2, #ambient .g3 { transition: none; }
}
