@font-face {
    font-family: "Pirata One";
    src: url("gfonts/pirata-one-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("gfonts/source-sans-3-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("gfonts/source-sans-3-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --abyss: #07090c;
    --abyss-panel: rgba(7, 9, 12, 0.78);
    --abyss-scrim: rgba(7, 9, 12, 0.99);
    --foam: #d7e2dc;
    --foam-muted: #9aaba3;
    --lantern: #e4b15a;
    --lantern-dim: rgba(228, 177, 90, 0.35);
    --copper-edge: rgba(184, 115, 51, 0.55);
    --sky-0: #07090c;
    --sky-1: #0c1218;
    --sky-2: #101820;
    --sky-3: #141e28;
    --font-display: "Pirata One", serif;
    --font-ui: "Source Sans 3", sans-serif;
    --panel-max: 440px;
    --play-size: 64px;
    --mute-size: 44px;
    --share-size: 48px;
    --social-size: 44px;
    --info-size: 44px;
    --volume-width: 112px;
    --corner: 24px;
    --radius-panel: 10px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--abyss);
    color: var(--foam);
    font-family: var(--font-ui);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

button,
a,
input {
    -webkit-touch-callout: none;
    font-family: inherit;
}

button {
    color: inherit;
}

#SeaContainer,
#SeaCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

#SeaCanvas {
    display: block;
}

.lantern-wash {
    position: fixed;
    left: 50%;
    top: 46%;
    width: 480px;
    height: 480px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(228, 177, 90, 0.12), transparent 68%);
    pointer-events: none;
    z-index: 5;
}

.log-panel {
    position: relative;
    z-index: 10;
    width: min(var(--panel-max), calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 32px 32px;
    transform: translateY(-4vh);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--abyss-panel);
    border: 1px solid var(--copper-edge);
    border-radius: var(--radius-panel);
    box-shadow:
        inset 0 0 0 1px rgba(215, 226, 220, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px) saturate(0.85);
}

.wordmark {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    line-height: 0.85;
    letter-spacing: 0.06em;
    color: var(--foam);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 0 24px rgba(228, 177, 90, 0.18);
}

.wordmark span {
    display: block;
    margin-top: 0.45rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--lantern);
    text-shadow: none;
}

.tagline {
    margin-top: 14px;
    font-size: 0.9375rem;
    font-style: italic;
    letter-spacing: 0.04em;
    color: var(--foam-muted);
}

.player-section {
    width: 100%;
    margin-top: 26px;
}

.now-playing {
    position: relative;
    margin-bottom: 24px;
    padding-top: 22px;
}

.now-playing::before {
    content: "Standing by";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.65rem;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--foam-muted);
}

body[stream-active] .now-playing::before {
    content: "On the air";
    color: var(--lantern);
}

.now-playing::after {
    content: "";
    display: block;
    width: 48px;
    height: 1px;
    margin: 0 auto 14px;
    background: var(--copper-edge);
}

#track-title,
#artist-name {
    display: block;
    cursor: pointer;
    overflow: hidden;
}

#track-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

#artist-name {
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--foam-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

#track-title:hover,
#artist-name:hover {
    color: var(--lantern);
}

#track-title:focus-visible,
#artist-name:focus-visible {
    outline: 2px solid var(--lantern);
    outline-offset: 3px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    width: 100%;
}

#stream-toggle-btn {
    position: relative;
    flex: 0 0 auto;
    width: var(--play-size);
    height: var(--play-size);
    border: none;
    border-radius: 50%;
    background: var(--lantern);
    color: var(--abyss);
    cursor: pointer;
}

#stream-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--copper-edge);
}

#stream-toggle-btn:active {
    transform: scale(0.96);
}

#stream-toggle-btn:focus {
    outline: none;
}

#stream-toggle-btn:focus-visible {
    outline: 2px solid var(--foam);
    outline-offset: 4px;
}

.play-icon,
.pause-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s var(--ease);
}

.play-icon {
    opacity: 1;
}

.pause-icon {
    opacity: 0;
}

body[stream-active] #stream-toggle-btn .play-icon {
    opacity: 0;
}

body[stream-active] #stream-toggle-btn .pause-icon {
    opacity: 1;
}

.triangle {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-left: 16px solid var(--abyss);
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
}

.pause-icon .bar {
    width: 4px;
    height: 22px;
    margin: 0 2.5px;
    border-radius: 1px;
    background: var(--abyss);
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#mute-btn,
.social-link,
#info-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--mute-size);
    height: var(--mute-size);
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--foam-muted);
    cursor: pointer;
    text-decoration: none;
}

#mute-btn {
    flex: 0 0 auto;
    border: none;
}

#mute-btn svg,
.social-link svg,
#share-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

#mute-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#mute-btn .speaker {
    fill: currentColor;
    stroke: none;
}

#mute-btn .slash {
    opacity: 0;
}

#mute-btn.muted {
    color: var(--lantern);
}

#mute-btn.muted .wave {
    opacity: 0;
}

#mute-btn.muted .slash {
    opacity: 1;
}

#mute-btn:active,
.social-link:active,
#share-btn:active,
#info-toggle:active {
    transform: scale(0.96);
}

#mute-btn:focus,
.social-link:focus,
#share-btn:focus,
#info-toggle:focus,
#volume-slider:focus {
    outline: none;
}

#mute-btn:focus-visible,
.social-link:focus-visible,
#info-toggle:focus-visible {
    outline: 2px solid var(--foam);
    outline-offset: 2px;
}

.volume-slider-container {
    width: var(--volume-width);
    height: 44px;
    display: flex;
    align-items: center;
}

#volume-slider {
    width: 100%;
    height: 44px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#volume-slider::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: rgba(215, 226, 220, 0.22);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5.5px;
    border: 1px solid rgba(184, 115, 51, 0.9);
    border-radius: 50%;
    background: var(--lantern);
    cursor: pointer;
}

#volume-slider::-moz-range-track {
    height: 3px;
    border: none;
    border-radius: 2px;
    background: rgba(215, 226, 220, 0.22);
}

#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(184, 115, 51, 0.9);
    border-radius: 50%;
    background: var(--lantern);
    cursor: pointer;
}

#volume-slider:focus-visible {
    outline: 2px solid var(--foam);
    outline-offset: 2px;
}

.social-media {
    position: fixed;
    z-index: 20;
    left: max(var(--corner), env(safe-area-inset-left));
    bottom: max(var(--corner), env(safe-area-inset-bottom));
    display: flex;
    gap: 12px;
}

.social-link {
    width: var(--social-size);
    height: var(--social-size);
    background: rgba(7, 9, 12, 0.75);
    border-color: var(--copper-edge);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover,
#info-toggle:hover,
#mute-btn:hover {
    color: var(--foam);
}

#share-btn {
    position: fixed;
    z-index: 20;
    right: max(var(--corner), env(safe-area-inset-right));
    bottom: max(var(--corner), env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--share-size);
    height: var(--share-size);
    border: 1px solid var(--copper-edge);
    border-radius: 50%;
    background: var(--lantern);
    color: var(--abyss);
    cursor: pointer;
}

#share-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(228, 177, 90, 0.4);
}

#share-btn:focus-visible {
    outline: 2px solid var(--foam);
    outline-offset: 4px;
}

#info-toggle {
    position: fixed;
    z-index: 120;
    top: max(var(--corner), env(safe-area-inset-top));
    right: max(var(--corner), env(safe-area-inset-right));
    background: rgba(7, 9, 12, 0.75);
    border-color: var(--copper-edge);
    font-size: 1rem;
    font-weight: 600;
}

#info-panel {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    background: var(--abyss-scrim);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

#info-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.info-content {
    width: min(480px, 100%);
    max-height: 100%;
    overflow-y: auto;
    padding: 36px 32px;
    text-align: center;
    background: var(--abyss-panel);
    border: 1px solid var(--copper-edge);
    border-radius: 12px;
    user-select: text;
    -webkit-user-select: text;
}

.info-content h2 {
    margin-bottom: 18px;
    font-family: var(--font-ui);
    font-size: 1.5rem;
    font-weight: 600;
}

.info-content p {
    margin-bottom: 14px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--foam-muted);
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.tag {
    padding: 6px 12px;
    border: 1px solid var(--copper-edge);
    border-radius: 4px;
    background: rgba(228, 177, 90, 0.12);
    color: var(--lantern);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.notification {
    position: fixed;
    z-index: 1000;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    max-width: min(360px, calc(100vw - 24px));
    padding: 14px 22px;
    border: 1px solid var(--copper-edge);
    border-radius: 8px;
    background: rgba(7, 9, 12, 0.92);
    color: var(--foam);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes lanternBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(228, 177, 90, 0); }
    50% { transform: scale(1.04); box-shadow: 0 0 28px var(--lantern-dim); }
}

@media (prefers-reduced-motion: no-preference) {
    body:not([stream-active]) #stream-toggle-btn {
        animation: lanternBreath 2.8s ease-in-out infinite;
    }
}

@media (min-width: 1920px) {
    :root { --corner: 32px; }
}

@media (max-width: 768px) {
    :root {
        --play-size: 56px;
        --volume-width: 120px;
        --corner: 12px;
    }

    .log-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 58dvh;
        margin: 0;
        padding: 16px max(16px, env(safe-area-inset-right)) calc(76px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
        transform: none;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        overflow-y: auto;
    }

    .wordmark { font-size: 2.25rem; }
    .lantern-wash { top: 28%; }
    #info-panel { align-items: stretch; }
    .info-content {
        width: 100%;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }
}

@media (max-width: 430px) {
    :root {
        --play-size: 60px;
        --volume-width: 140px;
    }

    .log-panel { padding-top: 20px; }
    .wordmark { font-size: 2.4rem; }
}

@media (max-width: 390px) {
    :root {
        --play-size: 56px;
        --volume-width: 120px;
    }
}

@media (max-width: 360px) {
    :root {
        --play-size: 48px;
        --volume-width: 96px;
    }

    .log-panel {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .wordmark { font-size: 2rem; }
    .tagline { font-size: 0.8125rem; }
    #track-title { font-size: 1rem; }
    #artist-name { font-size: 0.75rem; }
}

@media (max-height: 420px) {
    .log-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: min(88dvh, 320px);
        margin: 0;
        padding: 8px calc(64px + env(safe-area-inset-right)) 8px calc(108px + env(safe-area-inset-left));
        transform: none;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        text-align: left;
        border-radius: 0;
        overflow-y: auto;
    }

    .logo-section { flex: 0 0 auto; }
    .tagline,
    .now-playing::before,
    .now-playing::after,
    #artist-name { display: none; }
    .wordmark,
    .wordmark span {
        font-family: var(--font-ui);
        font-size: 0.875rem;
        font-weight: 600;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        line-height: 1.1;
        text-shadow: none;
    }
    .wordmark span { display: inline; margin-top: 0; color: var(--lantern); }
    .player-section { flex: 1; min-width: 0; margin-top: 0; }
    .now-playing { margin: 0 0 8px; padding: 0; }
    #track-title {
        display: block;
        -webkit-line-clamp: unset;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 0.875rem;
    }
    .player-controls { gap: 12px; }
    :root {
        --play-size: 44px;
        --mute-size: 44px;
        --share-size: 44px;
        --volume-width: min(160px, 30vw);
    }
    .lantern-wash { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
