/* ku앤유 팬 클립 사이트의 보랏빛 시각 스타일을 정의합니다. */
:root {
  color-scheme: light;
  --bg: #f7f2ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #201a2b;
  --muted: #635a73;
  --line: rgba(119, 87, 160, 0.18);
  --accent: #7d4de4;
  --accent-dark: #5630af;
  --accent-soft: #efe7ff;
  --cyan: #1296a3;
  --shadow: 0 18px 42px rgba(63, 42, 103, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(247, 242, 255, 0.94), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(143, 99, 236, 0.18), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(18, 150, 163, 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("./images/andyou-bg.png") center top / cover no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

a {
  color: inherit;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(320px, 0.8fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: min(760px, calc(100vh - 24px));
  margin: 0 auto;
  padding: 34px 0 26px;
}

.hero-copy {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker,
.player-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.hero-lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.stream-link,
.social-link,
.external-player-link {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.stream-link {
  grid-auto-flow: column;
  gap: 8px;
  border: 1px solid rgba(125, 77, 228, 0.26);
  background: var(--panel-strong);
  color: var(--accent-dark);
}

.stream-link.is-live {
  border-color: #ff7070;
  background: #fff5f8;
  color: #b51635;
  box-shadow: 0 0 0 0 rgba(255, 79, 115, 0.42);
  animation: livePulse 1400ms ease-in-out infinite;
}

.live-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  background: #ff3f62;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.live-badge[hidden] {
  display: none;
}

.social-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.stream-link:hover,
.social-link:hover,
.external-player-link:hover {
  text-decoration: underline;
}

.hero-visual {
  align-self: stretch;
  min-height: 520px;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 58px rgba(55, 35, 95, 0.24);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.profile-section,
.schedule-section,
.clips-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: clamp(22px, 4vw, 34px);
}

.profile-summary {
  display: grid;
  gap: 14px;
}

.profile-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  place-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  min-height: 42px;
  border: 1px solid rgba(125, 77, 228, 0.28);
  border-radius: 8px;
  padding: 0 15px;
  background: var(--panel-strong);
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(63, 42, 103, 0.1);
}

.profile-toggle:hover {
  text-decoration: underline;
}

.profile-toggle-icon {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.profile-section.is-open .profile-toggle-icon {
  transform: rotate(225deg) translate(-1px, -1px);
}

.profile-slide {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 280ms ease,
    opacity 220ms ease,
    transform 260ms ease;
}

.profile-slide:not([hidden]) {
  max-height: 360px;
  opacity: 1;
  transform: translateY(0);
}

.profile-slide[hidden] {
  display: block;
}

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

.profile-grid div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.profile-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-grid dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.schedule-section {
  margin-top: 18px;
  padding: 18px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.schedule-card {
  min-height: 112px;
  border: 1px solid rgba(125, 77, 228, 0.2);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(239, 231, 255, 0.72)),
    var(--panel-strong);
}

.schedule-card p,
.schedule-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.schedule-card strong {
  display: block;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.2;
}

.clips-section {
  margin-top: 18px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#resultCount {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.clip-card {
  border-radius: 8px;
  animation: slideIn 260ms ease both;
}

.clip-open {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(125, 77, 228, 0.22), rgba(18, 150, 163, 0.12)),
    #ece7f7;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.clip-open:hover {
  border-color: rgba(125, 77, 228, 0.64);
  box-shadow: 0 16px 30px rgba(63, 42, 103, 0.18);
  transform: translateY(-3px);
}

.clip-open::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(32, 26, 43, 0.76);
  transform: translate(-50%, -50%);
}

.clip-open::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 50% auto auto 50%;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #ffffff;
  transform: translate(-35%, -50%);
}

.thumb-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip-label {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.site-footer {
  padding: 20px 16px 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.empty-state {
  margin-top: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 36px 18px;
  background: var(--panel);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.player-modal[hidden] {
  display: none;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 26, 43, 0.74);
}

.player-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.player-head h2 {
  font-size: 22px;
}

.close-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.player-frame-wrap {
  aspect-ratio: 16 / 9;
  background: #151020;
}

.player-frame-wrap iframe,
.player-frame-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #151020;
}

.external-player-link {
  min-height: 40px;
  margin: 14px 16px 16px;
  background: var(--accent);
  color: #ffffff;
}

.admin-fab {
  position: fixed;
  right: 14px;
  top: 12px;
  z-index: 15;
  min-height: 32px;
  border: 1px solid rgba(125, 77, 228, 0.2);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(86, 48, 175, 0.72);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(63, 42, 103, 0.08);
  opacity: 0.52;
  backdrop-filter: blur(10px);
  transition:
    opacity 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.admin-fab:hover,
.admin-fab:focus-visible {
  background: #ffffff;
  color: var(--accent-dark);
  opacity: 1;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.admin-modal[hidden] {
  display: none;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 26, 43, 0.74);
}

.admin-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.admin-head,
.admin-status-row,
.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-head h2 {
  font-size: 22px;
}

.admin-login,
.admin-editor {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.admin-login[hidden],
.admin-editor[hidden] {
  display: none;
}

.admin-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(247, 242, 255, 0.42);
}

.admin-section h3 {
  margin: 0;
  font-size: 16px;
}

.admin-help,
.admin-login-message,
#adminStatus {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-login label,
.admin-editor label,
.clip-edit-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-login input,
.admin-editor input,
.admin-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.admin-editor textarea {
  resize: vertical;
  line-height: 1.55;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.clip-editor-list {
  display: grid;
  gap: 12px;
}

.clip-edit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.clip-edit-row .clip-wide {
  grid-column: 1 / -1;
}

.clip-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 10px;
}

.clip-edit-actions label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.clip-edit-actions input {
  width: auto;
}

.admin-primary,
.admin-secondary {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.admin-primary {
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  color: #ffffff;
}

.admin-secondary {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.admin-primary:disabled,
.admin-secondary:disabled {
  cursor: wait;
  opacity: 0.68;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 79, 115, 0.38);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 79, 115, 0.12);
  }
}

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-visual {
    min-height: 460px;
  }

  .profile-section {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero,
  main {
    width: min(100% - 24px, 1180px);
  }

  .hero-copy {
    padding: 22px;
  }

  .hero-visual {
    min-height: 380px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .player-head,
  .admin-head,
  .admin-status-row,
  .admin-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .header-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-link {
    grid-column: 1 / -1;
  }

  .admin-grid-2,
  .clip-edit-row {
    grid-template-columns: 1fr;
  }
}
