:root{
  --bg1:#1b2a3a;
  --bg2:#0f1720;
  --card1:#2b3f55;
  --card2:#1c2a3a;
  --text:#ffffff;
  --muted:rgba(255,255,255,0.75);
  --border:rgba(255,255,255,0.10);
  --shadow:0 8px 20px rgba(0,0,0,0.35);
  --shadow-hover:0 14px 28px rgba(0,0,0,0.45);
}

body{
  margin:0;
  font-family:"Segoe UI", Roboto, Arial, sans-serif;
  background:radial-gradient(circle at top, var(--bg1), var(--bg2));
  color:var(--text);
}

/* Top bar */
header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 22px;
  background:linear-gradient(135deg, var(--card1), var(--card2));
  border-bottom:1px solid var(--border);
  box-shadow:var(--shadow);
}

.logo{
  height:40px;
  width:auto;
}

/* Buttons */
.join-link,
.info-link{
  display:inline-block;
  font-size:0.95rem;
  font-weight:600;
  color:var(--text);
  text-decoration:none;
  padding:10px 14px;
  border-radius:10px;
  background:linear-gradient(135deg, var(--card1), var(--card2));
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  transition:transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.join-link:hover,
.info-link:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-hover);
  border-color:rgba(255,255,255,0.18);
}

/* Heading */
h1{
  text-align:center;
  margin:22px 0 10px;
  padding:0 14px;
  font-size:2.1rem;
  letter-spacing:1px;
  font-weight:650;
  text-transform:none;

  /* Yorkshire dashboard style: clean white, not neon */
  color:var(--text);
  text-shadow:none;

  /* remove your old gradient text */
  background:none;
  -webkit-background-clip:initial;
  -webkit-text-fill-color:initial;
}

/* Main container */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  justify-content:center;
  align-items:stretch;
}

/* Node cards */
.node{
  display:flex;
  flex-direction:column;
  padding:14px;
  background:linear-gradient(135deg, var(--card1), var(--card2));
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
  transition:transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.node:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-hover);
  border-color:rgba(255,255,255,0.18);
}

.node.talking{
  border:2px solid #4f86f7;
  animation: nodeGlowFade 4.5s ease-in-out infinite;
}


/* Summary row */
.node-summary{
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.node-name{
  font-weight:650;
  color:var(--text);
}

.node-tgs{
  color:var(--muted);
}

.node-time p{
  margin:6px 0 0;
  font-size:0.9rem;
  color:var(--muted);
}

/* Footer */
footer{
  text-align:center;
  padding:20px;
  margin-top:20px;
  color:rgba(255,255,255,0.60);
  border-top:1px solid var(--border);
  background:transparent;
  font-size:0.85rem;
}

footer a{
  color:rgba(255,255,255,0.80);
  text-decoration:none;
}

footer a:hover{
  text-decoration:underline;
}

/* Mobile */
@media (max-width:768px){
  header{
    flex-direction:column;
    gap:10px;
    text-align:center;
  }

  .join-link, .info-link{
    width:100%;
    text-align:center;
    padding:12px 16px;
    font-size:1rem;
  }

  .container{
    padding:12px;
  }

  h1{
    font-size:1.7rem;
  }

  .node-summary{
    flex-direction:column;
    align-items:flex-start;
  }
}


@keyframes nodeGlowFade{

  0%{
    box-shadow:
      0 0 4px rgba(79,134,247,0.25),
      0 0 8px rgba(79,134,247,0.18);
  }

  25%{
    box-shadow:
      0 0 12px rgba(79,134,247,0.45),
      0 0 20px rgba(79,134,247,0.30);
  }

  50%{
    box-shadow:
      0 0 24px rgba(79,134,247,0.80),
      0 0 40px rgba(79,134,247,0.60),
      0 0 55px rgba(79,134,247,0.40);
  }

  75%{
    box-shadow:
      0 0 12px rgba(79,134,247,0.45),
      0 0 20px rgba(79,134,247,0.30);
  }

  100%{
    box-shadow:
      0 0 4px rgba(79,134,247,0.25),
      0 0 8px rgba(79,134,247,0.18);
  }
}


/* =========================
   MOBILE FIT FIX (DROP IN)
   ========================= */

/* Prevent padding/border overflow on 100% width elements */
*,
*::before,
*::after{
  box-sizing:border-box;
}

/* Stop tiny horizontal scrolling on phones */
html, body{
  max-width:100%;
  overflow-x:hidden;
}

/* Allow flex items to actually shrink on small screens */
.node-summary{
  flex-wrap:wrap;
}

.node-summary > *{
  min-width:0;
}

/* Prevent long node names / TG text from pushing layout */
.node-name,
.node-tgs{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Mobile layout tightening */
@media (max-width:768px){

  header{
    width:100%;
  }

  .logo{
    max-width:100%;
    height:auto;
  }

  .join-link,
  .info-link{
    width:100%;
  }

  .container{
    padding:12px;
  }

  .node{
    padding:12px;
  }
}

/* =========================
   HARD STOP HORIZONTAL SCROLL (DROP IN)
   ========================= */

/* iOS + mobile browsers: apply to BOTH html and body */
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

/* Modern browsers: clip is even stricter than hidden */
@supports (overflow: clip){
  html, body{
    overflow-x:clip;
  }
}

/* Never let media/images exceed viewport */
img, svg, video, canvas{
  max-width:100%;
  height:auto;
}

/* Flex items can cause overflow unless allowed to shrink */
header, .node-summary{
  min-width:0;
}

header > *,
.node-summary > *{
  min-width:0;
}

/* Break long strings (hostnames, IDs, etc.) that force overflow */
.node,
.node *{
  overflow-wrap:anywhere;
  word-break:break-word;
}


/* Title + counter centred as one unit */
.title-row{
 .title-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  text-align:center;
}


/* Counter pill styled to match dark dashboard */
.node-counter{
  display:inline-flex;        /* keeps it sized to content */
  align-items:center;
  justify-content:center;
  font-size:0.9rem;
  font-weight:700;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--text);
  background:linear-gradient(135deg, var(--card1), var(--card2));
  box-shadow:var(--shadow);
  white-space:nowrap;         /* stops it stretching/wrapping */
  width:auto;                 /* prevents mobile full-width expansion */
  max-width:fit-content;
}


/* Error state (if API unavailable) */
.node-counter.counter-error{
  opacity:0.75;
  border-style:dashed;
}
