/* /tool — dùng chung với /post/css/style.css (khung trang, .post-article, .post-body…). Ở đây chỉ thêm phần riêng. */
:root {
    --tool-dl-bg: rgba(0, 100, 0, 0.5);        /* nút tải: xanh lá đậm, trong suốt 50% */
    --tool-dl-bg-hover: rgba(0, 120, 20, 0.68);
    --tool-dl-border: rgba(90, 200, 90, 0.45);
}

.tool-hub { max-width: 720px; margin: 0 auto; }
.tool-intro { margin: 8px 0 0; font-size: 15px; opacity: .8; }
.tool-empty { text-align: center; opacity: .75; }

/* ---------- Danh sách: mỗi tool 1 hộp, logo bo góc bên trái, tên + mô tả bên phải ---------- */
.tool-list { display: flex; flex-direction: column; gap: 14px; }

.tool-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    color: var(--text-cream);
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.tool-card[hidden] { display: none; }
.tool-card:hover, .tool-card:focus-visible { transform: translateY(-2px); border-color: rgba(244, 236, 216, .4); background: rgba(16, 26, 46, .85); }

.tool-card-logo, .tool-hero-logo {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    width: 88px; height: 88px;
    border-radius: 18px;               /* logo bo góc */
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
}
.tool-card-logo img, .tool-hero-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tool-logo-ph { font-size: 38px; }

.tool-card-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tool-card-name { font-size: 19px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.tool-card-sub, .tool-sub { display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.tool-line { display: block; white-space: pre-line; }
.tool-k { font-weight: 700; color: #ffffff; }        /* nhãn: Tác giả / Mô tả (§f) */
.l-game .tool-k { color: #55ff55; }                   /* Game (§a) */
.l-plat .tool-k { color: #ffaa00; }                   /* Nền tảng (§6, vàng) */
.l-ver .tool-k { color: #55ffff; }                    /* Version (§b) */
.tool-v { color: #aaaaaa; }                           /* giá trị mặc định xám (§7), tên tác giả mặc định trắng */
.l-author .tool-v { color: #ffffff; }

.tool-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    background: rgba(220, 50, 60, .85);
    color: #fff;
    font-size: 12px; font-weight: 800; letter-spacing: .5px;
    vertical-align: middle;
}
.tool-card .tool-badge { position: absolute; top: 10px; right: 12px; }

/* Logo của tool 18+ bị làm mờ, giữa logo có mắt gạch chéo: bấm vào để hiện logo đó (thẻ được thêm class is-revealed).
   Người xem đã xác nhận 18+ ở trang tool (class tool-18ok trên <html>) thì logo luôn rõ. */
.tool-card-logo { position: relative; }
.tool-eye { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: #fff; cursor: pointer; background: rgba(0, 0, 0, .28); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .8)); }
.tool-eye:hover, .tool-eye:focus-visible { background: rgba(0, 0, 0, .4); outline: none; }
html:not(.tool-18ok) .tool-card[data-adult]:not(.is-revealed) .tool-card-logo img { filter: blur(14px); transform: scale(1.15); }
html:not(.tool-18ok) .tool-card[data-adult]:not(.is-revealed) .tool-eye { display: flex; }

/* ---------- Trang chi tiết ---------- */
.tool-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.tool-hero-logo { width: 112px; height: 112px; border-radius: 22px; }
.tool-hero-text { min-width: 0; }
.tool-title { margin: 0 0 6px; overflow-wrap: anywhere; }
.tool-sub { font-size: 15px; line-height: 1.6; }

.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 24px; }
.tool-dls { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-body + .tool-actions { margin-top: 28px; margin-bottom: 0; }   /* nút tải nằm sau phần mô tả */

/* Nút tải: hình chữ nhật xanh lá đậm 50%, bo góc nhẹ */
.tool-dl {
    display: inline-block;
    min-width: 190px;
    padding: 12px 28px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--tool-dl-border);
    background: var(--tool-dl-bg);
    color: #f1fff1;
    font-size: 17px; font-weight: 800;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.tool-dl:hover, .tool-dl:focus-visible { background: var(--tool-dl-bg-hover); transform: translateY(-1px); }

.tool-donate { display: inline-block; line-height: 0; border-radius: 10px; transition: transform .15s ease; }
.tool-donate:hover, .tool-donate:focus-visible { transform: translateY(-2px); }
.tool-donate img { display: block; height: 54px; width: auto; border-radius: 10px; }

/* ---------- Cổng xác nhận 18+ ---------- */
.tool-gate { display: none; }
html.tool-locked .tool-gate {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(5, 11, 22, .96);
}
html.tool-locked .tool-article[data-adult] { visibility: hidden; }     /* ẩn nội dung tới khi xác nhận (không có JS thì không khóa) */
html.tool-locked .tool-view > .back-btn { visibility: hidden; }

.tool-gate-box {
    width: 100%; max-width: 460px;
    padding: 24px 22px;
    background: #0c1a2e;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.tool-gate-box h2 { margin: 0 0 10px; font-size: 21px; }
.tool-gate-box p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; opacity: .85; }
.tool-gate-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; cursor: pointer; }
.tool-gate-check input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; }
.tool-gate-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.tool-gate-ok {
    padding: 11px 22px;
    border-radius: 8px;
    border: 1px solid var(--tool-dl-border);
    background: var(--tool-dl-bg-hover);
    color: #f1fff1;
    font-family: inherit; font-size: 15px; font-weight: 800;
    cursor: pointer;
}
.tool-gate-ok:disabled { opacity: .4; cursor: not-allowed; }
.tool-gate-leave { color: #9fd7ff; font-size: 14px; }

@media (max-width: 480px) {
    .tool-card { gap: 12px; padding: 12px; }
    .tool-card-logo { width: 72px; height: 72px; border-radius: 16px; }
    .tool-card-name { font-size: 17px; padding-right: 34px; }
    .tool-hero { flex-direction: column; align-items: flex-start; }
    .tool-dl { width: 100%; }
}
