@font-face {
    font-family: 'Geist';
    src: url('../fonts/Geist.woff2') format('woff2');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --color-bg: #0a1321;
    --color-surface: #0d1625;
    --color-elevated: #131e30;
    --color-panel: #111c2e;
    --color-border: #283242;
    --color-border-strong: #3a4a62;
    --color-text: #ffffff;
    --color-text-muted: #8b9ab8;
    --color-text-subtle: #5c6e8a;
    --color-accent: #fc5c0b;
    --color-accent-hover: #fd6e24;
    --color-accent-dim: rgb(252 92 11 / 15%);
    --color-brand: #3d8bfc;
    --color-brand-dim: #192841;
    --color-online: #3fbf6a;
    --radius-sm: 6px;
    --radius-md: 7px;
    --radius-lg: 10px;
    --radius-full: 9999px;
}

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

html {
    min-height: 100%;
    color-scheme: dark;
    background: var(--color-bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.fw-locked { overflow: hidden; }

body.fw-locked .fw-bg,
body.fw-locked .fw-bg-credit,
body.fw-locked .fw-page,
body.fw-locked .fw-np { visibility: hidden; }

button { font: inherit; }

button:focus-visible {
    outline: 3px solid rgb(61 139 252 / 55%);
    outline-offset: 2px;
}

.fw-gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    background-color: var(--color-bg);
    opacity: 1;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.fw-gate[hidden] { display: none; }

.fw-gate.is-closing {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.fw-gate-card {
    width: 100%;
    max-width: 400px;
    padding: 28px;
    background-color: #131e30;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgb(0 0 0 / 55%);
    text-align: center;
    transform: translateY(0) scale(1);
    transition: opacity 220ms ease, transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.fw-gate.is-closing .fw-gate-card {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.fw-gate-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgb(0 0 0 / 35%);
}

.fw-gate-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 9px;
    color: var(--color-brand);
    background: var(--color-brand-dim);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fw-gate-title {
    margin: 0 0 6px;
    color: var(--color-text);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fw-gate-copy {
    max-width: 310px;
    margin: 0 auto 22px;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.fw-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 0 16px;
    color: #fff;
    background: var(--color-brand);
    border: 1px solid var(--color-brand);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    transition: background-color 160ms ease, border-color 160ms ease, transform 100ms ease;
}

.fw-gate-btn:hover {
    background: #5a9ffd;
    border-color: #5a9ffd;
}

.fw-gate-btn:active { transform: scale(0.97); }

.fw-gate-btn:disabled {
    cursor: wait;
    opacity: 0.8;
}

.fw-gate-btn i { font-size: 16px; }

.fw-gate-note {
    margin: 13px 0 0;
    color: var(--color-text-subtle);
    font-size: 12px;
}

.fw-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 40px 24px;
}

.fw-inner {
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
    text-align: center;
}

.fw-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--color-bg);
}

.fw-bg-layer {
    position: absolute;
    inset: clamp(10px, 2.25vw, 32px);
    overflow: hidden;
    background-color: var(--color-surface);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: clamp(12px, 1.6vw, 22px);
    box-shadow: 0 18px 60px rgb(0 0 0 / 34%);
    opacity: 0;
    transition: opacity 3s ease;
    filter: brightness(0.62) saturate(0.95);
}

@media (max-width: 600px) {
    .fw-bg-layer {
        inset: 8px;
        border-radius: 14px;
    }
}

.fw-bg-layer.is-active { opacity: 1; }

.fw-bg-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 360px at 50% 8%, rgb(252 92 11 / 8%), transparent 70%),
        radial-gradient(420px 300px at 82% 78%, rgb(61 139 252 / 6%), transparent 70%),
        linear-gradient(180deg, rgb(10 19 33 / 52%), rgb(10 19 33 / 68%) 60%, rgb(10 19 33 / 82%));
}

.fw-bg-credit {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 10px 18px;
    background-color: rgb(13 22 37 / 62%);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    font-size: 14.5px;
    opacity: 0;
    transition: opacity 1.2s ease;
    backdrop-filter: blur(4px);
}

.fw-bg-credit.is-visible { opacity: 1; }

.fw-bg-credit i { font-size: 15px; color: var(--color-accent); }

.fw-bg-credit strong { color: var(--color-text); font-weight: 600; }

.fw-logo {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.fw-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    padding: 5px 12px 5px 9px;
    background-color: var(--color-accent-dim);
    border: 1.5px solid rgb(252 92 11 / 30%);
    border-radius: var(--radius-full);
    color: #f89b62;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fw-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    animation: fw-ping 2.2s ease-out infinite;
}

@keyframes fw-ping {
    0%   { box-shadow: 0 0 0 0 rgb(252 92 11 / 50%); }
    70%  { box-shadow: 0 0 0 8px rgb(252 92 11 / 0%); }
    100% { box-shadow: 0 0 0 0 rgb(252 92 11 / 0%); }
}

.fw-title {
    margin: 0 0 12px;
    color: var(--color-text);
    font-size: clamp(26px, 6vw, 34px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fw-lead {
    margin: 0 0 28px;
    color: var(--color-text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}

.fw-steps {
    display: grid;
    gap: 8px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.fw-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background-color: var(--color-panel);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.fw-steps i {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background-color: var(--color-brand-dim);
    color: var(--color-brand);
    font-size: 13px;
}

.fw-steps div {
    flex: 1;
    min-width: 0;
}

.fw-steps strong {
    display: block;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 600;
}

.fw-steps span {
    display: block;
    margin-top: 2px;
    color: var(--color-text-subtle);
    font-size: 13.5px;
    line-height: 1.5;
}

.fw-foot {
    margin: 0;
    color: var(--color-text-subtle);
    font-size: 13.5px;
}

.fw-np {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 296px;
    padding: 10px 11px;
    background-color: var(--color-elevated);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 34px rgb(0 0 0 / 45%);
    animation: fw-np-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s backwards;
}

.fw-np.is-changing {
    animation: fw-np-swap 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes fw-np-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}

@keyframes fw-np-swap {
    0%   { transform: translateX(0); opacity: 1; }
    35%  { transform: translateX(22px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.fw-np-art {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
}

.fw-np-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fw-np-bars {
    position: absolute;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding-bottom: 8px;
    background: rgb(10 19 33 / 62%);
}

.fw-np.is-playing .fw-np-bars { display: flex; }

.fw-np-bars i {
    width: 3px;
    height: 30%;
    border-radius: 2px;
    background: var(--color-accent);
    animation: fw-eq 0.9s ease-in-out infinite;
}

.fw-np-bars i:nth-child(2) { animation-delay: 0.15s; }
.fw-np-bars i:nth-child(3) { animation-delay: 0.3s; }
.fw-np-bars i:nth-child(4) { animation-delay: 0.45s; }

@keyframes fw-eq {
    0%, 100% { height: 22%; }
    50%      { height: 85%; }
}

.fw-np-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.32;
}

.fw-np-label {
    color: var(--color-accent);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fw-np:not(.is-playing):not(.has-played) .fw-np-label {
    animation: fw-label-pulse 1.6s ease-in-out infinite;
}

@keyframes fw-label-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.fw-np:not(.has-played) { cursor: pointer; }

.fw-np-title,
.fw-np-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fw-np-title {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}

.fw-np-artist {
    color: var(--color-text-subtle);
    font-size: 12.5px;
}

.fw-np-btn {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--color-text-muted);
    background-color: transparent;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 100ms ease;
}

.fw-np-btn:hover {
    color: #fff;
    background-color: var(--color-brand);
    border-color: var(--color-brand);
}

.fw-np-btn:active { transform: scale(0.97); }

@media (max-width: 590px) {
    :root { --fw-mobile-image-height: clamp(210px, 42svh, 380px); }

    .fw-bg-layer {
        top: 8px;
        right: 8px;
        bottom: auto;
        left: 8px;
        height: var(--fw-mobile-image-height);
        background-position: center;
    }

    .fw-page {
        align-items: flex-start;
        padding: calc(var(--fw-mobile-image-height) + 24px) 12px 104px;
    }

    .fw-inner {
        padding: 20px 14px;
        background: rgb(13 22 37 / 94%);
        border: 1px solid rgb(255 255 255 / 9%);
        border-radius: 16px;
        box-shadow: 0 18px 48px rgb(0 0 0 / 30%);
    }

    .fw-gate { padding: 16px; }
    .fw-gate-card { padding: 24px 20px; }

    .fw-logo { width: 44px; height: 44px; margin-bottom: 16px; }
    .fw-lead { font-size: 13.5px; margin-bottom: 24px; }
    .fw-steps { margin-bottom: 24px; }
    .fw-steps li { padding: 12px 13px; gap: 10px; }

    .fw-np {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
    }

    .fw-bg-credit {
        position: absolute;
        top: calc(var(--fw-mobile-image-height) - 42px);
        bottom: auto;
        left: 18px;
        padding: 7px 11px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .fw-gate { transition-duration: 0.01ms !important; }

    .fw-bg-layer { transition-duration: 3s !important; }
    .fw-bg-credit { transition-duration: 1.2s !important; }
}
