:root {
    color-scheme: dark;
    --bg: #080b12;
    --panel: #111827;
    --panel-2: #172033;
    --text: #f8fafc;
    --muted: #94a3b8;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --cyan: #00e5ff;
    --pink: #ff3cac;
    --violet: #8b5cf6;
    --blue: #5865f2;
    --blue-dark: #3341d8;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 60, 172, 0.10), transparent 25rem),
        radial-gradient(circle at top, rgba(0, 229, 255, 0.14), transparent 34rem),
        radial-gradient(circle at top right, rgba(88, 101, 242, 0.16), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 20px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo-wrap {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    padding: 3px;
    background: conic-gradient(from var(--ring-angle), var(--cyan), var(--pink), var(--violet), var(--cyan));
    animation: ring-spin 5s linear infinite;
    box-shadow:
        0 0 34px rgba(0, 229, 255, 0.18),
        0 0 46px rgba(255, 60, 172, 0.10);
}

.brand-logo-inner {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 21px;
    background: rgba(8, 15, 28, 0.9);
    backdrop-filter: blur(12px);
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.25));
}

header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.06em;
    text-shadow: 0 0 28px rgba(0, 229, 255, 0.25);
}

header p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(12px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 20px 50px rgba(0, 0, 0, 0.25);
}

.toolbar strong {
    display: block;
}

.toolbar span {
    color: var(--muted);
    font-size: 0.92rem;
}

.action-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(8, 15, 28, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-pill {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    border-radius: 999px;
    padding: 0 16px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.95rem;
    transition:
        width 0.45s cubic-bezier(.22, 1, .36, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.action-pill i {
    min-width: 20px;
    text-align: center;
    font-size: 1.15rem;
    transition:
        transform 0.35s ease,
        color 0.35s ease;
}

.action-label {
    opacity: 0;
    max-width: 0;
    transform: translateX(-8px);
    transition:
        opacity 0.25s ease,
        max-width 0.45s ease,
        transform 0.35s ease;
}

.action-pill:hover,
.action-pill:focus-visible {
    width: 164px;
    transform: translateY(-1px);
}

.action-pill:hover .action-label,
.action-pill:focus-visible .action-label {
    opacity: 1;
    max-width: 120px;
    transform: translateX(0);
}

.action-pill:hover i,
.action-pill:focus-visible i {
    transform: scale(1.12) rotate(-4deg);
}

.refresh-button {
    background: rgba(0, 229, 255, 0.12);
    box-shadow: 0 0 0 rgba(0, 229, 255, 0);
}

.refresh-button:hover,
.refresh-button:focus-visible {
    background: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.22);
}

.refresh-button:hover i,
.refresh-button:focus-visible i {
    color: var(--cyan);
}

.invite-button {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 0 0 rgba(88, 101, 242, 0);
}

.invite-button:hover,
.invite-button:focus-visible {
    background: linear-gradient(135deg, #6d79ff, var(--blue));
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.42);
}

.invite-button:hover i,
.invite-button:focus-visible i {
    color: #ffffff;
}

.search-wrap {
    display: grid;
    place-items: center;
    margin: 6px 0 22px;
}

.search-shell {
    width: min(680px, 100%);
    position: relative;
    border-radius: 999px;
    padding: 2px;
    background: conic-gradient(from var(--ring-angle), var(--cyan), var(--pink), var(--violet), var(--cyan));
    animation: ring-spin 5s linear infinite;
    box-shadow: 0 0 36px rgba(0, 229, 255, 0.14);
    transition:
        width 0.45s cubic-bezier(.22, 1, .36, 1),
        box-shadow 0.35s ease,
        transform 0.35s ease;
}

.search-shell:focus-within {
    width: min(820px, 100%);
    box-shadow:
        0 0 34px rgba(0, 229, 255, 0.28),
        0 0 46px rgba(255, 60, 172, 0.14);
    transform: translateY(-1px);
}

.search-box {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    padding: 0 18px;
    background: rgba(12, 26, 42, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-box i {
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
}

.search-box input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.search-box input::placeholder {
    color: rgba(148, 163, 184, 0.48);
}

.search-state {
    min-height: 22px;
    margin-top: 8px;
    color: var(--muted);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

@property --ring-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes ring-spin {
    to {
        --ring-angle: 360deg;
    }
}

.country-section {
    margin-top: 34px;
}

.country-section.is-hidden {
    display: none;
}

.country-divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.country-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.country-emoji {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.82);
    border: 1px solid var(--border);
    font-size: 1.55rem;
}

.country-title h2 {
    margin: 0;
    font-size: 1.35rem;
}

.country-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.divider-line {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.55), rgba(255, 60, 172, 0.12), transparent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.country-empty {
    grid-column: 1 / -1;
    padding: 22px;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    background: rgba(17, 24, 39, 0.52);
}

.card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    background: rgba(17, 24, 39, 0.84);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 229, 255, 0.22);
    box-shadow:
        0 22px 58px rgba(0, 0, 0, 0.32),
        0 0 26px rgba(0, 229, 255, 0.08);
}

.card.is-hidden {
    display: none;
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.station-heading {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.station-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 16px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.45),
        0 14px 34px rgba(0, 0, 0, 0.22);
}

h3 {
    margin: 0;
    font-size: 1.15rem;
}

.card p {
    color: var(--muted);
    margin: 6px 0 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.badge.up {
    color: #052e16;
    background: var(--green);
    box-shadow: 0 0 22px rgba(34, 197, 94, 0.25);
}

.badge.down {
    color: #450a0a;
    background: var(--red);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.22);
}

.badge.checking {
    color: #422006;
    background: var(--yellow);
}

dl {
    margin: 18px 0 0;
    display: grid;
    gap: 10px;
}

dl div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

a {
    color: #93c5fd;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.mini-pill {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0 14px;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    font-size: 0.9rem;
    transition:
        width 0.45s cubic-bezier(.22, 1, .36, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.mini-pill i {
    min-width: 18px;
    text-align: center;
    font-size: 1rem;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.mini-label {
    opacity: 0;
    max-width: 0;
    transform: translateX(-8px);
    transition:
        opacity 0.25s ease,
        max-width 0.45s ease,
        transform 0.35s ease;
}

.mini-pill:hover,
.mini-pill:focus-visible {
    width: 158px;
    transform: translateY(-1px);
}

.mini-pill:hover .mini-label,
.mini-pill:focus-visible .mini-label {
    opacity: 1;
    max-width: 120px;
    transform: translateX(0);
}

.mini-pill:hover i,
.mini-pill:focus-visible i {
    color: var(--cyan);
    transform: scale(1.12) rotate(-4deg);
}

.stream-button {
    background: rgba(0, 229, 255, 0.12);
    box-shadow: 0 0 0 rgba(0, 229, 255, 0);
}

.stream-button:hover,
.stream-button:focus-visible {
    background: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.22);
}

.error {
    color: #fecaca !important;
    overflow-wrap: anywhere;
}

.no-results {
    display: none;
    margin: 24px auto 0;
    padding: 22px;
    max-width: 560px;
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(17, 24, 39, 0.68);
}

.no-results.is-visible {
    display: block;
}

footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px 50px;
    color: var(--muted);
}

@media (max-width: 700px) {
    header {
        padding-top: 34px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-logo-wrap {
        width: 64px;
        height: 64px;
        border-radius: 20px;
        flex: 0 0 auto;
    }

    .brand-logo-inner {
        border-radius: 17px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }

    .toolbar {
        align-items: flex-start;
        border-radius: 28px;
        flex-direction: column;
    }

    .action-menu {
        width: 100%;
        justify-content: space-between;
    }

    .action-pill {
        flex: 1;
        width: auto;
        justify-content: center;
    }

    .action-label {
        opacity: 1;
        max-width: 120px;
        transform: translateX(0);
    }

    .action-pill:hover,
    .action-pill:focus-visible {
        width: auto;
    }

    .search-shell,
    .search-shell:focus-within {
        width: 100%;
    }

    .mini-pill {
        width: 158px;
        justify-content: center;
    }

    .mini-label {
        opacity: 1;
        max-width: 120px;
        transform: translateX(0);
    }

    .mini-pill:hover,
    .mini-pill:focus-visible {
        width: 158px;
    }
}
