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

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", sans-serif;
  overflow: hidden;
  touch-action: none;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.cast-header {
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.cast-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff69b4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.countdown {
  font-size: 12px;
  margin-top: 4px;
  color: #ffb6c1;
  opacity: 0.9;
}

/* ビューポート */
.viewport {
  flex: 1;
  position: relative;
  width: 100%;
  overflow: visible;
  background: #000;
  touch-action: none; /* Android Chrome でブラウザスクロールと競合しないよう */
}

/* スライド内のコンテンツだけをクリップ */
.slide {
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.video-wrapper {
  width: 100%;
  max-width: 90vw;
  max-height: 75vh;
  aspect-ratio: 9 / 16;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  position: relative;
  margin: 0 auto;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
  pointer-events: none;
}

/* 横向き動画を縦スマホに合わせて回転 */
.video-wrapper video.landscape {
  transform: rotate(90deg);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mac/iPad などの大画面では動画を少し小さめに */
@media (min-width: 768px) {
  .video-wrapper {
    max-width: 60vw;
    max-height: 60vh;
  }
}

/* ナビゲーションボタン（左右スワイプ代替） */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  backdrop-filter: blur(4px);
  transition: transform 0.1s, background 0.2s;
  user-select: none;
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: #fff;
}

.nav-prev {
  left: 16px;
}

.nav-next {
  right: 16px;
}

/* ホイール操作ヒント（Mac など） */
.wheel-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  pointer-events: none;
  z-index: 25;
  display: none;
}

@media (min-width: 768px) {
  .wheel-hint {
    display: block;
  }
}

/* 再生ボタン */
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.1s;
}

.play-btn:active {
  transform: translate(-50%, -50%) scale(0.9);
}

.play-btn::before {
  content: '▶';
  margin-left: 4px;
}

/* ミュート切り替えボタン（明示的） */
.mute-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(4px);
  transition: transform 0.1s;
}

.mute-btn:active {
  transform: scale(0.9);
}

.mute-btn.muted {
  background: rgba(255, 71, 87, 0.8);
}

/* 再生オーバーレイ（自動再生失敗時にタップで再生） */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  cursor: pointer;
}

/* ローディング */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  z-index: 15;
  display: none;
}



.video-date {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 20;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-info {
  margin-top: 12px;
  text-align: center;
}

.video-info .title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.video-info .meta {
  font-size: 12px;
  color: #aaa;
}

/* いいねボタン */
.controls {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  z-index: 10;
}

.top-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.mute-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.1s, background 0.2s;
  flex-shrink: 0;
}

.mute-btn:active {
  transform: scale(0.9);
}

.mute-btn.muted {
  background: rgba(255, 71, 87, 0.8);
  border-color: #ff4757;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 8px 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.1s, box-shadow 0.2s;
  flex-shrink: 0;
}

.like-btn:active {
  transform: scale(0.9);
}

.like-btn.liked {
  background: #ff4757;
  border-color: #ff4757;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.6);
}

.heart {
  font-size: 18px;
}

.like-count {
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
}

/* コメントエリア */
.comment-area {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.comment-area input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  padding: 8px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.comment-area input::placeholder {
  color: rgba(255,255,255,0.5);
}

.comment-area button {
  background: #ff69b4;
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.comment-area button:active {
  transform: scale(0.95);
}

.comments-list {
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}

.comment-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-item .nickname {
  font-weight: 700;
  color: #ff69b4;
}

.comment-item .body {
  color: #eee;
}

.comment-item .time {
  font-size: 10px;
  color: #888;
  margin-left: auto;
}

/* ページネーション */
.pagination {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 10;
}

/* いいねアニメーション（ハート飛び散る） */
.like-explosion {
  position: absolute;
  pointer-events: none;
  font-size: 24px;
  z-index: 100;
  animation: popUp 0.6s ease-out forwards;
}

@keyframes popUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.4); opacity: 0; }
}

/* ローディング */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #888;
  font-size: 14px;
  z-index: 10;
}