/* RaidenX8 v32.1 – WOW Hyper-Premium DataStream Orb
   Upgraded: 3D Orb video layer, glow trail frame, LIVE vertical auto-play UI,
   Music Card v2 với waveform + mood color.
*/

/* ------------ Reset & Base ------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #03040a;
  --bg-elevated: rgba(7, 10, 25, 0.96);
  --bg-card: rgba(10, 13, 35, 0.92);
  --bg-chip: rgba(16, 24, 48, 0.95);
  --border-subtle: rgba(120, 140, 255, 0.25);

  --text-main: #f9fbff;
  --text-subtle: #a9b3ff;
  --text-mute: #7f8ac5;
  --accent-sol-1: #15f1ff;
  --accent-sol-2: #8a63ff;
  --accent-sol-3: #32ffb5;
  --accent-live: #ff3878;
  --accent-music: #ffb347;

  --radius-lg: 22px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --shadow-soft: 0 22px 60px rgba(0, 0, 0, 0.8);
  --shadow-orb: 0 0 90px rgba(105, 214, 255, 0.8);

  --transition-soft: 180ms ease-out;
  --transition-orb: 24s cubic-bezier(0.4, 0.0, 0.2, 1);
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
  background: radial-gradient(circle at top, #0a1020 0, #020308 60%, #01010a 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

/* ------------ Background Trinity ------------ */

#bg-particles {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  display: block;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.bg-aurora {
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 58, 255, 0.45), transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(0, 215, 255, 0.45), transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(49, 255, 181, 0.38), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: auroraShift 18s ease-in-out infinite alternate;
}

.bg-glow {
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(140, 121, 255, 0.35), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.55;
  filter: blur(6px);
  animation: glowPulse 16s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-12px, 16px, 0) scale(1.03);
  }
}

@keyframes glowPulse {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.85;
  }
}

/* ------------ App Shell ------------ */

#app {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 18px;
  gap: 12px;
  background: linear-gradient(
      135deg,
      rgba(4, 7, 26, 0.96),
      rgba(3, 10, 32, 0.98),
      rgba(6, 9, 28, 0.96)
    );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
  border-radius: 24px;
  margin: 10px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(19, 26, 60, 0.96),
    rgba(13, 22, 56, 0.9)
  );
  border: 1px solid rgba(111, 151, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-orb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: conic-gradient(
    from 220deg,
    #8a63ff,
    #15f1ff,
    #32ffb5,
    #ff7ad9,
    #8a63ff
  );
  box-shadow: 0 0 20px rgba(117, 214, 255, 0.9);
  position: relative;
}

.brand-orb::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, #ffffff, #050814);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: #ffffff;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-subtle);
}

.cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-sol {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(94, 235, 255, 0.6);
  background: radial-gradient(circle at 0 0, rgba(50, 255, 181, 0.2), transparent 55%),
    rgba(10, 26, 58, 0.9);
  font-size: 11px;
  color: #e2f8ff;
  white-space: nowrap;
}

/* ------------ Layout ------------ */

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  width: 100%;
}

/* Glow trail frame quanh hero */
.hero-glow-frame {
  position: relative;
}

.hero-glow-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 28px;
  padding: 1px;
  background: conic-gradient(
    from 210deg,
    rgba(21, 241, 255, 0.0),
    rgba(21, 241, 255, 0.8),
    rgba(138, 99, 255, 0.0),
    rgba(50, 255, 181, 0.7),
    rgba(21, 241, 255, 0.0)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.0;
  pointer-events: none;
  animation: glowTrail 6s ease-in-out infinite;
}

@keyframes glowTrail {
  0% {
    opacity: 0.0;
    transform: scale(1);
  }
  30% {
    opacity: 0.8;
    transform: scale(1.005);
  }
  60% {
    opacity: 0.0;
    transform: scale(1);
  }
  100% {
    opacity: 0.0;
  }
}

/* Stack on small screens */

@media (max-width: 900px) {
  #app {
    margin: 0;
    border-radius: 0;
  }

  .top-bar {
    padding-inline: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

/* ------------ Hero Main (Orb + Copy) ------------ */

.hero-main {
  position: relative;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, #17224e 0, #050618 40%, #02030d 100%);
  border: 1px solid rgba(111, 151, 255, 0.45);
  padding: 18px 18px 12px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
}

@media (max-width: 1200px) {
  .hero-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

.orb-wrapper {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 280px;
  margin: auto;
  display: grid;
  place-items: center;
}

/* Video 3D orb */
.orb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  filter: saturate(1.2) brightness(1.15);
  box-shadow: 0 0 72px rgba(117, 233, 255, 0.95);
}

/* CSS orb fallback */
.orb {
  position: absolute;
  border-radius: 999px;
}

/* Halo */
.orb.halo {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle, rgba(191, 231, 255, 0.3), transparent 60%),
    conic-gradient(from 220deg, rgba(21, 241, 255, 0.2), rgba(50, 255, 181, 0.0), rgba(138, 99, 255, 0.3));
  filter: blur(6px);
  animation: haloRotate var(--transition-orb) linear infinite;
}

@keyframes haloRotate {
  from {
    transform: scale(1.02) rotate(0deg);
  }
  to {
    transform: scale(1.06) rotate(360deg);
  }
}

/* Core */
.orb.core {
  width: 58%;
  height: 58%;
  background:
    radial-gradient(circle at 30% 20%, #ffffff, #7deeff 35%, #141f3b 70%, #050612 100%);
  box-shadow: var(--shadow-orb);
  animation: corePulse 4.4s ease-in-out infinite alternate;
}

@keyframes corePulse {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 55px rgba(120, 227, 255, 0.8);
  }
  100% {
    transform: scale(1.04);
    box-shadow: 0 0 100px rgba(121, 243, 210, 0.95);
  }
}

/* Rings */
.orb.ring {
  border: 1px solid rgba(196, 237, 255, 0.5);
  box-shadow: 0 0 30px rgba(125, 222, 255, 0.7);
}

.orb.ring-1 {
  width: 74%;
  height: 74%;
  animation: ringOrbit1 var(--transition-orb) linear infinite;
}
.orb.ring-2 {
  width: 88%;
  height: 88%;
  animation: ringOrbit2 18s linear infinite reverse;
}
.orb.ring-3 {
  width: 98%;
  height: 98%;
  border-style: dashed;
  border-color: rgba(72, 202, 255, 0.7);
  animation: ringOrbit3 26s linear infinite;
}

@keyframes ringOrbit1 {
  from {
    transform: rotateX(58deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(58deg) rotateZ(360deg);
  }
}

@keyframes ringOrbit2 {
  from {
    transform: rotateX(72deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(72deg) rotateZ(360deg);
  }
}

@keyframes ringOrbit3 {
  from {
    transform: rotateX(80deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(80deg) rotateZ(360deg);
  }
}

/* DataStream */
.orb.datastream {
  width: 2px;
  height: 120%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(21, 241, 255, 0.9),
    rgba(50, 255, 181, 0.0)
  );
  filter: blur(0.5px);
  transform-origin: center;
}

.datastream-1 {
  animation: streamOrbit1 3.4s linear infinite;
}
.datastream-2 {
  animation: streamOrbit2 4.1s linear infinite;
}
.datastream-3 {
  animation: streamOrbit3 5s linear infinite;
}

@keyframes streamOrbit1 {
  from {
    transform: rotate(0deg) translateY(-4%);
  }
  to {
    transform: rotate(360deg) translateY(-4%);
  }
}

@keyframes streamOrbit2 {
  from {
    transform: rotate(140deg) translateY(-4%);
  }
  to {
    transform: rotate(500deg) translateY(-4%);
  }
}

@keyframes streamOrbit3 {
  from {
    transform: rotate(250deg) translateY(-4%);
  }
  to {
    transform: rotate(610deg) translateY(-4%);
  }
}

/* Sparkles */
.orb.sparkle {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #ffffff, rgba(255, 255, 255, 0));
  mix-blend-mode: screen;
}

.sparkle-1 {
  top: 18%;
  right: 28%;
  animation: sparklePulse1 2.4s ease-in-out infinite alternate;
}
.sparkle-2 {
  bottom: 16%;
  left: 20%;
  animation: sparklePulse2 3.1s ease-in-out infinite alternate;
}
.sparkle-3 {
  top: 40%;
  left: 10%;
  animation: sparklePulse3 4s ease-in-out infinite alternate;
}

@keyframes sparklePulse1 {
  0% {
    opacity: 0.1;
    transform: scale(0.7);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.1);
  }
}
@keyframes sparklePulse2 {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  100% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}
@keyframes sparklePulse3 {
  0% {
    opacity: 0.15;
    transform: scale(0.6);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.15);
  }
}

/* ------------ Hero Copy ------------ */

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding-left: 4px;
}

.hero-copy h1 {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.18;
  margin: 0;
  letter-spacing: 0.02em;
}

.hero-copy p {
  margin: 0;
  font-size: 13px;
  color: var(--text-subtle);
  max-width: 440px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(13, 24, 58, 0.9);
  border: 1px solid rgba(134, 161, 255, 0.6);
  font-size: 11px;
  color: #dfe7ff;
}

.pill-primary {
  background: linear-gradient(135deg, #5be7ff, #32ffb5);
  color: #020514;
  border-color: transparent;
}

/* Ticker */

.ticker {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(101, 149, 255, 0.55);
  background: radial-gradient(circle at 0 0, rgba(20, 215, 255, 0.32), transparent 60%),
    rgba(4, 10, 36, 0.96);
  padding-block: 4px;
  margin-top: 4px;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-inline: 14px;
  white-space: nowrap;
  animation: tickerScroll 22s linear infinite;
}

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
}

.tk-label {
  font-weight: 600;
  color: #f5fbff;
}

.tk-value {
  color: #9ff6ff;
}

.tk-value::before {
  content: "•";
  margin-right: 4px;
  color: rgba(159, 246, 255, 0.5);
}

.ticker-item:nth-child(3n) .tk-value {
  color: #ffb4c5;
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ------------ Hero Side (LIVE + Music) ------------ */

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-section {
  border-radius: var(--radius-xl);
  background: linear-gradient(
    145deg,
    rgba(11, 16, 40, 0.98),
    rgba(7, 11, 28, 0.98)
  );
  border: 1px solid rgba(111, 151, 255, 0.5);
  padding: 12px 12px 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.side-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f7fbff;
}

.side-sub {
  font-size: 11px;
  color: var(--text-mute);
}

/* Live grid */

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-card {
  position: relative;
  border-radius: 14px;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  background: radial-gradient(circle at top, #283366 0, #050615 55%, #01020a 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
  transition: transform var(--transition-soft), box-shadow var(--transition-soft),
    border-color var(--transition-soft), background 260ms ease-out;
  border: 1px solid rgba(118, 152, 255, 0.7);
}

.live-card::after {
  /* glow trail nhỏ chạy quanh card khi hover (nhìn như Douyin) */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(21, 241, 255, 0.0),
    rgba(21, 241, 255, 0.6),
    rgba(255, 56, 120, 0.4),
    rgba(21, 241, 255, 0.0)
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
}

.live-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 35px rgba(5, 247, 255, 0.35);
  border-color: rgba(106, 227, 255, 0.95);
}

.live-card:hover::after {
  opacity: 1;
}

.live-video-shell {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
}

.live-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-gradient-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(4, 6, 18, 0.9),
      rgba(4, 6, 18, 0.4),
      rgba(4, 6, 18, 0.1)
    );
  mix-blend-mode: multiply;
}

/* progress vertical */
.live-progress-vertical {
  position: absolute;
  right: 5px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.live-progress-vertical::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(180deg, #ff8ab5, #ff3878);
  animation: liveProgressFill 4.2s linear infinite;
}

@keyframes liveProgressFill {
  0% {
    transform: translateY(110%);
  }
  100% {
    transform: translateY(-110%);
  }
}

.live-meta {
  position: absolute;
  inset: 0;
  padding: 7px 7px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.live-badge {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff3f9;
  background: radial-gradient(circle at 0 0, #ff8ab5, #ff3878);
  box-shadow: 0 0 16px rgba(255, 56, 120, 0.6);
}

.live-title {
  font-size: 11px;
  font-weight: 550;
  color: #fdfbff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

.live-viewers {
  font-size: 10px;
  color: #fbe3ff;
  opacity: 0.9;
}

/* Music card v2 */

.music-section {
  margin-top: 2px;
}

.music-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
}

.music-card-v2 {
  background: radial-gradient(circle at 0 0, rgba(255, 181, 112, 0.2), transparent 55%),
    rgba(10, 14, 40, 0.98);
  border: 1px solid rgba(255, 197, 133, 0.7);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
}

.music-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
}

.music-ring {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: conic-gradient(
    from 180deg,
    rgba(255, 179, 71, 1),
    rgba(255, 118, 118, 0.9),
    rgba(255, 179, 71, 1)
  );
  animation: musicRing 6s linear infinite;
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.75);
}

.music-core {
  position: absolute;
  width: 74%;
  height: 74%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffffff, #ffb347 45%, #32100a 85%);
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.95);
}

.music-wave-orb {
  position: absolute;
  inset: 14%;
  border-radius: 999px;
  border: 1px solid rgba(255, 234, 203, 0.7);
  box-shadow: 0 0 16px rgba(255, 214, 173, 0.8);
  opacity: 0.0;
  animation: musicWaveOrb 2.6s ease-out infinite;
}

@keyframes musicRing {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1.02);
  }
}

@keyframes musicWaveOrb {
  0% {
    opacity: 0.0;
    transform: scale(1);
  }
  40% {
    opacity: 0.9;
    transform: scale(1.12);
  }
  100% {
    opacity: 0.0;
    transform: scale(1.25);
  }
}

.music-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.music-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.music-title {
  font-size: 13px;
  font-weight: 600;
}

.music-subtitle {
  font-size: 11px;
  color: var(--text-subtle);
}

.music-play {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 0 0, #ffffff, #ffe0b3);
  color: #32140c;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 186, 116, 0.9);
  transition: transform var(--transition-soft), box-shadow var(--transition-soft),
    filter var(--transition-soft);
}

.music-play:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.music-play-icon {
  font-size: 11px;
  transform: translateX(1px);
}

/* Moods */

.music-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mood-chip {
  border-radius: 999px;
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 210, 150, 0.7);
  background: rgba(33, 19, 10, 0.9);
  color: #ffe5c9;
  cursor: pointer;
  transition: background var(--transition-soft), color var(--transition-soft),
    transform var(--transition-soft), box-shadow var(--transition-soft);
}

.mood-chip.active {
  background: radial-gradient(circle at 0 0, #ffb347, #ff7a5c);
  color: #20100a;
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.9);
}

/* Waveform */

.music-waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: 6px;
  height: 14px;
}

.music-waveform .bar {
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe2c4, #ff9b5f);
  opacity: 0.7;
  transform-origin: bottom;
  animation: musicBars 0.95s ease-in-out infinite alternate;
}

.music-waveform .bar:nth-child(2),
.music-waveform .bar:nth-child(6) {
  animation-duration: 0.7s;
}
.music-waveform .bar:nth-child(3),
.music-waveform .bar:nth-child(5) {
  animation-duration: 0.8s;
}
.music-waveform .bar:nth-child(4) {
  animation-duration: 0.6s;
}

@keyframes musicBars {
  0% {
    transform: scaleY(0.3);
  }
  100% {
    transform: scaleY(1);
  }
}

/* Progress */

.music-progress {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.music-progress-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 199, 145, 0.25);
  overflow: hidden;
}

.music-progress-fill {
  width: 32%;
  height: 100%;
  background: linear-gradient(90deg, #ffb347, #ff7a5c);
  animation: musicProgress 7.5s linear infinite;
}

@keyframes musicProgress {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(60%);
  }
}

.music-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #ffe2c4;
}

/* ------------ AI Orb & Panel ------------ */

.ai-orb-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 10;
}

.ai-orb-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(144, 234, 255, 0.5), transparent 70%);
  animation: aiPulse 2.6s ease-out infinite;
  opacity: 0.65;
}

.ai-orb-core {
  position: relative;
  width: 70%;
  height: 70%;
  border-radius: 999px;
  background: conic-gradient(
    from 200deg,
    #15f1ff,
    #8a63ff,
    #32ffb5,
    #15f1ff
  );
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #021018;
  box-shadow: 0 0 26px rgba(157, 237, 255, 0.95);
}

@keyframes aiPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

/* AI Panel */

.ai-panel {
  position: absolute;
  right: 18px;
  bottom: 78px;
  width: min(360px, 100% - 32px);
  max-height: 54vh;
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(10, 16, 42, 0.98),
    rgba(7, 12, 31, 0.98)
  );
  border: 1px solid rgba(118, 157, 255, 0.7);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  transform-origin: 100% 100%;
  transform: scale(0.8) translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 200ms ease-out;
  overflow: hidden;
  z-index: 9;
}

.ai-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(92, 130, 255, 0.45);
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #45ffb5;
  box-shadow: 0 0 12px rgba(69, 255, 181, 0.9);
}

.ai-panel-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-panel-title {
  font-size: 12px;
  font-weight: 600;
}

.ai-panel-subtitle {
  font-size: 10px;
  color: var(--text-mute);
}

.ai-panel-close {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  background: rgba(17, 25, 62, 0.9);
  color: var(--text-subtle);
}

.ai-panel-body {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.ai-message {
  display: flex;
  gap: 6px;
}

.ai-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: conic-gradient(
    from 210deg,
    #15f1ff,
    #8a63ff,
    #32ffb5,
    #15f1ff
  );
}

.ai-avatar-user {
  background: radial-gradient(circle at 30% 20%, #ffffff, #ffb347);
}

.ai-bubble {
  max-width: 100%;
  border-radius: 12px 12px 12px 2px;
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1.5;
  background: rgba(18, 25, 66, 0.95);
  border: 1px solid rgba(125, 162, 255, 0.7);
}

.ai-message-user .ai-bubble {
  border-radius: 12px 12px 2px 12px;
  background: radial-gradient(circle at 0 0, rgba(255, 179, 71, 0.25), transparent 55%),
    rgba(25, 17, 8, 0.95);
  border-color: rgba(255, 193, 122, 0.7);
}

.ai-panel-footer {
  padding: 8px 10px 10px;
  display: flex;
  gap: 6px;
  border-top: 1px solid rgba(86, 120, 255, 0.45);
}

.ai-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(102, 142, 255, 0.8);
  background: rgba(7, 12, 34, 0.96);
  color: var(--text-main);
  font-size: 11px;
  outline: none;
  padding: 6px 10px;
}

.ai-input::placeholder {
  color: var(--text-mute);
}

.ai-send {
  border-radius: 999px;
  border: 0;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #5be7ff, #32ffb5);
  color: #020512;
}

/* ------------ Scrollbars ------------ */

.ai-panel-body::-webkit-scrollbar {
  width: 4px;
}
.ai-panel-body::-webkit-scrollbar-thumb {
  background: rgba(120, 149, 255, 0.7);
  border-radius: 999px;
}

/* ------------ Responsive tweaks ------------ */

@media (max-width: 900px) {
  #app {
    margin: 0;
    border-radius: 0;
  }

  .hero-main {
    padding: 14px;
  }

  .hero-side {
    flex-direction: row;
  }

  .side-section {
    flex: 1;
  }

  .live-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 640px) {
  .hero-side {
    flex-direction: column;
  }

  .music-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .live-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ------------ LIVE FULLSCREEN MODAL (Douyin-style) ------------ */

.live-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(9, 15, 35, 0.95), rgba(0, 0, 0, 0.96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.live-modal.show {
  display: flex;
}

.live-modal-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 10px;
  box-sizing: border-box;
}

.live-video-wrapper-full {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 1);
  background: radial-gradient(circle at top, #151a33, #020309);
}

#live-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Close button */
.live-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  border: none;
  color: #fdfbff;
  background: radial-gradient(circle at 0 0, rgba(21, 241, 255, 0.9), rgba(2, 5, 14, 0.9));
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(12, 227, 255, 0.8);
  cursor: pointer;
  z-index: 20;
}

/* Sound toggle button */
.sound-btn {
  position: absolute;
  bottom: 24px;
  right: 22px;
  width: 54px;
  height: 54px;
  font-size: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fdfbff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.9);
  z-index: 30;
  background: radial-gradient(circle at 0 0, rgba(21, 241, 255, 0.8), rgba(2, 5, 14, 0.95));
}

.sound-btn.muted {
  background: radial-gradient(circle at 0 0, rgba(255, 56, 120, 0.9), rgba(20, 3, 10, 0.96));
}

/* Responsive tweaks for modal */
@media (max-width: 640px) {
  .live-modal-content {
    padding: 0;
  }

  .live-video-wrapper-full {
    max-width: none;
    border-radius: 0;
  }
}

