/* Ohmera Custom Web Receiver Stylesheet */
:root {
  --bg-top: #09050d;
  --bg-deep: #0b0710;
  --bg-bottom: #100b16;
  --surface: #17101d;
  --surface-raised: #211528;
  --gold: #c7a66a;
  --gold-light: #e4c894;
  --gold-deep: #8f6c3f;
  --glow: #6a3c68;
  --text-white: #ece6ed;
  --text-muted: #b5aab7;
  --text-dim: #736875;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(199, 166, 106, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-top);
  color: var(--text-white);
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Cast Media Player - hidden visually, fully active audio decoding engine */
cast-media-player {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  --theme-hue: 40;
  --progress-color: #c7a66a;
}

/* App Viewport with TV Safe Area (Overscan Protection) */
.tv-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 5vh 6vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  pointer-events: auto;
}

/* Fullscreen Ambient Backdrop System */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, var(--bg-deep) 0%, var(--bg-top) 100%);
}

.backdrop-canvas {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(65px) saturate(1.4) brightness(0.32);
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
  animation: subtleDrift 38s ease-in-out infinite alternate;
}

.backdrop-canvas.active {
  opacity: 1;
}

.backdrop-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 45%,
    rgba(106, 60, 104, 0.32) 0%,
    rgba(17, 11, 22, 0.78) 55%,
    rgba(9, 5, 13, 0.94) 100%
  );
  backdrop-filter: blur(10px);
}

@keyframes subtleDrift {
  0% {
    transform: scale(1.08) translate(0%, 0%);
  }
  50% {
    transform: scale(1.16) translate(-1.5%, 1%);
  }
  100% {
    transform: scale(1.10) translate(1.5%, -1%);
  }
}

/* Header Area with Gold Icon */
.receiver-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand-container {
  display: flex;
  align-items: center;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(199, 166, 106, 0.45));
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(23, 16, 29, 0.65);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #2ed573;
  box-shadow: 0 0 10px #2ed573;
  animation: pulseDot 2.2s infinite;
}

.status-badge.buffering .status-dot {
  background-color: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.status-badge.paused .status-dot {
  background-color: #ffa502;
  box-shadow: 0 0 10px #ffa502;
}

.status-text {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-white);
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

/* Main Playing Card */
.player-main {
  display: flex;
  align-items: center;
  gap: 5vw;
  margin: auto 0;
  transition: opacity 0.5s ease;
}

.artwork-wrapper {
  position: relative;
  width: 380px;
  height: 380px;
  flex-shrink: 0;
}

.artwork-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.85),
    0 0 45px rgba(106, 60, 104, 0.3);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.6s ease;
}

.artwork-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.25) 100%
  );
  pointer-events: none;
}

/* Touch / Smart Display Play-Pause Overlay */
.touch-control-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 5, 13, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.artwork-wrapper:hover .touch-control-overlay,
.artwork-wrapper:active .touch-control-overlay {
  opacity: 1;
}

.touch-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(199, 166, 106, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(199, 166, 106, 0.6);
}

.touch-btn svg {
  width: 32px;
  height: 32px;
  fill: #09050d;
}

/* Metadata & Visualizer */
.track-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 58vw;
}

.category-tag {
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(33, 21, 40, 0.6);
  border: 1px solid var(--border-gold);
  margin-bottom: 18px;
}

.track-title {
  font-size: 3.1rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.track-artist {
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 26px;
  letter-spacing: 0.02em;
}

/* Equalizer Live Waveform Animation */
.visualizer-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 26px;
}

.eq-bar {
  width: 5px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  transition: height 0.2s ease;
}

.playing .eq-bar:nth-child(1) {
  animation: eqPulse 1.2s infinite ease-in-out;
}
.playing .eq-bar:nth-child(2) {
  animation: eqPulse 0.9s infinite ease-in-out 0.2s;
}
.playing .eq-bar:nth-child(3) {
  animation: eqPulse 1.4s infinite ease-in-out 0.4s;
}
.playing .eq-bar:nth-child(4) {
  animation: eqPulse 1.1s infinite ease-in-out 0.1s;
}
.playing .eq-bar:nth-child(5) {
  animation: eqPulse 1.3s infinite ease-in-out 0.3s;
}

@keyframes eqPulse {
  0%, 100% {
    height: 6px;
  }
  50% {
    height: 26px;
  }
}

.playback-state-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

/* Footer & Progress Section */
.receiver-footer {
  width: 100%;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: visible;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--glow) 0%, var(--gold-deep) 40%, var(--gold) 100%);
  box-shadow: 0 0 12px rgba(199, 166, 106, 0.5);
  transition: width 0.35s linear;
}

.progress-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-white);
  box-shadow: 0 0 10px var(--gold);
}

.progress-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

/* Idle / Ready Screen with Larger Ohmera Logo */
.idle-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 6vh 8vw;
  text-align: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.idle-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.idle-emblem-container {
  position: relative;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}

.idle-emblem-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 166, 106, 0.45) 0%, rgba(106, 60, 104, 0) 70%);
  animation: breathingGlow 3.6s ease-in-out infinite alternate;
}

.idle-logo-img {
  height: 220px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 32px rgba(199, 166, 106, 0.65));
  z-index: 2;
}

@keyframes breathingGlow {
  0% {
    transform: scale(0.92);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.25);
    opacity: 0.95;
  }
}

.idle-title {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-white);
  margin-bottom: 12px;
}

.idle-subtitle {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.5;
  margin-bottom: 38px;
}

.idle-steps {
  display: flex;
  align-items: center;
  gap: 20px;
}

.idle-step-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(23, 16, 29, 0.7);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(10px);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-top);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-white);
}

/* Hidden Utility */
.hidden {
  display: none !important;
}
