@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Sans+JP:wght@300;400;700&display=swap');

:root {
  --accent: #ff2d55;
  --gold: #f5c518;
  --bg: #000;
}

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

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  overflow: hidden;
  height: 100dvh;
  touch-action: none;
  cursor: default;
}

/* ===== HEADER ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .85) 0%, transparent 100%);
}

#logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 4px;
  color: #fff;
}

#logo span {
  color: var(--accent);
}

.header-tabs {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: 700;
}

.tab {
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: color .2s;
}

.tab.active {
  color: #fff;
  border-bottom: 2px solid #fff;
  padding-bottom: 2px;
}

/* ===== SCROLL CONTAINER ===== */
#feed {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#feed::-webkit-scrollbar {
  display: none;
}

/* ===== SLIDE ===== */
.slide {
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* background poster blur */
.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(.4);
  transform: scale(1.1);
}

/* iframe wrapper — phone aspect ratio */
.video-wrap {
  position: relative;
  z-index: 2;
  width: min(100%, calc(100dvh * 9/16));
  aspect-ratio: 9/16;
  border-radius: 0;
  overflow: hidden;
  background: #111;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto;
}

/* YT API player div */
.video-wrap>div:first-child {
  width: 100%;
  height: 100%;
}

.video-wrap>div:first-child iframe {
  width: 100% !important;
  height: 100% !important;
  pointer-events: auto;
}

/* overlay gradient */
.video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, transparent 50%);
  pointer-events: none;
  z-index: 3;
}



/* ===== MOVIE INFO (bottom left) ===== */
.info {
  position: absolute;
  bottom: 90px;
  left: 16px;
  right: 80px;
  z-index: 5;
  pointer-events: none;
}

.genre-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.movie-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  margin-bottom: 6px;
}

.movie-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 8px;
}

.rating {
  color: var(--gold);
  font-weight: 700;
}

.rating::before {
  content: '★ ';
}

.movie-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, .65);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== RIGHT ACTION BAR ===== */
.actions {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .15);
  transition: transform .15s, background .2s;
}

.action-btn:active .action-icon {
  transform: scale(.85);
}

.action-btn.liked .action-icon {
  background: rgba(255, 45, 85, .3);
  border-color: var(--accent);
}

.action-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.action-label {
  font-size: 11px;
  color: rgba(255, 255, 255, .7);
  font-weight: 300;
}

/* avatar */
.avatar-wrap {
  position: relative;
  margin-bottom: 4px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

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

.follow-dot {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* ===== BOTTOM NAV ===== */
#nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, .9) 0%, transparent 100%);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: rgba(255, 255, 255, .4);
  transition: fill .2s;
}

.nav-item span {
  font-size: 10px;
  color: rgba(255, 255, 255, .4);
  transition: color .2s;
}

.nav-item.active svg {
  fill: #fff;
}

.nav-item.active span {
  color: #fff;
}

.nav-center {
  background: var(--accent);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-center svg {
  fill: #fff !important;
  width: 20px;
  height: 20px;
}

.nav-center span {
  color: #fff !important;
  font-weight: 700;
  font-size: 12px;
}

/* ===== PROGRESS INDICATOR ===== */
#progress-dots {
  position: fixed;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  transition: all .3s ease;
}

.dot.active {
  background: #fff;
  height: 20px;
}

/* scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: bounce 1.5s ease infinite;
  pointer-events: none;
}

.scroll-hint svg {
  width: 20px;
  height: 20px;
  fill: rgba(255, 255, 255, .6);
}

.scroll-hint span {
  font-size: 10px;
  color: rgba(255, 255, 255, .5);
  letter-spacing: 2px;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* entrance animation */
.slide.active .movie-title {
  animation: slideUp .4s ease forwards;
}

.slide.active .info {
  animation: fadeIn .5s ease forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* iframe pointer events on active */
.slide.playing .video-wrap iframe {
  pointer-events: auto;
}

/* ===== SEARCH MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal {
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: #fff;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.filter-section {}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip.active {
  background: #ff2d55;
  border-color: #ff2d55;
  color: #fff;
}

/* 年レンジ */
.year-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.year-select-wrap select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

/* フッター */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-reset {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  cursor: pointer;
}

.btn-apply {
  flex: 2;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #ff2d55;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
}

/* ===== SEARCH MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal {
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: #fff;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.filter-section {}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip.active {
  background: #ff2d55;
  border-color: #ff2d55;
  color: #fff;
}

/* 年レンジ */
.year-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.year-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.year-select-wrap select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

/* フッター */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-reset {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  cursor: pointer;
}

.btn-apply {
  flex: 2;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #ff2d55;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
}

/* ===== WATCHLIST OVERLAY ===== */
#watchlist-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}

#watchlist-overlay.open {
  transform: translateX(0);
  pointer-events: all;
}

.wl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 56px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.wl-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 4px;
  color: #fff;
}

.wl-title span {
  color: #ff2d55;
}

.wl-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.wl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  text-align: center;
}

.wl-empty svg {
  width: 56px;
  height: 56px;
  fill: rgba(255, 255, 255, 0.1);
}

.wl-empty p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.wl-empty span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
}

.wl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.wl-card {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}

.wl-card:active {
  transform: scale(0.97);
}

.wl-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: #222;
}

.wl-poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.wl-info {
  padding: 10px;
}

.wl-movie-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wl-meta {
  font-size: 11px;
  color: #f5c518;
  font-weight: 700;
  margin-bottom: 2px;
}

.wl-genre {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wl-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.wl-remove:hover {
  background: rgba(255, 45, 85, 0.8);
  border-color: #ff2d55;
}

/* ===== 予告なし：ポスター静止画表示 ===== */
.video-wrap.no-trailer {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.poster-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: #111;
}

.no-trailer-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  z-index: 4;
}

/* ===== 俳優/監督 入力欄 ===== */
.person-input-wrap {
  position: relative;
}

.person-input-wrap input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  font-family: 'Noto Sans JP', sans-serif;
}

.person-input-wrap input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.person-input-wrap input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

/* ===== 監督・キャスト表示 ===== */
.movie-credits {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.credits-label {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-right: 6px;
  text-transform: uppercase;
}