/* ═══════════════════════════════════════════════════════════
   GameVault UX — Toasts, forms, loading states
   ═══════════════════════════════════════════════════════════ */

.gv-toast-stack {
    position: fixed;
    top: 5.5rem;
    inset-inline-end: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}
@media (min-width: 640px) {
    .gv-toast-stack { top: 6.25rem; }
}

.gv-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(16px);
    animation: gvToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.gv-toast.is-leaving {
    animation: gvToastOut 0.25s ease forwards;
}
@keyframes gvToastIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gvToastOut {
    to { opacity: 0; transform: translateY(-6px); }
}
.gv-toast--success {
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.gv-toast--error {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.gv-toast--info {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.dark .gv-toast--info {
    background: rgba(22, 22, 42, 0.96);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
}
.gv-toast--warn {
    background: rgba(245, 158, 11, 0.92);
    color: #fff;
}
.gv-toast__icon { flex-shrink: 0; margin-top: 0.1rem; }
.gv-toast__body { flex: 1; min-width: 0; }
.gv-toast__title { font-weight: 700; margin-bottom: 0.15rem; }
.gv-toast__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.gv-toast__btn {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    cursor: pointer;
}
.gv-toast__btn:hover { background: rgba(255, 255, 255, 0.28); }
.gv-toast__close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
}
.gv-toast__close:hover { opacity: 1; }

.gv-field__error {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.gv-input.is-invalid,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.gv-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(139,92,246,0.06) 0%, rgba(139,92,246,0.14) 50%, rgba(139,92,246,0.06) 100%);
    background-size: 200% 100%;
    animation: gvSkeleton 1.2s ease-in-out infinite;
    border-radius: 0.5rem;
}
.dark .gv-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
}
@keyframes gvSkeleton {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Success celebration ── */
.gv-celebrate {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(8, 8, 15, 0.45);
    backdrop-filter: blur(8px);
    animation: gvCelebrateIn 0.3s ease;
    cursor: pointer;
}
.gv-celebrate.is-leaving { animation: gvCelebrateOut 0.4s ease forwards; }
@keyframes gvCelebrateIn { from { opacity: 0; } }
@keyframes gvCelebrateOut { to { opacity: 0; } }

.gv-celebrate__card {
    position: relative;
    max-width: 22rem;
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: 1.75rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35), 0 0 60px rgba(16, 185, 129, 0.15);
    animation: gvCelebrateCard 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dark .gv-celebrate__card {
    background: rgba(18, 18, 34, 0.97);
    border-color: rgba(16, 185, 129, 0.3);
}
@keyframes gvCelebrateCard {
    from { opacity: 0; transform: scale(0.7) translateY(24px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.gv-celebrate__check {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.25rem;
    display: block;
}
.gv-celebrate__circle {
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 155;
    stroke-dashoffset: 155;
    animation: gvDraw 0.6s 0.15s ease forwards;
}
.gv-celebrate__tick {
    stroke: #10b981;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: gvDraw 0.35s 0.65s ease forwards;
}
@keyframes gvDraw { to { stroke-dashoffset: 0; } }

.gv-celebrate__msg {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
    color: #0f172a;
}
.dark .gv-celebrate__msg { color: #f1f5f9; }

.gv-celebrate__confetti {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    opacity: 0;
    animation: gvConfetti 1.4s var(--cd, 0.2s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}
@keyframes gvConfetti {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.6); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--cx, 60px), 220px) rotate(var(--cr, 180deg)) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .gv-celebrate__confetti { display: none; }
    .gv-celebrate__circle, .gv-celebrate__tick { animation-duration: 0.01ms; stroke-dashoffset: 0; }
}

.gv-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    margin-top: 0.35rem;
}
.gv-retry-btn:hover { background: rgba(239, 68, 68, 0.14); }

.player-verify__status--error { display: flex; flex-direction: column; align-items: flex-start; }

/* Cookie consent banner */
.gv-cookie-consent {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 70;
    padding: 0.85rem 1rem calc(0.85rem + var(--gv-safe-bottom, 0px));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 -12px 40px -16px rgba(31, 18, 66, 0.25);
    transform: translateY(0);
    transition: transform 0.35s ease, opacity 0.35s ease;
}
.dark .gv-cookie-consent {
    background: rgba(12, 12, 24, 0.94);
    border-top-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, 0.55);
}
.gv-cookie-consent.is-leaving {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}
@media (max-width: 1023px) {
    .gv-cookie-consent {
        bottom: calc(var(--gv-bottom-nav-h, 62px) + var(--gv-safe-bottom, 0px));
    }
}
.gv-cookie-consent__inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.gv-cookie-consent__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.12));
    color: #8b5cf6;
    font-size: 1.1rem;
}
.dark .gv-cookie-consent__icon { color: #a78bfa; }
.gv-cookie-consent__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #475569;
}
.dark .gv-cookie-consent__text { color: #cbd5e1; }
.gv-cookie-consent__link {
    color: #7c3aed;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dark .gv-cookie-consent__link { color: #a78bfa; }
.gv-cookie-consent__btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.65rem 1.25rem !important;
    font-size: 0.875rem !important;
}
@media (max-width: 640px) {
    .gv-cookie-consent__inner {
        flex-wrap: wrap;
    }
    .gv-cookie-consent__btn {
        width: 100%;
        justify-content: center;
    }
}
html.gv-cookie-dismissed .gv-cookie-consent { display: none !important; }

/* Legal pages & footer links */
.footer-legal-link,
.legal-page-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #64748b;
    transition: color 0.2s;
}
.footer-legal-link:hover,
.legal-page-link:hover {
    color: #8b5cf6;
}
.dark .footer-legal-link,
.dark .legal-page-link { color: #94a3b8; }
.dark .footer-legal-link:hover,
.dark .legal-page-link:hover { color: #a78bfa; }
.gv-legal-check__input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}
.gv-legal-check__text a { text-decoration: underline; text-underline-offset: 2px; }
