*{
    padding:0;
    box-sizing:border-box;
}

html{
    width:100%;
    height:100%;
    background:#000;
    color:#fff;
    overflow:hidden;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
    background: var(--bg);
    color: var(--text);
    transition: background 0.25s, color 0.25s;
}
body.dark {
    --bg: #0f1115;
    --card: #1a1d23;
    --text: #f2f2f2;
    --muted: #aaa;
    --accent: #fff;
    --border: #2a2f3a;
}
#reels{
    width:100%;
    height:100dvh;
    overflow-x:hidden;
    overflow-y:auto;
    scroll-snap-type:y mandatory;
    overscroll-behavior-y:none;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    touch-action:pan-y;
}

#reels::-webkit-scrollbar{
    display:none;
}

#loading{
    min-height:100dvh;
    display:grid;
    place-items:center;
    color:#9a9a9a;
    font-size:15px;
}

.reel{
    min-height:100dvh;
    height:100dvh;
    width:100%;
    scroll-snap-align:start;
    scroll-snap-stop:always;

    display:flex;
    justify-content:flex-start;
    align-items:stretch;

    position:relative;
    overflow:hidden;
}

.content{
    width:100%;
    max-width:500px;

    margin:auto;

    padding:
        max(24px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));

    display:flex;
    flex-direction:column;
    align-items: flex-start;
    justify-content:flex-start;

    min-height:100%;
    gap:0;
}

/* .country-chip{
    position:absolute;
    top:24px;
    left:20px;

    padding:10px 18px;

    border-radius:999px;

    background:#ff4b4b;

    font-weight:700;
    font-size:14px;

    z-index:100;
} */
.country-chip{
    background:#ffffff15;

    color:#fff;

    padding:8px 16px;

    border-radius:999px;

    font-size:13px;
    font-weight:700;

    backdrop-filter:blur(8px);
}
.new-chip{
    background:#ff3b30;

    color:#fff;

    padding:8px 16px;

    border-radius:999px;

    font-size:13px;
    font-weight:700;
}
.chips{
    display:flex;
    flex-direction: row;
    gap:10px;
    flex-wrap:wrap;

    margin-bottom:14px;
    align-items: center;
    width: 100%;
}
.song-title{
    font-size:clamp(
        1.5rem,
        5vw,
        2.2rem
    );
    font-weight:700;
    display:-webkit-box;
    /* -webkit-line-clamp:3; */
    -webkit-box-orient:vertical;
    overflow:hidden;
    text-overflow:ellipsis;
    margin-bottom:10px;
    line-height:1.15;
    word-break:break-word;
}

.artist{
    color:#c8c8c8;
    margin-bottom:18px;
    line-height:1.5;
    font-size: 15px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    /* -webkit-line-clamp: 3; */
    overflow: hidden;

}

.embed-container{
    width:100%;
    min-height:clamp(160px, 28dvh, 220px);

    border-radius:14px;

    overflow:hidden;

    margin-bottom:18px;
}

.embed-placeholder{
    width:100%;
    height:clamp(160px, 28dvh, 220px);

    border-radius:14px;

    background:#151515;

    display:flex;
    justify-content:center;
    align-items:center;

    color:#666;
}

iframe{
    width:100%;
    height:clamp(160px, 28dvh, 220px);
    border:none;
    display:block;
}

.platforms{
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:10px;
    width:100%;
}

.platform-btn{
    text-decoration:none;

    color:#000;

    background:#fff;

    min-height:44px;
    padding:12px 10px;

    border-radius:999px;

    font-weight:600;
    font-size:13px;
    text-align: center;

    transition:.2s;
    flex:1 1 calc(50% - 12px);
    text-align:center;
    display:flex;
    align-items:center;
    justify-content:center;
    touch-action:manipulation;
    white-space:nowrap;
}

.platform-btn:hover,
.platform-btn:focus-visible{
    transform:scale(1.05);
}
.preview-unavailable{
    width:100%;
    min-height:clamp(160px, 28dvh, 220px);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    border-radius:14px;
    background:#141414;
    color:#999;
    font-size:16px;
    margin-bottom:24px;
    border:1px solid #222;
}

@media (max-width:480px){
    .content{
        max-width:100%;
        padding:
            max(18px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(18px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
    }

    .country-chip,
    .new-chip{
        padding:7px 12px;
        font-size:12px;
    }

    .song-title{
        font-size:1.5rem;
        max-height:4.9rem;
    }

    .artist{
        margin-bottom:14px;
        font-size:14px;
        max-height:3.1rem;
    }

    .embed-container,
    .preview-unavailable{
        margin-bottom:14px;
    }

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

    .platform-btn{
        min-height:42px;
        padding:11px 8px;
        font-size:12px;
    }
}

@media (max-height:680px){
    .song-title{
        font-size:1.35rem;
        max-height:3.25rem;
    }

    .artist{
        margin-bottom:12px;
    }

    .embed-container,
    .embed-placeholder,
    iframe,
    .preview-unavailable{
        min-height:150px;
        height:150px;
    }

    .platform-btn{
        min-height:40px;
    }
}

/* main page styling */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px; /* space below title */
}
.title-with-home{
    display:flex;
    align-items:center;
    gap:10px;
}
.home-link{
    width:30px;
    height:30px;
    background:white;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    opacity:0.85;
    overflow:hidden;
}
.home-link img,
.home-link svg{
    width:20px;     /* increase/decrease icon size here */
    height:20px;
    object-fit:contain;
    display:block;
}

.home-link:hover{
    opacity:1;
}
.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
}
header {
    position:sticky;
    top:0;
    z-index:1000;
    background: var(--card);
    padding: 14px 16px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow:0 2px 8px rgba(0,0,0,0.08);

}
.sheet,
.sheet:visited,
.sheet:hover,
.sheet:active {
    text-decoration: none;
}
.sheet {
    padding: 9px 16px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    background: var(--border);
    color: var(--text);
    transition: background 0.2s, color 0.2s;
    flex: 0 0 auto; /* 🔑 prevents vertical stacking */
    width: auto;
}

    .sheet.active {
        background: var(--accent);
        color: var(--bg);
    }

.horizontal-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* 🔑 THIS is critical */
    gap: 10px;
    margin-bottom: 12px; /* 🔑 space below pills */

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior:smooth;
}

    .horizontal-scroll::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
.filters {
    display: flex;
    gap: 10px;
}
.filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
}