/* 스킬 시뮬레이터 (/game/skills/) — 스킬 창·설명 창은 원본 그림을 정수 배로만(흐림 없음), 둘레는 사이트 모양(site.css 색 이름) */

/* ------------------------------------------------------------ 위 막대: 직업 · 계열 · 레벨 */
.sim { display: flex; flex-direction: column; gap: 16px; }
.sim-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; padding: 16px 20px; border-radius: 8px; background: var(--panel); }
.sim-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.sim-label { font-size: 12px; color: var(--fg-3); }
.sim-bar .seg { background: var(--panel-2); }
.sim-bar .seg button { padding: 8px 16px; }
.sim-lv { display: inline-flex; align-items: stretch; height: 35px; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.sim-lv input { width: 56px; border: 0; border-left: 1px solid var(--sep); border-right: 1px solid var(--sep); background: none; color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 500; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.sim-lv input::-webkit-inner-spin-button, .sim-lv input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sim-lv input:focus-visible { outline-offset: -2px; border-radius: 0; }
.sim-step { min-width: 40px; border: 0; background: none; color: var(--fg-2); font-size: 13px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.sim-step:hover { background: var(--hover); color: var(--fg); }
.sim-step:active { background: #2e4660; }
.sim-acts { margin-left: auto; display: flex; gap: 8px; }
.sim-acts .btn { height: 35px; }
.sim-acts .btn:disabled { cursor: default; opacity: .4; transform: none; }
.sim-job { margin-top: -4px; font-size: 14px; color: var(--fg-2); }
.sim-job:empty::before { content: "0"; }  /* 받기 전에도 한 줄 자리(받은 뒤 아래가 밀리지 않게) */

/* ------------------------------------------------------------ 본문: 스킬 창(왼쪽) · 목록과 자세히(오른쪽) */
.sim-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.sim-left { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sim-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sim.is-loading .sim-main { opacity: .4; pointer-events: none; }

/* 원본 픽셀 그림: .px-root 는 원본 크기(px = 원본 1점)로 두고 transform 으로 정수 배만 키운다(skills.js relayout) */
.sim-win-wrap { display: flex; justify-content: center; }
.sim-win { position: relative; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.px-root { position: absolute; left: 0; top: 0; width: 175px; height: 289px; transform-origin: 0 0; }
.px-root .px { position: absolute; display: block; background: var(--sim-ui, url("/skills/ui.png")) no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.px-root .pt { position: absolute; white-space: pre; font: 12px/12px OriginGulim12, sans-serif; color: #fff; letter-spacing: 0; }
.px-root .pt-num { letter-spacing: 1px; }  /* 남은 SP: 원본 Tahoma 숫자 진행폭 7 = 굴림 6 + 1 (skills.js drawWindow) */
.px-root .pt14 { font: 14px/14px OriginGulim14B, sans-serif; color: #fff; }

.sim-sp { display: flex; flex-direction: column; gap: 4px; max-width: 350px; font-size: 13px; color: var(--fg-2); }
.sim-sp b { font-weight: 600; color: var(--fg); }
.sim-sp b.is-brand { color: var(--brand-text); }
.sim-warn { color: #f1c27a; }

/* 설명 창 (원본 FUN_006bc506) — 마우스를 따라다니는 떠 있는 창 */
.sim-tip { position: fixed; z-index: 60; pointer-events: none; }
.sim-tip .px-root { position: relative; overflow: hidden; }  /* 원본은 290×h 그림판에 그린다 → 긴 레벨 줄은 양끝이 잘린다(FUN_006bc506 가운데 줄은 줄바꿈 없음) */
.sim-tip .tf { position: absolute; display: block; background: rgba(0, 0, 64, .627); }
.sim-tip .tbox { position: absolute; display: block; width: 68px; height: 68px; background: rgba(255, 255, 255, .627); }

/* ------------------------------------------------------------ 목록: 아이콘 · 이름 · 레벨 · − + MAX */
.sim-list { list-style: none; border-radius: 8px; background: var(--panel); overflow: hidden; }
.sl { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-bottom: 1px solid var(--sep); transition: background .2s ease; }
.sl:last-child { border-bottom: 0; }
.sl:hover { background: rgba(255, 255, 255, .025); }
.sl.is-on { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--brand); }
.sl-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.sl-ic { flex: none; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.sl-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--fg); }
.sl-name .badge { height: 18px; padding: 0 6px; font-size: 11px; }
.sl-lv { flex: none; font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-lv b { font-weight: 600; color: var(--fg); }
.sl-lv small { margin-left: 2px; font-size: 11px; }
.sl-btns { flex: none; display: flex; gap: 4px; }
.sb { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); color: var(--fg-2); cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.sb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sb:hover { background: var(--hover); color: var(--fg); border-color: #36506b; }
.sb:active { background: #2e4660; }
.sb:disabled { cursor: default; opacity: .35; background: var(--panel-2); color: var(--fg-2); border-color: var(--line); }
.sb-max { width: auto; padding: 0 9px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--brand-text); }
.sb-max:hover { color: var(--brand-text); }

/* 한 칸(좁은 화면): 고른 스킬 바로 아래에 자세히를 펼친다(skills.js drawList, 10-19 "모바일에서 좀 불편") */
.sim-acc .sim-right > .sim-detail { display: none; }
.sim-acc .sl.is-on { border-bottom-color: transparent; }
.sl-more { padding: 0 6px 10px; border-bottom: 1px solid var(--sep); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--brand); }
.sl-more:last-child { border-bottom: 0; }
.sl-more .sim-detail { padding: 4px 8px 6px 10px; background: none; }
.sl-more .sd-lv, .sl-more .table th, .sl-more .sd-all ol { background: var(--panel); }

/* ------------------------------------------------------------ 자세히 */
.sim-detail { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 8px; background: var(--panel); }
.sd-empty { font-size: 14px; color: var(--fg-3); }
.sd-head { display: flex; align-items: center; gap: 14px; }
.sd-ic { flex: none; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.sd-head h2 { font-size: 19px; font-weight: 600; }
.sd-meta { margin-top: 2px; font-size: 13px; color: var(--fg-3); }
.sd-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-btns .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sd-btns .btn:disabled { cursor: default; opacity: .4; transform: none; }
.sd-btns .btn:disabled:hover { background: var(--panel); color: var(--fg-2); border-color: var(--line); }
.sd-btns .btn-brand:disabled:hover { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.sd-why { margin-top: -6px; font-size: 13px; color: #f1c27a; }
.sd-desc { font-size: 14px; line-height: 1.7; color: var(--fg-2); }
.sd-desc em { font-style: normal; color: var(--brand-text); }
.sd-note { font-size: 13px; line-height: 1.6; color: var(--fg-3); }
.sd-lvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.sd-lv { padding: 12px 14px; border-radius: 6px; background: var(--panel-2); }
.sd-lv b { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--fg-3); }
.sd-lv p { font-size: 14px; line-height: 1.6; color: var(--fg); }
.sd-table td, .sd-table th { white-space: nowrap; }
.sd-table td { font-variant-numeric: tabular-nums; }
.sd-table .is-none, .sd-lv .is-none { color: var(--fg-3); }
.sd-cv { margin-left: 6px; font-size: 11px; color: #f1c27a; }
.sd-cap { margin-top: -6px; font-size: 12px; color: var(--fg-3); }
.sd-src b { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.sd-src ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sd-src li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--fg-3); }
.sd-srcbtn { height: auto; min-height: 32px; padding: 4px 12px 4px 8px; gap: 8px; }
.sd-srcic { position: static; flex: none; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.sd-srcbtn.is-on { border-color: var(--brand); color: var(--brand-text); background: rgba(243, 154, 61, .1); }
.sd-srcbtn:disabled { cursor: default; opacity: .45; transform: none; }
.sd-srcbtn:disabled:hover { background: var(--panel); color: var(--fg-2); border-color: var(--line); }
.sd-all summary { cursor: pointer; font-size: 13px; color: var(--fg-2); }
.sd-all summary:hover { color: var(--fg); }
.sd-all ol { list-style: none; margin-top: 10px; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.sd-all li { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--sep); font-size: 13px; line-height: 1.55; color: var(--fg-2); }
.sd-all li:last-child { border-bottom: 0; }
.sd-all li b { flex: none; width: 24px; font-weight: 500; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.sd-all li.is-on { background: rgba(243, 154, 61, .08); color: var(--fg); }
.sd-all li.is-on b { color: var(--brand-text); }

/* ------------------------------------------------------------ 추천 스킬트리 따라가기 (홈페이지에서 더한 것 — skills.js drawRec) */
.sim-rec[aria-expanded="true"] { background: var(--brand-hover); border-color: var(--brand-hover); box-shadow: inset 0 0 0 2px rgba(14, 22, 32, .35); }
.sim-rec-panel { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 8px; background: var(--panel); box-shadow: inset 0 0 0 1px rgba(243, 154, 61, .35); }
.sim-rec-panel[hidden] { display: none; }
.sr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sr-head h2 { font-size: 17px; font-weight: 600; }
.sr-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--fg-2); cursor: pointer;
  transition: background .2s ease, color .2s ease; }
.sr-x:hover { background: var(--hover); color: var(--fg); }
.sr-x svg, .sr-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sr-sec { display: flex; flex-direction: column; gap: 8px; }
.sr-label { font-size: 12px; color: var(--fg-3); }
.sr-jobs { display: flex; flex-direction: column; gap: 6px; }
.sr-group, .sr-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sr-glabel { flex: none; width: 44px; font-size: 12px; color: var(--fg-2); }
.sr-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.sr-chips button { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); color: var(--fg-2); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.sr-chips button:hover { background: var(--hover); color: var(--fg); }
.sr-chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.sr-desc { flex-basis: 100%; padding-left: 54px; font-size: 12px; line-height: 1.6; color: var(--fg-2); }
.sr-sec > .sr-desc { padding-left: 0; }
.sr-nav { display: flex; align-items: center; gap: 6px; }
.sr-nav.sim-recbar { display: none; }
.sr-nav .btn { height: 34px; padding: 0 12px; }
.sr-nav .btn:disabled { cursor: default; opacity: .4; transform: none; }
.sr-nav .btn:disabled:hover { background: var(--panel); color: var(--fg-2); border-color: var(--line); }
.sr-nav .btn-brand:disabled:hover { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.sr-lvnow { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; font-size: 13px; line-height: 1.3; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.sr-lvnow b { font-size: 18px; font-weight: 600; color: var(--fg); }
.sr-lvnow small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--brand-text); }
.sr-now { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 8px; background: var(--panel-2); }
.sr-nowhead { font-size: 13px; color: var(--fg-2); }
.sr-nowhead b { font-weight: 600; color: var(--fg); }
.sr-line { display: flex; align-items: flex-start; gap: 10px; }
.sr-tag { flex: none; width: 84px; padding-top: 7px; font-size: 12px; color: var(--brand-text); }
.sr-line.is-next .sr-tag { color: var(--fg-3); }
.sr-line.is-next .sr-evs { opacity: .7; }
.sr-evs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; min-height: 32px; }
.sr-ev { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--fg); }
.sr-ev b { font-weight: 600; }
.sr-dim { font-size: 12px; font-weight: 400; color: var(--fg-3); }
.sr-ic { flex: none; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.sr-plan { position: relative; list-style: none; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; border-radius: 8px; background: var(--panel-2); }
.sr-plan button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sr-per { position: sticky; top: 0; z-index: 1; background: var(--elev); }
.sr-per button { padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--fg); }
.sr-perlv { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.sr-row button { padding: 4px 12px; border-bottom: 1px solid var(--sep); font-size: 13px; transition: background .2s ease; }
.sr-row button:hover { background: var(--hover); }
.sr-lv { flex: none; width: 70px; font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.sr-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--fg); }
.sr-name .badge { height: 18px; padding: 0 6px; font-size: 11px; }
.sr-to { flex: none; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.sr-row.is-done button { opacity: .45; }
.sr-row.is-now button { background: rgba(243, 154, 61, .12); box-shadow: inset 3px 0 0 var(--brand); }
.sr-row.is-now .sr-lv { color: var(--brand-text); }
.sr-foot { font-size: 12px; line-height: 1.7; color: var(--fg-3); }
.sr-foot a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 2px; }
.sr-foot a:hover { color: var(--fg); }
/* 스킬 창·목록: 이 레벨에 찍은 줄 */
.px-root .px-hl { position: absolute; display: block; background: rgba(255, 153, 0, .22); box-shadow: inset 0 0 0 1px #ff8a00; }
.sl.is-new { background: rgba(243, 154, 61, .08); }

/* 알림(잠깐 떴다 사라짐) */
.sim-flash { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px;
  background: var(--elev); border: 1px solid var(--line); font-size: 14px; color: var(--fg); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

.sim-notes summary { cursor: pointer; font-size: 14px; color: var(--fg-2); }
.sim-notes summary:hover { color: var(--fg); }
.sim-notes .prose { margin-top: 12px; font-size: 14px; }
.sim-notes ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

/* ------------------------------------------------------------ 좁은 화면 */
@media (max-width: 1023px) {
  .sim-main { grid-template-columns: minmax(0, 1fr); }
  .sim-left { position: static; align-items: center; }
  .sim-sp { align-items: center; text-align: center; }
  /* 한 칸일 때는 스킬 창이 따라가기 칸 위에 있으므로 레벨 넘기기를 화면 아래에도 띄워 창을 보면서 누르게 한다(skills.js recBar) */
  body.sim-following .sr-nav.sim-recbar:not([hidden]) { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 55; max-width: 560px; margin: 0 auto;
    padding: 8px; border-radius: 10px; background: var(--elev); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
  body.sim-following { padding-bottom: 72px; }
  body.sim-following .sim-flash { bottom: 84px; }
}
@media (max-width: 767px) {
  .sim-bar { padding: 14px 16px; }
  .sim-field { width: 100%; }
  .sim-bar .seg { width: 100%; }
  .sim-bar .seg button { flex: 1 0 auto; padding: 8px 12px; }
  .sim-acts { margin-left: 0; width: 100%; }
  .sim-acts .btn { flex: 1; }
  .sim-lv { width: 100%; }
  .sim-lv input { flex: 1; }
  .sim-detail { padding: 16px; }
  .sim-rec-panel { padding: 16px; }
  .sr-glabel { width: 100%; }
  .sr-desc { padding-left: 0; }
  .sr-tag { width: 100%; padding-top: 0; }
  .sr-line { flex-direction: column; gap: 4px; }
  .sr-lv { width: 58px; }
}
/* 손가락으로 누르기 쉽게 — 폰·태블릿(손가락 화면)은 누르는 칸 40px 안팎(10-19 사용자 "모바일에서 스킬 잘 안눌러지고") */
@media (max-width: 767px), (pointer: coarse) {
  .sim-bar .seg button { padding: 11px 12px; }
  .sim-lv { height: 44px; }
  .sim-step { min-width: 48px; }
  .sim-acts .btn { height: 44px; }
  .sl { gap: 6px; padding: 2px 6px 2px 2px; }
  .sl-pick { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 2px 10px; min-height: 54px; padding: 8px 6px; }
  .sl-pick .sl-ic { grid-row: 1 / 3; }
  .sl-name { font-size: 14px; }
  .sl-lv { font-size: 12px; }
  .sl-btns { gap: 6px; }
  .sb { width: 40px; height: 40px; }
  .sb-max { width: auto; padding: 0 10px; }
  .sd-btns .btn { height: 42px; }
  .sd-srcbtn { min-height: 42px; }
  .sr-x { width: 40px; height: 40px; }
  .sr-chips button { height: 36px; padding: 0 14px; border-radius: 18px; }
  .sr-nav .btn { height: 42px; }
  .sr-per button { padding: 10px 12px; }
  .sr-row button { padding: 9px 12px; }
}
@media (max-width: 480px) {
  .sr-wide { display: none; }
  .sr-nav .btn { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .sl, .sb, .sim-step, .sr-chips button, .sr-row button, .sr-x { transition: none; }
}
@media (pointer: coarse) { .sim-lv input { font-size: 16px; } }
