/* bike.pdwiki.net — 바이크 동호회 3D 갤러리
   어두운 차고(쇼룸) 위에 주황색 한 가지 강조색. 글자는 시스템 한글 글꼴, 영문·숫자 제목만 Barlow Condensed. */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-condensed-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/barlow-condensed-700-italic.woff2") format("woff2"); }

:root {
  --bg: #0a0c0f;
  --panel: #13171c;
  --panel-2: #191e25;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --text: #e9edf2;
  --muted: #8f99a7;
  --dim: #626c79;
  --accent: #ff6a1a;
  --accent-2: #ffb24a;
  --accent-ink: #1c0d03;
  --danger: #ff5b66;
  --ok: #45d9a0;
  --radius: 18px;
  --grid-line: rgba(160, 185, 215, .13);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color-scheme: dark; -webkit-text-size-adjust: 100%; scrollbar-color: #2b323b transparent;
  background:
    radial-gradient(900px 480px at 82% -120px, rgba(255, 106, 26, .13), transparent 70%),
    radial-gradient(700px 420px at 8% -160px, rgba(90, 140, 220, .09), transparent 70%),
    var(--bg);
}
/* 모달·뷰어가 뜨면 스크롤을 잠근다. 사라진 스크롤 막대 폭(--scrollbar, ui.js 가 잰다)만큼 채워 화면이 밀리지 않게 한다. */
html.is-locked { overflow: hidden; }
html.is-locked body { padding-right: var(--scrollbar, 0px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.icon { flex: none; display: block; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { max-width: 640px; margin: 40px auto; padding: 0 24px; text-align: center; color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 버튼 · 입력 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { color: var(--accent-ink); background: linear-gradient(180deg, #ff8a45, #f8600f); box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 24px -12px rgba(255, 106, 26, .9); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ff9a5c, #ff6a1a); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.btn-quiet { height: 36px; padding: 0 12px; color: var(--muted); background: transparent; border-color: var(--line); font-weight: 600; font-size: 13px; }
.btn-quiet:hover:not(:disabled) { color: var(--text); }
.btn-danger { color: #fff; background: #d93f4c; }
.btn-danger:hover:not(:disabled) { background: #ec4a58; }
.btn-danger-text { color: var(--danger); }
.btn-block { width: 100%; }

.ibtn {
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: inherit; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.ibtn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); }
.ibtn:disabled { opacity: .4; cursor: not-allowed; }
.ibtn[aria-pressed="true"] { color: var(--accent); background: rgba(255, 106, 26, .14); }
.ibtn-danger:hover:not(:disabled) { color: var(--danger); background: rgba(255, 91, 102, .14); }
@media (hover: hover) {
  .ibtn[data-tip]::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 5;
    padding: 5px 9px; border-radius: 8px; background: rgba(0, 0, 0, .88); color: #fff;
    font: 500 12px/1.3 var(--font); white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s;
  }
  .ibtn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
  .top .ibtn[data-tip]::after, .viewer-top .ibtn[data-tip]::after, .panel-head .ibtn[data-tip]::after, .modal-head .ibtn[data-tip]::after { bottom: auto; top: calc(100% + 9px); }
  .top-actions .ibtn:last-child[data-tip]::after, .viewer-top-actions .ibtn:last-child[data-tip]::after, .panel-head .ibtn[data-tip]::after, .modal-head .ibtn[data-tip]::after, .card-admin .ibtn:last-child[data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
  .top-actions .ibtn:last-child[data-tip]:hover::after, .viewer-top-actions .ibtn:last-child[data-tip]:hover::after, .panel-head .ibtn[data-tip]:hover::after, .modal-head .ibtn[data-tip]:hover::after, .card-admin .ibtn:last-child[data-tip]:hover::after { transform: translate(0, 0); }
  .viewer-back[data-tip]::after { left: 0; transform: translate(0, 4px); }
  .viewer-back[data-tip]:hover::after { transform: translate(0, 0); }
}

.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: #0c0f13; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 26, .22); }
.input:disabled { opacity: .6; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.55; }
select.input { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238f99a7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: #c5ced9; }
.field-label em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); }
.field-help { font-size: 12.5px; color: var(--muted); }
.form-error { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; color: #ffc9cd; background: rgba(255, 91, 102, .12); border: 1px solid rgba(255, 91, 102, .3); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-2); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ── 위쪽 줄 ─────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 max(24px, calc((100vw - 1360px) / 2 + 24px));
  background: rgba(10, 12, 15, .72); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; border-radius: 10px; }
.brand-mark { flex: none; width: 30px; height: 30px; transition: transform .9s var(--ease); }
.brand:hover .brand-mark { transform: rotate(180deg); }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 700 23px/1 var(--display); letter-spacing: .035em; text-transform: uppercase; }
.brand-tag { flex: none; padding: 2px 6px 1px; border-radius: 5px; font: 700 12px/1.3 var(--display); letter-spacing: .08em; color: var(--accent-ink); background: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* ── 머리 영역 ───────────────────────────────────────────────── */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 24px; min-height: 250px; padding: 34px 0 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 14px/1 var(--display); letter-spacing: .22em; color: var(--accent); }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.hero-title { margin-top: 14px; font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; line-height: 1.16; letter-spacing: -.025em; word-break: keep-all; }
.hero-title em { font-style: normal; color: transparent; background: linear-gradient(92deg, #ff7a2e, #ffc06a); -webkit-background-clip: text; background-clip: text; }
.hero-sub { margin-top: 14px; max-width: 34em; color: var(--muted); font-size: 16px; word-break: keep-all; }

/* 머리 그림: 다가오는 격자 바닥과 천천히 도는 턴테이블 고리 */
.hero-art { position: relative; height: 230px; perspective: 620px; overflow: hidden; -webkit-mask-image: radial-gradient(75% 85% at 50% 60%, #000 35%, transparent 78%); mask-image: radial-gradient(75% 85% at 50% 60%, #000 35%, transparent 78%); }
.hero-floor {
  position: absolute; left: -45%; right: -45%; top: -20%; bottom: -6%;
  background-image: linear-gradient(var(--grid-line) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--grid-line) 1.5px, transparent 1.5px);
  background-size: 46px 46px;
  transform: rotateX(70deg); transform-origin: 50% 100%;
  animation: floor-run 5s linear infinite;
}
.hero-ring { position: absolute; left: 50%; bottom: 14px; width: 290px; height: 290px; margin-left: -145px; border-radius: 50%; border: 2px solid var(--accent); transform: rotateX(70deg); transform-origin: 50% 100%; box-shadow: 0 0 34px rgba(255, 106, 26, .55), inset 0 0 34px rgba(255, 106, 26, .28); }
.hero-ring::after { content: ""; position: absolute; inset: 40px; border-radius: 50%; border: 2px dashed rgba(255, 178, 74, .8); animation: spin 100s linear infinite; }
.hero-beam { position: absolute; left: 50%; bottom: 20px; width: 250px; height: 210px; margin-left: -125px; background: linear-gradient(0deg, rgba(255, 138, 60, .2), transparent 78%); clip-path: polygon(8% 100%, 92% 100%, 66% 0, 34% 0); filter: blur(7px); }
@keyframes floor-run { to { background-position: 0 46px, 0 0; } }

/* ── 갤러리 ──────────────────────────────────────────────────── */
.gallery { padding-bottom: 72px; }
.gallery-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 0 18px; border-top: 1px solid var(--line); }
.bar-count { font: 600 15px/1 var(--display); letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.bar-count-num { margin-left: 6px; font-size: 24px; letter-spacing: .02em; color: var(--text); }
.bar-tools { display: flex; align-items: center; gap: 8px; }
.bar-search { position: relative; display: block; color: var(--dim); }
.bar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.bar-search-input { width: 230px; height: 38px; padding: 0 12px 0 34px; }
.bar-sort { width: auto; height: 38px; padding-top: 0; padding-bottom: 0; }

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

.empty { display: grid; justify-items: center; gap: 10px; padding: 70px 20px 60px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent); }
.empty-art { display: grid; place-items: center; width: 104px; height: 104px; margin-bottom: 6px; border-radius: 50%; color: var(--accent); border: 2px solid rgba(255, 106, 26, .5); box-shadow: 0 0 40px -6px rgba(255, 106, 26, .5), inset 0 0 30px -10px rgba(255, 106, 26, .5); }
.empty-title { font-size: 19px; font-weight: 750; }
.empty-sub { max-width: 30em; color: var(--muted); word-break: keep-all; }
.empty .btn { margin-top: 10px; }

/* ── 3D 카드 ─────────────────────────────────────────────────── */
.card { position: relative; --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%; animation: card-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.card-link { display: block; color: inherit; text-decoration: none; perspective: 900px; border-radius: var(--radius); -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible .card-plate { outline: 2px solid var(--accent); outline-offset: 3px; }

.card-tilt { position: relative; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .6s var(--ease); }
.card.is-hover .card-tilt { transition: transform .1s linear; will-change: transform; }

.card-plate {
  overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, #181d24, #101318);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 34px -24px #000;
  transition: border-color .3s, box-shadow .3s;
}
.card.is-hover .card-plate, .card-link:active .card-plate {
  border-color: rgba(255, 122, 46, .6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 34px 60px -30px #000, 0 22px 60px -26px rgba(255, 106, 26, .55);
}

/* 카드 속 작은 무대: 조명 + 격자 바닥 + 턴테이블 고리 */
.card-stage { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: radial-gradient(110% 85% at 50% 4%, #2b333e 0%, #181c23 52%, #0f1216 100%); }
.card-floor {
  position: absolute; left: -45%; right: -45%; bottom: -40%; height: 96%;
  background-image: linear-gradient(rgba(170, 195, 225, .17) 1px, transparent 1px), linear-gradient(90deg, rgba(170, 195, 225, .17) 1px, transparent 1px);
  background-size: 24px 24px;
  transform: perspective(380px) rotateX(66deg); transform-origin: 50% 100%;
  -webkit-mask-image: radial-gradient(58% 72% at 50% 74%, #000 25%, transparent 76%); mask-image: radial-gradient(58% 72% at 50% 74%, #000 25%, transparent 76%);
}
.card-ring { position: absolute; left: 15%; right: 15%; bottom: 9.5%; height: 21%; border-radius: 50%; border: 1.5px solid rgba(255, 122, 46, .8); box-shadow: 0 0 18px rgba(255, 106, 26, .4), inset 0 0 16px rgba(255, 106, 26, .16); opacity: .8; transition: opacity .3s, box-shadow .3s; }
.card.is-hover .card-ring { opacity: 1; box-shadow: 0 0 26px rgba(255, 106, 26, .75), inset 0 0 20px rgba(255, 106, 26, .3); }

/* 작품 그림은 판 위에 떠 있다 — 마우스를 올리면 카드 밖으로 떠오른다 */
.card-model { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 4 / 3; pointer-events: none; transition: transform .55s var(--ease); }
.card.is-hover .card-model { transform: translateZ(58px) scale(1.05); }
.card-poster, .card-spin { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-poster { object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35)); }
.card-spin { opacity: 0; background-repeat: no-repeat; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35)); }
.card-model.is-spinning .card-spin { opacity: 1; }
.card-model.is-spinning .card-poster { opacity: 0; }
.card-noimage { position: absolute; inset: 0; display: grid; place-items: center; color: #56606d; }

.card-format { position: absolute; left: 12px; top: 12px; padding: 3px 8px 2px; border-radius: 7px; font: 700 13px/1.35 var(--display); letter-spacing: .1em; color: #dbe2ea; background: rgba(9, 11, 14, .68); border: 1px solid var(--line-2); transform: translateZ(26px); }
.card-cta {
  position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent);
  opacity: 0; transform: translateZ(40px) translateY(6px); transition: opacity .25s, transform .35s var(--ease);
}
.card.is-hover .card-cta, .card-link:focus-visible .card-cta { opacity: 1; transform: translateZ(40px); }
.card-glare { position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(360px circle at var(--gx) var(--gy), rgba(255, 255, 255, .17), transparent 46%); transform: translateZ(1px); }
.card.is-hover .card-glare { opacity: 1; }

.card-info { position: relative; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.card-title { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 16px; font-weight: 700; line-height: 1.38; word-break: keep-all; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--muted); }
.card-meta > * + *::before { content: "·"; margin: 0 7px; opacity: .6; }
.card-author { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font: 600 12.5px/1 var(--display); letter-spacing: .04em; color: #b9c3cf; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.chip-accent { color: var(--accent-2); border-color: rgba(255, 178, 74, .35); background: rgba(255, 178, 74, .08); font-family: var(--font); font-size: 11.5px; letter-spacing: 0; }
.card-admin { position: absolute; right: 8px; bottom: 9px; z-index: 2; display: flex; gap: 2px; }
.card-admin .ibtn { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); }
.card-admin .ibtn:hover { color: var(--text); }
.card-admin .ibtn-danger:hover { color: var(--danger); }
.card:has(.card-admin) .card-chips { padding-right: 70px; }

.card.is-fresh .card-plate { animation: fresh 2.4s ease-out 1; }
@keyframes fresh { 0%, 35% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 26, .45), 0 20px 60px -20px rgba(255, 106, 26, .8); } }

/* ── 아래 줄 ─────────────────────────────────────────────────── */
.foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 22px 24px 30px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.foot-name { font: italic 700 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ── 뷰어 ────────────────────────────────────────────────────── */
.viewer {
  position: fixed; inset: 0; z-index: 50; overflow: hidden; visibility: hidden; opacity: 0;
  color: var(--text);
  background: radial-gradient(ellipse 90% 85% at 50% 42%, #1b2028 0%, #0d1014 55%, #07090b 100%);
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.viewer.is-open { visibility: visible; opacity: 1; transition: opacity .3s ease; }
.viewer-stage { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.viewer.is-ready .viewer-stage { opacity: 1; }
.stage-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; cursor: grab; }
.stage-canvas:active { cursor: grabbing; }

.viewer-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px 34px; background: linear-gradient(180deg, rgba(7, 9, 11, .7), transparent); pointer-events: none; }
.viewer-top > * { pointer-events: auto; }
.viewer-heading { flex: 1; min-width: 0; pointer-events: none; }
.viewer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 750; line-height: 1.3; }
.viewer-meta { display: flex; overflow: hidden; white-space: nowrap; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.viewer-meta > * + *::before { content: "·"; margin: 0 7px; opacity: .6; }
.viewer-top-actions { display: flex; gap: 4px; flex: none; }
.viewer-back { background: rgba(255, 255, 255, .07); border-color: var(--line); }
.viewer-admin-btn { color: var(--accent-2); }

.viewer-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 68px; margin-top: -34px; border-radius: 14px; color: #cdd5df; background: rgba(14, 17, 21, .5); border-color: var(--line); }
.viewer-nav:hover:not(:disabled) { background: rgba(14, 17, 21, .85); color: #fff; }
.viewer-prev { left: 14px; }
.viewer-next { right: 14px; }

.viewer-bar {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 3;
  display: flex; align-items: center; gap: 6px; max-width: calc(100vw - 20px); padding: 6px 8px;
  border-radius: 18px; border: 1px solid var(--line-2); background: rgba(15, 19, 24, .74);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 18px 44px -20px #000; transform: translateX(-50%);
}
.bar-group { display: flex; gap: 2px; }
.bar-sep { flex: none; width: 1px; height: 22px; background: var(--line-2); }
.speed-wrap { position: relative; }
.speed-pop { position: absolute; left: 50%; bottom: calc(100% + 16px); width: 236px; padding: 13px 15px 11px; border-radius: 15px; border: 1px solid var(--line-2); background: #11151a; box-shadow: 0 24px 50px -20px #000; transform: translateX(-50%); }
.speed-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 650; }
.speed-text { font: 600 15px/1 var(--display); letter-spacing: .03em; color: var(--accent-2); }
.speed-range { width: 100%; margin: 12px 0 6px; accent-color: var(--accent); cursor: pointer; }
.speed-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

.viewer-hint {
  position: absolute; left: 50%; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 68px); z-index: 2;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 8px 15px; border-radius: 999px;
  font-size: 13px; color: #dde3ea; background: rgba(0, 0, 0, .55); pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .4s, transform .4s var(--ease);
}
.viewer-hint.is-in { opacity: 1; transform: translate(-50%, 0); }

.viewer-panel {
  position: absolute; right: 14px; top: calc(max(12px, env(safe-area-inset-top)) + 58px); z-index: 4;
  width: min(340px, calc(100vw - 28px)); max-height: calc(100% - 170px); overflow: auto; padding: 8px 18px 18px;
  border-radius: 18px; border: 1px solid var(--line-2); background: rgba(15, 19, 24, .88); color: var(--text);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 30px 60px -30px #000;
  animation: panel-in .25s var(--ease);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-8px); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-right: -10px; }
.panel-head h3 { font-size: 15px; font-weight: 750; }
.panel-desc { margin: 4px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: #cfd6df; }
.spec { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.spec-row dt { color: var(--muted); flex: none; }
.spec-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.panel-label { margin-top: 14px; font-size: 13px; font-weight: 750; }
.panel-label:first-of-type { margin-top: 4px; }
.panel-help { margin: 3px 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--muted); word-break: keep-all; }
.axis-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.axis-buttons .btn { height: 36px; padding: 0 6px; font-size: 13px; }
.axis-x { --axis: #ff6b6b; } .axis-y { --axis: #6fdc8c; } .axis-z { --axis: #6aa9ff; }
.axis-buttons .btn .icon, .chip-btn[class*="axis-"] { color: var(--axis); }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel-actions .btn { height: 36px; font-size: 13px; }

.viewer-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; align-content: center; gap: 12px; pointer-events: none; }
.viewer-poster { position: absolute; left: 50%; top: 50%; width: min(86vw, 880px); max-height: 72vh; object-fit: contain; opacity: .3; filter: blur(2px) saturate(.7); transform: translate(-50%, -52%); }
.ring { position: relative; width: 78px; height: 78px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: rgba(8, 10, 12, .55); stroke: rgba(255, 255, 255, .14); stroke-width: 3; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .25s ease; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font: 600 22px/1 var(--display); color: #fff; }
.ring-num::after { content: "%"; position: absolute; left: 50%; top: 50%; margin: 2px 0 0 15px; font-size: 11px; opacity: .65; }
.viewer-loading-text { position: relative; font-size: 13px; color: #c6ced8; text-shadow: 0 1px 6px #000; }

.viewer-error { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; text-align: center; color: #e4e9ee; }
.viewer-error > .icon { color: var(--accent-2); }
.viewer-error-title { font-size: 18px; font-weight: 750; }
.viewer-error-text { max-width: 30em; margin-bottom: 10px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

/* 밝은 배경 */
.viewer[data-theme="light"] { color: #171b20; background: radial-gradient(ellipse 90% 85% at 50% 42%, #ffffff 0%, #e9edf2 55%, #cfd6de 100%); }
.viewer[data-theme="light"] .viewer-top { background: linear-gradient(180deg, rgba(255, 255, 255, .8), transparent); }
.viewer[data-theme="light"] .viewer-meta { color: #5a6471; }
.viewer[data-theme="light"] .viewer-top .ibtn:hover:not(:disabled) { background: rgba(0, 0, 0, .07); }
.viewer[data-theme="light"] .viewer-back { background: rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .1); }
.viewer[data-theme="light"] .viewer-admin-btn { color: #c2500a; }
.viewer[data-theme="light"] .viewer-loading-text { color: #3a424c; text-shadow: none; }

/* ── 모달 ────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow: auto; padding: 16px; background: rgba(4, 6, 8, .68); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.modal-backdrop.is-in { opacity: 1; }
.modal { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 32px); border-radius: 20px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 40px 110px -30px #000; transform: translateY(12px) scale(.985); transition: transform .28s var(--ease); }
.modal-backdrop.is-in .modal { transform: none; }
.modal-sm { max-width: 390px; }
.modal-md { max-width: 520px; }
.modal-xl { max-width: 1060px; }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 750; }
.modal-body { overflow: auto; padding: 20px; }
.modal-text { color: #cfd6df; word-break: keep-all; }
.modal-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ── 올리기 창 ───────────────────────────────────────────────── */
.up-drop {
  display: grid; justify-items: center; gap: 8px; padding: 50px 20px 42px; text-align: center;
  border-radius: 16px; border: 2px dashed var(--line-2);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  transition: border-color .2s, background-color .2s;
}
.modal.is-dragover .up-drop, .modal.is-dragover .up-preview { border-color: var(--accent); background-color: rgba(255, 106, 26, .07); }
.up-drop-icon { display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 6px; border-radius: 50%; color: var(--accent); background: var(--panel); border: 2px solid rgba(255, 106, 26, .5); box-shadow: 0 0 36px -8px rgba(255, 106, 26, .6); }
.up-drop-title { font-size: 19px; font-weight: 750; }
.up-drop-sub { max-width: 30em; color: var(--muted); word-break: keep-all; }
.up-drop-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.up-drop-error { max-width: 34em; padding: 9px 13px; border-radius: 10px; font-size: 13.5px; color: #ffc9cd; background: rgba(255, 91, 102, .12); border: 1px solid rgba(255, 91, 102, .3); word-break: keep-all; }
.up-drop-formats { margin-top: 8px; font: 600 14px/1.5 var(--display); letter-spacing: .1em; color: #a9b3bf; }
.up-drop-limit { font-size: 12.5px; color: var(--dim); }

.up-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.up-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 16px; border: 1px solid var(--line-2); background: radial-gradient(ellipse 90% 85% at 50% 42%, #1e242d 0%, #10141a 58%, #0a0c0f 100%); }
.up-stage { position: absolute; inset: 0; }
.up-overlay { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; font-size: 14px; color: #d5dce4; background: rgba(10, 12, 15, .72); overflow-wrap: anywhere; }
.up-overlay.is-error { color: #ffc9cd; }
.up-orient { position: absolute; left: 10px; top: 10px; z-index: 1; display: flex; align-items: center; gap: 5px; }
.up-orient-label { margin-right: 2px; font-size: 12px; font-weight: 650; color: #c5ced9; text-shadow: 0 1px 4px #000; }
.chip-btn { display: inline-grid; place-items: center; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(9, 11, 14, .75); color: var(--text); font: 700 13px/1 var(--display); letter-spacing: .05em; cursor: pointer; }
.chip-btn:hover { background: rgba(40, 46, 54, .9); }
.up-tip { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: #d3dae2; background: rgba(9, 11, 14, .68); pointer-events: none; word-break: keep-all; }
.up-tip .icon { color: var(--accent-2); }
.up-preview.is-disabled { pointer-events: none; }
.up-form { display: grid; gap: 14px; }
.up-form.is-disabled { opacity: .7; }
.up-files-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.up-files { min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.up-progress { flex: 1; min-width: 0; display: grid; gap: 6px; }
.up-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.up-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; }
.up-progress-text { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .18); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.drop-veil { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(8, 10, 12, .8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); pointer-events: none; }
.drop-veil-box { display: grid; justify-items: center; gap: 12px; padding: 44px 56px; border-radius: 22px; border: 2px dashed var(--accent); color: var(--accent-2); font-size: 18px; font-weight: 700; text-align: center; background: rgba(255, 106, 26, .06); }

/* ── 토스트 ──────────────────────────────────────────────────── */
#toast-root { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 100; display: grid; justify-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 24px); transform: translateX(-50%); pointer-events: none; }
.viewer.is-open ~ #toast-root { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 70px); }
.toast { display: flex; align-items: center; gap: 9px; max-width: min(560px, calc(100vw - 24px)); padding: 10px 16px; border-radius: 13px; border: 1px solid var(--line-2); background: #1c2129; color: var(--text); font-size: 14px; line-height: 1.45; box-shadow: 0 20px 44px -18px #000; pointer-events: auto; cursor: pointer; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease); word-break: keep-all; overflow-wrap: anywhere; }
.toast.is-in { opacity: 1; transform: none; }
.toast-ok .icon { color: var(--ok); }
.toast-error .icon { color: var(--danger); }
.toast-info .icon { color: var(--accent-2); }

/* ── 작은 화면 ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 30px 0 22px; }
  .hero-art { position: absolute; right: -40px; top: 0; bottom: 0; width: 320px; height: auto; opacity: .5; z-index: -1; }
  .up-main { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  main { padding: 0 16px; }
  .top { height: 58px; padding: 0 12px 0 16px; }
  .brand-name { font-size: 20px; }
  .btn-upload span { display: none; }
  .btn-upload { width: 40px; padding: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
  .bar-tools { width: 100%; }
  .bar-search { flex: 1; }
  .bar-search-input { width: 100%; }
  .gallery-bar { padding-bottom: 14px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100dvh - 20px); border-radius: 20px 20px 16px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .up-drop { padding: 34px 14px 30px; }
  .viewer-title { font-size: 16px; }
  .viewer-nav { width: 36px; height: 54px; margin-top: -27px; background: rgba(14, 17, 21, .35); }
  .viewer-prev { left: 6px; }
  .viewer-next { right: 6px; }
  .viewer-bar { gap: 3px; padding: 5px; border-radius: 16px; }
  .viewer-bar .ibtn { width: 38px; height: 38px; }
  .bar-sep { margin: 0 1px; }
  .viewer-hint { font-size: 12px; white-space: normal; text-align: center; border-radius: 14px; }
  .viewer-panel { left: 10px; right: 10px; top: auto; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 62px); width: auto; max-height: 52%; }
  .up-tip { font-size: 11.5px; }
}
@media (max-width: 380px) {
  .viewer-bar .ibtn { width: 34px; height: 36px; }
  .bar-sep { display: none; }
}

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