/* KNHTA 3D Photo Viewer */
.pv-root * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.pv-root {
  position: fixed; inset: 0; z-index: 99999;
  background: #0c0c0e; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.pv-root.open { opacity: 1; visibility: visible; pointer-events: auto; }
.pv-root:not(.open),
.pv-root:not(.open) * { pointer-events: none !important; }

.pv-header {
  padding: 10px 12px 6px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: center; gap: 10px;
  z-index: 40; position: relative;
  background: rgba(12, 12, 14, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.pv-close {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pv-toggle {
  display: flex; background: rgba(255,255,255,0.08);
  border-radius: 20px; padding: 3px; gap: 1px;
  width: fit-content;
}
.pv-btn {
  width: 42px; height: 32px; border-radius: 16px; border: none;
  background: transparent; color: rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.22s ease;
}
.pv-btn.active { background: rgba(255,255,255,0.18); color: #fff; }
.pv-btn svg { width: 18px; height: 18px; }

.pv-size {
  display: none; align-items: center; gap: 6px;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.08); padding: 5px 10px; border-radius: 18px;
}
.pv-size.visible { display: flex; }
.pv-size input[type=range] {
  -webkit-appearance: none; appearance: none; width: 72px; height: 3px;
  background: rgba(255,255,255,0.25); border-radius: 2px; outline: none;
}
.pv-size input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.pv-size-label { font-size: 11px; color: rgba(255,255,255,0.55); min-width: 14px; text-align: center; }

.pv-main { flex: 1; position: relative; overflow: hidden; }

.pv-view {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22,1,0.36,1);
  transform: scale(0.97);
}
.pv-view.active { opacity: 1; pointer-events: auto; transform: scale(1); }

/* Coverflow — values driven by --pv-* vars */
.pv-scene {
  perspective: var(--pv-perspective, 1100px);
  width: 100%; height: 100%; display: flex; align-items: center;
}
.pv-carousel {
  display: flex; align-items: center; height: 100%;
  padding: 0 var(--pv-pad, 42%);
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pv-carousel::-webkit-scrollbar { display: none; }
.pv-card {
  flex: 0 0 var(--pv-card-w, 320px);
  width: var(--pv-card-w, 320px);
  height: var(--pv-card-h, 210px);
  margin: 0 calc(var(--pv-overlap, 28px) * -1);
  scroll-snap-align: center; position: relative; transform-style: preserve-3d;
  border-radius: var(--pv-radius, 14px); overflow: hidden;
  box-shadow:
    0 var(--pv-sh-y, 20px) var(--pv-sh-blur, 40px) rgba(0,0,0, var(--pv-sh-op, 0.55)),
    0 calc(var(--pv-sh-y, 20px) * 0.4) calc(var(--pv-sh-blur, 40px) * 0.4) rgba(0,0,0, calc(var(--pv-sh-op, 0.55) * 0.65));
  will-change: transform; cursor: pointer;
}
.pv-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pv-card-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  pointer-events: none;
}
.pv-card-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-card-author { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; }

/* Grid */
.pv-grid-wrap { padding: 8px 10px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; height: 100%; }
.pv-grid { display: grid; gap: 8px; }
.pv-grid-item {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  aspect-ratio: 4/3; box-shadow: 0 5px 16px rgba(0,0,0,0.3);
  transform-origin: center center;
}
.pv-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Filmstrip — default view: large photo + centered thumbs */
.pv-film { display: flex; flex-direction: column; height: 100%; }
.pv-film-main {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; position: relative;
}
.pv-film-main img {
  max-width: 100%; max-height: 100%; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45); object-fit: contain;
  pointer-events: none;
}
.pv-film-strip {
  flex: 0 0 auto; min-height: 96px; padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; background: rgba(0,0,0,0.35);
}
.pv-film-strip::-webkit-scrollbar { display: none; }
.pv-film-inner {
  display: flex; gap: 8px; justify-content: center;
  width: max-content; min-width: 100%;
}
.pv-film-thumb {
  flex: 0 0 72px; width: 72px; height: 52px; border-radius: 8px; overflow: hidden;
  opacity: 0.5; border: 2px solid transparent; cursor: pointer; transition: all 0.25s;
}
.pv-film-thumb.active { opacity: 1; border-color: #fff; }
.pv-film-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pv-backdrop {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.pv-backdrop.visible { opacity: 1; pointer-events: auto; }
.pv-expanding {
  position: fixed; z-index: 100001; border-radius: 14px; overflow: hidden;
  box-shadow: 0 28px 56px rgba(0,0,0,0.55); pointer-events: none; background: #111;
}
.pv-expanding img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Coverflow tweak panel — disabled (values locked) */
.pv-tune { display: none !important; }
.pv-tune-DISABLED {
  position: absolute; right: 10px; bottom: 10px;
  z-index: 50; width: min(320px, calc(100vw - 20px));
  max-height: min(62vh, 520px);
  display: none; flex-direction: column;
  background: rgba(16,16,20,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  overflow: hidden;
  pointer-events: auto;
}
.pv-root[data-view="coverflow"] .pv-tune { display: flex; }
.pv-tune-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
}
.pv-tune-head button {
  border: none; background: rgba(255,255,255,0.1); color: #fff;
  font-size: 10px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
}
.pv-tune-body {
  overflow-y: auto; padding: 8px 10px 10px;
  -webkit-overflow-scrolling: touch;
}
.pv-tune-row {
  display: grid; grid-template-columns: 76px 1fr 52px;
  align-items: center; gap: 6px; margin: 5px 0;
}
.pv-tune-row label {
  font-size: 10px; color: rgba(255,255,255,0.62); white-space: nowrap;
}
.pv-tune-row input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 3px;
  background: rgba(255,255,255,0.22); border-radius: 2px; outline: none;
}
.pv-tune-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.pv-tune-row input[type=number] {
  width: 52px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35); color: #fff;
  font-size: 10px; text-align: right; padding: 0 4px;
}
.pv-tune-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: rgba(255,255,255,0.7); margin: 4px 0 8px;
}
.pv-tune-check input { accent-color: #fff; }

/* Home 전승자이야기 coverflow */
.home-cf {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  height: var(--home-cf-stage-h, 532px);
  position: relative;
  overflow: hidden;
}
.home-cf-scene {
  perspective: var(--home-cf-perspective, 1220px);
  width: 100%; height: 100%;
  display: flex; align-items: center;
  overflow: visible;
}
.home-cf-carousel {
  display: flex; align-items: center; height: 100%;
  padding: 0 var(--home-cf-pad, 42%);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.home-cf-carousel::-webkit-scrollbar { display: none; }
.home-cf-card {
  flex: 0 0 var(--home-cf-card-w, 292px);
  width: var(--home-cf-card-w, 292px);
  height: var(--home-cf-card-h, 220px);
  margin: 0 calc(var(--home-cf-overlap, 45px) * -1);
  scroll-snap-align: center; position: relative; transform-style: preserve-3d;
  border-radius: var(--home-cf-radius, 8px); overflow: hidden; cursor: pointer;
  box-shadow: 0 var(--home-cf-sh-y, 23px) var(--home-cf-sh-blur, 40px) rgba(0,0,0, var(--home-cf-sh-op, 0.35));
}
.home-cf-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.home-cf-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--home-cf-grad-pad, 22px) 14px 12px;
  background: linear-gradient(
    to top,
    var(--home-cf-grad-bottom, rgba(0,0,0,0.78)) 0%,
    var(--home-cf-grad-mid, rgba(0,0,0,0.28)) var(--home-cf-grad-height, 65%),
    transparent 100%
  );
  pointer-events: none; text-align: left;
}
.home-cf-title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; }
.home-cf-sub {
	font-size: 11px;
	color: rgba(255,255,255,0.72);
	margin-top: 3px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: normal;
	word-break: break-word;
	line-height: 1.35;
	max-height: calc(1.35em * 2);
	height: calc(1.35em * 2);
}

/* 시스템 파라미터 조정 창 (서버관리자 전용) */
.sys-param {
  position: fixed;
  left: 12px;
  bottom: 12px;
  top: auto;
  right: auto;
  transform: none !important;
  z-index: 100050;
  width: 268px;
  max-width: calc(100vw - 24px);
  display: flex; flex-direction: column;
  background: rgba(16,16,20,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
  contain: layout style;
  isolation: isolate;
}
.sys-param.collapsed { width: auto; max-width: calc(100vw - 24px); }
.home-cf-tune { display: none !important; }
.sys-param-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; cursor: move; user-select: none;
  font-size: 11px; font-weight: 700;
}
.sys-param:not(.collapsed) .sys-param-head {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sys-param-title { pointer-events: none; }
.sys-param-head button {
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 10px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
}
.sys-param-body { display: none; overflow-y: auto; max-height: min(56vh, 420px); padding: 4px 8px 8px; }
.home-cf-tune-row { display: grid; grid-template-columns: 62px 1fr 46px; gap: 4px; align-items: center; margin: 3px 0; font-size: 10px; }
.home-cf-tune-row label { opacity: .8; }
.home-cf-tune-row input[type=number] { width: 46px; font-size: 10px; padding: 1px 2px; color: #111; }
.sys-param:not(.collapsed) .sys-param-body { display: block; }
.sys-param-acc { border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; }
.sys-param-acc summary {
  list-style: none; cursor: pointer; padding: 8px 10px;
  font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sys-param-acc-actions { display: flex; gap: 4px; margin-left: auto; }
.sys-param-acc-actions button {
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 9px; padding: 3px 7px; border-radius: 6px; cursor: pointer;
}
.sys-param-acc summary::-webkit-details-marker { display: none; }
.sys-param-acc-body { padding: 6px 8px 8px; }
.home-cf-tune-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; cursor: move; user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 700;
}
.home-cf-tune-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; cursor: move; user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 11px; font-weight: 700;
}
.home-cf-tune-head .home-cf-tune-title { pointer-events: none; flex: 1; min-width: 0; }
.home-cf-tune-head button {
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 10px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
  pointer-events: auto;
}
.home-cf-tune-body { overflow-y: auto; padding: 8px 12px 12px; }
.home-cf-tune-row {
  display: grid; grid-template-columns: 84px 1fr 54px;
  align-items: center; gap: 6px; margin: 5px 0;
}
.home-cf-tune-row label { font-size: 10px; color: rgba(255,255,255,0.65); }
.home-cf-tune-row input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 3px;
  background: rgba(255,255,255,0.22); border-radius: 2px; outline: none;
}
.home-cf-tune-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; cursor: pointer;
}
.home-cf-tune-row input[type=number] {
  width: 54px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35); color: #fff;
  font-size: 10px; text-align: right; padding: 0 4px;
}
