/* ════════════════════════════════════════════
   EdeeTube — pink & purple, soft and sparkly
   ════════════════════════════════════════════ */

:root {
  --pink-50:  #fff0f8;
  --pink-200: #ffc2e2;
  --pink-400: #ff7ac0;
  --pink-500: #ff4fa3;
  --berry:    #d6247f;
  --lilac:    #c39bff;
  --purple:   #8a3ffc;
  --plum:     #4a0f5e;

  --glass:        rgba(255, 255, 255, 0.16);
  --glass-strong: rgba(255, 255, 255, 0.24);
  --glass-border: rgba(255, 255, 255, 0.38);
  --shadow:       0 10px 30px rgba(74, 15, 94, 0.28);
  --shadow-lift:  0 18px 40px rgba(74, 15, 94, 0.38);

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --font-display: "DynaPuff", system-ui, sans-serif;
  --font-body: "Sour Gummy", system-ui, sans-serif;

  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Page ─────────────────────────────────── */

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 48px;
  font-family: var(--font-body);
  color: #fff;
  background-color: #a8329b;
}

/* Dreamy gradient, pinned to the screen (works on iOS, unlike background-attachment: fixed) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(55vmax 55vmax at 8% 6%,   rgba(255, 194, 226, 0.55), transparent 60%),
    radial-gradient(45vmax 45vmax at 95% 15%, rgba(195, 155, 255, 0.60), transparent 60%),
    radial-gradient(60vmax 60vmax at 50% 115%, rgba(255, 122, 192, 0.65), transparent 60%),
    linear-gradient(160deg, #7b2ff7 0%, #c2187f 55%, #ff6fb5 100%);
}

/* Twinkly sparkles behind everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 30px 40px,  #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 120px 90px, #fff, transparent 60%),
    radial-gradient(2.5px 2.5px at 200px 30px, var(--pink-200), transparent 60%),
    radial-gradient(1.5px 1.5px at 260px 160px, #fff, transparent 60%),
    radial-gradient(2px 2px at 80px 200px, var(--pink-50), transparent 60%);
  background-size: 300px 240px;
  opacity: 0.55;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to   { opacity: 0.75; }
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  border-radius: 12px;
}

h1, h2, h3, h5 { font-family: var(--font-display); font-weight: 700; }

/* ── Logo ─────────────────────────────────── */

.logo {
  display: inline-block;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1;
  color: #fff;
  letter-spacing: 0.01em;
  /* candy "sticker" look */
  text-shadow:
    0 3px 0 var(--pink-400),
    0 6px 0 var(--berry),
    0 12px 28px rgba(74, 15, 94, 0.45);
  transition: transform 0.4s var(--bounce);
}
.logo-link { text-decoration: none; }
.logo-link:hover .logo { transform: rotate(-3deg) scale(1.04); }

.logo .sparkle {
  display: inline-block;
  font-size: 0.45em;
  vertical-align: top;
  margin-left: 0.1em;
  text-shadow: none;
  animation: sparkle-spin 3.5s ease-in-out infinite;
}
@keyframes sparkle-spin {
  0%, 100% { transform: rotate(0) scale(1); }
  50%      { transform: rotate(20deg) scale(1.2); }
}

/* ── Home hero ────────────────────────────── */

.home-hero {
  text-align: center;
  padding: clamp(40px, 8vh, 80px) 16px 28px;
}
.tagline {
  margin: 18px 0 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  color: var(--pink-50);
  text-shadow: 0 2px 8px rgba(74, 15, 94, 0.35);
}

/* ── Channel tiles (home) ─────────────────── */

.channel-tile {
  --accent: linear-gradient(135deg, var(--pink-400), var(--purple));
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 30px 20px 24px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.35s var(--bounce), box-shadow 0.3s ease, background 0.3s ease;
}
.channel-tile:hover,
.channel-tile:focus-visible {
  color: #fff;
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: var(--shadow-lift);
  background: var(--glass-strong);
}
.channel-tile:active { transform: translateY(-2px) scale(0.98); }

.emoji-bubble {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  font-size: 3rem;
  line-height: 1;
  border-radius: 50%;
  background: var(--accent, linear-gradient(135deg, #ff9ccf, #ff4fa3));
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.12),
    inset 0 6px 10px rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(74, 15, 94, 0.3);
  transition: transform 0.45s var(--bounce);
}
.channel-tile:hover .emoji-bubble { transform: scale(1.12) rotate(8deg); }

.channel-tile .tile-name {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(74, 15, 94, 0.35);
}

.tile-cta {
  margin-top: auto;
  padding: 8px 20px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--plum);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(74, 15, 94, 0.25);
  transition: background 0.25s, color 0.25s;
}
.channel-tile:hover .tile-cta { background: var(--pink-50); color: var(--berry); }

/* ── Buttons ──────────────────────────────── */

.btn-primary,
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--pink-500), var(--purple));
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(138, 63, 252, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.3s var(--bounce), box-shadow 0.25s, filter 0.25s;
}
.btn-primary:hover,
.btn-primary:focus-visible,
.btn-pill:hover,
.btn-pill:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--pink-500), var(--purple));
  border-color: #fff;
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 24px rgba(138, 63, 252, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:active,
.btn-pill:active { transform: scale(0.97); }

.btn-ghost {
  background: var(--glass);
  box-shadow: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover,
.btn-ghost:focus-visible { background: var(--glass-strong); }

.btn-lg-pill { padding: 16px 40px; font-size: 1.2rem; }

/* ── Channel page header ──────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 8px;
  background: rgba(123, 47, 247, 0.28);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-header .logo {
  font-size: clamp(2rem, 6vw, 2.75rem);
  text-shadow:
    0 2px 0 var(--pink-400),
    0 4px 0 var(--berry),
    0 8px 18px rgba(74, 15, 94, 0.4);
}

/* ── Channel hero ─────────────────────────── */

.channel-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0 28px;
}
.channel-hero .emoji-bubble {
  flex: none;
  width: 76px;
  height: 76px;
  font-size: 2.4rem;
}
.channel-hero:empty { display: none; }

#channelName {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
  text-shadow: 0 3px 12px rgba(74, 15, 94, 0.4);
}
.channel-sub {
  margin: 4px 0 0;
  font-size: 1.1rem;
  color: var(--pink-50);
  opacity: 0.9;
}

/* ── Video cards ──────────────────────────── */

.video-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  text-align: left;
  color: #fff;
  font: inherit;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s var(--bounce), box-shadow 0.3s ease, border-color 0.3s;
}
.video-card:hover,
.video-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: #fff;
}
.video-card:active { transform: scale(0.98); }
.video-card.is-playing {
  border-color: #fff;
  box-shadow: 0 0 0 4px var(--pink-400), var(--shadow-lift);
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: rgba(74, 15, 94, 0.35);
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.06); }

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding-left: 4px;
  font-size: 1.5rem;
  color: var(--berry);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(74, 15, 94, 0.4);
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0.85;
  transition: transform 0.35s var(--bounce), opacity 0.25s;
}
.video-card:hover .play-badge,
.video-card:focus-visible .play-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

.now-playing {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: #fff;
  background: var(--pink-500);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(74, 15, 94, 0.35);
}

.video-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 14px 18px 18px;
}
.video-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(74, 15, 94, 0.35);
}
.video-date {
  margin-top: auto;
  align-self: flex-start;
  padding: 2px 12px;
  font-size: 0.9rem;
  color: var(--plum);
  background: var(--pink-50);
  border-radius: 999px;
}

/* ── Player ───────────────────────────────── */

#videoPlayer {
  padding: 18px;
  margin-bottom: 12px;
  background: rgba(74, 15, 94, 0.38);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 6px rgba(255, 122, 192, 0.25), var(--shadow-lift);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: pop-in 0.45s var(--bounce) both;
}
.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
#videoPlayer h5 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
#videoPlayer lite-youtube {
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.btn-close-player {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--plum);
  background: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(74, 15, 94, 0.3);
  cursor: pointer;
  transition: transform 0.3s var(--bounce), background 0.2s, color 0.2s;
}
.btn-close-player:hover,
.btn-close-player:focus-visible {
  color: #fff;
  background: var(--pink-500);
  transform: scale(1.06);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Loading skeletons ────────────────────── */

.skeleton {
  height: 100%;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.skeleton-thumb { aspect-ratio: 16 / 9; }
.skeleton-line {
  height: 14px;
  margin: 16px 18px 0;
  border-radius: 999px;
}
.skeleton-line.short { width: 40%; margin-bottom: 20px; }
.skeleton-thumb,
.skeleton-line {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(255, 255, 255, 0.12) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

/* ── Messages ─────────────────────────────── */

.status-message {
  padding: 40px 24px;
  text-align: center;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.status-message .status-emoji {
  display: block;
  font-size: 3.5rem;
  margin-bottom: 8px;
}
.status-message p {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

/* ── Entrance animation ───────────────────── */

.card-fade-in { animation: fade-up 0.5s var(--bounce) both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ── Motion preferences ───────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Phones ───────────────────────────────── */

.logo, .btn-pill { white-space: nowrap; }

@media (max-width: 575.98px) {
  .site-header .btn-pill { padding: 8px 16px; font-size: 0.9rem; }

  /* Compact horizontal tiles so more channels fit on screen */
  .channel-tile {
    flex-direction: row;
    gap: 16px;
    padding: 14px 18px;
    text-align: left;
    border-radius: var(--radius-md);
  }
  .channel-tile:hover,
  .channel-tile:focus-visible { transform: translateY(-3px); }
  .channel-tile .emoji-bubble { flex: none; width: 64px; height: 64px; font-size: 2rem; }
  .channel-tile .tile-name { flex: 1; font-size: 1.15rem; }
  .tile-cta { margin-top: 0; padding: 8px 14px; }

  .channel-hero .emoji-bubble { width: 60px; height: 60px; font-size: 1.9rem; }
}
