:root {
  --bg: #070d14;
  --panel: rgba(16, 24, 35, 0.84);
  --card: rgba(18, 28, 40, 0.86);
  --card2: rgba(12, 20, 32, 0.7);
  --border: #25364d;
  --text: #d8e4f0;
  --fg: var(--text);
  --muted: #91a4ba;
  --green: #5ee487;
  --accent: var(--green);
  --green-soft: rgba(94, 228, 135, 0.14);
  --yellow: #ffd166;
  --red: #ff6b6b;
  --blue: #7cc7ff;
  --shadow: rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(94, 228, 135, 0.08), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(124, 199, 255, 0.06), transparent 28rem),
    var(--bg);
  pointer-events: none;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.wrap {
  width: min(960px, calc(100% - 32px));
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 0;
  position: relative;
  z-index: 1;
}

header {
  margin-bottom: 14px;
}

h1 {
  display: flex;
  align-items: flex-start;
  gap: .45ch;
  max-width: 100%;
  margin: 0;
  color: var(--green);
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.1;
}

h1 .title {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mobile-title {
  display: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 14px 0;
}

.nav a,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  background: #0c1420;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active,
button:hover,
button:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
  outline: none;
}

.shell {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 80px var(--shadow);
  padding: 16px;
}

.output {
  height: calc(10 * 1.55em);
  margin: 0;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow: hidden;
}

.cursor::after {
  content: "█";
  color: var(--green);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(94, 228, 135, .055);
  font-size: 16px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 20px var(--shadow);
  outline: none;
}

.status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.status__item {
  min-height: 68px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--card2);
  overflow: hidden;
}

.status__label,
.label {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

#uptime,
#task {
  display: block;
  width: 100%;
}

#task {
  min-height: 2.45em;
  line-height: 1.22;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  transition: opacity .35s ease, transform .35s ease;
}

#task.fade {
  opacity: 0;
  transform: translateY(4px);
}

.easter {
  min-height: 22px;
  margin-top: 16px;
  color: var(--green);
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s ease;
}

.easter.visible {
  opacity: 1;
}

.cli {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.system-log {
  min-height: 18px;
  margin-bottom: 8px;
  color: var(--green);
  opacity: .78;
}

.cli__line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cli__input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.cli__input::placeholder {
  color: var(--muted);
  opacity: .55;
}

.cli__output {
  min-height: 20px;
  margin-top: 8px;
  color: var(--green);
}

.footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--green);
  opacity: 0.45;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.quality {
  color: var(--green);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.hero-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.hero-latency {
  text-align: right;
  white-space: nowrap;
}

.latency-main {
  color: var(--blue);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.latency-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.grid.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 10px;
}

.card {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 68px;
  overflow: hidden;
  height: 100%;
}

.card.wide {
  grid-column: 1 / -1;
}

.value {
  color: var(--text);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-value {
  color: var(--text);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
  font-weight: 700;
}

.network-value {
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.18;
}

.normal {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.muted { color: var(--muted); }
.good { color: var(--green); }
.warn { color: var(--yellow); }
.bad { color: var(--red); }
.blue { color: var(--blue); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid rgba(37, 54, 77, 0.8);
  background: var(--card2);
  border-radius: 12px;
  padding: 10px;
}

.metric-name {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metric-value {
  font-size: 14px;
  line-height: 1.25;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.service-box {
  border: 1px solid rgba(37, 54, 77, 0.8);
  border-radius: 12px;
  padding: 10px;
  background: var(--card2);
}

.service-name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}

.service-meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.details {
  display: none;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.details.open {
  display: block;
}

.charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 210px;
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 210px !important;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--green);
  opacity: 0.45;
}

.updated {
  color: var(--muted);
}

.dice-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dice-types {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0 18px;
}

.dice-type {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.dice-type:hover,
.dice-type:focus-visible,
.dice-type.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 24px rgba(94, 228, 135, .18);
  outline: none;
}

.dice-type:hover {
  transform: translateY(-2px);
}

.dice-stage {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dice {
  width: min(220px, 52vw);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 35% 28%, rgba(94, 228, 135, 0.12), transparent 34%),
    var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(56px, 12vw, 92px);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 40px rgba(94, 228, 135, .08);
  transition:
    transform .18s ease,
    border-color .18s ease,
    color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.dice:hover,
.dice:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background:
    radial-gradient(circle at 35% 28%, rgba(94, 228, 135, 0.2), transparent 34%),
    var(--card);
  box-shadow: 0 0 70px rgba(94, 228, 135, .25);
  transform: translateY(-4px);
  outline: none;
}

.dice.rolling {
  border-color: var(--green);
  color: var(--green);
  animation: dice-roll .58s cubic-bezier(.2, .8, .2, 1);
}

@keyframes dice-roll {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  20% {
    transform: translateY(-22px) rotate(90deg) scale(1.05);
  }

  45% {
    transform: translateY(10px) rotate(190deg) scale(.96);
  }

  70% {
    transform: translateY(-8px) rotate(300deg) scale(1.03);
  }

  100% {
    transform: translateY(0) rotate(360deg) scale(1);
  }
}

.boardgames-section {
  margin-top: 72px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: 28px;
  color: var(--green);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: #0c1420;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease;
}

.text-link:hover,
.text-link:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
  transform: translateY(-2px);
  outline: none;
}

.boardgames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  width: 100%;
}

a.boardgame-card {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 14px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card2);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

a.boardgame-card:hover,
a.boardgame-card:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(94, 228, 135, .14);
  outline: none;
}

a.boardgame-card img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

a.boardgame-card .boardgame-name {
  display: block;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

a.boardgame-card .boardgame-meta,
a.boardgame-card .boardgame-rating {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

a.boardgame-card .boardgame-meta {
  color: var(--muted);
}

a.boardgame-card .boardgame-rating {
  color: var(--green);
}

.bgg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0c1420;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.bgg-badge:hover,
.bgg-badge:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-2px);
  outline: none;
}

.bgg-badge img {
  display: block;
  height: 28px;
  width: auto;
}

.game-links {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.game-link-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(168, 255, 96, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
    rgba(0,0,0,0.18);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.game-link-card:hover,
.game-link-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(168,255,96,0.55);
  background: rgba(168,255,96,0.06);
  outline: none;
}

.game-link-icon {
  font-size: 28px;
  text-align: center;
  line-height: 1;
}

.game-link-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.game-link-body strong {
  color: var(--green);
}

.game-link-body span {
  opacity: 0.72;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.game-link-arrow {
  font-size: 22px;
  color: var(--green);
  line-height: 1;
}

@media (max-width: 680px) {
  .wrap {
    width: min(100% - 24px, 960px);
    max-width: 960px;
    padding: 14px 0;
  }

  header {
    margin-bottom: 12px;
    overflow: hidden;
  }

  h1 {
    font-size: clamp(24px, 7vw, 32px);
    align-items: baseline;
    gap: .35ch;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
  }

  .nav a {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .shell {
    padding: 14px;
    border-radius: 18px;
  }

  .output {
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.5;
    height: calc(10 * 1.5em);
  }

  .links {
    flex-direction: column;
    gap: 10px;
  }

  .link {
    width: 100%;
    font-size: 14px;
    min-height: 40px;
  }

  .status,
  .grid,
  .grid.status-grid {
    grid-template-columns: 1fr;
  }

  .status {
    gap: 10px;
  }

  .status__item {
    min-height: 68px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-latency {
    text-align: left;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .shell,
  .card,
  .hero,
  .status__item {
    border-radius: 14px;
    padding: 12px;
  }

  .chart-wrap,
  .chart-wrap canvas {
    height: 190px !important;
  }

  .dice-types {
    gap: 8px;
    padding-bottom: 14px;
  }

  .dice-type {
    flex: 1 1 72px;
    padding: 8px 10px;
  }

  .dice-stage {
    min-height: 300px;
  }

  .dice {
    width: min(190px, 66vw);
    border-radius: 24px;
  }

  .boardgames-section {
    margin-top: 48px;
  }

  .section-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .boardgames-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  a.boardgame-card {
    padding: 10px;
    gap: 8px;
  }

  a.boardgame-card img {
    height: 150px;
  }

  a.boardgame-card .boardgame-name {
    font-size: 14px;
  }

  a.boardgame-card .boardgame-meta,
  a.boardgame-card .boardgame-rating {
    font-size: 12px;
  }

  .bgg-badge img {
    height: 24px;
  }

  .game-link-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .game-link-arrow {
    display: none;
  }

  .game-link-icon {
    font-size: 24px;
  }

  .footer,
  .footer-row {
    margin-top: 14px;
  }
}

@media (max-width: 420px) {
  .wrap {
    width: min(100% - 20px, 960px);
    padding: 12px 0;
  }

  h1 {
    font-size: 24px;
  }

  .nav {
    gap: 7px;
  }

  .nav a,
  button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .shell {
    padding: 10px;
  }

  .boardgames-grid {
    grid-template-columns: 1fr;
  }

  a.boardgame-card img {
    height: 180px;
  }

  .game-link-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}