:root {
  --bg: #0d0d0d;        /* flat near-black, rot.sh style */
  --grid: #141414;
  --panel: #141414;     /* panel fill */
  --border: rgba(255, 255, 255, 0.10);
  --ink: #c9c9c9;       /* muted light gray body text */
  --muted: #6f6f6f;     /* dim gray */
  --accent: #d9cce4;    /* pale lavender highlight */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  color: var(--ink);
  background-color: var(--bg);
  position: relative;
}

/* Grid lives on a separate layer so we can fade it toward the edges. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}

/* thin bar, pinned to the bottom */
.topbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #1a1a1a;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.topbar-left { color: var(--accent); }

.topbar-tag {
  color: #4a4458;
  background: var(--accent);
  padding: 1px 7px;
  border: none;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* stage: IP readout on top, the card row below, all centered */
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

/* the three cards side by side */
.cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

/* monochrome visitor IP readout */
.ipinfo {
  font-size: 12px;
  line-height: 1.6;
  color: #bdbdbd;
}
.ip-out {
  white-space: pre;
  color: #bdbdbd;
}
.ip-out::after {
  content: '▋';
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}

.glass-side { width: 320px; padding: 16px; align-self: center; }
.glass-side .discord,
.glass-side .repos { margin-top: 0; width: 100%; }

/* on narrow screens the cards stack */
@media (max-width: 1000px) {
  .glass-side { width: 100%; max-width: 360px; }
}

/* flat bordered panel, rot.sh style */
.glass {
  text-align: center;
  padding: 28px 40px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.glass h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  min-height: 1.4em; /* reserve space so the box doesn't jump while typing */
}

.cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.glass .sub {
  margin: 8px 0 0;
  font-size: 0.85rem;
  /* flowing rainbow text */
  background: linear-gradient(
    90deg,
    #ff0040, #ff8c00, #ffe000, #00d26a, #00b3ff, #8a2be2, #ff0040
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: rainbow 6s linear infinite;
}

@keyframes rainbow {
  to { background-position: 200% center; }
}

.socials {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* wireguard peer counter */
.wg {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.wg-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4b4b4b;
}
.wg.wg-live .wg-dot {
  background: #23a55a;
  box-shadow: 0 0 6px #23a55a;
  animation: wgpulse 2s ease-in-out infinite;
}
@keyframes wgpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* chip-style buttons, like the about/recent/tos row */
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  border-radius: 3px;
  color: var(--ink);
  background: #1f1f1f;
  border: 1px solid var(--border);
  transition: color .15s ease, background .15s ease;
}

.social svg { width: 18px; height: 18px; }

.social:hover {
  color: #ffffff;
  background: #2a2a2a;
}

/* ---- real-time discord profile card ---- */
.discord { width: 100%; }
.dc-loading { color: var(--muted); font-size: 12px; text-align: center; padding: 20px 0; }

/* banner bleeds to the card edges (cancels .glass-side padding) */
.dc-banner {
  height: 70px;
  margin: -16px -16px 0;
  background-size: cover;
  background-position: center;
  border-radius: 4px 4px 0 0;
}
.dc-body { position: relative; }

.dc-top { display: flex; align-items: flex-end; justify-content: space-between; }
.dc-avatar-wrap {
  position: relative;
  width: 64px; height: 64px;
  margin-top: -32px; /* overlap the banner */
  flex-shrink: 0;
}
.dc-avatar {
  width: 64px; height: 64px; border-radius: 50%; display: block;
  border: 4px solid var(--panel); background: var(--panel);
}
.dc-deco { position: absolute; inset: 0; width: 64px; height: 64px; transform: scale(1.18); pointer-events: none; }
.dc-status {
  position: absolute; right: 0; bottom: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--panel);
}

.dc-badges { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 4px; justify-content: flex-end; }
.dc-badge { width: 18px; height: 18px; }

/* custom animated badges: badge silhouette masks a flowing gradient */
.dc-cb {
  display: inline-block;
  width: 18px; height: 18px;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  background-size: 200% auto;
  animation: rainbow 4s linear infinite;
}
/* Nitro -> flowing rainbow */
.dc-cb-nitro {
  background-image: linear-gradient(90deg,#ff0040,#ff8c00,#ffe000,#00d26a,#00b3ff,#8a2be2,#ff0040);
  animation-duration: 4s;
}
/* Quest -> black + flowing metallic gold */
.dc-cb-quest {
  background-image: linear-gradient(90deg,#0a0a0a,#5c4710,#d4af37,#fff2b0,#d4af37,#5c4710,#0a0a0a);
  animation-duration: 3s;
}
/* Boost -> black + flowing neon royal purple (icon cycles via JS) */
.dc-cb-boost {
  background-image: linear-gradient(90deg,#050505,#2a0a45,#7a1fd6,#c77dff,#7a1fd6,#2a0a45,#050505);
  animation-duration: 3.5s;
}

.dc-name { color: #f5f5f5; font-weight: 700; font-size: 16px; margin-top: 6px; }
.dc-user { color: var(--muted); font-size: 12px; }

.dc-custom { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; }
.dc-emoji { width: 16px; height: 16px; vertical-align: middle; }

.dc-act {
  margin-top: 12px;
  padding: 10px;
  border-radius: 5px;
  background: #121212;
  border: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.dc-act-art { width: 50px; height: 50px; border-radius: 4px; flex-shrink: 0; object-fit: cover; }
.dc-act-blank { background: #2a2a2a; }
.dc-act-info { min-width: 0; flex: 1; }
.dc-act-top { color: var(--accent); font-size: 11px; font-weight: 600; }
.dc-act-name { color: #f5f5f5; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-act-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-elapsed { color: var(--accent); }

.dc-bar { margin-top: 6px; height: 4px; background: #333; border-radius: 2px; overflow: hidden; }
.dc-bar-fill { height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.dc-time { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 3px; }

.dc-since { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--ink); font-size: 11px; }
.dc-since span { display: block; color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 2px; }

/* ---- github repos ---- */
.repos {
  width: 100%;
  text-align: left;
}

.repos-head {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.repos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

/* slim scrollbar */
.repos-list::-webkit-scrollbar { width: 6px; }
.repos-list::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.repo {
  display: block;
  padding: 10px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 5px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.repo:hover { background: #222; border-color: #333; }

.repo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repo-name { color: var(--accent); font-weight: 600; font-size: 13px; }
.repo-star { color: #f0b232; font-size: 11px; flex-shrink: 0; }

.repo-desc {
  color: var(--ink);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}
.repo-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}
.repo-time { margin-left: auto; }

/* ---- settings panel ---- */
.qpanel {
  position: fixed;
  top: 8px;
  left: 8px;
  bottom: 34px; /* clear the bottom bar */
  z-index: 50;
  width: 215px;
  max-width: calc(100vw - 16px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.qpanel[hidden] { display: none; }

/* title bar that sits on top of the border, fieldset/legend style */
.qpanel-bar {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.qpanel-title,
.qpanel-close {
  background: var(--panel);
  padding: 0 8px;
}

.qpanel-title { color: var(--ink); font-weight: 600; }

.qpanel-close {
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.qpanel-close .x { color: #e06c75; }
.qpanel-close:hover .x { color: #ff8088; }

.qpanel-body {
  padding: 22px 18px 18px;
}

.qopt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.qopt input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.qnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---- the qt in the corner ---- */
.qt {
  position: fixed;
  right: 0;
  bottom: 26px; /* sit just above the bottom bar */
  z-index: 5;
  max-width: 440px;
  height: auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s ease;
}
.qt[hidden] { display: none; }
.qt.show { opacity: 1; }
