:root {
    --widget-width: 720px;
    --widget-height: 210px;
    --background: rgba(0, 38, 65, 0.92);
    --border: rgba(144, 185, 226, 0.86);
    --primary-text: #fff;
    --secondary-text: rgba(237,237,237,0.76);
    --accent: #faa634;
    --rotation-duration: 8s;
}

* { box-sizing: border-box; }

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: transparent;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-widget {
    position: relative;
    width: var(--widget-width);
    height: var(--widget-height);
    overflow: hidden;
    color: var(--primary-text);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.055), transparent 48%),
        linear-gradient(90deg, rgba(0,85,150,0.34), transparent),
        var(--background);
    border: 2px solid var(--border);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    clip-path: inset(0 100% 0 0);
}

body::before,
body::after {
    content: "";
    position: fixed;
    left: calc(50% - (var(--widget-width) / 2));
    top: calc(50% - (var(--widget-height) / 2));
    width: 2px;
    height: var(--widget-height);
    background: var(--border);
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

body::before {
    transform: scaleY(0);
    transform-origin: center;
}

body.widget-revealing::before {
    animation: drawLeftBorder 0.32s cubic-bezier(0.22,1,0.36,1) forwards;
}

body.widget-revealing::after {
    animation: moveRightBorder 0.62s 0.36s cubic-bezier(0.22,1,0.36,1) forwards;
}

.sponsor-widget.reveal-animation {
    visibility: visible;
    animation: revealWidget 0.62s 0.36s cubic-bezier(0.22,1,0.36,1) forwards;
}

.sponsor-widget.ready {
    opacity: 1;
    visibility: visible;
    clip-path: inset(0);
}

body.widget-ready::before,
body.widget-ready::after { opacity: 0; }

.sponsor-content {
    display: grid;
    height: 100%;
    grid-template-columns: 190px 1fr 170px;
    align-items: center;
    padding: 24px 34px 28px;
    opacity: 0;
}

.sponsor-widget.reveal-animation .sponsor-content {
    animation: contentIn 0.34s 0.76s cubic-bezier(0.22,1,0.36,1) forwards;
}

.sponsor-widget.ready .sponsor-content { opacity: 1; }

.sponsor-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1.5;
}

.label-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(250,166,52,0.15);
}

.logo-stage {
    display: grid;
    width: 280px;
    height: 118px;
    place-items: center;
    padding: 8px 18px;
    border-right: 1px solid rgba(255,255,255,0.18);
    border-left: 1px solid rgba(255,255,255,0.18);
}

.sponsor-logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sponsor-name {
    padding-left: 28px;
    color: var(--secondary-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.rotation-track {
    position: absolute;
    right: 34px;
    bottom: 17px;
    left: 34px;
    height: 3px;
    overflow: hidden;
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
}

.rotation-fill {
    width: 0;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.sponsor-widget.ready .rotation-fill.running {
    animation: rotationProgress var(--rotation-duration) linear forwards;
}

.sponsor-widget.hide-animation {
    opacity: 1;
    visibility: visible;
    border-right-color: transparent;
    animation: collapseToRight 0.55s cubic-bezier(0.65,0,0.35,1) forwards;
}

.sponsor-widget.hide-animation .sponsor-content,
.sponsor-widget.hide-animation .rotation-track {
    animation: contentOut 0.22s ease-in forwards;
}

body.widget-hiding::before { opacity: 0; }
body.widget-hiding::after {
    opacity: 1;
    animation: returnBorderToLeft 1.05s cubic-bezier(0.65,0,0.35,1) forwards;
}

body.widget-waiting::after { opacity: 1; transform: translateX(0); }
body.widget-item-revealing::before { opacity: 1; transform: scaleY(1); }
body.widget-item-revealing::after {
    animation: moveRightBorder 0.62s cubic-bezier(0.22,1,0.36,1) forwards;
}

.sponsor-widget.item-reveal-animation {
    visibility: visible;
    animation: revealWidget 0.62s cubic-bezier(0.22,1,0.36,1) forwards;
}

.sponsor-widget.item-reveal-animation .sponsor-content {
    animation: contentIn 0.34s 0.36s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes drawLeftBorder {
    from { opacity: 1; transform: scaleY(0); }
    to { opacity: 1; transform: scaleY(1); }
}

@keyframes moveRightBorder {
    0% { opacity: 1; transform: translateX(0); }
    99% { opacity: 1; transform: translateX(calc(var(--widget-width) - 2px)); }
    100% { opacity: 0; transform: translateX(calc(var(--widget-width) - 2px)); }
}

@keyframes revealWidget {
    from { opacity: 1; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0); }
}

@keyframes contentIn {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes contentOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(12px); }
}

@keyframes collapseToRight {
    from { clip-path: inset(0); }
    to { clip-path: inset(0 0 0 100%); }
}

@keyframes returnBorderToLeft {
    0%, 52% { opacity: 1; transform: translateX(calc(var(--widget-width) - 2px)); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes rotationProgress {
    from { width: 0; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }
}
