/* ─── RPG Heroes privacy layer ─────────────────────────────────────────────
   The consent surface is deliberately self-contained so it can be shipped on
   every page without depending on page-specific Tailwind utilities. */
.cookie-consent {
    --consent-gold: #f0d18b;
    --consent-gold-soft: #d6ad62;
    --consent-ink: #070a11;
    --consent-panel: rgba(13, 17, 26, .97);
    --consent-line: rgba(214, 173, 98, .25);
    position: fixed;
    z-index: 250;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 1rem;
    color: #e7eaf0;
    pointer-events: none;
}

.cookie-consent[hidden] { display: none; }

.cookie-consent__scrim {
    position: fixed;
    z-index: 0;
    inset: 0;
    background: rgba(1, 3, 8, .68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}

.cookie-consent[data-mode="settings"] .cookie-consent__scrim {
    opacity: 1;
    pointer-events: auto;
}

.cookie-consent__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    max-height: min(92dvh, 820px);
    margin: 0 auto;
    overflow: auto;
    border: 1px solid rgba(214, 173, 98, .34);
    border-radius: 1.4rem;
    background:
        radial-gradient(circle at 7% 0%, rgba(159, 29, 53, .17), transparent 31%),
        linear-gradient(145deg, rgba(22, 28, 42, .98), var(--consent-panel) 54%, rgba(7, 10, 17, .99));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        0 28px 90px rgba(0, 0, 0, .56),
        0 0 38px rgba(214, 173, 98, .09);
    pointer-events: auto;
    scrollbar-width: thin;
}

.cookie-consent__panel::before {
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--consent-gold), transparent);
    content: "";
    opacity: .85;
}

.cookie-consent__panel::after {
    position: absolute;
    top: 1.25rem;
    right: 1.3rem;
    width: 5rem;
    height: 5rem;
    border: 1px solid rgba(214, 173, 98, .14);
    border-radius: 50%;
    content: "";
    opacity: .8;
    pointer-events: none;
    box-shadow: 0 0 0 9px rgba(214, 173, 98, .025), 0 0 0 18px rgba(214, 173, 98, .018);
}

.cookie-consent__intro,
.cookie-consent__settings {
    position: relative;
    padding: 1.55rem;
}

.cookie-consent__intro {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .95fr) minmax(13rem, .72fr);
    align-items: center;
    gap: 1.45rem;
}

.cookie-consent__identity {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    min-width: 0;
}

.cookie-consent__crest {
    display: grid;
    flex: 0 0 3.15rem;
    place-items: center;
    width: 3.15rem;
    height: 3.15rem;
    border: 1px solid rgba(240, 209, 139, .48);
    border-radius: 1rem;
    color: var(--consent-gold);
    background: linear-gradient(145deg, rgba(214, 173, 98, .21), rgba(159, 29, 53, .13));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 22px rgba(214, 173, 98, .12);
}

.cookie-consent__crest svg { width: 1.8rem; height: 1.8rem; }

.cookie-consent__crest svg { animation: cookie-consent-sigil 5s ease-in-out infinite; }

@keyframes cookie-consent-sigil {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-1px) rotate(1.5deg); }
}

.cookie-consent__eyebrow,
.cookie-consent__option-kicker {
    margin: 0;
    color: rgba(240, 209, 139, .82);
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .2em;
    line-height: 1.4;
    text-transform: uppercase;
}

.cookie-consent__title {
    margin: .35rem 0 .45rem;
    color: #fff;
    font-family: "Cinzel", "Cinzel Fallback", Georgia, serif;
    font-size: clamp(1.13rem, 1.8vw, 1.45rem);
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.2;
}

.cookie-consent__copy {
    max-width: 36rem;
    margin: 0;
    color: #aab4c4;
    font-size: .78rem;
    line-height: 1.65;
}

.cookie-consent__copy a,
.cookie-consent__legal a {
    color: var(--consent-gold);
    text-decoration: underline;
    text-decoration-color: rgba(240, 209, 139, .4);
    text-underline-offset: .17em;
}

.cookie-consent__copy a:hover,
.cookie-consent__legal a:hover { color: #fff1c7; }

.cookie-consent__signals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.cookie-consent__signal {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-width: 0;
    padding: .78rem .72rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: .85rem;
    background: rgba(255, 255, 255, .035);
}

.cookie-consent__signal-icon {
    display: grid;
    flex: 0 0 1.8rem;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid rgba(214, 173, 98, .31);
    border-radius: .58rem;
    color: var(--consent-gold);
    background: rgba(214, 173, 98, .09);
}

.cookie-consent__signal-icon svg { width: 1rem; height: 1rem; }

.cookie-consent__signal strong {
    display: block;
    color: #edf1f7;
    font-size: .72rem;
    line-height: 1.35;
}

.cookie-consent__signal span {
    display: block;
    margin-top: .15rem;
    color: #8490a2;
    font-size: .63rem;
    line-height: 1.35;
}

.cookie-consent__actions {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.cookie-consent__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    min-height: 2.55rem;
    padding: .68rem .9rem;
    border: 1px solid transparent;
    border-radius: .72rem;
    color: #d9dfeb;
    background: rgba(255, 255, 255, .045);
    cursor: pointer;
    font: inherit;
    font-size: .71rem;
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.2;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.cookie-consent__button:hover { transform: translateY(-1px); }

.cookie-consent__button:focus-visible,
.cookie-consent__reopen:focus-visible,
.cookie-consent__back:focus-visible,
.cookie-consent__toggle input:focus-visible + .cookie-consent__switch {
    outline: 2px solid var(--consent-gold);
    outline-offset: 3px;
}

.cookie-consent__button svg { width: 1rem; height: 1rem; flex: 0 0 auto; }

.cookie-consent__button--primary {
    color: #17120a;
    border-color: rgba(240, 209, 139, .72);
    background: linear-gradient(135deg, #f0d18b, #c69549);
    box-shadow: 0 0 18px rgba(214, 173, 98, .13), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.cookie-consent__button--primary:hover {
    color: #0b0a07;
    background: linear-gradient(135deg, #ffe6a8, #d6ad62);
    box-shadow: 0 0 25px rgba(214, 173, 98, .26), inset 0 1px 0 rgba(255, 255, 255, .52);
}

.cookie-consent__button--secondary:hover {
    color: #fff;
    border-color: rgba(214, 173, 98, .35);
    background: rgba(214, 173, 98, .1);
}

.cookie-consent__button--quiet {
    color: #9aa6b8;
    border-color: rgba(148, 163, 184, .14);
    background: transparent;
}

.cookie-consent__button--quiet:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }

.cookie-consent__legal {
    grid-column: 1 / -1;
    margin: -.1rem 0 -.1rem;
    color: #788497;
    font-size: .64rem;
    line-height: 1.5;
}

.cookie-consent__settings {
    width: min(100%, 700px);
    margin: 0 auto;
}

.cookie-consent[data-mode="settings"] {
    top: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.cookie-consent[data-mode="settings"] .cookie-consent__panel { width: min(100%, 700px); }

.cookie-consent__settings-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cookie-consent__back {
    display: grid;
    flex: 0 0 2.25rem;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: .7rem;
    color: #aab4c4;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
}

.cookie-consent__back:hover { color: #fff; border-color: rgba(214, 173, 98, .42); }
.cookie-consent__back svg { width: 1rem; height: 1rem; }

.cookie-consent__settings-title {
    margin: .2rem 0 .35rem;
    color: #fff;
    font-family: "Cinzel", "Cinzel Fallback", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 800;
}

.cookie-consent__settings-copy {
    margin: 0;
    color: #8f9bad;
    font-size: .74rem;
    line-height: 1.6;
}

.cookie-consent__options {
    display: grid;
    gap: .7rem;
    margin: 1.15rem 0;
}

.cookie-consent__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .95rem 1rem;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .035);
}

.cookie-consent__option:hover { border-color: rgba(214, 173, 98, .3); }

.cookie-consent__option-body { min-width: 0; }

.cookie-consent__option-title {
    margin: .22rem 0 .2rem;
    color: #edf1f7;
    font-size: .82rem;
    font-weight: 800;
}

.cookie-consent__option-copy {
    margin: 0;
    color: #8692a5;
    font-size: .68rem;
    line-height: 1.5;
}

.cookie-consent__toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .55rem;
    color: #8c98aa;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 800;
    white-space: nowrap;
}

.cookie-consent__toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cookie-consent__switch {
    position: relative;
    display: inline-block;
    width: 2.65rem;
    height: 1.45rem;
    border: 1px solid rgba(148, 163, 184, .27);
    border-radius: 999px;
    background: rgba(5, 8, 14, .8);
    transition: background-color 180ms ease, border-color 180ms ease;
}

.cookie-consent__switch::after {
    position: absolute;
    top: .2rem;
    left: .2rem;
    width: .9rem;
    height: .9rem;
    border-radius: 50%;
    background: #7f8b9d;
    content: "";
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.cookie-consent__toggle input:checked + .cookie-consent__switch {
    border-color: rgba(214, 173, 98, .66);
    background: rgba(214, 173, 98, .2);
}

.cookie-consent__toggle input:checked + .cookie-consent__switch::after {
    background: var(--consent-gold);
    box-shadow: 0 0 12px rgba(240, 209, 139, .55);
    transform: translateX(1.18rem);
}

.cookie-consent__toggle input:disabled + .cookie-consent__switch {
    border-color: rgba(63, 196, 154, .42);
    background: rgba(63, 196, 154, .11);
}

.cookie-consent__toggle input:disabled + .cookie-consent__switch::after {
    background: #74e2bc;
    box-shadow: 0 0 12px rgba(63, 196, 154, .4);
    transform: translateX(1.18rem);
}

.cookie-consent__toggle input:disabled ~ .cookie-consent__toggle-label { color: #74e2bc; }

.cookie-consent__settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    padding-top: .35rem;
}

.cookie-consent__reopen {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border: 1px solid rgba(214, 173, 98, .42);
    border-radius: .8rem;
    color: var(--consent-gold);
    background: rgba(10, 14, 23, .9);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.cookie-consent__reopen:hover { border-color: var(--consent-gold); box-shadow: 0 0 22px rgba(214, 173, 98, .18); transform: translateY(-2px); }
.cookie-consent__reopen svg { width: 1.15rem; height: 1.15rem; }

body.cookie-consent-open { overflow: hidden; }

@media (max-width: 920px) {
    .cookie-consent__intro { grid-template-columns: minmax(0, 1fr) minmax(15rem, .8fr); }
    .cookie-consent__actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .cookie-consent { padding: .6rem; }
    .cookie-consent__intro,
    .cookie-consent__settings { padding: 1.15rem; }
    .cookie-consent__intro { display: block; }
    .cookie-consent__signals { margin-top: 1rem; }
    .cookie-consent__actions { display: flex; margin-top: 1rem; }
    .cookie-consent__legal { margin-top: .85rem; }
    .cookie-consent__panel { border-radius: 1.1rem; max-height: calc(100dvh - 1.2rem); }
    .cookie-consent__option { align-items: flex-start; }
    .cookie-consent__toggle { padding-top: .2rem; }
    .cookie-consent__settings-actions { flex-direction: column-reverse; }
    .cookie-consent__settings-actions .cookie-consent__button { width: 100%; }
    .cookie-consent__reopen { right: .7rem; bottom: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent__crest svg,
    .cookie-consent__scrim,
    .cookie-consent__button,
    .cookie-consent__reopen,
    .cookie-consent__switch,
    .cookie-consent__switch::after { transition: none; }
    .cookie-consent__button:hover,
    .cookie-consent__reopen:hover { transform: none; }
}
