:root {
  color-scheme: dark;
  --ink: #02040a;
  --panel: rgba(3, 8, 17, 0.92);
  --line: rgba(150, 187, 222, 0.24);
  --line-hot: rgba(42, 108, 255, 0.58);
  --text: #d8dde2;
  --soft: #8e9bab;
  --dim: #596676;
  --cobalt: #145cff;
  --electric: #2680ff;
  --cyan: #42d9ff;
  --violet: #9a7cff;
  --amber: #ffb83e;
  --red: #ff5266;
  --green: #36d98b;
  --mono: "Cascadia Mono", "IBM Plex Mono", Consolas, monospace;
  --serif: "Iowan Old Style", Baskerville, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 63% -10%, rgba(20, 92, 255, 0.2), transparent 31rem),
    #02050a;
  color: var(--text);
  font-family: var(--mono);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(69, 112, 151, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 112, 151, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  pointer-events: none;
}

button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.noise {
  position: fixed;
  z-index: 20;
  inset: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  pointer-events: none;
}

.shell { width: min(100% - 20px, 1720px); margin: 10px auto; }

.frame {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015), 0 20px 70px rgba(0,0,0,.18);
}

.frame::after {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(127,171,209,.045);
  content: "";
  pointer-events: none;
}

.topbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 0 22px;
  overflow: hidden;
  border-bottom-color: rgba(38,128,255,.45);
}

.wordmark {
  position: relative;
  z-index: 2;
  width: max-content;
  color: #eef1ef;
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: .14em;
  text-decoration: none;
}

.visitorMarquee {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1;
  margin-left: 28px;
  overflow: hidden;
  border-left: 1px solid rgba(150,187,222,.2);
  mask-image: linear-gradient(90deg,transparent,black 3%,black 97%,transparent);
}

.visitorTrack {
  display: flex;
  width: max-content;
  animation: visitor-scroll 42s linear infinite;
  will-change: transform;
}

.visitorMarquee:hover .visitorTrack { animation-play-state: paused; }
.visitorGroup { display: flex; align-items: center; }

.visitorItem,
.visitorEmpty {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-right: 1px solid rgba(150,187,222,.13);
  color: #8492a2;
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
}

.visitorItem b {
  color: #4f6072;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}

.visitorItem.current {
  background: linear-gradient(90deg,rgba(20,92,255,.18),rgba(20,92,255,.04));
  color: #6fb2ff;
  text-shadow: 0 0 12px rgba(38,128,255,.48);
}

.visitorItem.current b { color: #2680ff; }

@keyframes visitor-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.logoMarquee {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg,transparent,black 5%,black 95%,transparent);
}

.logoTrack { display: flex; width: max-content; animation: logo-scroll 34s linear infinite; will-change: transform; }
.logoMarquee:hover .logoTrack { animation-play-state: paused; }
.logoGroup { display: flex; align-items: center; }

.brandLogo {
  display: grid;
  width: 128px;
  height: 58px;
  flex: none;
  place-items: center;
  border-right: 1px solid rgba(150,187,222,.13);
  opacity: .74;
  transition: opacity 160ms ease,background 160ms ease;
}

.brandLogo:hover { opacity: 1; background: rgba(20,92,255,.08); }
.brandLogo img { display: block; max-width: 104px; max-height: 29px; object-fit: contain; }
.brandLogo.peace img { filter: grayscale(1) brightness(1.65) contrast(1.1); }
.brandLogo.honor img { filter: grayscale(1) brightness(1.6); }
.brandLogo.security img { max-width: 112px; }
.brandLogo.delta img { max-width: 102px; }
.brandLogo.codm img { max-width: 112px; filter: grayscale(1) brightness(1.7); }
.brandLogo.valorant img { max-width: 74px; filter: brightness(1.8); }

.dashboard {
  display: grid;
  grid-template-columns: minmax(320px,.72fr) minmax(0,2.1fr);
  grid-template-rows: minmax(500px,auto) minmax(230px,auto);
  gap: 8px;
  margin-top: 8px;
}

.identity {
  grid-row: 1 / 3;
  min-height: 758px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 26%,rgba(20,92,255,.19),transparent 38%),rgba(2,7,14,.95);
}

.corner { position: absolute; z-index: 4; top: 12px; width: 16px; height: 16px; border-top: 2px solid var(--soft); }
.cornerTL { left: 12px; border-left: 2px solid var(--soft); }
.cornerTR { right: 12px; border-right: 2px solid var(--soft); }

.identityLabel {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  justify-content: space-between;
  color: var(--soft);
  font-size: 9px;
  letter-spacing: .1em;
}
.identityLabel b { color: var(--electric); font-weight: 500; }

.portraitStage {
  position: relative;
  display: flex;
  height: 620px;
  min-height: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 23px;
  margin: 0;
  padding: 58px 10px 38px;
  overflow: hidden;
}

.portraitStage::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: repeating-linear-gradient(0deg,rgba(255,255,255,.018) 0 1px,transparent 1px 4px);
  content: "";
  pointer-events: none;
}

.portraitHalo {
  position: absolute;
  z-index: 0;
  width: 84%;
  aspect-ratio: 1;
  border: 1px solid rgba(38,128,255,.25);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(20,92,255,.22),inset 0 0 55px rgba(20,92,255,.11);
}
.portraitHalo::before,.portraitHalo::after { position:absolute; inset:12%; border:1px dashed rgba(38,128,255,.2); border-radius:50%; content:""; }
.portraitHalo::after { inset: 28%; }

.portraitStage img {
  position: relative;
  z-index: 2;
  display: block;
  width: min(78%,330px);
  height: auto;
  border: 1px solid rgba(38,128,255,.56);
  background: white;
  box-shadow: 0 0 0 5px rgba(3,8,17,.78),0 26px 90px rgba(0,0,0,.52);
}

.portraitStage figcaption {
  position: relative;
  z-index: 4;
  display: flex;
  width: calc(100% + 2px);
  align-items: center;
  justify-content: space-between;
  margin: 0 -1px;
  color: transparent;
  font-family: "STSong", "Songti SC", "SimSun", var(--serif);
  font-size: clamp(27px,2.05vw,35px);
  font-weight: 500;
  line-height: 1;
  -webkit-text-stroke: .65px rgba(227,236,247,.92);
  paint-order: stroke fill;
  text-shadow: 0 0 17px rgba(38,128,255,.22);
}

.identityCopy {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 15px;
  left: 0;
  border-top: 1px solid var(--line);
  padding-top: 3px;
}

.majorTitle {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 2px);
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  color: transparent;
  font-family: var(--serif);
  font-size: 31px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  text-align: center;
  white-space: nowrap;
  -webkit-text-stroke: .9px rgba(231,238,248,.92);
  text-shadow: 0 0 18px rgba(38,128,255,.25);
}

.identityMarquee { width: 100%; }
.identityMarquee .logoTrack { animation-duration: 30s; }

.panel { overflow: hidden; }
.market,.users { grid-column: 2; }

.panelHeader {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.panelHeader > div:first-child { display: flex; min-width: max-content; align-items: center; gap: 12px; }
.panelHeader .index { display:grid; width:32px; height:32px; flex:none; place-items:center; border:1px solid var(--line-hot); color:var(--electric); font-size:10px; }
.panelHeader p,.panelHeader h2 { margin:0; }
.panelHeader p { color:var(--dim); font-size:8px; letter-spacing:.14em; }
.panelHeader h2 { margin-top:3px; color:#dbe0e3; font-family:var(--serif); font-size:19px; font-weight:400; letter-spacing:.04em; }
.panelHeader.compact { min-height:58px; }

.marketControls { display:flex; min-width:0; align-items:center; justify-content:flex-end; gap:10px; }
.productTabs,.periods,.sourceTabs { display:flex; border:1px solid var(--line); }
.productTabs button,.periods button,.sourceTabs button {
  min-width: 47px;
  height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--soft);
  font: 10px var(--mono);
  cursor: pointer;
}
.productTabs button { min-width:96px; padding:0 12px; }
.sourceTabs { display:grid; grid-template-columns:repeat(4,1fr); width:100%; }
.sourceTabs button { min-width:0; padding:0 5px; }
.productTabs button:last-child,.periods button:last-child,.sourceTabs button:last-child { border-right:0; }
.productTabs button:hover,.periods button:hover,.sourceTabs button:hover { color:white; background:rgba(38,128,255,.12); }
.productTabs button.active,.periods button.active,.sourceTabs button.active { color:white; background:rgba(20,92,255,.42); box-shadow:inset 0 0 0 1px var(--cobalt); }
.sourceTabs button.warn { color:var(--amber); }

.marketGrid { display:grid; grid-template-columns:minmax(340px,.77fr) minmax(400px,1.23fr); min-height:426px; }
.quote { display:flex; flex-direction:column; justify-content:center; padding:27px 28px 22px; border-right:1px solid var(--line); }
.eyebrow { margin:0; color:var(--electric); font-size:9px; letter-spacing:.16em; }
.quote h3 { margin:9px 0 0; color:#edf1f2; font-family:var(--serif); font-size:29px; font-weight:400; letter-spacing:.055em; }
.quoteValue { display:flex; align-items:flex-start; margin-top:19px; color:#eff1f0; }
.quoteValue span { margin-top:5px; font-family:var(--serif); font-size:30px; }
.quoteValue strong { font-family:var(--serif); font-size:clamp(68px,6.6vw,106px); font-weight:400; line-height:.82; letter-spacing:-.055em; }
.quoteCaption { min-height:14px; margin:14px 0 24px; color:var(--soft); font-size:10px; }
.sourceNote { min-height:14px; margin:10px 0 0; color:var(--dim); font-size:8px; line-height:1.6; }

.chartWrap { position:relative; display:flex; min-width:0; flex-direction:column; justify-content:center; padding:22px 21px 13px; background:linear-gradient(135deg,transparent 35%,rgba(20,92,255,.07)); }
.chartMeta { display:flex; justify-content:space-between; gap:10px; color:var(--dim); font-size:9px; }
.chartMeta span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chartMeta b { color:var(--electric); font-weight:500; }
#marketChart { width:100%; height:315px; overflow:visible; }
.chartGrid line { stroke:rgba(141,171,201,.12); stroke-width:1; stroke-dasharray:2 4; }
.chartLine { fill:none; stroke:var(--electric); stroke-width:1.7; vector-effect:non-scaling-stroke; }
.chartArea { stroke:none; }
.chartDots circle { fill:#eaf2ff; stroke:var(--electric); stroke-width:2; vector-effect:non-scaling-stroke; }
.chartEmpty { fill:var(--dim); font:10px var(--mono); }
.axisLabels { display:flex; justify-content:space-between; gap:12px; color:var(--dim); font-size:8px; }

.snapshotFlag { color:var(--dim); font-size:8px; letter-spacing:.1em; }
.nodeLegend { display:flex; align-items:center; justify-content:flex-end; gap:16px; padding:9px 16px 0; color:var(--soft); font-size:8px; }
.nodeLegend[hidden] { display:none; }
.nodeLegend span { display:flex; align-items:center; gap:5px; }
.nodeLegend i { width:11px; height:3px; box-shadow:0 0 8px currentColor; }

.userTable { padding:4px 16px 8px; }
.userRow { display:grid; min-height:64px; grid-template-columns:minmax(145px,.65fr) minmax(280px,2.35fr); align-items:center; gap:18px; border-top:1px solid var(--line); }
.userRow:first-child { border-top:0; }
.userName { display:flex; min-width:0; align-items:center; gap:11px; }
.userName > i { width:12px; height:12px; flex:none; border-radius:50%; }
.userName > i.online { background:var(--green); box-shadow:0 0 12px var(--green); }
.userName > i.offline { background:var(--red); box-shadow:0 0 12px var(--red); }
.userName b { overflow:hidden; color:#dce3e6; font-size:12px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }

.meter { position:relative; height:27px; overflow:hidden; border:1px solid var(--line); background:rgba(255,255,255,.025); }
.meterFill { position:absolute; inset:0 auto 0 0; display:flex; min-width:0; overflow:hidden; }
.meterFill i { height:100%; min-width:1px; }
.fillSGV { background:rgba(66,217,255,.74); color:var(--cyan); }
.fillSGH { background:rgba(154,124,255,.74); color:var(--violet); }
.fillINH { background:rgba(255,184,62,.74); color:var(--amber); }
.meter > span { position:absolute; inset:0; display:grid; place-items:center; color:white; font-size:8px; text-shadow:0 1px 4px #000,0 0 5px #000; }
.loadingState { min-height:100px; display:grid; place-items:center; margin:0; color:var(--dim); font-size:9px; }
.loadingState.error { color:var(--red); }

.userTable.isRestricted { padding:0; }

.accessDeniedStage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%,rgba(20,92,255,.18),transparent 32%),
    linear-gradient(135deg,rgba(6,17,42,.96),rgba(1,4,11,.99));
}

.accessDeniedStage::before,
.accessDeniedStage::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
}

.accessDeniedStage::before {
  background: repeating-linear-gradient(
    0deg,
    rgba(178,210,255,.055) 0,
    rgba(178,210,255,.055) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
}

.accessDeniedStage::after {
  background:
    linear-gradient(90deg,rgba(2,5,12,.86),transparent 13%,transparent 87%,rgba(2,5,12,.86)),
    linear-gradient(rgba(2,5,12,.72),transparent 20%,transparent 80%,rgba(2,5,12,.72));
  box-shadow: inset 0 0 80px rgba(0,0,0,.78);
}

.accessDeniedField {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 185%;
  height: 730px;
  align-content: center;
  gap: 8px;
  transform: translate(-50%,-50%) rotate(-30deg);
  opacity: .72;
  filter: saturate(1.12) contrast(1.07);
}

.accessDeniedRail {
  width: 100%;
  height: 96px;
  overflow: hidden;
  border-top: 1px solid rgba(72,126,255,.46);
  border-bottom: 1px solid rgba(72,126,255,.34);
  background-color: rgba(11,22,63,.68);
  background-repeat: repeat-x;
  background-position: 0 0;
  background-size: auto 100%;
  box-shadow: 0 0 22px rgba(24,77,255,.2),inset 0 0 18px rgba(27,73,255,.12);
  animation: access-screen-scroll var(--rail-speed) linear var(--rail-delay) infinite;
  will-change: background-position;
}

.accessDeniedStripA { background-image:url("./assets/access-strip-a.png"); }
.accessDeniedStripB { background-image:url("./assets/access-strip-b.png"); }
.accessDeniedRail.reverse { animation-direction: reverse; }

.accessDeniedNotice {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 238px;
  min-height: 102px;
  place-content: center;
  gap: 8px;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(56,119,255,.72);
  background: rgba(2,7,18,.88);
  box-shadow:
    0 0 0 5px rgba(2,7,18,.48),
    0 0 42px rgba(25,91,255,.38),
    inset 0 0 22px rgba(29,77,189,.14);
  text-align: center;
  backdrop-filter: blur(8px);
}

.accessDeniedNotice span {
  color: var(--electric);
  font-size: 8px;
  letter-spacing: .18em;
}

.accessDeniedNotice strong {
  color: #f0f4fa;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: .16em;
  text-shadow: 0 0 16px rgba(38,128,255,.62);
}

.commandbar { display:flex; min-height:52px; align-items:center; justify-content:space-between; gap:30px; margin-top:8px; padding:0 20px; color:var(--soft); font-size:9px; letter-spacing:.08em; }
.commandbar > span { color:#b6c0c8; }
.commandbar > span i { display:inline-block; width:7px; height:13px; margin-left:5px; background:var(--electric); box-shadow:0 0 10px var(--cobalt); vertical-align:middle; animation:blink 1s steps(1) infinite; }
.quickLinks { display:flex; align-items:center; gap:24px; min-width:58px; justify-content:flex-end; }

.privateSubEntry,.archiveEntry { position:relative; z-index:30; display:block; flex:none; border-radius:999px; transition:opacity 160ms ease,transform 160ms ease,box-shadow 160ms ease; }
.privateSubEntry { width:18px; height:18px; border:1px solid rgba(118,215,255,.55); background:rgba(118,215,255,.46); box-shadow:0 0 0 4px rgba(118,215,255,.08),0 0 18px rgba(118,215,255,.24); opacity:.68; }
.privateSubEntry:hover { opacity:1; transform:scale(1.18); box-shadow:0 0 0 6px rgba(118,215,255,.1),0 0 24px rgba(118,215,255,.52); }
.archiveEntry { width:11px; height:11px; border:1px solid rgba(255,90,167,.42); background:rgba(255,90,167,.34); box-shadow:0 0 0 3px rgba(255,90,167,.06),0 0 12px rgba(255,90,167,.18); opacity:.52; }
.archiveEntry:hover { opacity:.9; transform:scale(1.25); box-shadow:0 0 0 5px rgba(255,90,167,.08),0 0 18px rgba(255,90,167,.38); }

@keyframes blink { 50% { opacity:0; } }
@keyframes logo-scroll { to { transform:translateX(-50%); } }
@keyframes access-screen-scroll { to { background-position:-688px 0; } }

@media (max-width:1120px) {
  .dashboard { grid-template-columns:minmax(270px,.62fr) minmax(0,1.38fr); }
  .marketGrid { grid-template-columns:1fr; }
  .quote { border-right:0; border-bottom:1px solid var(--line); }
  .portraitStage { height:570px; }
  .marketControls { align-items:flex-end; flex-direction:column; gap:6px; }
  .chartWrap { min-height:320px; }
}

@media (max-width:760px) {
  .shell { width:min(100% - 12px,720px); margin:6px auto; }
  .topbar { min-height:52px; padding:0 13px; }
  .wordmark { font-size:22px; }
  .visitorMarquee { margin-left:14px; }
  .visitorItem,.visitorEmpty { padding:0 12px; font-size:10px; }
  .wordmark { font-size:20px; }
  .brandLogo { width:112px; height:54px; }
  .brandLogo img { max-width:92px; max-height:26px; }
  .brandLogo.security img,.brandLogo.codm img { max-width:98px; }
  .dashboard { display:block; }
  .identity,.market,.users { margin-top:6px; }
  .identity { min-height:670px; }
  .portraitStage { height:535px; padding:50px 8px 36px; }
  .portraitStage img { width:min(82%,310px); }
  .portraitStage figcaption { font-size:clamp(25px,7.2vw,29px); }
  .identityCopy { right:0; bottom:14px; left:0; }
  .majorTitle { font-size:28px; }
  .panelHeader { min-height:62px; align-items:flex-start; padding:10px 11px; }
  .marketHeader { flex-direction:column; }
  .marketControls { width:100%; align-items:center; flex-direction:row; justify-content:space-between; }
  .productTabs { min-width:0; }
  .productTabs button { min-width:0; padding:0 9px; }
  .periods button { min-width:39px; }
  .marketGrid { display:block; }
  .quote { padding:22px 18px 18px; }
  .quote h3 { font-size:25px; }
  .quoteValue strong { font-size:76px; }
  .chartWrap { min-height:250px; padding:15px 11px 9px; }
  #marketChart { height:205px; }
  .snapshotFlag { max-width:128px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .nodeLegend { padding-right:11px; }
  .userTable { padding:4px 11px 8px; }
  .userRow { grid-template-columns:minmax(88px,.65fr) minmax(150px,1.35fr); gap:9px; }
  .userName b { font-size:10px; }
  .accessDeniedStage { min-height:330px; }
  .accessDeniedField { width:230%; height:680px; }
  .accessDeniedRail { height:88px; }
  .accessDeniedNotice { min-width:210px; min-height:92px; }
  .accessDeniedNotice strong { font-size:24px; }
  .commandbar { min-height:46px; padding:0 12px; }
}

@media (prefers-reduced-motion:reduce) {
  * { scroll-behavior:auto !important; animation:none !important; transition:none !important; }
  .logoTrack { transform:translateX(0); }
}
