/* ═══════════════════════════════════════════════════════════════════════
   DAILY CHECK-IN — Multi-step overlay (24-hour reset)
   Steps: Greeting → Mood → Streak → Celebration → Reward
   ═══════════════════════════════════════════════════════════════════════ */

/* Full-screen overlay */
.checkin-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(8, 6, 18, 0.94);
    animation: checkinFadeIn 0.4s ease;
}
@keyframes checkinFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Full-screen modal (takes up entire viewport) */
.checkin-modal {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 1.75rem;
    width: 100%; height: 100%;
    border-radius: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(168, 139, 250, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(212, 175, 55, 0.06) 0%, transparent 40%),
        linear-gradient(170deg, rgba(30, 24, 55, 0.98), rgba(15, 12, 30, 1));
    border: none;
    box-shadow: none;
    animation: checkinSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
@keyframes checkinSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Steps container ── */
.checkin-step {
    display: none;
    flex-direction: column; align-items: center;
    width: 100%;
    animation: checkinStepIn 0.4s ease;
}
.checkin-step--active {
    display: flex;
}
@keyframes checkinStepIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.checkin-step__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem;
    text-align: center;
    letter-spacing: 0.02em;
}
.checkin-step__sub {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    line-height: 1.5;
    margin: 0 0 1.25rem;
    max-width: 280px;
}

/* ── Primary action button ── */
.checkin-btn {
    width: 100%;
    padding: 0.85rem 0;
    border-radius: 16px;
    border: none;
    background: rgba(167, 139, 250, 0.15);
    color: #d4b4ff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    margin-top: 0.75rem;
    -webkit-tap-highlight-color: transparent;
}
.checkin-btn:hover {
    background: rgba(167, 139, 250, 0.25);
    box-shadow: 0 4px 24px rgba(167, 139, 250, 0.2);
}
.checkin-btn:active { transform: scale(0.97); }

.checkin-btn--gold {
    background: linear-gradient(135deg, var(--color-gold), #c084fc);
    color: #fff;
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.3);
}
.checkin-btn--gold:hover {
    box-shadow: 0 6px 32px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

/* ═════════════════════════════════════════
   STEP 1 — Pet Greeting (highlight ring)
   ═════════════════════════════════════════ */
.checkin-pet-ring {
    position: relative;
    width: 180px; height: 180px;
    margin-bottom: 1rem;
}
.checkin-pet-ring__frame {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    z-index: 2;
}
.checkin-pet-ring__pet {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 62%; height: 62%;
    object-fit: contain;
    z-index: 1;
    animation: checkinPetBounce 2.5s ease-in-out infinite;
}
@keyframes checkinPetBounce {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50%      { transform: translate(-50%, -50%) translateY(-5px); }
}

/* ═════════════════════════════════════════
   STEP 2 — Mood Selection
   ═════════════════════════════════════════ */
.checkin-moods {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}
.checkin-mood {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 0.4rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.checkin-mood img {
    width: 48px; height: 48px;
    object-fit: contain;
    transition: transform 0.2s;
}
.checkin-mood__label {
    font-family: var(--font-display);
    font-size: 0.5rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
}
.checkin-mood:hover {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.2);
}
.checkin-mood:hover img { transform: scale(1.1); }
.checkin-mood:active { transform: scale(0.93); }

/* Selected mood */
.checkin-mood--selected {
    border-color: rgba(167, 139, 250, 0.6);
    background: rgba(167, 139, 250, 0.12);
}
.checkin-mood--selected img { transform: scale(1.15); }
.checkin-mood--selected .checkin-mood__label { color: #c084fc; }

/* ═════════════════════════════════════════
   STEP 3 — Streak Row (badge images)
   ═════════════════════════════════════════ */
.checkin-streak-count {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 0.25rem;
}
.checkin-streak-count__flame {
    width: 48px; height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255, 165, 0, 0.5))
            drop-shadow(0 0 24px rgba(212, 175, 55, 0.3));
    margin-bottom: 0.25rem;
    animation: flameFloat 2s ease-in-out infinite;
}
@keyframes flameFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
}
.checkin-streak-count__num {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 30px rgba(168, 139, 250, 0.3), 0 0 60px rgba(212, 175, 55, 0.15);
    animation: streakNumPop 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes streakNumPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.checkin-streak-count__label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
}

/* Badge row */
.checkin-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.15rem;
}
.checkin-badge {
    width: 38px; height: 38px;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.checkin-badge--today {
    transform: scale(1.2);
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.6))
            drop-shadow(0 0 24px rgba(167, 139, 250, 0.3));
    animation: checkinBadgeFloat 2s ease-in-out infinite;
}
@keyframes checkinBadgeFloat {
    0%, 100% { transform: scale(1.2) translateY(0); }
    50%      { transform: scale(1.25) translateY(-3px); }
}

/* Day letters row */
.checkin-badges__letters {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    width: 100%;
}
.checkin-badges__letters span {
    width: 38px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

/* ── Streak repair ── */
.checkin-repair {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.06), rgba(243, 156, 18, 0.06));
    border: 1px solid rgba(167, 139, 250, 0.12);
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: center;
}
.checkin-repair__icon {
    width: 48px; height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(167, 139, 250, 0.3));
}
.checkin-repair__info {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.checkin-repair__msg {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
.checkin-repair__btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 1.2rem;
    border-radius: 10px;
    border: 1.5px solid rgba(167, 139, 250, 0.25);
    background: rgba(167, 139, 250, 0.1);
    color: #c084fc;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.checkin-repair__btn:hover {
    background: rgba(167, 139, 250, 0.18);
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.15);
}
.checkin-repair__btn:active { transform: scale(0.95); }
.checkin-repair__cost {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* ═════════════════════════════════════════
   STEP 4 — Chest Reward Sequence
   ═════════════════════════════════════════ */
.checkin-chest {
    position: relative;
    width: 180px; height: 180px;
    margin: 2rem auto 1.5rem;
    display: flex; align-items: center; justify-content: center;
}
.checkin-chest__closed,
.checkin-chest__open {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: contain;
}
/* Closed chest: idle wobble */
.checkin-chest__closed {
    animation: chestWobble 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 16px rgba(167, 139, 250, 0.3));
}
@keyframes chestWobble {
    0%, 100% { transform: rotate(-1deg) scale(1); }
    50%      { transform: rotate(1deg) scale(1.02); }
}
/* Open chest: burst in */
.checkin-chest__open {
    filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.5));
}
.checkin-chest--opening .checkin-chest__open {
    animation: chestOpen 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chestOpen {
    from { opacity: 0; transform: scale(0.7) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Confetti container */
.checkin-chest__confetti {
    position: absolute;
    inset: -60px;
    pointer-events: none;
    z-index: 5;
}
.checkin-confetti-particle {
    position: absolute;
    border-radius: 2px;
    pointer-events: none;
}

/* Star that rises from chest */
.checkin-chest__star-wrap {
    position: absolute;
    top: -90px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 10;
    animation: chestStarRise 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes chestStarRise {
    from { opacity: 0; transform: translateX(-50%) translateY(70px) scale(0.3); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.checkin-chest__star {
    width: 64px; height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.7))
            drop-shadow(0 0 32px rgba(167, 139, 250, 0.4));
    animation: chestStarPulse 1.5s ease-in-out infinite;
}
@keyframes chestStarPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.1) rotate(5deg); }
}
.checkin-chest__pts {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Glow burst behind chest on open */
.checkin-chest--opening::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 200px; height: 200px;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), rgba(167, 139, 250, 0.15), transparent 70%);
    animation: chestGlow 0.8s ease-out forwards;
    z-index: 0;
}
@keyframes chestGlow {
    from { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    to   { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 374px) {
    .checkin-modal { padding: 1.5rem 1rem 1.25rem; width: 100%; height: 100%; }
    .checkin-pet-ring { width: 140px; height: 140px; }
    .checkin-mood img { width: 38px; height: 38px; }
    .checkin-moods { gap: 0.3rem; }
    .checkin-streak-count__num { font-size: 3.5rem; }
    .checkin-streak-count__flame { width: 36px; height: 36px; }
    .checkin-badge { width: 32px; height: 32px; }
    .checkin-badges__letters span { width: 32px; }
    .checkin-chest { width: 130px; height: 130px; }
    .checkin-chest__star { width: 44px; height: 44px; }
    .checkin-chest__pts { font-size: 0.9rem; }
}

/* Constrain content within full-screen modal */
.checkin-step {
    max-width: 380px;
}

