:root {
  --bg: #0f1115;
  --bg-elev: #1a1d24;
  --text: #f2f3f5;
  --muted: #9aa3b2;
  --accent: #ff6b4a;
  --line: #2a2f3a;
  --radius: 12px;
  --pad: 16px;
  --max: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --chrome-h: 52px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.logo { font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.nav a.is-active,
.nav a:hover { color: var(--text); background: var(--bg-elev); }

.page { padding: 20px 0 80px; }
.page-title { font-size: 1.35rem; margin: 0 0 8px; }
.page-desc { color: var(--muted); margin: 0 0 20px; font-size: 0.95rem; }

.hero {
  background: linear-gradient(160deg, #1f2430, #12151c 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 24px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.5rem; }
.hero p { margin: 0 0 16px; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn.is-disabled,
a.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Cards */
.card-grid { display: grid; gap: 12px; }
.work-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 10px;
}
.work-card__thumb {
  width: 88px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
}
.work-card__meta h2 { margin: 0 0 4px; font-size: 1rem; }
.work-card__meta p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2a3140;
  color: var(--muted);
}

.episode-list { list-style: none; margin: 0; padding: 0; }
.episode-list li {
  border-bottom: 1px solid var(--line);
}
.episode-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
}
.episode-list a:hover { color: var(--accent); }
.episode-list .date { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.notice-item h2 { margin: 0 0 4px; font-size: 1rem; }
.notice-item .date { color: var(--muted); font-size: 0.8rem; }
.notice-item p { margin: 8px 0 0; color: #c8ced8; font-size: 0.92rem; }

.empty-state, .state-box {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.empty-state__title, .state-box p { color: var(--text); margin: 0 0 8px; font-weight: 600; }
.state-box--error { border-color: #5a3030; }

/* Ads */
.ad-slot {
  margin: 12px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #3a4252;
  background: repeating-linear-gradient(
    -45deg,
    #161a22,
    #161a22 8px,
    #1b202a 8px,
    #1b202a 16px
  );
  color: var(--muted);
  font-size: 12px;
  border-radius: 8px;
}
.ad-slot--banner-top {
  width: min(100%, 320px);
  height: 50px;
}
.ad-slot--viewer-rect {
  width: min(100%, 300px);
  height: 250px;
}
@media (min-width: 768px) {
  .ad-slot--banner-top {
    width: min(100%, 728px);
    height: 90px;
  }
}
.ad-slot__label { font-weight: 600; }
.ad-slot__size::before { content: attr(data-size-m); }
@media (min-width: 768px) {
  .ad-slot__size::before { content: attr(data-size-d); }
}
.ad-slot__size { font-size: 0; }
.ad-slot__size::before { font-size: 11px; color: #7d8696; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px var(--pad) calc(24px + var(--safe-b));
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.is-hidden { display: none !important; }

.work-detail__thumb {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: #222;
}
.meta-row { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.section-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 24px 0 8px;
  font-weight: 600;
}

/* Language switcher */
.lang-switcher {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.lang-switcher__btn {
  min-width: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #2a3140;
  color: var(--muted);
  border: 1px solid transparent;
  line-height: 1.2;
}
.lang-switcher__btn.is-active {
  background: var(--accent);
  color: #fff;
}
.lang-switcher__btn.is-pending {
  opacity: 0.55;
  text-decoration: line-through;
}
.lang-switcher--page {
  margin: 0 0 16px;
}
.detail-lang-row {
  margin: 0 0 12px;
}
.section-label__lang {
  font-weight: 500;
  color: var(--muted);
}
.episode-list__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.badge--lang {
  margin-top: 0;
  font-size: 10px;
  padding: 1px 6px;
  background: #243044;
  color: #a8b4c8;
}

.badge--warn {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #7a3e00;
  background: #ffe6bf;
  border-radius: 999px;
  vertical-align: middle;
}
.test-banner {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: #7a3e00;
  background: #fff4e0;
  border: 1px solid #f0c879;
  border-radius: 8px;
}
