:root {
    --bg-color: #ffffff;
    --accent-red: #FF0000;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'stolzl', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* The Mobile Frame - 375px width to match Figma */
.frame-mobile {
    width: 100%;
    max-width: 375px;
    /* Keep Figma scale on desktop, shrink on small mobile */
    min-height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.app-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* Ensure vertical scrolling works */
}

/* Add padding and dynamic height for standalone/PWA mode (home screen app) */
@media (display-mode: standalone) {
    .frame-mobile {
        width: 100%;
        height: 100dvh;
        box-shadow: none;
    }

    .app-content {
        padding-top: calc(20px + env(safe-area-inset-top, 20px));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu {
        padding-top: calc(20px + env(safe-area-inset-top, 20px));
    }
}

/* iOS Safari standalone fallback */
@supports (-webkit-touch-callout: none) {
    @media (display-mode: standalone) {
        .frame-mobile {
            width: 100%;
            height: -webkit-fill-available;
            box-shadow: none;
        }

        .app-content {
            padding-top: calc(20px + env(safe-area-inset-top, 44px));
            padding-bottom: calc(20px + env(safe-area-inset-bottom, 34px));
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .nav-menu {
            padding-top: calc(20px + env(safe-area-inset-top, 44px));
        }
    }
}

/* Slide-out Nav Menu - 216px wide per Figma */
.nav-menu {
    position: absolute;
    top: 0;
    right: -216px;
    width: 216px;
    height: 100%;
    background: #ffffff;
    z-index: 2000;
    padding: 20px 8px 20px 20px;
    box-sizing: border-box;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nav-menu.open {
    right: 0;
}

/* When opened from bottom nav, position items at the bottom */
.nav-menu.from-bottom {
    justify-content: flex-end;
    padding-bottom: 40px;
}

.nav-menu.from-bottom .nav-menu-items {
    padding-top: 0;
    padding-bottom: 20px;
}

.nav-menu.from-bottom .nav-close {
    top: auto;
    bottom: 425px;
}

.nav-menu-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 20px;
    align-items: flex-end;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    padding: 6px 4px 6px 4px;
    text-decoration: none;
    width: fit-content;
}

.nav-item span {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 42px;
    color: #ffffff;
    letter-spacing: -2.24px;
    line-height: 26px;
    white-space: nowrap;
}

.nav-close {
    position: absolute;
    top: 5px;
    left: 12px;
    width: 24px;
    height: 46px;
    background: none;
    border: none;
    font-size: 46px;
    font-weight: 300;
    color: var(--accent-red);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.menu {
    cursor: pointer;
}

/* 1. Nav Bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 38px;
    flex-shrink: 0;
    z-index: 100;
}

.menu {
    width: 29px;
    height: 26.51px;
    cursor: pointer;
    padding: 10px;
    margin: -10px;
    box-sizing: content-box;
    position: relative;
    z-index: 101;
    -webkit-tap-highlight-color: transparent;
}

.profile {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1px;
}

.profile img {
    width: 36px;
    height: 36px;
}

/* 2. Betafish Background */
.betafish-wrapper {
    position: absolute;
    left: calc(50% - 17.82px);
    transform: translateX(-50%);
    top: 80px;
    width: 509.37px;
    height: 597.91px;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.betafish-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 3. Hero Section */
.hero {
    width: 335px;
    height: 440px;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    touch-action: pan-y;
    /* Allow scrolling through hero */
}

.main-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 110px;
    width: 327.53px;
    height: 104.50px;
}

/* Listen Now Button - Figma specs */
.listen-now-button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 230.54px;
    padding: 6px 8px;
    background-color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    animation: pulse 2s infinite ease-in-out;
}

.listen-now-button span {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 40px;
    color: white;
    letter-spacing: -2.1px;
    line-height: 0.64;
    text-align: center;
    display: flex;
    /* Helps with span alignment */
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.1);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* 4. Middle Section */
.middle {
    width: 335px;
    height: 244px;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}

.curated-text {
    position: absolute;
    left: 0;
    top: 160px;
    width: 170px;
    font-family: 'stolzl', sans-serif;
    font-weight: 300;
    font-size: 26px;
    line-height: 1.0;
    letter-spacing: -0.07em;
    color: black;
    margin: 0;
}

/* Red circle for the 'o' in community */
.red-o {
    position: relative;
    color: transparent;
}

.red-o::before {
    content: '';
    position: absolute;
    top: 59%;
    left: 56%;
    transform: translate(-50%, -50%);
    width: 0.55em;
    height: 0.55em;
    background-color: var(--accent-red);
    border-radius: 50%;
}

/* Pit Wheel */
.pit-section {
    position: absolute;
    left: 200px;
    top: 50px;
}

.pit-graphic {
    width: 200px;
    height: 200px;
    animation: spin 12s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 5. Footer Section */
.footer {
    width: 335px;
    height: 250px;
    /* Increased from 176px to add bottom padding */
    position: relative;
    z-index: 30;
    flex-shrink: 0;
}

/* Notification Box - Figma specs */
.notification {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 90px;
    width: 253.2px;
    height: 78px;
    background-color: var(--accent-red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Squiggly Line Decoration */
/* Curved Line Decoration - from Figma */
.notification::before {
    content: '';
    display: block;
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 12px;
    background-image: url('assets/curved-line.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 10;
}

.notification-text {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 36px;
    line-height: 31.2px;
    letter-spacing: -2.52px;
    color: white;
    text-align: center;
    white-space: nowrap;
}

.notification-text p {
    margin: 0;
}

/* Input Row */
.input-row {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 180px;
    width: 253.2px;
    height: 31.2px;
    display: flex;
    align-items: center;
    gap: 8.4px;
}

.phone-input-wrapper {
    width: 220.8px;
    height: 31.2px;
    border: 1px solid black;
    display: flex;
    align-items: center;
    padding: 0 5px;
    box-sizing: border-box;
}

.phone-input {
    width: 100%;
    border: none;
    padding: 0;
    font-family: 'stolzl', sans-serif;
    font-weight: 300;
    font-size: 13.2px;
    line-height: 31.2px;
    letter-spacing: -0.92px;
    color: rgba(0, 0, 0, 0.36);
    outline: none;
    background: transparent;
}

.phone-input::placeholder {
    color: rgba(0, 0, 0, 0.36);
}

.arrow-icon {
    width: 24px;
    height: 24px;
}

/* Page Content Styling */
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.page-title {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 48px;
    color: #000000;
    letter-spacing: -2px;
    text-align: center;
    margin: 0;
}

/* =====================
   LIBRARY PAGE STYLES
   ===================== */

/* Library Hero Section */
.library-hero {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    flex-shrink: 0;
    height: auto;
}

.library-logo {
    width: 272.94px;
    height: 141px;
    object-fit: contain;
}

/* Volume Tabs */
.volume-tabs {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    flex-shrink: 0;
}

.volume-tab {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 24px;
    color: #000000;
    letter-spacing: -1px;
    cursor: pointer;
    position: relative;
    padding-bottom: 1px;
    padding-left: 2px;
    padding-right: 2px;
}

.volume-tab.active {
    text-decoration: none;
    background-color: black;
    color: #ffffff;
}

.filter-wrapper {
    position: relative;
    margin-left: auto;
}

.filter-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.filter-icon:hover {
    opacity: 0.7;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #000000;
    min-width: 150px;
    z-index: 100;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-dropdown.open {
    display: flex;
}

.filter-option {
    font-family: 'stolzl', sans-serif;
    font-weight: 300;
    font-size: 14px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-option:hover {
    background-color: #f0f0f0;
}

.filter-option.active {
    background-color: #000000;
    color: #ffffff;
}

/* Episode List */
.episode-list {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 10px 0;
    flex-shrink: 0;
}

.episode-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}

.episode-source {
    font-family: 'stolzl', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: #000000;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 2px;
    line-height: .5;
}

.episode-badge {
    color: var(--accent-red);
    font-weight: 400;
}

.episode-title {
    font-family: 'stolzl', sans-serif;
    font-weight: 400;
    font-size: 36px;
    color: #000000;
    letter-spacing: -2px;
    line-height: 1;
}

.episode-genres {
    font-family: 'stolzl', sans-serif;
    font-weight: 100;
    font-size: 10px;
    color: #000000;
    letter-spacing: -0.3px;
    padding-top: 2px;

}

/* Library Footer adjustments */
.library-footer {
    margin-top: 100px;
    height: 100px;
    padding-bottom: 20px;

}

.library-footer .notification {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin-bottom: 10px;
}

.library-footer .input-row {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
}

/* Bottom nav for library */
.bottom-nav {
    margin-top: 10px;
}

/* =====================
   THE PIT PAGE STYLES
   ===================== */

.pit-content {
    justify-content: flex-start;
    /* Align to top */
    padding-top: 20px;
}

/* Updated Hero with real asset */
.pit-hero {
    width: 100%;
    max-width: 253px;
    height: 215px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    margin: 0 auto;
}

.pit-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Remove CSS approximation */
.pit-logo-wrapper {
    display: none;
}

.catalog-header {
    width: 90%;
    /* Fluid width */
    max-width: 335px;
    /* Use content width */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.catalog-title {
    font-family: 'stolzl', sans-serif;
    font-size: 36px;
    /* Inferred from visual hierarchy in screenshot and common patterns */
    /* The specific font size for "Catalog" wasn't in the snippet but 48px matches typical header size */
    /* Wait, the text node was 68:118. Let's assume typical header 32-48px. */
    /* Actually, looking at the screenshot, "Catalog" seems similar to other headers. */
    /* Let's stick to standard styling but use the layout we verified. */
    /* Wait, in the MCP code: 
      <text id="68:118" name="Catalog" x="0" y="0" width="313" height="48" />
      Height 48 suggests font size around 48px or line-height. */
    font-weight: 400;
    color: #000;
    line-height: 1;
    letter-spacing: -2px;
}

.catalog-controls {
    display: flex;
    gap: 10px;
    /* Space between controls */
}

/* Control Icons */
.control-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    /* Icons are images now */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: transparent;
}

.control-icon img {
    width: 100%;
    height: 100%;
}

.pit-list {
    width: 85%;
    /* Fluid width */
    max-width: 313px;
    /* From MCP: width="313" */
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* Gap from screenshot/code */
    padding-bottom: 20px;
    flex-shrink: 0;
}

.pit-item {
    display: flex;
    flex-direction: column;
    gap: 0px;
    /* Tighter gap */
    cursor: pointer;
    height: 55px;
    /* From MCP: height="55" */
}

.pit-item-name {
    font-family: 'stolzl', sans-serif;
    font-size: 32px;
    /* Precision from MCP */
    font-weight: 400;
    line-height: 30px;
    /* Precision from MCP */
    color: #000;
    letter-spacing: -2.24px;
    /* Precision from MCP */
    white-space: nowrap;
    text-overflow: ellipsis;
    align-items: flex-start;
}

.pit-item-genre {
    font-family: 'stolzl', sans-serif;
    font-size: 11px;
    /* Precision from MCP */
    font-weight: 300;
    /* Stolzl:Thin */
    color: #000;
    /* #000000 */
    letter-spacing: -0.77px;
    /* Precision from MCP */
    line-height: 26px;
    /* Precision from MCP */
    margin-top: 3px;
    /* Slight visual adjustment */
}