:root {
    --bg-red: #7b0000;
    --card-red: #a50000;
    --gold: #ffd700;
    --white: #ffffff; /* Simplified Font Scale */
    --size-hero: 120px;
    --size-l1: 1.3em;
    --size-l2: 1.1em;
    --size-l3: 0.8em;
    --size-l4: 0.75em;
    --size-micro: 0.65em;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevents side-scrolling */
    height: 100%; /* Fixed height */
}

body {
    background-color: var(--bg-red);
    color: var(--white);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    /* Change center to flex-start to remove top space */
    justify-content: flex-start;
    align-items: center;

    /* Use min-height but allow the content to dictate height */
    margin: 0;

    /* Add this to handle modern phone notches/status bars */
    padding-top: env(safe-area-inset-top, 10px);

    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

body.rendered {
    opacity: 1;
}

.banner-item {
    grid-column: span 3;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Remove any extra margin or padding here */
    padding: 0;
    margin-bottom: 5px;
}

#banner-svg {
    width: 100%; /* Fills the 3-column span */
    height: auto;
    display: block;
    overflow: visible;
}

#banner-text-path {
    fill: var(--gold);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.bento-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 12px;
    width: 95%;
    max-width: 420px;
    /* Reduce this padding to tighten the top gap */
    padding: 10px 20px 20px 20px;
}

.tile {
    background: var(--card-red);
    border: 1.5px solid var(--gold);
    border-radius: 24px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.tile-large {
    grid-column: span 3;
}
.tile-gold {
    background: var(--gold);
    color: var(--bg-red);
    border: none;
}
.tile-gold .label {
    color: rgba(123, 0, 0, 0.7);
}
.label {
    font-size: var(--size-l4); /* Unified label size */
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 4px;
}
#greeting {
    font-weight: bold;
    font-size: 1em; /* Standardized to baseline */
}
#weekday-name {
    font-size: var(--size-l2);
    font-weight: bold;
    text-transform: capitalize;
}
#moon-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
} /* The Container */
.lunar-header {
    display: flex;
    align-items: center;
    justify-content: center;
} /* The Day Box - This is your "Anchor" */
.lunar-day-box {
    min-width: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
} /* The Number */
.lunar-day {
    font-family: ui-serif, "New York", "Georgia", "Times New Roman", serif;
    font-size: var(--size-hero);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    user-select: none;
    outline: none;
} /* The Arrows */
.nav-arrow {
    background: none;
    border: none;
    color: white;
    padding: 0 25px;
    margin: 0;
    cursor: pointer;
    font-size: 50px;
    opacity: 0.25;
    outline: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .nav-arrow:hover {
        opacity: 1;
        transform: scale(1.1);
    }
}
.nav-arrow:focus {
    opacity: 0.25;
    transform: none;
}
.nav-arrow:active {
    opacity: 1;
    transform: scale(0.9);
}
#luck-badge,
.hour-pill {
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: bold;
}
#luck-badge {
    font-size: var(--size-l4);
}
.hour-pill {
    font-size: var(--size-micro);
    letter-spacing: 0.02em;
    opacity: 0.9;
}
.luck-good {
    background-color: rgba(255, 215, 0, 0.2);
    color: var(--gold);
}
.luck-bad {
    background-color: rgba(0, 0, 0, 0.4);
    color: #ccc;
}
#lucky-hours {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    justify-items: center;
}
.zodiac-name {
    font-weight: bold;
    font-size: var(--size-l3);
    margin-bottom: 5px;
}
#day-animal-icon,
#month-animal-icon,
#year-animal-icon {
    font-size: 1.8em;
}
#days-counter {
    font-size: var(--size-l1);
    font-weight: bold;
}
#leap-badge {
    display: none;
    background: #ff4d4d;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: var(--size-l4);
    position: absolute;
    top: 12px;
    right: 12px;
}
#solar-date {
    font-size: var(--size-l4);
    opacity: 0.7;
    margin-top: 15px;
    width: 80%;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    padding-top: 10px;
}
#month-name {
    width: 80%;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-size: 1em; /* Kept standard */
}
.floating-item {
    position: fixed;
    bottom: -10%;
    z-index: 1000;
    pointer-events: none;
    animation: float 4s linear forwards;
}
@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}
