/*
  Ghost / 未读凡灵 Radio
  Futuristic radio-face version. Stationary flip ghost.

  No Next button.
  No progress bar.
  No signal-time display.
  No track count.
  Time-based station behaviour remains internal.

  v5 alignment notes:
  - Little ghost centred against the main display text.
  - Ghost size is set just smaller than the text line.
  - Dial glow remains on the 100.0 marker.
*/

:root {
  color-scheme: dark;
  --wf-blue: #9fe8ff;
  --wf-blue-soft: rgba(159, 232, 255, .62);
  --wf-border: rgba(159, 232, 255, .22);
  --wf-panel: rgba(4, 8, 14, .86);
  --wf-text: #edf8ff;
  --wf-muted: rgba(237, 248, 255, .66);
}

html,
body {
  margin: 0;
  overflow: hidden;
  background: #000;
}

body.wf-standalone {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(.45rem, 2vw, 1rem);
  color: var(--wf-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background:
    radial-gradient(circle at 50% 8%, rgba(90, 180, 255, .12), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(120, 180, 255, .08), transparent 26%),
    #000;
}

#weidu-radio-page {
  width: min(100%, 1120px);
  max-height: calc(100vh - 1rem);
  margin: 0 auto;
  box-sizing: border-box;
}

#weidu-radio-page * {
  box-sizing: border-box;
}

#weidu-radio-page .wf-radio-face {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: clamp(16px, 2vw, 28px);
  background:
    linear-gradient(180deg, rgba(20, 35, 46, .62), rgba(0, 0, 0, .94)),
    #020509;
  border: 1px solid rgba(160, 225, 255, .22);
  box-shadow:
    0 22px 80px rgba(0, 0, 0, .74),
    0 0 34px rgba(80, 180, 255, .10),
    inset 0 0 40px rgba(120, 220, 255, .045);
}

#weidu-radio-page .wf-radio-face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, .035) 0,
      rgba(255, 255, 255, .035) 1px,
      transparent 2px,
      transparent 5px
    );
  opacity: .22;
  mix-blend-mode: screen;
}

#weidu-radio-page .wf-radio-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

#weidu-radio-page .wf-radio-glow {
  position: absolute;
  z-index: 2;
  left: 54.37%;
  top: 57.55%;
  width: .62%;
  height: 6.8%;
  border-radius: 999px;
  background: rgba(156, 235, 255, .88);
  box-shadow:
    0 0 14px rgba(156, 235, 255, .8),
    0 0 42px rgba(156, 235, 255, .42);
  transform-origin: center bottom;
  animation: wf-tuner-breathe 2.7s ease-in-out infinite;
}

#weidu-radio-page .wf-radio-ghost {
  position: absolute;
  z-index: 3;
  /* Centre point of the ghost inside the main tuner text display. */
  left: 25.45%;
  top: 33.55%;
  /* Just a touch smaller than the main display text. */
  height: clamp(36px, 4.1vw, 52px);
  width: auto;
  max-width: none;
  opacity: .88;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: screen;
  filter:
    drop-shadow(0 0 7px rgba(185, 230, 255, .9))
    drop-shadow(0 0 20px rgba(100, 200, 255, .48));
  transform-origin: center;
  transform: translate(-50%, -50%);
  animation:
    wf-ghost-flip 9.0s ease-in-out infinite,
    wf-ghost-pulse 4.5s ease-in-out infinite;
}

#weidu-radio-page .wf-card {
  width: min(100%, 880px);
  margin: clamp(.55rem, 1.5vw, .95rem) auto 0;
  padding: clamp(.85rem, 2vw, 1.1rem);
  border-radius: clamp(14px, 2vw, 20px);
  border: 1px solid var(--wf-border);
  background:
    radial-gradient(circle at 15% 0%, rgba(160, 230, 255, .08), transparent 34%),
    linear-gradient(180deg, rgba(11, 15, 24, .90), rgba(2, 3, 7, .94));
  box-shadow:
    0 16px 60px rgba(0, 0, 0, .54),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

#weidu-radio-page .wf-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}

#weidu-radio-page .wf-kicker {
  margin: 0 0 .35rem;
  opacity: .62;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: clamp(.62rem, 1.3vw, .76rem);
}

#weidu-radio-page .wf-title {
  margin: 0;
  color: #f5fbff;
  font-size: clamp(1.28rem, 3.8vw, 2.05rem);
  line-height: 1.05;
  letter-spacing: .015em;
  text-shadow: 0 0 18px rgba(145, 230, 255, .16);
}

#weidu-radio-page .wf-tagline {
  margin: .46rem 0 0;
  color: var(--wf-muted);
  line-height: 1.35;
  font-size: clamp(.8rem, 1.7vw, .94rem);
}

#weidu-radio-page .wf-status {
  flex: 0 0 auto;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  color: var(--wf-muted);
  padding-top: .16rem;
}

#weidu-radio-page .wf-status::before {
  content: "";
  display: inline-block;
  width: .56rem;
  height: .56rem;
  margin-right: .42rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .72;
  vertical-align: -.04rem;
}

#weidu-radio-page[data-state="live"] .wf-status {
  color: var(--wf-blue);
}

#weidu-radio-page[data-state="live"] .wf-status::before {
  animation: wf-live-pulse 1.45s ease-in-out infinite;
}

#weidu-radio-page[data-state="error"] .wf-status,
#weidu-radio-page[data-state="blocked"] .wf-status {
  color: #ffb7b7;
}

#weidu-radio-page .wf-track-panel {
  margin: .75rem 0 .82rem;
  padding: clamp(.8rem, 2vw, 1rem);
  border: 1px solid rgba(159, 232, 255, .16);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(159, 232, 255, .045), transparent),
    rgba(0, 0, 0, .48);
}

#weidu-radio-page .wf-label {
  margin: 0 0 .52rem;
  text-transform: uppercase;
  letter-spacing: .17em;
  color: var(--wf-muted);
  font-size: .70rem;
}

#weidu-radio-page .wf-track-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1rem, 2.8vw, 1.32rem);
  line-height: 1.24;
}

#weidu-radio-page .wf-meta {
  margin: .42rem 0 0;
  color: rgba(237, 248, 255, .58);
  font-size: .84rem;
}

#weidu-radio-page .wf-fragment {
  margin: .7rem 0 0;
  color: rgba(237, 248, 255, .82);
  line-height: 1.45;
  font-size: .9rem;
}

#weidu-radio-page .wf-controls {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin: .78rem 0 0;
}

#weidu-radio-page button {
  appearance: none;
  border: 1px solid rgba(159, 232, 255, .38);
  background:
    linear-gradient(180deg, rgba(159, 232, 255, .18), rgba(159, 232, 255, .055));
  color: #f7fdff;
  border-radius: 999px;
  padding: .76rem 1.28rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 0 20px rgba(90, 200, 255, .10);
}

#weidu-radio-page button:hover,
#weidu-radio-page button:focus {
  background:
    linear-gradient(180deg, rgba(159, 232, 255, .26), rgba(159, 232, 255, .08));
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 0 28px rgba(90, 200, 255, .18);
}

#weidu-radio-page button:disabled {
  cursor: wait;
  opacity: .65;
}

#weidu-radio-page .wf-message {
  margin: .7rem 0 0;
  color: rgba(237, 248, 255, .66);
  line-height: 1.45;
  font-size: .86rem;
}

@keyframes wf-live-pulse {
  0%, 100% {
    opacity: .34;
    box-shadow: 0 0 0 rgba(190, 235, 255, 0);
  }
  50% {
    opacity: .98;
    box-shadow: 0 0 18px rgba(190, 235, 255, .74);
  }
}

@keyframes wf-tuner-breathe {
  0%, 100% {
    opacity: .58;
    transform: translateX(-50%) translateY(0) scaleY(.88);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px) scaleY(1.04);
  }
}

@keyframes wf-ghost-flip {
  0%, 42% {
    transform: translate(-50%, -50%) scaleX(1);
  }
  50%, 92% {
    transform: translate(-50%, -50%) scaleX(-1);
  }
  100% {
    transform: translate(-50%, -50%) scaleX(1);
  }
}

@keyframes wf-ghost-pulse {
  0%, 100% {
    opacity: .58;
    filter:
      drop-shadow(0 0 5px rgba(185, 230, 255, .58))
      drop-shadow(0 0 14px rgba(100, 200, 255, .30));
  }
  50% {
    opacity: .96;
    filter:
      drop-shadow(0 0 10px rgba(210, 245, 255, .98))
      drop-shadow(0 0 32px rgba(110, 210, 255, .62));
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: hidden;
  }

  body.wf-standalone {
    place-items: center;
    min-height: 100vh;
    padding: .45rem;
  }

  #weidu-radio-page {
    max-height: calc(100vh - .9rem);
  }

  #weidu-radio-page .wf-card {
    border-radius: 15px;
    padding: .72rem;
    margin-top: .46rem;
  }

  #weidu-radio-page .wf-header {
    display: block;
  }

  #weidu-radio-page .wf-status {
    margin-top: .65rem;
  }

  #weidu-radio-page .wf-radio-ghost {
    left: 25.45%;
    top: 33.55%;
    height: clamp(31px, 5.4vw, 46px);
    width: auto;
    max-width: none;
  }
}
