:root {
    --engagement-ink: #080b13;
    --engagement-surface: #10141e;
    --engagement-surface-soft: #151923;
    --engagement-paper: #f6edda;
    --engagement-muted: #aaa5ad;
    --engagement-gold: #c9a66b;
    --engagement-gold-bright: #efd8a6;
    --engagement-line: rgba(239, 216, 166, .18);
}

.daily-journey-launcher[hidden] { display: none !important; }

.daily-journey-launcher {
    box-sizing: border-box;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 6200;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 11px;
    min-width: 220px;
    min-height: 64px;
    border: 1px solid rgba(239, 216, 166, .28);
    border-radius: 16px;
    padding: 9px 13px 9px 10px;
    background: linear-gradient(135deg, rgba(32, 25, 38, .97), rgba(8, 11, 19, .98));
    box-shadow: 0 18px 60px rgba(0, 0, 0, .45), inset 0 1px rgba(255, 255, 255, .04);
    color: var(--engagement-paper);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.daily-journey-launcher:hover {
    border-color: rgba(239, 216, 166, .55);
    box-shadow: 0 20px 68px rgba(0, 0, 0, .55), 0 0 32px rgba(126, 72, 104, .16);
    transform: translateY(-2px);
}

.daily-journey-launcher:focus-visible,
.engagement-dialog button:focus-visible,
.engagement-dialog a:focus-visible,
.engagement-dialog input:focus-visible {
    outline: 2px solid var(--engagement-gold-bright);
    outline-offset: 3px;
}

.daily-launcher-icon {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(239, 216, 166, .25);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #7b4565, #211522 68%);
    color: var(--engagement-gold-bright);
}

.daily-launcher-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    border: 2px solid #17111b;
    border-radius: 999px;
    padding: 0 4px;
    background: var(--engagement-gold-bright);
    color: #171119;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
}

.daily-launcher-copy { display: grid; gap: 2px; }
.daily-journey-launcher small { color: var(--engagement-gold); font-size: 11px; letter-spacing: .14em; }
.daily-journey-launcher b { color: var(--engagement-paper); font-size: 14px; font-weight: 650; }
.daily-journey-launcher em { color: var(--engagement-gold-bright); font-style: normal; }
.daily-journey-launcher > i { color: var(--engagement-gold); font-size: 12px; }

.engagement-dialog {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: grid;
    visibility: hidden;
    place-items: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: visibility 0s linear 240ms, opacity 220ms ease;
}

.engagement-dialog.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.engagement-scrim {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2, 4, 9, .78);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.engagement-panel {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: min(860px, calc(100svh - 48px));
    overflow: auto;
    border: 1px solid rgba(239, 216, 166, .24);
    background: radial-gradient(circle at 90% 0, rgba(101, 56, 88, .2), transparent 30%), linear-gradient(160deg, #121620, #090c14 72%);
    box-shadow: 0 34px 100px rgba(0, 0, 0, .72), inset 0 1px rgba(255, 255, 255, .04);
    color: var(--engagement-paper);
    transform: translateY(18px) scale(.98);
    transition: transform 240ms cubic-bezier(.16, 1, .3, 1);
    scrollbar-color: rgba(201, 166, 107, .45) transparent;
}

.engagement-dialog.is-open .engagement-panel { transform: translateY(0) scale(1); }

.engagement-close {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid rgba(239, 216, 166, .18);
    border-radius: 50%;
    background: rgba(6, 8, 14, .5);
    color: #d7d2d8;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.engagement-close:hover { border-color: var(--engagement-gold); background: rgba(45, 28, 42, .8); color: #fff; }

.daily-journey-panel { padding: 30px; }
.daily-journey-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.daily-journey-header p,
.fate-activity-copy > p { margin: 0 0 8px; color: var(--engagement-gold); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.daily-journey-header h2 { margin: 0; color: var(--engagement-paper); font-family: "Noto Serif TC", "Microsoft JhengHei", serif; font-size: clamp(27px, 4vw, 38px); line-height: 1.28; }
.daily-journey-header span { display: block; margin-top: 10px; color: var(--engagement-muted); font-size: 14px; }

.daily-progress {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 28px 0 10px;
    border-block: 1px solid var(--engagement-line);
    padding: 18px 0;
}

.daily-progress-ring {
    --daily-progress: 0deg;
    position: relative;
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    grid-template-columns: auto auto;
    place-content: center;
    border-radius: 50%;
    background: radial-gradient(circle closest-side, #10141e 77%, transparent 79% 100%), conic-gradient(var(--engagement-gold-bright) var(--daily-progress), rgba(255, 255, 255, .09) 0);
}

.daily-progress-ring b { color: var(--engagement-paper); font-size: 23px; }
.daily-progress-ring small { align-self: end; margin: 0 0 3px 2px; color: var(--engagement-muted); font-size: 11px; }
.daily-progress > div { display: grid; gap: 4px; }
.daily-progress strong { color: var(--engagement-paper); font-size: 17px; }
.daily-progress > div small { color: var(--engagement-gold); font-size: 13px; }

.daily-step-list { display: grid; margin: 0; padding: 0; list-style: none; }
.daily-step-list > li {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 18px 0;
}

.daily-step-state {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(201, 166, 107, .2);
    border-radius: 50%;
    background: rgba(255, 255, 255, .025);
    color: var(--engagement-gold);
    transition: 200ms ease;
}

.daily-step-list li.is-done .daily-step-state { border-color: rgba(239, 216, 166, .58); background: rgba(201, 166, 107, .16); color: var(--engagement-gold-bright); }
.daily-step-list li.is-done .daily-step-state i::before { content: "\f00c"; }
.daily-step-list li.is-done > div:nth-child(2) b { color: #c8c1b6; }
.daily-step-list li > div:nth-child(2) { display: grid; gap: 2px; }
.daily-step-list li > div:nth-child(2) small { color: #797681; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.daily-step-list li > div:nth-child(2) b { color: #f5efe4; font-size: 16px; }
.daily-step-list li > div:nth-child(2) p { margin: 2px 0 0; color: #99949e; font-size: 13px; line-height: 1.5; }
.daily-step-list li > button,
.daily-step-list li > a {
    display: inline-flex;
    min-width: 70px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 166, 107, .32);
    border-radius: 999px;
    padding: 8px 14px;
    background: transparent;
    color: var(--engagement-gold-bright);
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: 200ms ease;
}
.daily-step-list li > button:hover,
.daily-step-list li > a:hover { border-color: var(--engagement-gold-bright); background: rgba(201, 166, 107, .1); color: #fff; }
.daily-step-list li.is-done > button,
.daily-step-list li.is-done > a { border-color: transparent; color: #85818a; pointer-events: none; }

.daily-focus-choices,
.daily-reflection-form { grid-column: 2 / 4; width: 100%; }
.daily-focus-choices { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.daily-focus-choices[hidden], .daily-reflection-form[hidden] { display: none; }
.daily-focus-choices button {
    min-width: 68px;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: #ccc6cc;
    font: inherit;
    cursor: pointer;
    transition: 180ms ease;
}
.daily-focus-choices button:hover,
.daily-focus-choices button.is-active { border-color: var(--engagement-gold); background: rgba(201, 166, 107, .12); color: var(--engagement-gold-bright); }

.daily-reflection-form { padding-top: 8px; }
.daily-reflection-form label { display: block; margin-bottom: 7px; color: #b5afb7; font-size: 13px; }
.daily-reflection-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.daily-reflection-form input {
    min-width: 0;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 10px 13px;
    background: rgba(255, 255, 255, .035);
    color: #fff;
    font: inherit;
    font-size: 15px;
}
.daily-reflection-form button { min-width: 72px; min-height: 46px; border: 1px solid var(--engagement-gold); border-radius: 8px; background: var(--engagement-gold); color: #171119; font: inherit; font-weight: 700; cursor: pointer; }
.daily-reflection-form > small { display: block; min-height: 18px; padding-top: 5px; color: #e5a1a1; font-size: 12px; }

.daily-reward { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 24px; }
.daily-reward > div { display: flex; align-items: center; gap: 12px; }
.daily-reward > div > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: rgba(201, 166, 107, .14); color: var(--engagement-gold-bright); }
.daily-reward p { display: grid; margin: 0; }
.daily-reward p small { color: var(--engagement-muted); font-size: 11px; }
.daily-reward p b { color: var(--engagement-paper); font-size: 15px; }
.fate-activity-primary {
    min-height: 48px;
    border: 1px solid var(--engagement-gold-bright);
    border-radius: 7px;
    padding: 10px 18px;
    background: linear-gradient(120deg, #efd8a6, #ac8148);
    color: #171119;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: filter 200ms ease, transform 200ms ease;
}
.fate-activity-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.daily-reward p b em { color: var(--engagement-gold-bright); font-style: normal; }
.daily-reward-status { color: var(--engagement-gold); font-size: 13px; text-align: right; }

.fate-activity-panel { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); width: min(100%, 940px); overflow: hidden; }
.fate-activity-panel > .engagement-close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.fate-activity-panel figure { position: relative; min-height: 570px; margin: 0; overflow: hidden; background: #0c0e14; }
.fate-activity-panel figure::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, #0c0f17 100%), linear-gradient(0deg, rgba(6, 8, 14, .5), transparent 45%); content: ""; }
.fate-activity-panel img { width: 100%; height: 100%; object-fit: cover; object-position: 66% center; filter: saturate(.72) brightness(.76); }
.fate-activity-copy { display: flex; flex-direction: column; justify-content: center; padding: 72px 42px 42px; }
.fate-activity-copy h2 { margin: 0; color: var(--engagement-paper); font-family: "Noto Serif TC", "Microsoft JhengHei", serif; font-size: clamp(32px, 4vw, 48px); line-height: 1.18; }
.fate-activity-copy > span { display: block; margin-top: 18px; color: #aaa5ad; font-size: 15px; line-height: 1.8; }
.fate-activity-gift { display: flex; align-items: center; gap: 12px; margin: 26px 0 22px; border-block: 1px solid var(--engagement-line); padding: 16px 0; color: var(--engagement-gold-bright); }
.fate-activity-gift > i { font-size: 21px; }
.fate-activity-gift span { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 16px; }
.fate-activity-gift small { color: #9b969e; font-size: 12px; }
.fate-activity-gift b { font-size: 18px; }
.fate-activity-primary { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; }
.fate-activity-later { min-height: 44px; border: 0; background: transparent; color: #8f8a92; font: inherit; font-size: 13px; cursor: pointer; }
.fate-activity-later:hover { color: #d9d4d8; }

@media (max-width: 767.98px) {
    .daily-journey-launcher { right: 10px; bottom: max(82px, calc(68px + env(safe-area-inset-bottom))); min-width: 48px; min-height: 48px; grid-template-columns: 48px; padding: 0; border-radius: 50%; }
    .daily-journey-launcher .daily-launcher-copy,
    .daily-journey-launcher > i { display: none; }
    .daily-launcher-icon { width: 48px; height: 48px; border: 0; }
    .daily-journey-launcher.is-mobile-header-launcher {
        position: static;
        z-index: auto;
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        flex: 0 0 44px;
        grid-template-columns: 44px;
        border-color: rgba(239, 216, 166, .22);
        box-shadow: none;
        transform: none;
    }
    .daily-journey-launcher.is-mobile-header-launcher:hover { transform: none; }
    .daily-journey-launcher.is-mobile-header-launcher .daily-launcher-icon { width: 42px; height: 42px; }
    .mobile-header .daily-journey-launcher.is-mobile-header-launcher { margin-left: auto; margin-right: 6px; }
    .engagement-dialog { align-items: end; padding: 0; }
    .engagement-panel { width: 100%; max-height: min(88dvh, 760px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 20px 20px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); transform: translateY(28px); }
    .daily-journey-panel::before { display: block; width: 42px; height: 4px; margin: -10px auto 18px; border-radius: 99px; background: rgba(255, 255, 255, .28); content: ""; }
    .daily-journey-panel { padding: 24px 18px max(22px, env(safe-area-inset-bottom)); }
    .daily-journey-header { gap: 14px; }
    .daily-journey-header h2 { font-size: 28px; }
    .daily-step-list > li { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 16px 0; }
    .daily-step-state { width: 40px; height: 40px; }
    .daily-step-list li > div:nth-child(2) p { display: none; }
    .daily-step-list li > button, .daily-step-list li > a { min-width: 62px; padding: 8px 11px; }
    .daily-reward { align-items: stretch; flex-direction: column; }
    .daily-reward-status { text-align: left; }
    .fate-activity-panel { display: block; max-height: calc(100svh - 20px); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .fate-activity-panel figure { min-height: 270px; max-height: 36svh; }
    .fate-activity-panel figure::after { background: linear-gradient(0deg, #0c0f17 0, transparent 58%); }
    .fate-activity-panel img { object-position: 60% 34%; }
    .fate-activity-copy { padding: 12px 22px 8px; }
    .fate-activity-copy h2 { max-width: 290px; font-size: 32px; }
    .fate-activity-copy > span { margin-top: 12px; font-size: 14px; line-height: 1.65; }
    .fate-activity-gift { margin: 18px 0 16px; padding: 12px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .daily-journey-launcher,
    .engagement-dialog,
    .engagement-panel,
    .engagement-dialog button,
    .engagement-dialog a { scroll-behavior: auto; transition: none !important; }
}
