/* ── Tokens ── */
:root {
    --gold: #d4af37;
    --gold-light: #f0c84a;
    --gold-dim: rgba(212,175,55,0.2);
    --bg: #0d0b08;
    --bg-card: #1a1408;
    --bg-card2: #1e1608;
    --text: #e8d5a3;
    --dim: #a09070;
    --border: rgba(212,175,55,0.2);
    --red: #ff4d4d;
    --green: #4ecdc4;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Crimson Pro', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Header ── */
.site-header {
    height: 50px;
    background: linear-gradient(90deg, #0d0b08, #1a1005, #0d0b08);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.hinner {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hlogo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
}
.hlogo img { width: 30px; height: 30px; object-fit: contain; }
.hlogo em { font-style: normal; color: var(--dim); font-weight: 400; }
nav { display: flex; align-items: center; gap: 14px; }
nav a { color: var(--dim); text-decoration: none; font-size: 0.82rem; transition: color .2s; }
nav a:hover { color: var(--gold); }
.vip-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(212,175,55,0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
}

/* ── VIP Gate ── */
.vip-gate {
    min-height: calc(100vh - 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #1a1005, #0d0b08);
}
.gate-card {
    text-align: center;
    padding: 48px 40px;
    background: linear-gradient(160deg, #1e1608, #17110a);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 380px;
    width: 90%;
}
.gate-icon { font-size: 3rem; margin-bottom: 14px; }
.gate-card h2 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 1.3rem; margin-bottom: 10px; }
.gate-card p { color: var(--dim); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.6; }
.btn-gold {
    display: block;
    padding: 12px 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #b8860b, #d4af37);
    color: #1a1005;
    border-radius: 10px;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 700;
}
.btn-outline {
    display: block;
    padding: 10px 28px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--dim);
    text-decoration: none;
    font-size: 0.82rem;
    transition: border-color .2s, color .2s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ── App ── */
.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}
.page-title .highlight { color: var(--gold); }

.page-sub {
    color: var(--dim);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.user-bar {
    display: inline-block;
    background: rgba(212,175,55,0.08);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 0.85rem;
    color: var(--dim);
}
.user-bar strong { color: var(--gold); }

/* ── Grid ── */
.pdfs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ── Card ── */
.pdf-card {
    background: #120e07;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
}
.pdf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.3);
    border-color: rgba(212,175,55,0.5);
}

/* Image area — portrait aspect ratio so full characters show */
.card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: radial-gradient(ellipse at 50% 20%, #2a1d0a, #0e0906);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 64px;
    padding-top: 8px;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
}

/* Gradient that fades the bottom of the image into the card body */
.card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(12, 9, 5, 0.55) 75%,
        #120e07 100%
    );
    pointer-events: none;
}

/* Edition badge — top-right corner of the image */
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(0,0,0,0.65);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.06em;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--dim);
    margin-bottom: 14px;
    line-height: 1.5;
    flex: 1;
}

.download-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #b8860b, #d4af37, #f0c84a);
    border: none;
    border-radius: 8px;
    color: #1a1005;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 2px 10px rgba(212,175,55,0.2);
}
.download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(212,175,55,0.4);
}
.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Messages ── */
.msg {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}
.msg-error { background: rgba(220,53,69,0.12); border: 1px solid #dc3545; color: #ff6b6b; }
.msg-success { background: rgba(78,205,196,0.1); border: 1px solid #4ecdc4; color: #4ecdc4; }

/* ── Notification toast ── */
.notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1e1608;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    white-space: nowrap;
}
.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ── Copyright Modal ── */
.cr-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cr-modal {
    background: linear-gradient(160deg, #1a1005, #130e06);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 18px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.1);
    overflow: hidden;
    position: relative;
}

/* Top gold line */
.cr-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.cr-shield {
    text-align: center;
    font-size: 2.8rem;
    padding: 28px 24px 0;
}

.cr-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
    text-align: center;
    margin: 10px 24px 4px;
    letter-spacing: 0.04em;
}

.cr-subtitle {
    text-align: center;
    color: var(--dim);
    font-size: 0.82rem;
    margin-bottom: 20px;
    font-style: italic;
}

.cr-body {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
}
.cr-body::-webkit-scrollbar { width: 4px; }
.cr-body::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

.cr-law-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,175,55,0.15);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
}
.cr-law-block--penal {
    border-left-color: #e05050;
    border-color: rgba(224,80,80,0.2);
    background: rgba(224,80,80,0.05);
}

.cr-law-label {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.06em;
    margin-bottom: 7px;
}
.cr-law-block--penal .cr-law-label { color: #e07070; }

.cr-law-text {
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.65;
}
.cr-law-text strong { color: #ffcc55; }
.cr-law-block--penal .cr-law-text strong { color: #ff8080; }

.cr-warning {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.83rem;
    color: #fcd34d;
    line-height: 1.6;
}
.cr-warning-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.cr-warning strong { color: #fff; }

.cr-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.55;
    padding: 4px 0;
}
.cr-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--gold);
    cursor: pointer;
}

.cr-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 24px;
    justify-content: flex-end;
    border-top: 1px solid rgba(212,175,55,0.1);
}

.cr-btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 8px;
    color: var(--dim);
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.cr-btn-cancel:hover { border-color: var(--gold); color: var(--gold); }

.cr-btn-confirm {
    padding: 10px 22px;
    background: linear-gradient(135deg, #b8860b, #d4af37, #f0c84a);
    border: none;
    border-radius: 8px;
    color: #1a1005;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, opacity .2s;
    box-shadow: 0 2px 10px rgba(212,175,55,0.25);
}
.cr-btn-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(212,175,55,0.4);
}
.cr-btn-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .page-title { font-size: 1.4rem; }
    .pdfs-grid { grid-template-columns: 1fr; }
    .app { padding: 20px 14px 40px; }
}
