.moon-phase-page {
    overflow-y: auto;
    overflow-x: hidden;
}

.moon-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

/* Hero Section */
.moon-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

/* Desktop: 3-column layout */
@media (min-width: 961px) {
    .moon-hero {
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 3rem;
    }
}

/* Moon Visual (Left on desktop) */
.moon-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.moon-sphere {
    width: min(280px, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #1e2028 0%, #12141b 55%, #07090f 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(147, 112, 219, 0.2);
    transition: transform 0.3s ease;
}

@media (min-width: 961px) {
    .moon-sphere {
        width: 320px;
    }
}

.moon-sphere::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #f9f2dc 0%, #d6c3a0 55%, #9b845f 100%);
    transform: translateX(var(--phase-x, 0%));
    transition: transform 0.5s ease;
}

.moon-sphere.use-svg-moon::after {
    content: none !important;
}

.moon-sphere.use-svg-moon {
    background: none !important;
}

.moon-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Moon Center (Date & Navigation) */
.moon-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 961px) {
    .moon-center {
        gap: 1rem;
    }
}

.moon-caption {
    text-align: center;
}

.moon-caption h1 {
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0 0 0.3rem;
    color: rgba(255, 255, 255, 0.9);
}

.moon-caption p {
    margin: 0;
    color: rgba(224, 212, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 300;
}

/* Mobile: Wheel Picker (default visible) */
.date-picker-mobile {
    width: 100%;
    max-width: 300px;
}

.date-picker-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.date-picker-label span {
    font-size: 0.75rem;
    color: rgba(224, 212, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-today {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 300;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-today:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 1);
}

.date-wheel-wrapper {
    position: relative;
    height: 120px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: transparent;
}

.date-wheel {
    position: absolute;
    width: 100%;
    padding: 40px 0;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    cursor: grab;
    user-select: none;
}

.date-wheel.grabbing {
    cursor: grabbing;
    transition: none;
}

.date-wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    font-weight: 300;
}

.date-wheel-item.active {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.date-wheel-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    transform: translateY(-50%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* Desktop: Arrow Navigation (hidden by default) */
.date-picker-desktop {
    display: none;
}

@media (min-width: 961px) {
    .date-picker-mobile {
        display: none;
    }

    .date-picker-desktop {
        display: flex;
        align-items: center;
        gap: 1rem;
        justify-content: center;
    }

    .btn-date-nav {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 1.5rem;
        font-weight: 300;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 4px;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-date-nav:hover {
        border-color: rgba(255, 255, 255, 0.4);
        color: rgba(255, 255, 255, 1);
        transform: scale(1.05);
    }

    .btn-today-desktop {
        padding: 0.4rem 1.2rem;
        font-size: 0.8rem;
        font-weight: 300;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 4px;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-today-desktop:hover {
        border-color: rgba(255, 255, 255, 0.4);
        color: rgba(255, 255, 255, 1);
    }
}

/* Moon Data (Right on desktop) - Clean, no boxes */
.moon-data {
    display: grid;
    gap: 1.2rem;
}

@media (min-width: 961px) {
    .moon-data {
        gap: 1.5rem;
        justify-content: end;
        min-width: 200px;
    }
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.data-label {
    font-size: 0.7rem;
    color: rgba(224, 212, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 300;
}

.data-value {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

@media (min-width: 961px) {
    .data-value {
        font-size: 1rem;
    }
}

/* Sections */
.calendar-section,
.phases-section,
.orbit-section {
    margin-top: 5rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 300;
    margin: 0 0 0.3rem;
    color: rgba(255, 255, 255, 0.9);
}

.section-subtitle {
    color: rgba(224, 212, 255, 0.5);
    margin-bottom: 2rem;
    font-size: 0.85rem;
    font-weight: 300;
}

/* Calendar - Full width */
.calendar-wrapper {
    display: flex;
    justify-content: center;
}

.calendar-card {
    width: 100%;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1.2rem;
    background: transparent;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}

.calendar-nav {
    display: flex;
    gap: 0.3rem;
}

.btn-nav {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
}

.calendar-weekdays {
    margin-bottom: 0.4rem;
}

.weekday {
    text-align: center;
    font-size: 0.65rem;
    color: rgba(224, 212, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem;
}

.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.3rem 0.2rem;
    min-width: 0;
    overflow: hidden;
}

.day:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
}

.day.is-outside {
    opacity: 0.2;
    cursor: default;
}

.day.is-outside:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.08);
    background: transparent;
}

.day.is-today {
    border-color: rgba(255, 255, 255, 0.3);
}

.day.is-selected {
    border-color: rgba(224, 212, 255, 0.5);
    background: rgba(147, 112, 219, 0.1);
}

.day-number {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.moon-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #1e2028 0%, #12141b 60%, #07090f 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 6px rgba(147, 112, 219, 0.2);
}

.moon-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #f9f2dc 0%, #d6c3a0 60%, #9b845f 100%);
    transform: translateX(var(--phase-x, 0%));
    transition: transform 0.6s ease;
}

.moon-icon.use-svg-moon::after {
    content: none !important;
}

.moon-icon.use-svg-moon {
    background: none !important;
}

/* Phase Diagram */
.phase-diagram {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.phase-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: all 0.2s ease;
}

.phase-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
}

.phase-card h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
}

.phase-card p {
    margin: 0;
    color: rgba(224, 212, 255, 0.5);
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 300;
}

.phase-card .moon-icon {
    width: 36px;
    height: 36px;
    align-self: center;
}

/* Footnote */
.footnote {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(224, 212, 255, 0.4);
    font-size: 0.75rem;
    text-align: center;
    font-weight: 300;
}

/* Responsive Design */
@media (max-width: 640px) {
    .moon-container {
        padding: 1rem 1rem 3rem;
    }

    .moon-sphere {
        width: min(220px, 70vw);
    }

    .moon-caption h1 {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .phase-diagram {
        grid-template-columns: 1fr;
    }

    .calendar-days,
    .calendar-weekdays {
        gap: 0.3rem;
    }

    .day {
        padding: 0.2rem 0.1rem;
    }

    .day-number {
        font-size: 0.7rem;
    }

    .moon-icon {
        width: 16px;
        height: 16px;
    }
}

/* Orbit Diagram */
.orbit-section {
    margin-top: 5rem;
}

.orbit-diagram {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.orbit-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 640px) {
    .orbit-diagram {
        padding: 1rem 0;
    }
}
