/* ==========================================================
   PhreakNIC.fm — retro.css
   A loving tribute to 1998. Tables optional, bevels mandatory.
   ========================================================== */

:root {
  --bg: #000000;
  --panel: #0b0f0b;
  --panel-2: #101810;
  --win-gray: #c0c0c0;
  --win-dark: #808080;
  --win-light: #ffffff;
  --win-blue: #000080;
  --green: #39ff14;
  --green-dim: #1f8f0f;
  --amber: #ffb000;
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --yellow: #ffff00;
  --red: #ff2a2a;
  --link: #ffff66;
  --visited: #d19cff;
  --text: #e6e6e6;
  --font-pixel: "Press Start 2P", "VT323", "Courier New", monospace;
  --font-lcd: "VT323", "Courier New", monospace;
  --font-body: "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  background: #000 url("../img/circuit.png") repeat;
  image-rendering: pixelated;
  min-height: 100vh;
}
img { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: #fff; background: #800080; text-decoration: none; }
b, strong { color: #fff; }
kbd { font-family: var(--font-lcd); background: #222; border: 1px solid #666; padding: 0 4px; border-radius: 2px; }

.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: var(--font-lcd); font-size: 18px; letter-spacing: 0.5px; }
.hidden { display: none !important; }

/* ---------- Starfield overlay ---------- */
.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 80px, #9f9 50%, transparent 51%),
    radial-gradient(1px 1px at 200px 150px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 300px 50px, #ff9 50%, transparent 51%),
    radial-gradient(1px 1px at 350px 220px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 60px 260px, #9ff 50%, transparent 51%);
  background-color: rgba(0, 0, 0, 0.6);
  background-size: 400px 300px;
  opacity: 0.9;
  animation: twinkle 3s steps(2) infinite;
}
@keyframes twinkle { 0%,100% { opacity: .9; } 50% { opacity: .8; } }

/* ---------- Page frame ---------- */
.page {
  position: relative; z-index: 1;
  max-width: 1000px;
  margin: 12px auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.82);
  border: 3px double var(--green-dim);
  box-shadow: 0 0 0 4px #000, 0 0 24px rgba(57, 255, 20, 0.25);
}

.bevel {
  background: var(--panel);
  border-top: 2px solid #4a4;
  border-left: 2px solid #4a4;
  border-right: 2px solid #131;
  border-bottom: 2px solid #131;
}

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #0f1f0f 0%, #000 100%);
}
.masthead-art { flex: 0 0 auto; }
.masthead-title { text-align: center; flex: 1 1 auto; min-width: 0; }
.masthead h1 {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(18px, 4.2vw, 38px);
  line-height: 1.2;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 #004400, 6px 6px 0 #002200;
}
.masthead .t1 { color: var(--green); }
.masthead .t2 { color: var(--magenta); }
.tagline {
  margin-top: 8px;
  font-family: var(--font-lcd);
  font-size: 18px;
  color: var(--amber);
  letter-spacing: 1px;
}

/* ---------- Marquee ---------- */
.marquee {
  margin: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  background: var(--win-blue);
  color: #fff;
  border: 2px inset #8888ff;
  font-family: var(--font-lcd);
  font-size: 20px;
  padding: 2px 0;
}
.marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- Columns ---------- */
.columns { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.sidebar { flex: 0 0 210px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Boxes ---------- */
.box { padding: 8px 10px 10px; }
.box-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #000;
  background: var(--green);
  margin: -8px -10px 8px;
  padding: 6px 8px;
  letter-spacing: 1px;
}
.box p { margin: 6px 0; }
.navlist { list-style: none; margin: 0; padding: 0; }
.navlist li { margin: 3px 0; }
.navlist a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.navlist a:hover { text-decoration: underline; }
#stream-url { word-break: break-all; font-size: 15px; color: #9f9; }

.webring-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-family: var(--font-pixel); font-size: 9px; }

.odometer {
  display: inline-block;
  font-family: var(--font-lcd);
  font-size: 30px;
  letter-spacing: 6px;
  color: var(--green);
  background: #000;
  border: 2px inset #555;
  padding: 2px 6px 0 12px;
  margin: 4px 0;
}

.construction img { display: block; margin: 0 auto 4px; }

.badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.badge {
  width: 88px; height: 31px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: 7px; line-height: 1.4; text-align: center;
  color: #fff; border: 1px solid #000; box-shadow: inset 0 0 0 1px #fff;
  text-transform: uppercase;
}
.b-ns { background: #1b5ba0; }
.b-800 { background: #333; }
.b-html { background: #c33; }
.b-mp3 { background: #060; }
.b-cast { background: #2c5aa0; }
.b-cf { background: #f38020; color: #000; }

/* ---------- Blink ---------- */
.blink { animation: blink 1s steps(2) infinite; color: var(--red); }
.blink-slow { animation: blink 1.6s steps(2) infinite; color: var(--yellow); font-weight: bold; }
@keyframes blink { 50% { opacity: 0; } }
.pulse { animation: pulse 0.7s ease-in-out infinite alternate; display: inline-block; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ---------- Ads ---------- */
.ad-slot { text-align: center; }
.ad-label {
  font-family: var(--font-pixel); font-size: 7px; color: #777; letter-spacing: 2px; margin: 6px 0 2px;
}
.banner-ad {
  display: inline-flex; align-items: center; justify-content: space-between;
  width: 468px; max-width: 100%; height: 60px;
  background: repeating-linear-gradient(45deg, #ffd800 0 12px, #000 12px 24px);
  border: 2px solid #fff; outline: 2px solid #000;
  text-decoration: none; color: #000;
  padding: 0 6px;
  position: relative; overflow: hidden;
}
.banner-ad:hover { background: repeating-linear-gradient(45deg, #ff00ff 0 12px, #000 12px 24px); color: #fff; }
.banner-shot { flex: 0 0 auto; }
.banner-shot.flip { transform: scaleX(-1); }
.banner-frames { position: relative; flex: 1 1 auto; height: 48px; margin: 0 6px; background: #fff; border: 2px solid #000; }
.banner-ad:hover .banner-frames { background: #000; color: #fff; border-color: #fff; }
.banner-frames .frame {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: 11px; line-height: 1.3; padding: 0 6px; text-align: center;
  opacity: 0; animation: adframes 8s steps(1) infinite;
}
.banner-frames .frame b { color: #b00; }
/* Press Start 2P has no Ö, so we draw the umlaut ourselves. */
.uml { position: relative; display: inline-block; }
.uml::before {
  content: ""; position: absolute; left: 0.12em; top: -0.36em;
  width: 0.22em; height: 0.22em; background: currentColor;
  box-shadow: 0.48em 0 0 currentColor;
}
.banner-ad:hover .frame b { color: #ff0; }
.frame.f1 { animation-delay: 0s; }
.frame.f2 { animation-delay: 2s; }
.frame.f3 { animation-delay: 4s; }
.frame.f4 { animation-delay: 6s; }
@keyframes adframes { 0% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; } }

.box-ad {
  display: block; text-decoration: none; color: #000;
  width: 100%; max-width: 210px; margin: 0 auto;
  background: #f4ecd2;
  border: 3px solid #1d4d2b; outline: 2px solid #c9a227;
  padding: 8px 6px 10px;
  font-family: var(--font-body);
}
.box-ad:hover { background: #fff7dd; color: #000; }
.box-ad-head { font-family: var(--font-pixel); font-size: 8px; letter-spacing: 2px; color: #1d4d2b; }
.box-ad-brand { font-family: var(--font-pixel); font-size: 22px; line-height: 1; color: #1d4d2b; text-shadow: 2px 2px 0 #c9a227; margin: 2px 0 6px; padding-top: 9px; }
.bottle { display: block; margin: 0 auto; animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.box-ad-copy { margin: 8px 0 6px; font-size: 13px; line-height: 1.3; }
.ad-line { margin: 4px 0; }
.ad-line-1 { font-style: italic; font-weight: bold; color: #7a1010; }
.ad-line-2 { font-size: 12px; color: #1d4d2b; }
.ad-line-3 { font-size: 12px; }
.box-ad-copy b { color: #000; }
.box-ad-cta {
  font-family: var(--font-pixel); font-size: 9px; color: #fff; background: #b00;
  border: 2px outset #f66; padding: 6px 4px; margin: 6px auto 4px; display: block;
}
.box-ad-fine { font-size: 10px; color: #555; line-height: 1.2; }

/* ---------- The Player (PHREAKAMP) ---------- */
.winamp {
  background: var(--win-gray);
  border: 2px outset #fff;
  box-shadow: 4px 4px 0 #000;
  color: #000;
  font-family: var(--font-lcd);
}
.win-titlebar {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--win-blue), #1084d0);
  color: #fff; padding: 2px 4px;
  font-family: var(--font-pixel); font-size: 8px; letter-spacing: 1px;
}
.win-dots { flex: 0 0 auto; width: 12px; height: 12px; background: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px); opacity: .6; }
.win-title { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns { display: inline-flex; gap: 2px; }
.win-btns span { width: 14px; height: 12px; background: var(--win-gray); color: #000; border: 1px outset #fff; font-size: 9px; line-height: 10px; text-align: center; font-family: Arial, sans-serif; }

.win-body { padding: 6px; }
.lcd {
  background: #000; color: var(--green);
  border: 2px inset #666;
  padding: 4px 6px;
  text-shadow: 0 0 6px rgba(57,255,20,.5);
}
.lcd-row { display: flex; align-items: center; gap: 8px; }
.lcd-time { font-size: 40px; line-height: 1; min-width: 110px; letter-spacing: 2px; }
.viz { flex: 1 1 auto; height: 40px; width: 100%; max-width: 100%; background: #000; border-left: 1px solid #133; }
.lcd-ticker { overflow: hidden; white-space: nowrap; margin-top: 4px; font-size: 20px; border-top: 1px dotted #164; padding-top: 2px; }
.lcd-ticker-track { display: inline-block; padding-left: 100%; animation: marquee 18s linear infinite; }
.lcd-meta { display: flex; align-items: baseline; gap: 10px; font-size: 18px; margin-top: 2px; flex-wrap: wrap; }
.lcd-meta small { font-size: 12px; margin-left: 2px; color: var(--green-dim); }
.lcd-tag { border: 1px solid var(--green-dim); padding: 0 5px; font-size: 14px; }
.lcd-tag.live { color: var(--red); border-color: var(--red); animation: blink 1s steps(2) infinite; }

.progress { height: 12px; margin-top: 6px; background: #000; border: 2px inset #666; position: relative; cursor: default; }
.progress-fill { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, var(--green) 0 4px, #0a0 4px 6px); transition: width .5s linear; }
.progress-labels { display: flex; justify-content: space-between; font-size: 16px; margin-top: 2px; }

.controls { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.btn {
  font-family: Arial, sans-serif; font-size: 16px; line-height: 1;
  width: 40px; height: 30px; cursor: pointer;
  background: var(--win-gray); color: #000;
  border: 2px outset #fff;
}
.btn:active, .btn.active { border-style: inset; background: #a8a8a8; }
.btn:focus-visible { outline: 2px dotted #000; outline-offset: -4px; }
.vol { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 120px; }
.vol .small { font-family: var(--font-pixel); font-size: 8px; }
input[type=range] { flex: 1 1 auto; min-width: 70px; accent-color: #000080; cursor: pointer; }
.status-pill {
  font-family: var(--font-pixel); font-size: 8px; padding: 6px 8px;
  background: #000; color: var(--amber); border: 1px inset #666; white-space: nowrap;
}
.status-pill.playing { color: var(--green); }
.status-pill.error { color: var(--red); }

/* Now playing block */
.np { display: flex; gap: 10px; padding: 8px; background: #000; color: var(--text); border-top: 2px groove #888; }
.np-art-wrap { flex: 0 0 auto; }
.np-art { width: 96px; height: 96px; object-fit: cover; border: 2px solid #4a4; background: #111; display: block; }
.np-text { min-width: 0; flex: 1 1 auto; }
.np-label { font-family: var(--font-pixel); font-size: 8px; color: var(--magenta); letter-spacing: 2px; margin-bottom: 4px; }
.np-title { font-family: var(--font-body); font-size: 20px; font-weight: bold; color: #fff; line-height: 1.15; word-wrap: break-word; }
.np-artist { font-family: var(--font-lcd); font-size: 20px; color: var(--cyan); margin-top: 2px; }
.np-sub { color: #999; margin-top: 4px; }

/* Up next */
.next { display: flex; gap: 10px; align-items: center; }
.next-art { width: 64px; height: 64px; object-fit: cover; border: 2px solid #4a4; background: #111; flex: 0 0 auto; }
.next-title { font-size: 17px; font-weight: bold; color: #fff; }
.next-artist { color: var(--cyan); font-family: var(--font-lcd); font-size: 18px; }
.next-when { color: var(--amber); margin-top: 2px; }

/* History */
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th { text-align: left; font-family: var(--font-pixel); font-size: 8px; color: var(--amber); padding: 4px 6px; border-bottom: 1px solid #353; }
.history-table td { padding: 5px 6px; border-bottom: 1px dotted #242; vertical-align: top; }
.history-table tr:nth-child(even) td { background: rgba(57,255,20,.04); }
.history-table .t { font-family: var(--font-lcd); font-size: 17px; color: var(--green); white-space: nowrap; }
.history-table .a { color: var(--cyan); }

.stat-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.stat-table td { padding: 3px 2px; border-bottom: 1px dotted #242; }
.stat-table td:first-child { color: #aaa; }
.stat-table td:last-child { text-align: right; color: var(--green); font-size: 17px; }

.about p { margin: 6px 0; }
.about-art { float: right; margin: 0 0 6px 10px; }
.about::after { content: ""; display: block; clear: both; }

/* Footer */
.footer { margin-top: 12px; text-align: center; color: #9a9; border-top: 1px dashed #353; padding-top: 8px; }
.footer p { margin: 4px 0; }

/* ---------- Responsive (yes, even in 1998) ---------- */
@media (max-width: 860px) {
  .columns { flex-wrap: wrap; }
  .main { order: 1; flex: 1 1 100%; }
  .sidebar { order: 2; flex: 1 1 calc(50% - 5px); }
  .sidebar.right { order: 3; }
}
@media (max-width: 560px) {
  .page { margin: 4px; padding: 6px; }
  .masthead { flex-direction: column; }
  .masthead .boombox { display: none; }
  .sidebar { flex: 1 1 100%; }
  .lcd-time { font-size: 30px; min-width: 84px; }
  .banner-ad { height: 60px; }
  .banner-frames .frame { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .lcd-ticker-track { animation-duration: 90s; }
  .blink, .blink-slow, .pulse, .bottle, .stars, .lcd-tag.live { animation: none; }
}
