:root {
  --profile-page-bg: #f5f7fb;
  --profile-surface: rgba(255, 255, 255, 0.85);
  --profile-surface-alt: #f9fafc;
  --profile-border: rgba(15, 23, 42, 0.08);
  --profile-border-strong: rgba(15, 23, 42, 0.12);
  --profile-text-primary: #0f172a;
  --profile-text-muted: #4b5563;
  --profile-hero-text: #0f172a;
  --profile-hero-subtext: rgba(15, 23, 42, 0.65);
  --profile-hero-bg: linear-gradient(135deg, #f9fbff, #eef2ff);
  --profile-hero-shadow: 0 24px 45px rgba(15, 23, 42, 0.12);
  --profile-card-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  --profile-avatar-gradient: linear-gradient(135deg, #ff8c37, #ff4f81);
  --profile-badge-bg: rgba(99, 102, 241, 0.06);
  --profile-badge-color: #6366f1;
  --profile-badge-border: rgba(99, 102, 241, 0.15);
  --profile-badge-glow: rgba(239, 68, 68, 0.05);
  --profile-chip-bg: rgba(15, 23, 42, 0.05);
  --profile-empty-bg: rgba(15, 23, 42, 0.04);
  --profile-rating-badge-bg: rgba(0, 0, 0, 0.82);
  --profile-rating-badge-color: #fff;
}

.dark {
  --profile-page-bg: linear-gradient(180deg, rgba(38, 38, 38, 0.95), rgba(18, 20, 27, 0.98));
  --profile-surface: linear-gradient(175deg, rgba(38, 38, 38, 0.85), rgba(22, 25, 33, 0.95));
  --profile-surface-alt: linear-gradient(175deg, rgba(34, 36, 45, 0.88), rgba(19, 22, 30, 0.96));
  --profile-border: rgba(255, 255, 255, 0.04);
  --profile-border-strong: rgba(255, 255, 255, 0.08);
  --profile-text-primary: #f2f5fa;
  --profile-text-muted: rgba(242, 245, 250, 0.65);
  --profile-hero-text: #f8f9fb;
  --profile-hero-subtext: rgba(248, 249, 251, 0.72);
  --profile-hero-bg: linear-gradient(145deg, rgba(38, 38, 38, 0.97), rgba(18, 20, 27, 0.95));
  --profile-hero-shadow: 0 18px 32px rgba(0, 0, 0, 0.38);
  --profile-card-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  --profile-avatar-gradient: linear-gradient(135deg, #ff8c37, #ff4f81);
  --profile-badge-bg: rgba(129, 140, 248, 0.08);
  --profile-badge-color: #c7d2fe;
  --profile-badge-border: rgba(129, 140, 248, 0.2);
  --profile-badge-glow: rgba(248, 113, 113, 0.08);
  --profile-chip-bg: rgba(255, 255, 255, 0.06);
  --profile-empty-bg: rgba(33, 36, 46, 0.9);
  --profile-rating-badge-bg: rgba(0, 0, 0, 0.55);
  --profile-rating-badge-color: #ffe6a8;
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
  color: var(--profile-text-primary);
  background: var(--profile-page-bg);
  border-radius: 1.5rem;
  padding: 0.15rem;
}

.profile-hero {
  display: flex;
  gap: 1.5rem;
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: var(--profile-hero-bg);
  border: 1px solid var(--profile-border-strong);
  box-shadow: var(--profile-hero-shadow);
  color: var(--profile-hero-text);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--profile-avatar-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.profile-avatar__initial {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-hero__description {
  margin-top: 0.75rem;
  color: var(--profile-hero-subtext);
  line-height: 1.45;
}

.profile-meta h1 {
  margin: 0;
  font-size: 1.9rem;
  color: var(--profile-hero-text);
}

.profile-handle {
  font-size: 1rem;
  margin-left: 0.75rem;
  color: var(--profile-hero-subtext);
}

.profile-meta__details {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--profile-hero-subtext);
}

.profile-meta__details span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--profile-badge-bg);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--profile-badge-color);
  border: 1px solid var(--profile-badge-border);
  letter-spacing: 0.015em;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px var(--profile-badge-glow);
}

.profile-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px var(--profile-badge-glow);
}

.profile-badge .heart.icon {
  color: #ef4444;
  font-size: 0.9em;
  filter: drop-shadow(0 1px 2px rgba(239, 68, 68, 0.3));
}

.profile-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.profile-stat {
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--profile-surface-alt);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-card-shadow);
}

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

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--profile-text-primary);
}

.profile-section {
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-card-shadow);
}

.profile-two-column {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .profile-two-column {
    grid-template-columns: 1fr 0.85fr;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h3 {
  margin: 0;
  color: var(--profile-text-primary);
}

.section-header .ui.mini.basic.button {
  border-color: var(--profile-border-strong);
  color: var(--profile-text-primary);
  background: var(--profile-chip-bg);
}

.dark .section-header .ui.mini.basic.button {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--profile-text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.section-header .ui.mini.basic.button:hover {
  border-color: var(--profile-badge-border);
  color: var(--profile-badge-color);
  background: var(--profile-badge-bg);
}

.media-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.media-feed-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--profile-surface-alt);
  border-radius: 1rem;
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-card-shadow);
}

.media-feed-thumb {
  display: block;
  overflow: visible;
  flex-shrink: 0;
}

.media-feed-thumb img {
  width: 70px !important;
  min-width: 70px;
  max-width: 70px;
  height: 105px;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 1px solid var(--profile-border);
  display: block;
}

.media-feed-item {
  position: relative;
  z-index: 1;
}

.media-feed-item:hover {
  z-index: 10;
}

.media-feed-title {
  font-weight: 600;
  color: var(--profile-text-primary);
}

.media-feed-year {
  color: var(--profile-text-muted);
  margin-left: 0.35rem;
}

.media-feed-meta {
  font-size: 0.9rem;
  color: var(--profile-text-muted);
  margin: 0.15rem 0;
}

.media-feed-overview {
  margin: 0;
  color: var(--profile-text-muted);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.watchlist-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.watchlist-poster-grid .column {
  width: 100% !important;
  padding: 0 !important;
}

.watchlist-poster-grid .ui.card {
  position: relative;
  background: transparent;
  box-shadow: none;
  margin: 0;
}

.rating-card {
  background: var(--profile-surface-alt);
  border-radius: 1rem;
  border: 1px solid var(--profile-border);
  overflow: visible;
  box-shadow: var(--profile-card-shadow);
  position: relative;
}

.rating-art {
  position: relative;
  display: block;
  overflow: visible;
  border-radius: 1rem 1rem 0 0;
}

.rating-art img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 1rem 1rem 0 0;
  display: block;
}

.rating-badge {
  position: absolute;
  top: 0.02rem;
  right: 0.03rem;
  background: #db2828;
  color: #fff;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.95rem;
  box-shadow: 0 10px 20px rgba(219, 40, 40, 0.3);
  z-index: 2;
  pointer-events: none;
}

.rating-card:hover {
  z-index: 10;
}

.rating-meta {
  padding: 0.85rem 1rem 1.25rem;
  color: var(--profile-text-primary);
}

.rating-sub {
  font-size: 0.85rem;
  color: var(--profile-text-muted);
}

.top-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.top-list-card {
  position: relative;
  border-radius: 1.1rem;
  overflow: visible;
  background: var(--profile-surface-alt);
  border: 1px solid var(--profile-border);
  box-shadow: var(--profile-card-shadow);
  display: flex;
  flex-direction: column;
}

.top-list-card__posters {
  position: relative;
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border-radius: 1.1rem 1.1rem 0 0;
}

.top-list-poster {
  position: absolute;
  top: 0;
  height: 100%;
  width: auto;
  object-fit: cover;
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
}

.top-list-poster--1 {
  left: 0%;
  z-index: 5;
  width: 30%;
}

.top-list-poster--2 {
  left: 18%;
  z-index: 4;
  width: 30%;
}

.top-list-poster--3 {
  left: 36%;
  z-index: 3;
  width: 30%;
}

.top-list-poster--4 {
  left: 54%;
  z-index: 2;
  width: 30%;
}

.top-list-poster--5 {
  left: 72%;
  z-index: 1;
  width: 30%;
}

.top-list-poster:hover {
  transform: scale(1.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.top-list-card__body {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--profile-text-primary);
  flex: 1;
}

.top-list-card__body h4 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-list-card__body a {
  color: var(--profile-text-primary);
}

.list-username {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--profile-text-muted);
  font-style: italic;
}

.top-list-card__likes {
  color: #ff6b6b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.top-list-card__meta {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--profile-text-muted);
  display: flex;
  justify-content: space-between;
}

.empty-state {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--profile-empty-bg);
  color: var(--profile-text-muted);
  text-align: center;
  border: 1px solid var(--profile-border);
}

@media (max-width: 768px) {
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-meta__details {
    flex-direction: column;
  }

  .profile-actions {
    flex-direction: column;
    width: 100%;
  }

  .media-feed-item {
    flex-direction: column;
  }

  .media-feed-thumb img {
    width: 100%;
    height: auto;
  }

  .upnext-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .upnext-card {
    width: 100%;
  }

  .upnext-card__poster,
  .upnext-card__poster img {
    width: 100%;
  }

  .upnext-card__poster {
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .upnext-card__poster img {
    height: 100%;
    object-fit: cover;
  }

  .upnext-card__footer {
    width: 100%;
  }

  .media-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .media-feed-item {
    padding: 0;
    background: var(--profile-surface-alt);
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid var(--profile-border);
  }

  .media-feed-thumb {
    display: block;
  }

  .media-feed-thumb img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: none;
    border-radius: 0;
  }

  .media-feed-body {
    padding: 0.75rem 0.75rem 0.9rem;
  }

  .media-feed-overview {
    display: none;
  }
}

.upnext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.upnext-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
  overflow: visible;
  z-index: 1;
}

.upnext-card:hover {
  z-index: 10;
}

.upnext-card__poster {
  width: 100%;
  position: relative;
}

.upnext-card__poster .ui.rounded.image {
  position: relative;
  overflow: visible;
}

.upnext-card__poster .ui.rounded.image a {
  position: relative;
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
  border-radius: 0.28571429rem;
  overflow: hidden;
}

.upnext-card__poster .ui.rounded.image a:hover {
  transform: scale(1.015);
}

.upnext-card__poster img.poster-card {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  transition: box-shadow 180ms ease;
  transform: none !important;
}

.upnext-card__poster .ui.rounded.image a:hover img.poster-card {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
  transform: none !important;
}

.dark .upnext-card__poster .ui.rounded.image a:hover img.poster-card {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.upnext-card__poster .season-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  height: 5px;
  border-radius: 0 0 0.28571429rem 0.28571429rem;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.season-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.3s ease;
}

.season-progress-bar.is-complete {
  background: linear-gradient(90deg, #10b981, #059669);
}

.upnext-card__footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--profile-text-primary);
  font-size: 1rem;
}

.upnext-card__next-code {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--profile-text-muted);
}

.upnext-card__next-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--profile-text-primary);
  font-size: 1.05rem;
  font-weight: 600;
}

.upnext-section-meta {
  font-size: 0.9rem;
  color: var(--profile-text-muted);
}

@media (max-width: 768px) {
  .upnext-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    justify-content: center;
  }

  .upnext-card,
  .upnext-card__poster,
  .upnext-card__poster img,
  .upnext-card__footer {
    width: 100%;
  }

  .upnext-card__poster {
    height: auto;
    aspect-ratio: 2 / 3;
  }

  .upnext-card__poster img {
    height: 100%;
  }
}

.welcome-page {
  background: var(--profile-page-bg);
}

.welcome-hero {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  padding: 2.5rem 20rem;
}

.welcome-hero__badge {
  width: min(520px, 90vw);
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--profile-border-strong);
  box-shadow: var(--profile-hero-shadow);
}

.welcome-hero__badge img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.welcome-hero__copy h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.01em;
  color: var(--profile-hero-text);
}

.welcome-hero .profile-hero__description {
  max-width: 720px;
  margin: 0 auto;
  color: var(--profile-hero-subtext);
  font-size: 1.05rem;
}

.welcome-hero__copy {
  width: 100%;
  max-width: 960px;
}

.profile-actions--welcome {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.rating-grid--welcome {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

@media (min-width: 1200px) {
  .rating-grid--welcome {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .welcome-hero {
    padding: 2rem 1.25rem;
  }

  .welcome-hero__copy {
    max-width: 100%;
  }
}

@media (max-width: 1200px) and (min-width: 769px) {
  .welcome-hero {
    padding: 2.25rem 6rem;
  }

  .welcome-hero__copy {
    max-width: 960px;
  }
}
