:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --text: #172033;
    --muted: #667085;
    --line: #dfe5ee;
    --blue-dark: #0b1f66;
    --blue: #1967f2;
    --blue-soft: #e9f1ff;
    --blue-ring: rgba(25, 103, 242, 0.18);
    --green: #14804a;
    --green-soft: #eaf8f0;
    --red: #b42318;
    --red-soft: #fff1f0;
    --shadow: 0 20px 50px rgba(23, 43, 77, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 12%, rgba(25, 103, 242, 0.10), transparent 28rem),
        radial-gradient(circle at 88% 92%, rgba(11, 31, 102, 0.09), transparent 26rem),
        var(--bg);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
a,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--blue-ring);
    outline-offset: 3px;
}

.player-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 28px;
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: center;
    gap: 34px;
    padding: 36px 40px;
    border-radius: var(--radius-xl);
    color: #fff;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.hero::before {
    width: 320px;
    height: 320px;
    top: -190px;
    right: 80px;
}

.hero::after {
    width: 220px;
    height: 220px;
    right: -95px;
    bottom: -115px;
}

.hero-copy,
.hero-logo {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.10);
}

.hero h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.hero p {
    max-width: 650px;
    margin: 14px 0 0;
    color: rgba(255,255,255,0.86);
    font-size: 17px;
    line-height: 1.6;
}

.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 34px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}

.hero-logo img {
    display: block;
    width: 100%;
    max-width: 205px;
    aspect-ratio: 1;
    object-fit: contain;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
    gap: 24px;
    margin-top: 24px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(23, 43, 77, 0.07);
}

.player-card {
    padding: 28px;
}

.now-playing {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 22px;
}

.cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 118px;
    height: 118px;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--blue-soft), #fff);
    border: 1px solid #d7e5ff;
}

.cover > img {
    width: 84%;
    height: 84%;
    object-fit: contain;
}

#sonic_art_full {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: inherit;
}

#sonic_art_full:empty {
    display: none;
}

#sonic_art_full img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 9px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 29px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 800;
}

.status-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-chip.is-live {
    color: var(--green);
    background: var(--green-soft);
}

.status-chip.is-error {
    color: var(--red);
    background: var(--red-soft);
}

.status-text {
    color: var(--muted);
    font-size: 13px;
}

.now-playing-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

#sonic_title {
    min-height: 56px;
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--text);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.player-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.play-button {
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(145deg, var(--blue-dark), var(--blue));
    box-shadow: 0 12px 28px rgba(25, 103, 242, 0.28);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(25, 103, 242, 0.34);
}

.play-button:active {
    transform: translateY(0) scale(.97);
}

.play-button:disabled {
    cursor: wait;
    opacity: .64;
}

.play-button svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.volume-area {
    min-width: 0;
}

.volume-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.volume-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-dark);
    background: var(--surface-soft);
    cursor: pointer;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--blue);
    cursor: pointer;
}

.volume-value {
    text-align: right;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 750;
}

.wave {
    height: 34px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    overflow: hidden;
}

.wave span {
    width: 4px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--blue), var(--blue-dark));
    opacity: .26;
    animation: pulse 1s ease-in-out infinite;
    animation-play-state: paused;
}

.wave.is-playing span {
    opacity: .85;
    animation-play-state: running;
}

.wave span:nth-child(2n) { animation-delay: .08s; }
.wave span:nth-child(3n) { animation-delay: .16s; }
.wave span:nth-child(4n) { animation-delay: .24s; }
.wave span:nth-child(5n) { animation-delay: .32s; }

@keyframes pulse {
    0%, 100% { height: 8px; }
    50% { height: 30px; }
}

.side-card {
    padding: 24px;
}

.side-card h2,
.apps-card h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.side-card > p,
.apps-card > p {
    margin: 7px 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.action-link,
.store-link,
.install-button {
    text-decoration: none;
    transition: transform .17s ease, border-color .17s ease, background .17s ease;
}

.action-link {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    background: var(--surface-soft);
}

.action-link:hover,
.store-link:hover,
.install-button:hover {
    transform: translateY(-2px);
    border-color: #b9cff7;
    background: #f5f8ff;
}

.action-link svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-link strong {
    display: block;
    font-size: 13px;
}

.action-link small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.apps-card {
    margin-top: 24px;
    padding: 24px;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.store-link,
.install-button {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    background: var(--surface);
    font-weight: 750;
    cursor: pointer;
}

.install-button {
    width: 100%;
    margin-top: 12px;
}

.store-link svg,
.install-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: var(--blue-dark);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.install-button[hidden] {
    display: none !important;
}

.install-help {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #38445b;
    background: #f3f6fb;
    font-size: 12px;
    line-height: 1.5;
}

.install-help[hidden] {
    display: none;
}

.footer {
    padding: 24px 4px 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.footer a {
    color: var(--blue-dark);
    text-decoration: none;
    font-weight: 700;
}

.footer a:hover {
    text-decoration: underline;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) 180px;
        padding: 30px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .side-card {
        order: 2;
    }
}

@media (max-width: 640px) {
    .player-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 10px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 28px 24px;
        border-radius: 22px;
    }

    .hero-copy {
        text-align: center;
    }

    .eyebrow {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-logo {
        width: 172px;
        margin: 0 auto;
        padding: 12px;
        border-radius: 28px;
    }

    .player-card,
    .side-card,
    .apps-card {
        padding: 20px;
        border-radius: 18px;
    }

    .now-playing {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 15px;
    }

    .cover {
        width: 88px;
        height: 88px;
        border-radius: 18px;
    }

    #sonic_title {
        min-height: 48px;
        font-size: 20px;
    }

    .player-controls {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .volume-area {
        width: 100%;
    }

    .links-grid,
    .store-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 410px) {
    .links-grid,
    .store-grid {
        grid-template-columns: 1fr;
    }

    .action-link {
        min-height: 76px;
    }

    .now-playing {
        grid-template-columns: 1fr;
    }

    .cover {
        width: 96px;
        height: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
