/* เมนูอาชีพ (K) — โครงแผงใช้ .game-expertise-panel ร่วมกับเมนูความเชี่ยวชาญ แต่กว้างสองคอลัมน์ */
#game-class-root {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 55;
    --expertise-top-clearance: calc(var(--safe-top) + clamp(92px, 15vh, 118px));
}

/* จอกว้าง: #ui-overlay คือคอลัมน์กลาง — ยื่นออกไปครึ่งคอลัมน์ทั้งซ้ายและขวา
   (กลางคอลัมน์ซ้าย → กลางคอลัมน์ขวา = กว้างสองเท่าของแผงทั่วไป) แต่ไม่เกินขอบจอ */
html.layout-wide #game-class-root {
    left: max(calc(var(--game-col-w) / -2), calc((var(--game-col-w) - 100vw) / 2));
    right: max(calc(var(--game-col-w) / -2), calc((var(--game-col-w) - 100vw) / 2));
}

#game-class-root.open {
    pointer-events: auto;
}

[data-class-backdrop] {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--expertise-top-clearance);
    /* ไม่ทำฉากหลังมืด — ยังรับคลิกนอกแผงเพื่อปิดเหมือนเดิม */
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

#game-class-root.open [data-class-backdrop] {
    opacity: 1;
    pointer-events: auto;
}

#game-class-root.open .game-expertise-panel {
    transform: translateY(0);
}

/* จอกว้าง: แผงลอยกลางจอสูงเต็มพื้นที่เสมอ — ไม่ยืดหดตามเนื้อหาเมื่อสลับอาชีพ/สกิลที่ดู (เนื้อหาเกินก็เลื่อนในคอลัมน์ขวา) */
html.layout-wide #game-class-root .game-expertise-panel {
    height: 100%;
}

/* ───────── ปุ่มของเมนูอาชีพ ─────────
   เส้นบาง มุมมน โทนม่วงครามกับทองโคม ชุดเดียวกับการ์ดและแท็บในแผง (ไม่ใช้ .pixel-btn ก้อนหนา)
   .is-gold = การกระทำหลัก · .is-quiet = การกระทำรอง · .is-small = ปุ่มในแถว · .is-maxed = ถึงระดับสูงสุดแล้ว */
.class-btn {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--touch-min, 44px);
    padding: 4px 14px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    color: #efe6d6;
    background: linear-gradient(180deg, rgba(78, 65, 110, 0.78) 0%, rgba(36, 28, 56, 0.9) 100%);
    border: 1px solid rgba(170, 150, 210, 0.42);
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(224, 210, 255, 0.18),
        0 1px 0 rgba(6, 4, 12, 0.85);
    text-shadow: 0 1px 0 rgba(8, 4, 16, 0.7);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease,
        filter 0.15s ease,
        transform 0.06s ease;
}

.class-btn:hover:not(:disabled),
.class-btn:focus-visible:not(:disabled) {
    color: #fff3d6;
    border-color: rgba(240, 200, 96, 0.8);
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 170, 0.22),
        0 1px 0 rgba(6, 4, 12, 0.85),
        0 0 10px rgba(255, 170, 80, 0.28);
    outline: none;
}

.class-btn:focus-visible {
    outline: 2px solid var(--px-gold, #ffd36b);
    outline-offset: 2px;
}

.class-btn:active:not(:disabled) {
    transform: translateY(1px);
    filter: brightness(0.92);
}

/* การกระทำหลัก: เรียน / +1 / เปลี่ยนอาชีพ — ทองโคมแบบเดียวกับป้ายแต้มสกิล */
.class-btn.is-gold {
    color: #2a1a05;
    border-color: #ffe9a6;
    background: linear-gradient(180deg, #ffe08a 0%, #eeb548 52%, #d2932c 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 250, 225, 0.75),
        0 1px 0 rgba(42, 20, 6, 0.9),
        0 0 12px rgba(255, 170, 80, 0.28);
    text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}

.class-btn.is-gold:hover:not(:disabled),
.class-btn.is-gold:focus-visible:not(:disabled) {
    color: #2a1a05;
    border-color: #fff6d6;
    filter: brightness(1.07);
    box-shadow:
        inset 0 1px 0 rgba(255, 250, 225, 0.85),
        0 1px 0 rgba(42, 20, 6, 0.9),
        0 0 16px rgba(255, 180, 90, 0.5);
}

/* การกระทำรอง: ถอด / รีเซ็ต / ปิด — โปร่ง เห็นแค่เส้นขอบ */
.class-btn.is-quiet {
    color: var(--dusk-text-dim, #b3a8c4);
    background: rgba(8, 6, 20, 0.36);
    border-color: rgba(160, 140, 200, 0.3);
    box-shadow: none;
}

.class-btn.is-small {
    min-height: 30px;
    padding: 3px 11px;
    font-size: 0.74rem;
    border-radius: 7px;
}

/* ปุ่มที่กดค้างอยู่ (กำลังเลือกช่อง) */
.class-btn.is-open {
    color: #f8e3a8;
    border-color: #f0c860;
    background: linear-gradient(180deg, rgba(120, 78, 34, 0.9) 0%, rgba(58, 36, 20, 0.95) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 220, 160, 0.3),
        0 0 10px rgba(255, 170, 80, 0.3);
}

.class-btn:disabled {
    cursor: default;
    color: rgba(190, 180, 205, 0.5);
    background: rgba(8, 6, 20, 0.3);
    border-color: rgba(160, 140, 200, 0.16);
    box-shadow: none;
    text-shadow: none;
}

/* ถึงระดับสูงสุด — เป็นป้ายทองสลัก ไม่ใช่ปุ่มที่ดูกดได้ */
.class-btn.is-maxed:disabled {
    color: #d9b25a;
    background: rgba(240, 200, 96, 0.07);
    border-color: rgba(236, 192, 104, 0.38);
    letter-spacing: 0.1em;
}

.class-close-btn {
    width: var(--touch-min, 44px);
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}

/* จอกว้างที่ใช้เมาส์: ปุ่มเตี้ยลงให้พอดีกับแถวข้อความ (จอสัมผัสคงความสูงขั้นต่ำสำหรับนิ้ว) */
html.layout-wide:not(.touch-play) #game-class-root .class-btn:not(.is-small) {
    min-height: 34px;
}

html.layout-wide:not(.touch-play) #game-class-root .class-close-btn {
    width: 34px;
}

/* ───────── โครง: รายชื่ออาชีพ (ซ้าย แนวตั้ง) | อาชีพที่เลือกดู (ขวา) ───────── */
.class-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 10px;
}

.class-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 2px 2px 0;
}

.class-list-btn {
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    min-height: var(--touch-min, 44px);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    text-align: left;
    color: #b3a48c;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(141, 110, 99, 0.4);
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.class-list-btn:hover,
.class-list-btn:focus-visible {
    color: #f4ead6;
    border-color: rgba(236, 192, 104, 0.6);
    outline: none;
}

.class-list-btn.is-view {
    color: #f8e3a8;
    border-color: #f0c860;
    background: linear-gradient(90deg, rgba(240, 200, 96, 0.24) 0%, rgba(0, 0, 0, 0.3) 100%);
    box-shadow: 0 0 10px rgba(240, 200, 96, 0.25);
}

.class-list-img {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
    opacity: 0.6;
}

.class-list-btn.is-view .class-list-img,
.class-list-btn.is-active .class-list-img {
    opacity: 1;
}

.class-list-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.class-list-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 700;
}

.class-list-lv {
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.class-list-tag {
    position: absolute;
    top: -6px;
    right: -2px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.5;
    color: #10230f;
    background: #8fe37a;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

[data-class-body] {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ฉากเปิด: ตายแล้วกำลังเลือกอาชีพเริ่มต้น — ปิดหน้าต่างไม่ได้จนกว่าจะเลือก */
#game-class-root.is-start-choice .class-close-btn {
    display: none;
}

/* จอแคบ (แผงเลื่อนล่างเต็มจอ) — รายชื่ออาชีพเหลือไอคอน + ชื่อย่อใต้ไอคอน */
html:not(.layout-wide) .class-layout {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
}

html:not(.layout-wide) .class-list-btn {
    flex-direction: column;
    gap: 2px;
    padding: 6px 2px 4px;
    text-align: center;
}

html:not(.layout-wide) .class-list-text {
    align-items: center;
    max-width: 100%;
}

html:not(.layout-wide) .class-list-name {
    max-width: 100%;
    font-size: 0.62rem;
}

/* ───────── หัวอาชีพที่เลือกดู ───────── */
.class-head {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.4);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.24) 100%);
}

.class-head-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.class-head-name {
    font-size: var(--text-lg, 1rem);
    font-weight: 700;
    color: #fff8e1;
    text-shadow: 1px 1px 0 #000;
}

.class-head-lv {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f0cf6a;
    font-variant-numeric: tabular-nums;
}

.class-head-desc {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #cbbfa8;
}

.class-head-weapons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
}

.class-head-weapons-label {
    color: #b3a48c;
}

.class-weapon-chip {
    padding: 1px 9px;
    border-radius: 999px;
    border: 1px solid rgba(236, 192, 104, 0.55);
    background: rgba(240, 200, 96, 0.12);
    color: #f8e3a8;
    font-weight: 700;
}

.class-exp {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.class-exp-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #e8e0d8;
}

.class-head-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.class-points {
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(141, 110, 99, 0.45);
    font-size: 0.78rem;
    font-weight: 700;
    color: #b3a48c;
    font-variant-numeric: tabular-nums;
}

.class-points.has-points {
    color: #2a1a05;
    border-color: #ffe9a6;
    background: linear-gradient(180deg, #ffe08a 0%, #e0a52e 100%);
}

.class-current-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8fe37a;
}

.class-reset-btn {
    margin-left: auto;
}

.class-empty {
    margin: 12px 0;
    text-align: center;
    color: #b3a48c;
    font-size: 0.85rem;
}

/* ───────── แถวไอคอนสกิลของอาชีพ (แนวนอน ขึ้นแถวใหม่เมื่อเต็ม) ───────── */
.class-skill-strip {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.class-skill-tab {
    width: 68px;
    padding: 5px 2px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font: inherit;
    color: #b3a48c;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(141, 110, 99, 0.4);
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.class-skill-tab:hover,
.class-skill-tab:focus-visible {
    color: #f4ead6;
    border-color: rgba(236, 192, 104, 0.6);
    outline: none;
}

.class-skill-tab.is-selected {
    color: #f8e3a8;
    border-color: #f0c860;
    background: linear-gradient(180deg, rgba(240, 200, 96, 0.22) 0%, rgba(0, 0, 0, 0.3) 100%);
    box-shadow: 0 0 10px rgba(240, 200, 96, 0.25);
}

.class-skill-tab-icon {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 2px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.45);
}

.class-skill-tab-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.class-skill-tab.is-unlearned .class-skill-tab-icon img {
    filter: grayscale(0.85) brightness(0.75);
}

.class-skill-tab-lv {
    position: absolute;
    right: -4px;
    bottom: -4px;
    padding: 0 3px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.82);
    color: #ffd98a;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.class-skill-tab-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 700;
}

/* ───────── รายละเอียดของสกิลที่เลือก ───────── */
.class-skill {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.4);
    background: rgba(0, 0, 0, 0.3);
}

.class-skill-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.class-skill-icon {
    width: 48px;
    height: 48px;
    padding: 2px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.45);
}

.class-skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.class-skill.is-unlearned .class-skill-icon img {
    filter: grayscale(0.85) brightness(0.75);
}

.class-skill-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.class-skill-name {
    font-size: var(--text-md, 0.95rem);
    font-weight: 700;
    color: #fff8e1;
    text-shadow: 1px 1px 0 #000;
}

.class-skill-up {
    min-width: 64px;
}

.class-skill-rows {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 3px;
    font-size: 0.8rem;
    line-height: 1.45;
}

.class-skill-rows dt {
    color: #b3a48c;
    white-space: nowrap;
}

.class-skill-rows dd {
    white-space: pre-line;
    margin: 0;
    color: #e8e0d8;
}

/* แถวละ 2 คู่ (หัวข้อ · ค่า · หัวข้อ · ค่า) — เงื่อนไขการแสดงผล / ความสามารถ (is-wide) อยู่แถวเดียวเต็มความกว้าง
   จอแคบ (ไม่ใช่ layout-wide) ยังเป็นคู่เดียวต่อแถวตามเดิม */
html.layout-wide .class-skill-rows--pairs {
    grid-template-columns: fit-content(11em) minmax(0, 1fr) fit-content(11em) minmax(0, 1fr);
    column-gap: 12px;
}

html.layout-wide .class-skill-rows--pairs dt {
    white-space: normal;
}

html.layout-wide .class-skill-rows--pairs dt.is-wide {
    grid-column: 1;
}

html.layout-wide .class-skill-rows--pairs dd.is-wide {
    grid-column: 2 / -1;
}

/* ความสามารถของสกิล — ป้าย "Buff : Provoke" นำหน้าข้อความ (เมนูอาชีพ · ทูลทิป · หน้าต่างรายละเอียด · คู่มือ) */
.skill-ability-line {
    display: block;
}

/* สกิลที่มีหลายความสามารถ — bullet ทีละความสามารถ */
.skill-ability-list {
    margin: 0;
    padding-left: 1.1em;
    list-style: disc;
    text-align: left;
    white-space: normal;
}

.skill-ability-list li + li {
    margin-top: 0.35em;
}

/* ป้ายนำหน้าบรรทัด (ไม่มีช่องว่างตามหลังในข้อความ) — ป้ายกลางประโยคมีช่องว่างคั่นอยู่แล้ว */
.skill-ability-line > .skill-ability-badge:first-child {
    margin-right: 0.4em;
}

.skill-ability-badge {
    display: inline-block;
    padding: 0 0.45em;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: 0.05em;
}

/* ลำดับความสามารถในป้าย (Pain Barrier 1 · 2) — badge ซ้อนสีขาว */
.skill-ability-badge-num {
    display: inline-block;
    min-width: 1.1em;
    padding: 0 0.3em;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    vertical-align: 0.05em;
}

.skill-ability-badge--buff {
    color: #7fd98b;
    background: rgba(70, 160, 85, 0.18);
}

.skill-ability-badge--debuff {
    color: #ff8f7a;
    background: rgba(200, 70, 50, 0.18);
}

/* ───────── Attributes ของสกิลที่เลือก ───────── */
.class-attrs {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(236, 192, 104, 0.25);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.class-attrs-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.class-attrs-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f8e3a8;
}

.class-attrs-hint {
    font-size: 0.7rem;
    color: #b3a48c;
}

.class-attr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.4);
    background: rgba(0, 0, 0, 0.26);
}

.class-attr.is-selected {
    border-color: rgba(143, 227, 122, 0.6);
}

.class-attr.is-locked {
    opacity: 0.72;
}

.class-attr-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.class-attr.is-locked .class-attr-icon {
    filter: grayscale(0.85) brightness(0.75);
}

.class-attr-info {
    min-width: 0;
}

.class-attr-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.class-attr-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #fff8e1;
}

.class-attr-tier,
.class-attr-on {
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.6;
}

.class-attr-tier {
    color: #f8e3a8;
    border: 1px solid rgba(236, 192, 104, 0.55);
}

.class-attr-on {
    color: #10230f;
    background: #8fe37a;
}

.class-attr-lv {
    font-size: 0.72rem;
    color: #ffd98a;
    font-variant-numeric: tabular-nums;
}

.class-attr-lines {
    margin: 3px 0 0;
    padding-left: 16px;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #e8e0d8;
}

.class-attr-price {
    margin: 3px 0 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffd98a;
    font-variant-numeric: tabular-nums;
}

.class-attr-unlock {
    margin: 3px 0 0;
    font-size: 0.72rem;
    color: #8fe37a;
}

.class-attr.is-locked .class-attr-unlock {
    color: #ffb08a;
}

.class-attr-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.class-attr-up,
.class-attr-pick {
    min-width: 58px;
}

/* จอแคบ: คอลัมน์หัวข้อแคบลง หัวข้อยาว (ความสามารถ …) ตัดบรรทัดได้ */
html:not(.layout-wide) .class-skill-rows {
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    column-gap: 8px;
}

html:not(.layout-wide) .class-skill-rows dt {
    white-space: normal;
}

/* ───────── ติดตั้งสกิลลงแถบสกิล: ปุ่ม · เลือกช่อง · ลากไอคอน ───────── */
.class-skill-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.class-skill-slot-tag {
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid rgba(141, 110, 99, 0.45);
    font-size: 0.7rem;
    font-weight: 700;
    color: #b3a48c;
}

.class-skill-slot-tag.is-on {
    color: #8fe37a;
    border-color: rgba(143, 227, 122, 0.55);
}

.class-skill-drag-hint {
    margin: -2px 0 8px;
    font-size: 0.7rem;
    color: #9a8a72;
}

/* ไอคอนที่ลากได้ */
.class-skill-icon.is-draggable,
.class-skill-tab-icon.is-draggable {
    cursor: grab;
}

.class-skill-tab-slot {
    position: absolute;
    left: -4px;
    top: -4px;
    min-width: 14px;
    padding: 0 3px;
    border-radius: 4px;
    background: #2f7d32;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.class-slot-pick {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: -2px 0 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(236, 192, 104, 0.45);
    background: rgba(240, 200, 96, 0.08);
}

.class-slot-pick-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #f8e3a8;
}

.class-slot-pick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.class-slot-pick-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 2px;
    display: grid;
    place-items: center;
    border: 1px solid var(--dusk-slot-edge, #3d3258);
    border-radius: 7px;
    background: linear-gradient(150deg, var(--dusk-slot-hi, #2a2240) 0%, var(--dusk-slot-lo, #120e1e) 100%);
    box-shadow:
        inset 0 1px 0 rgba(200, 180, 250, 0.14),
        inset 0 -2px 4px rgba(0, 0, 0, 0.4);
    color: #cfc4e2;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

.class-slot-pick-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    opacity: 0.55;
}

.class-slot-pick-num {
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 1px 1px 0 #000;
}

.class-slot-pick-btn.is-filled .class-slot-pick-num {
    position: absolute;
    right: 2px;
    bottom: 0;
    font-size: 0.66rem;
}

.class-slot-pick-btn:hover,
.class-slot-pick-btn:focus-visible {
    color: #fff3d6;
    border-color: #f0c860;
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 170, 0.2),
        0 0 10px rgba(255, 170, 80, 0.35);
    outline: none;
}

.class-slot-pick-btn.is-current {
    border-color: #8fe37a;
    box-shadow:
        inset 0 1px 0 rgba(200, 255, 190, 0.2),
        0 0 8px rgba(143, 227, 122, 0.4);
}

.class-slot-pick-btn.is-current img {
    opacity: 1;
}

/* ถาดสกิล 4 แถว × 10 ช่อง (เมนูอาชีพ / กระเป๋า) */
.hotbar-slot-pick {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.hotbar-slot-pick-grid {
    display: grid;
    grid-template-columns: auto repeat(10, minmax(0, 34px));
    gap: 4px;
    align-items: center;
    justify-content: start;
}

.hotbar-slot-pick-row-label {
    padding-right: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    color: #cbb98a;
    white-space: nowrap;
}

.hotbar-slot-pick .class-slot-pick-btn {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
}

.hotbar-slot-pick .class-slot-pick-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.6);
    opacity: 0.55;
}

.hotbar-slot-pick .class-slot-pick-btn:disabled:hover {
    border-color: var(--dusk-slot-edge, #3d3258);
    box-shadow: none;
}

/* การ์ดไอเทมระหว่างเลือกช่อง — ซ่อนปุ่มเดิมไว้ก่อน */
.action-card.is-picking-slot .action-card-main,
.action-card.is-picking-slot .action-card-tiles {
    display: none;
}

.action-card .hotbar-slot-pick {
    margin: 8px 0 0;
}

/* ระหว่างลากสกิล: แผงจางและปล่อยให้เมาส์/นิ้วทะลุไปถึงแถบสกิลด้านล่าง */
#game-class-root.ui-drag-active,
#game-class-root.ui-drag-active * {
    /* ต้องชนะกฎ .open ของแผง และลูกที่ตั้ง pointer-events: auto ไว้เอง */
    pointer-events: none !important;
}

#game-class-root.ui-drag-active .game-expertise-panel {
    opacity: 0.25 !important;
    transition: opacity 0.12s;
}

/* จอแคบ: ปุ่มติดตั้งลงไปอยู่ใต้ชื่อสกิล ไม่เบียดชื่อ */
html:not(.layout-wide) .class-skill-top {
    grid-template-columns: auto minmax(0, 1fr);
}

html:not(.layout-wide) .class-skill-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
}

/* รูปแบบการโจมตีของอาชีพ — สีตามประเภท */
.class-attack-chip--physical {
    border-color: rgba(255, 138, 101, 0.6);
    background: rgba(255, 112, 67, 0.14);
    color: #ffccbc;
}

.class-attack-chip--magical {
    border-color: rgba(149, 117, 205, 0.7);
    background: rgba(126, 87, 194, 0.18);
    color: #d1c4e9;
}

.class-attack-chip--hybrid {
    border-color: rgba(129, 199, 132, 0.6);
    background: rgba(102, 187, 106, 0.14);
    color: #c8e6c9;
}

/* ป้ายที่ต่อท้ายในบรรทัดเดียวกัน (รูปแบบการโจมตี · Class Max Targets) */
.class-head-weapons-label--gap {
    margin-left: 10px;
}
