/* ───────── 글꼴: 페이퍼로지 ───────── */
@font-face { font-family: 'Paperlogy'; font-weight: 400; font-display: swap; src: url('fonts/Paperlogy-4Regular.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 500; font-display: swap; src: url('fonts/Paperlogy-5Medium.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 700; font-display: swap; src: url('fonts/Paperlogy-7Bold.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 900; font-display: swap; src: url('fonts/Paperlogy-9Black.woff2') format('woff2'); }
/* 리아체 (롯데GRS, 원본 그대로 사용 — fonts/RiaSans_license.pdf) : 제목·무대 큰 글자용 */
@font-face { font-family: 'RiaSans'; font-weight: 700 900; font-display: swap; src: url('fonts/RiaSans-ExtraBold.otf') format('opentype'); }

:root {
  --ink: #5a3b2e;
  --ink-soft: #77594b;
  --cream: #fff8ec;
  --paper: #ffffff;
  --line: #efdcc8;
  --line-strong: #e0c6ac;
  --pink: #ff8fab;
  --coral: #ff7a6b;
  --yellow: #ffd166;
  --mint: #6fd3b5;
  --sky: #7cc4f2;
  --lavender: #b9a3e3;
  --peach: #ffb38a;
  --shadow: 0 4px 0 rgba(90, 59, 46, .12), 0 10px 24px rgba(90, 59, 46, .08);
  --radius: 22px;
  --ria: 'RiaSans', 'Paperlogy', 'Malgun Gothic', sans-serif;
}

/* 리아체로 쓰는 곳: 제목, 무대 위 큰 글자, 강조 꼬리표 (본문·입력 칸은 페이퍼로지) */
.brand b, .panel h2, #dlgForm h3, .btn.big, .num, .empty p,
.opening h1, .closing h1, .op-class, .intro .drum, .rc-num, .rc-type,
.rc-text h2, .lv-text h2, .lv-badge, .next-strip .ns-label, .tray-title, .mc-box b,
.op-panel b, .op-marq, .op-word.ria, .jump-head b {
  font-family: var(--ria);
  font-weight: 800;
  letter-spacing: -.01em;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Paperlogy', 'Malgun Gothic', sans-serif;
  font-size: 17px;
  color: var(--ink);
  background: var(--cream) url('assets/bg-board.webp') center / cover fixed;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.showing { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

/* ───────── 버튼 ───────── */
.btn {
  border: 2.5px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, background .15s;
  white-space: nowrap;
}
.btn:hover { background: #fff3df; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--pink); color: #fff; text-shadow: 0 1px 0 rgba(90,59,46,.35); }
.btn.primary:hover { background: #ff7f9f; }
.btn.big { font-size: 1.1rem; padding: 11px 24px; background: var(--coral); }
.btn.big:hover { background: #ff6a59; }
.btn.ghost { border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.small { padding: 6px 14px; font-size: .9rem; }
.btn.danger { color: #d1495b; }
.btn.new-btn { background: #fff6d9; border-color: #f1d98a; box-shadow: 0 3px 0 #f1d98a; }
.btn.new-btn:hover { background: #ffefb8; }
.btn:focus-visible, .type-btn:focus-visible, .head-btns button:focus-visible, .handle:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ───────── 윗줄 ───────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px;
  background: rgba(255, 248, 236, .92);
  backdrop-filter: blur(6px);
  border-bottom: 2px dashed var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); object-fit: cover; object-position: 50% 20%; }
.brand b { display: block; font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; }
.brand span { font-size: .9rem; color: var(--ink-soft); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--ink-soft); margin-right: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.7); }
.save-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.save-state.bad { color: #c23a4c; font-weight: 700; background: #fff0f2; }
.save-state.bad::before { background: #e5485a; }

/* ───────── 배치 ───────── */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding-bottom: calc(27px + env(safe-area-inset-bottom)); box-sizing: border-box; } /* 화면 아래에 붙은 푸터만큼 비워 둠 */
#app > .layout { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.layout {
  max-width: 1360px; margin: 0 auto; padding: 26px 28px 44px;
  display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 26px; align-items: start;
}
.side { display: flex; flex-direction: column; gap: 22px; }
.panel {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px 26px;
}
.panel h2 { margin: 0; font-size: 1.4rem; font-weight: 900; display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.panel-head { margin-bottom: 18px; }
.panel-desc { margin: 4px 0 0 26px; font-size: .92rem; color: var(--ink-soft); line-height: 1.5; }
.dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2.5px solid var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 1rem; margin-bottom: 14px; }
.field small { font-weight: 400; color: var(--ink-soft); font-size: .86rem; line-height: 1.45; }
.field .lbl { display: block; }
input:not([type=checkbox]):not([type=file]), textarea {
  width: 100%;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  padding: 11px 14px;
  background: #fffdf9;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.45;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b39a89; font-weight: 400; }
textarea { resize: vertical; }
input:hover:not(:focus), textarea:hover:not(:focus) { border-color: #cfb193; }
input:focus, textarea:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 4px rgba(124,196,242,.25); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ───────── 진행 설정 ───────── */
.set-group + .set-group { margin-top: 18px; }
.set-title { margin: 0 0 8px 4px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .04em; }
.setting {
  position: relative;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 11px;
  padding: 11px 12px 11px 12px; margin-bottom: 8px;
  border: 2px solid var(--line); border-radius: 16px; background: #fffaf3;
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.setting:hover { border-color: #e2c3a5; background: #fff6ea; }
.setting:active { transform: scale(.99); }
.setting:has(input:checked) { background: #effbf6; border-color: #a8e3cf; }
.set-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 1.25rem; line-height: 1; }
/* 제목·설명 모두 한 줄 — 넘치면 말줄임(…), 전체 설명은 마우스를 올리면 보임(title) */
.set-txt b, .set-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-txt b { font-size: 1.02rem; font-weight: 800; line-height: 1.35; }
.set-txt small { margin-top: 2px; font-size: .84rem; color: var(--ink-soft); line-height: 1.45; letter-spacing: -.01em; }
.setting input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch { position: relative; flex: none; width: 54px; height: 31px; border-radius: 999px; background: #e5d4c3; border: 2.5px solid var(--ink); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); box-sizing: border-box; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.setting input:checked + .switch { background: var(--mint); }
.setting input:checked + .switch::after { transform: translateX(23px); }
.setting input:focus-visible + .switch { outline: 3px solid var(--sky); outline-offset: 3px; }

/* ───────── 순서 목록 ───────── */
.program-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.program-head h2 { margin: 0; }
.summary { flex: 1; color: var(--ink-soft); font-size: .95rem; font-weight: 500; }
.summary:not(:empty) { flex: 0 1 auto; padding: 3px 12px; border-radius: 999px; background: #fff3df; }
.program-head .summary + .btn { margin-left: auto; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.list-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.spacer { flex: 1; }

.card {
  border: 2.5px solid var(--line);
  border-left: 10px solid var(--tc);
  border-radius: 18px;
  background: #fffdf9;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #e8cfb6; border-left-color: var(--tc); }
.card.open { border-color: var(--ink); border-left-color: var(--tc); box-shadow: var(--shadow); background: #fff; }
.card.dragging { opacity: .85; box-shadow: 0 14px 30px rgba(90,59,46,.25); pointer-events: none; transform: scale(1.01); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 8px; }
.handle { border: 0; background: none; font-size: 1.4rem; color: #c9ad96; cursor: grab; padding: 4px 6px; touch-action: none; border-radius: 8px; line-height: 1; }
.handle:active { cursor: grabbing; }
.num { flex: none; width: 36px; height: 36px; font-size: 1.02rem; border-radius: 50%; background: var(--tc); color: #fff; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); text-shadow: 0 1px 0 rgba(90,59,46,.4); }
.ic { flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: #fff; border: 2px solid var(--line); }
.head-text { flex: 1; min-width: 0; cursor: pointer; }
.h-title { display: block; font-size: 1.18rem; font-weight: 900; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-title em { font-style: normal; color: #b8977f; font-weight: 700; }
.h-sub { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: .95rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; }
.h-perf { overflow: hidden; text-overflow: ellipsis; }
.tag { flex: none; padding: 1px 11px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 26%, white); color: var(--ink); font-weight: 700; font-size: .85rem; }
.h-meta { flex: none; display: flex; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.h-meta span { background: #fff3df; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.head-btns { flex: none; display: flex; gap: 6px; align-items: center; }
.head-btns button { min-height: 38px; border: 2px solid var(--line-strong); background: #fff; border-radius: 12px; padding: 5px 11px; font-size: .92rem; font-weight: 700; color: var(--ink); transition: background .15s, border-color .15s; }
.head-btns button:hover { border-color: var(--ink); background: #fffaf2; }
.head-btns button[data-act=up], .head-btns button[data-act=down] { width: 38px; padding: 0; color: var(--ink-soft); }
.head-btns .edit-btn { padding: 5px 14px; }
.card.open .edit-btn { background: var(--yellow); border-color: var(--ink); }
.head-btns .del-btn { color: #c23a4c; border-color: #f2c4cb; }
.head-btns .del-btn:hover { background: #fff0f2; border-color: #d1495b; color: #b8323f; }
.btn.danger-fill { background: #e5485a; color: #fff; text-shadow: none; }
.btn.danger-fill:hover { background: #d13a4c; }

.card-body { padding: 6px 20px 18px; border-top: 2px dashed var(--line); background: #fffcf7; border-radius: 0 0 16px 16px; animation: drop .2s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
/* 고치기 칸: 번호 붙은 묶음 */
.eb { padding: 16px 0 6px; }
.eb + .eb { border-top: 1.5px solid var(--line); }
.eb-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--ria); font-size: 1.08rem; font-weight: 800; }
.eb-title span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tc); color: #fff; font-family: 'Paperlogy', sans-serif; font-size: .82rem; font-weight: 900; border: 2px solid var(--ink); }
.eb-hint { margin: -4px 0 10px; font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }
.eb-hint.small { margin: 8px 0 0; font-size: .84rem; }
.eb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.eb-split .field { margin-bottom: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.type-btn { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .9rem; font-weight: 700; transition: transform .1s, border-color .15s; }
.type-btn img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.type-btn:hover { transform: translateY(-2px); border-color: var(--tc); }
.type-btn.on { border: 3px solid var(--ink); background: color-mix(in srgb, var(--tc) 28%, white); box-shadow: 0 3px 0 var(--ink); }
.media-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 52px; padding: 10px 12px; border: 2px dashed var(--line-strong); border-radius: 14px; background: #fff; font-weight: 500; }
.media-box small { color: var(--ink-soft); font-size: .84rem; }
.media-box audio { height: 36px; max-width: 100%; flex: 1 1 220px; }
.media-box .fname { font-size: .88rem; color: var(--ink-soft); flex: 1 1 100px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.body-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.body-foot .btn:first-child { background: var(--mint); }

.empty { text-align: center; padding: 30px 10px 20px; color: var(--ink-soft); font-weight: 500; list-style: none; }
.empty img { width: 140px; height: 140px; margin: 0 auto 8px; border-radius: 50%; background: #fff; border: 2.5px solid var(--line); object-fit: cover; }

/* ───────── 알림 창 · 토스트 ───────── */
dialog { border: 2.5px solid var(--ink); border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); color: var(--ink); background: #fff; overflow: hidden; }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(60, 38, 29, .45); backdrop-filter: blur(2px); }
#dlgForm { display: flex; flex-direction: column; max-height: calc(100vh - 44px); }
#dlgForm h3 { margin: 0; padding: 22px 26px 12px; font-size: 1.35rem; font-weight: 900; border-bottom: 1.5px solid var(--line); }
#dlgForm .dlg-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 26px 4px; font-size: 1.02rem; line-height: 1.6; color: var(--ink); }
#dlgForm .dlg-body p { margin: 0 0 10px; }
#dlgForm .dlg-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 26px 20px; flex-wrap: wrap; border-top: 1.5px solid var(--line); background: #fffaf3; }
.help-sec { margin: 0 0 6px; font-family: var(--ria); font-weight: 800; font-size: 1.05rem; }
.help-steps { margin: 0 0 16px; padding-left: 0; list-style: none; counter-reset: s; }
.help-steps li { counter-increment: s; position: relative; padding: 7px 0 7px 42px; line-height: 1.55; }
.help-steps li::before { content: counter(s); position: absolute; left: 0; top: 7px; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: .92rem; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 8px 0 16px; font-size: .95rem; }
.keys div { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: #fffaf3; border: 1.5px solid var(--line); }
.keys kbd { min-width: 38px; text-align: center; }
.help-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: #eef8ff; border: 1.5px solid #cfe7f8; font-size: .92rem; line-height: 1.55; }
kbd { font: inherit; font-weight: 800; background: #fff; border: 2px solid var(--line-strong); border-bottom-width: 4px; border-radius: 8px; padding: 0 8px; white-space: nowrap; }
@media (max-width: 600px) { .keys { grid-template-columns: 1fr; } .eb-split { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: calc(46px + env(safe-area-inset-bottom)); z-index: 50; /* 푸터 위로 */
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 14px 12px 24px;
  display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 1rem;
  box-shadow: 0 10px 30px rgba(43,29,23,.3);
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), visibility 0s .25s;
  max-width: calc(100vw - 32px);
}
.toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.toast button { border: 0; background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 5px 14px; font-weight: 900; }
.toast:not(:has(button)) { padding-right: 22px; }

/* ───────── 진행 화면 ───────── */
#show { position: fixed; inset: 0; z-index: 100; background: #2b1d17; overflow: hidden; cursor: none; }
#show.ui { cursor: default; }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  overflow: hidden;
  background: #fff3df;
  color: var(--ink);
}
.bg { position: absolute; inset: 0; background: center / cover no-repeat; transition: opacity .4s; }
#slide { position: absolute; inset: 0; }
#confetti { position: absolute; inset: 0; pointer-events: none; }
.sl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* 여는 · 마치는 화면 */
.opening, .closing { padding: 40px 300px 150px; }
.mascot { width: 250px; height: 250px; object-fit: contain; mix-blend-mode: multiply; animation: bob 2.4s ease-in-out infinite, popIn .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.opening h1, .closing h1 {
  margin: 6px 0 10px; font-weight: 900; line-height: 1.12; letter-spacing: -.02em; width: 100%;
  color: #fff;
  -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill;
  text-shadow: 0 10px 0 var(--ink);
  animation: popIn .8s .15s cubic-bezier(.3, 1.6, .5, 1) both;
}
.closing h1 { color: var(--yellow); }
.op-class { display: inline-block; background: #fff; border: 5px solid var(--ink); border-radius: 999px; padding: 6px 36px; font-size: 46px; font-weight: 900; box-shadow: 0 7px 0 var(--ink); animation: popIn .6s .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.op-slogan { margin: 18px 0 0; font-size: 50px; font-weight: 700; animation: rise .6s .5s ease-out both; }
.op-welcome { margin: 16px 0 0; font-size: 42px; font-weight: 500; line-height: 1.45; background: rgba(255,255,255,.75); border-radius: 30px; padding: 14px 36px; animation: rise .6s .65s ease-out both; }
.closing .op-welcome { margin-bottom: 26px; }

/* 순서 소개 */
.intro .drum {
  font-size: 150px; font-weight: 900; color: #fff;
  -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; text-shadow: 0 10px 0 var(--ink);
  animation: wobble .35s ease-in-out infinite alternate, popIn .5s cubic-bezier(.3, 1.6, .5, 1) both;
}
.intro.revealed .drum { display: none; }
.reveal-card {
  display: none;
  width: 1260px; background: #fff; border: 7px solid var(--ink); border-radius: 56px;
  box-shadow: 0 16px 0 var(--ink), 0 40px 80px rgba(90,59,46,.25);
  overflow: hidden;
}
.intro.revealed .reveal-card { display: block; animation: cardIn .75s cubic-bezier(.3, 1.5, .5, 1) both; }
.rc-top { display: flex; justify-content: center; align-items: center; gap: 22px; background: var(--tc); padding: 20px; border-bottom: 7px solid var(--ink); }
.rc-num { background: #fff; border: 5px solid var(--ink); border-radius: 999px; padding: 2px 30px; font-size: 48px; font-weight: 900; }
.rc-type { font-size: 50px; font-weight: 900; color: #fff; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; }
.rc-main { display: flex; align-items: center; gap: 50px; padding: 46px 60px 54px; text-align: left; }
.rc-ic { flex: none; width: 300px; height: 300px; object-fit: cover; border-radius: 50%; border: 6px solid var(--line); animation: spinIn .9s .25s cubic-bezier(.3, 1.5, .5, 1) both; }
.rc-text { flex: 1; min-width: 0; }
.rc-text h2, .lv-text h2 { margin: 0 0 22px; font-weight: 900; line-height: 1.15; letter-spacing: -.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 14px; }
.chip { background: color-mix(in srgb, var(--tc) 22%, white); border: 4px solid var(--ink); border-radius: 999px; padding: 4px 28px; font-size: 44px; font-weight: 700; animation: popIn .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.chips.small .chip { font-size: 36px; padding: 2px 22px; }

/* 공연 중 */
.live { padding: 330px 360px 160px; }
.lv-badge {
  position: absolute; top: 222px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; white-space: nowrap;
  background: var(--tc); color: #fff; border: 6px solid var(--ink); border-radius: 999px;
  padding: 8px 40px; font-size: 52px; font-weight: 900; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill;
  box-shadow: 0 8px 0 var(--ink);
  animation: dropIn .6s cubic-bezier(.3, 1.6, .5, 1) both;
}
.lv-badge span { background: #fff; color: var(--ink); -webkit-text-stroke: 0; border-radius: 999px; padding: 0 22px; font-size: 40px; border: 4px solid var(--ink); }
/* 사진·영상이 없는 공연 화면: 꼬리표도 아래 내용과 한 줄기로 쌓아 절대 겹치지 않게 */
.live:not(.has-media) { padding: 205px 360px 150px; }
.live:not(.has-media) .lv-badge { position: relative; top: auto; left: auto; transform: none; flex: none; margin: 0 0 34px; animation-name: dropInFlow; }
@keyframes dropInFlow { from { opacity: 0; transform: translateY(-80px); } }
.lv-main { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.lv-ic { width: 250px; height: 250px; border-radius: 50%; background: #fff; border: 8px solid var(--ink); overflow: hidden; box-shadow: 0 12px 0 var(--ink); animation: popIn .7s .1s cubic-bezier(.3, 1.6, .5, 1) both, bob 3s 1s ease-in-out infinite; }
.lv-ic img { width: 100%; height: 100%; object-fit: cover; }
.lv-text { width: 100%; display: flex; flex-direction: column; align-items: center; }
.lv-text h2 { margin-bottom: 20px; text-shadow: 0 5px 0 #fff, 0 -2px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff; animation: rise .6s .2s ease-out both; }
.lv-text .chips { justify-content: center; }
.live.has-photo .lv-main { flex-direction: row; gap: 60px; text-align: left; }
.live.has-photo .lv-text { align-items: flex-start; flex: 1; min-width: 0; }
.live.has-photo .lv-text .chips { justify-content: flex-start; }
.polaroid { flex: none; background: #fff; padding: 18px 18px 54px; border: 5px solid var(--ink); border-radius: 12px; box-shadow: 0 14px 0 rgba(90,59,46,.25); transform: rotate(-4deg); animation: photoIn .8s .1s cubic-bezier(.3, 1.4, .5, 1) both; }
.polaroid img { width: 400px; height: 400px; object-fit: cover; border-radius: 4px; background: #f3e7d8; }
.rc-main .polaroid img { width: 330px; height: 330px; }

/* 공연 중: 사진·영상을 무대 가운데 큰 화면에 */
.live.has-media { padding: 0; }
.has-media .lv-badge { top: 86px; }
.ms-text { position: absolute; left: 50%; top: 250px; transform: translate(-50%, -50%); width: 1500px; flex-direction: row !important; justify-content: center; align-items: center; gap: 26px; }
.ms-text h2 { margin: 0 !important; white-space: nowrap; min-width: 0; }
.ms-text .chips { flex-wrap: nowrap; animation: none; }
.media-stage { position: absolute; left: 50%; top: 318px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ms-frame {
  position: relative; width: 896px; height: 504px;
  background: #1d1410; border: 10px solid #fff; border-radius: 26px;
  box-shadow: 0 0 0 6px var(--ink), 0 18px 0 6px rgba(90,59,46,.3), 0 30px 60px rgba(0,0,0,.25);
  overflow: hidden; animation: popIn .6s .1s cubic-bezier(.3, 1.5, .5, 1) both;
}
.ms-body { position: absolute; inset: 0; display: grid; place-items: center; }
.ms-body img, .ms-body video { width: 100%; height: 100%; object-fit: contain; background: #1d1410; display: block; }
.ms-msg { color: #fff; font-size: 40px; font-weight: 700; }
.ms-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 86px; height: 86px; border-radius: 50%; border: 5px solid var(--ink); background: rgba(255,255,255,.94); color: var(--ink); font-size: 36px; font-weight: 900; cursor: pointer; box-shadow: 0 6px 0 var(--ink); }
.ms-nav[data-ms="-1"] { left: 18px; }
.ms-nav[data-ms="1"] { right: 18px; }
.ms-nav:active { transform: translateY(calc(-50% + 4px)); box-shadow: 0 2px 0 var(--ink); }
.ms-full { position: absolute; right: 16px; top: 16px; z-index: 2; border: 4px solid var(--ink); background: rgba(255,255,255,.94); color: var(--ink); border-radius: 999px; padding: 4px 20px; font-size: 26px; font-weight: 800; cursor: pointer; }
.ms-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 150px; height: 150px; border-radius: 50%; border: 7px solid #fff; background: var(--coral); color: #fff; font-size: 62px; padding-left: 10px; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.ms-dots { display: flex; gap: 14px; }
.ms-dots i { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.75); border: 4px solid var(--ink); cursor: pointer; }
.ms-dots i.on { background: var(--tc); transform: scale(1.25); }
#stage.mc-on .ms-frame { width: 640px; height: 360px; }

/* 링크 단추 (진행 화면 오른쪽 위) */
.att-tray {
  position: absolute; top: 36px; right: 36px; width: 350px;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.94); border: 5px solid var(--ink); border-radius: 30px; box-shadow: 0 7px 0 var(--ink);
  padding: 14px 14px 16px;
  animation: rise .5s .4s ease-out both;
}
.tray-title { font-size: 30px; font-weight: 900; padding: 0 8px; }
.att-tray button {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 4px solid var(--ink); border-radius: 20px; background: var(--yellow);
  padding: 8px 16px; font-size: 28px; font-weight: 700; color: var(--ink);
  box-shadow: 0 5px 0 var(--ink); cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.att-tray button:nth-of-type(3n+2) { background: #bfe6ff; }
.att-tray button:nth-of-type(3n) { background: #c8f0e2; }
.att-tray button:hover { transform: translateY(-3px); }
.att-tray button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.att-tray .ti { flex: none; font-size: 34px; }
.att-tray .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 배경 음악 끄기·켜기 (여는·마치는 화면, 쉬는 시간) */
.bgm-btn {
  position: absolute; top: 36px; right: 36px; z-index: 6;
  display: flex; align-items: center; gap: 12px;
  border: 5px solid var(--ink); border-radius: 999px; background: #c8f0e2;
  padding: 10px 30px; font: inherit; font-size: 30px; font-weight: 700; color: var(--ink);
  box-shadow: 0 6px 0 var(--ink); cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .2s;
  animation: rise .5s .6s ease-out both;
}
.bgm-btn i { font-style: normal; font-size: 34px; display: inline-block; animation: bgmBob 1.1s ease-in-out infinite; }
.bgm-btn.off { background: #fff; color: var(--ink-soft); }
.bgm-btn.off i { animation: none; }
.bgm-btn:hover { transform: translateY(-3px); }
.bgm-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
@keyframes bgmBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.att-tray button:nth-of-type(n+6) { display: none; }

/* 자료 보기 창 (화면 전체) */
.viewer { position: absolute; inset: 0; z-index: 6; background: rgba(30, 20, 16, .94); display: flex; flex-direction: column; cursor: default; }
.viewer[hidden] { display: none; }
.vw-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; }
.vw-bar b { font-size: 1.25rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-bar button { border: 0; border-radius: 14px; background: rgba(255,255,255,.16); color: #fff; padding: 9px 16px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.vw-bar button:hover { background: rgba(255,255,255,.3); }
.vw-bar button.exit { background: var(--coral); }
.vw-bar button[hidden] { display: none; }
.vw-count { color: #fff; font-weight: 700; min-width: 50px; text-align: center; }
.vw-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 14px 8px; }
.vw-body img, .vw-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; background: #000; }
.vw-body iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.vw-msg { color: #fff; font-size: 1.4rem; font-weight: 700; text-align: center; line-height: 1.6; }
.vw-hint { margin: 0; padding: 0 16px 10px; color: rgba(255,255,255,.7); font-size: .9rem; text-align: center; min-height: 1px; }

/* 준비 화면: 무대 자료 목록 */
.att-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.att-empty { color: var(--ink-soft); font-weight: 500; font-size: .92rem; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 14px; background: #fffdf8; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fffdf8; }
.att.missing { border-color: #f3b0b8; background: #fff3f4; }
.att-thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #f3e7d8; display: grid; place-items: center; font-size: 28px; border: 2px solid var(--line); }
.att-thumb img, .att-thumb video { width: 100%; height: 100%; object-fit: cover; }
.att-thumb i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; color: #fff; font-size: 22px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.att-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.att-fields input { padding: 6px 10px !important; font-size: .95rem !important; }
.att-kind { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.att-btns { flex: none; display: flex; gap: 4px; }
.att-btns button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 9px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.att-btns button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.att-btns button:disabled { opacity: .35; cursor: default; }
.att-btns .danger { color: #d1495b; }
.att-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.att-add small { font-weight: 400; color: var(--ink-soft); font-size: .82rem; }

/* 다음 순서 띠 */
.next-strip {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; max-width: 1300px;
  background: rgba(255,255,255,.95); border: 5px solid var(--ink); border-radius: 999px;
  padding: 10px 40px 10px 12px; box-shadow: 0 7px 0 var(--ink);
  font-size: 38px; font-weight: 700; white-space: nowrap;
  animation: rise .5s .5s ease-out both;
}
.next-strip .ns-label { background: var(--yellow); border: 4px solid var(--ink); border-radius: 999px; padding: 0 22px; font-weight: 900; font-size: 32px; }
.next-strip img { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); }
.next-strip .ns-text { overflow: hidden; text-overflow: ellipsis; }
.next-strip .ns-perf { color: var(--ink-soft); font-weight: 500; }

/* 사회자 멘트 */
.mc-box {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%);
  width: 1500px; background: rgba(43, 29, 23, .9); color: #fff; border-radius: 34px;
  padding: 24px 40px 28px; font-size: 44px; font-weight: 500; line-height: 1.5; text-align: left;
  border: 5px solid var(--yellow);
}
.mc-box { bottom: 36px; }
.mc-box b { display: inline-block; background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 0 20px; font-size: 32px; font-weight: 900; margin-bottom: 8px; }
/* 멘트가 떠 있으면 무대 내용을 위로 올린다 */
#stage.mc-on .intro { padding-bottom: 300px; }
#stage.mc-on .intro .reveal-card { transform: scale(.9); }
#stage.mc-on .live { padding-bottom: 300px; }
#stage.mc-on .live:not(.has-media) .lv-badge { margin-bottom: 20px; }
#stage.mc-on .lv-ic { width: 170px; height: 170px; border-width: 6px; }
#stage.mc-on .live.has-photo .polaroid img { width: 260px; height: 260px; }

/* 아래 조작 막대 */
/* 조작 막대: 화면 왼쪽 가장자리의 세로 막대 (무대 글자와 겹치지 않게) */
.controls {
  position: absolute; left: 8px; top: 50%; transform: translate(calc(-100% - 20px), -50%);
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  background: rgba(43, 29, 23, .88); border-radius: 18px; padding: 8px 6px;
  transition: transform .25s ease;
  max-height: calc(100vh - 16px); overflow-y: auto; scrollbar-width: none;
}
#show.ui .controls { transform: translate(0, -50%); }
.ctl-group { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.ctl-group + .ctl-group { padding-top: 6px; border-top: 2px solid rgba(255,255,255,.18); }
.controls button {
  border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff;
  width: 62px; padding: 5px 2px 4px; font-weight: 700; font-size: 11.5px; line-height: 1.2; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.controls button i { font-style: normal; font-size: 17px; line-height: 1.2; }
@media (max-height: 640px) {
  .controls button { padding: 3px 2px; font-size: 10.5px; }
  .controls button i { font-size: 14px; }
}
.controls button:hover { background: rgba(255,255,255,.28); }
.controls button.main { background: var(--coral); }
.controls button.on { background: var(--mint); color: var(--ink); }
.controls button.exit { background: rgba(255,143,171,.35); }
.controls button:disabled { opacity: .35; cursor: default; }
.progress { color: #fff; font-weight: 700; font-size: 12px; text-align: center; padding: 1px 0; }

.jump { position: absolute; inset: 0; background: rgba(43, 29, 23, .6); display: grid; place-items: center; z-index: 5; cursor: default; }
.jump[hidden] { display: none; }
.jump-box { background: var(--cream); border: 3px solid var(--ink); border-radius: 26px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; }
.jump-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 2px dashed var(--line); font-size: 1.2rem; }
.jump-head button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 16px; font-weight: 700; }
#jumpList { list-style: none; margin: 0; padding: 10px; overflow: auto; }
#jumpList button { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 2px solid transparent; background: none; border-radius: 16px; padding: 9px 12px; font-size: 1.15rem; font-weight: 700; }
#jumpList button:hover { background: #fff; border-color: var(--line); }
#jumpList button.cur { background: #fff; border-color: var(--ink); }
#jumpList img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
#jumpList .jn { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--tc); color: #fff; display: grid; place-items: center; font-weight: 900; border: 2px solid var(--ink); font-size: .9rem; }
#jumpList .jp { color: var(--ink-soft); font-weight: 500; font-size: 1rem; margin-left: auto; white-space: nowrap; }
#jumpList button.cur { background: color-mix(in srgb, var(--tc) 18%, white); }

/* ───────── 오프닝 영상 (opening.js) ───────── */
.op-root { position: absolute; inset: 0; overflow: hidden; background: #0a0a0f; font-family: 'Paperlogy', sans-serif; color: #fff; }
.op-cam { transform-origin: 50% 50%; will-change: transform, filter; }
.op-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.op-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 80px 80px; -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 30%, transparent 85%); }
.op-dot { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; border-radius: 50%; }
.op-big { position: absolute; left: 50%; top: 52%; white-space: nowrap; font-family: 'Paperlogy', sans-serif; font-weight: 900; font-size: 420px; line-height: 1; letter-spacing: .02em; color: transparent; -webkit-text-stroke: 3px rgba(255,255,255,.075); }
.op-orbit { position: absolute; left: 50%; top: 56%; border: 2px solid; border-radius: 50%; }
.op-orbit-dot { position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; }
.op-flip { padding: 0 .3em; }
.op-hud { position: absolute; inset: 0; font-family: Consolas, 'Courier New', monospace; color: rgba(255,255,255,.8); font-size: 22px; letter-spacing: .12em; }
.op-hud .hud-bar { position: absolute; left: 60px; right: 60px; top: 34px; height: 4px; background: rgba(255,255,255,.12); border-radius: 2px; }
.op-hud .hud-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.op-hud .hud-bar b { position: absolute; top: -5px; width: 4px; height: 14px; border-radius: 2px; transform: translateX(-2px); }
.op-hud .hud-tl { position: absolute; left: 60px; top: 62px; display: flex; align-items: baseline; gap: 12px; transform-origin: 0 50%; }
.op-hud .hud-num { font-size: 44px; font-weight: 700; letter-spacing: 0; }
.op-hud .hud-of { color: rgba(255,255,255,.45); }
.op-hud .hud-en { font-weight: 700; color: #fff; }
.op-hud .hud-ko { font-family: 'Paperlogy', sans-serif; font-weight: 700; letter-spacing: 0; color: rgba(255,255,255,.7); font-size: 24px; }
.op-hud .hud-tr { position: absolute; right: 60px; top: 66px; color: rgba(255,255,255,.55); }
.op-hud .hud-tr em { font-style: normal; color: #ff5f6d; }
.op-hud .hud-bl { position: absolute; left: 60px; bottom: 40px; color: #ff5f6d; }
.op-hud .hud-bl span { color: rgba(255,255,255,.75); }
.op-hud .hud-br { position: absolute; right: 60px; bottom: 40px; font-family: 'Paperlogy', sans-serif; font-weight: 700; letter-spacing: .02em; color: rgba(255,255,255,.6); }
.op-flare { position: absolute; left: 0; width: 100%; height: 0; mix-blend-mode: screen; pointer-events: none; }
.op-flare i { position: absolute; left: 50%; top: 0; width: 2200px; height: 7px; border-radius: 4px; }
.op-flare b { position: absolute; left: 50%; top: 0; width: 220px; height: 220px; border-radius: 50%; }
.op-leak { position: absolute; top: -10%; bottom: -10%; left: 0; width: 100%; mix-blend-mode: screen; pointer-events: none; }
.op-scan { position: absolute; left: 0; top: 0; width: 100%; height: 3px; mix-blend-mode: screen; pointer-events: none; }
.op-reticle { position: absolute; }
.op-reticle .rc { position: absolute; width: 60px; height: 60px; border-style: solid; border-width: 0; }
.op-reticle .tl { left: 0; top: 0; border-top-width: 5px; border-left-width: 5px; }
.op-reticle .tr { right: 0; top: 0; border-top-width: 5px; border-right-width: 5px; }
.op-reticle .bl { left: 0; bottom: 0; border-bottom-width: 5px; border-left-width: 5px; }
.op-reticle .br { right: 0; bottom: 0; border-bottom-width: 5px; border-right-width: 5px; }
/* 스플릿: 같은 글자 두 장을 위·아래 반쪽씩 */
.op-word .sp { display: block; will-change: transform; }
.op-word .sp-a { clip-path: inset(-20% -5% 50% -5%); }
.op-word .sp-b { position: absolute; left: 0; top: 0; width: 100%; clip-path: inset(50% -5% -20% -5%); }
/* 모핑: 두 낱말을 한 자리에 겹쳐 녹이듯 바꾼다 */
.op-morph { width: 0; height: 0; }
.op-morph span { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity, filter; }
/* 카운트업 */
.op-count { text-align: center; line-height: 1; }
.op-count small { display: block; font-size: .3em; letter-spacing: .08em; margin-bottom: .15em; opacity: .9; }
.op-count b { display: block; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 스택 블록 */
.op-block { position: absolute; display: grid; place-items: center; border: 6px solid; border-radius: 26px; background: rgba(10,10,15,.66); color: #fff; font-weight: 800; white-space: nowrap; will-change: transform, opacity; }
.op-word .shine { position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); mix-blend-mode: screen; pointer-events: none; }
.op-word.mono { white-space: pre; }
.op-panel { grid-template-rows: auto auto; align-content: center; gap: 18px; }
.op-panel small { font-family: Consolas, 'Courier New', monospace; font-weight: 700; font-size: 34px; letter-spacing: .4em; text-align: center; }
/* 그레인: 화면보다 큰 판을 계단식으로 옮겨 지글거리게 (합성만 하므로 가벼움, 섞기 모드 없음) */
.op-grain { position: absolute; inset: -128px; opacity: .22; pointer-events: none; will-change: transform; animation: opGrain .5s steps(5) infinite; }
@keyframes opGrain { 0% { transform: translate3d(0,0,0); } 20% { transform: translate3d(-64px,32px,0); } 40% { transform: translate3d(48px,-80px,0); } 60% { transform: translate3d(-96px,-24px,0); } 80% { transform: translate3d(80px,96px,0); } 100% { transform: translate3d(0,0,0); } }
.op-vig { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 55%, rgba(0,0,0,.65) 100%); pointer-events: none; }
.op-layer { position: absolute; inset: 0; }
.op-fill { position: absolute; inset: 0; }
.op-word { position: absolute; white-space: nowrap; line-height: 1.1; letter-spacing: -.03em; will-change: transform, opacity; }
.op-word span { display: inline-block; will-change: transform; }
.op-word .ch { transform-origin: 50% 85%; backface-visibility: hidden; }
.op-word .mk { display: inline-block; }
.op-word .cur { font-weight: 400; margin-left: .04em; }
.op-word .echo { position: absolute; left: 0; top: 0; width: 100%; text-align: center; color: transparent !important; text-shadow: none !important; z-index: -1; pointer-events: none; }
.op-ring { position: absolute; border-style: solid; border-radius: 50%; transform: translate(-50%, -50%); }
.op-burst { position: absolute; width: 0; height: 0; }
.op-burst > div { position: absolute; left: -4px; bottom: 0; width: 8px; border-radius: 4px; transform-origin: 50% 100%; }
.op-sun { position: absolute; left: 50%; top: 50%; width: 2300px; height: 2300px; border-radius: 50%; will-change: transform, opacity; }
.op-marq { position: absolute; left: 0; white-space: nowrap; font-weight: 900; line-height: 1; letter-spacing: -.02em; color: transparent; }
.op-panel { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; }
.op-panel b { font-size: 190px; font-weight: 800; color: #fff; display: inline-block; }
.op-dash { position: absolute; left: 50%; top: 50%; width: 820px; height: 820px; border: 10px dashed; border-radius: 50%; }
.op-line { position: absolute; left: 50%; width: 1500px; height: 8px; border-radius: 4px; transform-origin: center; }
.op-skip { position: absolute; right: 40px; bottom: 34px; z-index: 3; background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; padding: 10px 28px; font-size: 30px; font-weight: 700; animation: opSkip 4s ease forwards; pointer-events: none; }
@keyframes opSkip { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ───────── 움직임 ───────── */
@keyframes popIn { from { opacity: 0; transform: scale(.4); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
@keyframes dropIn { from { opacity: 0; transform: translate(-50%, -80px); } }
@keyframes cardIn { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }
@keyframes spinIn { from { opacity: 0; transform: scale(.2) rotate(-200deg); } }
@keyframes photoIn { from { opacity: 0; transform: rotate(-25deg) scale(.5); } }
@keyframes bob { 50% { transform: translateY(-14px); } }
@keyframes wobble { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.05); } }
@keyframes pulse { 50% { transform: scale(1.05); } }

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

/* ───────── 좁은 화면 ───────── */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 350px minmax(0, 1fr); gap: 20px; padding: 22px 20px 60px; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .panel { padding: 18px 16px 20px; }
  .card-body { padding: 4px 12px 14px; }
  .topbar { padding: 10px 16px; }
}
@media (max-width: 600px) {
  .grid2 { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .h-meta, .head-btns button[data-act=up], .head-btns button[data-act=down] { display: none; }
  .att { flex-wrap: wrap; }
  .att-btns { width: 100%; justify-content: flex-end; }
  .ic { width: 42px; height: 42px; }
  .top-actions .btn.ghost { padding: 7px 12px; font-size: .88rem; }
}

/* ───────── 푸터 (timer.ggagossam.com과 같은 꼴) ───────── */
#foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; /* 스크롤과 상관없이 늘 화면 아래에 보임 */
  height: 26px; box-sizing: content-box; padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; line-height: 1; color: var(--ink-soft);
  background: var(--paper); border-top: 1px solid var(--line);
}
#foot i { width: 1px; height: 10px; display: block; background: var(--ink-soft); opacity: .4; }
#foot a { color: #0a8f77; text-decoration: none; font-weight: 700; }
#foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
