@font-face {
    font-family: "OpenAI Sans";
    src: url("fonts/OpenAISans-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "OpenAI Sans";
    src: url("fonts/OpenAISans-Semibold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "OpenAI Sans";
    src: url("fonts/OpenAISans-Bold.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #10161b;
    --bg-2: #151d23;
    --panel: #18222a;
    --panel-2: #202b34;
    --soft: #2a1e21;
    --ink: #f4f7f8;
    --muted: #aeb8bf;
    --line: #334149;
    --line-soft: rgb(255 255 255 / 8%);
    --accent: #ff3d36;
    --accent-2: #b8120d;
    --green: #46d07d;
    --amber: #e4a949;
    --error: #ff6b6b;
    --pad: max(12px, env(safe-area-inset-left));
    --player-reserve: 248px;
    --player-width: min(1180px, calc(100% - (var(--pad) * 2)));
}


* {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

input[type="search"],
input[type="search"] * {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: "OpenAI Sans", Arial, Helvetica, sans-serif;
    line-height: 1.4;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    text-rendering: auto;
}

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgb(8 11 14 / 62%), rgb(8 11 14 / 35%)),
        url("patterns/radyo-desen-tile.svg");
    background-repeat: no-repeat, repeat;
    background-position: center top, 0 0;
    background-size: 100% 100%, 320px 320px;
}

button,
input,
select {
    font: inherit;
    line-height: 1.35;
}

button {
    cursor: pointer;
    touch-action: manipulation;
}

.app {
    width: 100%;
    min-height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) var(--pad) calc(var(--player-reserve) + env(safe-area-inset-bottom));
}

.top {
    display: grid;
    gap: 8px;
    width: min(1180px, 100%);
    margin: 0 auto 10px;
}

.category-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 10px;
    background: linear-gradient(180deg, rgb(21 29 35 / 96%), rgb(17 24 30 / 95%));
    box-shadow: 0 10px 28px rgb(0 0 0 / 18%), inset 0 1px 0 rgb(255 255 255 / 4%);
    padding: 8px 10px;
}

.search-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 10px;
    background: linear-gradient(180deg, rgb(21 29 35 / 96%), rgb(17 24 30 / 95%));
    box-shadow: 0 10px 28px rgb(0 0 0 / 18%), inset 0 1px 0 rgb(255 255 255 / 4%);
    padding: 8px 10px;
}

.search-bar > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.search-bar input {
    min-width: 0;
    width: 100%;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 9px;
    background: rgb(35 45 56 / 95%);
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
    font-weight: 800;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(255 61 54 / 16%);
}

.category-bar label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
}

.category-bar select {
    min-width: 0;
    width: 100%;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 9px;
    background: rgb(35 45 56 / 95%);
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
    font-weight: 900;
}

.category-bar select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(255 61 54 / 16%);
}

.count {
    display: grid;
    min-width: 48px;
    height: 44px;
    place-items: center;
    border: 1px solid rgb(255 61 54 / 52%);
    border-radius: 10px;
    background: linear-gradient(180deg, rgb(76 22 24 / 72%), rgb(43 17 18 / 92%));
    color: #ff685f;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding-bottom: 6px;
}

.public-info {
    display: grid;
    gap: 10px;
    width: min(1180px, 100%);
    margin: 0 auto 10px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 10px;
    background: linear-gradient(180deg, rgb(24 34 42 / 94%), rgb(17 25 31 / 95%));
    color: var(--ink);
    padding: 12px 14px;
}

.public-info-bottom {
    margin-top: 10px;
    margin-bottom: 0;
    text-align: center;
}

.public-info p {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.public-info-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.public-info-bottom .public-info-links {
    justify-content: center;
}

.public-info-links:empty {
    display: none;
}

.public-info a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 61 54 / 42%);
    border-radius: 8px;
    background: rgb(255 61 54 / 10%);
    color: #fff;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
}

.station {
    position: relative;
    display: flex;
    min-height: 86px;
    min-width: 0;
    align-items: center;
    gap: 10px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 12px;
    background: linear-gradient(180deg, rgb(26 36 44 / 96%), rgb(19 28 35 / 96%));
    box-shadow: 0 10px 24px rgb(0 0 0 / 16%), inset 0 1px 0 rgb(255 255 255 / 3%);
    color: var(--ink);
    padding: 10px 12px;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.station.active {
    border-color: rgb(255 61 54 / 65%);
    background: linear-gradient(180deg, rgb(49 29 33 / 96%), rgb(34 21 24 / 96%));
    box-shadow: 0 12px 26px rgb(0 0 0 / 22%), inset 0 0 0 1px rgb(255 61 54 / 34%);
}

.station:active {
    transform: translateY(1px);
}

.station-badge,
.logo {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    color: #fff;
    font-weight: 900;
    line-height: 1.15;
    contain: layout paint;
    isolation: isolate;
}

.station-badge {
    width: 44px;
    height: auto;
    aspect-ratio: 11 / 20;
    font-size: 12px;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.logo {
    width: 54px;
    height: 54px;
    font-size: 15px;
}

.logo.has-image,
.station-badge.has-image {
    background: transparent !important;
    padding: 0;
}

.logo img,
.station-badge img {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    object-fit: contain !important;
    transform: none !important;
}

.station-name {
    min-width: 0;
    padding-block: 0.05em;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: .01em;
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgb(27 36 43 / 88%);
    color: var(--muted);
    padding: 18px;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
}

.player {
    position: fixed;
    right: var(--pad);
    bottom: max(10px, env(safe-area-inset-bottom));
    left: var(--pad);
    z-index: 30;
    width: var(--player-width);
    margin: 0 auto;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 18px;
    background: linear-gradient(180deg, rgb(8 13 17 / 96%), rgb(5 10 14 / 95%));
    box-shadow: 0 24px 42px rgb(0 0 0 / 30%), inset 0 1px 0 rgb(255 255 255 / 4%);
    padding: 12px;
    backdrop-filter: blur(14px);
}

.player-shell {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
}

.player-main {
    display: grid;
    align-content: center;
    gap: 10px;
    min-width: 0;
}

.player-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.player-logo {
    width: 100%;
    height: auto;
    aspect-ratio: 11 / 20;
    align-self: center;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0;
    font-size: 18px;
}

.player-logo.has-image {
    background: transparent !important;
    padding: 0;
}

.player-logo img {
    border-radius: 0;
    object-fit: contain !important;
}

.now {
    display: contents;
}

.title {
    min-width: 0;
}

.title strong {
    display: block;
    min-width: 0;
    color: var(--ink);
    font-size: clamp(16px, 4.2vw, 22px);
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.state {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 7px;
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    padding: 6px 11px;
}

.state.status-playing {
    color: var(--green);
    border-color: rgb(70 208 125 / 46%);
    background: rgb(70 208 125 / 10%);
}

.state.status-loading,
.state.status-retry,
.state.status-stalled {
    color: var(--amber);
    border-color: rgb(228 169 73 / 46%);
    background: rgb(228 169 73 / 11%);
}

.state.status-error {
    color: var(--error);
    border-color: rgb(255 107 107 / 46%);
    background: rgb(255 107 107 / 11%);
}

.state.status-paused {
    color: var(--ink);
}

.dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 99px;
    background: var(--muted);
}

.dot.loading,
.dot.retry,
.dot.stalled {
    background: var(--amber);
}

.dot.playing {
    background: var(--green);
}

.dot.error {
    background: var(--error);
}

.dock-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.player-icon-button {
    width: 66px;
    height: 66px;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: transparent;
    padding: 0;
    flex: 0 0 auto;
}

.player-icon-button:disabled {
    cursor: default;
    opacity: .48;
}

.play-control {
    background-image: url("icons/player-play.svg");
}

.pause-control {
    background-image: url("icons/player-pause.svg");
}

.stop-control {
    background-image: url("icons/player-stop.svg");
}

.notice {
    margin-top: 0;
    border: 1px solid rgb(255 107 107 / 55%);
    border-radius: 10px;
    background: rgb(255 107 107 / 12%);
    color: var(--error);
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.32;
}

.notice.ok {
    border-color: rgb(70 208 125 / 52%);
    background: rgb(70 208 125 / 12%);
    color: var(--green);
}

.notice.wait {
    border-color: rgb(228 169 73 / 52%);
    background: rgb(228 169 73 / 13%);
    color: var(--amber);
}

.controls {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    gap: 8px;
    align-items: center;
    margin-top: 0;
}

.nav-button,
.mute-button,
.station,
#installAccept,
.install-close {
    cursor: pointer;
}

.nav-button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 12px;
    background: linear-gradient(180deg, rgb(24 34 42 / 96%), rgb(18 28 36 / 96%));
    color: var(--ink);
    line-height: 1;
}

.volume {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    border: 1px solid rgb(255 255 255 / 9%);
    border-radius: 14px;
    background: linear-gradient(180deg, rgb(24 34 42 / 98%), rgb(16 26 34 / 98%));
    padding: 8px 10px;
}

.mute-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: rgb(34 45 55 / 92%);
    color: var(--ink);
}

.ui-icon {
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

.ui-volume { -webkit-mask-image: url("icons/volume.svg"); mask-image: url("icons/volume.svg"); }
.ui-volume-off { -webkit-mask-image: url("icons/volume-off.svg"); mask-image: url("icons/volume-off.svg"); }
.ui-prev { -webkit-mask-image: url("icons/prev.svg"); mask-image: url("icons/prev.svg"); }
.ui-next { -webkit-mask-image: url("icons/next.svg"); mask-image: url("icons/next.svg"); }

.range {
    width: 100%;
    min-width: 0;
    accent-color: var(--accent);
}

.range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
}

.range::-webkit-slider-thumb {
    margin-top: -5px;
}

.install-box {
    position: fixed;
    right: auto;
    bottom: calc(var(--player-reserve) + 12px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 48px;
    align-items: center;
    gap: 12px;
    width: var(--player-width);
    min-height: 76px;
    max-width: none;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #e9eef2);
    box-shadow: 0 18px 38px rgb(0 0 0 / 28%);
    color: var(--bg);
    padding: 14px;
    transform: translateX(-50%);
}


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

.install-box span {
    min-width: 0;
    padding-inline-start: 2px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

#installAccept {
    min-width: 104px;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.install-close {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: rgb(16 22 27 / 16%);
    color: var(--bg);
    font-size: 24px;
    line-height: 1;
}

audio {
    display: none;
}

@media (display-mode: fullscreen), (display-mode: standalone) {
    .install-box {
        display: none;
    }
}

@media (min-width: 640px) {
    :root {
        --pad: 18px;
        --player-reserve: 224px;
    }

    .app {
        padding-top: 18px;
        padding-bottom: calc(var(--player-reserve) + env(safe-area-inset-bottom));
    }

    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .player {
        padding: 12px 14px;
    }

    .player-shell {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 14px;
    }

    .player .player-logo {
        width: 100%;
        height: auto;
        min-height: 144px;
        align-self: stretch;
        border-radius: 18px;
    }
}

@media (min-width: 980px) {
    :root {
        --player-reserve: 218px;
    }

    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .player-shell {
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
    }

    .player-main {
        grid-template-columns: minmax(190px, 1fr) auto minmax(330px, 1.25fr);
        grid-template-rows: auto auto;
        align-items: center;
        gap: 10px 22px;
    }

    .player-top {
        display: contents;
    }

    .player .player-logo,
    .player .logo.player-logo {
        width: 88px;
        height: 160px;
        min-height: 0;
        align-self: center;
        aspect-ratio: 11 / 20;
    }

    .title {
        grid-column: 1;
        grid-row: 1;
    }

    .title strong {
        font-size: clamp(17px, 1.55vw, 22px);
    }

    .dock-buttons {
        grid-column: 2;
        grid-row: 1;
        gap: 6px;
    }

    .player-icon-button {
        width: 58px;
        height: 58px;
    }

    .controls {
        grid-column: 3;
        grid-row: 1;
        width: 100%;
    }

    .notice {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 540px) {
    :root {
        --player-reserve: 236px;
    }

    .install-box {
        grid-template-columns: minmax(0, 1fr) 48px;
        min-height: 92px;
        gap: 10px;
        padding: 12px;
    }

    #installAccept {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 50px;
    }

    .install-close {
        grid-column: 2;
        grid-row: 1;
    }

    body {
        background-size: 100% 100%, 260px 260px;
    }

    .category-bar {
        grid-template-columns: 1fr auto;
    }

    .category-bar label {
        grid-column: 1 / -1;
    }

    .search-bar {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .grid {
        gap: 7px;
    }

    .station {
        min-height: 84px;
        padding: 9px 10px;
        border-radius: 10px;
    }

    .station-badge {
        width: 44px;
        height: auto;
        aspect-ratio: 11 / 20;
        border-radius: 0;
        padding: 0;
    }

    .station-name {
        font-size: 14px;
        line-height: 1.18;
    }

    .player {
        border-radius: 16px;
        padding: 10px;
    }

    .player-shell {
        grid-template-columns: minmax(96px, 29%) minmax(0, 1fr);
        align-items: stretch;
        gap: 10px;
    }

    .player .player-logo,
    .player .logo.player-logo {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 11 / 20;
        align-self: center;
        margin: 0;
        border-radius: 0;
        padding: 0;
        font-size: 16px;
    }

    .player .player-logo.has-image {
        padding: 0;
        background: transparent !important;
    }

    .player-main {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        align-content: stretch;
        gap: 8px;
        min-width: 0;
    }

    .player-top {
        display: grid;
        grid-template-rows: auto minmax(70px, 1fr);
        grid-template-columns: 1fr;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .title {
        text-align: center;
    }

    .title strong {
        font-size: clamp(15px, 4vw, 18px);
        line-height: 1.15;
    }

    .state {
        justify-content: center;
        margin: 4px auto 0;
        font-size: 11px;
        padding: 5px 9px;
    }

    .dock-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: center;
        justify-items: center;
        width: 100%;
        gap: 2px;
        margin: 0;
    }

    .player-icon-button {
        width: 66px;
        height: 66px;
        max-width: 100%;
    }

    .controls {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 6px;
        margin: 0;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .volume {
        min-height: 40px;
        gap: 7px;
        padding: 5px 7px;
        border-radius: 11px;
    }

    .mute-button {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .ui-icon {
        width: 20px;
        height: 20px;
    }

    .notice {
        font-size: 11px;
        padding: 7px 8px;
    }
}

@media (max-width: 380px) {
    :root {
        --player-reserve: 226px;
    }

    .player-shell {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 8px;
    }

    .player .player-logo,
    .player .logo.player-logo {
        min-height: 0;
        aspect-ratio: 11 / 20;
    }

    .player-icon-button {
        width: 60px;
        height: 60px;
    }
}
