:root {
  color-scheme: dark;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
  --background: #141414;
  --surface: #202020;
  --surface-soft: #292929;
  --line: #3f3f46;
  --text: #fff;
  --muted: #a1a1aa;
  --accent: #dc2626;
  --accent-dark: #991b1b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0));
  transition: background-color .25s ease, backdrop-filter .25s ease;
}

.site-header.is-scrolled {
  background: rgba(20, 20, 20, .96);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  min-height: 60px;
  margin: 0 auto;
  padding: 8px 16px;
  gap: 14px;
}

.brand {
  display: grid;
  width: 180px;
  height: 45px;
  flex: 0 0 180px;
  place-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-action {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #18181b;
}

.hero-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #141414 0%, rgba(20, 20, 20, .72) 28%, rgba(20, 20, 20, .12) 68%),
    radial-gradient(ellipse at 50% 47%, rgba(0, 0, 0, .32) 0%, rgba(0, 0, 0, .1) 36%, transparent 62%),
    linear-gradient(to right, rgba(0, 0, 0, .28), transparent 55%, rgba(0, 0, 0, .18));
}

.hero-content {
  position: relative;
  display: flex;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 100px 16px 20px;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  text-align: center;
}

.hero-content::before {
  position: absolute;
  z-index: 0;
  inset: -36px 4px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .12) 44%, transparent 68%);
  content: "";
  pointer-events: none;
}

.hero-content > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  display: flex;
  margin: 0;
  width: 100%;
  max-width: 400px;
  align-items: center;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .28em;
  row-gap: 10px;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -.055em;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
  text-shadow: 0 4px 24px #000, 0 2px 8px #000, 0 1px 2px #000;
}

.hero-title-segment,
.hero-title-accent {
  display: inline-block;
  white-space: nowrap;
}

.hero-title-art {
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(12px);
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff)
    drop-shadow(0 3px 6px rgba(0, 0, 0, .65));
}

.hero-actions {
  display: flex;
  width: min(100%, 330px);
  margin-top: 8px;
  flex-direction: column;
  gap: 10px;
}

.pill-button {
  display: flex;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  transition: transform .15s ease, background-color .15s ease;
}

.pill-button:active,
.episode-card:active,
.round-button:active,
.detail-action:active {
  transform: scale(.97);
}

.pill-button-primary {
  background: #fff;
  color: #09090b;
}

.pill-button-primary:hover {
  background: #e4e4e7;
}

.catalog {
  position: relative;
  z-index: 2;
  max-width: 676px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

.closure-notice {
  width: 100%;
  margin: 0;
  padding: 22px 14px;
  border: 1px solid #e85b5b;
  border-radius: 12px;
  background: #361b1e;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
  cursor: pointer;
}

.closure-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #b91c1c;
  color: #fff;
  font-weight: 800;
}

.closure-title {
  display: block;
  font-size: clamp(1.1rem, 3.8vw, 1.5rem);
  color: #fff;
  word-break: keep-all;
}

.closure-description { display: block; margin: 10px 0 0; color: #f1dada; font-size: .85rem; line-height: 1.7; }
body[data-closed="1"] .hero-actions { width: min(100%, 480px); margin-top: 16px; }
body[data-closed="1"] .episode-card:hover,
body[data-closed="1"] .episode-card:active,
body[data-closed="1"] .episode-card:hover img { transform: none; }
.registration-closed .training-poster { background: #323236; }

.catalog-heading {
  display: flex;
  margin-bottom: 14px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-shadow: 0 2px 8px #000;
}

.catalog h2 {
  margin: 0;
  color: #f4f4f5;
  font-size: 1rem;
}

.result-count {
  color: #a1a1aa;
  font-size: .72rem;
}

.episode-list {
  display: grid;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 0 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.episode-list::-webkit-scrollbar,
.comment-list::-webkit-scrollbar {
  display: none;
}

.episode-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #2f2f33;
  border-radius: 8px;
  background: #1f1f21;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease;
}

.episode-card:hover {
  transform: translateY(-3px);
}

.episode-poster {
  display: block;
  flex: none;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #18181b;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}

.episode-poster img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.episode-card:hover .episode-poster img {
  transform: scale(1.04);
}

.training-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: #1d5138;
  color: #fff;
  transition: background-color .18s ease;
}

.training-poster::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  content: "";
  pointer-events: none;
}

.training-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  transition: transform .18s ease;
}

.training-card-icon .icon {
  width: 40px;
  height: 40px;
}

.training-poster strong {
  font-size: clamp(.9rem, 3vw, 1.2rem);
  letter-spacing: -.04em;
}

.training-poster > span:last-child {
  color: rgba(255, 255, 255, .72);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.training-card:hover .training-card-icon {
  transform: scale(1.06);
}

.training-card:hover .training-poster {
  background: #246346;
}

.episode-title {
  width: 100%;
  flex: 0 0 44px;
  position: static;
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 10px;
  text-align: center;
  background: #1f1f21;
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow: none;
}

.empty-state {
  padding: 48px 16px;
  color: #71717a;
  text-align: center;
}

.detail-modal {
  outline: none;
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--background);
}

.detail-shell {
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
}

.detail-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid #27272a;
  background: #000;
}

.detail-media iframe,
.detail-media video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.detail-media video {
  object-fit: contain;
}

.round-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  place-items: center;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.detail-content {
  padding: 18px 16px max(40px, env(safe-area-inset-bottom));
}

.detail-content > h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.metadata {
  display: flex;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #a1a1aa;
  font-size: .72rem;
  font-weight: 600;
}

.metadata-box {
  padding: 2px 5px;
  border: 1px solid #52525b;
  border-radius: 3px;
  color: #d4d4d8;
  font-size: .64rem;
}

.rank-card {
  display: flex;
  margin-top: 15px;
  padding: 10px;
  border: 1px solid #27272a;
  border-radius: 7px;
  align-items: center;
  gap: 9px;
  background: rgba(24, 24, 27, .78);
  font-size: .75rem;
  font-weight: 700;
}

.rank-card strong {
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--accent);
  font-size: .62rem;
}

.video-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.restart-button {
  background: #303033;
  color: #fff;
}

.video-status {
  color: #d4d4d8;
  font-size: .8rem;
  line-height: 1.5;
}

.episode-summary {
  padding-top: 16px;
}

.episode-summary h3 {
  margin: 0 0 10px;
  color: #d4d4d8;
  font-size: .95rem;
}

.detail-description p {
  margin: 0 0 10px;
  color: #d4d4d8;
  font-size: .9rem;
  line-height: 1.75;
}

.detail-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #2f2f33;
  color: #a1a1aa;
  font-size: .72rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.detail-source p {
  margin: 0 0 4px;
}

.detail-source a {
  color: #d4d4d8;
  text-decoration-color: #52525b;
  text-underline-offset: 3px;
}

.detail-source a:hover {
  color: #fff;
}

.detail-source-url {
  display: block;
  color: #a1a1aa !important;
}

.detail-actions {
  display: grid;
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid #27272a;
  border-bottom: 1px solid #27272a;
  grid-template-columns: repeat(4, 1fr);
}

.detail-action {
  display: flex;
  min-height: 58px;
  padding: 4px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: #a1a1aa;
}

.detail-action:hover,
.detail-action.is-active {
  color: #fff;
}

.detail-action span {
  font-size: .62rem;
}

.like-button .icon {
  stroke: #fff;
  fill: none;
}

.like-button.is-active .icon {
  fill: #fff;
}

.like-button:disabled {
  cursor: default;
  opacity: 1;
}

#like-count {
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.comment-section {
  margin-top: 16px;
  padding: 0;
}

.comment-heading {
  display: flex;
  margin-bottom: 12px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-heading #comment-count { margin-right: auto; }
#comment-write {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #e4e4e7;
}
#comment-write::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  border: 1px solid #52525b;
  border-radius: 5px;
  pointer-events: none;
}
#comment-write:hover::before { border-color: #71717a; }
#comment-write:focus-visible { outline: 2px solid #a1a1aa; outline-offset: 3px; }
#comment-write .icon { width: 16px; height: 16px; }
#comment-write span { color: inherit; font-size: inherit; }
.comment-error { color: #fca5a5; font-size: .8rem; }
.comment-error:empty { display: none; }
.comment-item.is-new .comment-author { color: #fff; }
.comment-item.is-new p { color: #fff; }

.comment-heading h3 {
  margin: 0;
  font-size: .82rem;
}

.comment-heading span {
  color: #71717a;
  font-size: .68rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: none;
}

.comment-empty,
.comment-loading {
  padding: 24px 8px;
  color: #71717a;
  font-size: .75rem;
  text-align: center;
}

.comment-item {
  padding: 16px 0;
}

.comment-item + .comment-item { border-top: 1px solid #27272a; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author {
  color: #e4e4e7;
  font-size: .75rem;
  font-weight: 800;
}

.comment-date {
  margin-right: auto;
  color: #71717a;
  font-size: .62rem;
}

.comment-tool {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  place-items: center;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
}

.comment-tool .icon {
  width: 15px;
  height: 15px;
}

.comment-menu { position: relative; flex-shrink: 0; }
.comment-more .icon { width: 20px; height: 20px; fill: currentColor; }
.comment-more:hover,
.comment-more[aria-expanded="true"] { color: #fff; background: #3f3f46; border-radius: 7px; }
.comment-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  width: 132px;
  padding: 4px;
  border: 1px solid #52525b;
  border-radius: 9px;
  background: #27272a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.comment-menu-option {
  display: flex;
  width: 100%;
  padding: 0 12px;
  gap: 10px;
  align-items: center;
  border-radius: 5px;
  color: #f4f4f5;
  font-size: .8rem;
}
.comment-menu-option:hover,
.comment-menu-option:focus-visible { background: #3f3f46; }
.comment-menu-option.is-delete { color: #fca5a5; }

.comment-item p {
  margin: 6px 0 0;
  color: #e4e4e7;
  font-size: .76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #27272a;
}

.comment-identity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.comment-form label,
.comment-action-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #a1a1aa;
  font-size: .68rem;
}

.comment-form input,
.comment-form textarea,
.comment-action-modal input,
.comment-action-modal textarea {
  width: 100%;
  border: 1px solid #3f3f46;
  border-radius: 7px;
  outline: 0;
  background: #27272a;
  color: #fff;
}

.comment-form input,
.comment-action-modal input {
  min-height: 44px;
  padding: 0 11px;
  font-size: .75rem;
}

.comment-body-field {
  margin-top: 8px;
}

.comment-form textarea,
.comment-action-modal textarea {
  padding: 10px 11px;
  resize: vertical;
  font-size: .78rem;
  line-height: 1.5;
}

.comment-submit-row {
  display: flex;
  margin-top: 8px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.comment-submit-row > span {
  color: #71717a;
  font-size: .65rem;
}

.comment-submit,
.modal-confirm,
.modal-cancel {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.comment-submit,
.modal-confirm {
  background: var(--accent);
  color: #fff;
}

.comment-submit:disabled,
.modal-confirm:disabled {
  opacity: .55;
  cursor: wait;
}

.toast {
  position: fixed;
  z-index: 80;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  border: 1px solid #3f3f46;
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  background: #27272a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
  font-size: clamp(.75rem, 3.2vw, .78rem);
  font-weight: 700;
  text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}

.toast .icon {
  color: #ef4444;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.comment-action-modal {
  width: min(calc(100% - 32px), 440px);
  padding: 0;
  border: 1px solid #3f3f46;
  border-radius: 14px;
  background: #18181b;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

.comment-action-modal::backdrop {
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(4px);
}

.comment-action-modal form {
  display: flex;
  padding: 18px;
  flex-direction: column;
  gap: 14px;
}

.action-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.action-modal-header .round-button {
  width: 44px;
  height: 44px;
  background: #27272a;
}

#comment-action-help {
  margin: 0;
  color: #a1a1aa;
  font-size: .7rem;
  line-height: 1.5;
}

.action-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#comment-action-cancel { margin-right: auto; }
#comment-create-modal > .action-modal-header { padding: 18px 18px 0; }
#comment-create-modal .comment-form { margin-top: 0; border-top: 0; }
.comment-author { overflow-wrap: anywhere; min-width: 0; }
.comment-tool { flex-shrink: 0; }
.comment-action-modal input:focus-visible,
.comment-action-modal textarea:focus-visible { outline: 2px solid #a1a1aa; outline-offset: 2px; }
@media (max-width: 480px) {
  .comment-action-modal input,
  .comment-action-modal textarea { font-size: 16px; }
}

.modal-cancel {
  background: #3f3f46;
  color: #fff;
}

@media (min-width: 600px) {
  .header-inner,
  .catalog {
    padding-right: 28px;
    padding-left: 28px;
  }

  .hero {
    height: auto;
  }

  .catalog {
    margin-top: 0;
  }

  .hero-actions {
    width: auto;
    max-width: none;
    flex-direction: row;
  }

  .hero-actions .pill-button {
    min-width: 210px;
  }

  .episode-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .episode-title {
    font-size: .86rem;
  }

  .detail-content {
    padding: 24px 28px 60px;
  }

  .detail-content > h2 {
    font-size: 1.65rem;
  }
}

@media (min-width: 900px) {
  .header-inner {
    min-height: 72px;
  }

  .brand {
    width: 208px;
    height: 52px;
    flex-basis: 208px;
  }

  .catalog {
    margin-top: 0;
    padding-top: 28px;
  }

  .catalog h2 {
    font-size: 1.2rem;
  }

  .detail-shell {
    max-width: 1200px;
    border-right: 1px solid #27272a;
    border-left: 1px solid #27272a;
    box-shadow: 0 0 80px rgba(0, 0, 0, .55);
  }

  .detail-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 40px 72px;
  }

}

@media (min-width: 1200px) {
  .catalog {
    max-width: 820px;
  }

  .episode-list {
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
