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

:root {
  --bg-primary: #fff5f9;
  --bg-secondary: #ffe4f0;
  --bg-elevated: #ffd6eb;
  --text-primary: #4a2040;
  --text-muted: #9b6b8a;
  --accent: #e84393;
  --accent-hover: #fd79a8;
  --accent-soft: #f8b4d9;
  --gold: #d4a574;
  --border: rgba(232, 67, 147, 0.2);
  --shadow: 0 8px 32px rgba(232, 67, 147, 0.15);
  --radius: 16px;
  --font-display: 'Parisienne', cursive;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Quicksand', sans-serif;
  --text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 2px 10px rgba(0, 0, 0, 0.55);
  --text-shadow-strong: 0 2px 4px rgba(0, 0, 0, 0.9), 0 4px 16px rgba(0, 0, 0, 0.65);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

body.player-open {
  overflow: hidden;
}

.home-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('/img/IMG-20260612-WA0029.jpg') center center / cover no-repeat;
  z-index: -1;
}

.home-page {
  background: transparent;
}

button,
input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.1;
  position: relative;
}

.home-page .brand-logo {
  color: #fff;
  text-shadow: var(--text-shadow-strong);
}

.brand-logo::before {
  content: '✦';
  position: absolute;
  top: -0.4rem;
  left: -0.5rem;
  font-size: 0.75rem;
  color: var(--gold);
  opacity: 0.85;
}

.btn {
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 16px rgba(232, 67, 147, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(232, 67, 147, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--accent-soft);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-soft);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* Login */
.login-page {
  position: relative;
  overflow: hidden;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(248, 180, 217, 0.5), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 214, 235, 0.6), transparent 45%),
    linear-gradient(180deg, #fff0f7 0%, #ffe8f3 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><path fill="%23f8b4d9" fill-opacity="0.25" d="M30 5l2.5 8h8.5l-7 5.2 2.7 8.3L30 21.5 23.3 26.5l2.7-8.3-7-5.2h8.5z"/></svg>');
  background-size: auto, auto, auto, 60px 60px;
  z-index: 0;
}

.login-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.login-card .brand-logo {
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--text-muted);
  margin: 0.75rem 0 2rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 0.75rem;
}

.login-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.login-form input {
  background: var(--bg-primary);
  border: 2px solid var(--accent-soft);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.9rem 1rem;
}

.login-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.15);
}

.login-form input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-error {
  color: #d6306a;
  font-size: 0.875rem;
  margin: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 245, 249, 0.92);
  border-bottom: 1px solid var(--accent-soft);
  backdrop-filter: blur(10px);
}

.home-page .site-header {
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
}

.home-page .btn-ghost {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  text-shadow: var(--text-shadow);
}

.home-page .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.65);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.hero-section {
  margin-bottom: 2rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.home-page .section-title {
  color: #fff;
  text-shadow: var(--text-shadow-strong);
}

.hero-heart {
  display: inline-flex;
  color: var(--accent);
  filter: drop-shadow(0 2px 6px rgba(232, 67, 147, 0.35));
  animation: heartPulse 2s ease-in-out infinite;
}

.hero-heart svg {
  display: block;
}

@keyframes heartPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.section-subtitle {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.loading-state,
.error-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.home-page .loading-state,
.home-page .error-state {
  color: #fff;
  text-shadow: var(--text-shadow);
}

.error-state {
  color: #d6306a;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.channel-card {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  text-align: left;
  overflow: hidden;
  min-height: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}

.channel-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  text-shadow: var(--text-shadow-strong);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (hover: hover) {
  .channel-card:hover,
  .channel-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    outline: none;
  }
}

.channel-card:active {
  border-color: var(--accent);
  opacity: 0.95;
}

/* Player fullscreen */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-modal[hidden] {
  display: none;
}

.player-backdrop {
  display: none;
}

.player-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.player-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: rgba(255, 245, 249, 0.95);
  border-bottom: 1px solid var(--accent-soft);
  backdrop-filter: blur(8px);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: auto;
}

.player-header.player-header--hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.player-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

#video-player {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  background: #000;
  object-fit: contain;
}

@media (max-width: 768px) {
  .brand-logo {
    font-size: 2.35rem;
  }

  .header-inner,
  .main-content {
    padding-top: 0.85rem;
    padding-bottom: 1rem;
  }

  .main-content {
    padding-top: 1rem;
  }

  .hero-section {
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .hero-heart svg {
    width: 24px;
    height: 24px;
  }

  .channels-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .channel-name {
    font-size: 1rem;
  }

  .btn-ghost {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
  }

  .player-header {
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .btn-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .channels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 2rem 1.5rem;
  }
}
