:root {
    color-scheme: light;
    --maroon: #590a10;
    --gold: #efbd60;
    --ivory: #fcf7eb;
    font-family: "Nirmala UI", "Noto Sans Tamil", Latha, sans-serif;
    color: var(--maroon);
    background: var(--ivory)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    user-select: none;
}

button {
    font: inherit
}

.page {
    width: 100%;
    max-width: 1024px;
    margin-inline: auto;
    container-type: inline-size;
    background: radial-gradient(ellipse at center, #fffdf7 0%, #fcf7eb 85%);
    min-height: 100vh
}

.banner {
    height: 25.2cqw;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, #801321, #590710 80%);
    border-bottom: 3px solid var(--gold);
    isolation: isolate
}

.celestial {
    position: absolute;
    inset: 0 0 auto;
    height: 10.7cqw;
    background: url('rasi-reference.png') center top/100% auto no-repeat;
    z-index: -1
}

.banner:before,
.banner:after {
    content: "";
    position: absolute;
    bottom: -1px;
    width: 13cqw;
    height: 15cqw;
    border: 1px solid #d99a2b;
    pointer-events: none;
    z-index: -1
}

.banner:before {
    left: 0;
    border-radius: 0 0 0 100%;
    box-shadow: inset 5px -3px 0 -4px #ffe39a, inset 11px -6px 0 -9px #d99a2b
}

.banner:after {
    right: 0;
    border-radius: 0 0 100% 0;
    box-shadow: inset -5px -3px 0 -4px #ffe39a, inset -11px -6px 0 -9px #d99a2b
}

h1 {
    font-size: 6.2cqw;
    line-height: 1.25;
    margin: 10.8cqw 0 0;
    font-weight: 700;
    color: #ffe39a;
    text-shadow: 0 2px 1px #38050a
}

.banner-star {
    position: absolute;
    top: 14.1cqw;
    color: #f3d481;
    font: 4.2cqw Georgia, serif
}

.star-left {
    left: 9.4%
}

.star-right {
    right: 9.4%
}

.year {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3cqw;
    margin-top: .3cqw;
    color: #ffe39a
}

.year p {
    font: 5.5cqw/1.05 Georgia, "Times New Roman", serif;
    letter-spacing: .55cqw;
    margin: 0
}

.year span {
    width: 14cqw;
    height: 1px;
    position: relative;
    background: linear-gradient(90deg, transparent, #e8b458)
}

.year span:last-child {
    transform: rotate(180deg)
}

.year span:after {
    content: "✦ ◆";
    position: absolute;
    right: -1.8cqw;
    top: -1cqw;
    font-size: 1.5cqw;
    white-space: nowrap
}

.selection {
    padding: 0 3.8cqw 4.2cqw
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2cqw;
    height: 8.7cqw
}

h2 {
    font-size: 3.35cqw;
    line-height: 1.5;
    font-weight: 700;
    margin: 0;
    white-space: nowrap
}

.section-title>span {
    display: flex;
    align-items: center;
    flex: 1;
    color: #c68a26;
    font: 2.4cqw Georgia, serif;
    gap: .3cqw
}

.section-title>span:before {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d99a2b)
}

.section-title>span:last-child {
    transform: scaleX(-1)
}

.rasi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.1cqw
}

.rasi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 26.1cqw;
    padding: 1.1cqw .5cqw 1.1cqw;
    border: 1px solid var(--gold);
    border-radius: 2.1cqw;
    background: linear-gradient(130deg, #fdfaf3, #fcf8ed);
    box-shadow: 0 .7cqw 1.4cqw #b68a3420;
    color: var(--maroon);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    -webkit-tap-highlight-color: transparent
}

.art {
    display: block;
    position: relative;
    overflow: hidden;
    width: 21.5cqw;
    height: auto;
    aspect-ratio: 220/200;
    flex: none;
    mix-blend-mode: multiply
}

.art:before {
    content: "";
    position: absolute;
    width: 465.45455%;
    height: auto;
    aspect-ratio: 2/3;
    left: var(--x);
    top: var(--y);
    background: url('rasi-reference.png') 0 0/100% 100% no-repeat
}

.label {
    display: block;
    font-size: 3.5cqw;
    line-height: 1.4;
    font-weight: 700;
    margin-top: .2cqw;
    white-space: nowrap
}

.rasi-card:focus-visible {
    outline: 3px solid #790d1b;
    outline-offset: 4px
}

@media(hover:hover) {
    .rasi-card:hover {
        transform: translateY(-3px);
        border-color: #b88022;
        box-shadow: 0 9px 22px #9a6c3430
    }
}

.rasi-card:active {
    transform: scale(.985)
}

.status {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 14px 20px;
    border: 1px solid #e8bd69;
    border-radius: 12px;
    background: #590a10;
    color: #fff3ce;
    box-shadow: 0 5px 25px #32040e40;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    z-index: 5
}

.status:empty {
    display: none
}

@media(max-width:599px) {
    .banner {
        height: 34cqw
    }

    .celestial {
        height: 11cqw
    }

    h1 {
        font-size: 6.1cqw;
        margin-top: 13cqw;
        line-height: 1.5
    }

    .year {
        margin-top: 1cqw
    }

    .year p {
        font-size: 7.4cqw
    }

    .banner-star {
        top: 23cqw;
        font-size: 5cqw
    }

    .section-title {
        height: auto;
        min-height: 17cqw;
        gap: 1cqw;
        padding: 3cqw 0
    }

    h2 {
        font-size: 4.4cqw;
        white-space: normal;
        text-align: center;
        max-width: 82%
    }

    .section-title>span {
        font-size: 3cqw
    }

    .selection {
        padding-inline: 4cqw;
        padding-bottom: 7cqw
    }

    .rasi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2.2cqw
    }

    .rasi-card {
        min-height: 29cqw;
        border-radius: 2.5cqw;
        padding: 1.5cqw .4cqw 1.8cqw
    }

    .art {
        width: 24cqw;
        height: auto
    }

    .label {
        font-size: 3.7cqw;
        margin-top: .5cqw
    }

    .status {
        font-size: 14px
    }
}

@media(prefers-reduced-motion:reduce) {
    .rasi-card {
        transition: none
    }
}

/* Match the reference's compact lettering and soften source-image edges. */
h1 {
    transform: scaleX(.82)
}

h2 {
    font-size: 2.75cqw
}

.label {
    transform: scaleX(.88)
}

.banner:before {
    border-width: 0 0 1px 1px
}

.banner:after {
    border-width: 0 1px 1px 0
}

.art {
    mix-blend-mode: normal;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
    mask-composite: intersect
}

@media(max-width:599px) {
    h1 {
        transform: none;
        font-size: 5.1cqw
    }

    h2 {
        font-size: 4.4cqw
    }
}

.app-install-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 10;
}

.app-install-overlay.show {
    display: block;
}

.app-install-popup {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fcf7eb;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    z-index: 11;
    max-width: 100%;
}

.app-install-popup.show {
    display: block;
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.aip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.aip-header h3 {
    margin: 0;
    font-size: 24px;
    color: #590a10;
    font-weight: 700;
}

.aip-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #590a10;
    cursor: pointer;
    padding: 0;
}

.aip-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.aip-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px solid #efbd60;
}

.aip-info {
    flex: 1;
}

.aip-name {
    font-size: 18px;
    font-weight: 700;
    color: #590a10;
    /* margin-bottom: 4px; */
}

.aip-desc {
    font-size: 14px;
    color: #000000;
}

.aip-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 16px 0;
    border-top: 1px solid #e0d5c7;
    border-bottom: 1px solid #e0d5c7;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #590a10;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #020202;
}

.age-badge {
    display: inline-block;
    background: #590a10;
    color: #fcf7eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.aip-btn-open {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: #981414;
    color: #fcf7eb;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.aip-btn-open:link,
.aip-btn-open:visited,
.aip-btn-open:hover,
.aip-btn-open:active {
    color: #fcf7eb;
    background: #981414;
    text-decoration: none;
}