/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

:root {
    --c: #D946EF;
    --cl: #FAE8FF;
    --grad: linear-gradient(135deg, #FF6B9D 0%, #D946EF 50%, #9333EA 100%);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --name-w: 112px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #F8F0FF;
    min-height: 100vh;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 44px);
    overflow-x: hidden;
}

/* ── FLOATING BG ── */
#bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.05;
    animation: floatUp var(--dur, 20s) linear infinite var(--delay, 0s);
}

@keyframes floatUp {
    from {
        transform: translateY(110vh) rotate(0deg);
    }

    to {
        transform: translateY(-10vh) rotate(360deg);
    }
}

/* ── HEADER ── */
#header {
    background: var(--grad);
    padding: clamp(44px, 8vw, 64px) 5% clamp(72px, 12vw, 96px);
    text-align: center;
    border-radius: 0 0 clamp(36px, 6vw, 56px) clamp(36px, 6vw, 56px);
    position: relative;
    z-index: 5;
    overflow: hidden;
    transition: background 0.4s;
}

#header::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

#girl-icon {
    display: block;
    font-size: clamp(52px, 12vw, 80px);
    margin-bottom: 6px;
    animation: heroFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0) scale(1) rotate(-2deg);
    }

    50% {
        transform: translateY(-14px) scale(1.07) rotate(2deg);
    }
}

#header h1 {
    color: #fff;
    font-weight: 900;
    letter-spacing: -0.5px;
    font-size: clamp(22px, 6vw, 42px);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    margin: 4px 0 2px;
}

#header-sub {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(12px, 3vw, 15px);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

#star-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 10px 28px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.sb-icon {
    font-size: 30px;
}

#star-count {
    font-size: clamp(32px, 7vw, 44px);
    font-weight: 900;
    color: #fff;
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

#star-count.bump {
    animation: starBump 0.32s ease-out;
}

@keyframes starBump {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.5)
    }
}

.sb-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
}

/* ── WRAPPER ── */
.wrap {
    width: 90%;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* ── GIRL TABS ── */
#girl-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: clamp(-32px, -5vw, -44px) auto 0;
}

.gtab {
    padding: clamp(12px, 3vw, 18px) 10px;
    border-radius: clamp(16px, 3vw, 24px);
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(13px, 3.5vw, 16px);
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: all 0.28s;
    -webkit-tap-highlight-color: transparent;
}

.gtab.active {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
    transform: translateY(-4px);
}

.gtab.inactive {
    background: #fff !important;
    color: #C0C0C0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.gtab-name {
    display: block;
}

.gtab-age {
    display: block;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 500;
    opacity: 0.78;
    margin-top: 2px;
}

/* ── CONTENT ── */
#content {
    padding: 22px 0 16px;
}

/* ── VIEW TOGGLE ── */
#view-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    background: #fff;
    border-radius: 22px;
    padding: 5px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.vtab {
    padding: 10px 6px;
    border-radius: 17px;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(10px, 2.8vw, 12px);
    font-weight: 700;
    color: #BBBBBB;
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.22s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.3;
}

.vtab .ve {
    display: block;
    font-size: clamp(16px, 4vw, 20px);
    margin-bottom: 2px;
}

.vtab.active {
    background: var(--grad);
    color: #fff;
}

/* ── PERIOD TABS ── */
#period-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    background: #fff;
    border-radius: 22px;
    padding: 5px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.ptab {
    padding: 10px 4px;
    border-radius: 17px;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(9px, 2.5vw, 11px);
    font-weight: 700;
    color: #BBBBBB;
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.22s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.3;
}

.ptab .pe {
    display: block;
    font-size: clamp(16px, 4vw, 20px);
    margin-bottom: 2px;
}

.ptab.active {
    color: #fff;
}

/* ── ALL DONE BANNER ── */
#all-done-banner {
    display: none;
    text-align: center;
    background: var(--grad);
    color: #fff;
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 16px;
    font-weight: 800;
    font-size: clamp(13px, 3.5vw, 16px);
    animation: popIn 0.4s cubic-bezier(.34, 1.56, .64, 1) both;
}

#all-done-banner.show {
    display: block;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.82);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── CALENDAR NAV ── */
#cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--cl);
    color: var(--c);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    transition: all 0.18s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.cal-nav-btn:active {
    transform: scale(0.9);
}

#cal-nav-label {
    font-size: clamp(11px, 3vw, 14px);
    font-weight: 700;
    color: #333;
    text-align: center;
    flex: 1;
    padding: 0 8px;
}

/* ══════════════════════════════════════
   CALENDAR GRID
══════════════════════════════════════ */
.cal-wrap {
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
}

/* Scroll container for when it overflows */
.cal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Sticky name column */
.cal-head-name {
    width: var(--name-w);
    min-width: var(--name-w);
    padding: 12px 10px 10px 14px;
    border-bottom: 2px solid #F3F3F3;
    border-right: 2px solid #F0F0F0;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 3;
    vertical-align: bottom;
}

.cal-head-meta {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #DDDDDD;
}

.cal-head-count {
    font-size: 16px;
    font-weight: 900;
    color: var(--c);
    margin-top: 1px;
}

.cal-head-count span {
    font-size: 11px;
    font-weight: 600;
    color: #CCCCCC;
}

/* Day header cells */
.cal-head-cell {
    text-align: center;
    padding: 10px 4px 10px;
    border-bottom: 2px solid #F3F3F3;
    vertical-align: bottom;
}

.cal-day-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: #CCCCCC;
    display: block;
    line-height: 1;
}

.cal-day-sub {
    font-size: 9px;
    font-weight: 600;
    color: #DDDDDD;
    margin-top: 3px;
    display: block;
}

.cal-head-cell.today-col .cal-day-label {
    color: var(--c);
    background: var(--cl);
    border-radius: 20px;
    padding: 3px 5px;
    display: inline-block;
}

.cal-head-cell.today-col .cal-day-sub {
    color: var(--c);
}

/* Chore name cell */
.cal-chore-cell {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    width: var(--name-w);
    min-width: var(--name-w);
    padding: 11px 8px 11px 14px;
    border-right: 2px solid #F0F0F0;
    vertical-align: middle;
    cursor: default;
}

.cal-chore-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-chore-emoji {
    font-size: 15px;
    flex-shrink: 0;
}

.cal-chore-text {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Zebra striping */
.cal-row:nth-child(even) .cal-chore-cell,
.cal-row:nth-child(even) .cal-check-cell {
    background: #FAFAFA;
}

.cal-row:nth-child(even) .cal-chore-cell {
    background: #FAFAFA;
}

/* Row separator */
.cal-row:not(:last-child) .cal-chore-cell,
.cal-row:not(:last-child) .cal-check-cell {
    border-bottom: 1px solid #F5F5F5;
}

/* Check cells */
.cal-check-cell {
    text-align: center;
    padding: 8px 3px;
    vertical-align: middle;
    -webkit-tap-highlight-color: transparent;
}

.cal-check-cell.clickable {
    cursor: pointer;
}

.cal-check-cell.clickable:active .cal-dot {
    transform: scale(0.88);
}

.cal-check-cell.future-cell {
    pointer-events: none;
}

.cal-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    transition: all 0.18s;
    background: #F4F4F4;
    border: 2px solid #EBEBEB;
    color: transparent;
}

.cal-dot.done {
    background: var(--c);
    border-color: var(--c);
    color: #fff;
}

.cal-dot.today-dot:not(.done) {
    border-color: var(--c);
    background: var(--cl);
}

.cal-dot.future {
    opacity: 0.28;
}

/* Period legend row at bottom of table */
.cal-legend-row td {
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 600;
    color: #CCCCCC;
    border-top: 2px solid #F3F3F3;
}

/* ═══════════════════════════
   CHECKLIST VIEW
═══════════════════════════ */
.sec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.sec-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #C8C8C8;
    white-space: nowrap;
}

.sec-tally {
    font-size: 10px;
    font-weight: 800;
    color: #CCCCCC;
    white-space: nowrap;
}

.sec-line {
    flex: 1;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(to right, #EBEBEB, transparent);
}

.chore-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 28px;
}

.chore-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 18px;
    padding: clamp(11px, 2.5vw, 15px) clamp(12px, 3vw, 18px);
    border: 2.5px solid #F0F0F0;
    transition: all 0.22s;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: slideIn 0.28s ease-out both;
}

.chore-card:active {
    transform: scale(0.96);
}

.chore-card.done {
    border-color: var(--c);
    background: var(--cl);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cc-check {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    border: 2.5px solid #DDDDDD;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    transition: all 0.22s;
    color: #fff;
    background: #fff;
}

.done .cc-check {
    background: var(--c);
    border-color: var(--c);
}

.cc-emoji {
    font-size: clamp(22px, 5vw, 28px);
    flex-shrink: 0;
}

.cc-name {
    flex: 1;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 600;
    color: #2E2E2E;
    line-height: 1.3;
    transition: all 0.22s;
}

.done .cc-name {
    text-decoration: line-through;
    color: #C0C0C0;
}

.cc-stars {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 800;
    background: #F2F2F2;
    color: #AAAAAA;
    flex-shrink: 0;
    transition: all 0.22s;
    white-space: nowrap;
}

.done .cc-stars {
    background: var(--c);
    color: #fff;
}

/* ═══════════════════════════
   REWARDS VIEW
═══════════════════════════ */
#rewards-panel {
    background: #fff;
    border-radius: 24px;
    padding: clamp(18px, 4vw, 26px);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

#rewards-panel h2 {
    font-size: clamp(17px, 4.5vw, 22px);
    font-weight: 900;
    color: #1A1A1A;
    margin-bottom: 3px;
}

.rew-sub {
    font-size: 12px;
    color: #BBBBBB;
    font-weight: 500;
    margin-bottom: 4px;
}

.rgroup-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin: 20px 0 10px;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    color: #fff;
}

.reward-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: clamp(11px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
    border-radius: 16px;
    border: 2.5px solid #EEEEEE;
    background: #FAFAFA;
    margin-bottom: 9px;
    transition: all 0.25s;
}

.reward-card.unlocked {
    border-color: var(--c);
    background: var(--cl);
}

.rc-emoji {
    font-size: clamp(20px, 5vw, 26px);
    flex-shrink: 0;
}

.rc-body {
    flex: 1;
    min-width: 0;
}

.rc-name {
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 600;
    color: #AAAAAA;
    line-height: 1.3;
}

.reward-card.unlocked .rc-name {
    color: #222;
}

.rc-cost {
    padding: 5px 11px;
    border-radius: 20px;
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 800;
    flex-shrink: 0;
    background: #E8E8E8;
    color: #BBBBBB;
    white-space: nowrap;
}

.reward-card.unlocked .rc-cost {
    background: var(--c);
    color: #fff;
}

.rc-prog {
    margin-top: 6px;
}

.prog-bar {
    height: 5px;
    background: #EBEBEB;
    border-radius: 10px;
    overflow: hidden;
}

.prog-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--grad);
    transition: width 0.7s cubic-bezier(.25, .46, .45, .94);
}

.prog-text {
    font-size: 10px;
    color: #CCCCCC;
    font-weight: 600;
    margin-top: 3px;
}

/* ═══════════════════════════
   BILLS BANNER
═══════════════════════════ */
#bills-banner {
    background: linear-gradient(135deg, #C60C30 0%, #00338D 100%);
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.bb-icon {
    font-size: 30px;
    flex-shrink: 0;
}

.bb-text {
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 800;
    color: #fff;
}

.bb-sub {
    font-size: clamp(10px, 2.5vw, 12px);
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    margin-top: 2px;
}

/* ═══════════════════════════
   HOW IT WORKS
═══════════════════════════ */
#how {
    background: linear-gradient(135deg, #FFFDE7, #FFF8E1);
    border: 2px solid #FFE082;
    border-radius: 22px;
    padding: clamp(16px, 4vw, 22px);
    margin-bottom: 18px;
}

#how h3 {
    font-size: clamp(13px, 3.5vw, 15px);
    font-weight: 800;
    color: #F9A825;
    margin-bottom: 12px;
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.how-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 13px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hi-e {
    font-size: clamp(18px, 4vw, 22px);
}

.hi-l {
    font-size: 10px;
    color: #AAAAAA;
    font-weight: 600;
}

.hi-s {
    font-size: clamp(13px, 3vw, 15px);
    font-weight: 900;
    color: #2E2E2E;
}

/* ═══════════════════════════
   MISC
═══════════════════════════ */
#moto {
    text-align: center;
    padding: 8px 0 6px;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 700;
    color: #C8C8C8;
}

#parent-area {
    text-align: center;
    padding: 6px 0 4px;
}

#parent-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #DDDDDD;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

/* ═══════════════════════════
   MODAL
═══════════════════════════ */
#modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#modal-bg.open {
    display: flex;
}

#modal {
    background: #fff;
    border-radius: 28px;
    padding: 28px 24px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    animation: popIn 0.35s cubic-bezier(.34, 1.56, .64, 1);
}

#modal h2 {
    font-size: 18px;
    font-weight: 900;
    color: #222;
    margin-bottom: 6px;
}

#modal p {
    font-size: 13px;
    color: #999;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn:active {
    transform: scale(0.97);
}

.modal-btn.danger {
    background: #FEE2E2;
    color: #EF4444;
}

.modal-btn.safe {
    background: #F3F4F6;
    color: #888;
}

/* ═══════════════════════════
   ANIMATIONS
═══════════════════════════ */
.star-burst {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: sbAnim 0.9s ease-out forwards;
    font-size: 30px;
}

@keyframes sbAnim {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }

    45% {
        opacity: 1;
        transform: translate(-50%, -160%) scale(1.9);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -260%) scale(1.1);
    }
}

.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: cFall var(--cd) linear forwards;
}

@keyframes cFall {
    0% {
        opacity: 1;
        transform: translateY(-10px) rotate(0deg) translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg) translateX(var(--cx));
    }
}

/* ═══════════════════════════
   RESPONSIVE TWEAKS
═══════════════════════════ */
@media (max-width: 380px) {
    :root {
        --name-w: 96px;
    }

    .cal-dot {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .how-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 600px) {
    :root {
        --name-w: 140px;
    }

    .cal-dot {
        width: 34px;
        height: 34px;
    }

    .cal-head-cell {
        padding: 12px 6px;
    }
}