@font-face {
  font-family: 'ZeroCool';
  src: url('/fonts/zerocool.woff') format('woff'),
       url('/fonts/zerocool.ttf') format('truetype');
}

@font-face {
  font-family: 'SyneMono';
  src: url('/fonts/SyneMono-Regular.ttf') format('truetype');
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: "ZeroCool", Arial, sans-serif;
  color: azure;
  overflow: hidden;
  background: #000;
}

#tiling-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#tiling-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── Layout container ───────────────────────────────────── */
#wz-container {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: calc(100% - 40px);
  max-width: 445px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 40px);
  z-index: 20;
}

/* ─── Upcoming schedule panel ────────────────────────────── */
#upcoming {
  background-color: rgba(0, 0, 0, 0.85);
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#upcoming .upcoming-header .subtitle {
  font-size: 1em;
  opacity: 1;
  margin-bottom: 12px;
}

#upcoming .tz-label {
  font-size: 0.8em;
  opacity: 0.65;
  font-weight: normal;
}

#upcoming .schedule {
  list-style: none;
  margin: 0;
  padding: 0;
}

#upcoming .schedule li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(240, 255, 255, 0.1);
  font-size: 0.88em;
}

#upcoming .schedule li .sched-time {
  opacity: 0.55;
  min-width: 90px;
  font-size: 0.85em;
  white-space: nowrap;
}

#upcoming .schedule li .sched-name {
  flex: 1;
}

#upcoming .schedule li .sched-badge {
  font-size: 0.72em;
  text-transform: uppercase;
  opacity: 0.45;
  letter-spacing: 0.04em;
}

#upcoming .schedule li.is-live .sched-time {
  color: #3db8e8;
  opacity: 1;
}

#upcoming .schedule li.is-live .sched-badge {
  color: #3db8e8;
  opacity: 0.85;
}

#upcoming .schedule .schedule-empty {
  opacity: 0.4;
  font-style: italic;
  display: block;
  padding: 8px 0;
}

/* ─── Player panel ───────────────────────────────────────── */
#oz-player {
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.85);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

/* Stopped state */
#oz-player.stopped h1 {
  opacity: 0.7;
}

#oz-player.stopped #now-playing .title {
  opacity: 0.7;
}

#oz-player h1 {
  font-size: 2em;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

/* Header with title, waveform and time */
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.player-header .time {
  font-size: 0.9em;
  opacity: 0.7;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  flex: 1;
}

/* Now Playing styles */
#now-playing {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#now-playing .track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

#now-playing .artist,
#now-playing .title {
  white-space: nowrap;
  display: inline-block;
}

#now-playing .artist.scrolling,
#now-playing .title.scrolling {
  animation: marquee var(--marquee-duration, 8s) linear infinite;
}

@keyframes marquee {
  0%, 10% { transform: translateX(0); }
  45%, 55% { transform: translateX(var(--marquee-offset, -50%)); }
  90%, 100% { transform: translateX(0); }
}

#now-playing .artist {
  font-size: 1em;
  opacity: 0.7;
}

#now-playing .title {
  font-size: 1em;
  font-weight: bold;
}

.waveform .bar {
  width: 4px;
  background-color: azure;
  border-radius: 2px;
  height: 10px;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.waveform.playing .bar {
  opacity: 1;
  animation: waveform 1s ease-in-out infinite;
}

.waveform .bar:nth-child(1) { animation-delay: 0s; }
.waveform .bar:nth-child(2) { animation-delay: 0.1s; }
.waveform .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform .bar:nth-child(4) { animation-delay: 0.3s; }
.waveform .bar:nth-child(5) { animation-delay: 0.4s; }
.waveform .bar:nth-child(6) { animation-delay: 0.5s; }
.waveform .bar:nth-child(7) { animation-delay: 0.6s; }
.waveform .bar:nth-child(8) { animation-delay: 0.7s; }
.waveform .bar:nth-child(9) { animation-delay: 0.8s; }
.waveform .bar:nth-child(10) { animation-delay: 0.9s; }
.waveform .bar:nth-child(11) { animation-delay: 0.15s; }
.waveform .bar:nth-child(12) { animation-delay: 0.25s; }
.waveform .bar:nth-child(13) { animation-delay: 0.35s; }
.waveform .bar:nth-child(14) { animation-delay: 0.45s; }
.waveform .bar:nth-child(15) { animation-delay: 0.55s; }

@keyframes waveform {
  0%, 100% { height: 8px; }
  25% { height: 25px; }
  50% { height: 12px; }
  75% { height: 20px; }
}

/* ─── Links block ────────────────────────────────────────── */
#links-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.85);
}

#links-bar a {
  color: azure;
  text-decoration: none;
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#links-bar a:hover {
  opacity: 1;
}

/* ─── Content overlay (About / Contribution) ──────────────── */
#content-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.62);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

#content-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#content-overlay .overlay-inner {
  position: relative;
  max-width: 500px;
  width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  padding: 30px;
  color: azure;
  background-color: rgba(0, 0, 0, 0.92);
  font-family: 'SyneMono', monospace;
}

#content-overlay .overlay-inner a {
  color: #7ec8e3;
}

#content-overlay .overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: azure;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#content-overlay .overlay-close:hover {
  opacity: 1;
}

#content-overlay .overlay-body p {
  line-height: 1.6;
  margin: 1em 0;
}

#content-overlay .overlay-inner h1,
#content-overlay .overlay-inner h2,
#content-overlay .overlay-inner h3 {
  font-family: 'ZeroCool', Arial, sans-serif;
}

/* ─── Play overlay ───────────────────────────────────────── */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay h1 {
  font-size: 4em;
  margin: 0;
  padding: 0;
  text-align: center;
}

.overlay-content {
  display: flex;
  align-items: center;
  gap: 30px;
}

#play-button {
  width: 50px;
  height: 50px;
  border: 4px solid azure;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#play-button:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}

#play-button svg {
  width: 32px;
  height: 32px;
  margin-left: 6px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 580px) {
  #wz-container {
    left: 0;
    right: 0;
    width: 100%;
    max-height: 100vh;
    top: 50%;
    transform: translateY(-50%);
  }
  #overlay h1 { font-size: 2.5em; }
  .overlay-content { gap: 20px; }
  #play-button { width: 60px; height: 60px; }
  #play-button svg { width: 24px; height: 24px; margin-left: 4px; }
}

@media (max-width: 480px) {
  .waveform .bar:nth-child(n+13) { display: none; }
}

@media (max-width: 420px) {
  .waveform .bar:nth-child(n+10) { display: none; }
}

@media (max-width: 360px) {
  .waveform .bar:nth-child(n+7) { display: none; }
}

@media (max-width: 330px) {
  .waveform .bar:nth-child(n+4) { display: none; }
}

@media (max-width: 300px) {
  .waveform { display: none; }
}

@media (max-height: 160px) {
  #wz-container {
    top: 0;
    transform: none;
  }
}

/* ─── Embed mode ─────────────────────────────────────────── */
body.embed-mode {
  background: #000;
  overflow: hidden;
}

body.embed-mode #tiling-bg {
  display: none;
}

body.embed-mode #wz-container {
  position: static;
  transform: none;
  max-width: 100%;
  width: 100%;
  max-height: 100vh;
}

body.embed-mode #upcoming,
body.embed-mode #links-bar,
body.embed-mode #overlay,
body.embed-mode #content-overlay {
  display: none !important;
}

body.embed-mode #oz-player {
  background-color: #000;
  position: relative;
}

/* Embed play overlay (sits on top of the player) */
#embed-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 900;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#embed-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.embed-overlay-content {
  display: flex;
  align-items: center;
  gap: 16px;
  color: azure;
  font-size: 1.4em;
}

#embed-play-button {
  width: 40px;
  height: 40px;
  border: 3px solid azure;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#embed-play-button:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}

#embed-play-button svg {
  width: 20px;
  height: 20px;
  margin-left: 4px;
}
