:root {
  --bg: #001406;
  --fg: #b7ffbf;
  --fg2: #69ff7d;
  --dim: #4faa59;
  --panel: rgba(0, 32, 10, 0.72);
  --border: rgba(105, 255, 125, 0.42);
  --danger: #ff4f4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at center, rgba(53, 255, 82, 0.12), transparent 55%),
    linear-gradient(#001406, #000603);
  color: var(--fg);
  font-family: "Courier New", monospace;
  text-shadow: 0 0 6px rgba(105, 255, 125, 0.55);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(183, 255, 191, 0.045) 0px,
    rgba(183, 255, 191, 0.045) 1px,
    transparent 1px,
    transparent 4px
  );
  transform: translateZ(0);
  z-index: 10;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.45) 100%);
  transform: translateZ(0);
  z-index: 11;
}

body.no-crt {
  text-shadow: none;
}

body.no-crt::before,
body.no-crt::after {
  display: none;
}

#boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

#boot pre {
  width: min(760px, 100%);
  white-space: pre-wrap;
  font-size: clamp(14px, 2vw, 20px);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

main {
  width: min(1100px, calc(100% - 28px));
  max-width: 100%;
  margin: auto;
  padding: 28px 0;
}

.top {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  box-shadow: 0 0 32px rgba(105, 255, 125, 0.16);
}

.headerRight {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.headerClock {
  text-align: right;
}

.headerClock strong,
.headerClock span {
  display: block;
}

.headerClock strong {
  color: var(--fg2);
  font-size: 22px;
}

.headerClock span {
  color: var(--dim);
  font-size: 13px;
}

.prompt {
  margin: 0 0 10px;
  color: var(--fg2);
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.sub {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 18px;
}

button,
.smallButton {
  background: #001f0a;
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: inherit;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover,
.smallButton:hover {
  background: #003811;
}

.smallButton {
  padding: 6px 10px;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 18px;
  box-shadow: inset 0 0 24px rgba(105, 255, 125, 0.06);
}

.panelTitleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panelTitleRow h3 {
  margin-bottom: 0;
}

.panelPills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  border: 1px solid rgba(105, 255, 125, 0.28);
  color: var(--dim);
  padding: 4px 8px;
  font-size: 12px;
}

.app {
  color: var(--fg);
  text-decoration: none;
  min-height: 135px;
  position: relative;
}

.app:hover {
  background: rgba(0, 54, 17, 0.85);
}

.status {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 11px;
  height: 11px;
  background: var(--fg2);
  box-shadow: 0 0 12px var(--fg2);
  border-radius: 50%;
}

.status.offline {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

h2,
h3 {
  margin: 0 0 10px;
  color: var(--fg2);
}

h2 {
  font-size: 34px;
}

.value {
  font-size: 44px;
  font-weight: bold;
}

.spark {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  color: var(--fg2);
  font-size: 24px;
  margin-bottom: 0;
}

.networkSpark {
  font-size: 18px;
  margin-top: 2px;
}

.netline {
  font-size: 22px;
  margin: 8px 0 0;
}

.nowPlaying,
.music,
.randomPick,
.recent,
.terminal {
  margin-top: 14px;
}

.nowPlayingLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.trackList {
  display: grid;
  gap: 12px;
}

.trackCard,
.randomInner {
  display: flex;
  gap: 16px;
  align-items: center;
}

.trackCard img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 0 22px rgba(105, 255, 125, 0.12);
}

.trackCard.primaryTrack img {
  width: 144px;
  height: 144px;
}

.nowPlaying strong {
  display: block;
  color: var(--fg2);
  font-size: 30px;
  animation: glowPulse 2.6s ease-in-out infinite;
}

.nowPlaying span {
  display: block;
  color: var(--dim);
  margin-top: 6px;
}

.listenerList {
  display: grid;
  gap: 6px;
}

.listenerRow {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  border: 1px dashed rgba(105, 255, 125, 0.28);
  padding: 7px;
  color: var(--fg);
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

.albumCover {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border: 1px solid var(--border);
  float: left;
  margin: 0 18px 12px 0;
  box-shadow: 0 0 22px rgba(105, 255, 125, 0.12);
}

.musicGrid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 14px;
}

.musicGrid div {
  border: 1px dashed rgba(105, 255, 125, 0.28);
  padding: 14px;
  min-width: 0;
}

.musicGrid p {
  margin: 0 0 8px;
  color: var(--dim);
  text-transform: uppercase;
  font-size: 13px;
}

.musicGrid strong,
.randomInner strong {
  display: block;
  color: var(--fg2);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.musicGrid span,
.randomInner span {
  display: block;
  margin-top: 8px;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.randomInner img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 0 22px rgba(105, 255, 125, 0.12);
}

.recentAlbums {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-color: var(--fg2) transparent;
}

.albumMini {
  flex: 0 0 140px;
  border: 1px dashed rgba(105, 255, 125, 0.28);
  padding: 10px;
  min-width: 0;
  text-align: center;
}

.albumMini img {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
}

.albumMini strong {
  display: block;
  margin-top: 8px;
  color: var(--fg2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.albumMini span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.termbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.termbar span {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 50%;
}

#terminal {
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.55;
  min-height: 220px;
}

@media (max-width: 1200px) {
  .grid,
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px), (max-height: 700px) {
  body::before {
    opacity: 0.22;
  }

  body::after {
    opacity: 0.75;
  }
}

@media (max-width: 850px) {
  .top {
    flex-direction: column;
  }

  .headerRight {
    width: 100%;
    justify-items: start;
  }

  .headerClock {
    text-align: left;
  }

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

  h1 {
    letter-spacing: -0.04em;
  }
}

@media (max-width: 700px) {
  .albumCover {
    float: none;
    width: 100%;
    height: auto;
    margin: 0 0 14px 0;
  }

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

  .trackCard,
  .randomInner {
    flex-direction: column;
    align-items: flex-start;
  }

  .trackCard img,
  .trackCard.primaryTrack img,
  .randomInner img {
    width: 100%;
    height: auto;
  }

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

@media (max-aspect-ratio: 5/4) {
  main {
    width: min(760px, calc(100% - 24px));
  }
}
