/* Ruach Credits 고유 모양. 디자인 표준(tokens·base·components) 뒤에 불러온다. 고유 클래스는 c- 로 시작한다. */
:root { --stage: #0a0a0c; }

.c-work { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.c-stage-col { display: none; }
.page { width: 100%; }
.c-side-foot { margin-top: auto; padding: 0 8px 2px; font-size: 12.5px; color: var(--text-3); display: flex; flex-direction: column; gap: 2px; }
.c-side-foot b { color: var(--text-2); font-weight: 600; font-size: 13px; }
.nav-item .c-n { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }

/* 넓은 화면: 오른쪽에 미리 보기가 늘 붙어 있다 */
@media (min-width: 1180px) {
  .c-work { grid-template-columns: minmax(0, 1fr) minmax(380px, 40%); }
  .c-stage-col { display: block; border-left: 1px solid var(--sep); }
  .c-stage-col > .c-stage { position: sticky; top: 0; padding: 30px 28px; }
  .page { max-width: 760px; }
}

/* 미리 보기 */
.c-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.c-stage h2 { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 2px; min-height: 30px; display: flex; align-items: center; justify-content: space-between; }
.c-screen { position: relative; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 0.5px var(--line-2); }
.c-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.c-screen .c-blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgb(255 255 255 / 0.5); font-size: 14px; padding: 0 20px; text-align: center; }
.c-ctl { display: flex; align-items: center; gap: 10px; }
.c-ctl .c-play { width: 36px; height: 36px; border-radius: 50%; padding: 0; background: var(--fill); color: var(--text); flex: none; }
.c-ctl .c-play:hover:not(:disabled) { filter: brightness(0.96); }
.c-ctl .c-play svg { width: 18px; height: 18px; }
.c-ctl .c-time { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; min-width: 78px; text-align: right; }
.c-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.c-stats .stat { padding: 11px 13px; min-width: 0; }
.c-stats .stat b { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-stats .stat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 막대 (크기·위치 조절) */
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 28px; margin: 0; background: none; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--p), var(--fill) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--thumb); box-shadow: var(--shadow-thumb), 0 0 0 0.5px var(--line-2); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--thumb); box-shadow: var(--shadow-thumb), 0 0 0 0.5px var(--line-2); }
input[type=range]:focus-visible { box-shadow: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--shadow-thumb), 0 0 0 3.5px var(--ring); }
input[type=range]:disabled { opacity: 0.45; cursor: default; }

/* 사진·영상 목록 */
.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.c-tile { position: relative; display: block; aspect-ratio: 16 / 9; width: 100%; height: auto; padding: 0; border-radius: var(--r-md); overflow: hidden; background: var(--stage); color: #fff; transition: transform .15s var(--ease), opacity .15s; }
.c-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; pointer-events: none; }
.c-tile.blur img.bg { filter: blur(10px) brightness(0.6); transform: scale(1.25); }
.c-tile.blur img.fg { object-fit: contain; padding: 3% 0; }
.c-tile .c-no { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: rgb(0 0 0 / 0.55); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.c-tile .c-len { position: absolute; right: 6px; top: 6px; height: 22px; padding: 0 7px 0 5px; border-radius: var(--r-pill); background: rgb(0 0 0 / 0.55); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.c-tile .c-len svg { width: 12px; height: 12px; }
.c-tile .c-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.7)); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-tile:hover { transform: scale(1.02); }
.c-tile:focus-visible { box-shadow: 0 0 0 3.5px var(--ring); }
.c-tile.drag { opacity: 0.35; }
.c-tile.over { box-shadow: 0 0 0 3px var(--accent); }
.c-add { aspect-ratio: 16 / 9; width: 100%; height: auto; border-radius: var(--r-md); background: var(--group); color: var(--text-2); flex-direction: column; gap: 4px; font-size: 13px; }
.c-add:hover { background: var(--fill); }
.c-add svg { width: 22px; height: 22px; color: var(--accent); }

.c-dropzone { background: var(--group); border-radius: var(--r-lg); padding: 52px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.c-dropzone .c-big { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.c-dropzone .c-big svg { width: 28px; height: 28px; }
.c-dropzone b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.c-dropzone p { color: var(--text-2); font-size: 14px; line-height: 1.6; max-width: 380px; }
.c-dropzone button { margin-top: 12px; height: 40px; padding: 0 22px; font-size: 15px; }

.c-drop { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--accent) 18%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.c-drop > div { background: var(--raised); box-shadow: var(--shadow-win); border-radius: var(--r-lg); padding: 18px 26px; font-size: 16px; font-weight: 600; }

/* 설정 줄: 오른쪽에 고르는 것 */
.row > select { width: auto; min-width: 150px; max-width: 56%; flex: none; }
.row > .seg { flex: none; }
.row > input[type=range] { max-width: 46%; }
.row > .c-val { flex: none; width: 44px; text-align: right; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.c-fields { display: flex; flex-direction: column; gap: 14px; }
.c-logo { width: 44px; height: 44px; border-radius: var(--r-sm); background: repeating-conic-gradient(var(--fill) 0 25%, transparent 0 50%) 0 0 / 12px 12px; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.c-logo img { max-width: 100%; max-height: 100%; display: block; }
.c-note { background: color-mix(in srgb, var(--warn) 11%, transparent); color: var(--warn); border-radius: var(--r-md); padding: 11px 14px; font-size: 14px; line-height: 1.5; }
.c-go { height: 48px; font-size: 16px; }
.c-result video { width: 100%; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-md); display: block; }
.c-result .c-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.c-result .c-row .hint { flex: 1; min-width: 160px; }

/* 한 장 고치기 */
dialog.c-edit { width: min(600px, calc(100% - 32px)); }
.c-shot { position: relative; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-md); overflow: hidden; }
.c-shot canvas { width: 100%; height: 100%; display: block; }
.c-shot.pick canvas { cursor: crosshair; }
.c-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.c-acts .hint { flex: 1; min-width: 180px; }

/* 만드는 중 */
.c-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.c-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .2s linear; }
.c-prog { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.c-pct { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

@media (max-width: 899px) {
  .c-work { min-height: 0; }
  .c-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .c-tile, .c-add { border-radius: var(--r); }
  .c-tile:hover { transform: none; }
  .c-dropzone { padding: 40px 18px; }
  .c-dropzone button { height: var(--h-touch); width: 100%; font-size: 16px; }
  .row > select { min-width: 132px; max-width: 54%; height: 38px; font-size: 15px; }
  .row > .seg button { padding: 0 11px; }
  .c-ctl .c-play { width: 40px; height: 40px; }
  .c-row-wrap { flex-wrap: wrap; }
  .c-row-wrap > .seg { width: 100%; display: flex; }
  .c-row-wrap > .seg button { flex: 1; height: 32px; }
  .c-stats .stat b { font-size: 18px; }
}

/* 로그인 화면 · 계정 */
.c-auth-icon { width: 56px; height: 56px; border-radius: 15px; align-self: center; margin-bottom: 2px; }
.c-auth-hint { text-align: center; margin-top: 4px; }
.auth-card .msg.err { text-align: center; }
.c-me { display: flex; align-items: center; gap: 8px; padding: 0 0 8px; min-width: 0; }
.c-me b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-me button { height: 26px; padding: 0 8px; font-size: 12.5px; color: var(--text-2); flex: none; }
.c-me button:hover { background: var(--hover); color: var(--text); }
