/* 하드웨어: 책상 위의 모니터와 조작 콘솔. 오프화이트 슬래브, 흑연색 패널, 강조색은 주황 하나. 모니터 안의 내용은 screen.css */

:root {
  --slab: #cfcbc1;
  --slab-hi: #dcd8cf;
  --slab-lo: #a9a59b;
  --plate: #262523;
  --plate-hi: #302f2c;
  --seam: #0c0b0a;
  --panel-edge: inset 0 1px 0 rgba(255, 255, 255, .17), inset 0 -1px 0 rgba(0, 0, 0, .5);
  --alu: #bdbab1;
  --alu-hi: #d6d3ca;
  --alu-lo: #8c897f;
  --ink: #171614;
  --bone: #d9d4c7;
  --bone-dim: #8f8b80;
  --signal: #e8501f;
  --amber: #ffb000;
  --orange: var(--signal);
  --hw-font: 'Michroma', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --ko-font: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --pen-font: 'TapePen', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --seg-font: 'DSEG7', monospace;
  /* 무광 도장의 미세한 입자 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
html { background: #0e0d0c; -webkit-text-size-adjust: 100%; }
body {
  font: 14px/1.45 'Galmuri14', 'Malgun Gothic', sans-serif; color: var(--bone); background: #0e0d0c;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
img { display: block; }
p { margin: 0; }
h2, h3, h4 { margin: 0; font-size: inherit; font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.px, canvas { image-rendering: pixelated; }
.noscript { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; background: #000; color: var(--amber); }
.bgm-video { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---- 배치 ---- */
#rig { position: fixed; inset: 0; display: flex; gap: 10px; padding: 10px; overflow: hidden; }
#monitor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#console { position: relative; flex: none; width: 432px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; scrollbar-width: thin; background: var(--seam); }
/* 나란히 놓을 때는 쪽 구분 없이 한 판으로 쌓는다 */
.console-pages, .console-page { display: contents; }
[data-layout='wide'] .console-head { order: 1; }
[data-layout='wide'] .mod-program { order: 2; }
[data-layout='wide'] .row-links { order: 3; }
[data-layout='wide'] .row-grille { order: 4; }
[data-layout='wide'] .mod-bgm { order: 5; }
[data-layout='wide'] .main-grille { order: 6; }
[data-layout='wide'] .row-info { order: 7; }
[data-layout='wide'] .row-service { order: 8; }
.page-fill, .page-dots { display: none; }
/* 위아래 놓을 때: 모니터 아래에서 콘솔을 좌우로 넘긴다. 빈 곳은 스피커 망으로 채운다 */
[data-layout='stacked'] #rig { flex-direction: column; overflow-y: auto; padding: 6px; gap: 6px; }
[data-layout='stacked'] #monitor { flex: 1 1 auto; min-height: 300px; }
[data-layout='stacked'] #console { width: 100%; overflow: hidden; gap: 0; }
[data-layout='stacked'] .console-pages { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
[data-layout='stacked'] .console-pages::-webkit-scrollbar { display: none; }
[data-layout='stacked'] .console-page { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; scroll-snap-stop: always; }
[data-layout='stacked'] .page-fill { display: block; flex: 1 1 0; min-height: 0; }
[data-layout='stacked'] .row-grille { display: none; }
[data-layout='stacked'] .main-grille { display: none; }
[data-layout='stacked'] .page-dots { flex: none; display: flex; justify-content: center; gap: 2px; background: var(--plate); }
.page-dot { width: 34px; height: 22px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
.page-dot::before { content: ''; width: 16px; height: 3px; background: #4a463f; }
.page-dot.on::before { background: var(--signal); box-shadow: 0 0 6px 1px rgba(232, 80, 31, .75); }
.page-dot:focus-visible { outline: 1px solid var(--signal); outline-offset: -2px; }
.fader { touch-action: pan-y; }

/* ---- 모니터 본체 ---- */
#monitor {
  position: relative; overflow: hidden; padding: 12px 14px 8px;
  background: var(--grain), linear-gradient(180deg, var(--slab-hi), var(--slab) 8%, var(--slab) 92%, var(--slab-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .4);
}
.mon-vents { display: none; }
.mon-bezel {
  flex: 1; min-height: 0; padding: 18px; background: #111010;
  box-shadow: 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .55), inset 0 0 18px #000;
}
#glass {
  /* 주사선과 그림자는 유리 안에서만. 앞으로 올라오는 턴테이블과 규칙 종이는 그 위에 놓인다 */
  position: relative; isolation: isolate; height: 100%; overflow: hidden; border-radius: 16px / 20px; container-type: size;
  background: var(--ph-bg); color: var(--ph); box-shadow: 0 0 0 1px #000;
}
#crt, #sheen { position: absolute; inset: 0; z-index: 60; pointer-events: none; border-radius: inherit; }
#crt { box-shadow: inset 0 0 60px rgba(0, 0, 0, .5); }
.crt-on #crt { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px); }
#sheen { background: linear-gradient(115deg, rgba(255, 255, 255, .045), transparent 24%); }
.off #glass > :not(#boot, #crt, #sheen) { visibility: hidden; }
.off #glass { background: #090a09; }
#glass.collapsing > * { animation: crt-off .5s steps(10) forwards; }
@keyframes crt-off {
  60% { transform: scale(1, .004); filter: brightness(4); }
  100% { transform: scale(0, .004); filter: brightness(0); }
}

/* 테이프를 읽는 도스 화면 */
#loader { position: absolute; inset: 0; z-index: 40; display: none; padding: 18px 24px; overflow: hidden; color: var(--ph); font: 24px/30px 'GalmuriMono11', monospace; text-shadow: 0 0 5px var(--ph-glow); white-space: pre; }
#loader.on { display: block; }
#loader p { min-height: 1lh; }
@container (max-width: 700px) {
  #loader { padding: 10px 12px; font-size: 12px; line-height: 16px; }
}
#glass.at-edge, #glass.at-edge * { cursor: ew-resize !important; }
.tape { animation: tape-wipe .2s steps(14); }
.tape.swiped { animation: none; }
@keyframes tape-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

.mon-chin { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 0 0; }
.ticker {
  flex: 1; min-width: 0; height: 24px; overflow: hidden; display: flex; align-items: center; padding: 0 8px; background: #0d0a05;
  box-shadow: 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .5); color: var(--amber); font: 12px/1 'Galmuri11', sans-serif; text-shadow: 0 0 5px rgba(255, 176, 0, .55); white-space: nowrap;
}
.ticker.live { cursor: pointer; color: #ff5a3c; text-shadow: 0 0 5px rgba(255, 70, 40, .7); }
.ticker-text { display: inline-block; padding-left: 100%; }
.ticker-text.run { animation: ticker var(--ticker-time, 14s) linear; }
@keyframes ticker { to { transform: translateX(-100%); } }
.off .ticker-text { visibility: hidden; }
.plate {
  flex: none; padding: 4px 10px; color: var(--ink); text-align: right; font: 700 8.5px/1.35 var(--hw-font); letter-spacing: .3px; cursor: pointer;
  background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.plate:active { transform: translateY(1px); }

/* ---- 콘솔 공통: 얇은 틈으로 나뉜 한 장의 금속판 ---- */
.module, .console-head { position: relative; flex: none; }
.module {
  padding: 30px 12px 11px;
  background: var(--grain), var(--plate); box-shadow: var(--panel-edge);
}
.module-title { position: absolute; left: 12px; top: 11px; font: 700 8.5px/1 var(--hw-font); color: var(--bone); letter-spacing: 1.6px; }
.mod-program .module-title::after { content: ''; position: absolute; left: calc(100% + 10px); top: 2.5px; width: 66px; height: 3px; background: linear-gradient(90deg, var(--signal) 0 33%, #d9a93a 33% 66%, #3d7d84 66%); }
.silk { font: 700 7.5px/1 var(--hw-font); color: var(--bone); letter-spacing: .5px; white-space: nowrap; text-align: center; }
.silk.tiny { font-size: 6.5px; color: var(--bone-dim); }
.dymo {
  display: inline-block; padding: 2px 7px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: #0d0c0b; color: var(--bone); font: 700 9.5px/1.3 var(--hw-font); letter-spacing: .5px; box-shadow: 0 0 0 1px #000;
}

/* 램프 */
.lamp { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2a2622; box-shadow: 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .12); }
.lamp.red.on { background: #ff3a2a; box-shadow: 0 0 0 1px #000, 0 0 9px 2px rgba(255, 58, 42, .75); }
.lamp.green.on { background: #ffb000; box-shadow: 0 0 0 1px #000, 0 0 8px 2px rgba(255, 176, 0, .7); }
.lamp.amber.on { background: #ffb000; box-shadow: 0 0 0 1px #000, 0 0 8px 2px rgba(255, 176, 0, .7); }

/* 7세그먼트: 앰버 하나로 통일 */
.seg { position: relative; display: inline-block; padding: 4px 6px; background: #080705; box-shadow: 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .1); font: 700 16px/1 var(--seg-font); color: var(--amber); text-shadow: 0 0 6px rgba(255, 176, 0, .55); }
.seg-ghost { opacity: .08; }
.seg-on { position: absolute; right: 6px; top: 4px; white-space: nowrap; }
/* 다음 방송 카운트다운: 시계와 구분되게 살짝 주황빛 */
.seg.next { color: #ff9416; text-shadow: 0 0 6px rgba(255, 148, 22, .55); }
/* 방송 중: 여섯 글자라 조금 작게, 칸 가운데에 */
.seg.next.live .seg-ghost { visibility: hidden; }
.seg.next.live .seg-on { left: 0; right: 0; top: 50%; transform: translateY(-50%); font-size: .76em; line-height: 1; text-align: center; }
.off .seg-on { visibility: hidden; }

/* 노브: 절삭 알루미늄 */
.knob { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.knob-dial { position: relative; display: block; width: 52px; height: 52px; touch-action: none; cursor: grab; outline: none; border-radius: 50%; }
.knob-dial:active { cursor: grabbing; }
.knob-dial.sm { width: 36px; height: 36px; }
.knob-cap {
  position: absolute; inset: 8px; border-radius: 50%;
  background: repeating-conic-gradient(#46443f 0 3deg, #5d5b55 3deg 6deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .8), 0 0 0 1px #000;
}
.knob-dial.sm .knob-cap { inset: 6px; }
.knob-cap::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: conic-gradient(from 40deg, #e4e1d8, #8f8c82 18%, #d4d1c8 34%, #807d74 52%, #dad7ce 68%, #87847b 84%, #e4e1d8); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.knob-mark { position: absolute; z-index: 1; left: calc(50% - 1px); top: 9%; width: 2px; height: 36%; background: var(--ink); }
.knob-dial:focus-visible .knob-cap { box-shadow: 0 2px 3px rgba(0, 0, 0, .8), 0 0 0 2px var(--signal); }
.knob-ticks { position: absolute; inset: 0; }
.knob-ticks i { position: absolute; left: calc(50% - .5px); top: 0; width: 1px; height: 4px; background: var(--bone); transform-origin: 50% 26px; opacity: .75; }
.knob-dial.sm .knob-ticks i { height: 3px; transform-origin: 50% 18px; }
/* 물방울 손잡이: 뾰족한 쪽이 가리키는 곳이 고른 번호 */
.knob-dial.drop .knob-cap { background: none; box-shadow: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .85)); }
.knob-dial.drop .knob-cap::before { inset: 0; border-radius: 50% 50% 50% 0; transform: rotate(135deg); background: radial-gradient(circle at 60% 40%, #5a5853, #1e1d1b 72%); box-shadow: inset 0 0 0 1px #000; }
.knob-dial.drop .knob-mark { top: -20%; height: 58%; background: var(--bone); }
.knob-dial.drop:focus-visible .knob-cap { box-shadow: none; filter: drop-shadow(0 0 2px var(--signal)); }
.knob-read { min-height: 11px; font: 700 7.5px/11px var(--hw-font); color: var(--bone-dim); white-space: nowrap; }

/* 똑딱 스위치 */
.toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.toggle { position: relative; width: 26px; height: 42px; padding: 0; border: 0; background: none; }
.toggle-nut {
  position: absolute; left: 3px; top: 11px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, #0d0c0a 0 22%, #5d5b55 24% 34%, transparent 36%), conic-gradient(from 20deg, #c9c6bd, #6f6c64, #dedbd2, #66635c, #c9c6bd, #6f6c64, #dedbd2, #66635c, #c9c6bd);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 0 1px #0a0908;
}
.toggle-bat {
  position: absolute; z-index: 1; left: 7.5px; top: 1px; width: 11px; height: 20px; transform-origin: 50% 20px;
  clip-path: polygon(0 16%, 8% 6%, 26% 0, 74% 0, 92% 6%, 100% 16%, 66% 100%, 34% 100%);
  background: linear-gradient(90deg, #66635b, #f2efe7 38%, #c9c6bc 60%, #55524b);
  transition: transform .05s linear; transform: scaleY(-1);
}
.toggle.on .toggle-bat { transform: none; }
.toggle:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
.toggle.sm { width: 22px; height: 32px; }
.toggle.sm .toggle-nut { left: 3px; top: 8px; width: 16px; height: 16px; }
.toggle.sm .toggle-bat { left: 6.5px; top: 1px; width: 9px; height: 15px; transform-origin: 50% 15px; }

/* 누르는 키: 납작한 무광 캡 */
.key {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 3px 4px 5px; border: 0; color: var(--ink);
  background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu));
  box-shadow: 0 2px 0 var(--alu-lo), 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .55);
}
.key:active, .key.down { transform: translateY(2px); box-shadow: 0 0 0 #000, 0 1px 0 #000, inset 0 1px 2px rgba(0, 0, 0, .3); }
.key-top { font: 700 11px/1.1 var(--hw-font); }
.key-sub { font: 700 6.5px/1 var(--hw-font); letter-spacing: .3px; }
.key.orange { background: var(--grain), var(--signal); color: #120702; box-shadow: 0 2px 0 #8e2e10, 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .3); }
.key.orange:active { box-shadow: 0 0 0 #000, 0 1px 0 #000, inset 0 1px 2px rgba(0, 0, 0, .3); }
/* 눌려 있는 동안 윗면 띠에 불이 들어온다 */
.key.green.down::before { content: ''; position: absolute; left: 22%; right: 22%; top: 3px; height: 2px; background: var(--signal); box-shadow: 0 0 5px 1px rgba(232, 80, 31, .7); }
.key:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
.key.jammed { filter: brightness(.65); }

/* ---- 윗줄: 알루미늄 판 ---- */
.console-head {
  display: flex; flex-direction: column; gap: 5px; padding: 7px 12px; color: var(--ink);
  background: var(--grain), repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, rgba(0, 0, 0, .025) 1px 2px), linear-gradient(180deg, var(--alu-hi), var(--alu));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.console-head .silk { color: var(--ink); }
.console-title { display: flex; align-items: center; justify-content: center; gap: 10px; font: 700 13px/1 var(--hw-font); letter-spacing: 2.2px; color: var(--ink); white-space: nowrap; }
.console-title::before, .console-title::after { content: ''; flex: 1; height: 1px; background: rgba(0, 0, 0, .4); box-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
/* 다섯 칸 모두 글씨 줄과 부품 줄의 높이가 같아서 가운데가 한 선에 놓인다 */
.head-row { display: flex; align-items: flex-end; justify-content: space-evenly; gap: 6px; }
.clock-cell { width: 84px; }
.head-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: inherit; }
.head-cell > .silk { height: 8px; font-size: 6px; line-height: 8px; white-space: nowrap; }
.head-ctl { position: relative; display: grid; place-items: center; height: 30px; }
.console-head .clock-date { color: #47453f; }
.air .lamp { width: 11px; height: 11px; }
.keyswitch { position: relative; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: conic-gradient(from 30deg, #eeebe3, #8f8c82, #dad7ce, #7f7c73, #eeebe3); box-shadow: 0 0 0 1px #000, 0 1px 2px rgba(0, 0, 0, .6); }
.keyswitch-slot { position: absolute; left: 11.5px; top: 5px; width: 3px; height: 16px; background: #0c0b0a; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); transition: transform .12s; }
.keyswitch.turned .keyswitch-slot { transform: rotate(90deg); }
.keyswitch:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
.adminkey .lamp { position: absolute; right: -8px; top: 1px; width: 6px; height: 6px; }
.powerbox { position: relative; }
.power-lamp { position: absolute; right: 2px; top: 11px; width: 7px; height: 7px; }

/* 전원 열쇠: 끌어서 돌린다 */
.lock-wrap { width: 68px; }
.lock-on { position: absolute; left: calc(50% + 19px); bottom: 2px; font-size: 6px; color: #47453f; }
.console-head .lock-on { color: #47453f; }
.lock { position: relative; z-index: 6; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; touch-action: none; cursor: grab; background: conic-gradient(from 30deg, #eeebe3, #8f8c82, #dad7ce, #7f7c73, #eeebe3); box-shadow: 0 0 0 1px #000, 0 2px 3px rgba(0, 0, 0, .55); }
.lock:active { cursor: grabbing; }
.lock:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
.off .lock { animation: power-call 1.4s steps(2) infinite; }
@keyframes power-call { 50% { box-shadow: 0 0 0 2px var(--signal), 0 0 12px 2px var(--signal); } }
.lock-cylinder { position: absolute; inset: 5px; border-radius: 50%; background: #171614; box-shadow: inset 0 1px 2px #000, 0 0 0 1px #000; }
.lock-key { position: absolute; left: 15px; top: 15px; width: 0; height: 0; transform: rotate(var(--turn, 0deg)); }
.lock-key.settle { transition: transform .2s cubic-bezier(.3, 1.3, .5, 1); }
.lock-blade { position: absolute; left: -2px; top: -5px; width: 4px; height: 14px; background: linear-gradient(90deg, #8c897f, #f2efe7, #8c897f); box-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.lock-bow { position: absolute; left: -10px; top: 8px; width: 20px; height: 14px; border-radius: 2px; background: radial-gradient(circle at 50% 68%, transparent 0 3px, #cfccc3 3.5px), linear-gradient(135deg, #f2efe7, #8c897f); box-shadow: 0 2px 3px rgba(0, 0, 0, .75); }
/* 키링은 열쇠가 돌아가도 늘 아래로 늘어진다 */
.key-ring { position: absolute; left: 0; top: 18px; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; transform: rotate(calc(var(--turn, 0deg) * -1)); }
.key-ring.settle { transition: transform .2s; }
.key-swing { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.key-swing::before { content: ''; position: absolute; left: -6px; top: -1px; width: 12px; height: 12px; border: 1.5px solid #c9c6bd; border-radius: 50%; box-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.key-chain { position: absolute; left: -.5px; top: 11px; width: 1px; height: 9px; background: #c9c6bd; }
/* 입체로 흔들리는 키링. 변형만 움직여서 화면 합성기가 처리하므로 부담이 거의 없다 */
.key-ring { perspective: 90px; }
.key-swing { transform-style: preserve-3d; animation: fob-sway 2.6s ease-in-out infinite; }
.key-fob { position: absolute; left: -14px; top: 18px; width: 28px; height: 28px; display: block; transform-origin: 50% 0; transform-style: preserve-3d; will-change: transform; animation: fob-twist 3.7s ease-in-out infinite; }
.key-fob img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; backface-visibility: visible; }
.key-fob img:not(:last-child) { filter: brightness(.42); }
@keyframes fob-sway {
  0%, 100% { transform: rotateZ(-5deg) rotateX(9deg); }
  50% { transform: rotateZ(5deg) rotateX(-9deg); }
}
@keyframes fob-twist {
  0%, 100% { transform: rotateY(-34deg); }
  50% { transform: rotateY(34deg); }
}

/* ---- 프로그램 덱: 왼쪽에 얇은 슬롯과 키, 오른쪽에 카세트 목록 ---- */
.program-row { display: flex; align-items: stretch; gap: 8px; }
.program-left { flex: none; width: 124px; display: flex; flex-direction: column; gap: 7px; }
/* 눕혀서 넣는 슬롯 */
.door { position: relative; flex: none; height: 30px; overflow: hidden; background: #0d0c0b; box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255, 255, 255, .08); perspective: 200px; }
.slot-mouth { position: absolute; left: 7px; right: 7px; top: 11px; height: 8px; background: #000; box-shadow: inset 0 2px 2px #000, 0 1px 0 rgba(255, 255, 255, .14), 0 -1px 0 rgba(0, 0, 0, .9); }
.slot-spine { position: absolute; left: 7px; right: 7px; top: 6px; height: 18px; display: flex; align-items: center; gap: 4px; padding: 0 5px; overflow: hidden; color: var(--ink); background: linear-gradient(180deg, #3a3936 0 2px, var(--bone) 2px 16px, #3a3936 16px); transition: transform .18s cubic-bezier(.3, .8, .3, 1), opacity .12s; }
.door[data-state='empty'] .slot-spine { transform: translateY(-120%); opacity: 0; }
.slot-icon { flex: none; width: 13px; height: 13px; filter: saturate(.32) contrast(.92); }
.slot-title { min-width: 0; overflow: hidden; white-space: nowrap; font: 700 9.5px/1 var(--ko-font); }
/* 투명한 사각 덮개: 넣고 뺄 때 위쪽 경첩으로 살짝 들린다 */
.door-glass { position: absolute; inset: 2px; pointer-events: none; transform-origin: 50% 0; background: linear-gradient(118deg, rgba(255, 255, 255, .2) 0 16%, rgba(255, 255, 255, .03) 26% 70%, rgba(255, 255, 255, .09) 88%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), inset 0 -3px 4px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .6); }
.door.taking .door-glass { animation: flap-lift .34s ease-out; }
@keyframes flap-lift { 35% { transform: rotateX(-52deg); } }
.door.deny { animation: door-deny .3s steps(4); }
@keyframes door-deny { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.program-keys { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding-bottom: 3px; }
.program-keys .key { min-height: 34px; }
.program-keys .key-top { font-size: 9.5px; }

/* 카세트 목록: 한 줄에서 찰칵찰칵 넘어간다 */
.slide-unit { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 3px; }
.slide-key { flex: none; width: 20px; padding: 0; }
.slide-key .key-top { font-size: 8px; }
.slide-gate { position: relative; flex: 1; min-width: 0; height: 74px; overflow: hidden; touch-action: pan-y; cursor: grab; background: #0a0908; box-shadow: inset 0 0 0 1px #000, inset 0 2px 6px #000; }
.slide-gate:active { cursor: grabbing; }
.slide-gate.snap .slide-strip { animation: slide-snap .13s steps(3); }
@keyframes slide-snap { 50% { transform: translateY(2px); } }
.slide-strip { position: absolute; inset: 0; }
.slide {
  position: absolute; left: calc(50% - 56px); top: calc(50% - 31px); width: 112px; height: 62px; padding: 0; border: 0; background: none; color: var(--ink); --u: .96px;
  transition: transform .12s cubic-bezier(.2, 1.4, .4, 1), opacity .1s, filter .1s; filter: brightness(.36);
}
.slide .cas { cursor: inherit; }
.slide.jump { transition: none; }
.slide.far { opacity: 0; pointer-events: none; }
.slide.center { z-index: 2; filter: none; }
.slide.center .cas { box-shadow: 0 0 0 1px #000, 0 2px 10px 2px rgba(0, 0, 0, .85), 0 0 12px rgba(255, 244, 214, .2); }
.slide:focus-visible { outline: 1px solid var(--signal); outline-offset: 1px; }
/* 지금 슬롯에 들어가 있는 테이프는 빈 자리가 되고 표시등이 켜진다 */
.slide.out .cas { background: #0a0908; box-shadow: inset 0 0 0 1px #3a3936, inset 0 0 0 4px #121110, inset 0 0 0 5px #24231f; }
.slide.out .cas > * { visibility: hidden; }
.slide-empty { display: none; }
.slide.out .slide-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 700 8.5px/1 var(--hw-font); letter-spacing: 1.2px; color: var(--amber); text-shadow: 0 0 5px rgba(255, 176, 0, .5); }
.slide-empty b { font-weight: 700; }
.slide-empty i { width: 12px; height: 3px; margin-bottom: 1px; background: var(--amber); box-shadow: 0 0 5px 1px rgba(255, 176, 0, .55); }

/* ---- 바로가기: 손을 올리면 버튼이 튀어나온다 ---- */
.mod-links { flex: 1 1 0; min-width: 0; }
.link-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
/* 키 하나에 사진과 이름이 함께 있다: 금속 윗면에 오린 사진을 테이프로 붙이고, 아래에 이름 홈을 팠다 */
.link-key { position: relative; display: block; min-width: 0; padding-bottom: 3px; color: var(--ink); text-decoration: none; outline: none; perspective: 240px; }
.link-body {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px 4px 3px;
  background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); box-shadow: 0 2px 0 var(--alu-lo), 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .09s cubic-bezier(.2, 1.6, .4, 1), box-shadow .09s;
}
.link-key:hover, .link-key:focus-visible { z-index: 8; }
.link-key:hover .link-body, .link-key:focus-visible .link-body { transform: translateY(-2px); box-shadow: 0 3px 0 var(--alu-lo), 0 4px 0 #000, 0 7px 7px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .55); }
.link-key:active .link-body { transform: translateY(2px); box-shadow: 0 0 0 #000, 0 1px 0 #000, inset 0 1px 2px rgba(0, 0, 0, .3); }
/* 투명 뚜껑: 키캡처럼 위로 좁아지는 유리 캡. 네 경사면의 밝기가 달라 입체로 보이고, 윗면에 반사광이 지난다.
   평소 닫혀 있어 색이 빠져 보이고, 손을 올리면 위쪽 경첩으로 들린다 */
.link-lid {
  position: absolute; left: -2px; right: -2px; top: -2px; bottom: 1px; pointer-events: none; transform-origin: 50% 0;
  border: 5px solid; border-color: rgba(255, 255, 255, .42) rgba(255, 255, 255, .14) rgba(0, 0, 0, .24) rgba(255, 255, 255, .26); background-clip: padding-box;
  background-image: linear-gradient(128deg, rgba(255, 255, 255, .36) 0 15%, rgba(255, 255, 255, .06) 29%, rgba(255, 255, 255, .02) 58%, rgba(255, 255, 255, .18) 73%, rgba(255, 255, 255, .03) 87%);
  background-color: rgba(18, 18, 16, .12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .48), 0 2px 4px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .42);
  transition: transform .2s cubic-bezier(.3, 1.3, .5, 1), opacity .2s;
}
.link-key:hover .link-lid, .link-key:focus-visible .link-lid, .link-key:active .link-lid { transform: rotateX(76deg); opacity: .75; }
.link-key:focus-visible .link-body { outline: 1px solid var(--signal); outline-offset: 1px; }
/* 가위로 오린 사진. 버튼마다 기울기와 테이프 자리가 다르다 */
.link-photo { position: relative; display: block; width: 76%; align-self: center; transform: rotate(var(--tilt, 0deg)); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.link-cut { display: block; padding: 2px; background: #efe9dc; clip-path: var(--cut, none); }
.link-tape {
  position: absolute; width: 58%; height: 7px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 3px), linear-gradient(180deg, rgba(240, 229, 190, .72), rgba(222, 208, 160, .6));
  clip-path: polygon(0 0, 100% 0, 95% 17%, 100% 33%, 95% 50%, 100% 67%, 95% 83%, 100% 100%, 0 100%, 5% 83%, 0 67%, 5% 50%, 0 33%, 5% 17%);
}
.link-key:nth-child(1) { --tilt: -2.4deg; --cut: polygon(1% 2%, 99% 0, 100% 97%, 3% 100%); }
.link-key:nth-child(1) .link-tape:nth-of-type(1) { left: -22%; top: -4%; transform: rotate(-38deg); }
.link-key:nth-child(1) .link-tape:nth-of-type(2) { right: -22%; top: -4%; transform: rotate(36deg); }
.link-key:nth-child(2) { --tilt: 1.8deg; --cut: polygon(0 1%, 98% 3%, 100% 100%, 2% 98%); }
.link-key:nth-child(2) .link-tape:nth-of-type(1) { left: 21%; top: -9%; transform: rotate(-3deg); }
.link-key:nth-child(2) .link-tape:nth-of-type(2) { display: none; }
.link-key:nth-child(3) { --tilt: -1.2deg; --cut: polygon(2% 0, 100% 2%, 98% 100%, 0 97%); }
.link-key:nth-child(3) .link-tape:nth-of-type(1) { left: -22%; top: -3%; transform: rotate(-42deg); }
.link-key:nth-child(3) .link-tape:nth-of-type(2) { right: -14%; bottom: 7%; width: 44%; transform: rotate(-40deg); }
.link-key:nth-child(4) { --tilt: 2.6deg; --cut: polygon(0 3%, 97% 0, 100% 98%, 3% 100%); }
.link-key:nth-child(4) .link-tape:nth-of-type(1) { right: -22%; top: -4%; transform: rotate(40deg); }
.link-key:nth-child(4) .link-tape:nth-of-type(2) { left: -14%; bottom: 7%; width: 44%; transform: rotate(38deg); }
.link-key:nth-child(5) { --tilt: -1.8deg; --cut: polygon(3% 1%, 100% 0, 98% 98%, 0 100%); }
.link-key:nth-child(5) .link-tape:nth-of-type(1) { left: 19%; top: -9%; transform: rotate(4deg); }
.link-key:nth-child(5) .link-tape:nth-of-type(2) { display: none; }
.link-face { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #0d0c0b; filter: saturate(.3); transition: filter .15s; }
/* 뚜껑이 열리면 원래 색이 돌아온다 */
.link-key:hover .link-face, .link-key:focus-visible .link-face, .link-key:active .link-face { filter: none; }
.link-face.logo { display: grid; place-items: center; }
.link-face.logo img { width: 72%; height: 72%; }
/* 이름은 판 안쪽으로 파낸 홈에 들어간다 */
.link-name { padding: 1px 0 2px; text-align: center; font: 700 8px/1.1 var(--ko-font); white-space: nowrap; color: #ece7d9; background: #33312c; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .6); }

/* ---- 시작 안내와 리셋: 투명 케이스를 씌운 시소 스위치. 위아래는 링크 버튼과 맞춘다 ---- */
.mod-start { flex: none; width: 66px; display: flex; align-items: stretch; }
.row-links .module { padding: 25px 10px 7px; }
.row-links .module-title { left: 10px; top: 8px; }
.start-case { position: relative; flex: 1; min-width: 0; display: flex; padding: 3px; perspective: 260px; background: #171614; box-shadow: inset 0 1px 3px #000, 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .1); }
.start-case .rocker { flex: 1; width: auto; }
.start-case .rocker-cap { min-height: 0; }
.start-case .rocker-half { padding-top: 6px; font: 700 5.6px/1 var(--hw-font); letter-spacing: 0; }
.start-case .reset-key { color: #5b1e0d; }
.start-case .rocker-cap[data-on='none'] { transform: none; }
/* 처음 켰을 때 테이프가 없는 동안 먼저 눌러 보라고 깜빡인다 */
.start-key.lit .rocker-led { background: var(--signal); box-shadow: 0 0 6px 1px rgba(232, 80, 31, .8); }
.start-key { position: relative; z-index: 1; }
.start-key.call { animation: start-call .9s ease-in-out infinite; }
.start-key.call .rocker-led { background: #fff2e4; box-shadow: 0 0 6px 2px rgba(255, 170, 110, .95); }
@keyframes start-call {
  0%, 100% { background: var(--grain), #e8501f; color: #190902; box-shadow: 0 0 8px 2px rgba(232, 80, 31, .75); }
  50% { background: var(--grain), #ff8040; color: #190902; box-shadow: 0 0 20px 7px rgba(255, 110, 50, 1), inset 0 0 8px rgba(255, 225, 200, .8); }
}
.mod-start:has(.start-key.call) .module-title { color: #ff8a55; text-shadow: 0 0 6px rgba(255, 96, 36, .8); }
/* 위쪽 경첩으로 열리는 투명 케이스. 눌러도 스위치까지 그대로 닿는다 */
.case-lid {
  position: absolute; inset: -1px; pointer-events: none; transform-origin: 50% 0;
  background: linear-gradient(128deg, rgba(255, 255, 255, .26) 0 12%, rgba(255, 255, 255, .03) 24%, rgba(255, 255, 255, .02) 72%, rgba(255, 255, 255, .13) 88%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34), inset 0 3px 0 rgba(255, 255, 255, .14), 0 2px 5px rgba(0, 0, 0, .4);
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1);
}
.start-case:hover .case-lid { transform: rotateX(22deg); }
.start-case.cover-open .case-lid { transform: rotateX(68deg) translateY(-2px); }

/* 카세트: 무채색. 라벨에 아이콘과 제목 */
.cas {
  position: relative; display: block; width: 100%; height: 100%; color: var(--ink);
  background: linear-gradient(180deg, #33322f, #222120); box-shadow: 0 0 0 1px #000;
}
.cas-label { position: absolute; left: 5%; right: 5%; top: 7%; height: 42%; display: flex; align-items: center; gap: calc(var(--u, 1px) * 4); padding: 0 calc(var(--u, 1px) * 4); overflow: hidden; background: var(--bone); }
.cas-icon { flex: none; width: calc(var(--u, 1px) * 19); height: calc(var(--u, 1px) * 19); filter: saturate(.32) contrast(.92); }
.cas-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; font: 700 calc(var(--u, 1px) * 10.5)/1.1 var(--ko-font); text-align: left; }
.cas-window { position: absolute; left: 22%; right: 22%; top: 55%; height: 27%; display: block; overflow: hidden; background: #0a0908; box-shadow: inset 0 1px 2px #000, 0 0 0 1px rgba(255, 255, 255, .08); }
.cas-pack { position: absolute; top: 50%; border-radius: 50%; background: #2a221c; }
.cas-pack:nth-of-type(1) { left: 25%; width: calc(var(--u, 1px) * (14 + 22 * var(--left, .6))); height: calc(var(--u, 1px) * (14 + 22 * var(--left, .6))); transform: translate(-50%, -50%); }
.cas-pack:nth-of-type(2) { left: 75%; width: calc(var(--u, 1px) * (14 + 22 * var(--right, .4))); height: calc(var(--u, 1px) * (14 + 22 * var(--right, .4))); transform: translate(-50%, -50%); }
.cas-hub { position: absolute; top: calc(50% - var(--u) * 5.5); width: calc(var(--u, 1px) * 11); height: calc(var(--u, 1px) * 11); border-radius: 50%; background: repeating-conic-gradient(#d9d4c7 0 30deg, #3e3c37 30deg 60deg); box-shadow: 0 0 0 1px #000; }
.cas-hub:nth-of-type(3) { left: calc(25% - var(--u) * 5.5); }
.cas-hub:nth-of-type(4) { left: calc(75% - var(--u) * 5.5); }
.cas-foot { position: absolute; left: 24%; right: 24%; bottom: 0; height: 12%; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); background: #141312; }
@keyframes reel { to { transform: rotate(-360deg); } }
/* 가운데로 온 테이프는 릴이 돌아간다 */
.slide.center:not(.out) .cas-hub { animation: reel 2.2s linear infinite; }
.off .slide.center .cas-hub { animation: none; }
.cas-fly { position: fixed; z-index: 200; pointer-events: none; transform-origin: 50% 50%; }

/* ---- 카세트 플레이어 ---- */
.bgm-top { display: flex; align-items: stretch; gap: 7px; }
/* 곡 그림도 녹색 액정으로: 바탕 위에 줄무늬가 겹친다 */
.bgm-screen { position: relative; flex: none; padding: 3px; background: #0d0c0b; box-shadow: 0 0 0 1px #000; }
.bgm-screen::after { content: ''; position: absolute; inset: 3px; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(20, 28, 14, .2) 0 1px, transparent 1px 3px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55), inset 0 0 6px rgba(40, 50, 26, .22); }
.bgm-thumb { display: block; width: 54px; height: 54px; background: #ced6b6; }
.bgm-center { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 4px; }
.bgm-deck { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 3px; }
/* 위가 들은 시간 합계, 아래가 지금 곡 */
.bgm-counters { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.bgm-counters .seg { font-size: 13px; padding: 3px 4px; }
.bgm-counters .seg-on { right: 4px; top: 3px; }
.seg.total { color: #ff9416; text-shadow: 0 0 6px rgba(255, 148, 22, .55); }
/* 제목: 깊게 파인 홈 안의 납작하고 넓은 원기둥. 좌우로 휘어 양 끝이 어둡고, 홈 양쪽 끝의 전구가 가까운 곳만 비춘다 */
.drum { position: relative; flex: none; height: 16px; padding: 3px 2px; overflow: hidden; background: #020202; box-shadow: inset 0 3px 3px -1px #000, inset 0 -2px 2px -1px #000, inset 0 0 0 1px #000, 0 1px 0 rgba(255, 255, 255, .13); }
.drum-roll { position: relative; display: block; height: 100%; overflow: hidden; perspective: 90px; background: linear-gradient(90deg, #0b0a08 0, #3f3b2f 6%, #98927d 20%, #cfc9b2 42%, #d9d3bc 50%, #cfc9b2 58%, #98927d 80%, #3f3b2f 94%, #0b0a08 100%); }
.drum-roll::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 2px 2px -1px rgba(0, 0, 0, .9), inset 0 -1px 1px -1px rgba(0, 0, 0, .7); }
.drum-ribs { position: absolute; left: 0; right: -48px; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 4px); }
.drum-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 11px; overflow: hidden; color: #15130e; font: 700 7.5px/1 var(--hw-font); letter-spacing: .3px; white-space: nowrap; backface-visibility: hidden; }
.drum-lamp { position: absolute; z-index: 2; top: 1px; bottom: 1px; width: 24px; pointer-events: none; }
.drum-lamp.left { left: 1px; background: radial-gradient(ellipse 100% 80% at 3px 50%, rgba(255, 196, 96, .85) 0, rgba(255, 170, 64, .32) 34%, transparent 78%); }
.drum-lamp.right { right: 1px; background: radial-gradient(ellipse 100% 80% at calc(100% - 3px) 50%, rgba(255, 196, 96, .85) 0, rgba(255, 170, 64, .32) 34%, transparent 78%); }
.drum-lamp::before { content: ''; position: absolute; top: calc(50% - 3px); width: 2px; height: 6px; background: #ffe2a0; box-shadow: 0 0 3px 1px rgba(255, 196, 96, .85); }
.drum-lamp.left::before { left: 1px; }
.drum-lamp.right::before { right: 1px; }
.off .drum-lamp, .off .drum-face { visibility: hidden; }
.bgm-well { position: relative; flex: 1; min-width: 0; height: 40px; padding: 2px; overflow: hidden; background: #0d0c0b; box-shadow: inset 0 0 0 1px #000; }
/* 재생 덱의 투명한 사각 덮개 */
.well-lid { inset: 2px; background: linear-gradient(118deg, rgba(255, 255, 255, .22) 0 14%, rgba(255, 255, 255, .03) 24% 72%, rgba(255, 255, 255, .1) 88%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .36), 0 1px 2px rgba(0, 0, 0, .6); }
/* 덱에 든 실물 카세트: 양옆 나사와 롤러, 가운데 창 너머로 릴과 테이프 뭉치가 보인다 */
.dt { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: #070606; }
.dt-spindle { position: absolute; top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: repeating-conic-gradient(#8f8c82 0 60deg, #2f2d29 60deg 120deg); box-shadow: 0 0 0 1px #000; }
.dt-spindle.left { left: calc(32% - 4px); }
.dt-spindle.right { left: calc(68% - 4px); }
.dt-shell {
  position: absolute; inset: 0; display: block;
  background:
    radial-gradient(circle, #5d5b55 0 1.2px, #111 1.4px 2px, transparent 2.2px) 3px 3px / 5px 5px no-repeat,
    radial-gradient(circle, #5d5b55 0 1.2px, #111 1.4px 2px, transparent 2.2px) calc(100% - 3px) 3px / 5px 5px no-repeat,
    radial-gradient(circle, #5d5b55 0 1.2px, #111 1.4px 2px, transparent 2.2px) 3px calc(100% - 3px) / 5px 5px no-repeat,
    radial-gradient(circle, #5d5b55 0 1.2px, #111 1.4px 2px, transparent 2.2px) calc(100% - 3px) calc(100% - 3px) / 5px 5px no-repeat,
    linear-gradient(180deg, #3a3936, #232220);
  transition: transform .16s cubic-bezier(.3, .8, .3, 1), opacity .1s;
}
.dt.empty .dt-shell { transform: translateY(-110%); opacity: 0; }
.dt-window { position: absolute; left: 15%; right: 15%; top: 1px; bottom: 1px; display: block; overflow: hidden; background: #0b0a09; box-shadow: inset 0 1px 3px #000, 0 0 0 1px rgba(255, 255, 255, .1); }
.dt-reel { position: absolute; top: 50%; width: 0; height: 0; }
.dt-reel.left { left: 25%; }
.dt-reel.right { left: 75%; }
.dt-spin { position: absolute; left: 0; top: 0; width: 0; height: 0; display: block; will-change: transform; }
.dt-pack {
  position: absolute; left: calc(var(--r, 8px) * -1); top: calc(var(--r, 8px) * -1); width: calc(var(--r, 8px) * 2); height: calc(var(--r, 8px) * 2); border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 220, 180, .16), transparent 18% 50%, rgba(255, 220, 180, .12) 62%, transparent 80%), repeating-radial-gradient(circle, #3b2c21 0 .8px, #2a1e16 .8px 1.6px);
  box-shadow: 0 0 0 .5px #000;
}
.dt-hub { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #0d0c0b 0 30%, transparent 32%), repeating-conic-gradient(#efeadd 0 30deg, #8f8b7f 30deg 60deg); box-shadow: 0 0 0 1px #000; }
.dt-run { position: absolute; left: 0; right: 0; bottom: 1px; height: 1px; background: #4c382a; }
.dt-roller { position: absolute; bottom: 7px; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #111 0 30%, #bdb9ae 34%); box-shadow: 0 0 0 1px #000; }
.dt-roller.left { left: 6%; }
.dt-roller.right { right: 6%; }
.dt-head { position: absolute; left: calc(50% - 9px); bottom: 0; width: 18px; height: 5px; background: #6d6a62; clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.vu { position: relative; flex: none; width: 88px; }
.vu-face { position: relative; display: block; width: 88px; height: 100%; min-height: 56px; overflow: hidden; background: #e4dabb; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .5), 0 0 0 1px #000; }
.vu-face::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: 4px; height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 38'%3E%3Cpath d='M6 34 A52 52 0 0 1 60 12' fill='none' stroke='%23201d16' stroke-width='1.2'/%3E%3Cpath d='M60 12 A52 52 0 0 1 84 34' fill='none' stroke='%23c6341c' stroke-width='2.6'/%3E%3Cg stroke='%23201d16' stroke-width='.9'%3E%3Cpath d='M6 34l3 3M16 25l3 3M27 18l2 4M39 14l1 4M51 12l0 4'/%3E%3C/g%3E%3Cg stroke='%23c6341c' stroke-width='.9'%3E%3Cpath d='M64 13l-1 4M74 20l-2 3M84 34l-3 2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.vu-face b { position: absolute; left: 6px; bottom: 4px; font: 700 7px/1 var(--hw-font); color: #201d16; }
.vu-needle { position: absolute; left: 44px; bottom: -12px; width: 1.5px; height: 58px; background: #15130f; transform-origin: 50% 100%; transform: rotate(-48deg); }
.vu .lamp { position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; }
.bgm-controls { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.bgm-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.piano { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding-bottom: 3px; }
.piano .key { height: 30px; padding: 2px 1px 3px; }
.piano .key-top { font-size: 8.5px; }
.piano .key-sub { font-size: 5.5px; }
.bgm-controls .knob { flex: none; width: 42px; }
.bgm-controls .silk { font-size: 6.5px; }
.bgm-controls .knob-dial.sm { width: 30px; height: 30px; }
.bgm-controls .knob-dial.sm .knob-cap { inset: 5px; }
.bgm-controls .knob-dial.sm .knob-ticks i { height: 3px; transform-origin: 50% 15px; }
.bgm-controls .knob-read { min-height: 9px; line-height: 9px; font-size: 7px; }
.fader-wrap { display: flex; align-items: center; gap: 5px; min-width: 0; }
.fader-wrap .silk { flex: none; font-size: 6px; color: var(--bone-dim); }
.fader { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; width: 100%; height: 16px; margin: 0; background: transparent; cursor: ew-resize; }
.fader::-webkit-slider-runnable-track { height: 3px; background: #060505; box-shadow: 0 1px 0 rgba(255, 255, 255, .12); }
.fader::-moz-range-track { height: 3px; background: #060505; }
.fader::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 16px; margin-top: -6.5px; background: linear-gradient(90deg, var(--alu) 0 42%, #111 42% 58%, var(--alu) 58%); box-shadow: 0 0 0 1px #000, 0 2px 2px rgba(0, 0, 0, .7); }
.fader::-moz-range-thumb { width: 9px; height: 16px; border: 0; border-radius: 0; background: linear-gradient(90deg, var(--alu) 0 42%, #111 42% 58%, var(--alu) 58%); }

/* ---- 서비스 + 글씨와 LED가 있는 누름 버튼 ---- */
.panel-row { flex: none; display: flex; align-items: stretch; gap: 3px; }
.mod-service { flex: 1 1 0; min-width: 0; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 1px; }
.service-row .knob { flex: 0 1 46px; min-width: 0; }
.service-row .silk { font-size: 6.5px; }
.service-row .knob-read { font-size: 6.5px; min-height: 9px; line-height: 9px; }
.service-row .knob-dial.sm { width: 34px; height: 34px; }
.service-row .knob-dial.sm .knob-cap { inset: 6px; }
.service-row .knob-dial.sm .knob-ticks i { height: 3px; transform-origin: 50% 17px; }
.service-row .knob-dial.drop .knob-cap { inset: 8px; }
.service-row .toggle.sm { width: 26px; height: 38px; }
.service-row .toggle.sm .toggle-nut { left: 4px; top: 10px; width: 18px; height: 18px; }
.service-row .toggle.sm .toggle-bat { left: 8px; top: 1px; width: 10px; height: 18px; transform-origin: 50% 18px; }
/* SAVER 노브 위의 작은 TEST: 전원이나 어드민처럼 LED가 박혀 있다 */
.saver-cell { position: relative; }
.saver-test { position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%); display: flex; align-items: center; gap: 3px; padding: 1px 2px; border: 0; background: none; color: var(--bone-dim); font: 700 5.5px/1 var(--hw-font); letter-spacing: .3px; white-space: nowrap; }
.saver-test::after { content: ''; position: absolute; inset: -7px -8px -2px; }
.saver-test:hover, .saver-test:focus-visible { color: var(--bone); outline: none; }
.saver-test:active { transform: translateX(-50%) translateY(1px); }
.saver-test .lamp { width: 5px; height: 5px; }

.led-stack { flex: none; width: 114px; display: flex; flex-direction: column; gap: 3px; }
.mod-led { flex: 1; display: flex; padding: 7px 8px 9px; }
.led-key {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 28px; padding: 3px 8px 5px; border: 0; color: var(--ink); text-align: left;
  background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); box-shadow: 0 2px 0 var(--alu-lo), 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .55);
}
.led-key:active { transform: translateY(2px); box-shadow: 0 0 0 #000, 0 1px 0 #000; }
.led-key:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }
.led-bar { display: block; width: 100%; height: 3px; background: #4a463f; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .55); }
.led-key.on .led-bar { background: var(--signal); box-shadow: 0 0 8px 1px rgba(232, 80, 31, .8); }
.led-key b { font: 700 9.5px/1 var(--hw-font); letter-spacing: .8px; }

/* ---- 본체 사양, 규칙: 옛날 휴대폰의 녹색 액정 ---- */
.row-info > .module { flex: 1 1 0; min-width: 0; }
.row-info > .mod-spec { flex-grow: 1.18; }
.lcd {
  flex: 1; min-width: 0; margin: 0; padding: 3px 5px; overflow: hidden; border: 2px solid #0d0c0b; color: #1b2810; font: 11px/12px 'Galmuri11', sans-serif; text-shadow: 1px 1px 0 rgba(27, 40, 16, .14);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 2px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 2px), linear-gradient(180deg, #adbc88, #98a974);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55), inset 0 0 8px rgba(40, 60, 20, .25), 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .1);
}
.off .lcd { color: transparent; text-shadow: none; }
.info-row { display: flex; align-items: stretch; gap: 6px; }
.lcd-spec { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 5px; align-content: center; height: 82px; }
.lcd-spec dt { white-space: nowrap; opacity: .78; }
.lcd-spec dd { margin: 0; white-space: nowrap; overflow: hidden; }
.rules-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 4px 6px; }
.lcd-rule { height: 58px; word-break: keep-all; overflow-wrap: anywhere; }
.rules-row .silk { font-size: 6px; }
.rules-row .knob-read { font-size: 6px; min-height: 9px; line-height: 9px; }
.rules-row .knob-dial.sm { width: 30px; height: 30px; }
.rules-row .knob-dial.sm .knob-ticks i { height: 3px; transform-origin: 50% 15px; }
.rules-row .knob-dial.drop .knob-cap { inset: 7px; }
.rules-row .key { grid-column: 1 / -1; flex-direction: row; gap: 5px; height: 16px; margin-bottom: 3px; padding: 0 4px; }
.rules-row .key-top { font-size: 7px; }
.rules-row .key-sub { font-size: 6px; }
/* PC: 규칙은 종이로 가고, 사양이 한 줄을 다 쓴다. 스위치는 눕히고 액정은 두 칸으로 */
[data-layout='wide'] .mod-rules { display: none; }
[data-layout='wide'] .row-info > .mod-spec { padding: 8px 12px 9px; }
[data-layout='wide'] .info-row { gap: 8px; }
[data-layout='wide'] .lcd-spec { height: 46px; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.2fr); }
[data-layout='wide'] .mod-spec .rocker { width: 104px; margin-top: 15px; }
[data-layout='wide'] .mod-spec .rocker-cap { flex-direction: row; min-height: 25px; }
[data-layout='wide'] .mod-spec .rocker-cap[data-on='0'] { transform: rotateY(-9deg); }
[data-layout='wide'] .mod-spec .rocker-cap[data-on='1'] { transform: rotateY(9deg); }
[data-layout='wide'] .mod-spec .rocker-half { padding-top: 5px; }
[data-layout='wide'] .mod-spec .rocker-half + .rocker-half { border-top: 0; border-left: 1px solid #000; }
[data-layout='wide'] .mod-spec .rocker-led { top: 3px; }
/* 모바일: 프로그램과 서비스 쪽 높이에 맞춘다 */
[data-layout='stacked'] .rules-row .knob-read { display: none; }
[data-layout='stacked'] .lcd-rule { height: 46px; }
/* 시소 스위치: 고른 쪽이 눌려 들어가고 반대쪽이 올라온다 */
.rocker { flex: none; width: 40px; padding: 3px; background: #0d0c0b; box-shadow: 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .1); perspective: 130px; }
.rocker-cap { height: 100%; min-height: 70px; display: flex; flex-direction: column; transition: transform .07s linear; }
.rocker-cap[data-on='0'] { transform: rotateX(9deg); }
.rocker-cap[data-on='1'] { transform: rotateX(-9deg); }
.rocker-half { position: relative; flex: 1; min-height: 0; padding: 7px 0 0; border: 0; display: flex; align-items: center; justify-content: center; color: var(--ink); font: 700 9px/1 var(--ko-font); background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .25); }
.rocker-half[aria-checked='true'] { color: #24231f; background: var(--grain), linear-gradient(180deg, #8d8a80, #a29f94); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45); }
.rocker-half + .rocker-half { border-top: 1px solid #000; }
.rocker-half:focus-visible { outline: 1px solid var(--signal); outline-offset: -2px; }
.rocker-led { position: absolute; left: 30%; right: 30%; top: 4px; height: 2px; background: #4a463f; }
.rocker-half[aria-checked='true'] .rocker-led { background: var(--signal); box-shadow: 0 0 5px 1px rgba(232, 80, 31, .75); }
@media (max-width: 560px) {
  .row-info { flex-direction: column; }
  .row-info > .module { flex: none; }
  .rules-row { grid-template-columns: 40px minmax(0, 1fr) 58px; }
  .rules-row .key { grid-column: auto; flex-direction: column; gap: 2px; height: 40px; }
}

/* 남는 자리는 스피커 망 */
.row-grille { flex: none !important; height: 14px; }
.grille { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: radial-gradient(circle, #040403 0 1.3px, transparent 1.6px) 0 0 / 6px 6px, var(--plate); box-shadow: var(--panel-edge); }
[data-layout='stacked'] .off .off-note { top: 56%; }

/* 이스터에그 재생 중: 콘솔 전체 사용 불가 */
.console-locked .console-head, .console-locked .module, .console-locked .grille, .console-locked .page-dots { filter: brightness(.24) saturate(.5); }
.lock-note { display: none; }
.console-locked .lock-note { position: absolute; z-index: 9; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; background: #0c0b0a; box-shadow: 0 6px 20px rgba(0, 0, 0, .8); }
.lock-stripe { display: block; height: 14px; background: repeating-linear-gradient(135deg, #d9a93a 0 14px, #15130f 14px 28px); }
.lock-body { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 12px; }
.lock-body b { font: 700 15px/1 var(--hw-font); letter-spacing: 3px; color: #d9a93a; white-space: nowrap; }
.lock-triangle { flex: none; width: 40px; height: 35px; padding-top: 12px; text-align: center; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #d9a93a; color: #15130f; font: 700 18px/1 var(--hw-font); font-style: normal; }
@media (max-width: 460px) {
  .lock-body b { font-size: 12px; letter-spacing: 2px; }
}

/* 전원이 꺼지면 콘솔도 어둡다 */
.off .module, .off .grille { filter: brightness(.3); }
.off .console-head::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .62); pointer-events: none; }
.off .powerbox { position: relative; z-index: 1; }
.off .powerbox .silk { color: var(--bone); }
.off-note { display: none; }
.off .off-note { position: absolute; z-index: 7; left: 0; right: 0; top: 76%; padding: 10px 24px; display: flex; align-items: center; gap: 14px; background: rgba(8, 8, 7, .78); color: #bf5b2c; font: 700 10.5px/1 var(--hw-font); letter-spacing: 4px; white-space: nowrap; pointer-events: none; }
.off .off-note::before, .off .off-note::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .4; }

/* ---- 위아래 배치 ---- */
[data-layout='stacked'] .plate-rest { display: none; }
[data-layout='stacked'] .plate { padding: 4px 8px; font-size: 9px; text-align: center; }
[data-layout='stacked'] .mon-bezel { padding: 9px; }
[data-layout='stacked'] #glass { border-radius: 10px / 14px; }
[data-layout='stacked'] #monitor { padding: 6px 8px; }
@media (max-width: 460px) {
  .console-title { font-size: 11px; letter-spacing: 1.6px; }
  .console-head { gap: 4px; padding: 5px 8px; }
  .head-row { gap: 3px; }
  .head-cell > .silk { font-size: 5.5px; }
  .seg { font-size: 13px; padding: 3px 4px; }
  .seg-on { right: 4px; top: 3px; }
  .program-left { width: 96px; }
  .program-keys .key-top { font-size: 8px; }
  .slide-key { width: 18px; }
  .vu, .vu-face { width: 74px; }
  .vu-needle { left: 37px; }
  .bgm-thumb { width: 48px; height: 48px; }
  .link-name { font-size: 7.5px; }
  .link-photo { width: 84%; }
  .link-keys { gap: 4px; }
  .bgm-counters .seg { font-size: 10px; }
  .drum-face { padding: 0 8px; font-size: 6.6px; letter-spacing: .1px; }
  .drum-lamp { width: 16px; }
  .mod-start { width: 60px; }
  /* 누름 키는 한 줄 전체, 그 아래에 짧아진 POSITION과 노브, 스위치를 나란히 */
  .bgm-controls { display: grid; grid-template-columns: minmax(0, 1fr) 40px 40px 24px 24px; gap: 3px 3px; margin-top: 6px; }
  .bgm-left { display: contents; }
  .piano { grid-column: 1 / -1; }
  .fader-wrap { flex-direction: column; align-items: stretch; gap: 3px; padding-right: 4px; }
  .fader-wrap .silk { text-align: left; }
  .fader { flex: none; }
  .bgm-controls .knob { width: auto; }
  .module:not(.mod-led) { padding: 24px 10px 8px; }
  .module-title { top: 8px; left: 10px; }
  .row-info > .module { padding-top: 20px; }
  .row-info .module-title { top: 6px; }
  .mod-led { padding: 5px 7px 7px; }
  .led-key { min-height: 24px; }
  .clock-cell { width: 68px; }
  .led-stack { width: 80px; }
  .led-key { padding: 3px 6px 5px; }
  .led-key b { font-size: 8.5px; }
  /* 폰은 콘솔 높이를 늘리지 않도록 부품 크기를 유지하고 간격만 넓힌다 */
  .service-row .knob { flex: 0 1 38px; }
  .service-row .silk { font-size: 5.3px; letter-spacing: .2px; }
  .service-row .knob-read { font-size: 6px; }
  .service-row .knob-dial.sm { width: 30px; height: 30px; }
  .service-row .knob-dial.sm .knob-cap { inset: 5px; }
  .service-row .knob-dial.sm .knob-ticks i { transform-origin: 50% 15px; }
  .service-row .knob-dial.drop .knob-cap { inset: 7px; }
  .service-row .toggle.sm { width: 22px; height: 32px; }
  .service-row .toggle.sm .toggle-nut { left: 3px; top: 8px; width: 16px; height: 16px; }
  .service-row .toggle.sm .toggle-bat { left: 6.5px; width: 9px; height: 15px; transform-origin: 50% 15px; }
}

/* ---- 룰렛 턴테이블: 모니터 앞으로 올라오는 실물 ---- */
#turntable {
  position: absolute; left: 14px; right: 14px; bottom: 0; z-index: 20; height: 90%; display: flex;
  transform: translateY(104%); transition: transform .36s cubic-bezier(.2, .9, .3, 1), visibility 0s .36s; visibility: hidden;
}
#turntable.open { transform: none; visibility: visible; transition-delay: 0s; }
.tt-plinth { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--grain), var(--plate); box-shadow: 0 -8px 22px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px #000; }
.tt-band { flex: none; display: flex; align-items: center; gap: 12px; padding: 7px 12px; color: var(--ink); background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); }
.tt-band b { font: 700 10px/1 var(--hw-font); letter-spacing: 1.4px; white-space: nowrap; }
.tt-stripes { display: none; }
.tt-main { flex: 1; min-height: 0; display: flex; gap: 2px; background: var(--seam); }
.tt-deck { position: relative; flex: none; height: 100%; aspect-ratio: 1; max-width: 60%; background: var(--grain), var(--plate); }
.tt-platter { position: absolute; left: 6%; top: 6%; width: 88%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 40deg, #55524c, #2c2b28 20%, #4a4843 40%, #262523 62%, #514f49 82%, #55524c); box-shadow: 0 0 0 1px #000, 0 3px 7px rgba(0, 0, 0, .75); }
.tt-record { position: absolute; inset: 2.6%; width: 94.8%; height: 94.8%; border-radius: 50%; will-change: transform; image-rendering: auto; }
.tt-spindle { position: absolute; left: calc(50% - 5px); top: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--alu-hi); box-shadow: 0 0 0 1px #000; }
.tt-arm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tt-arm-base { fill: #15130f; stroke: #4a4843; stroke-width: 1.5; }
.tt-arm-cap { fill: #bdbab1; stroke: #000; stroke-width: 2; }
.tt-arm-rod { fill: none; stroke: #d6d3ca; stroke-width: 6; stroke-linecap: butt; filter: drop-shadow(0 3px 1px rgba(0, 0, 0, .6)); }
.tt-arm-weight { fill: #15130f; stroke: #8c897f; stroke-width: 1.5; }
.tt-arm-head { fill: #15130f; stroke: #d6d3ca; stroke-width: 1.5; }
.tt-arm-needle { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: butt; }
.tt-arm-swing { transform-origin: 462px 66px; transition: transform .25s; }
#turntable.spinning .tt-arm-swing { transform: rotate(-5deg) translateY(-6px); }
.tt-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt-paper { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; color: var(--amber); font: 13px/1.3 'Galmuri11', sans-serif; text-shadow: 0 0 4px rgba(255, 176, 0, .3); background: #0c0904; box-shadow: inset 0 0 14px #000; }
.tt-paper h3 { font: 700 8px/1.3 var(--hw-font); letter-spacing: 1.4px; color: var(--amber); }
.tt-form { flex: none; display: flex; align-items: center; gap: 4px; }
.tt-field { min-height: 26px; padding: 2px 5px; background: rgba(255, 176, 0, .08); color: var(--amber); border: 1px solid rgba(255, 176, 0, .4); caret-color: var(--amber); user-select: text; -webkit-user-select: text; }
.tt-field::placeholder { color: #94700f; }
.tt-field:focus { outline: none; border-color: var(--amber); }
.tt-name { flex: 1; min-width: 0; }
.tt-count { flex: none; width: 54px; }
.tt-add, .tt-clear, .tt-del { padding: 2px 8px; min-height: 24px; color: var(--amber); background: none; border: 1px solid var(--amber); font: 12px/1.2 'Galmuri11', sans-serif; text-shadow: inherit; }
.tt-add:hover, .tt-clear:hover, .tt-del:hover { background: var(--amber); color: #0c0904; text-shadow: none; }
.tt-add:disabled, .tt-clear:disabled, .tt-del:disabled { opacity: .45; }
.tt-list { flex: 1; min-height: 60px; overflow: auto; scrollbar-color: #94700f transparent; scrollbar-width: thin; }
.tt-row { display: flex; align-items: center; gap: 5px; padding: 2px 0; }
.tt-swatch { flex: none; width: 11px; height: 11px; box-shadow: 0 0 0 1px rgba(255, 176, 0, .35); }
.tt-row-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tt-pct { flex: none; width: 42px; text-align: right; font-size: 12px; }
.tt-del { padding: 1px 6px; min-height: 22px; }
.tt-empty { padding: 14px; text-align: center; color: #94700f; }
.tt-paper-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.tt-controls { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; background: var(--grain), var(--plate); }
.tt-result { display: block; font-size: 11px; padding: 4px 8px; text-align: center; white-space: normal; overflow-wrap: anywhere; font-family: var(--ko-font); }
.tt-result.on { color: var(--amber); }
.tt-keys { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; padding-bottom: 3px; }
.tt-keys .key { height: 40px; }
.tt-keys .key:disabled { filter: brightness(.6); }
/* 룰렛 결과 창 */
.tt-win { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 12px; background: rgba(6, 5, 4, .62); }
.tt-win-card { width: min(340px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px 14px; color: var(--ink); background: var(--grain), linear-gradient(180deg, var(--alu-hi), var(--alu)); box-shadow: 0 0 0 1px #000, 0 10px 26px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .6); animation: tt-win-in .16s steps(5); }
@keyframes tt-win-in { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.tt-win-head { font: 700 8.5px/1 var(--hw-font); letter-spacing: 2.4px; text-align: center; }
.tt-win-body { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 12px; background: #0c0904; box-shadow: inset 0 1px 4px #000, 0 0 0 1px #000, 0 1px 0 1px rgba(255, 255, 255, .5); }
.tt-win-swatch { flex: none; width: 14px; height: 14px; box-shadow: 0 0 0 1px rgba(255, 176, 0, .5); }
.tt-win-name { min-width: 0; color: var(--amber); font: 700 28px/1.2 'Galmuri11', sans-serif; text-align: center; text-shadow: 0 0 8px rgba(255, 176, 0, .55); overflow-wrap: anywhere; }
.tt-win-pct { font: 700 11px/1 var(--ko-font); text-align: center; }
.tt-win-card .key { align-self: center; width: 110px; height: 32px; margin-bottom: 3px; }
[data-layout='stacked'] #turntable { left: 6px; right: 6px; height: 96%; }
[data-layout='stacked'] .tt-plinth { overflow-y: auto; }
[data-layout='stacked'] .tt-main { flex: none; flex-direction: column; }
[data-layout='stacked'] .tt-deck { width: min(62%, 240px); height: auto; max-width: none; align-self: center; }
[data-layout='stacked'] .tt-side { flex: none; }
[data-layout='stacked'] .tt-paper { min-height: 170px; }

/* ---- 규칙 노트: 포스트잇처럼 위아래로 반 접혀 왼쪽 끝에 끝만 보이다가, 누르면 밀려 나오며 아래쪽 날개가 펴진다 ---- */
#rules-paper {
  position: absolute; z-index: 70; left: 0; top: 14%; width: min(400px, 86%); height: 68%; display: flex; color: #1f2a3f; pointer-events: none;
  transform: translateX(calc(-100% + 34px)) rotate(-1.2deg); transform-origin: 0 50%; transition: transform .34s cubic-bezier(.25, .9, .3, 1); visibility: hidden;
}
.ready #rules-paper { visibility: visible; }
#rules-paper.open { transform: translateX(8px) rotate(-.6deg); }
#rules-paper > * { pointer-events: auto; }
/* 그림자는 접힌 모양을 따라가는 고정 그림자. filter 는 닫혀 있어도 매 프레임 비용이 들어 쓰지 않는다 */
#rules-paper::before { content: ''; position: absolute; z-index: -1; left: 0; right: 0; top: 0; bottom: 50%; pointer-events: none; box-shadow: 3px 5px 12px rgba(0, 0, 0, .6); }
#rules-paper.open::before { bottom: 0; transition: bottom 0s .48s; }
.paper-tape { position: absolute; z-index: 2; left: 36%; top: -11px; width: 92px; height: 24px; background: rgba(226, 216, 178, .62); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transform: rotate(2deg); pointer-events: none !important; }
.paper-tab { position: absolute; z-index: 3; right: 0; top: 0; bottom: 50%; width: 34px; padding: 0; border: 0; background: none; color: #1f2a3f; cursor: pointer; display: grid; place-items: center; }
#rules-paper.open .paper-tab { display: none; }
.paper-tab span { writing-mode: vertical-rl; font: 30px/1 var(--pen-font); letter-spacing: 6px; }
.paper-tab:focus-visible { outline: 2px dashed var(--signal); outline-offset: -3px; }
/* 접힌 동안 본문은 위쪽 반만 보이고, 날개가 다 펴지면 전부 보인다 */
#rules-paper .paper-body { clip-path: inset(0 0 50% 0); }
#rules-paper.open .paper-body { clip-path: inset(0); transition: clip-path 0s .48s; }
.paper-flap { position: absolute; z-index: 1; left: 0; top: 50%; width: 100%; height: 50%; pointer-events: none !important; transform-origin: 50% 0; transform-style: preserve-3d; transform: perspective(1100px) rotateX(180deg); transition: transform .42s cubic-bezier(.3, .9, .3, 1); }
#rules-paper.open .paper-flap { transform: perspective(1100px) rotateX(0); visibility: hidden; transition: transform .42s cubic-bezier(.3, .9, .3, 1) .06s, visibility 0s .48s; }
.paper-flap-front, .paper-flap-back { position: absolute; inset: 0; display: block; overflow: hidden; backface-visibility: hidden; }
.paper-flap-front { background: #f6f4ea; box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, .35); }
.paper-copy { position: absolute; left: 0; top: -100%; width: 100%; height: 200%; overflow: hidden !important; }
/* 접혔을 때 앞으로 오는 뒷면 */
.paper-flap-back { transform: rotateX(180deg); background: #efeadb; box-shadow: inset 0 -7px 7px -6px rgba(90, 70, 20, .45), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.paper-fold { position: absolute; z-index: 3; right: 16px; top: 4px; padding: 0 8px; border: 0; background: #f6f4ea; color: #a8331c; font: 22px/26px var(--pen-font); box-shadow: 0 0 0 1px rgba(168, 51, 28, .4); }
.paper-fold:hover, .paper-fold:focus-visible { background: #a8331c; color: #f6f4ea; outline: none; }
/* 모바일: 탭 없이 ALL RULES 버튼으로 모니터 앞에 올라온다 */
[data-layout='stacked'] #rules-paper { z-index: 25; left: 0; right: 0; top: auto; bottom: 4%; width: min(540px, 94%); height: 74%; margin: 0 auto; transform: translateY(125%) rotate(-.6deg); transform-origin: 50% 50%; transition: transform .3s cubic-bezier(.25, .9, .3, 1), visibility 0s .3s; visibility: hidden; }
[data-layout='stacked'] #rules-paper.open { transform: rotate(-.6deg); visibility: visible; transition-delay: 0s; }
[data-layout='stacked'] .paper-tab, [data-layout='stacked'] .paper-flap { display: none; }
[data-layout='stacked'] #rules-paper::before { bottom: 0; }
[data-layout='stacked'] #rules-paper .paper-body { clip-path: none; }
/* 줄 노트: 파란 줄과 빨간 여백 선. 글이 스크롤되면 줄도 같이 움직인다 */
.paper-sheet {
  flex: 1; min-width: 0; overflow-y: auto; padding: 0 8px 28px 44px; font: 21px/28px var(--pen-font); user-select: text; -webkit-user-select: text;
  background:
    linear-gradient(90deg, transparent 33px, rgba(214, 60, 50, .55) 33px 34.5px, transparent 34.5px) local,
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 110, 180, .35) 27px 28px) local,
    #f6f4ea;
}
.paper-sheet h2 { margin: 0; padding-top: 28px; font: 27px/28px var(--pen-font); color: #a8331c; }
.paper-list { list-style: decimal; padding-left: 24px; }
.paper-note { color: #51607d; }
.paper-photo { display: block; width: 100%; height: auto; margin: 0 0 28px; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); }
.paper-foot { display: flex; flex-direction: column; }
.paper-sign-line { position: relative; height: 56px; }
.paper-signature { position: absolute; left: 4px; bottom: 2px; width: 190px; height: 50px; overflow: visible; }
.paper-signature path { fill: none; stroke: #143a8c; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.paper-sign { align-self: flex-end; margin-top: 4px; padding: 0 12px; border: 2px solid #1f2a3f; background: #f6f4ea; color: #1f2a3f; font: 20px/26px var(--pen-font); }
.paper-sign:hover, .paper-sign:focus-visible { background: #1f2a3f; color: #f6f4ea; outline: none; }
#rules-paper.signing .paper-sign { visibility: hidden; }
#rules-paper:not(.open) .paper-fold { visibility: hidden; }

/* ---- 포스트잇: 평소엔 위로 올라가 끝만 보이고, 누르면 내려오면서 펴진다. PC 전용 ---- */
#spec-note {
  --note: 300px;
  --peek: 34px;
  position: absolute; z-index: 60; top: 0; width: var(--note); height: calc(var(--note) / 2); padding: 0; border: 0; background: none; color: #2a2318; text-align: left; visibility: hidden; cursor: pointer;
  transform: translateY(calc(var(--peek) - var(--note) / 2)) rotate(2.5deg); transform-origin: 50% 100%; perspective: 900px; filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, .55)); transition: transform .38s cubic-bezier(.3, .9, .3, 1);
}
.ready #spec-note { visibility: visible; }
#spec-note.open { height: var(--note); transform: translateY(16px) rotate(2deg); transform-origin: 50% 0; }
#spec-note:focus-visible { outline: none; }
[data-layout='stacked'] #spec-note { display: none; }
.note-top, .note-front, .note-back { position: absolute; left: 0; right: 0; display: block; background: #f7e27a; }
.note-top { top: 0; height: calc(var(--note) / 2); padding: 8px 16px 0; overflow: hidden; background: linear-gradient(180deg, #dcc44f 0 8px, #f7e27a 8px); }
.note-flap { position: absolute; left: 0; right: 0; top: calc(var(--note) / 2); height: calc(var(--note) / 2); display: block; transform-origin: 50% 0; transform-style: preserve-3d; transform: rotateX(180deg); transition: transform .42s cubic-bezier(.3, .9, .3, 1) .05s; }
#spec-note.open .note-flap { transform: rotateX(0); }
.note-front { inset: 0; padding: 2px 16px 0; overflow: hidden; backface-visibility: hidden; background: #f4dd72; box-shadow: inset 0 1px 0 rgba(120, 90, 0, .2); }
/* 접혔을 때 앞으로 보이는 뒷면: 접힌 선 쪽에 제목이 있다 */
.note-back { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 10px; backface-visibility: hidden; transform: rotateX(180deg); background: #eed567; box-shadow: inset 0 -5px 7px -5px rgba(120, 90, 0, .55); }
.note-back b { font: 28px/1 var(--pen-font); color: #3a2e12; }
.note-text b { display: block; margin-top: 4px; font: 24px/24px var(--pen-font); color: #8a3324; }
.note-text p { margin: 0; font: 20px/19px var(--pen-font); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .ticker-text.run { animation: none; padding-left: 0; }
  .slide.center:not(.out) .cas-hub, .tt-win-card, .start-key.call, .door.taking .door-glass, .key-swing, .key-fob, .off .lock, .start-key.call .rocker-led, .tape { animation: none; }
  .slot-spine, .slide, .toggle-bat, .keyswitch-slot, .lock-key.settle, .key-ring.settle, #rules-paper, #turntable, .dt-shell, .rocker-cap, .note-flap, #spec-note, .case-lid, .link-lid, .paper-flap, #rules-paper .paper-body { transition: none !important; }
}
