:root {
  --bg: #12141a;
  --panel: #1b1e27;
  --panel2: #232734;
  --line: #2e3344;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #ffcc33;
  --accent-ink: #1a1400;
  --pick: #3a6df0;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif;
  font-size: 15px; line-height: 1.45;
  min-height: 100vh;
}
button, input, select { font: inherit; }

.bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.logo { font-size: 18px; margin: 0; letter-spacing: -0.02em; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #4a5170; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.run { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.big { font-size: 20px; padding: 12px 36px; border-radius: 12px; margin-top: 14px; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }

.wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px;
  padding: 16px; max-width: 1400px; margin: 0 auto;
}
.stage { min-width: 0; }
.screen {
  position: relative; background: #000; border-radius: 10px; overflow: hidden;
  aspect-ratio: 4 / 3; width: 100%; max-height: calc(100vh - 140px);
  margin: 0 auto;
}
.screen canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: none; }
.cover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at center, #22263a 0%, #0b0c10 75%);
  padding: 16px;
}
.cover.hidden { display: none; }
.cover-sys { color: var(--accent); font-weight: 700; font-size: 14px; }
.cover-title { font-size: 22px; font-weight: 700; margin-top: 6px; word-break: keep-all; }
.cover-status { color: var(--muted); font-size: 13px; margin-top: 12px; min-height: 1.4em; }
.cover-status.err { color: #ff8a8a; }
.progress { width: min(320px, 70vw); height: 4px; background: #2a2e3d; border-radius: 4px; margin: 8px auto 0; overflow: hidden; visibility: hidden; }
.progress.on { visibility: visible; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.now { color: var(--muted); font-size: 13px; margin: 8px 2px; min-height: 1.2em; }
.keys { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.keys summary { cursor: pointer; font-weight: 700; }
.keys table { border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.keys th { text-align: left; color: var(--muted); font-weight: 400; padding: 3px 8px 3px 0; white-space: nowrap; }
.keys td { padding: 3px 18px 3px 0; white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.list {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 100px);
  position: sticky; top: 72px;
}
.search { padding: 10px; border-bottom: 1px solid var(--line); }
.search input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.systems { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); max-height: 168px; overflow: auto; }
.systems > button {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer;
}
.systems > button.on { background: var(--pick); border-color: var(--pick); color: #fff; }
.systems > button small { color: var(--muted); margin-left: 3px; }
.systems > button.on small { color: #dfe6ff; }
.games { list-style: none; margin: 0; padding: 4px; overflow: auto; flex: 1; min-height: 120px; }
.games li {
  padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
}
.games li:hover { background: var(--panel2); }
.games li.on { background: var(--pick); color: #fff; }
.games li small { color: var(--muted); white-space: nowrap; }
.games li.on small { color: #dfe6ff; }
.games .empty { color: var(--muted); cursor: default; }
.more { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.file { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); width: 100%; }
.file select { max-width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.file input { max-width: 100%; font-size: 12px; color: var(--muted); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin-top: 0; font-size: 18px; }
dialog li { margin: 4px 0; }

:fullscreen .screen, .screen:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; padding: 10px 16px; }
  .list { position: static; max-height: none; }
  .games { max-height: 55vh; }
  .screen { max-height: 70vh; }
  .keys { display: none; }
  body.touch .keys { display: none; }
}
@media (max-width: 560px) {
  .bar { padding: 8px 12px; gap: 8px; }
  .logo { font-size: 16px; }
  .btn { padding: 6px 9px; font-size: 13px; }
  .cover-title { font-size: 18px; }
}
body.playing.touch .bar .actions .btn:not(.run):not(#btnMenu):not(#btnFull):not(#btnStop) { display: none; }

/* ---- 회원제 추가 ---- */
[hidden] { display: none !important; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; display: block; }
.bar .user { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.me { position: relative; }
.me summary { list-style: none; cursor: pointer; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.me summary::-webkit-details-marker { display: none; }
.me-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 200px; z-index: 20; }
.me-info { color: var(--muted); font-size: 13px; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(ellipse at top, #22263a 0%, var(--bg) 70%); }
.auth-box { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; }
.logo.big { font-size: 26px; text-align: center; }
.auth-sub { color: var(--muted); font-size: 14px; text-align: center; margin: 8px 0 16px; word-break: keep-all; }
.notice { background: #2a2610; border: 1px solid #5a4c14; color: #ffe08a; border-radius: 8px; padding: 8px 10px; font-size: 14px; white-space: pre-wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs button { flex: 1; padding: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font: inherit; }
.tabs button.on { background: var(--panel2); color: var(--text); border-color: #4a5170; font-weight: 700; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.form label small { color: var(--muted); font-size: 12px; }
.form input, .admin textarea, .admin select { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn.wide { width: 100%; padding: 10px; font-size: 16px; }
.err { color: #ff8a8a; font-size: 14px; margin: 0; min-height: 1.2em; }
.row-btns { display: flex; gap: 8px; }

.admin { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow: auto; padding: 16px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto 12px; }
.admin-head h2 { margin: 0; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 1200px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card h3 small { color: var(--muted); font-weight: 400; }
.card .row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card .col { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; }
table.users { border-collapse: collapse; width: 100%; font-size: 13px; }
table.users th, table.users td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users th { color: var(--muted); font-weight: 400; }
table.users td .btn { margin-right: 4px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); }
.tag.adm { background: #3a2f0a; border-color: #6b5612; color: var(--accent); }
.tag.off { background: #3a1414; border-color: #6b2424; color: #ff9a9a; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } .bar .user { margin-left: 0; } }

/* 조작법(오른쪽 목록 아래) */
.list .keys { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 12px; background: transparent; }
.list .keys summary { font-size: 14px; }
.list .keys summary small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.keygrid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; align-items: center; margin-top: 8px; font-size: 13px; }
.keygrid .kname { color: var(--muted); white-space: nowrap; }
kbd {
  display: inline-block; min-width: 24px; padding: 1px 6px; margin-right: 3px; text-align: center;
  font: 600 12px/18px ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--text);
  background: var(--panel2); border: 1px solid #454b60; border-bottom-width: 2px; border-radius: 5px;
}
.list .games { min-height: 160px; }
.games li .ko-sub { display: block; color: var(--muted); font-size: 12px; }
.games li.on .ko-sub { color: #dfe6ff; }
body.touch .list .keys { display: none; }

.systems > button.lib { border-color: #6b5612; }
.systems > button.lib::before { content: "★ "; color: var(--accent); }
.systems > button.lib.on::before { color: #fff; }

/* 오른쪽 칸 공간 나누기 */
.list { max-height: calc(100vh - 96px); }
.systems { flex-shrink: 0; }
.list .games { min-height: 200px; flex: 1 1 auto; }
.keygrid { grid-template-columns: auto auto auto auto; gap: 4px 8px; }
.list .keys { flex-shrink: 0; }
.list .keys .hint { margin-top: 6px; font-size: 12px; }
details.more { border-top: 1px solid var(--line); padding: 8px 12px; flex-shrink: 0; display: block; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.more .file { margin-top: 6px; }

.btn.stop:not(:disabled) { background: #3a1f24; border-color: #7a3a44; color: #ffd0d6; font-weight: 700; }

.addgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.addgrid .col { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.addgrid .col small { color: var(--muted); }
.addgrid input:not([type=radio]), .addgrid select { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.addgrid .row { display: flex; gap: 6px; align-items: center; margin: 0; }

.keydos p { font-size: 13px; margin: 6px 0; color: var(--text); line-height: 1.7; }

.folder-form { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.folder-form .col { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.wide-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.browse { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; overflow: auto; }
td.path { white-space: normal; word-break: break-all; max-width: 320px; color: var(--muted); }
.folder-form .row { display: flex; gap: 6px; align-items: center; font-size: 14px; }

.gnote { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 8px; font-size: 14px; }
#gameNoteText { white-space: pre-line; line-height: 1.6; }
.gnote details { margin-top: 8px; }
.gnote summary { cursor: pointer; color: var(--accent); }
.gnote pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: var(--muted); max-height: 360px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 8px; }

.systems > button.admin-only-sys::before { content: "🔒 "; }


/* 목록을 두 번 눌러도 글자가 블록 지정되지 않게 */
.games li, .systems > button, .btn, .keygrid { -webkit-user-select: none; user-select: none; }
/* 전체 화면일 때 게임 칸 */
.screen:fullscreen { background: #000; }
.screen:fullscreen .cover { display: none; }

/* 회원 가입 승인·성인 등급 */
.systems > button.adult-sys { border-color: #6b2440; }
.systems > button.adult-sys::before { content: "🔞 "; }
.tag.wait { background: #0f2a3a; border-color: #1f5a7a; color: #9ad8ff; }
.tag.adult { background: #3a1428; border-color: #6b2440; color: #ff9ac4; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.form label.check input { margin-top: 3px; }
.form .ok { color: #8fe3a8; font-size: 14px; line-height: 1.5; margin: 0; }
#btnAdmin.alert { border-color: #1f5a7a; color: #9ad8ff; }

/* 비회원 화면: 로그인·가입 창은 게임 화면 위에 뜬다 */
.auth { position: fixed; inset: 0; z-index: 50; min-height: 0; overflow-y: auto; background: rgba(8,9,13,.78); backdrop-filter: blur(2px); align-items: flex-start; padding-top: max(24px, 6vh); }
.auth-box { position: relative; }
.auth-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.auth-close:hover { background: var(--panel2); color: var(--text); }
.notice.info { background: #10243a; border-color: #1f4a7a; color: #bfe0ff; margin: 0 0 12px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.auth-switch a, .guest-note a { color: var(--accent); }
.guest-note { margin: 0; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: #bfe0ff; background: #10243a; border-bottom: 1px solid #1f4a7a; word-break: keep-all; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; vertical-align: -4px; margin-right: 4px; flex: none; }
#btnHelp, #btnLogin, .me summary { display: inline-flex; align-items: center; }
.me summary .ico { margin-right: 6px; }
.systems > button.locked-sys { opacity: .8; border-style: dashed; }
.systems > button.locked-sys::before { content: "🔒 "; }
.games li.locked-msg { line-height: 1.6; padding: 14px 12px; word-break: keep-all; }
.locked-btns { display: flex; gap: 6px; margin-top: 10px; }
dialog.manual { max-width: 640px; max-height: 86vh; }
dialog.manual details { border-top: 1px solid var(--line); padding: 8px 0; }
dialog.manual summary { cursor: pointer; font-weight: 600; color: var(--accent); }
dialog.manual ul, dialog.manual ol { padding-left: 20px; margin: 8px 0; }
dialog.manual p { margin: 8px 0; }
@media (max-width: 560px) { #btnHelp span { display: none; } #btnHelp .ico { margin-right: 0; } }
.form label.check span { display: flex; flex-direction: column; gap: 2px; }
.games li.locked-msg { display: block; }
.locked-btns .btn { flex: none; }

/* ---- 관리 화면: 메뉴 + 쪽 ---- */
.admin { padding: 0; }
.adm-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.adm-side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; }
.adm-brand b { display: block; font-size: 20px; letter-spacing: -0.02em; }
.adm-brand small { color: var(--muted); font-size: 13px; }
.adm-nav { display: flex; flex-direction: column; gap: 4px; }
.adm-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; }
.adm-nav button:hover { background: var(--panel2); color: var(--text); }
.adm-nav button.on { background: #262c45; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.adm-nav .ico { width: 20px; height: 20px; margin: 0; }
.badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #d9493f; color: #fff; font-size: 12px; font-style: normal; text-align: center; line-height: 18px; }
.adm-close { margin-top: auto; }
.adm-main { padding: 22px 28px 60px; max-width: 1240px; width: 100%; min-width: 0; }
.adm-title { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.02em; }
.adm-title small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.adm-page .card { margin-bottom: 12px; }
.adm-page .hint { color: var(--muted); font-size: 13px; }
.card.flat { padding: 0; overflow: hidden; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: #46507a; transform: translateY(-1px); }
.stat b { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.stat span { font-size: 14px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat.hot { border-color: #6b5612; background: linear-gradient(180deg, #2a2410, var(--panel)); }
.stat.hot b { color: var(--accent); }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
ul.plain li { align-items: center; }
ul.plain li .when { color: var(--muted); white-space: nowrap; margin-left: 6px; font-size: 12px; }
ul.plain li.muted, td.muted { color: var(--muted); }
ul.plain li .acts { display: flex; gap: 4px; flex: none; }
.tag.mini { font-size: 11px; padding: 0 6px; margin-left: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chips button:hover { color: var(--text); }
.chips button.on { background: var(--pick); border-color: var(--pick); color: #fff; }
#userSearch { margin-left: auto; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; min-width: 220px; }
table.users td .sub { display: block; color: var(--muted); font-size: 12px; }
table.users tr.row-wait td { background: rgba(31, 90, 122, .14); }
table.users tr.row-off td { opacity: .6; }
table.users td.acts { white-space: nowrap; }
table.users td.detail { white-space: normal; color: var(--muted); max-width: 560px; word-break: break-all; }
.card.flat table.users th, .card.flat table.users td { padding: 9px 12px; }
.card.flat table.users th { background: var(--panel2); }
table.users tbody tr:hover td, table.users tr:hover td { background: rgba(255, 255, 255, .02); }
.btn.danger { border-color: #6b2424; color: #ff9a9a; }
.btn.danger:hover:not(:disabled) { background: #3a1414; }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { position: sticky; top: 0; height: auto; padding: 10px 12px 6px; gap: 8px; z-index: 3; border-right: 0; border-bottom: 1px solid var(--line); }
  .adm-brand { display: flex; align-items: baseline; gap: 8px; padding-right: 150px; }
  .adm-brand b { display: inline; font-size: 18px; }
  .adm-nav { flex-direction: row; overflow-x: auto; gap: 2px; scrollbar-width: none; margin: 0 -4px; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-nav button { width: auto; flex: none; padding: 8px 10px; font-size: 14px; gap: 6px; }
  .adm-nav button.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .adm-nav .ico { width: 18px; height: 18px; }
  .adm-close { position: absolute; top: 8px; right: 12px; margin: 0; padding: 6px 10px; font-size: 13px; }
  .adm-main { padding: 14px 16px 60px; }
  .adm-cols { grid-template-columns: 1fr; }
  #userSearch { margin-left: 0; width: 100%; min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
table.users td.path { white-space: normal; word-break: break-all; min-width: 160px; max-width: 300px; color: var(--muted); }
table.users td.dates { white-space: nowrap; }
table.users td.acts .acts-in { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; max-width: 220px; }
table.users td.acts .btn { margin: 0; }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
}
/* 휴대폰: 표를 카드처럼 */
@media (max-width: 700px) {
  table.users.cards, table.users.cards tbody, table.users.cards tr, table.users.cards td { display: block; width: 100%; }
  table.users.cards tr:first-child { display: none; }
  table.users.cards tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .card.flat table.users.cards td { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 0; border: 0; white-space: normal; max-width: none; }
  table.users.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; flex: 0 0 84px; }
  table.users.cards td[data-label=""]::before { display: none; }
  table.users.cards td .sub { display: inline; margin-left: 4px; }
  table.users.cards td.acts .acts-in { max-width: none; min-width: 0; }
  table.users.cards td.path { min-width: 0; }
}
/* 게임 이름·설명 고치기 */
.edit-bar { margin-top: 8px; }
.edit-bar .btn { display: inline-flex; align-items: center; }
dialog.game-edit { max-width: 640px; }
dialog.game-edit textarea { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
dialog.game-edit select { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.ge-dos { display: flex; flex-direction: column; gap: 12px; }
.ge-dos[hidden] { display: none !important; }

/* 게임 카드(실행 전 화면 칸) */
.cover { overflow: hidden; }
.cover-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(20px) brightness(.32) saturate(1.2); transform: scale(1.06); }
.cover-in { position: relative; display: flex; gap: 24px; align-items: center; max-width: 94%; max-height: 100%; text-align: left; }
.cover-in.empty { flex-direction: column; text-align: center; gap: 0; }
.cover-in.empty .cover-row { justify-content: center; }
.cover-art { flex: 0 0 auto; display: flex; align-items: center; }
.cover-art img { display: block; max-width: min(240px, 30vw); max-height: min(330px, 58vh); width: auto; height: auto; border-radius: 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, .55); }
.cover-art.snapart img { max-width: min(300px, 34vw); image-rendering: pixelated; border: 1px solid rgba(255, 255, 255, .12); }
.cover-info { min-width: 0; max-width: 470px; }
.cover-title { line-height: 1.3; }
.cover-orig { color: #a9b0c2; font-size: 13px; margin-top: 4px; word-break: break-word; }
.cover-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cover-tags:empty { display: none; }
.cover-tags span { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #e6e9f2; }
.cover-desc { color: #d3d7e2; font-size: 14px; line-height: 1.65; margin: 12px 0 0; max-height: 8.4em; overflow: auto; white-space: pre-line; word-break: keep-all; }
.cover-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.cover-row .btn.big { margin: 0; }
.cover-snap { width: 150px; height: auto; border-radius: 6px; image-rendering: pixelated; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
@media (max-width: 700px) {
  .cover-in { gap: 12px; }
  .cover-art img { max-width: 28vw; max-height: 40vh; }
  .cover-art.snapart img { max-width: 36vw; }
  .cover-title { font-size: 17px; }
  .cover-desc { font-size: 12.5px; max-height: 4.2em; margin-top: 8px; }
  .cover-snap { display: none; }
  .cover-row { margin-top: 10px; }
  .cover-tags { margin-top: 6px; }
}
/* 휴대폰: 실행 전에는 화면 칸이 카드 내용만큼 늘어난다 */
@media (max-width: 700px) {
  body:not(.playing) .screen { aspect-ratio: auto; height: auto; max-height: none; }
  body:not(.playing) .cover { position: relative; inset: auto; min-height: 230px; padding: 18px 14px; }
  .cover-in { max-width: 100%; align-items: flex-start; }
  .cover-art img { max-width: 30vw; max-height: 46vw; }
  .cover-row .btn.big { font-size: 17px; padding: 9px 24px; }
  .cover-desc { max-height: 6.4em; }
}

/* 이 기기에 받아 둔 게임 */
dialog.devdlg { max-width: 600px; }
.dev-sum { color: var(--muted); font-size: 13px; }
.dev-list { list-style: none; padding: 0; margin: 8px 0; max-height: 52vh; overflow: auto; }
.dev-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); margin: 0; }
.dev-list li.empty { color: var(--muted); display: block; }
.dev-list .t { flex: 1; min-width: 0; }
.dev-list .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dev-list .t small { color: var(--muted); font-size: 12px; }
#coverTags span.dev { border-color: var(--accent); color: var(--accent); }

/* 새 가입 신청 알림(관리자) */
.pend-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.45); max-width: calc(100% - 32px); }
.pend-banner span { font-weight: 600; }
.pend-banner[hidden] { display: none; }

/* 회원 정보 수정 */
dialog.prof { max-width: 560px; }
.prof-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.prof-info dt { color: var(--muted); }
.prof-info dd { margin: 0; word-break: break-all; }
dialog .row-btns { flex-wrap: wrap; }

/* 공지 띠 */
.site-banner { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 16px 0; padding: 9px 12px;
  border: 1px solid var(--accent); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 14px; }
.site-banner[hidden] { display: none; }
.site-banner span { white-space: pre-line; }

button.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
dialog.prof select { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
#auMore { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ===================== 디자인 다듬기 (2026-10-21) ===================== */
/* 어두운 스크롤 막대 */
* { scrollbar-width: thin; scrollbar-color: #3a4155 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #353b4e; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #4a5270; border: 2px solid transparent; background-clip: padding-box; }

/* 위쪽 막대: 로고에 작은 오락기 표시 */
.bar .logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.03em; }
.bar .logo::before {
  content: ""; width: 28px; height: 28px; flex: 0 0 auto;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23ffd447'/><stop offset='1' stop-color='%23ff8a3d'/></linearGradient></defs><rect x='1' y='6' width='24' height='14' rx='7' fill='url(%23g)'/><rect x='5.6' y='10' width='2.2' height='6.4' rx='.6' fill='%231b1c22'/><rect x='3.5' y='12.1' width='6.4' height='2.2' rx='.6' fill='%231b1c22'/><circle cx='17.6' cy='11.6' r='1.6' fill='%231b1c22'/><circle cx='20.6' cy='14.6' r='1.6' fill='%231b1c22'/></svg>") center/contain no-repeat;
}
.btn { transition: background-color .15s, border-color .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.run:hover:not(:disabled) { filter: brightness(1.06); }

/* 오른쪽 목록 */
.list { overflow: hidden; }
.search input { padding: 9px 12px; border-radius: 10px; }
.search input:focus { outline: none; border-color: #4a5aa0; box-shadow: 0 0 0 3px rgba(58, 109, 240, .18); }
.systems { max-height: min(34vh, 300px); gap: 5px 4px; padding: 6px 10px 10px; align-content: flex-start; overflow-x: hidden; }
.sys-head { flex: 0 0 100%; box-sizing: border-box; font-size: 11.5px; font-weight: 700; color: #8a93a8; letter-spacing: .02em; margin: 6px 0 0; padding: 0 2px; }
.sys-head:first-child { margin-top: 2px; }
.systems > button { padding: 4px 10px; transition: background-color .12s, border-color .12s; }
.systems > button:hover:not(.on) { background: var(--panel2); border-color: #444b62; }
.games { padding: 6px; }
.games li { align-items: center; justify-content: flex-start; gap: 10px; padding: 6px 8px; margin-bottom: 2px; }
.games li .gthumb {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: #252a38;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.games li .gthumb.ph {
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #8d96ad;
  background: linear-gradient(135deg, #262b3a, #1d212d);
}
.games li.on .gthumb.ph { color: #fff; background: rgba(255, 255, 255, .16); }
.games li .gtext { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.games li .gt { font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; }
.games li .ko-sub { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.games li .ko-sys { font-size: 11px; color: #7f88a0; }
.games li.on .ko-sys { color: #dfe6ff; }
.games li.on { box-shadow: 0 4px 14px rgba(58, 109, 240, .28); }

/* 화면 칸: 빈 화면·게임 카드 */
.screen { border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border: 1px solid #222634; }
.cover-in.empty .cover-sys { font-size: 13px; letter-spacing: .04em; }
.cover-in.empty .cover-title { font-size: 21px; font-weight: 600; color: #dfe3ee; max-width: 520px; }
.cover-title { font-size: 26px; letter-spacing: -0.02em; }
.cover-sys { font-size: 13px; }
.cover-art img { max-width: min(280px, 30vw); max-height: min(360px, 60vh); border-radius: 10px; }
.cover-desc { max-height: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; cursor: pointer; }
.cover-desc.open { -webkit-line-clamp: unset; display: block; max-height: 40vh; overflow: auto; }
.cover-desc:not(.open)::after { content: ""; }
.cover-tags span { background: rgba(255, 255, 255, .07); }
.btn.big { box-shadow: 0 8px 24px rgba(255, 204, 51, .22); }

/* 최근에 한 게임 */
.cover-recent { margin-top: 26px; width: min(620px, 86vw); }
.cover-recent[hidden] { display: none; }
.rc-head { font-size: 12.5px; color: #9aa1b2; font-weight: 700; margin-bottom: 8px; }
.rc-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rc {
  width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; color: var(--text);
  transition: background-color .15s, transform .15s;
}
.rc:hover { background: rgba(255, 255, 255, .09); transform: translateY(-2px); }
.rc img, .rc .rc-ph { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; background: #252a38; }
.rc .rc-ph { display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #8d96ad; }
.rc-t { font-size: 11.5px; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; }

/* 휴대폰 */
@media (max-width: 860px) {
  .systems { max-height: 26vh; }
  .cover-title { font-size: 19px; }
  .cover-in.empty .cover-title { font-size: 16px; }
  .cover-desc { -webkit-line-clamp: 3; }
  .rc { width: 78px; } .rc img, .rc .rc-ph { width: 54px; height: 54px; }
  .cover-recent { margin-top: 16px; }
  .games li .gthumb { width: 36px; height: 36px; }
}
/* 고른 게임이 없을 때 큰 실행 단추는 숨김(안내 글만), 휴대폰에서는 게임 중이 아닐 때 못 누르는 단추를 숨겨 위쪽 막대를 한 줄로 */
.cover-in.empty .btn.big:disabled { display: none; }
@media (max-width: 700px) {
  body:not(.playing) .bar .actions .btn:disabled { display: none; }
}

/* ===================== 회원 그룹·활동 (2026-10-21) ===================== */
.systems > button.group-sys { border-color: #2f5a8a; }
.systems > button.group-sys::before { content: "👥 "; }
.gchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--gc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--gc) 55%, transparent); color: #eef1f8; white-space: nowrap; margin: 1px 4px 1px 0;
}
.gchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gc); flex: 0 0 auto; }
.gchip.mini { font-size: 11.5px; padding: 0 7px 0 6px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.gcard { border-top: 3px solid var(--gc); display: flex; flex-direction: column; gap: 8px; }
.gcard-head { display: flex; align-items: center; gap: 8px; }
.gcard-head b { font-size: 17px; }
.gcard-head small { margin-left: auto; color: var(--muted); }
.gdot { width: 12px; height: 12px; border-radius: 50%; background: var(--gc); flex: 0 0 auto; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 25%, transparent); }
.gcard p.hint { margin: 0; }
.gsec { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.gsec > small:first-child { flex: 0 0 74px; color: var(--muted); }
.gsec .tag.mini { margin-left: 0; }
.gcard .row-btns { margin-top: auto; flex-wrap: wrap; }
.linklike.mini { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--panel2); }
.group-form { border-color: #3a4a7a; }
.group-form h3 { margin-bottom: 12px; }
.group-form .check, .admin .group-form label.col { margin-bottom: 10px; }
.group-form input[type=color] { width: 64px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.pick-box { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; background: rgba(0, 0, 0, .12); }
.pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pick-head input[type=search] { margin-left: auto; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 200px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 8px; padding: 8px 10px; max-height: 260px; overflow: auto; }
.pick-list > .hint { padding: 4px 2px; }
.pick { display: flex; align-items: flex-start; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.pick:hover { background: var(--panel2); }
.pick[hidden] { display: none; }
.pick input { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--pick); }
.pick-t { min-width: 0; word-break: keep-all; }
.pick-t small { color: var(--muted); }
.pick-t .tag.mini { margin-left: 4px; }
dialog .pick-box { margin: 4px 0 8px; }
dialog .pick-list { grid-template-columns: 1fr; max-height: 180px; }
.bulk-bar {
  position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px;
  background: #1d2440; border: 1px solid #3a4a7a; border-radius: 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.bulk-bar select, .filter-bar select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
table.users th.sel, table.users td.sel { width: 28px; padding-right: 0; }
table.users td.sel input, table.users th.sel input { width: 16px; height: 16px; accent-color: var(--pick); }
table.users tr.row-sel td { background: rgba(58, 109, 240, .10); }
table.users td.groups { white-space: normal; min-width: 90px; }
.stat.live b { color: #6fe39b; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; margin-right: 6px; box-shadow: 0 0 0 3px rgba(63, 209, 122, .18); vertical-align: 1px; }
ol.rank { counter-reset: rank; }
ol.rank li { counter-increment: rank; }
ol.rank li > span:first-child::before { content: counter(rank) ". "; color: var(--accent); font-weight: 700; }
.au-act { margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.au-act summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.au-act h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.au-act ul.plain { max-height: 180px; overflow: auto; font-size: 13px; }
.site-banner.group-banner { border-color: #3a4a7a; background: #172038; color: #cfe0ff; }
@media (max-width: 700px) {
  .group-grid { grid-template-columns: 1fr; }
  .pick-list { grid-template-columns: 1fr; }
  .pick-head input[type=search] { margin-left: 0; min-width: 0; width: 100%; }
  .gsec > small:first-child { flex-basis: 100%; }
}
.group-form label.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.group-form label.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--pick); }
.group-form label.check span { display: flex; flex-direction: column; gap: 2px; }
.group-form label.check small, .group-form > label.col small { color: var(--muted); font-size: 12.5px; }
.group-form > label.col { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.folder-form .pick-box { margin-top: 0; }
.form label.pick { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 14px; }
ol.plain { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ol.plain li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.adm-page > p.hint { margin: 0 0 12px; line-height: 1.6; }
table.users td .sub + .sub { margin-left: 0; }
ol.plain li { align-items: center; }
ol.plain li .when { color: var(--muted); white-space: nowrap; margin-left: 6px; font-size: 12px; }
.muted { color: var(--muted); }

/* ===================== 목록 두 단계·읽기 쉽게 (2026-10-22) ===================== */
.wrap { grid-template-columns: minmax(0, 1fr) 420px; max-width: 1720px; gap: 20px; }
.list { max-height: calc(100vh - 92px); }
.search { padding: 12px; }
.search input { font-size: 15px; padding: 11px 14px; }
.search input::placeholder { color: #8a92a8; }
/* ① 게임 종류 */
.list .systems { display: block; flex: 1 1 auto; max-height: none; min-height: 0; overflow: auto; padding: 4px 12px 16px; border-bottom: 0; }
.list .systems[hidden], .list .games[hidden] { display: none; }
.sys-head { display: flex; align-items: baseline; gap: 8px; margin: 16px 2px 10px; font-size: 14px; font-weight: 700; color: #d5daea; letter-spacing: 0; }
.sys-head:first-child { margin-top: 8px; }
.sys-head small { font-size: 12.5px; font-weight: 400; color: #8a92a8; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.sys-card {
  display: flex; flex-direction: column; gap: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: #1c2030; border: 1px solid #2c3246; border-radius: 12px; color: var(--text); font: inherit;
  transition: border-color .15s, transform .15s, background-color .15s;
}
.sys-card:hover { border-color: #4b5680; background: #20253a; transform: translateY(-2px); }
.sys-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sys-card.on { border-color: var(--pick); box-shadow: 0 0 0 1px var(--pick); }
.sys-art { position: relative; display: block; height: 92px; background: #141722; overflow: hidden; }
.sys-art img { position: absolute; top: 0; height: 100%; object-fit: cover; }
.sys-art.n1 img { left: 0; width: 100%; }
.sys-art.n2 img:nth-child(1) { left: 0; width: 50%; } .sys-art.n2 img:nth-child(2) { left: 50%; width: 50%; }
.sys-art.n3 img:nth-child(1) { left: 0; width: 34%; } .sys-art.n3 img:nth-child(2) { left: 33%; width: 34%; } .sys-art.n3 img:nth-child(3) { left: 66%; width: 34%; }
.sys-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 12, 18, .55)); }
.sys-art.ph { background: linear-gradient(135deg, hsl(var(--ph) 45% 30%), hsl(calc(var(--ph) + 40) 40% 16%)); }
.sys-art.ph::after {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'><rect x='1' y='6' width='24' height='14' rx='7' fill='%23ffffff' fill-opacity='.22'/><rect x='5.6' y='10' width='2.2' height='6.4' rx='.6' fill='%23ffffff' fill-opacity='.55'/><rect x='3.5' y='12.1' width='6.4' height='2.2' rx='.6' fill='%23ffffff' fill-opacity='.55'/><circle cx='17.6' cy='11.6' r='1.6' fill='%23ffffff' fill-opacity='.55'/><circle cx='20.6' cy='14.6' r='1.6' fill='%23ffffff' fill-opacity='.55'/></svg>") center/46px no-repeat;
}
.sys-txt { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 11px; min-width: 0; }
.sys-name { font-size: 15px; font-weight: 700; line-height: 1.35; color: #f2f4fa; word-break: keep-all; overflow-wrap: anywhere; }
.sys-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: #a3abc0; }
.sys-meta em { font-style: normal; font-size: 12px; padding: 0 7px; border-radius: 999px; border: 1px solid #3a4158; color: #cfd5e6; }
.sys-card.k-lib .sys-meta em { border-color: #6b5612; color: #ffd76a; }
.sys-card.k-adult .sys-meta em { border-color: #6b2440; color: #ff9ac4; }
.sys-card.k-group .sys-meta em { border-color: #2f5a8a; color: #9cc8ff; }
.sys-card.k-locked { opacity: .82; }
/* ② 게임 이름 목록 */
.lib-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #1a1e2c; }
.lib-head[hidden] { display: none; }
.lib-back {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px 8px 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid #3a4158; background: #232838; color: #e8ebf4; font: inherit; font-size: 14px; font-weight: 600;
}
.lib-back:hover { border-color: #56608a; background: #2a3044; }
.lib-back .ico { width: 18px; height: 18px; margin: 0; stroke-width: 2.4; }
.lib-title { min-width: 0; display: flex; flex-direction: column; }
.lib-title b { font-size: 16px; line-height: 1.3; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-title span { font-size: 12.5px; color: #a3abc0; }
.list .games { padding: 6px 8px; }
.games li { gap: 12px; padding: 8px 10px; margin-bottom: 2px; border-radius: 10px; }
.games li .gthumb { width: 48px; height: 48px; border-radius: 8px; }
.games li .gthumb.ph { font-size: 19px; color: rgba(255, 255, 255, .9); background: linear-gradient(135deg, hsl(var(--ph) 42% 34%), hsl(calc(var(--ph) + 40) 38% 20%)); }
.games li .gt { font-size: 15.5px; font-weight: 600; line-height: 1.35; color: #f2f4fa; }
.games li .ko-sub { font-size: 13px; color: #a3abc0; margin-top: 2px; }
.games li .ko-sys { font-size: 12.5px; color: #8fa0c8; margin-top: 1px; }
.games li:hover { background: #232838; }
.games li.on { background: var(--pick); }
.games li.on .gt { color: #fff; }
.games li.on .ko-sub, .games li.on .ko-sys { color: #e3e9ff; }
.games .empty { font-size: 14px; padding: 14px 12px; line-height: 1.6; }
/* 게임 카드(화면 칸) */
.cover-sys { font-size: 14px; font-weight: 700; letter-spacing: 0; }
.cover-title { font-size: 30px; line-height: 1.3; font-weight: 800; color: #fff; }
.cover-orig { font-size: 14px; color: #b9c0d2; }
.cover-tags span { font-size: 13px; padding: 3px 11px; }
.cover-desc { font-size: 15px; line-height: 1.75; color: #dfe3ee; }
.cover-status { font-size: 14px; color: #a9b1c6; }
.cover-ph {
  flex: 0 0 auto; width: min(240px, 28vw); aspect-ratio: 3 / 4; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(150deg, hsl(var(--ph) 45% 34%), hsl(calc(var(--ph) + 50) 40% 14%)); box-shadow: 0 12px 34px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .12);
}
.cover-ph[hidden] { display: none; }
.cover-ph b { font-size: min(96px, 10vw); line-height: 1; color: rgba(255, 255, 255, .92); text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.cover-ph small { font-size: 13px; color: rgba(255, 255, 255, .78); padding: 0 12px; text-align: center; word-break: keep-all; }
.now { font-size: 14px; color: #a9b1c6; }
@media (max-width: 1100px) { .wrap { grid-template-columns: minmax(0, 1fr) 360px; } .sys-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .list .systems { max-height: none; overflow: visible; }
  .list .games { max-height: 62vh; }
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sys-art { height: 78px; }
  .sys-name { font-size: 14.5px; }
  .cover-title { font-size: 21px; }
  .cover-desc { font-size: 14px; }
  .cover-ph { width: 30vw; }
  .cover-ph b { font-size: 12vw; }
  .games li .gt { font-size: 15px; }
}
@media (max-width: 900px) { #screen { scroll-margin-top: 104px; } }

/* 휴대폰 가로 화면에서 게임 중: 게임만 꽉 차게 */
.float-stop { display: none; }
@media (orientation: landscape) and (max-height: 520px) {
  body.playing .bar, body.playing .site-banner, body.playing .now, body.playing .gnote, body.playing .edit-bar, body.playing .list { display: none !important; }
  body.playing .wrap { display: block; padding: 0; max-width: none; }
  body.playing .screen { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-height: none; aspect-ratio: auto; border-radius: 0; border: 0; box-shadow: none; z-index: 40; }
  body.playing .float-stop {
    display: block; position: absolute; top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); z-index: 45;
    padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 700; color: #ffd0d6; cursor: pointer;
    background: rgba(40, 18, 24, .55); border: 1px solid rgba(255, 160, 175, .45); border-radius: 9px; opacity: .8;
  }
}
/* 휴대폰·좁은 화면: 목록 칸은 높이 제한 없이 페이지와 같이 내려간다(게임 종류 카드가 잘려 더 안 내려가던 문제) */
@media (max-width: 900px) {
  .list { position: static; max-height: none !important; overflow: visible !important; }
  .list .systems { max-height: none; overflow: visible; }
  .list .games { max-height: none; overflow: visible; min-height: 0; }
}
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr) !important; }   /* 게임 카드 내용이 칸을 밀어 옆으로 넘치던 것 */
  .stage, .screen, .cover-in, .cover-info { max-width: 100%; }
  /* 긴 목록에서도 '게임 종류' 단추가 늘 보이게: 위쪽 막대 바로 아래에 붙인다 */
  .lib-head { position: sticky; top: var(--bar-h, 92px); z-index: 4; }
  /* 게임을 고르기 전 빈 화면 칸은 작게 */
  body:not(.playing) .cover:has(.cover-in.empty) { min-height: 0; padding: 18px 14px; }
  body:not(.playing) .cover-in.empty .cover-title { font-size: 15px; }
}

/* 롬 받기 줄(게임 화면 아래) */
.rom-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding: 10px 14px; background: var(--panel); border: 1px solid #2f5a8a; border-radius: 12px; }
.rom-bar[hidden] { display: none; }
.rom-txt { flex: 1; min-width: 200px; font-size: 14px; line-height: 1.6; color: #c9cfdd; word-break: keep-all; }
.rom-txt b { color: #9cc8ff; margin-right: 4px; }
.rom-txt small { color: #8a92a8; margin-left: 4px; }
