/* ReCompile web - the desktop app's dark look (app/web/style.css tokens) */
:root {
  --bg: #121418; --bg2: #171a1f; --panel: #1d2026; --panel2: #242830; --panel3: #2c313a; --line: #2e333b; --line2: #3a4049;
  --fg: #e8e9eb; --muted: #9aa0a8; --accent: #ffb347; --accent2: #5fb3ff; --ok: #6fd58a; --danger: #ff6b6b; --warn: #ffd166;
  --radius: 8px; --topbar-h: 48px;
}
:root[data-theme="light"] { --bg: #f6f7f9; --bg2: #eceef2; --panel: #ffffff; --panel2: #f0f2f5; --panel3: #e4e7ec; --line: #d9dde3; --line2: #c8cdd5; --fg: #1b1e23; --muted: #5d6470; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--fg); font-size: 14px; }
h2 { margin: 0 0 10px; font-size: 18px; } h3 { margin: 16px 0 8px; font-size: 15px; color: var(--accent); }
h2 small, h3 small { font-weight: 400; font-size: 12px; color: var(--muted); }
a { color: var(--accent2); }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
button { background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); } button.active { background: var(--panel3); border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); } button.mini { padding: 2px 8px; font-size: 12px; }
select, input[type=range] { background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
label.inline, label.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sep { width: 1px; height: 22px; background: var(--line2); }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.tag.ko { color: var(--ok); border-color: var(--ok); }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }
.badge.run { color: var(--ok); border-color: var(--ok); } .badge.pause { color: var(--warn); border-color: var(--warn); }

#topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 16px; background: #0e1013; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 19px; font-weight: 700; white-space: nowrap; } .brand .logo { color: var(--accent); } .brand small { font-size: 11px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.brand small.build-no { display: inline; font-size: 10px; margin-left: 6px; opacity: .85; }   /* 사이트 빌드 번호 (web/tools/stamp_build.py), phones too */
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs button { background: transparent; border-color: transparent; padding: 6px 14px; font-size: 14px; color: var(--muted); }
.tabs button.active { background: var(--panel2); border-color: var(--line2); color: var(--fg); }
#main { padding: 14px 16px 40px; max-width: 1100px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.page { max-width: 900px; }

.drop { border: 1.5px dashed var(--line2); border-radius: 12px; padding: 16px 18px; background: var(--bg2); margin-bottom: 16px; }
.drop.over { border-color: var(--accent); background: var(--panel); }
.drop p { margin: 6px 0; line-height: 1.55; }
.status { min-height: 20px; font-size: 13px; color: var(--muted); } .status.ok { color: var(--ok); } .status.warn { color: var(--warn); }

.libhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.empty { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.vol { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.vol.dim { opacity: .55; } .vol.soon { border-style: dashed; } .vol.other h3 { color: var(--fg); }
.volhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.volhead h3 { margin: 4px 0; }
.chips { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.chip { display: inline-block; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line2); color: var(--muted); }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.entries { display: flex; flex-direction: column; }
.entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 2px; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.ename { min-width: 0; } .ename .muted { font-size: 12.5px; }
.entry > canvas.cover { flex: none; width: 80px; height: 50px; border-radius: 4px; background: var(--panel2); }
.entry > canvas.cover + .ename { flex: 1; }
.counts { margin-top: 2px; } .counts .cnt { color: var(--muted); text-decoration: none; margin-right: 10px; } .counts .cnt:hover { color: var(--accent); }
.ebtn { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.need { color: var(--warn); max-width: 360px; white-space: normal; }
.unk { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }

.playhead { display: flex; justify-content: space-between; align-items: flex-end; }
.toolbar { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
#screenwrap { background: #000; border-radius: var(--radius); display: flex; justify-content: center; align-items: center; aspect-ratio: 640 / 400; max-height: var(--pl-room, calc(100vh - 220px)); margin: 8px auto; }   /* (--pl-room: 「맞춤」's room, js/app.js fitRoom) */
#screenwrap:fullscreen { max-height: none; border-radius: 0; }
#screen { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; outline: none; cursor: crosshair; }
#screen:focus { box-shadow: 0 0 0 2px var(--accent); }
.notes { color: var(--muted); line-height: 1.5; }

.row.tight { gap: 6px; margin: 0; }
#drives[hidden], [hidden] { display: none !important; }
.libfilter input[type=search] { background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 13px; min-width: 220px; flex: 1; max-width: 360px; }
.tag.ending { color: var(--accent); border-color: var(--accent); }
.mono { font-family: Consolas, "D2Coding", monospace; }
.playpanel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 10px; margin-top: 8px; }
.ptabs { display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.ptabs button[data-p] { background: transparent; border-color: transparent; color: var(--muted); padding: 4px 12px; }
.ptabs button[data-p].active { background: var(--panel2); border-color: var(--line2); color: var(--fg); }
.ptabs .grow { flex: 1; }
.saves { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 12px; }
.saverow { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; font-size: 13px; }
.saverow.cur { background: var(--panel2); }
.saverow .sn { width: 18px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.saverow .st { flex: 1; color: var(--muted); font-size: 12.5px; } .saverow .st.has { color: var(--fg); }
.saverow .st.stale, .gc-item .stale { color: var(--muted); } .saverow small.eng, .gc-item small.eng { color: var(--warn, #e0a030); white-space: nowrap; }   /* a save of another build of the engine: not loaded (features/play.js) */
#pnotes h4 { margin: 10px 0 5px; font-size: 13px; color: var(--accent); } #pnotes h4 small { color: var(--muted); font-weight: 400; }
#pnotes { max-height: 60vh; overflow: auto; font-size: 12.5px; line-height: 1.55; }
.note { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; margin: 0 0 6px; }
.note.open { border-color: rgba(255, 107, 107, .45); }
.note .nh { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.note .nst { padding: 0 5px; border-radius: 3px; font-weight: 600; } .note .nst.open { background: rgba(255, 107, 107, .15); color: var(--danger); } .note .nst.done { background: rgba(111, 213, 138, .15); color: var(--ok); }
.note .nt { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.note .nf { margin-top: 4px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; } .note .nf b { color: var(--ok); font-weight: 600; margin-right: 3px; } .note.open .nf b { color: var(--warn); }
.note .nwith { margin-top: 3px; font-size: 11px; color: var(--accent2); }
.note .nsrc { margin-top: 3px; font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.ptabs button small { font-size: 11px; color: var(--muted); margin-left: 2px; } .ptabs button small.open { color: var(--danger); }
#tr-value { width: 110px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; }
#tr-rows input { width: 110px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 6px; font: inherit; font-size: 13px; }
pre.manual { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6; margin: 0; max-height: 50vh; overflow: auto; }
.mu-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: start; }
.tracklist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 170px); overflow: auto; padding: 4px; }
.track { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.track:hover { background: var(--panel2); } .track.playing { background: var(--panel3); color: var(--accent); }
.mu-player { min-width: 0; }
.track-head { margin: 8px 6px 2px; color: var(--muted); border-bottom: 1px solid var(--line); }
.np-title { font-size: 16px; font-weight: 600; margin: 4px 0; }
#mu-seek { flex: 1; min-width: 120px; }
.sfxrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; }
.sfxrow > span { min-width: 90px; }
/* the 음악 · 그림 tabs' 게임 menu is as wide as its longest title: no wider than the page (as #ex-game) */
#tab-music > .row label.inline, #tab-pics > .row label.inline { min-width: 0; max-width: 100%; } #mu-game, #pi-game { min-width: 0; max-width: min(420px, 100%); }
@media (max-width: 720px) { .mu-layout { grid-template-columns: 1fr; } .tracklist { max-height: 40vh; }
  #tab-music > .row label.inline:has(#mu-game), #tab-pics > .row label.inline:has(#pi-game) { flex: 1 1 100%; white-space: nowrap; } #mu-game, #pi-game { flex: 1; max-width: none; } }
#pi-bg { width: 36px; height: 24px; padding: 0; border: 1px solid var(--line2); border-radius: 4px; background: none; }
.pi-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: start; }
.pi-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 170px); overflow: auto; padding: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
.pi-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 6px; cursor: pointer; min-width: 0; }
.pi-item:hover { background: var(--panel2); } .pi-item.sel { background: var(--panel3); outline: 1px solid var(--accent); }
.pi-item canvas { max-width: 96px; max-height: 64px; image-rendering: pixelated; background: #2a2a2a; }
.pi-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pi-item.none { opacity: .4; }
.pi-group { grid-column: 1 / -1; margin: 8px 4px 2px; color: var(--muted); border-bottom: 1px solid var(--line); }
.pi-view { min-width: 0; }
.pi-stage { overflow: auto; max-height: calc(100vh - 200px); background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
#pi-canvas { image-rendering: pixelated; display: block; }
.gridtools { margin-top: 8px; } .gridtools input[type=number] { width: 64px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 13px; }
#pi-acanvas { image-rendering: pixelated; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 720px) { .pi-layout { grid-template-columns: 1fr; } .pi-list { max-height: 36vh; } }
table.cache { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cache th, table.cache td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cache th { color: var(--muted); font-weight: 500; } table.cache td.num { white-space: nowrap; }
/* 설정 > 세이브 데이터 (js/features/savedata.js): the CD cache's table; on phones the date goes under the name */
table.sd td.sd-act { white-space: nowrap; text-align: right; } table.sd td.sd-act button + button { margin-left: 4px; }
table.sd .sd-gone { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; vertical-align: 1px; }
table.sd .sd-when-m { display: none; }
@media (max-width: 720px) { table.sd .sd-when { display: none; } table.sd .sd-when-m { display: inline; } }
ul.small li { margin: 4px 0; line-height: 1.5; }

@media (max-width: 720px) {
  #main { padding: 10px 16px 30px; }
  #topbar { gap: 8px; padding: 0 10px; } .brand { font-size: 16px; } .topright { display: none; }
  .tabs { overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .brand small { display: none; } .tabs button { padding: 6px 8px; font-size: 13px; }
  .entry { flex-direction: column; align-items: flex-start; } .ebtn { justify-content: flex-start; }
  .entry:has(> canvas.cover) { display: grid; grid-template-columns: 64px 1fr; column-gap: 10px; align-items: start; }
  .entry:has(> canvas.cover) > .ebtn { grid-column: 1 / -1; } .entry > canvas.cover { width: 64px; height: 40px; }
  #screenwrap { max-height: none; }
}

/* the library rows: the desktop app's library cards (app/web/style.css .gamecard) without their buttons - they open the game
   card (js/features/card.js) */
.entry.pick { cursor: pointer; }
.entries .entry { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: start; justify-content: stretch; padding: 8px; margin: 0 0 6px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); position: relative; }
.entries .entry:first-child { border-top: 1px solid var(--line); }
.entries .entry:hover { border-color: var(--line2); }
.entries .entry:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.entries .entry.off { opacity: .55; }
.entries .entry > canvas.cover { width: 84px; height: 63px; border-radius: 4px; background: #000; image-rendering: pixelated; display: block; }
.entries .entry > canvas.cover:not(.done) { background: var(--panel2); }
.entry .ename { min-width: 0; }
.entry .t, .gc-info .t { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.entry .t2, .gc-info .t2 { font-size: 11.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.entry .t3, .gc-info .t3 { font-size: 11.5px; color: var(--accent2); margin-top: 2px; }
.entry .tags, .gc-info .tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.entry .meta, .gc-info .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.entries .tag, .gc-info .tag { font-size: 10.5px; padding: 0 6px; border-radius: 4px; background: var(--panel3); color: var(--muted); border: 1px solid var(--line2); line-height: 16px; margin: 0; vertical-align: baseline; }
.entries .tag.vol, .gc-info .tag.vol { color: var(--accent); border-color: #5a4a2a; background: #2a251c; }
.entries .tag.ko, .gc-info .tag.ko { color: var(--ok); border-color: #2f5a3a; background: #1c2a1f; }
.entries .tag.own, .gc-info .tag.own { color: var(--accent2); border-color: #2b4a66; background: #1b2531; }
.entries .tag.off, .gc-info .tag.off { color: var(--muted); }
.entries .tag.ser, .gc-info .tag.ser { background: #2b2a4a; color: #c9c3ff; border-color: #4a4680; }
.entries .tag.app, .gc-info .tag.app { background: #2a1c1c; color: #e0a0a0; border-color: #6a3a3a; }
.entry .endmark { position: absolute; left: 10px; top: 10px; background: rgba(16, 16, 16, .85); color: #ffd36e; border: 1px solid #ffd36e; border-radius: 3px;
  font-size: 10.5px; font-weight: 700; padding: 0 4px; line-height: 15px; pointer-events: none; }
/* 썸네일로 보기 */
body.libgrid .entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
body.libgrid .entries .entry { grid-template-columns: 1fr; margin: 0; }
body.libgrid .entries .entry > canvas.cover { width: 100%; height: auto; aspect-ratio: 4 / 3; }
body.libgrid .entry .meta { display: none; }
.viewsw { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; margin-left: auto; }
.viewsw .vbtn { border: 0; border-radius: 0; background: var(--panel2); padding: 0; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.viewsw .vbtn + .vbtn { border-left: 1px solid var(--line2); }
.viewsw .vbtn svg { width: 16px; height: 16px; fill: currentColor; }
.viewsw .vbtn.active { background: var(--panel3); color: var(--accent); }
/* the game card */
dialog.gamecard { border: 1px solid var(--line2); border-radius: 12px; padding: 0; width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--panel); color: var(--fg); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); overflow: hidden; }
dialog.gamecard::backdrop { background: rgba(0, 0, 0, .6); }
.gc-body { padding: 12px 16px 16px; overflow: auto; max-height: calc(100vh - 50px); }
.gc-bar { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; }
.gc-bar .gb-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-bar .gb-title small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.ending-btn { white-space: nowrap; }
.ending-btn.on { border-color: #ffd36e; color: #ffd36e; background: #2a2618; }
.gc-close { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; font-size: 16px; color: var(--muted); flex: none; }
.gc-head { display: flex; gap: 14px; align-items: flex-start; }
.gc-cover { flex: none; width: 176px; height: 132px; border-radius: 6px; background: #000; image-rendering: pixelated; }
.gc-info { min-width: 0; flex: 1; }
.gc-play, .gc-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gc-play button { flex: 1; min-height: 38px; padding: 6px 12px; font-size: 14px; }
.gc-play button.ja { border-color: #4a4f58; } .gc-play button.ko:not(:disabled) { border-color: #2f5a3a; color: var(--ok); }
.gc-more button { min-height: 34px; } .gc-more button small { margin-left: 6px; color: var(--muted); font-size: 11.5px; }
.gc-more { min-height: calc(min(var(--rows, 0), 1) * 34px); align-content: flex-start; }   /* room for the buttons that come after the card is shown (features/card.js: --rows), so the play buttons keep their place */
.gc-need { color: var(--warn); margin-top: 8px; } .gc-need:empty { display: none; }
.gc-pane { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; max-height: 46vh; overflow: auto; font-size: 13px; }
.gc-pane pre.manual { max-height: none; }
.gc-pane.notesbox { line-height: 1.55; font-size: 12.5px; }
.gc-pane.notesbox h4 { margin: 10px 0 5px; font-size: 13px; color: var(--accent); } .gc-pane.notesbox h4 small { color: var(--muted); font-weight: 400; }
.gc-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 2px; border-bottom: 1px solid var(--line); }
.gc-item:last-child { border-bottom: 0; } .gc-item > span { min-width: 0; overflow-wrap: anywhere; }
.gc-group { margin: 8px 0 2px; }
#play-title small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.playhead #ending { margin-left: auto; align-self: center; }
@media (max-width: 720px) {
  body.libgrid .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entries .entry, .entries .entry:has(> canvas.cover) { grid-template-columns: 72px 1fr; column-gap: 8px; }
  .entries .entry > canvas.cover { width: 72px; height: 54px; }
  body.libgrid .entries .entry, body.libgrid .entries .entry:has(> canvas.cover) { grid-template-columns: 1fr; }
  body.libgrid .entries .entry > canvas.cover { width: 100%; height: auto; }
  .viewsw .vbtn { width: 44px; height: 40px; }
  .entries .entry { padding: 8px; }
  dialog.gamecard { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; max-height: 92vh; border-bottom: 0; }
  .gc-body { max-height: 92vh; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .gc-head { flex-direction: column; gap: 10px; }
  .gc-cover { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .gc-play button { min-height: 44px; }
  .gc-more button { flex: 1 1 calc(50% - 8px); min-height: 44px; }
  .gc-more { min-height: calc(var(--rows, 0) * 52px - min(var(--rows, 0), 1) * 8px); }   /* two buttons a row, 44 px + 8 px between rows */
  .gc-close, .ending-btn { min-height: 40px; }
  .gc-item button { min-height: 36px; min-width: 64px; }
}

/* library filters as the app's sidebar (app/web/style.css): menus of check boxes, chips of the chosen filters */
.libfilter .volsel { position: relative; display: inline-block; }
.libfilter .dropbtn { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.libfilter .dropmenu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 6px; min-width: 240px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); max-height: 60vh; overflow: auto; }
.libfilter .dropmenu label { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.libfilter .dropmenu input { accent-color: var(--accent); }   /* the platform and sort menus' ticks in the site colour (as 보유만) */
.libfilter .dropmenu label:hover { background: var(--panel2); }
.libfilter .dropmenu label small { color: var(--muted); margin-left: auto; padding-left: 10px; }
.libfilter .dropmenu .dm-sep { height: 1px; background: var(--line); margin: 4px 0; }
.libfilter .dropmenu label.dim { opacity: .55; } .libfilter .dropmenu label.missing { opacity: .5; }
.libchips { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 8px; }
.libchips .chip { font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 1px 8px; cursor: pointer; color: var(--fg); min-width: 0; }
.libchips .chip:hover { border-color: var(--danger); }
.libchips .chip.ser { background: #2b2a4a; color: #c9c3ff; } .libchips .chip.plat { background: #1f3a2e; color: #a8e6c0; }
.volhead h3 .vcount { color: var(--muted); font-weight: 400; font-size: 12px; }
.entries .entry.selected { border-color: var(--accent); background: #22241f; }
.entries .entry.running { box-shadow: inset 3px 0 0 var(--ok); }
.entries .entry.missing { opacity: .38; cursor: not-allowed; } .entries .entry.missing > canvas.cover { filter: grayscale(.7); }
@media (max-width: 720px) {
  .libfilter .dropbtn { min-height: 40px; max-width: 46vw; }
  .libfilter .dropmenu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; max-height: 70vh; }
  .libfilter .dropmenu label { min-height: 40px; }
}
/* phones: the search box on a row of its own, then 플랫폼 · 호수 · 시리즈 (equal widths) and the view switch on one row, every control
   44px high with the same corners and type (user, 2026-11-08); wider screens keep their one row */
@media (max-width: 720px) {
  .row.libfilter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 6px; align-items: stretch; }
  .libfilter #lib-q { grid-column: 1 / -1; box-sizing: border-box; width: 100%; min-width: 0; max-width: none; height: 44px; margin: 0; padding: 0 12px; font-size: 16px; border-radius: 6px; }
  .libfilter > .volsel, .libfilter > .inline { display: block; min-width: 0; margin: 0; }
  .libfilter .dropbtn { box-sizing: border-box; width: 100%; max-width: none; height: 44px; min-height: 44px; margin: 0; padding: 0 6px; font-size: 16px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; gap: 2px; }
  .libfilter .dropbtn .dl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .libfilter .dropbtn .ico { flex: none; width: 12px; height: 12px; }
  .libfilter .viewsw { box-sizing: border-box; height: 44px; margin: 0; border-radius: 6px; }
  .libfilter .viewsw .vbtn { height: 100%; width: 42px; }
}
.track .ti { color: var(--muted); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; } .track .tn { flex: 1; min-width: 0; }
.np-label { margin-top: 4px; }
#mu-sf-info { margin-left: 4px; } a.mini-link { color: var(--accent2); }

/* ---- PL: the play tab as the desktop app's control bar, stage and side panel (js/features/playbar.js · playside.js) */
.badge.ended { color: var(--danger); border-color: var(--danger); }
#screenwrap { position: relative; }
#screenwrap.pl-fixed { overflow: auto; justify-content: flex-start; align-items: flex-start; }
#screenwrap.pl-fixed #screen { margin: auto; flex: none; }
#screenwrap.pl-ended #screen { filter: brightness(.45) grayscale(.3); }
/* (WJ16) a Windows game's menu bar: a band over the game screen inside its frame (full screen too) */
#screenwrap.has-mbar { flex-direction: column; justify-content: flex-start; align-items: stretch; }
#screenwrap.has-mbar #screen { flex: 1 1 auto; min-height: 0; height: auto; width: 100%; }
.wmbar { flex: none; display: flex; align-items: stretch; gap: 1px; height: 26px; padding: 0 4px; background: var(--panel, #1d2026); border-bottom: 1px solid var(--line, #2e333b); border-radius: var(--radius) var(--radius) 0 0; overflow-x: auto; scrollbar-width: none; }
#screenwrap:fullscreen .wmbar { border-radius: 0; }
.wmbar button { flex: none; background: none; border: 0; border-radius: 4px; color: var(--fg, #e8e9eb); font: inherit; font-size: 13px; line-height: 26px; padding: 0 9px; white-space: nowrap; cursor: pointer; }
.wmbar button:hover:not(:disabled), .wmbar button.open { background: var(--panel3, #2c313a); }
.wmbar button:disabled { opacity: .45; cursor: default; }
@media (pointer: coarse) { .wmbar { height: 30px; } .wmbar button { line-height: 30px; font-size: 14px; padding: 0 11px; } }
.pl-stage-msg { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center; color: var(--muted); background: #0b0d10; border-radius: inherit; overflow: auto; }
.pl-stage-msg[hidden] { display: none; }
.pl-stage-msg p { margin: 0; font-size: 13px; line-height: 1.6; max-width: 560px; }
.pl-stage-msg .big { font-size: 56px; line-height: 1; color: #2e333b; }
.pl-sm-title { color: var(--fg); font-weight: 600; font-size: 15px; }
.pl-sm-title small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.pl-sm-play { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pl-sm-play button { min-height: 40px; padding: 6px 16px; font-size: 14px; }
.pl-sm-play button.ko:not(:disabled) { border-color: #2f5a3a; color: var(--ok); }
.pl-sm-why { color: var(--warn); font-size: 12.5px; }
.pl-stage-msg.after { background: transparent; justify-content: flex-end; padding-bottom: 14px; pointer-events: none; }
.pl-stage-msg.after > * { pointer-events: auto; }
.pl-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: pl-spin 1s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
.pl-ended-badge { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 107, 107, .9); color: #fff; font-weight: 700; padding: 4px 12px;
  border-radius: 6px; letter-spacing: 1px; pointer-events: none; }
.pl-focus-hint { position: absolute; left: 50%; bottom: 12px; z-index: 2; transform: translateX(-50%); background: rgba(0, 0, 0, .7); color: #ddd; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
#pad-ind { padding: 1px 6px; }
/* the site's own icons (features/icons.js) in the play bar and panel */
#kbjoy { display: inline-flex; align-items: center; gap: 1px; } #kbjoy .ico-mid { width: .72em; height: .72em; opacity: .65; }
.toolbar:not(.rc-tools) #btn-animrec, .pl-sm-play button, #ending, .ptabs .pl-fold, .pl-savehead .mini, .saverow .pl-dl { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.pl-stage-msg .big .ico { display: block; }
.pl-stline .ico { color: var(--accent); }
/* the panel: folded (app: » «), 지금 실행, 상태, the slots' header, 설명서 일본어 / 한국어, 실행 방식 */
.ptabs .pl-fold { margin-left: auto; min-width: 34px; padding: 2px 8px; background: transparent; border-color: transparent; color: var(--muted); }
#playpanel.pl-folded .ppane { display: none !important; }
#playpanel.pl-folded .ptabs { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
#pl-now { background: var(--panel2); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; }
#pl-now .nt { font-weight: 600; font-size: 13.5px; } #pl-now .nt2 { color: var(--muted); font-size: 11.5px; }
#pl-now .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } #pl-now .tag { margin: 0; }
#pl-now .nexe { color: var(--muted); font-size: 11px; font-family: Consolas, monospace; margin-top: 4px; word-break: break-all; }
.pl-state { margin: 0 0 8px; }
.pl-state > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; padding: 4px 0; }
.pl-stline { font-size: 12px; color: var(--muted); margin: 2px 0 6px; overflow-wrap: anywhere; }
.pl-state table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.pl-state th { text-align: left; color: var(--muted); font-weight: 500; padding: 3px 8px 3px 0; width: 7.5em; vertical-align: top; white-space: nowrap; }
.pl-state td { padding: 3px 0; overflow-wrap: anywhere; }
.pl-savehead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.pl-savehead h4 { margin: 0 4px 0 0; font-size: 13px; color: var(--accent); }
.pl-slotgroup { grid-column: 1 / -1; margin: 6px 0 0; }
.saverow .pl-dl { padding: 2px 7px; }
.pl-mlang { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; margin: 0 0 8px; }
.pl-mlang[hidden] { display: none; }
.pl-mlang button { border: 0; border-radius: 0; background: transparent; padding: 3px 12px; font-size: 12.5px; }
.pl-mlang button.active { background: var(--panel3); color: var(--accent); }
#pnotes .nrun, .notesbox .nrun { color: var(--muted); font-size: 12px; padding: 6px 8px; border-left: 2px solid var(--line2); margin-bottom: 6px; }
#pnotes .nrun b, .notesbox .nrun b { color: var(--fg); font-weight: 600; margin-right: 4px; }
/* the portrait touch toolbar: 배율 does nothing there (the touch layout fits the screen); a gamepad turns the touch controls off */
.toolbar.rc-tools label.inline.pl-scale, .toolbar.rc-tools #pad-ind { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  .saverow button, .pl-savehead button, .ptabs .pl-fold, .pl-mlang button { min-height: 40px; }
  .saverow button, .pl-savehead button, .ptabs .pl-fold { min-width: 44px; }
  #tab-play > .toolbar:not(.rc-tools) button, #tab-play > .toolbar:not(.rc-tools) select { min-height: 40px; }
  .pl-state > summary { padding: 10px 0; }
}
@media (max-width: 720px) {
  .ptabs { flex-wrap: wrap; }
  .ptabs button[data-p] { padding: 4px 9px; min-height: 40px; }
  .pl-stage-msg { padding: 10px; gap: 6px; } .pl-stage-msg .big { display: none; } .pl-stage-msg p { font-size: 12px; line-height: 1.5; }
  .pl-focus-hint { white-space: normal; text-align: center; width: max-content; max-width: 90%; }
}

/* ---- WP4: top bar (help ?, badges, phones: tabs in two rows), toasts, help window, 변환 tab, 설정 additions, separate game window ---- */
kbd { background: var(--panel3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: 11.5px Consolas, "D2Coding", monospace; }
.topright { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
#btn-help { min-width: 32px; padding: 3px 9px; font-weight: 700; }
.badge.ended { color: var(--danger); border-color: var(--danger); }
.badge.rec { background: transparent; color: var(--danger); border-color: var(--danger); padding: 2px 9px; font-size: 12px; animation: rc-blink 1.4s ease-in-out infinite; }
@keyframes rc-blink { 50% { opacity: .55; } }
#toasts { position: fixed; right: 16px; bottom: 16px; left: auto; top: auto; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; pointer-events: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; inset: auto 16px 16px auto; color: var(--fg); }
#toasts:empty { display: none; }
.toast { pointer-events: auto; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-left: 4px solid var(--accent2); border-radius: 8px; padding: 9px 12px; font-size: 13px;
  line-height: 1.45; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); animation: rc-toast-in .18s ease-out; transition: opacity .3s; cursor: default; overflow-wrap: anywhere; }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); } .toast.out { opacity: 0; }
@keyframes rc-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.popover { position: fixed; top: calc(var(--topbar-h) + 8px); right: 14px; width: 460px; max-width: calc(100vw - 28px); max-height: calc(100vh - var(--topbar-h) - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); z-index: 90; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.pop-head .iconbtn { min-width: 34px; min-height: 32px; padding: 0 8px; font-size: 16px; }
.pop-body { padding: 4px 12px 12px; } .pop-body h4 { margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); }
.pop-body p { line-height: 1.55; margin: 4px 0; }
table.keys { border-collapse: collapse; width: 100%; font-size: 12.5px; } table.keys td { padding: 4px; vertical-align: top; line-height: 1.5; } table.keys td:first-child { white-space: nowrap; width: 150px; }
pre.log { background: #0b0d10; border: 1px solid var(--line); border-radius: 6px; padding: 8px; height: 220px; overflow: auto; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, "D2Coding", monospace; margin: 8px 0; color: var(--fg); }
table.kv { border-collapse: collapse; width: 100%; font-size: 13px; }
table.kv th { text-align: left; color: var(--fg); font-weight: 500; padding: 6px 10px 6px 0; width: 32%; vertical-align: top; border-bottom: 1px solid var(--line); }
table.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
/* 설정 additions */
#general-more input[type=text] { width: 90px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; }
.fold-row > span:first-child { min-width: 30px; }
.fold-pane { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin: 4px 0 8px; }
.fold-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.fold-item:last-child { border-bottom: 0; } .fold-item > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
details.emulog { margin: 8px 0; } details.emulog summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
/* the game in its own window */
#screenwrap.popped { position: relative; } #screenwrap.popped #screen { visibility: hidden; }
.popnote { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); text-align: center; }
#screenwrap:not(.popped) .popnote { position: static; transform: none; flex-direction: row; }
@media (max-width: 720px) {
  #topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; row-gap: 4px; column-gap: 8px; padding: 6px max(10px, env(safe-area-inset-right, 0px)) 6px max(10px, env(safe-area-inset-left, 0px)); }
  #topbar .brand { flex: 1; }
  #topbar .tabs { order: 3; flex: 1 0 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  #topbar .tabs button { min-height: 40px; padding: 4px 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  #topbar .topright { display: flex; } #topbar .topright #badge { display: none; }
  #btn-help { min-width: 40px; min-height: 40px; }
  #toasts { inset: calc(env(safe-area-inset-top, 0px) + 8px) 12px auto 12px; max-width: none; }
  .popover { left: 12px; right: 12px; width: auto; max-width: none; top: 8px; max-height: calc(100vh - 16px); }
  table.keys td:first-child { width: auto; white-space: normal; min-width: 76px; }
  table.kv th, table.kv td { display: block; width: auto; border-bottom: 0; padding: 4px 0; }
  table.kv tr { display: block; border-bottom: 1px solid var(--line); padding: 4px 0; }
  .fold-row button { min-height: 40px; flex: 1 1 auto; } .fold-item button { min-height: 40px; }
  #general-more select, #win-more select { min-height: 40px; }
  #general-more input[type=text] { min-height: 40px; font-size: 16px; }
  #topbar { position: relative; }
  #toasts { width: auto; }
  #general-more label.toggle, #general-more label.inline { min-height: 40px; }
  #emulog-box .row button, .fold-pane button { min-height: 40px; min-width: 44px; }
  details.emulog summary { padding: 10px 0; }
}

/* ---- WP6: CD 컨텐츠 tab (js/features/contents.js), as the desktop app's contents tab (app/web/style.css .contents-layout) ---- */
#tab-contents .ct-top { margin-top: 0; }
#tab-contents .ct-top select { max-width: min(520px, 100%); }
#tab-contents .ct-top label.inline { min-width: 0; max-width: 100%; }
.contents-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 14px; align-items: start; }
.ctlists { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; max-height: calc(100vh - var(--topbar-h) - 70px); overflow: auto; min-width: 0; }
.ctlists h4 { margin: 8px 4px 4px; color: var(--accent); font-size: 12px; position: sticky; top: -6px; background: var(--panel); padding: 4px; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ctlists h4:first-child { margin-top: 0; }
.ctlists h4 .cnt { color: var(--muted); font-weight: 400; font-size: 11px; }
.ctlists h4.flash { background: #2a251c; transition: background .3s; }
.ct-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.ct-item:hover { background: var(--panel2); } .ct-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-item.playing, .ct-item.open { background: #2a251c; box-shadow: inset 2px 0 0 var(--accent); }
.ct-item .ic { color: var(--muted); text-align: center; font-size: 13px; } .ct-item.playing .ic { color: var(--accent); }
.ct-item .tx { min-width: 0; } .ct-item .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-item .n2, .ct-item .d { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.ct-item.na .n { color: var(--muted); } .ct-item.na .ic { opacity: .5; }
.ct-item .btns { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.ct-msg { color: var(--muted); padding: 18px 10px; text-align: center; line-height: 1.5; } .ct-msg.small { padding: 6px 10px; font-size: 12px; }
.ct-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--topbar-h) + 8px); }
.ct-player { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 8px; }
.ct-player .nowplaying { padding: 0 0 4px; }
.ct-player .np-label { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin: 0; }
.ct-player .np-title { margin: 2px 0; overflow-wrap: anywhere; }
#ct-sub { overflow-wrap: anywhere; line-height: 1.45; }
.ct-stage { background: #000; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0 2px; position: relative; display: flex; align-items: center; justify-content: center; min-height: 240px; overflow: hidden; }
#ct-canvas { display: block; background: #000; max-width: 100%; height: auto; }
.ct-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #e8e9eb; background: rgba(0, 0, 0, .6); padding: 20px; font-size: 13px; line-height: 1.6; }
.ct-overlay.err { color: #ffb3b3; } .ct-overlay a { color: var(--accent2); }
.ct-transport { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.ct-transport #ct-seek { flex: 1; min-width: 140px; }
.ct-transport #ct-vol { width: 90px; }
#tab-contents .iconbtn { padding: 3px 9px; font-size: 15px; line-height: 1; }
.ct-info { font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ct-viewer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 360px; overflow: hidden; }
.ct-vhead { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ct-vhead .listtitle { flex: 1; min-width: 0; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a home-screen app's 「새 탭」: the viewer over the whole app (js/features/contents.js fullView) */
.ct-viewer.ct-full { position: fixed; inset: 0; z-index: 95; border: 0; border-radius: 0; min-height: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ct-viewer.ct-full .ct-frame, .ct-viewer.ct-full .ct-text { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; }
.ct-viewer.ct-full #ct-vopen { display: none; }
html.ct-full-open, html.ct-full-open body { overflow: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 2px 9px; font-size: 12px; } .seg button + button { border-left: 1px solid var(--line2); }
.seg button.active { background: var(--panel3); color: var(--accent); }
.ct-frame { width: 100%; height: calc(100vh - var(--topbar-h) - 120px); min-height: 60vh; border: 0; background: #fff; display: block; }
.ct-text { margin: 0; padding: 10px 12px; max-height: calc(100vh - var(--topbar-h) - 120px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.6; min-height: 300px; }
.ct-empty .big { font-size: 48px; margin-bottom: 8px; }
.ct-menu { border-collapse: collapse; width: calc(100% - 8px); font-size: 12px; margin: 0 4px 8px; table-layout: fixed; }
.ct-menu th, .ct-menu td { text-align: left; padding: 3px 5px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ct-menu th { color: var(--muted); font-weight: 500; white-space: nowrap; } .ct-menu th:first-child { width: 52px; } .ct-menu th:last-child { width: 40%; }
.ct-menu td.c { font-family: Consolas, "D2Coding", monospace; color: var(--muted); font-size: 11px; word-break: break-all; }
.ct-menu td .n2 { color: var(--muted); font-size: 11px; }
.ct-menu tr.link { cursor: pointer; } .ct-menu tr.link:hover td { background: var(--panel2); } .ct-menu tr.link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-menu tr.missing td { opacity: .55; }
.ct-menuexe { margin: 0 6px 8px; }
.ct-subst { display: inline-block; font-size: 10.5px; line-height: 15px; padding: 0 5px; border-radius: 4px; color: var(--accent2); border: 1px solid #2b4a66; background: #1b2531; white-space: nowrap; vertical-align: 1px; }
.ct-menu .ct-subst-line { margin-top: 3px; }
.ct-warn { color: var(--warn); font-weight: 600; }
.ct-game-title { color: var(--fg); font-weight: 400; font-size: 11px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .contents-layout { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 720px) {
  .contents-layout { grid-template-columns: minmax(0, 1fr); }
  .ctlists { max-height: none; overflow: visible; }
  .ctlists h4 { top: 0; }
  .ct-main { position: static; order: -1; }
  #tab-contents:not(.ct-open) .ct-main { display: none; }
  .ct-empty { display: none; }
  #tab-contents .ct-top select { min-height: 40px; font-size: 15px; flex: 1; min-width: 0; max-width: none; }
  #tab-contents .ct-top label.inline { flex: 1 1 100%; white-space: nowrap; }
  .ct-item { min-height: 48px; padding: 6px 8px; }
  .ct-item .btns button, .ct-item .btns a { min-height: 40px; min-width: 52px; display: inline-flex; align-items: center; justify-content: center; }
  .ct-item .btns a { padding: 0 6px; }
  .ct-menu td { padding: 9px 5px; } .ct-menu th:last-child { width: 38%; }
  .ct-player { padding: 8px 10px; }
  .ct-stage { min-height: 160px; }
  .ct-transport button { min-height: 40px; min-width: 44px; }
  .ct-transport #ct-seek { flex: 1 1 100%; order: 10; min-height: 32px; }
  .ct-transport .ct-vol { flex: 1 1 auto; } .ct-transport #ct-vol { flex: 1; width: auto; min-width: 80px; }
  .ct-vhead { gap: 8px; } .ct-vhead .listtitle { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
  .ct-vhead .seg button { min-height: 40px; padding: 2px 14px; } .ct-vhead a, #ct-vclose { min-height: 40px; display: inline-flex; align-items: center; }
  #ct-vclose { min-width: 44px; justify-content: center; margin-left: auto; }
  .ct-frame { height: 75vh; min-height: 60vh; }
  .ct-text { max-height: 75vh; }
}
#sound-store .sf-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; width: 100%; }
#cover-btn { align-self: center; margin-left: 12px; }   /* (not flush against the title's 호 label on a tablet or desktop; a phone has its own rule below) */
#sound-store .sf-item { display: inline-flex; gap: 6px; align-items: center; }
.gc-lang { margin: 0 0 6px; }

/* ---- 웹C (from WP5): 자료 tab (js/features/extras.js) - the desktop app's maps · 퍼즐 · 데이터 in the web's tab frame (music, pictures) ---- */
.ex-top label.inline { min-width: 0; max-width: 100%; } #ex-game { min-width: 0; max-width: min(420px, 100%); }
#ex-mode button small { color: var(--muted); font-size: 10.5px; margin-left: 3px; } #ex-mode button.active small { color: var(--accent); opacity: .75; }
/* the list and the view side by side (the pictures tab's .pi-layout), each scrolling on its own */
.ex-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ex-listcol { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 170px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.ex-dfilter { display: flex; gap: 6px; padding: 6px 6px 2px; } .ex-dfilter select { max-width: 52%; min-width: 0; }
.ex-dfilter input { flex: 1; min-width: 0; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; }
.ex-dfilter[hidden], .ex-panel[hidden], .ex-dimg[hidden], .ex-note[hidden], #tab-extras [hidden] { display: none !important; }
.ex-list { flex: 1; overflow: auto; padding: 4px; min-height: 80px; }
.ex-list h4 { margin: 8px 4px 2px; padding: 4px 0 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; border-bottom: 1px solid var(--line); position: sticky; top: -4px; background: var(--panel); z-index: 1; }
.ex-list h4:first-child { margin-top: 0; }
.ex-none { color: var(--muted); padding: 20px 6px; text-align: center; }
.ex-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px; border-radius: 6px; cursor: pointer; }
.ex-item:hover, .ex-ditem:hover { background: var(--panel2); }
.ex-item.selected, .ex-ditem.selected { background: var(--panel3); outline: 1px solid var(--accent); outline-offset: -1px; }
.ex-item canvas { width: 64px; height: 48px; image-rendering: pixelated; background: var(--bg2); border-radius: 3px; }
.ex-item canvas.none { opacity: .35; }
.ex-item .n { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-ditem .n { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-item .d, .ex-ditem .d { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-item .d b { color: var(--ok); font-weight: 500; }
.ex-item .n .muted, .ex-ditem .n .muted { font-size: 11px; }
.ex-sub { margin: 6px 4px 2px; font-size: 11.5px; color: var(--muted); }
.ex-ditem { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; align-items: center; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.ex-ditem .ic { display: flex; justify-content: center; color: var(--muted); } .ex-ditem .tx { min-width: 0; }
.ex-ditem .ic svg { width: 16px; height: 16px; }
.ex-view { min-width: 0; max-height: calc(100vh - 170px); overflow: auto; }
/* what the view shows: as the music tab's 「지금 재생」 and title */
.ex-np .np-title { overflow-wrap: anywhere; } .ex-np .muted { overflow-wrap: anywhere; }
#tab-extras .mini-link { font-size: 12.5px; }
.ex-empty { padding: 18px 4px; line-height: 1.6; max-width: 720px; }
.ex-empty b { color: var(--fg); } .ex-empty a { color: var(--accent2); } .ex-empty .row { margin-top: 10px; }
.ex-msg { color: var(--muted); padding: 18px 10px; text-align: center; line-height: 1.5; }
/* map: scroll box, drag to pan */
.ex-mapscroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 200px; border: 1px solid var(--line); border-radius: var(--radius); background: #000;
  cursor: grab; user-select: none; touch-action: none; }
.ex-mapscroll.drag { cursor: grabbing; }
.ex-mapscroll canvas { display: block; max-width: none; }
#exm-bg { width: 36px; height: 24px; padding: 0; border: 1px solid var(--line2); border-radius: 4px; background: none; }
/* puzzle cards */
.ex-puzgrid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding-bottom: 12px; }
.ex-puz { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 5px; max-width: 100%; }
.ex-puz.hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ex-puz canvas { display: block; image-rendering: pixelated; background: var(--bg2); border-radius: 4px; max-width: 100%; height: auto; }
.ex-puz .ph { display: flex; gap: 8px; align-items: baseline; } .ex-puz .no { color: var(--accent); font-weight: 700; min-width: 18px; } .ex-puz .goal { font-weight: 600; font-size: 13.5px; }
.ex-puz .hint, .ex-puz .other { font-size: 12px; line-height: 1.45; } .ex-puz .meta { font-size: 11px; color: var(--muted); }
.ex-puz .lb { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; margin-right: 2px; }
.ex-puz .other { color: var(--ok); } .ex-puz .other .lb { color: var(--ok); border-color: var(--ok); }
/* data: read-only JSON tree, script text lines */
.ex-note { color: var(--warn); margin: 2px 0 6px; }
.ex-dimg { display: block; max-height: 240px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; margin: 4px 0 8px; background: #000; }
.ex-json { font-family: Consolas, "Cascadia Mono", "MS Gothic", monospace; font-size: 12px; line-height: 1.55; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; overflow: auto; max-height: calc(100vh - 290px); }
.ex-json .jt-row, .ex-json summary { white-space: pre-wrap; word-break: break-word; }
.ex-json .jt-row { padding-left: 14px; }
.ex-json summary { cursor: pointer; list-style: none; border-radius: 3px; } .ex-json summary::-webkit-details-marker { display: none; }
.ex-json summary::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 2px; vertical-align: -1px; background: var(--muted);
  -webkit-mask: var(--ico-chevron-right) center / contain no-repeat; mask: var(--ico-chevron-right) center / contain no-repeat; }   /* js/features/icons.js */
.ex-json details[open] > summary::before { -webkit-mask-image: var(--ico-chevron-down); mask-image: var(--ico-chevron-down); }
.ex-note .ico { vertical-align: -.2em; }
.ex-json summary:hover { background: var(--panel2); }
.ex-json .jt-body { margin-left: 5px; padding-left: 10px; border-left: 1px dotted var(--line2); }
.jt-k { color: #9cc7ff; } .jt-i { color: var(--muted); } .jt-s { color: #b5e08a; } .jt-n { color: #ffcf7a; } .jt-b { color: #d6a8ff; } .jt-t { color: var(--muted); }
.jt-p { color: #6c727b; } .ex-json details[open] > summary > .jt-p { display: none; }
.ex-lines .ln { display: grid; grid-template-columns: 64px 46px minmax(0, 1fr); gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.ex-lines.noblk .ln { grid-template-columns: 64px minmax(0, 1fr); }
.ex-lines .off { color: var(--muted); } .ex-lines .blk { color: #c98f3c; }
.ex-lines .tx { white-space: pre-wrap; word-break: break-word; font-family: "MS Gothic", "Malgun Gothic", monospace; } .ex-lines .cc { color: #6c727b; }
.ex-lines > button { margin: 8px 0; }
@media (max-width: 720px) {
  .ex-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ex-top label.inline { flex: 1 1 100%; } #ex-game { flex: 1; max-width: none; }
  .ex-listcol { max-height: 40vh; } .ex-view { max-height: none; overflow: visible; }
  #tab-extras button, #tab-extras select, #tab-extras .ex-dfilter input { min-height: 40px; }
  #tab-extras .seg button { padding: 3px 14px; }
  #tab-extras label.toggle { min-height: 40px; }
  #tab-extras .mini-link { display: inline-flex; align-items: center; min-height: 40px; }
  #exm-bg { width: 44px; height: 40px; }
  .ex-ditem { min-height: 44px; } .ex-item { min-height: 56px; }
  .ex-mapscroll { max-height: 60vh; }
  .ex-json { max-height: 70vh; }
  .ex-puz .meta a.ans, .ex-empty a[data-key] { display: inline-block; padding: 13px 2px; margin: -13px 0; }   /* a 40px tap target in a line of text */
}
/* ---- 웹C end ---- */
/* ---- coordinator: the loader's 「?」 and its list of file types ---- */
#fmt-help { min-width: 44px; padding-left: 12px; padding-right: 12px; font-weight: 700; }
.btn-pair { display: inline-flex; gap: inherit; column-gap: 8px; flex-wrap: nowrap; }   /* 「?」 stays beside 구글 드라이브 when the row wraps */
.fmt-dlg { width: min(92vw, 480px); padding: 20px 22px 18px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg2); color: var(--fg); }
.fmt-dlg::backdrop { background: rgba(0, 0, 0, .55); }
.fmt-dlg h3 { margin: 0 0 16px; font-size: 17px; }
.fmt-dlg dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 18px; margin: 0 0 14px; align-items: baseline; }
.fmt-dlg dt { font-weight: 700; color: var(--accent); white-space: nowrap; }
.fmt-dlg dd { margin: 0; line-height: 1.65; word-spacing: 1px; }
.fmt-dlg form { margin: 16px 0 0; text-align: right; }
.fmt-dlg form button { min-width: 88px; min-height: 40px; }
/* ---- coordinator end ---- */

/* ---- coordinator: the play header on a phone — 「이 화면을 표지로」 and 「엔딩 봄」 under the title, not over its 호 label ---- */
@media (max-width: 720px) {
  .playhead { flex-wrap: wrap; row-gap: 6px; column-gap: 8px; align-items: center; }
  .playhead > div:first-child { flex: 1 1 100%; min-width: 0; }
  #play-title small { white-space: nowrap; }
  .playhead #cover-btn { margin-left: auto; }
  .playhead #cover-btn + #ending { margin-left: 0; }
  .playhead #cover-btn, .playhead #ending { min-height: 36px; padding-top: 0; padding-bottom: 0; font-size: 14px; }
}
/* ---- coordinator end ---- */
