/* KoreaCom Client 웹사이트
   재료 이름 팔레트: 흑요석 바탕, 다이아(클라이언트 포인트색) 강조, 금은 기록, 레드스톤은 오류.
   제목·키캡·숫자는 갈무리(한글 픽셀 글꼴), 본문은 게임 HUD 와 같은 Pretendard. */
:root {
  --obsidian: #15111d;
  --obsidian-2: #1d1828;
  --obsidian-3: #241e31;
  --stone: #2f2840;
  --stone-light: #403756;
  --text: #efeaf6;
  --text-dim: #a59db6;
  --text-faint: #6f6782;
  --diamond: #4fd1c5;
  --diamond-dark: #2a8f86;
  --diamond-ink: #062420;
  --gold: #f4c34c;
  --redstone: #ef4b4b;
  --emerald: #5fd39a;
  --pixel: "Galmuri11", "Pretendard Variable", sans-serif;
  --body: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --rail: 232px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--text);
  font: 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.3; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--pixel); font-size: .92em; }
code { background: var(--obsidian-3); border: 1px solid var(--stone); padding: .05em .4em; border-radius: 3px; }
::selection { background: var(--diamond); color: var(--diamond-ink); }
:focus-visible { outline: 2px solid var(--diamond); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ 뼈대: 왼쪽 메뉴(ClickGUI 사이드바) + 본문 */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail);
  background: #110e18; border-right: 1px solid var(--stone);
  display: flex; flex-direction: column; padding: 22px 14px 18px;
  z-index: 40;
}
.logo { font-family: var(--pixel); font-size: 1.35rem; text-decoration: none; padding: 0 10px; letter-spacing: -.01em; }
.logo b { color: var(--diamond); font-weight: 400; }
.logo-sub { color: var(--text-faint); font-size: .78rem; padding: 2px 10px 0; }
.rail nav { margin-top: 26px; display: grid; gap: 2px; }
.rail-group { color: var(--text-faint); font-size: .78rem; padding: 14px 10px 6px; }
.rail a.item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text-dim);
  position: relative;
}
.rail a.item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.rail a.item.active { color: var(--text); background: rgba(255, 255, 255, .07); }
.rail a.item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--diamond); }
.rail-foot { margin-top: auto; display: grid; gap: 8px; }
.rail-foot small { color: var(--text-faint); padding: 0 4px; }

.main { margin-left: var(--rail); min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; max-width: 1080px; padding: 36px 40px 80px; }
.content.wide { max-width: 1280px; }
.page-title { font-family: var(--pixel); font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 10px; }
.intro { color: var(--text-dim); max-width: 38em; margin-bottom: 28px; }
.footer { color: var(--text-faint); font-size: .82rem; padding: 22px 40px; border-top: 1px solid var(--stone); }

/* ------------------------------------------------------------ 버튼·입력 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 1rem var(--pixel); text-decoration: none; cursor: pointer;
  padding: 11px 18px; border-radius: 4px; border: 0;
  background: var(--stone); color: var(--text);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .06);
}
.btn:hover { background: var(--stone-light); }
.btn:active { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .35); transform: translateY(1px); }
.btn-diamond { background: var(--diamond); color: var(--diamond-ink); }
.btn-diamond:hover { background: #6ee0d5; }
.btn-small { font-size: .85rem; padding: 7px 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--diamond); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--redstone); }

input, textarea, select {
  font: inherit; color: var(--text); background: var(--obsidian); border: 1px solid var(--stone);
  border-radius: 4px; padding: 10px 12px; outline: none; width: 100%;
}
input:focus, textarea:focus { border-color: var(--diamond); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--diamond); }
input[type="range"] { padding: 0; accent-color: var(--diamond); border: 0; background: none; }
input[type="color"] { padding: 2px; height: 34px; width: 46px; cursor: pointer; }
label.field { display: grid; gap: 6px; color: var(--text-dim); font-size: .9rem; }

.flash { padding: 12px 16px; border-radius: 4px; background: var(--obsidian-2); border-left: 4px solid var(--diamond); margin-bottom: 18px; }
.flash.error { border-left-color: var(--redstone); }
.flash.ok { border-left-color: var(--emerald); }

/* ------------------------------------------------------------ 게임 화면(체험) */
.screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: 6px; overflow: hidden; background: #1b1530;
  border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone), 0 30px 60px -30px rgba(0, 0, 0, .8);
  cursor: crosshair; user-select: none; touch-action: manipulation;
}
.screen canvas.world { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.screen canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hud { position: absolute; font-family: var(--body); color: #fff; font-size: clamp(.62rem, 1.15vw, .85rem); text-shadow: 0 1px 0 rgba(0, 0, 0, .5); pointer-events: none; }
.hud-chip { background: rgba(14, 16, 20, .55); border-radius: 4px; padding: .25em .6em; display: inline-block; margin-bottom: .35em; }
.hud-chip span { color: #a6adba; margin-right: .4em; }
.hud-tl { left: 1.6%; top: 2.5%; }
.hud-tl .wm { font-weight: 700; color: var(--diamond); }
.hud-tl .wm i { font-style: normal; color: #a6adba; font-weight: 400; margin-left: .5em; }
.keys { right: 2%; bottom: 3%; display: grid; grid-template-columns: repeat(3, 2.6em); gap: .25em; }
.key {
  height: 2.6em; display: grid; place-items: center; border-radius: 4px;
  background: rgba(14, 16, 20, .55); color: #fff; font-weight: 600; transition: background .06s, color .06s;
}
.key.on { background: rgba(79, 209, 197, .9); color: var(--diamond-ink); }
.key.w { grid-column: 2; }
.key.a { grid-column: 1; }
.key.mouse { grid-column: span 3; display: grid; grid-template-columns: 1fr 1fr; gap: .25em; background: none; height: auto; }
.key.mouse > div { height: 2.6em; border-radius: 4px; background: rgba(14, 16, 20, .55); display: grid; place-items: center; line-height: 1.1; text-align: center; font-size: .9em; }
.key.mouse > div.on { background: rgba(79, 209, 197, .9); color: var(--diamond-ink); }
.key.mouse small { display: block; font-size: .75em; opacity: .8; font-weight: 400; }
.key.space { grid-column: span 3; height: 1.3em; }
.key.space::after { content: ""; width: 40%; height: 2px; background: currentColor; border-radius: 2px; }
.hint-bubble {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  font-family: var(--pixel); font-size: clamp(.75rem, 1.3vw, .95rem);
  background: rgba(10, 8, 15, .78); padding: .5em .9em; border-radius: 4px; pointer-events: none;
  transition: opacity .4s;
}
.hint-bubble kbd { color: var(--diamond); }

.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.home-head h1 { font-family: var(--pixel); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.1; }
.home-head p { color: var(--text-dim); margin: 8px 0 0; }
.online-now { color: var(--emerald); font-weight: 600; }

/* 시작 순서: 실제로 차례가 있는 내용이라 번호를 크게 */
.path { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--stone); border: 1px solid var(--stone); border-radius: 6px; overflow: hidden; }
.path > li { counter-increment: step; background: var(--obsidian-2); padding: 22px 22px 24px; position: relative; }
.path > li::before { content: counter(step); font-family: var(--pixel); font-size: 2.4rem; line-height: 1; color: var(--diamond); display: block; margin-bottom: 10px; }
.path h2 { font-family: var(--pixel); font-size: 1.2rem; margin-bottom: 8px; }
.path p { color: var(--text-dim); font-size: .95rem; margin-bottom: 14px; }
.path .cmds { line-height: 2.1; color: var(--text-faint); font-size: .88rem; }
.path .cmds code { color: var(--diamond); margin-right: 6px; }
.path .muted-note { color: var(--text-faint); font-size: .85rem; margin: 0; }
.path-links { display: flex; gap: 6px; flex-wrap: wrap; }

/* 도구 페이지 공통 "게임에 넣기" */
.ingame { margin-top: 20px; background: var(--obsidian-2); border: 1px solid var(--stone); border-left: 4px solid var(--gold); border-radius: 6px; padding: 16px 18px; }
.ingame b { font-family: var(--pixel); font-weight: 400; color: var(--gold); }
.ingame ol { margin: 8px 0 0; padding-left: 1.3em; color: var(--text-dim); font-size: .94rem; }
.ingame li { margin: 4px 0; }

.news { margin-top: 40px; display: grid; grid-template-columns: 220px 1fr; gap: 24px; border-top: 1px solid var(--stone); padding-top: 28px; }
.news h2 { font-family: var(--pixel); font-size: 1.15rem; }
.news h2 small { display: block; color: var(--text-faint); font-family: var(--body); font-size: .85rem; margin-top: 4px; }
.news ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.news li { padding-left: 18px; position: relative; color: var(--text-dim); }
.news li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--diamond); }
.news a { color: var(--diamond); }


/* ------------------------------------------------------------ 조준점 만들기 */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.bg-switch { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--obsidian); border: 1px solid var(--stone); border-radius: 4px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { font: .9rem var(--pixel); background: none; border: 0; color: var(--text-dim); padding: 6px 10px; border-radius: 3px; cursor: pointer; text-decoration: none; }
.seg button:hover, .seg a:hover { color: var(--text); }
.seg button.on, .seg a.on { background: var(--diamond); color: var(--diamond-ink); }
.panel { background: var(--obsidian-2); border: 1px solid var(--stone); border-radius: 6px; padding: 18px; }
.panel h2 { font-family: var(--pixel); font-size: 1.05rem; margin-bottom: 12px; }
.ctl { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; padding: 7px 0; font-size: .92rem; color: var(--text-dim); }
.ctl output { font-family: var(--pixel); color: var(--text); text-align: right; }
.ctl.row2 { grid-template-columns: 96px 1fr; }
.ctl .colors { display: flex; gap: 8px; align-items: center; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatches button { width: 20px; height: 20px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .15); cursor: pointer; padding: 0; }
.code-box { margin-top: 14px; display: grid; gap: 8px; }
.code-out { font-family: var(--pixel); font-size: .85rem; word-break: break-all; background: var(--obsidian); border: 1px dashed var(--stone-light); border-radius: 4px; padding: 10px; color: var(--diamond); user-select: all; }
.how { margin-top: 28px; color: var(--text-dim); font-size: .95rem; }
.how ol { padding-left: 1.3em; margin: 8px 0 0; }
.how li { margin: 4px 0; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.preset { width: 44px; height: 44px; background: #0e0b14; border: 1px solid var(--stone); border-radius: 4px; cursor: pointer; padding: 0; }
.preset:hover { border-color: var(--diamond); }

/* ------------------------------------------------------------ HUD 배치 */
.stage { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 6px; overflow: hidden; border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone); background: #1b1530; user-select: none; touch-action: none; }
.stage canvas.world { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hudbox {
  position: absolute; transform-origin: 0 0; cursor: grab; box-sizing: border-box;
  background: rgba(14, 16, 20, .55); color: #fff; border-radius: 4px; padding: 3px 6px;
  font: 600 9px/10px var(--body); white-space: nowrap; overflow: hidden;
  outline: 1px dashed transparent;
}
.hudbox:hover { outline-color: rgba(255, 255, 255, .35); }
.hudbox.sel { outline: 1px solid var(--diamond); cursor: grabbing; }
.hudbox .lbl { color: #a6adba; font-weight: 400; }
.hudbox .acc { color: var(--diamond); }
.hudbox .rows { display: grid; gap: 2px; }
.hudbox .rows i { font-style: normal; font-weight: 400; }
.hudbox .rows .bar { height: 3px; background: var(--emerald); border-radius: 2px; width: 75%; }
.hudbox .ks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.hudbox .ks i { font-style: normal; text-align: center; background: rgba(255, 255, 255, .08); border-radius: 2px; line-height: 16px; height: 16px; }
.hudbox .ks i:empty, .hudbox .ks i:first-child, .hudbox .ks i:nth-child(3) { background: none; }
.hudbox .ks .w2 { grid-column: span 2; } .hudbox .ks .w3 { grid-column: span 3; height: 8px; line-height: 8px; }
.hudbox .icons.v { display: grid; gap: 3px; }
.hudbox .icons i { display: block; width: 12px; height: 14px; background: #7fd6e8; border-radius: 2px; margin: 0 auto; }
.hudbox .model { width: 20px; height: 64px; margin: 4px auto; background: linear-gradient(#c58c63 0 25%, #2fb5b0 25% 62%, #3f3aa6 62%); border-radius: 2px; }
.guide { position: absolute; background: var(--diamond); opacity: .7; pointer-events: none; }
.guide.gx { top: 0; bottom: 0; width: 1px; }
.guide.gy { left: 0; right: 0; height: 1px; }
.stage-tip { color: var(--text-faint); font-size: .85rem; align-self: center; }
.hud-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--stone); border-radius: 4px; }
.hud-list li { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: .92rem; border-top: 1px solid var(--stone); }
.hud-list li:first-child { border-top: 0; }
.hud-list li.sel { background: rgba(79, 209, 197, .1); }
.hud-list label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.hud-list small { color: var(--text-faint); font-size: .78rem; }
.sel-box { margin-top: 10px; padding: 10px 12px; background: var(--obsidian); border-radius: 4px; }
.sel-box b { font-family: var(--pixel); font-weight: 400; color: var(--diamond); }

/* 조준점 갤러리 */
.xh-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.xh { background: var(--obsidian-2); border: 1px solid var(--stone); border-radius: 6px; padding: 12px; display: grid; justify-items: center; gap: 8px; }
.xh canvas { width: 96px; height: 96px; image-rendering: pixelated; border-radius: 4px; }
.xh b { font-weight: 600; font-size: .92rem; text-align: center; }
.xh .like[disabled] { color: var(--redstone); }
.xh .btn { white-space: nowrap; }

/* ------------------------------------------------------------ CPS 측정 */
.cps-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.pad {
  position: relative; height: 360px; border-radius: 6px; border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--stone); background: #0e0b14; overflow: hidden; cursor: pointer; user-select: none;
  display: grid; place-items: center; text-align: center;
}
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: .55; }
.pad .big { position: relative; font-family: var(--pixel); font-size: clamp(3rem, 9vw, 6rem); line-height: 1; }
.pad .sub { position: relative; color: var(--text-dim); margin-top: 10px; }
.pad.done .big { color: var(--gold); }
.pad .ripple { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--diamond); border-radius: 50%; animation: ripple .45s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(5); opacity: 0; } }
.cps-graph { margin-top: 14px; width: 100%; height: 120px; background: var(--obsidian-2); border: 1px solid var(--stone); border-radius: 6px; }
.records { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.records li { display: flex; justify-content: space-between; color: var(--text-dim); }
.records li b { font-family: var(--pixel); font-weight: 400; color: var(--text); }
.records li.best b { color: var(--gold); }

/* ------------------------------------------------------------ 망토 */
.cape-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.viewer { position: relative; height: 520px; border-radius: 6px; overflow: hidden; border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone); background: #0e0b14; }
.viewer canvas.world { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: .65; }
.viewer canvas.skin { position: relative; cursor: grab; }
.viewer .tip { position: absolute; left: 12px; bottom: 10px; font-size: .82rem; color: var(--text-dim); }
.cape-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 16px; }
.cape-opt { background: var(--obsidian); border: 2px solid var(--stone); border-radius: 4px; padding: 8px 4px 6px; cursor: pointer; display: grid; justify-items: center; gap: 4px; font-size: .8rem; color: var(--text-dim); }
.cape-opt canvas { width: 30px; height: 48px; image-rendering: pixelated; }
.cape-opt.on { border-color: var(--diamond); color: var(--text); }
.cape-opt input { position: absolute; opacity: 0; pointer-events: none; }
.row { display: flex; gap: 8px; }

/* ------------------------------------------------------------ 모듈 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input { flex: 1 1 260px; width: auto; }
.mod-table { width: 100%; border-collapse: collapse; }
.mod-table td { padding: 11px 8px; border-top: 1px solid var(--stone); vertical-align: top; }
.mod-table tr:first-child td { border-top: 0; }
.mod-table td:first-child { font-family: var(--pixel); white-space: nowrap; width: 1%; padding-right: 22px; }
.mod-table td:nth-child(2) { color: var(--text-dim); }
.mod-table td:last-child { color: var(--text-faint); font-size: .85rem; white-space: nowrap; text-align: right; }
.mod-table tr:hover td { background: rgba(255, 255, 255, .02); }
.empty { color: var(--text-dim); padding: 40px 0; text-align: center; }
.mod-table.bench thead td { color: var(--text-faint); font-family: var(--body); font-size: .85rem; border-top: 0; }
.mod-table.bench td:first-child { font-family: var(--body); white-space: normal; width: auto; }
.mod-table.bench td:not(:first-child) { font-family: var(--pixel); text-align: right; white-space: nowrap; width: 1%; color: var(--text); font-size: 1rem; }

/* 모듈 상세 */
.mod-table a { color: var(--text); text-decoration: none; }
.mod-table a:hover { color: var(--diamond); }
.mod-table.settings td:first-child { font-family: var(--body); font-weight: 600; }

/* 서버 목록 */
.server-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.server-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; background: var(--obsidian-2); border: 1px solid var(--stone); border-radius: 6px; padding: 14px 16px; }
.server-list .cmd { grid-column: 1 / -1; margin: 4px 0 0; }
.sv-main b { font-family: var(--pixel); font-weight: 400; font-size: 1.1rem; display: block; }
.sv-motd { color: var(--text-dim); font-size: .9rem; white-space: pre-line; }
.sv-side { text-align: right; display: grid; gap: 2px; align-content: start; }
.sv-side small { color: var(--text-faint); }
.sv-count { font-family: var(--pixel); font-size: 1.4rem; color: var(--diamond); }
.sv-count small { font-size: .8rem; color: var(--text-faint); margin-left: 2px; }
.sv-off { color: var(--text-faint); font-size: .9rem; }

/* ------------------------------------------------------------ 설정 공유 */
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.share-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--stone); border-radius: 6px; overflow: hidden; }
.share-list li a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 16px; text-decoration: none; background: var(--obsidian-2); border-top: 1px solid var(--stone); }
.share-list li:first-child a { border-top: 0; }
.share-list li a:hover { background: var(--obsidian-3); }
.share-list b { font-weight: 600; }
.share-list .code { font-family: var(--pixel); color: var(--diamond); text-align: right; }
.share-list small { color: var(--text-faint); }
.big-code { font-family: var(--pixel); font-size: 2.2rem; color: var(--diamond); letter-spacing: .08em; }
.cmd { display: flex; gap: 8px; align-items: stretch; margin: 10px 0; }
.cmd code { flex: 1; display: flex; align-items: center; padding: 8px 12px; font-size: 1rem; }
.layout-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone); }
.layout-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.layout-preview .box { position: absolute; background: rgba(14, 16, 20, .6); color: #fff; font-size: clamp(.55rem, 1vw, .78rem); padding: .2em .5em; border-radius: 3px; white-space: nowrap; }
.mods-on { display: flex; flex-wrap: wrap; gap: 6px; }
.mods-on span { background: var(--obsidian-3); border: 1px solid var(--stone); border-radius: 3px; padding: 2px 8px; font-size: .85rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; margin: 0; }
.facts dt { color: var(--text-faint); }
.facts dd { margin: 0; }

/* ------------------------------------------------------------ 스크린샷 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.gallery .shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; border: 1px solid var(--stone); background: #0e0b14; }
.gallery .shot img { width: 100%; height: 100%; object-fit: cover; }
.gallery .shot:hover { border-color: var(--diamond); }
.shot-full { margin: 0; }
.shot-full img { width: 100%; border-radius: 6px; border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone); }
.shot-full figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--text-faint); font-size: .9rem; }

/* ------------------------------------------------------------ 다운로드·업데이트 */
.dl { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 24px; background: var(--obsidian-2); border: 1px solid var(--stone); border-left: 4px solid var(--diamond); border-radius: 6px; }
.dl h2 { font-family: var(--pixel); font-size: 1.3rem; word-break: break-all; }
.dl p { margin: 4px 0 0; color: var(--text-dim); }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--stone); }
.files li span:first-child { flex: 1; word-break: break-all; }
.files .muted { color: var(--text-faint); font-size: .88rem; }
.steps { padding-left: 1.3em; color: var(--text-dim); }
.steps li { margin: 6px 0; }
.steps b { color: var(--text); font-weight: 600; }
h2.sub { font-family: var(--pixel); font-size: 1.1rem; margin: 40px 0 12px; }
.log { list-style: none; margin: 0; padding: 0; }
.log > li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--stone); }
.log > li:first-child { border-top: 0; padding-top: 0; }
.log .when { font-family: var(--pixel); color: var(--diamond); }
.log .when small { display: block; color: var(--text-faint); font-family: var(--body); font-size: .85rem; }
.log h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.log ul { margin: 0; padding-left: 1.1em; color: var(--text-dim); }
.log ul li { margin: 3px 0; }

/* 관리 */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-grid .panel.wide { grid-column: 1 / -1; overflow-x: auto; }
.stack { display: grid; gap: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--stone); }
.table th { color: var(--text-faint); font-weight: 400; border-top: 0; }
.mono { font-family: var(--pixel); font-size: .78rem; }
.stats-line { display: flex; gap: 28px; flex-wrap: wrap; color: var(--text-dim); margin-bottom: 20px; }
.stats-line b { font-family: var(--pixel); font-weight: 400; color: var(--text); font-size: 1.3rem; margin-right: 6px; }
.compact { list-style: none; padding: 0; margin: 12px 0 0; font-size: .88rem; }
.compact li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--stone); }
.compact li > span:first-child { flex: 1; word-break: break-all; }
.compact form { display: inline; }

/* ------------------------------------------------------------ 좁은 화면: 메뉴가 위로 */
@media (max-width: 980px) {
  .editor, .cps-wrap, .cape-stage, .share-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rail { position: sticky; top: 0; width: auto; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--stone); overflow-x: auto; }
  .logo { padding: 0; font-size: 1.1rem; flex: none; }
  .logo-sub, .rail-group, .rail-foot small { display: none; }
  .rail nav { margin: 0; display: flex; gap: 2px; flex: none; }
  .rail a.item { white-space: nowrap; padding: 6px 9px; }
  .rail a.item.active::before { display: none; }
  .rail-foot { margin: 0 0 0 auto; flex: none; }
  .main { margin-left: 0; }
  .content { padding: 22px 16px 60px; }
  .footer { padding: 18px 16px; }
  .news, .path { grid-template-columns: 1fr; }
  .log > li { grid-template-columns: 1fr; gap: 6px; }
  .keys { grid-template-columns: repeat(3, 2.1em); }
  .key, .key.mouse > div { height: 2.1em; }
  .mod-table td:last-child { display: none; }
  .pad { height: 280px; }
  .viewer { height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .pad .ripple { animation: none; display: none; }
  .key { transition: none; }
}

.crash { background: var(--obsidian); border: 1px solid var(--stone); border-radius: 6px; padding: 14px; overflow: auto; max-height: 70vh; font-size: .8rem; color: var(--text-dim); white-space: pre-wrap; }

/* 망토 그리기 */
.draw-wrap { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
#grid { width: 250px; height: 400px; image-rendering: pixelated; border: 2px solid #000; box-shadow: 0 0 0 1px var(--stone); border-radius: 4px; cursor: crosshair; touch-action: none; }
.draw-tools { display: grid; gap: 12px; }
@media (max-width: 760px) { .draw-wrap { grid-template-columns: 1fr; } }

/* 리플레이 맞힌 순간 막대 */
.hit-line { position: relative; height: 14px; margin-top: 10px; background: var(--obsidian-2); border: 1px solid var(--stone); border-radius: 4px; }
.hit-line i { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--diamond); border-radius: 1px; }

.seg label span.on { background: var(--diamond); color: var(--diamond-ink); font-family: var(--pixel); }
.seg label span { font-family: var(--pixel); color: var(--text-dim); }
