:root {
  --bg: #0b0b0c;
  --fg: #f3f3f1;
  --muted: #8d8d92;
  --radius: 10px;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- 상단: 로고(가운데) + 유튜브 아이콘 ---------- */
.top {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 2vw, 24px);
  padding: clamp(36px, 6vw, 72px) 20px clamp(28px, 4vw, 48px);
}
.brand img { display: block; height: clamp(72px, 11vw, 140px); width: auto; }
.wordmark { font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -.02em; }
.yt { display: flex; align-items: center; opacity: .9; transition: opacity .2s, transform .2s; }
.yt:hover { opacity: 1; transform: translateY(-1px); }
.yt img { display: block; height: calc(clamp(26px, 3vw, 38px) * .7); width: auto; }   /* PC·태블릿: 기존 대비 70% */
@media (max-width: 767px) {
  .yt img { height: calc(clamp(26px, 3vw, 38px) * .5); }                            /* 폰: 기존 대비 50% */
}
.yt svg { display: block; width: clamp(30px, 3.4vw, 40px); height: auto; color: #fff; }

/* ---------- 영상 타일 공통 ---------- */
.grid {
  --gap: 14px;
  padding: 0 clamp(16px, 4vw, 56px);
}

.tile {
  display: block; min-width: 0;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.thumb {
  position: relative; width: 100%; aspect-ratio: var(--ar); overflow: hidden;
  border-radius: var(--radius); background: #161618;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.66) 0%, rgba(0,0,0,.2) 32%, transparent 55%);
  transition: background .3s;
}
.play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  opacity: 0; transform: scale(.85); transition: opacity .3s, transform .3s;
}
.play::before {
  content: ""; position: absolute; left: 21px; top: 17px;
  border-style: solid; border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #0b0b0c;
}
@media (hover: hover) {
  .tile:hover .thumb img { transform: scale(1.045); }
  .tile:hover .thumb::after { background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.15) 100%); }
  .tile:hover .play { opacity: 1; transform: scale(1); }
}

/* 제목: 썸네일 안 왼쪽 위 */
.title {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  padding: 16px 18px 0;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4;
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: keep-all;
}
.is-short .title { font-size: 14px; padding: 12px 12px 0; -webkit-line-clamp: 3; }

.badge {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
}

/* ---------- PC: 한 줄 높이를 맞춰 비율대로 배치 ---------- */
.mode-pc {
  --h: 300px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
.mode-pc::after { content: ""; flex-grow: 1000000; }
.mode-pc .tile { max-width: calc(var(--h) * var(--ar) * 1.8); }

/* ---------- 태블릿·폰: 한 줄에 2개 / 1개 ---------- */
.row { display: flex; gap: var(--gap); margin-bottom: var(--gap); }

.mode-tablet .row > .tile:only-child { max-width: calc(50% - var(--gap) / 2); }

.mode-phone { --gap: 12px; }
.mode-phone .row { justify-content: center; }
.mode-phone .tile { flex: 1 1 100% !important; max-width: none; }   /* 폰: 쇼츠 포함 모든 영상 가로폭 가득 */
.mode-phone .title { font-size: 15px; padding: 14px 16px 0; }
.mode-phone .is-short .title { font-size: 14px; padding: 12px 14px 0; }
.mode-phone .play { display: none; }

/* ---------- 기타 ---------- */
.sentinel { height: 1px; margin-bottom: 80px; }
.empty { padding: 60px 20px; color: var(--muted); text-align: center; line-height: 1.9; }
.empty a { color: var(--fg); border-bottom: 1px solid var(--muted); }

/* ---------- 팝업 플레이어 ---------- */
.player {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 20px;
  background: rgba(0, 0, 0, .88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.player.show { opacity: 1; visibility: visible; }
.player-box {
  width: min(92vw, calc((100vh - 112px - 56px) * var(--ar)), 1600px);
  transform: scale(.96); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.player.show .player-box { transform: none; }
.player-frame {
  position: relative; width: 100%; aspect-ratio: var(--ar);
  background: #000; border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.player-close:hover { background: rgba(255, 255, 255, .24); }
.player-close svg { width: 22px; height: 22px; }
html.player-open, html.player-open body { overflow: hidden; }
@media (max-width: 767px) {
  .player { padding: 64px 12px 24px; }
  .player-box { width: min(100%, calc((100vh - 96px - 56px) * var(--ar))); }
}

/* ---------- 오른쪽 위 이메일 아이콘 + 복사 알림 ---------- */
.mail {
  position: absolute; top: clamp(16px, 2.4vw, 28px); right: clamp(16px, 4vw, 56px);
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .85; transition: opacity .2s, background .2s;
}
.mail:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.mail svg { width: 26px; height: 26px; }
@media (max-width: 767px) {
  .mail { width: 38px; height: 38px; top: 12px; right: 12px; }
  .mail svg { width: 22px; height: 22px; }
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200;
  transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px);
  padding: 12px 22px; border-radius: 16px;
  background: rgba(255, 255, 255, .95); color: #0b0b0c;
  font-size: 14px; font-weight: 600; line-height: 1.5;
  text-align: center; white-space: pre-line; word-break: keep-all;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 팝업 아래: 채널 버튼 / 유튜브에서 보기 */
.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; min-height: 44px;
}
.player-ch, .player-yt {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); transition: background .2s;
  white-space: nowrap;
}
.player-yt { padding: 8px 14px; color: rgba(255, 255, 255, .8); font-weight: 500; }
.player-ch:hover, .player-yt:hover { background: rgba(255, 255, 255, .2); }
.player-ch img { height: 18px; width: auto; display: block; }
@media (max-width: 767px) {
  .player-ch, .player-yt { font-size: 13px; }
  .is-vertical .player-bar { flex-direction: column; align-items: stretch; }
}
