@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&display=swap');

:root {
    --brand-bg: #FBF5EA;
    --brand-surface: #FFFFFF;
    --brand-ink: #3A2E27;
    --brand-muted: #8A7B6E;
    --brand-primary: #FF8A5B;
    --brand-primary-ink: #B8461B;
    --brand-primary-dark: #E06A3B;
    --brand-accent: #FFC857;
    --brand-accent-dark: #E8A33D;
    --brand-line: #F0E4D2;

    /* quest-type accents */
    --type-daily: #4DA3FF;
    --type-daily-ink: #1D68C4;
    --type-family: #9B7EDE;
    --type-family-ink: #6A4FBF;
    --type-challenge: #2EC4B6;
    --type-challenge-ink: #14958A;
    --type-special: #FF6B9D;
    --type-special-ink: #D63C74;
    --type-reward: #E8A33D;
    --type-reward-ink: #7A4E10;
    --type-wish: #4CAF7D;
    --type-wish-ink: #2E7D52;

    --brand-radius: 20px;
    --shadow-card: 0 2px 4px rgba(58,38,20,.04), 0 8px 20px rgba(58,38,20,.06);
    --shadow-card-hover: 0 6px 10px rgba(58,38,20,.06), 0 14px 28px rgba(58,38,20,.10);

    --topbar-h: 60px;
    --bottomnav-h: 64px;
    --sidebar-w: 232px;

    /* Dark, steady "home" header */
    --topbar-bg: #2A211B;
    --topbar-bg-2: #362A22;
    --topbar-ink: #F5E9DA;
    --topbar-muted: #C9B8A8;
    --topbar-line: #4A3B30;

    --font-game: "Baloo 2", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at 8% 4%, rgba(255,200,87,.10) 0, transparent 45%),
        radial-gradient(circle at 95% 12%, rgba(255,138,91,.08) 0, transparent 40%),
        var(--brand-bg);
    background-attachment: fixed;
    color: var(--brand-ink);
}

a { color: inherit; }

.font-game { font-family: var(--font-game); }

/* ---------- Shell layout ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
    height: var(--topbar-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, var(--topbar-bg-2) 0%, var(--topbar-bg) 100%);
    border-bottom: 1px solid var(--topbar-line);
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    position: sticky;
    top: 0;
    z-index: 40;
    color: var(--topbar-ink);
}

/* Text/icons sitting directly on the dark bar (not inside their own light
   chip) need to be recolored so they don't get swallowed by the dark bg. */
.app-topbar [data-family-name] { color: var(--topbar-ink); }
.topbar-username { color: var(--topbar-ink); }

.topbar-icon-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: var(--topbar-ink);
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease;
}
.topbar-icon-btn:hover { transform: scale(1.08); background: rgba(255,255,255,.16); }
.notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand-accent);
    border: 1.5px solid var(--topbar-bg);
    box-shadow: 0 0 0 2px rgba(255,200,87,.35);
}

.app-body { flex: 1 1 auto; display: flex; min-height: 0; }

.app-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--brand-surface);
    border-right: 1px solid var(--brand-line);
    padding: 20px 12px;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
}

.sidebar-group-label {
    font-size: .7rem;
    font-weight: 800;
    color: var(--brand-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 16px 10px 6px;
}
.sidebar-group-label:first-child { margin-top: 0; }

.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--brand-ink);
    font-weight: 600;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.sidebar-link:hover { background: var(--brand-bg); transform: translateX(1px); }
.sidebar-link.active {
    background: linear-gradient(90deg, #FFF1E7 0%, #FFF8F0 100%);
    color: var(--brand-primary-ink);
    font-weight: 800;
    border-left-color: var(--brand-primary);
}
.nav-emoji { width: 22px; text-align: center; }

.app-main { flex: 1 1 auto; min-width: 0; padding-bottom: calc(var(--bottomnav-h) + 12px); }

@media (min-width: 768px) {
    .app-main { padding-bottom: 24px; }
}

.app-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: var(--bottomnav-h);
    background: var(--brand-surface);
    border-top: 1px solid var(--brand-line);
    box-shadow: 0 -2px 10px rgba(58,38,20,.05);
    display: flex;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-link {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: .68rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--brand-muted);
    gap: 2px;
    transition: transform .12s ease;
}
.bottomnav-link.active { color: var(--brand-primary-ink); font-weight: 800; transform: translateY(-2px); }

/* ---------- Shared building blocks ---------- */
.card-soft {
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--brand-radius);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card-soft:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }

/* Pink "love/vote" style pill — use for hearts, votes, favorites */
.badge-love {
    background: linear-gradient(180deg, #FFD3E4 0%, #FFB3CF 100%);
    color: var(--type-special-ink);
    border: 1px solid #FF9EC0;
    font-weight: 700;
    border-radius: 999px;
    padding: .28em .75em;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    gap: .3em;
}

.section-title {
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.avatar-chip {
    --chip-color: #FF8A5B;
    width: 34px; height: 34px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--chip-color) 18%, white);
    border: 2px solid var(--chip-color);
    box-shadow: 0 2px 0 color-mix(in srgb, var(--chip-color) 45%, #00000020), 0 3px 6px rgba(0,0,0,.08);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.avatar-chip.lg { width: 56px; height: 56px; font-size: 1.6rem; border-width: 3px; }
.avatar-chip.sm { width: 26px; height: 26px; font-size: .85rem; border-width: 1.5px; box-shadow: 0 1px 0 color-mix(in srgb, var(--chip-color) 45%, #00000020); }

.badge-soft {
    background: var(--brand-bg);
    color: var(--brand-muted);
    border-radius: 999px;
    padding: .28em .75em;
    font-size: .75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .3em;
}

/* Gold "XP" style pill — use on anything awarding experience or coins */
.badge-xp {
    background: linear-gradient(180deg, #FFE3A0 0%, var(--brand-accent) 100%);
    color: #7A4E10;
    border: 1px solid var(--brand-accent-dark);
    font-family: var(--font-game);
    font-weight: 700;
}

/* Small ribbon-style level badge: <span class="level-badge">Lv.8</span> */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    font-family: var(--font-game);
    font-weight: 700;
    font-size: .78rem;
    color: #fff;
    background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    padding: .22em .65em .22em .5em;
    border-radius: 999px 6px 6px 999px;
    box-shadow: 0 2px 0 var(--brand-primary-ink);
}

.btn-brand {
    background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-color: var(--brand-primary-dark);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 0 var(--brand-primary-ink);
    transition: transform .08s ease, box-shadow .08s ease;
}
.btn-brand:hover { background: linear-gradient(180deg, var(--brand-primary-dark) 0%, var(--brand-primary-dark) 100%); border-color: var(--brand-primary-ink); color: #fff; }
.btn-brand:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-primary-ink); }
.btn-brand:disabled { box-shadow: none; opacity: .5; }

.progress-xp {
    height: 14px;
    border-radius: 999px;
    background: var(--brand-line);
    box-shadow: inset 0 2px 3px rgba(58,38,20,.10);
    overflow: hidden;
    position: relative;
}
.progress-xp > .bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #FFDA85 0%, var(--brand-accent) 45%, var(--brand-accent-dark) 100%);
    box-shadow: 0 0 8px rgba(255,200,87,.55);
    position: relative;
    transition: width .3s ease;
}
.progress-xp > .bar::after {
    content: "";
    position: absolute; inset: 1px 1px auto 1px;
    height: 35%;
    background: rgba(255,255,255,.55);
    border-radius: 999px;
}

/* ---------- Home: family house ---------- */
.house-card {
    background:
        radial-gradient(circle at 15% 0%, rgba(255,255,255,.6) 0, transparent 40%),
        linear-gradient(180deg, #FFF6EA 0%, #FDEBD8 60%, #FBE0C4 100%);
    border: 1px solid #F5DEC2;
    border-radius: 26px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.house-card::before {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 14px;
    background: linear-gradient(180deg, rgba(139,168,90,.35), rgba(139,168,90,.55));
    border-top: 2px dashed rgba(139,168,90,.5);
}
.house-roofline {
    font-size: 2.4rem;
    text-align: center;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,.12));
}
.house-members {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 14px 0 6px;
}
.house-member {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: .8rem;
    color: var(--brand-muted);
    text-align: center;
}
.house-member .name { color: var(--brand-ink); font-weight: 700; font-size: .82rem; }

.energy-bar-wrap { max-width: 320px; margin: 10px auto 0; position: relative; z-index: 1; }

.todo-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--brand-line); }
.todo-row:last-child { border-bottom: none; }
.todo-row.done .todo-title { text-decoration: line-through; color: var(--brand-muted); }

.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-primary); box-shadow: 0 0 0 3px rgba(255,138,91,.2); flex: 0 0 auto; margin-top: 6px; }

.wish-card {
    border: 1px solid var(--brand-line);
    border-left: 5px solid var(--type-wish);
    border-radius: 18px;
    padding: 16px;
    background: var(--brand-surface);
    height: 100%;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
}
.wish-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }

/* ---------- Quest board ---------- */
.quest-card {
    border: 1px solid var(--brand-line);
    border-left: 5px solid var(--brand-primary);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--brand-surface);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    transition: transform .12s ease, box-shadow .12s ease, opacity .2s ease;
}
.quest-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.quest-card.done { opacity: .55; }
.quest-card.done .flex-grow-1 { text-decoration: line-through; }

.quest-card--daily { border-left-color: var(--type-daily); }
.quest-card--family { border-left-color: var(--type-family); }
.quest-card--challenge { border-left-color: var(--type-challenge); }
.quest-card--special { border-left-color: var(--type-special); background: linear-gradient(180deg, #FFF9FB 0%, #FFFFFF 30%); }

.quest-type-tag {
    font-family: var(--font-game);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    padding: .18em .55em;
    border-radius: 999px;
    white-space: nowrap;
}
.quest-type-tag--daily { background: var(--type-daily); }
.quest-type-tag--family { background: var(--type-family); }
.quest-type-tag--challenge { background: var(--type-challenge); }
.quest-type-tag--special { background: var(--type-special); }
.quest-type-tag--reward { background: var(--type-reward); }
.quest-type-tag--wish { background: var(--type-wish); }

/* Quest board tabs */
.quest-tabs .nav-link {
    font-family: var(--font-game);
    font-weight: 700;
    color: var(--brand-muted);
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: 999px;
    padding: .45rem 1rem;
    transition: all .15s ease;
}
.quest-tabs .nav-link:hover { color: var(--brand-primary-ink); }
.quest-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-color: var(--brand-primary-dark);
    box-shadow: 0 2px 0 var(--brand-primary-ink);
}

.reward-card {
    border: 1px solid var(--brand-line);
    border-top: 5px solid var(--type-reward);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
    background: var(--brand-surface);
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
}
.reward-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }

/* ---------- Generic list-group (Settings, Notifications) ---------- */
.list-group-item {
    border-radius: 14px !important;
    border: 1px solid var(--brand-line) !important;
    margin-bottom: 8px;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease;
}
.list-group-item:hover { transform: translateX(2px); box-shadow: var(--shadow-card); }

/* Welcome / marketing page touches */
.feature-card { transition: transform .15s ease, box-shadow .15s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

[v-cloak] { display: none; }
