:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --card: #f8fafc;
  --accent: #d97706;
  --accent-2: #2563eb;
  --primary: #0f172a;
  --danger: #b91c1c;
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

body {
  height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #e9eef7 0%, #f7f9fc 45%, #eef2f7 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 4vw 14px;
  position: relative;
  overflow: hidden;
}

body.allow-scroll {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.card-actions > button:not(#dislike-btn):not(#like-btn):not(#skip-btn) {
  display: none !important;
}


.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.brand-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  letter-spacing: 2px;
}

.top-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stats {
  display: flex;
  gap: 16px;
}

.search-wrap {
  display: flex;
  justify-content: flex-end;
  align-self: center;
  margin-top: -128px;
  margin-right: 36px;
}

.search-input {
  width: min(340px, 40vw);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.left-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.load-more-inline {
  display: none;
}

.left-meta .stats {
  margin-top: 2px;
}

.profile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.profile-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.subtitle-banner {
  color: var(--muted);
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
  margin-left: 0;
  font-family: "Bebas Neue", sans-serif;
}

.stat {
  background: var(--glass);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-align: center;
  min-width: 92px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  align-items: start;
  max-width: 1200px;
  margin: -90px auto 0;
}

.card-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  min-height: 0;
  width: 100%;
  margin-top: -74px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.admin-actions {
  position: fixed;
  top: 96px;
  right: 24px;
  display: flex;
  justify-content: flex-end;
  z-index: 5;
}

.admin-actions button {
  font-size: 0.85rem;
}

.card-stack::before,
.card-stack::after {
  content: none;
}

.movie-card {
  width: 100%;
  max-width: 720px;
  margin: 0;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.4s ease, opacity 0.4s ease;
  height: 560px;
}

.movie-card.swipe-left {
  transform: translateX(-120%) rotate(-6deg);
  opacity: 0;
}

.movie-card.swipe-right {
  transform: translateX(120%) rotate(6deg);
  opacity: 0;
}

.movie-card.swipe-down {
  transform: translateY(120%) rotate(2deg);
  opacity: 0;
}

.card-media {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.card-title-row h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 1px;
}

.runtime {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.synopsis {
  color: #1f2937;
  line-height: 1.5;
  max-height: 6.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.meta-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.meta-value {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
}

.inline-rating {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.rating-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 70px;
}

.imdb-inline {
  background: rgba(15, 23, 42, 0.9);
  color: white;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.inline-stars {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-stars .star-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.inline-stars .star-btn.active {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.card-actions {
  display: inline-flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding: 0;
  width: fit-content;
  margin: 0 auto;
  box-shadow: none;
  border-radius: 0;
}

.card-actions::before,
.card-actions::after {
  content: none;
}

.card-actions > button {
  margin: 0;
}

.card-stack button:not(#like-btn):not(#dislike-btn):not(#skip-btn):not(.star-btn) {
  display: none !important;
}

.card-actions * {
  background: transparent !important;
  box-shadow: none !important;
}

.card-actions .btn.primary {
  background: var(--primary) !important;
  color: white;
}

.card-actions .btn.ghost {
  background: transparent !important;
  border: 2px solid var(--danger);
  color: var(--danger);
}


button:empty {
  display: none;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.allow-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.allow-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 8px;
}

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

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 42, 68, 0.2);
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.ghost {
  background: transparent;
  border: 2px solid var(--danger);
  color: var(--danger);
}

.btn.outline {
  background: white;
  border: 2px solid var(--accent-2);
  color: var(--accent-2);
}

.side-panel {
  background: transparent;
  border-radius: 0;
  padding: 8px 0 0;
  box-shadow: none;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  margin-top: -14px;
  justify-self: start;
  width: min(255px, 30vw);
  margin-left: 96px;
}

.filter-nav {
  display: grid;
  gap: 8px;
}

.filter-btn {
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: white;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.side-summaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-left: 18px;
}

.side-panel h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.side-panel .list {
  max-height: clamp(140px, 22vh, 240px);
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: white;
}

.list-item span {
  font-size: 0.9rem;
}

.list-item .list-rating {
  color: var(--accent-2);
  font-weight: 700;
}

.end-state {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ratings-view {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

.ratings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ratings-header h2 {
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.ratings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ratings-table th,
.ratings-table td {
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.ratings-table th {
  background: rgba(15, 23, 42, 0.04);
  font-weight: 700;
  color: var(--ink);
}

.ratings-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .side-panel {
    order: -1;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .subtitle-banner {
    margin-left: 0;
  }

  .search-wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .search-input {
    width: min(360px, 90vw);
  }

  .profile-wrap {
    width: 100%;
  }
}

@media (max-width: 1366px) and (max-height: 768px) {
  body {
    padding: 6px 5vw 12px;
    gap: 8px;
  }

  .card-media {
    height: 220px;
  }

  .movie-card {
    max-width: 640px;
  }

  .side-panel {
    padding: 16px;
  }

  .synopsis {
    max-height: 5.5em;
  }
}

@media (min-width: 1367px) and (max-width: 1440px) and (max-height: 900px) {
  body {
    padding: 8px 6vw 12px;
    gap: 10px;
  }

  .card-media {
    height: 260px;
  }

  .movie-card {
    max-width: 690px;
  }

  .synopsis {
    max-height: 6em;
  }
}

@media (max-width: 640px) {
  body {
    padding: 20px 5vw;
    gap: 18px;
  }

  .card-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .movie-card {
    width: 100%;
  }
}
