/* === Age Gate Stories v3 — Saying Central Style === */

/* Default hidden — JS adds .ags-visible to show */
.ags-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,1);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ags-overlay.ags-visible {
    display: flex;
    animation: agsFadeIn .25s ease;
}
@keyframes agsFadeIn { from{opacity:0} to{opacity:1} }

.ags-modal {
    background: #fff;
    border-radius: 22px;
    padding: 36px 32px 26px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: agsUp .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes agsUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }

/* Background blob decorations */
.ags-blob-tl, .ags-blob-br {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.ags-blob-tl {
    width: 180px; height: 180px;
    background: radial-gradient(circle, #BFDBFE, transparent);
    top: -60px; left: -60px; opacity: .5;
}
.ags-blob-br {
    width: 200px; height: 200px;
    background: radial-gradient(circle, #DDD6FE, transparent);
    bottom: -60px; right: -60px; opacity: .45;
}

/* Brand / Logo */
.ags-brand {
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.ags-logo { max-height: 52px; max-width: 200px; object-fit: contain; }
.ags-brand-text { display: inline-flex; align-items: center; gap: 8px; }
.ags-brand-icon { font-size: 30px; }
.ags-site-name  { font-size: 21px; font-weight: 800; color: #1E3A8A; }

/* Heading */
.ags-heading {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    margin: 0 0 22px !important;
    letter-spacing: -.2px !important;
    position: relative;
    z-index: 1;
}

/* Cards */
.ags-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.ags-card {
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 18px;
    padding: 24px 12px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    font-family: inherit;
}
.ags-card:hover {
    border-color: var(--card-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,.08);
}
.ags-card:active { transform: translateY(0); }

.ags-star { position: absolute; opacity: .65; line-height: 1; }
.ags-star-1 { top: 12px; left: 12px; font-size: 10px; }
.ags-star-2 { top: 20px; right: 16px; font-size: 8px; }

.ags-avatar-circle {
    width: 110px; height: 110px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    transition: transform .2s;
}
.ags-card:hover .ags-avatar-circle { transform: scale(1.05); }
.ags-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.ags-card-label {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.3px;
    margin-bottom: 5px;
    display: block;
}
.ags-card-underline {
    display: block;
    width: 26px; height: 3px;
    border-radius: 2px;
    margin: 0 auto 14px;
}
.ags-arrow-btn {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    transition: transform .2s, box-shadow .2s;
}
.ags-card:hover .ags-arrow-btn { transform: scale(1.08); }

/* Preference bar */
.ags-pref-bar {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.ags-pref-shield {
    width: 34px; height: 34px;
    background: #E2E8F0;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ags-pref-label {
    font-size: 12px; font-weight: 700; color: #374151;
    white-space: nowrap; flex-shrink: 0;
}
.ags-pref-options { display: flex; gap: 4px; margin-left: auto; }
.ags-pref-opt {
    display: flex; align-items: flex-start; gap: 6px;
    cursor: pointer; padding: 3px 8px; border-radius: 8px;
    transition: background .15s;
}
.ags-pref-opt:hover { background: #F1F5F9; }
.ags-radio {
    width: 17px; height: 17px; border-radius: 50%;
    border: 2px solid #CBD5E1;
    flex-shrink: 0; margin-top: 3px;
    transition: border .2s; display: block;
}
.ags-radio.active { border-width: 5px; border-color: #F97316; }
.ags-pref-icon-svg { flex-shrink: 0; margin-top: 3px; }
.ags-pref-title { font-size: 12px; font-weight: 700; color: #374151; }
.ags-pref-desc  { font-size: 10px; color: #9CA3AF; line-height: 1.4; }

/* Badge */
.ags-badge {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 99999;
    color: #fff; border-radius: 50px;
    padding: 8px 14px 8px 12px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: agsUp .4s ease;
}
#ags-badge-text { font-weight: 600; }
.ags-change-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff; border-radius: 20px;
    padding: 3px 10px; font-size: 11px;
    cursor: pointer; font-family: inherit;
    transition: background .2s;
}
.ags-change-btn:hover { background: rgba(255,255,255,.28); }

/* Restricted notice */
.ags-restricted-notice {
    text-align: center; padding: 50px 30px;
    background: #FFF8F0; border: 2px dashed #FDBA74;
    border-radius: 16px; margin: 30px 0;
}
.ags-restricted-icon { font-size: 60px; margin-bottom: 14px; }
.ags-restricted-notice h3 { font-size: 20px; color: #1E293B; margin: 0 0 10px; }
.ags-restricted-notice p  { color: #64748B; margin: 6px 0; }

.ags-inline-change-btn {
    display: inline-block; background: #2563EB;
    color: #fff !important; border: none; border-radius: 8px;
    padding: 10px 22px; font-size: 14px; cursor: pointer;
    margin: 12px 6px 0; font-family: inherit;
    transition: background .2s; text-decoration: none;
}
.ags-inline-change-btn:hover { background: #1D4ED8; color: #fff !important; }
.ags-home-link { display:inline-block;color:#2563EB;margin-top:12px;font-size:14px; }

@media (max-width: 520px) {
    .ags-modal { padding: 26px 14px 20px; border-radius: 16px; }
    .ags-heading { font-size: 14px !important; }
    .ags-cards { gap: 10px; }
    .ags-avatar-circle { width: 82px; height: 82px; }
    .ags-card-label { font-size: 16px; }
    .ags-pref-bar { gap: 6px; }
    .ags-pref-label { display: none; }
    .ags-pref-options { margin-left: 0; }
    .ags-badge { bottom: 10px; right: 10px; }
}

/* ── Inline Gate Shortcode ─────────────────────────────── */
.ags-inline-gate-wrap {
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 20px;
    padding: 28px 24px 24px;
    text-align: center;
    margin: 24px 0;
    position: relative;
}
.ags-inline-warning {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    margin-bottom: 20px;
}
.ags-inline-warning p {
    margin: 0;
    font-size: 13px;
    color: #92400E;
    line-height: 1.5;
}
.ags-inline-heading {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    margin: 0 0 20px !important;
}
.ags-inline-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 460px;
    margin: 0 auto 16px;
    transition: opacity .3s;
}
.ags-inline-card {
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 16px;
    padding: 20px 12px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    font-family: inherit;
}
.ags-inline-card:hover {
    border-color: var(--card-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.ags-inline-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    transition: transform .2s;
}
.ags-inline-card:hover .ags-inline-avatar { transform: scale(1.06); }
.ags-inline-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.ags-inline-label {
    font-size: 17px;
    font-weight: 800;
    display: block;
    margin-bottom: 5px;
}
.ags-inline-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .ags-inline-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ags-inline-avatar { width: 70px; height: 70px; }
    .ags-inline-label { font-size: 15px; }
}

/* ── Loading state (shown after age selection) ─────────── */
.ags-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.96);
    border-radius: 22px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}
.ags-loading-overlay.ags-loading-visible {
    display: flex;
}
.ags-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E2E8F0;
    border-top-color: var(--ags-spinner-color, #2563EB);
    border-radius: 50%;
    animation: agsSpin .75s linear infinite;
}
@keyframes agsSpin { to { transform: rotate(360deg); } }
.ags-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #64748B;
}

/* ── Menu age-based visibility ─────────────────────────── */
html.ags-age-under14 .ags-menu-above14,
body.ags-age-under14 .ags-menu-above14 { display: none !important; }
html.ags-age-above14 .ags-menu-under14,
body.ags-age-above14 .ags-menu-under14 { display: none !important; }
