:root {
  --bg: #0f0f0f;
  --card: #1c1c1c;
  --text: #ffffff;
  --muted: #a0a0a0;
  --primary: #3ea6ff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================= HEADER ================= */

.app-header,
.player-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15,15,15,0.9);
  backdrop-filter: blur(10px);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1, h2 {
  margin: 0;
  font-weight: 600;
}
.app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
}

.app-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}


/* ================= BUTTONS ================= */

button {
  background: var(--primary);
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--muted);
}

.back-btn {
  background: transparent;
  color: var(--text);
  font-size: 20px;
}

/* ================= MAIN ================= */

main {
  padding: 24px;
}

.status {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 14px;
  animation: statusIn 0.3s ease forwards;
}

@keyframes statusIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= GRID ================= */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

/* ================= VIDEO CARD ================= */

.video-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  will-change: transform;
  transition:
    transform 0.25s cubic-bezier(.4,0,.2,1),
    box-shadow 0.25s cubic-bezier(.4,0,.2,1);
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.video-card:active {
  transform: scale(0.97);
}

.thumb {
  position: relative;
}

.thumb img {
  width: 100%;
  display: block;
}

.play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 48px;
  color: white;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.video-card:hover .play-icon {
  opacity: 1;
  transform: scale(1);
}

.video-card h4 {
  margin: 0;
  padding: 12px;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.video-card:hover h4 {
  color: var(--primary);
}

.video-card h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40%;
  height: 1.4em;
  background: linear-gradient(to right, transparent, var(--card));
}

/* ================= SKELETON ================= */

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #1e1e1e 25%,
    #2a2a2a 37%,
    #1e1e1e 63%
  );
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite ease-in-out;
}

.skeleton-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-thumb {
  height: 140px;
}

.skeleton-title {
  height: 14px;
  margin: 12px;
  border-radius: 6px;
}

.skeleton-title.short {
  width: 60%;
}

/* ================= PLAYER ================= */

.player-container {
  display: flex;
  justify-content: center;
  padding: 24px;
}

iframe {
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
}

/* ================= ACCESSIBILITY ================= */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
