/* =========================================================
   lc_features.css — สไตล์ของฟีเจอร์ชุดใหม่
   (อภิธานศัพท์ / ชื่อการ์ดกดค้นหา / ฟอร์แมตรายเด็ค + ตรวจเด็ค /
    ใบลงทะเบียน / โหมดการ์ดที่ขาด)
   ========================================================= */

/* ---------- 1. คีย์เวิร์ด + ชื่อการ์ดในความสามารถ ----------
   ใช้พื้นหลังของตัวเอง (ป้ายสี) เพื่อให้อ่านออกทุกสีกล่องความสามารถ
   ทั้งกล่องสีอ่อน (Creature/Action/Armor) กล่องสีเข้ม (Boost/Fusion) และในป้ายแดง .hlkw */
.kw-term, .card-ref {
    padding: 0 5px;
    border-radius: 5px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background 0.15s, color 0.15s;
}

/* คีย์เวิร์ด = ป้ายเหลืองอ่อน ตัวอักษรน้ำตาลเข้ม + เส้นประ (กดดูความหมาย) */
.kw-term {
    cursor: help;
    background: #fff1b8;
    color: #4a2f00 !important;
    font-weight: 600;
    text-decoration: underline dotted #b07800;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    box-shadow: inset 0 0 0 1px rgba(176, 120, 0, 0.35);
}
.kw-term:hover, .kw-term:focus-visible {
    background: #ffd84d;
    color: #2b1a00 !important;
    outline: none;
}

/* ชื่อการ์ด = ป้ายฟ้าอ่อน ตัวอักษรน้ำเงินเข้ม (กดแล้วค้นหา) */
.card-ref {
    cursor: pointer;
    background: #e1ecff;
    color: #0a3a8c !important;
    font-weight: 700;
    font-style: normal;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px #7fa8f5;
}
.card-ref::after { content: "\00a0🔍"; font-size: 0.75em; }
.card-ref:hover, .card-ref:focus-visible {
    background: #1a5fd6;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px #1a5fd6;
    outline: none;
}

/* ในป้ายคำศัพท์ของ popup / หน้ารวมคำศัพท์ (พื้นเข้ม) ใช้แบบเดียวกัน */
.kw-pop-related .kw-term, .kw-pop-desc .kw-term { font-weight: 500; }

/* popup คำอธิบาย */
.kw-popover {
    position: fixed;
    z-index: 100050;
    width: min(320px, calc(100vw - 16px));
    background: #1e1e2e;
    color: #f1f1f1;
    border: 1px solid #6c5ce7;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    padding: 12px 14px;
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
.kw-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.kw-pop-title { font-weight: 600; font-size: 16px; color: #ffd900; }
.kw-popover .kw-pop-close, .glossary-modal .kw-pop-close {
    background: transparent; border: 0; color: #aaa; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.kw-popover .kw-pop-close:hover, .glossary-modal .kw-pop-close:hover { color: #fff; background: rgba(255,255,255,0.12); }
.kw-pop-desc.is-pending { color: #aaa; font-style: italic; }
.kw-pop-related { margin-top: 8px; font-size: 13px; color: #bbb; }
.kw-pop-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.kw-pop-actions button, .glossary-item-head button {
    font-family: 'Kanit', sans-serif; font-size: 13px;
    background: #6c5ce7; color: #fff; border: 0; border-radius: 16px;
    padding: 5px 12px; cursor: pointer;
}
.kw-pop-actions button[data-act="all"] { background: rgba(255,255,255,0.12); }
.kw-pop-actions button:hover, .glossary-item-head button:hover { background: #8577f0; }
.kw-pop-actions button[data-act="all"]:hover { background: rgba(255,255,255,0.22); }

/* หน้ารวมคำศัพท์ */
.glossary-modal {
    position: fixed; inset: 0; z-index: 100040;
    background: rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.glossary-box {
    width: min(560px, 100%);
    max-height: 85vh;
    display: flex; flex-direction: column;
    background: #1e1e2e; color: #eee;
    border-radius: 14px; border: 1px solid #6c5ce7;
    font-family: 'Kanit', sans-serif;
    overflow: hidden;
}
.glossary-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 4px; }
.glossary-head h3 { margin: 0; color: #ffd900; font-size: 18px; }
.glossary-hint { margin: 0 16px 8px; font-size: 13px; color: #aaa; }
.glossary-list { overflow-y: auto; padding: 0 16px 16px; }
.glossary-item { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.05); margin-bottom: 8px; line-height: 1.55; }
.glossary-item.is-focus { outline: 2px solid #ffd900; }
.glossary-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.glossary-term { font-weight: 600; font-size: 16px; }

.nav-btn.btn-glossary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    font-family: inherit;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: none;
}
.nav-btn.btn-glossary:hover { background: #6c5ce7; border-color: #6c5ce7; }

/* ---------- 2. ฟอร์แมตรายเด็ค + ตรวจเด็ค ---------- */
.deck-format-row {
    display: flex; align-items: center; gap: 8px;
    margin: 8px 0 4px;
    font-size: 13px; color: #ddd;
}
.deck-format-row label { white-space: nowrap; }
.deck-format-row select {
    flex: 1; min-width: 0;
    font-family: 'Kanit', sans-serif; font-size: 13px;
    padding: 5px 8px; border-radius: 8px;
    border: 1px solid #555; background: #2b2b3a; color: #fff;
}

.deck-validation {
    margin: 6px 0;
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 13px;
    border: 1px solid;
    overflow: hidden;
}
.deck-validation.is-ok  { border-color: #2ecc71; background: rgba(46, 204, 113, 0.12); color: #d8ffe6; }
.deck-validation.is-bad { border-color: #ff6b6b; background: rgba(255, 107, 107, 0.12); color: #ffe1e1; }
.deck-validation summary {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 7px 10px; cursor: pointer; list-style: none;
}
.deck-validation summary::-webkit-details-marker { display: none; }
.deck-validation summary::after { content: "▾"; opacity: 0.7; }
.deck-validation[open] summary::after { content: "▴"; }
.dv-head { font-weight: 600; }
.dv-format { margin-left: auto; font-size: 12px; opacity: 0.8; white-space: nowrap; }
.dv-body { padding: 0 12px 10px; }
.dv-body ul { margin: 0; padding-left: 18px; }
.dv-body li { margin: 3px 0; }
.dv-body li small { display: block; opacity: 0.75; font-size: 12px; }
.dv-note { margin: 4px 0; opacity: 0.8; font-size: 12px; }
.dv-over { color: #ff6b6b !important; font-weight: bold; }

.coll-format-badge {
    display: inline-block; margin-left: 6px;
    background: #07357D; color: #fff !important;
    font-size: 11px !important; border-radius: 10px; padding: 1px 8px;
}

.showcase-validation { max-width: 720px; margin: 0 auto 10px; }

/* ---------- 3. ปุ่มในหัว Showcase ---------- */
.showcase-header { flex-wrap: wrap; gap: 8px; }
#ownedModeBtn.is-on { background: #e67e22 !important; color: #fff; }

/* ---------- 4. หน้าต่างใบลงทะเบียน ---------- */
.lc-dialog-backdrop {
    position: fixed; inset: 0; z-index: 100030;
    background: rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.lc-dialog {
    width: min(460px, 100%);
    max-height: 90vh; overflow-y: auto;
    background: #1e1e2e; color: #eee;
    border: 1px solid #6c5ce7; border-radius: 14px;
    padding: 16px 18px;
    font-family: 'Kanit', sans-serif;
}
.lc-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.lc-dialog-head h3 { margin: 0; color: #ffd900; }
.lc-dialog .lc-dialog-x { padding: 4px 8px; box-shadow: none; background: transparent; border: 0; color: #aaa; font-size: 18px; cursor: pointer; }
.lc-dialog-sub { margin: 6px 0 12px; font-size: 14px; color: #ccc; }
.lc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.lc-field input {
    font-family: 'Kanit', sans-serif; font-size: 16px;
    padding: 10px 12px; border-radius: 10px;
    border: 1px solid #555; background: #2b2b3a; color: #fff;
}
.lc-field input:focus { outline: 2px solid #6c5ce7; border-color: transparent; }
.lc-warning {
    margin: 10px 0; padding: 8px 10px;
    border-left: 4px solid #e67e22; background: rgba(230, 126, 34, 0.12);
    font-size: 13px; line-height: 1.5; border-radius: 4px;
}
.lc-warning.is-red { border-left-color: #ff6b6b; background: rgba(255, 107, 107, 0.12); }
.lc-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.lc-dialog .lc-btn-primary, .lc-dialog .lc-btn-ghost {
    font-family: 'Kanit', sans-serif; font-size: 14px;
    border-radius: 10px; padding: 8px 16px; cursor: pointer; border: 0;
}
.lc-dialog .lc-btn-primary { background: #6c5ce7; color: #fff; }
.lc-dialog .lc-btn-ghost { background: rgba(255,255,255,0.1); color: #eee; }
.lc-dialog .lc-btn-primary:hover { background: #8577f0; }
.lc-dialog .lc-btn-ghost:hover, .lc-dialog .lc-dialog-x:hover { background: rgba(255,255,255,0.2); }

/* ---------- 5. โหมดการ์ดที่ขาด ---------- */
.owned-bar {
    position: sticky; top: 86px; z-index: 900;
    background: #2a2140; color: #fff;
    border: 1px solid #e67e22; border-radius: 12px;
    padding: 10px 12px; margin: 0 0 12px;
    font-family: 'Kanit', sans-serif;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.owned-bar-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.owned-total { color: #b8f5c9; }
.owned-total.has-missing { color: #ffb37a; }
.owned-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.owned-view-switch { display: inline-flex; border-radius: 16px; overflow: hidden; border: 1px solid #555; }
.owned-view-switch button, .owned-act {
    font-family: 'Kanit', sans-serif; font-size: 13px;
    background: transparent; color: #ddd; border: 0; padding: 5px 12px; cursor: pointer;
}
.owned-view-switch button:hover { background: rgba(255,255,255,0.12); }
.owned-view-switch button.active, .owned-view-switch button.active:hover { background: #e67e22; color: #fff; }
.owned-bar .owned-act { background: rgba(255,255,255,0.1); border-radius: 16px; }
.owned-bar .owned-act:hover { background: rgba(255,255,255,0.2); }
.owned-bar .owned-act:disabled { opacity: 0.4; cursor: default; }

.owned-mode .showcase-card { cursor: pointer; }
.owned-mode .showcase-card:hover img { transform: none; }
#showcaseBody .showcase-card.is-missing img,
#showcaseBody .showcase-row.is-missing { filter: grayscale(1) brightness(0.55); }
#showcaseBody .showcase-row.is-missing { opacity: 0.8; }

.owned-miss-chip {
    display: inline-block;
    background: #e67e22; color: #fff;
    font-size: 12px; font-weight: bold;
    border-radius: 10px; padding: 1px 8px;
    white-space: nowrap;
}
.owned-miss-chip.is-on-card { position: absolute; left: 6px; bottom: 6px; z-index: 3; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.owned-empty { text-align: center; color: #ccc; padding: 30px 0; font-family: 'Kanit', sans-serif; }

@media (max-width: 768px) {
    .owned-bar { top: 70px; }
    .owned-bar-top { font-size: 13px; }
}

/* ---------- 6. กันสไตล์ปุ่มส่วนกลาง (filterdiv.css: button:not(.qty-btn)) ---------- */
.kw-popover button, .glossary-modal button, .lc-dialog button, .owned-bar button {
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    box-shadow: none;
    transform: none;
    border-radius: 16px;
}
.kw-popover button:hover, .glossary-modal button:hover, .lc-dialog button:hover, .owned-bar button:hover {
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    /* มือถือ: แถบการ์ดที่ขาดไม่ต้องลอยตาม (กินพื้นที่จอเกินไป) */
    .owned-bar { position: static; }
}

/* ---------- 7. นับการ์ดที่มี: แถบความคืบหน้า + หัวข้อหมวดในหน้าคำศัพท์ ---------- */
.owned-progress {
    flex-basis: 100%;
    height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.12);
    overflow: hidden; margin-top: 6px;
}
.owned-progress span { display: block; height: 100%; background: linear-gradient(90deg, #e67e22, #2ecc71); transition: width 0.25s; }
.owned-total { color: #ffb37a; }
.owned-total:not(.has-missing) { color: #b8f5c9; }

.glossary-group {
    margin: 14px 0 8px; color: #b9b1ff; font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12); padding-bottom: 4px;
}
.glossary-group:first-child { margin-top: 0; }

/* ---------- 8. ป้าย "กลับไปที่การ์ดเดิม" (search_trail.js) ---------- */
.search-trail {
    position: fixed;
    left: 50%;
    top: 14px;                     /* PC: บนสุดกลางจอ ไม่บังข้อความในหน้าต่างการ์ด */
    transform: translateX(-50%);
    z-index: 100060;               /* อยู่เหนือหน้าต่างการ์ด เพื่อกดกลับได้แม้เปิดการ์ดใบใหม่อยู่ */
    display: flex;
    align-items: stretch;
    max-width: calc(100vw - 24px);
    background: #1e1e2e;
    border: 2px solid #ffd900;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 217, 0, 0.35);
    font-family: 'Kanit', sans-serif;
    overflow: hidden;
    animation: st-pop 0.25s ease-out;
}
@keyframes st-pop { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.search-trail button {
    font-family: 'Kanit', sans-serif;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    transform: none;
}
.search-trail button:hover { transform: none; box-shadow: none; }
.search-trail .st-back {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 6px;
    min-width: 0;
    font-size: 14px;
}
.search-trail .st-back:hover { background: rgba(255, 217, 0, 0.15); }
.search-trail .st-back img {
    width: 30px; height: 42px; object-fit: cover;
    border-radius: 4px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.3);
}
.search-trail .st-arrow { font-size: 18px; padding-left: 8px; }
.search-trail .st-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trail .st-text b { color: #ffd900; }
.search-trail .st-count {
    background: #ffd900; color: #1e1e2e;
    font-size: 11px; font-weight: 700;
    border-radius: 10px; padding: 0 7px; flex-shrink: 0;
}
.search-trail .st-close {
    padding: 0 14px;
    border-left: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    font-size: 14px;
}
.search-trail .st-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

@media (max-width: 768px) {
    /* มือถือ: ยกขึ้นเหนือปุ่มลอย "โหมดจัดเด็ค" (มุมซ้ายล่าง) */
    .search-trail { top: auto; bottom: 140px; }
    .search-trail .st-back { font-size: 13px; }
}

/* ---------- 9. popup คำศัพท์: ปุ่มย้อนเมื่อดูต่อยอด ---------- */
.kw-popover .kw-pop-back {
    background: rgba(255,255,255,0.1); color: #ffd900; border: 0;
    border-radius: 6px; padding: 2px 9px; font-size: 16px; line-height: 1.2;
    cursor: pointer; box-shadow: none; flex-shrink: 0;
}
.kw-popover .kw-pop-back:hover { background: rgba(255,217,0,0.25); color: #fff; }
.kw-pop-head .kw-pop-title { flex: 1; }

/* ---------- 10. ป้ายอนุกรมวิธานในหน้าการ์ด: กดแล้วกรองการ์ดอนุกรมวิธานนั้น ---------- */
#modalInfo .taxo-badge {
    cursor: pointer;
    transition: box-shadow 0.15s, background 0.15s;
}
#modalInfo .taxo-badge::after { content: "\00a0🔍"; font-size: 0.8em; }
#modalInfo .taxo-badge:hover {
    box-shadow: 0 0 0 2px #2ecc71;
    background: #d9f7e5;
}


/* ---------- 11. หน้าต่าง Donate (QR พร้อมเพย์) ---------- */
.donate-modal {
    position: fixed; inset: 0; z-index: 100070;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}
.donate-modal[hidden] { display: none; }
.donate-box {
    position: relative;
    width: min(380px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #1e1e2e;
    color: #eee;
    border: 2px solid #ffc107;
    border-radius: 16px;
    padding: 18px 18px 14px;
    text-align: center;
    font-family: 'Kanit', sans-serif;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}
.donate-box h3 { margin: 0 0 4px; color: #ffc107; font-size: 20px; }
.donate-sub { margin: 0 0 12px; font-size: 13px; color: #bbb; }
.donate-qr { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff; }
.donate-save {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 8px 14px;
    border-radius: 20px;
    background: linear-gradient(45deg, #ff9f43, #ffc107);
    color: #1a1a1a; font-weight: 600; font-size: 14px;
    text-decoration: none;
}
.donate-save:hover { filter: brightness(1.08); }
.donate-thanks { margin: 10px 0 0; font-size: 13px; color: #ccc; }
.donate-box .donate-close {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; padding: 0;
    background: rgba(255,255,255,0.1); color: #ddd;
    border: 0; border-radius: 50%; box-shadow: none;
    font-size: 15px; cursor: pointer;
}
.donate-box .donate-close:hover { background: rgba(255,255,255,0.2); color: #fff; transform: none; box-shadow: none; }

.donate-purpose {
    margin: 2px 0 6px; padding: 6px 10px;
    background: rgba(255, 193, 7, 0.12);
    border: 1px dashed rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    color: #ffe08a; font-size: 14px;
}

/* ---------- 12. สำรอง / กู้คืนข้อมูลทั้งหมด (backup_all.js) ---------- */
.backup-bar {
    padding: 10px 14px;
    background: #202030;
    border-bottom: 1px solid #333;
    font-family: 'Kanit', sans-serif;
}
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-bar .backup-btn {
    height: 34px; padding: 0 14px;
    font-family: 'Kanit', sans-serif; font-size: 13px;
    background: #2f3446; color: #eee;
    border: 1px solid #454b60; border-radius: 8px;
    box-shadow: none; transform: none; cursor: pointer;
}
.backup-bar .backup-btn:hover { background: #3c4360; transform: none; box-shadow: none; }
.backup-bar .backup-btn.is-primary { background: #1e8449; border-color: #27ae60; color: #fff; }
.backup-bar .backup-btn.is-primary:hover { background: #239b56; }
.backup-status { display: block; margin-top: 6px; font-size: 12px; color: #9a9ab0; }
.backup-status.is-warn { color: #ffb37a; }

.restore-options { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.lc-dialog .restore-opt {
    display: block; width: 100%; text-align: left;
    padding: 10px 12px; border-radius: 10px;
    background: #2b2b3a; color: #eee; border: 1px solid #454b60;
    font-family: 'Kanit', sans-serif; font-size: 14px; cursor: pointer;
}
.lc-dialog .restore-opt small { display: block; color: #aaa; font-size: 12px; margin-top: 2px; }
.lc-dialog .restore-opt:hover { background: #363650; }
.lc-dialog .restore-opt.is-recommended { border-color: #27ae60; }
.lc-dialog .restore-opt.is-danger b { color: #ff9a9a; }
.restore-tag { background: #27ae60; color: #fff; font-size: 11px; border-radius: 8px; padding: 0 6px; margin-left: 4px; }

/* ---------- 13. ปุ่ม "✨ มีอะไรใหม่" (whats_new.js) ---------- */
h1.main-title .whats-new-btn {
    position: relative;
    align-self: center;
    flex-shrink: 0;
    height: 30px;
    padding: 0 12px;
    font-family: 'Kanit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: #1a1a1a;
    background: linear-gradient(135deg, #ffe066, #ffb347);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 224, 102, 0.25), 0 4px 12px rgba(255, 179, 71, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
h1.main-title .whats-new-btn:hover {
    background: linear-gradient(135deg, #fff08a, #ffc266);
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(255, 224, 102, 0.35), 0 6px 16px rgba(255, 179, 71, 0.45);
}
/* ยังไม่เคยเปิดดูเวอร์ชันนี้ → จุดแดงกระพริบ + แสงวิ้ง */
h1.main-title .whats-new-btn.is-new::after {
    content: "";
    position: absolute;
    top: -3px; right: -3px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: #ff4757;
    border: 2px solid #1e1e2e;
    animation: wn-ping 1.6s ease-out infinite;
}
h1.main-title .whats-new-btn.is-new { animation: wn-glow 2.4s ease-in-out infinite; }
@keyframes wn-ping {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    80%, 100% { box-shadow: 0 0 0 9px rgba(255, 71, 87, 0); }
}
@keyframes wn-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 224, 102, 0.25), 0 4px 12px rgba(255, 179, 71, 0.35); }
    50% { box-shadow: 0 0 0 4px rgba(255, 224, 102, 0.45), 0 4px 20px rgba(255, 179, 71, 0.7); }
}
@media (prefers-reduced-motion: reduce) {
    h1.main-title .whats-new-btn.is-new, h1.main-title .whats-new-btn.is-new::after { animation: none; }
}
@media (max-width: 768px) {
    /* มือถือ: เหลือแค่ ✨ + จุดแดง ไม่ดันหัวเว็บตกบรรทัด */
    h1.main-title { font-size: 19px !important; gap: 8px !important; }
    h1.main-title .whats-new-btn { width: 28px; height: 28px; padding: 0; font-size: 14px; }
    h1.main-title .whats-new-btn .wn-text { display: none; }
}

.whats-new-box { width: min(520px, 100%); }
.whats-new-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.whats-new-list li {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}
.whats-new-list .wn-icon { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.whats-new-list .wn-body b { display: block; font-size: 14.5px; color: #fff; }
.whats-new-list .wn-body small { display: block; font-size: 12.5px; color: #b8b8c8; line-height: 1.5; margin-top: 2px; }
.lc-dialog .whats-new-list .wn-try {
    margin-top: 6px; padding: 3px 12px; height: auto;
    font-family: 'Kanit', sans-serif; font-size: 12.5px;
    background: #6c5ce7; color: #fff; border: 0; border-radius: 14px; cursor: pointer;
}
.lc-dialog .whats-new-list .wn-try:hover { background: #8577f0; }

/* ---------- 14. ค้นหาไม่เจอ (site_extras.js) ---------- */
.empty-search {
    width: 100%;
    max-width: 640px;
    margin: 30px auto;
    padding: 18px 20px;
    background: rgba(20, 20, 32, 0.92);
    border: 1px solid #454b60;
    border-radius: 14px;
    color: #ddd;
    font-family: 'Kanit', sans-serif;
    text-align: center;
}
.es-title { font-size: 18px; color: #fff; margin-bottom: 10px; }
.es-title b { color: #ffd900; }
.es-chips, .es-similar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 8px 0; font-size: 13px; }
.es-chips > span:first-child, .es-similar > span:first-child { color: #9a9ab0; }
.es-chip { background: #2f3446; border: 1px solid #454b60; border-radius: 12px; padding: 2px 10px; color: #ffd27a; }
.es-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 4px; }
.empty-search .es-btn, .empty-search .es-name {
    font-family: 'Kanit', sans-serif; font-size: 14px;
    padding: 7px 14px; border-radius: 18px;
    background: #2f3446; color: #eee; border: 1px solid #454b60;
    box-shadow: none; transform: none; cursor: pointer;
}
.empty-search .es-btn.is-primary { background: #07357D; border-color: #1a4a9e; color: #fff; }
.empty-search .es-btn:hover, .empty-search .es-name:hover { background: #3c4360; transform: none; box-shadow: none; }
.empty-search .es-btn.is-primary:hover { background: #0b4db3; }
.empty-search .es-name { padding: 4px 12px; font-size: 13px; background: #e1ecff; color: #0a3a8c; border-color: #7fa8f5; }
.empty-search .es-name:hover { background: #1a5fd6; color: #fff; }

/* ---------- 15. ป้ายข้อมูลการ์ดล่าสุด (แถบล่าง) ---------- */
.nav-left .data-updated {
    font-size: 0.75rem;
    opacity: 0.6;
    border-left: 1px solid #555;
    padding-left: 12px;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .nav-left .data-updated { display: none; }
}

/* ---------- 16. โน้ตเด็ค + จัดการคอลเล็คชั่น (deck_extras.js) ---------- */
#deckBuilderView .dp-notes { margin-top: 8px; font-size: 13px; color: #ccc; }
#deckBuilderView .dp-notes summary { cursor: pointer; padding: 4px 0; list-style: none; user-select: none; }
#deckBuilderView .dp-notes summary::-webkit-details-marker { display: none; }
#deckBuilderView .dp-notes summary::after { content: " ▾"; opacity: 0.6; }
#deckBuilderView .dp-notes[open] summary::after { content: " ▴"; }
#deckBuilderView .dp-notes.has-notes summary { color: #ffd900; }
#deckBuilderView .dp-notes-hint { font-size: 11px; opacity: 0.7; }
#deckBuilderView .dp-notes textarea {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 70px;
    margin-top: 4px; padding: 8px 10px;
    font-family: 'Kanit', sans-serif; font-size: 13.5px; line-height: 1.5;
    background: #1b1b24; color: #eee; border: 1px solid #454b60; border-radius: 8px;
}
#deckBuilderView .dp-notes textarea:focus { border-color: #ffd900; outline: none; }

.coll-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 14px; background: #202030; border-bottom: 1px solid #333; box-sizing: border-box; }
.coll-tools input, .coll-tools select {
    height: 32px; padding: 0 10px; font-family: 'Kanit', sans-serif; font-size: 13px;
    background: #2b2b3a; color: #eee; border: 1px solid #454b60; border-radius: 8px;
}
.coll-tools input { flex: 1; min-width: 140px; }
.coll-count { color: #9a9ab0; font-size: 12px; white-space: nowrap; }
.collection-card-item .dup-deck-btn {
    position: absolute !important; top: 10px; right: 48px;
    width: 30px; height: 30px; padding: 0 !important;
    display: flex; align-items: center; justify-content: center;
    background: rgba(7, 53, 125, 0.9) !important; color: #fff !important;
    border: none !important; border-radius: 50% !important; font-size: 15px;
    box-shadow: none !important; cursor: pointer; z-index: 5;
}
.collection-card-item .dup-deck-btn:hover { background: #0b4db3 !important; transform: none !important; }
.deck-info .coll-note-badge { display: inline-block; margin-left: 6px; font-size: 11px !important; background: #ffe7a0; color: #6b4a00 !important; border-radius: 10px; padding: 1px 7px; }
.deck-info .coll-when { display: block; font-size: 11px !important; color: #555 !important; margin-top: 2px; }
.coll-empty { text-align: center; color: #aaa; font-family: 'Kanit', sans-serif; font-size: 13px; }

/* ---------- 17. การ์ดโปรด / ดูล่าสุด / ขนาดตัวอักษร / ซูมรูป (ux_extras.js) ---------- */
.quick-lists { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
#searchBar .quick-lists .ql-btn, #searchBar .quick-lists .ql-clear {
    height: 28px; padding: 0 12px;
    font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 400;
    background: transparent; color: #ccc;
    border: 1px solid #555; border-radius: 14px;
    box-shadow: none; transform: none; cursor: pointer;
}
#searchBar .quick-lists .ql-btn small { opacity: 0.65; margin-left: 2px; }
#searchBar .quick-lists .ql-btn:hover { background: rgba(255,255,255,0.08); transform: none; box-shadow: none; }
#searchBar .quick-lists .ql-btn.active { background: #ffd900; color: #1a1a1a; border-color: #ffd900; }
#searchBar .quick-lists .ql-clear { border-style: dashed; font-size: 12px; color: #aaa; }

#modalInfo h2 .fav-star {
    margin-left: 8px; vertical-align: middle;
    width: 34px; height: 34px; padding: 0;
    font-size: 22px; line-height: 1;
    background: transparent; color: #b0b0b0;
    border: 1px solid #ddd; border-radius: 50%;
    box-shadow: none; cursor: pointer;
}
#modalInfo h2 .fav-star:hover { color: #f1c40f; background: #fff8dc; transform: none; box-shadow: none; }
#modalInfo h2 .fav-star.is-on { color: #f1c40f; border-color: #f1c40f; background: #fffbe8; }

#modalInfo .ability-box { font-size: calc(1em * var(--lc-ability-scale, 1)); }
#modalInfo .ab-font { float: right; display: inline-flex; gap: 4px; }
#modalInfo .ab-font button {
    width: 30px; height: 24px; padding: 0;
    font-family: 'Kanit', sans-serif; font-size: 12px; font-weight: 600;
    background: rgba(0,0,0,0.12); color: inherit;
    border: 1px solid rgba(0,0,0,0.2); border-radius: 6px;
    box-shadow: none; cursor: pointer;
}
#modalInfo .ab-font button:hover:not(:disabled) { background: rgba(0,0,0,0.22); transform: none; box-shadow: none; }
#modalInfo .ab-font button:disabled { opacity: 0.35; cursor: default; }
#modalImg { cursor: zoom-in; }
.lc-zoom-overlay img { max-width: 96vw !important; max-height: 96vh !important; touch-action: pinch-zoom; }

/* =========================================================
   18. Showcase — ภาพรวมเด็ค (Deck Overview)
   ========================================================= */
#showcaseBody .showcase-overview-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px 7px 12px;
    background: #1e1e2e; color: #d8d6f0;
    border: 1px solid rgba(108, 92, 231, 0.7); border-radius: 20px;
    font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: normal;
    box-shadow: none; transform: none; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#showcaseBody .showcase-overview-btn:hover { background: rgba(108, 92, 231, 0.22); color: #fff; transform: none; box-shadow: none; }
#showcaseBody .showcase-overview-btn.is-open { background: #6c5ce7; border-color: #6c5ce7; color: #fff; }
#showcaseBody .showcase-overview-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#showcaseBody .showcase-overview-btn .sob-chev { width: 14px; height: 14px; opacity: 0.75; transition: transform 0.2s; }
#showcaseBody .showcase-overview-btn.is-open .sob-chev { transform: rotate(180deg); }

.deck-overview {
    --dov-bg: #161625; --dov-card: #1e1e30; --dov-line: rgba(255,255,255,0.08);
    --dov-ink: #f2f2f7; --dov-ink2: #b4b4c6; --dov-ink3: #7d7d93;
    margin: 0 0 16px; padding: 18px;
    background: var(--dov-bg); color: var(--dov-ink);
    border: 1px solid rgba(108, 92, 231, 0.45); border-radius: 14px;
    font-family: 'Kanit', sans-serif;
}
.deck-overview[hidden] { display: none; }
.deck-overview .dov-empty { margin: 8px 0; text-align: center; color: var(--dov-ink3); }
.deck-overview .dov-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.deck-overview .dov-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: var(--dov-ink); }
.deck-overview .dov-total { font-size: 13px; color: var(--dov-ink2); }

.deck-overview .dov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.deck-overview .dov-tile {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 12px 8px; background: var(--dov-card);
    border: 1px solid var(--dov-line); border-radius: 10px; text-align: center;
}
.deck-overview .dov-tile-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dov-ink2); }
.deck-overview .dov-tile-num { font-size: 26px; font-weight: 600; line-height: 1.15; color: var(--dov-ink); font-variant-numeric: tabular-nums; }
.deck-overview .dov-tile-sub { font-size: 11px; color: var(--dov-ink3); }

.deck-overview .dov-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.deck-overview .dov-panel {
    display: flex; flex-direction: column; min-width: 0;
    padding: 14px 14px 12px; background: var(--dov-card);
    border: 1px solid var(--dov-line); border-radius: 10px;
}
.deck-overview .dov-panel-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.deck-overview .dov-panel-head h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--dov-ink); }
.deck-overview .dov-panel-head h4 small { margin-left: 4px; font-weight: normal; color: var(--dov-ink3); }
.deck-overview .dov-panel-meta { font-size: 12px; color: var(--dov-ink2); }

.deck-overview .dov-chart {
    display: flex; align-items: stretch; gap: 6px; height: 170px;
    padding: 0 2px; border-bottom: 1px solid rgba(255,255,255,0.18);
}
.deck-overview .dov-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; cursor: default; }
.deck-overview .dov-val { flex: none; height: 18px; font-size: 12px; line-height: 18px; color: var(--dov-ink2); font-variant-numeric: tabular-nums; }
.deck-overview .dov-bar-area { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.deck-overview .dov-bar {
    flex: none; width: 70%; max-width: 26px; display: flex; flex-direction: column-reverse; gap: 2px;
    border-radius: 4px 4px 0 0; overflow: hidden;
}
.deck-overview .dov-seg { display: block; min-height: 3px; flex-basis: 0; }
.deck-overview .dov-x { position: absolute; bottom: -22px; font-size: 11px; color: var(--dov-ink3); font-variant-numeric: tabular-nums; }
.deck-overview .dov-col:hover .dov-bar { filter: brightness(1.15); }
.deck-overview .dov-col:hover .dov-x { color: var(--dov-ink); }
.deck-overview .dov-col:not(.is-empty):hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
    z-index: 5; width: max-content; max-width: 220px; padding: 6px 9px;
    background: #0d0d16; color: var(--dov-ink); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px; font-size: 12px; line-height: 1.35; white-space: normal; pointer-events: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.45);
}
.deck-overview .dov-col:first-child:hover::after { left: 0; transform: none; }
.deck-overview .dov-col:last-child:hover::after { left: auto; right: 0; transform: none; }

.deck-overview .dov-legend {
    display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 30px; padding-top: 10px;
    border-top: 1px solid var(--dov-line); font-size: 12px; color: var(--dov-ink2);
}
.deck-overview .dov-key { display: inline-flex; align-items: center; gap: 5px; }
.deck-overview .dov-key b { font-weight: 600; color: var(--dov-ink); font-variant-numeric: tabular-nums; }
.deck-overview .dov-key img { width: 16px; height: 16px; object-fit: contain; }
.deck-overview .dov-key.is-muted { color: var(--dov-ink3); }
.deck-overview .dov-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

@media (max-width: 768px) {
    .deck-overview { padding: 14px; }
    .deck-overview .dov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .deck-overview .dov-panels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .deck-overview .dov-tile-num { font-size: 22px; }
    .deck-overview .dov-chart { height: 140px; gap: 4px; }
}
