/* หน้า 100 Days: นาฬิกา 1-100 วันอยู่กลางจอ หมุนตามวันที่เลื่อน โทนดำแดงคงที่ไม่เปลี่ยนตามธีม */
:root {
    --accent: #ef4444;
    --on-accent: #fff;
    --bg: #050506;
    --font-ui: 'Prompt', system-ui, sans-serif;
    --dial: clamp(136px, 23vh, 196px);
    /* การ์ด 4:5 กว้างเท่าที่จอสูงพอจะแสดงครบ */
    --card-w: max(216px, min(76vw, 310px, calc((100vh - var(--dial) - 150px) * .8)));
}

@supports (height: 100dvh) {
    :root {
        --card-w: max(216px, min(76vw, 310px, calc((100dvh - var(--dial) - 150px) * .8)));
    }
}

body {
    position: relative;
    color: #fff;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(127, 29, 29, .6), transparent 75%),
        linear-gradient(150deg, #030304, #0b0b0d 55%, #1f0507);
    background-attachment: fixed;
}

.rc-actions {
    position: absolute;
    z-index: 10;
    top: 12px;
    right: var(--gutter);
    display: flex;
    gap: 8px;
}

.rc-btn,
.rc-step {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-family: var(--font-fight);
    font-size: 13px;
    transition: transform .4s var(--spring), background-color .2s, opacity .2s;
}

.rc-btn:active,
.rc-step:active {
    transform: scale(.88);
    transition-duration: .1s;
}

.rc-step:disabled {
    opacity: .3;
    cursor: default;
}

@media (hover: hover) {
    .rc-btn:hover,
    .rc-step:hover:not(:disabled) {
        background: rgba(255, 255, 255, .2);
    }
}

.rc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 14px 0 22px;
}

.rc-title {
    align-self: flex-start;
    padding: 0 104px 0 var(--gutter);
    font-family: var(--font-fight);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: .03em;
    animation: rise .6s var(--ease-out) both;
}

.rc-title span {
    display: block;
    font-size: 24px;
}

.rc-title small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .1em;
    color: #d4d4d8;
}

/* ---------- นาฬิกา ---------- */
.rc-dial-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    animation: rise .6s .05s var(--ease-out) both;
}

.dial {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: var(--dial);
    height: var(--dial);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.dial:active {
    cursor: grabbing;
}

.dial-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    transition: transform .45s cubic-bezier(.25, .8, .3, 1);
    will-change: transform;
}

.dial-ring line {
    stroke: rgba(255, 255, 255, .28);
    stroke-width: 1.4;
    stroke-linecap: round;
    transition: stroke .25s;
}

.dial-ring line.is-major {
    stroke: rgba(255, 255, 255, .6);
    stroke-width: 2;
}

.dial-ring line.is-done {
    stroke: #ef4444;
}

.dial-ring text {
    fill: rgba(255, 255, 255, .62);
    font-family: var(--font-fight);
    font-size: 11px;
    text-anchor: middle;
    dominant-baseline: central;
}

.dial-pointer {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top: 9px solid #ef4444;
    border-bottom: 0;
}

.dial-center {
    text-align: center;
    font-family: var(--font-fight);
    pointer-events: none;
}

.dial-center small {
    display: block;
    font-size: 10px;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: #a1a1aa;
}

.dial-center b {
    display: block;
    font-size: calc(var(--dial) * .27);
    line-height: 1.05;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- การ์ดรูป 4:5 ---------- */
.rc-stage {
    position: relative;
    width: 100%;
    min-height: calc(var(--card-w) * 1.25 + 8px);
    animation: rise .6s .1s var(--ease-out) both;
}

.swiper {
    width: 100%;
    height: calc(var(--card-w) * 1.25 + 8px);
    padding-top: 4px;
}

.swiper-slide.day {
    position: relative;
    aspect-ratio: 4 / 5;
    height: auto;
    overflow: hidden;
    border-radius: 22px;
    background: #17171a;
    border: 1px solid rgba(255, 255, 255, .1);
}

.swiper-slide.day::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
    opacity: .62;
    pointer-events: none;
    transition: opacity .35s ease;
}

.swiper-slide.day.swiper-slide-active {
    border-color: rgba(255, 255, 255, .34);
}

.swiper-slide.day.swiper-slide-active::after {
    opacity: 0;
}

.day img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
}

.day-shade {
    position: absolute;
    inset: 55% 0 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
}

.day-open {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: #0b0b0d;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: transform .45s var(--spring);
}

.day-open:active {
    transform: translateX(-50%) scale(.93);
    transition-duration: .1s;
}

.day-detail {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(14, 14, 17, .97);
    opacity: 0;
    visibility: hidden;
    transform: translateY(26px) scale(.97);
    transition: opacity .2s ease, transform .22s var(--ease-in), visibility 0s .22s;
}

.day-detail.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .22s ease, transform .55s var(--spring), visibility 0s;
}

.day-detail h2 {
    font-family: var(--font-fight);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

.day-detail hr {
    width: 40px;
    height: 2px;
    margin: 8px 0 14px;
    border: 0;
    background: var(--accent);
}

.day-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transition: transform .4s var(--spring);
}

.day-close:active {
    transform: scale(.88);
    transition-duration: .1s;
}

.day-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .3) transparent;
}

.day-scroll h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-family: var(--font-fight);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9ca3af;
}

.day-scroll h3 .icon {
    color: var(--accent);
}

.day-scroll p {
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    white-space: pre-line;
}

.day--skeleton {
    width: var(--card-w);
    aspect-ratio: 4 / 5;
    margin-left: calc(50vw - var(--card-w) / 2);
    border-radius: 22px;
    background: rgba(255, 255, 255, .05);
}

/* ---------- ไม่มีข้อมูล/โหลดไม่ได้ ---------- */
.rc-notice {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    text-align: center;
    color: #a1a1aa;
    font-size: 15px;
}

.rc-notice[hidden] {
    display: none;
}

.rc-notice .btn-primary {
    width: auto;
    min-height: 44px;
    border-radius: 999px;
    font-size: 14px;
}

.rc-notice > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(100%, 320px);
    padding: 32px 24px;
    border: 1px dashed rgba(255, 255, 255, .24);
    border-radius: 24px;
    color: #d4d4d8;
    line-height: 1.55;
    animation: rise .6s var(--ease-out) both;
}

.rc-notice b {
    font-family: var(--font-fight);
    font-size: 44px;
    line-height: 1.1;
    color: #fff;
}

.rc-notice a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-top: 4px;
    padding: 0 20px;
    border-radius: 999px;
    background: #fff;
    color: #0b0b0d;
    font-weight: 500;
}

/* ---------- เกี่ยวกับโปรเจกต์ ---------- */
.rc-about {
    max-width: 620px;
    margin-top: 14px;
    padding: 0 var(--gutter);
    text-align: center;
}

.rc-about p {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    color: #e4e4e7;
}

.rc-about small {
    display: block;
    margin-top: 8px;
    font-family: var(--font-fight);
    font-size: 11px;
    letter-spacing: .2em;
    color: #9ca3af;
}

@media (min-width: 900px) {
    .rc-title {
        position: absolute;
        top: 22px;
        left: 24px;
        padding: 0;
    }

    .rc-title span {
        font-size: 32px;
    }

    .rc-title small {
        font-size: 17px;
    }

    .rc-actions {
        top: 20px;
        right: 24px;
    }

    .rc {
        padding-top: 26px;
        gap: 14px;
    }

    .rc-dial-row {
        gap: 34px;
    }

    .rc-step {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }
}
