@font-face {
  font-family: "Handjet";
  src: url("/assets/fonts/handjet-latin-full-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Departure Mono";
  src: url("/assets/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --deep: #16057f;
  --plate: #2008ba;
  --cy: #8ff6ff;
  --cy-dim: #8ff6ff8c;
  --mag: #ee7bf5;
  --line: #8ff6ff6b;
  --pad: clamp(10px, 2.4vw, 22px);
}

* { box-sizing: border-box; }

html, body {
  background: var(--deep);
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--cy);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  font-family: "Departure Mono", ui-monospace, monospace;
}

#app {
  background: radial-gradient(120% 90% at 50% 42%, #3a17e8 0%, var(--plate) 46%, var(--deep) 100%);
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* faint scanline texture, purely decorative, no filler beyond what the reference already carries */
#app::after {
  content: "";
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 6;
  background: repeating-linear-gradient(#00000029 0 1px, #0000 1px 3px);
  position: absolute;
  inset: 0;
}

.shout {
  z-index: 1;
  text-align: center;
  letter-spacing: .01em;
  text-transform: lowercase;
  color: #dffcff;
  text-shadow: 0 0 8px #8ff6ffbf, 0 0 34px #59a0ff8c;
  width: 92vw;
  margin: 0;
  font-family: "Handjet", "Departure Mono", monospace;
  font-variation-settings: "wght" 500, "ELGR" 1, "ELSH" 2;
  font-size: clamp(2.9rem, 13.5vw, 10.5rem);
  line-height: .86;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.shout span { display: block; }
.shout span:last-child {
  color: var(--mag);
  text-shadow: 0 0 10px #ee7bf5cc, 0 0 40px #ee7bf573;
}

.stage {
  z-index: 3;
  position: absolute;
  inset: 0;
}

.dog { position: absolute; inset: 0; }

.dog img {
  transform-origin: 50%;
  image-rendering: pixelated;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  position: absolute;
  top: 0;
  left: 0;
}

.dog .head, .dog .body {
  filter: drop-shadow(0 0 14px #8ff6ff73);
}

.floor {
  transform-origin: 50%;
  will-change: transform;
  background: radial-gradient(50% 50%, #ee7bf58c 0%, #8ff6ff38 45%, #8ff6ff00 100%);
  position: absolute;
  top: 0;
  left: 0;
}

.preboot .ghost, .preboot .floor { display: none; }
.preboot .head {
  width: min(30vh, 34vw);
  height: auto;
  top: 12%;
  left: 50%;
  transform: translate(-50%);
}
.preboot .body {
  width: min(20.6vh, 23.4vw);
  height: auto;
  top: calc(12% + min(29vh, 33vw));
  left: 50%;
  transform: translate(-50%);
}

.ghost { opacity: 0; filter: saturate(1.4); }
.g1 { opacity: .3; }
.g2 { opacity: .19; }
.g3 { opacity: .1; }

.hud {
  z-index: 5;
  border: 2px solid var(--line);
  letter-spacing: .06em;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  background: #06003e57;
  border-radius: 10px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: clamp(11px, 1.5vw, 14px);
  display: flex;
  position: absolute;
}
.hud .k { color: var(--cy-dim); }
.hud .n { color: #fff; text-align: right; min-width: 2.6ch; font-weight: 400; }
.hud .u { color: var(--cy-dim); }
.hud .gap { margin-left: 6px; }

.hud-ping { top: var(--pad); right: var(--pad); }
.hud-behind { top: var(--pad); left: var(--pad); }
.hud-worst { left: var(--pad); bottom: calc(var(--pad) + 84px); }

.ic {
  background: var(--cy);
  flex: none;
  width: 15px;
  height: 15px;
  -webkit-mask: none 50%/contain no-repeat;
  mask: none 50%/contain no-repeat;
}
.ic-hourglass { -webkit-mask-image: url(/assets/icons/hourglass.svg); mask-image: url(/assets/icons/hourglass.svg); }
.ic-signal { -webkit-mask-image: url(/assets/icons/aerial-signal.svg); mask-image: url(/assets/icons/aerial-signal.svg); }
.ic-globe { -webkit-mask-image: url(/assets/icons/wireframe-globe.svg); mask-image: url(/assets/icons/wireframe-globe.svg); }

.bars { align-items: flex-end; gap: 2px; height: 13px; margin-left: 2px; display: inline-flex; }
.bars s { background: var(--cy-dim); width: 3px; text-decoration: none; display: block; }
.bars s:nth-child(1) { height: 25%; }
.bars s:nth-child(2) { height: 50%; }
.bars s:nth-child(3) { height: 75%; }
.bars s:nth-child(4) { height: 100%; }
.bars.q1 s:nth-child(-n+1),
.bars.q2 s:nth-child(-n+2),
.bars.q3 s:nth-child(-n+3),
.bars.q4 s:nth-child(-n+4) { background: var(--cy); box-shadow: 0 0 6px var(--cy); }

.fix {
  z-index: 5;
  left: 50%;
  bottom: calc(var(--pad) + 74px);
  border: 2px solid var(--cy);
  color: var(--cy);
  letter-spacing: .14em;
  cursor: pointer;
  background: #06003e80;
  border-radius: 12px;
  padding: 12px 26px;
  font-family: inherit;
  font-size: clamp(13px, 1.9vw, 17px);
  position: absolute;
  transform: translate(-50%);
  box-shadow: 0 0 18px #8ff6ff47, inset 0 0 12px #8ff6ff24;
}
.fix:hover { background: #8ff6ff24; }
.fix.on {
  background: var(--mag);
  color: #22004a;
  border-color: #fff;
  box-shadow: 0 0 26px #ee7bf599;
}

.foot {
  z-index: 5;
  padding: 10px var(--pad) calc(8px + env(safe-area-inset-bottom));
  letter-spacing: .05em;
  background: #06003e66;
  border-top: 2px solid #8ff6ff38;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  font-size: clamp(10px, 1.3vw, 13px);
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.foot p { margin: 0; }
.foot .k { color: var(--cy-dim); }
.ca b { color: #fff; word-break: break-all; font-weight: 400; }
.links { align-items: baseline; gap: 14px; margin-left: auto; display: flex; }
.links a { color: var(--cy); border-bottom: 1px dotted var(--cy-dim); text-decoration: none; }
.links a:hover { color: #fff; }
.links b { color: var(--mag); font-weight: 400; }
.src { color: #8ff6ff5c; letter-spacing: .03em; width: 100%; font-size: clamp(9px, 1.1vw, 11px); }

#boom { font-family: "Departure Mono", monospace; }

@media (width <= 620px) {
  .hud-behind { top: var(--pad); left: var(--pad); right: var(--pad); }
  .hud-ping { top: calc(var(--pad) + 40px); right: var(--pad); left: auto; }
  .hud-worst { top: calc(var(--pad) + 40px); left: var(--pad); bottom: auto; right: auto; }
  .wide { display: none; }
  .hud { gap: 6px; padding: 6px 9px; }
  .shout { font-size: clamp(2.6rem, 15vw, 5rem); top: 27%; }
  .fix { bottom: calc(var(--pad) + 96px); }
  .links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
}
