/**
 * August CSGO Fair — Widget + Roulette overlay
 * Mọi selector đều có tiền tố .august-csgo-fair để không ảnh hưởng giao diện site.
 */

.august-csgo-fair {
    --acf-bg: #12121a;
    --acf-border: #1e1e2e;
    --acf-glass: rgba(255, 255, 255, 0.03);
    --acf-text: #e8e8f0;
    --acf-dim: #8892b0;
    --acf-gold: #ffd700;
    --acf-green: #00e676;
    --acf-red: #ff5252;
    --acf-purple: #6c5ce7;
    margin: 24px 0;
    padding: 18px 20px;
    background: var(--acf-bg);
    border: 1px solid var(--acf-border);
    border-radius: 12px;
    color: var(--acf-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}
.august-csgo-fair *,
.august-csgo-fair *::before,
.august-csgo-fair *::after { box-sizing: border-box; }

.august-csgo-fair__head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.august-csgo-fair__shield {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(108, 92, 231, 0.15); border-radius: 10px; font-size: 20px;
}
.august-csgo-fair__title { font-weight: 700; font-size: 1rem; letter-spacing: .02em; }
.august-csgo-fair__sub { color: var(--acf-dim); font-size: .85rem; line-height: 1.45; }

.august-csgo-fair__hash { background: var(--acf-glass); border: 1px solid var(--acf-border); border-radius: 8px; padding: 10px 12px; }
.august-csgo-fair__label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--acf-dim); margin-bottom: 4px; }
.august-csgo-fair code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: .78rem; color: var(--acf-gold); background: transparent; padding: 0;
    word-break: break-all;
}

.august-csgo-fair__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.august-csgo-fair__btn,
.august-csgo-fair-overlay .august-csgo-fair__btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: 50px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
    color: #e8e8f0; font: 600 .88rem/1 'Inter', sans-serif; transition: all .25s ease;
}
.august-csgo-fair__btn:hover { border-color: rgba(255, 215, 0, .5); color: #ffd700; }
.august-csgo-fair__btn--primary,
.august-csgo-fair-overlay .august-csgo-fair__btn--primary {
    background: linear-gradient(135deg, #ffd700, #ffb300); color: #111; border-color: transparent;
}
.august-csgo-fair__btn--primary:hover { color: #111; filter: brightness(1.08); box-shadow: 0 0 18px rgba(255, 215, 0, .35); }
.august-csgo-fair__btn[disabled] { opacity: .6; cursor: wait; }

/* Verify panel */
.august-csgo-fair__panel { margin-top: 16px; border-top: 1px solid var(--acf-border); padding-top: 16px; }
.august-csgo-fair__verdict { padding: 10px 14px; border-radius: 8px; font-weight: 600; margin-bottom: 14px; }
.august-csgo-fair__verdict.is-ok { background: rgba(0, 230, 118, .1); color: var(--acf-green); border: 1px solid rgba(0, 230, 118, .25); }
.august-csgo-fair__verdict.is-bad { background: rgba(255, 82, 82, .1); color: var(--acf-red); border: 1px solid rgba(255, 82, 82, .25); }
.august-csgo-fair__kv { margin: 0 0 14px; }
.august-csgo-fair__kv dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--acf-dim); margin-top: 10px; }
.august-csgo-fair__kv dd { margin: 4px 0 0; font-size: .82rem; }
.august-csgo-fair__table-wrap { overflow-x: auto; }
.august-csgo-fair__table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.august-csgo-fair__table th,
.august-csgo-fair__table td { padding: 8px 10px; border-bottom: 1px solid var(--acf-border); text-align: left; color: var(--acf-text); }
.august-csgo-fair__table th { color: var(--acf-dim); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.august-csgo-fair__details { margin-top: 12px; font-size: .84rem; color: var(--acf-dim); }
.august-csgo-fair__details summary { cursor: pointer; color: var(--acf-text); font-weight: 600; }
.august-csgo-fair__details ol { max-height: 240px; overflow: auto; margin: 8px 0 0; padding-left: 22px; }
.august-csgo-fair__details li { margin: 2px 0; }

/* ── Roulette overlay ── */
body.august-csgo-fair-lock { overflow: hidden; }
.august-csgo-fair-overlay {
    position: fixed; inset: 0; z-index: 999999;
    background: rgba(5, 5, 10, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: august-csgo-fair-fade .3s ease;
}
@keyframes august-csgo-fair-fade { from { opacity: 0; } to { opacity: 1; } }
.august-csgo-fair-overlay__box {
    position: relative; width: 100%; max-width: 920px;
    background: #12121a; border: 1px solid #1e1e2e; border-radius: 16px;
    padding: 28px 20px 24px; text-align: center; color: #e8e8f0;
    box-shadow: 0 0 60px rgba(255, 215, 0, .08);
}
.august-csgo-fair-overlay__skip {
    position: absolute; top: 12px; right: 12px; cursor: pointer;
    background: transparent; border: 1px solid rgba(255, 255, 255, .12); color: #8892b0;
    border-radius: 50px; padding: 6px 12px; font: 600 .78rem 'Inter', sans-serif;
}
.august-csgo-fair-overlay__skip:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.august-csgo-fair-overlay__round { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #8892b0; }
.august-csgo-fair-overlay__prize { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 18px; font-size: 1.25rem; font-weight: 700; color: #ffd700; }
.august-csgo-fair-overlay__prize img { width: 56px; height: 42px; object-fit: contain; }

.august-csgo-fair-reel {
    position: relative; overflow: hidden; height: 150px;
    background: #0a0a0f; border: 1px solid #1e1e2e; border-radius: 12px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.august-csgo-fair-reel__marker {
    position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%);
    background: #ffd700; box-shadow: 0 0 14px #ffd700; z-index: 2;
}
.august-csgo-fair-reel__strip { display: flex; height: 100%; align-items: center; will-change: transform; padding-left: 0; }
.august-csgo-fair-reel__tile {
    flex: 0 0 120px; width: 120px; height: 124px; margin: 0 6px; /* TILE = 132px */
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, #181826, #12121a); border: 1px solid #23233a; border-radius: 10px;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.august-csgo-fair-reel__tile.is-revealed { border-color: #ffd700; box-shadow: 0 0 22px rgba(255, 215, 0, .5); transform: scale(1.06); }
.august-csgo-fair-reel__avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.august-csgo-fair__avatar-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(108, 92, 231, .25); color: #fff; font-weight: 700;
}
.august-csgo-fair-reel__name { max-width: 108px; font-size: .78rem; color: #e8e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.august-csgo-fair-overlay__winner { min-height: 28px; margin-top: 16px; font-size: 1.05rem; color: #e8e8f0; }
.august-csgo-fair-overlay__winner strong { color: #ffd700; }
.august-csgo-fair-overlay__summary { margin-top: 6px; }
.august-csgo-fair-overlay__row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 8px auto; max-width: 560px;
    background: rgba(255, 255, 255, .03); border: 1px solid #1e1e2e; border-radius: 10px; text-align: left;
}
.august-csgo-fair-overlay__row-prize { flex: 1; color: #ffd700; font-weight: 600; }
.august-csgo-fair-overlay__row-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.august-csgo-fair-overlay__row-name { font-weight: 600; }
.august-csgo-fair-overlay__close { margin-top: 14px; }

@media (max-width: 600px) {
    .august-csgo-fair { padding: 14px; }
    .august-csgo-fair-reel { height: 136px; }
    .august-csgo-fair-overlay__prize { font-size: 1.05rem; }
}

/* ── Footer link "Check seed" trong widget ── */
.august-csgo-fair__foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--acf-border);
    font-size: .82rem; color: var(--acf-dim);
}
.august-csgo-fair__foot strong { color: var(--acf-text); }
.august-csgo-fair__foot a { color: var(--acf-gold); text-decoration: none; font-weight: 600; }
.august-csgo-fair__foot a:hover { text-decoration: underline; }

/* ── Trang kiểm tra [august_csgo_fair_verify] ── */
.august-csgo-fair-verify { max-width: 900px; margin-left: auto; margin-right: auto; }
.august-csgo-fair-verify__load,
.august-csgo-fair-verify__mine { margin-bottom: 16px; }
.august-csgo-fair-verify__row { display: flex; gap: 10px; flex-wrap: wrap; }
.august-csgo-fair-verify__row .august-csgo-fair-verify__input { flex: 1 1 160px; max-width: 240px; }
.august-csgo-fair .august-csgo-fair-verify__input {
    display: block; width: 100%; margin: 0 0 12px; padding: 10px 14px;
    background: #0a0a0f; color: #ffd700; border: 1px solid var(--acf-border); border-radius: 8px;
    font: .88rem/1.4 'JetBrains Mono', 'Fira Code', Consolas, monospace; box-shadow: none;
}
.august-csgo-fair-verify__row .august-csgo-fair-verify__input { margin-bottom: 0; }
.august-csgo-fair .august-csgo-fair-verify__input:focus { outline: none; border-color: var(--acf-gold); }
.august-csgo-fair textarea.august-csgo-fair-verify__input { resize: vertical; min-height: 110px; }
.august-csgo-fair-verify__hint { margin: -6px 0 0; font-size: .75rem; color: var(--acf-dim); }
.august-csgo-fair-verify__status { margin-top: 10px; font-size: .85rem; line-height: 1.5; color: var(--acf-dim); }
.august-csgo-fair-verify__status.is-ok   { color: var(--acf-green); }
.august-csgo-fair-verify__status.is-bad  { color: var(--acf-red); }
.august-csgo-fair-verify__status.is-warn { color: #ff9100; }
.august-csgo-fair-verify__manual { margin: 4px 0 6px; }
.august-csgo-fair-verify__manual[open] summary { margin-bottom: 12px; }
.august-csgo-fair-verify .august-csgo-fair__verdict + .august-csgo-fair__verdict { margin-top: -6px; }

/* ── Hộp seed trước khi mở hòm ── */
.august-csgo-fair-seedbox { margin: 16px 0; padding: 14px 16px; }
.august-csgo-fair-seedbox__row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.august-csgo-fair-seedbox__main { min-width: 0; flex: 1; }
.august-csgo-fair-seedbox__hash { display: block; font-size: .74rem !important; }
.august-csgo-fair-seedbox__client .august-csgo-fair-verify__input { max-width: 260px; }
.august-csgo-fair-seedbox__nonce { color: var(--acf-gold); }
.august-csgo-fair-rollverify { margin-bottom: 28px; }

/* Link "Check seed" dùng trong bảng lịch sử của plugin khác */
.august-csgo-fair-check {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none;
    color: #ffd700; background: rgba(255, 215, 0, .08); border: 1px solid rgba(255, 215, 0, .3);
}
.august-csgo-fair-check:hover { background: rgba(255, 215, 0, .18); color: #ffd700; }
.august-csgo-fair-check--none {
    color: #8892b0; background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .08); cursor: help;
}

/* ── Dạng thu gọn (mặc định): chỉ 1 dòng, bấm mũi tên để xổ xuống ── */
.august-csgo-fair.august-csgo-fair--compact { padding: 0; margin: 14px 0; overflow: hidden; }
.august-csgo-fair--compact > .august-csgo-fair__summary {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer; list-style: none; user-select: none;
    font-size: .88rem; color: var(--acf-text);
}
.august-csgo-fair--compact > .august-csgo-fair__summary::-webkit-details-marker { display: none; }
.august-csgo-fair--compact > .august-csgo-fair__summary::marker { content: ''; }
.august-csgo-fair__summary-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.august-csgo-fair__summary-sub { margin-left: 6px; color: var(--acf-dim); font-size: .8rem; }
.august-csgo-fair__summary-link {
    flex: 0 0 auto; color: var(--acf-gold); font-weight: 600; font-size: .82rem; text-decoration: none;
    padding: 3px 10px; border: 1px solid rgba(255, 215, 0, .3); border-radius: 999px; background: rgba(255, 215, 0, .06);
}
.august-csgo-fair__summary-link:hover { background: rgba(255, 215, 0, .16); color: var(--acf-gold); }
.august-csgo-fair__chevron {
    flex: 0 0 auto; width: 9px; height: 9px; margin-left: 2px;
    border-right: 2px solid var(--acf-dim); border-bottom: 2px solid var(--acf-dim);
    transform: rotate(45deg); transition: transform .2s ease; position: relative; top: -2px;
}
.august-csgo-fair--compact[open] .august-csgo-fair__chevron { transform: rotate(-135deg); top: 2px; }
.august-csgo-fair--compact > .august-csgo-fair__body { padding: 4px 16px 16px; border-top: 1px solid var(--acf-border); }
.august-csgo-fair--compact > .august-csgo-fair__body > .august-csgo-fair__label:first-child { margin-top: 12px; }
.august-csgo-fair--compact .august-csgo-fair-seedbox__client { margin-top: 12px; }
.august-csgo-fair-seedbox.august-csgo-fair--compact { margin: 12px 0; }
@media (max-width: 480px) {
    .august-csgo-fair__summary-sub { display: none; }
}

/* Ghi chú (vd: Admin trực tiếp quay thông qua tính năng công bằng) — link tới trang kiểm tra */
.august-csgo-fair__summary-link.august-csgo-fair__note { padding: 0; border: 0; background: none; border-radius: 0; flex: 0 1 auto; color: var(--acf-dim); font-weight: 500; font-size: .8rem; text-decoration: underline dotted; text-underline-offset: 3px; }
.august-csgo-fair__summary-link.august-csgo-fair__note:hover { background: none; color: var(--acf-gold); }
@media (max-width: 480px) { .august-csgo-fair__summary-sub.august-csgo-fair__note { display: inline; } }
