@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&display=swap');

:root {
    --surface-primary: rgba(15, 23, 42, 0.76);
    --surface-strong: rgba(15, 23, 42, 0.92);
    --overlay-gradient: linear-gradient(220deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 64, 175, 0.15) 55%, rgba(59, 130, 246, 0.12) 100%);
    --accent: #60a5fa;
    --accent-strong: #a855f7;
    --text-primary: #f8fafc;
    --text-muted: rgba(226, 232, 240, 0.78);
    --border: rgba(148, 163, 184, 0.38);
    --overlay-radius: 28px;
    --avatar-size: clamp(80px, 14vw, 180px);
    --space: clamp(1.2rem, 3vw, 3rem);
    --gap: clamp(0.9rem, 2vw, 1.6rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.hide {
    display: none !important;
}

.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}

.shoutout-overlay {
    position: relative;
    width: min(94vw, 1280px);
    aspect-ratio: 16 / 9;
    --profile-offset: 0px;
    --accent: #60a5fa;
    --accent-strong: #a855f7;
    --accent-soft: rgba(96, 165, 250, 0.25);
    --badge-shadow: rgba(96, 165, 250, 0.38);
    border-radius: var(--overlay-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    box-shadow: 0 32px 90px rgba(2, 8, 23, 0.62);
    isolation: isolate;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease, opacity 0.4s ease;
}

.shoutout-overlay::before,
.shoutout-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shoutout-overlay::before {
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: scale(1.02);
}

.shoutout-overlay::after {
    background: var(--overlay-gradient);
    z-index: 1;
    opacity: 0.9;
    pointer-events: none;
}

.shoutout-overlay.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.shoutout-overlay:not(.is-active) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.shoutout-overlay:not(.is-active)::after,
.shoutout-overlay:not(.is-active)::before {
    opacity: 0;
}

.shoutout-overlay > :not(video) {
    position: relative;
    z-index: 2;
}

.shoutout-overlay[data-background="mesh"]::before {
    opacity: 0.85;
    background: radial-gradient(circle at 16% 24%, color-mix(in srgb, var(--accent) 60%, transparent) 0%, transparent 58%),
        radial-gradient(circle at 78% 32%, color-mix(in srgb, var(--accent-strong) 48%, transparent) 0%, transparent 55%),
        radial-gradient(circle at 54% 82%, rgba(15, 23, 42, 0.6) 0%, transparent 70%);
    transform: scale(1.03);
}

.shoutout-overlay[data-background="galaxy"]::before {
    opacity: 0.95;
    background: radial-gradient(circle at 22% 22%, color-mix(in srgb, var(--accent-strong) 35%, rgba(248, 250, 252, 0.25)) 0%, transparent 62%),
        radial-gradient(circle at 70% 78%, color-mix(in srgb, var(--accent) 30%, rgba(248, 250, 252, 0.18)) 0%, transparent 65%),
        linear-gradient(130deg, rgba(2, 6, 23, 0.18), rgba(15, 23, 42, 0.65));
    mix-blend-mode: screen;
    animation: galaxyDrift 18s ease-in-out infinite alternate;
}

.shoutout-overlay[data-background="spotlight"]::before {
    opacity: 0.8;
    background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--accent) 32%, rgba(248, 250, 252, 0.2)) 0%, transparent 60%),
        linear-gradient(160deg, rgba(2, 6, 23, 0.22), rgba(15, 23, 42, 0.65));
}

.shoutout-overlay[data-background="none"]::before {
    opacity: 0;
}

.shoutout-overlay video,
.shoutout-overlay .video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    z-index: -2;
    filter: saturate(1.08) contrast(1.05);
    background-color: rgba(2, 6, 23, 0.92);
}

.shoutout-overlay.has-profile {
    --profile-offset: calc(var(--avatar-size) + var(--gap));
}

.shoutout-overlay[data-frame="glass"] {
    background: rgba(9, 14, 28, 0.52);
    border-color: color-mix(in srgb, var(--accent) 32%, rgba(148, 163, 184, 0.45));
    box-shadow: 0 42px 95px rgba(2, 8, 23, 0.65);
    backdrop-filter: blur(24px);
}

.shoutout-overlay[data-frame="outline"] {
    background: rgba(2, 6, 23, 0.35);
    border-width: 2px;
    border-color: color-mix(in srgb, var(--accent) 70%, rgba(248, 250, 252, 0.3));
    box-shadow: 0 30px 85px rgba(2, 8, 23, 0.7), inset 0 0 0 1px rgba(248, 250, 252, 0.08);
}

.shoutout-overlay[data-frame="minimal"] {
    background: rgba(2, 8, 23, 0.28);
    border-width: 1px;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 24px 60px rgba(2, 8, 23, 0.55);
}

#text-container {
    position: absolute;
    bottom: calc(var(--space) + 0.4rem);
    left: calc(var(--space) + var(--profile-offset));
    right: var(--space);
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 1.1vw, 0.85rem);
    pointer-events: none;
}

.title-text {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(0.85rem, 1.8vw, 1.35rem) clamp(1.2rem, 2.8vw, 2.25rem);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.85), rgba(168, 85, 247, 0.92));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 82%, rgba(255, 255, 255, 0.18)),
            color-mix(in srgb, var(--accent-strong) 88%, rgba(15, 23, 42, 0.12)));
    color: #0b1220;
    font-weight: 700;
    font-size: clamp(1.35rem, 3vw, 2.6rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.35);
    box-shadow: 0 18px 38px color-mix(in srgb, var(--accent) 30%, rgba(2, 6, 23, 0.65));
    pointer-events: auto;
    transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, letter-spacing 0.4s ease;
}

.shoutout-overlay[data-text-style="capsule"] .title-text {
    letter-spacing: 0.2em;
}

.shoutout-overlay[data-text-style="soft"] .title-text {
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.82), rgba(168, 85, 247, 0.82));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 65%, rgba(255, 255, 255, 0.22)),
            color-mix(in srgb, var(--accent-strong) 72%, rgba(15, 23, 42, 0.18)));
}

.shoutout-overlay[data-text-style="loud"] .title-text {
    font-size: clamp(1.6rem, 3.6vw, 3rem);
    letter-spacing: 0.06em;
    border-radius: 14px;
    text-transform: uppercase;
    text-shadow: 0 14px 28px rgba(2, 8, 23, 0.6);
}

.shoutout-overlay[data-text-style="soft"] #details-container {
    background: rgba(15, 23, 42, 0.72);
    border-color: color-mix(in srgb, var(--accent) 22%, rgba(148, 163, 184, 0.3));
}

.shoutout-overlay[data-text-style="loud"] #details-container .details-text.item-0 {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#profile {
    position: absolute;
    bottom: calc(var(--space) - 0.2rem);
    left: var(--space);
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(96, 165, 250, 0.85);
    border: 4px solid color-mix(in srgb, var(--accent) 80%, rgba(248, 250, 252, 0.35));
    box-shadow: 0 22px 44px rgba(2, 8, 23, 0.55);
    box-shadow: 0 22px 44px color-mix(in srgb, var(--accent) 22%, rgba(2, 8, 23, 0.65));
    background: var(--surface-primary);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, clip-path 0.4s ease, border-radius 0.4s ease;
}

.shoutout-overlay[data-avatar-shape="rounded"] #profile {
    border-radius: 28%;
}

.shoutout-overlay[data-avatar-shape="hex"] #profile {
    border-radius: 0;
    clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);
    border-width: 5px;
}

#details-container {
    position: absolute;
    top: var(--space);
    left: var(--space);
    max-width: min(70%, 420px);
    padding: clamp(0.85rem, 2vw, 1.35rem) clamp(1.15rem, 2.4vw, 1.85rem);
    border-radius: 22px;
    background: var(--surface-primary);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, rgba(148, 163, 184, 0.35));
    box-shadow: 0 20px 45px rgba(2, 8, 23, 0.55);
    box-shadow: 0 20px 45px color-mix(in srgb, var(--accent) 18%, rgba(2, 8, 23, 0.55));
    display: flex;
    flex-direction: column;
    gap: clamp(0.25rem, 0.9vw, 0.55rem);
    animation: detail-dismiss 18s forwards;
    backdrop-filter: blur(14px);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

#details-container .details-text {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 6px rgba(7, 12, 30, 0.6);
}

#details-container .details-text.item-0 {
    font-size: clamp(1.3rem, 2.6vw, 2rem);
}

#details-container .details-text.item-1 {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 500;
    color: var(--text-muted);
}

#details-container .details-text.item-2 {
    font-size: clamp(0.95rem, 1.8vw, 1.35rem);
    font-weight: 500;
}

#details-container .details-text.item-3 {
    font-size: clamp(0.85rem, 1.6vw, 1.15rem);
    font-weight: 500;
    color: var(--text-muted);
}

.countdown {
    position: absolute;
    top: var(--space);
    right: var(--space);
    background: var(--surface-strong);
    border-radius: 20px;
    padding: clamp(0.7rem, 1.6vw, 1rem) clamp(1rem, 2.2vw, 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    color: var(--text-primary);
    text-shadow: 0 2px 6px rgba(2, 8, 23, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(148, 163, 184, 0.28));
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 38px rgba(2, 8, 23, 0.52);
    box-shadow: 0 18px 38px color-mix(in srgb, var(--accent) 18%, rgba(2, 8, 23, 0.52));
    min-width: clamp(72px, 12vw, 120px);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.overlay-badge {
    position: absolute;
    top: calc(var(--space) * 0.6);
    left: 50%;
    transform: translate(-50%, -50%);
    padding: clamp(0.45rem, 1.4vw, 0.65rem) clamp(1.2rem, 2.8vw, 2rem);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.9), rgba(168, 85, 247, 0.95));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 82%, rgba(255, 255, 255, 0.2)),
            color-mix(in srgb, var(--accent-strong) 88%, rgba(15, 23, 42, 0.15)));
    color: #0b1220;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    box-shadow: 0 22px 44px var(--badge-shadow);
    z-index: 3;
    pointer-events: none;
    transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.overlay-badge[data-style="outline"] {
    background: rgba(10, 15, 32, 0.82);
    color: #f8fafc;
    border: 1px solid color-mix(in srgb, var(--accent) 60%, rgba(248, 250, 252, 0.35));
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.6);
}

.overlay-badge[data-style="minimal"] {
    background: rgba(8, 13, 28, 0.65);
    color: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(248, 250, 252, 0.35);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

.shoutout-overlay.has-badge #details-container {
    top: calc(var(--space) + 2.1rem);
}

.shoutout-overlay.has-badge .countdown {
    top: calc(var(--space) + 2.1rem);
}

.countdown-label {
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    opacity: 0.85;
}

.countdown-value {
    font-size: clamp(1.35rem, 2.8vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.fade {
    opacity: 0;
    animation: fade-in 0.6s ease forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes detail-dismiss {
    0%,
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes galaxyDrift {
    0% {
        transform: scale(1.02) translate3d(-1%, -1%, 0);
    }
    50% {
        transform: scale(1.05) translate3d(1%, 2%, 0);
    }
    100% {
        transform: scale(1.03) translate3d(-1%, 1%, 0);
    }
}

@media (max-width: 900px) {
    .shoutout-overlay {
        width: 100vw;
        border-radius: 0;
    }

    #details-container {
        max-width: 88%;
    }

    .title-text {
        font-size: clamp(1.2rem, 4vw, 2.1rem);
    }
}

@media (max-width: 640px) {
    :root {
        --avatar-size: clamp(64px, 22vw, 120px);
        --space: clamp(0.8rem, 4vw, 1.4rem);
    }

    .countdown {
        min-width: unset;
    }
}