/* ================================================================
   home.css — Nihongo Planet student dashboard (home.html)
   Hero + featured Continue Learning card + course grid +
   activity timeline + quick actions. Depends on platform.css vars.
   ================================================================ */

/* ---------- layout ---------- */
.hp { scroll-behavior: smooth; }

.hp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.hp-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 1.25rem;
    align-items: start;
    margin-top: 2rem;
}

#coursesSection, #activitySection, #quickSection { scroll-margin-top: 90px; }

.hp-hero-grid.hp-solo { grid-template-columns: 1fr; }

/* ---------- entrance motion ---------- */
@keyframes hp-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hp-enter { opacity: 0; animation: hp-rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.hp-enter[data-d="2"] { animation-delay: 0.08s; }
.hp-enter[data-d="3"] { animation-delay: 0.16s; }
.hp-enter[data-d="4"] { animation-delay: 0.24s; }

@keyframes hp-grow { from { width: 0; } }

/* ---------- hero / courses separation ---------- */
.hp-divider {
    position: relative;
    height: 1px;
    margin: 2.5rem 0 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(247, 109, 142, 0.55) 30%,
        rgba(255, 159, 104, 0.45) 70%,
        transparent 100%);
    box-shadow: 0 0 18px rgba(247, 109, 142, 0.35);
}

.hp-divider-gem {
    position: absolute;
    inset-inline-start: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--grad-main);
    box-shadow: 0 0 12px rgba(247, 109, 142, 0.8);
}

#coursesSection { margin-top: 2.5rem; }

/* ---------- floating decorative icons ---------- */
@keyframes hp-float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.float-anim { display: inline-block; animation: hp-float-y 3.8s ease-in-out infinite; }

/* ---------- scroll reveal ---------- */
body.reveal-ready [data-reveal] { opacity: 0; transform: translateY(20px); }

body.reveal-ready [data-reveal].revealed {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
    transition-delay: var(--rd, 0s);
}

.hp-grid-courses [data-reveal]:nth-child(2) { --rd: 0.1s; }
.hp-grid-courses [data-reveal]:nth-child(3) { --rd: 0.2s; }
.hp-grid-courses [data-reveal]:nth-child(n+4) { --rd: 0.3s; }

/* ---------- welcome panel ---------- */
.hp-welcome {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(247, 109, 142, 0.28);
    background:
        radial-gradient(640px 260px at 100% 0%, rgba(214, 48, 49, 0.18), transparent 62%),
        radial-gradient(420px 220px at 0% 100%, rgba(247, 178, 103, 0.12), transparent 60%),
        var(--grad-soft);
    padding: 1.7rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 214, 222, 0.85);
    margin: 0 0 0.55rem;
}

.hp-kicker::before {
    content: '';
    width: 22px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-orange));
}

.hp-welcome h1 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.45rem, 2.4vw, 1.95rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.hp-welcome h1 .hp-grad {
    background: linear-gradient(120deg, #ffb3c1, #ff8fa3 40%, #f7b267);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hp-jp {
    font-family: 'Noto Sans JP', var(--font-ui);
    font-size: 1.02rem;
    font-weight: 700;
    color: #ffd9df;
    margin: 0 0 0.15rem;
    text-shadow: 0 0 18px rgba(247, 109, 142, 0.35);
}

.hp-en { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.hp-deco-kana {
    position: absolute;
    inset-inline-end: -14px;
    bottom: -34px;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-weight: 900;
    font-size: 9rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.045);
    pointer-events: none;
    user-select: none;
    transform: rotate(-8deg);
}

/* ---------- stat tiles ---------- */
.hp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1.15rem;
    position: relative;
    z-index: 1;
}

.hp-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 1rem;
    background: rgba(11, 18, 38, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hp-stat:hover { transform: translateY(-2px); border-color: rgba(247, 109, 142, 0.4); }

.hp-stat-icon { font-size: 0.95rem; line-height: 1; }

.hp-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- featured Continue Learning card ---------- */
.hp-continue-slot { min-height: 280px; }

.hp-continue {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(247, 109, 142, 0.45);
    padding: 1.5rem 1.6rem;
    background:
        radial-gradient(500px 260px at 110% -20%, rgba(255, 159, 104, 0.28), transparent 60%),
        radial-gradient(420px 240px at -20% 120%, rgba(214, 48, 49, 0.30), transparent 60%),
        linear-gradient(150deg, rgba(214, 48, 49, 0.30) 0%, rgba(247, 109, 142, 0.14) 50%, rgba(11, 18, 38, 0.55) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 18px 50px rgba(214, 48, 49, 0.20),
        0 4px 18px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hp-continue:hover {
    transform: translateY(-3px);
    border-color: rgba(247, 109, 142, 0.75);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 26px 64px rgba(214, 48, 49, 0.30),
        0 6px 22px rgba(0, 0, 0, 0.32);
}

.hp-eyebrow {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffe3e9;
}

.hp-kana-bg { position: absolute; inset: 0; pointer-events: none; user-select: none; z-index: 0; }

.hp-kana-bg span {
    position: absolute;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.055);
    animation: hp-float 9s ease-in-out infinite alternate;
}

@keyframes hp-float {
    from { transform: translateY(-6px) rotate(-4deg); }
    to   { transform: translateY(10px) rotate(5deg); }
}

.hp-petals { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

.hp-petal {
    position: absolute;
    top: -18px;
    width: 11px;
    height: 11px;
    background: linear-gradient(135deg, rgba(255, 179, 193, 0.9), rgba(247, 109, 142, 0.55));
    border-radius: 100% 4px 100% 4px;
    opacity: 0;
    animation: hp-fall 12s linear infinite;
}

@keyframes hp-fall {
    0%   { transform: translate(0, -20px) rotate(0deg); opacity: 0; }
    8%   { opacity: 0.85; }
    50%  { transform: translate(-26px, 46vh) rotate(200deg); }
    92%  { opacity: 0.6; }
    100% { transform: translate(-44px, 78vh) rotate(380deg); opacity: 0; }
}

.hp-glyph {
    position: relative;
    z-index: 2;
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 24px;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-size: 2.7rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(140deg, #e03a3b, #f76d8e 70%, #ff9f68);
    box-shadow: 0 10px 30px rgba(214, 48, 49, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: hp-pulse 3.2s ease-in-out infinite;
}

@keyframes hp-pulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(214, 48, 49, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
    50%      { box-shadow: 0 10px 42px rgba(247, 109, 142, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
}

.hp-continue-main {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1.05rem;
}

.hp-continue-info { min-width: 0; }

.hp-continue-info h2 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    text-wrap: balance;
}

.hp-continue-next {
    margin: 0;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 224, 230, 0.92);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-continue-meta {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: rgba(255, 224, 230, 0.8);
}

.hp-continue-prog { position: relative; z-index: 2; margin-top: auto; }

.hp-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 224, 230, 0.85);
    margin-bottom: 0.45rem;
}

.hp-progress-row b { font-size: 0.95rem; color: #fff; }

.hp-bar-lg { height: 11px; background: rgba(4, 8, 20, 0.45); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); }

.hp-fill-animated { animation: hp-grow 1s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s backwards; }

.hp-cta {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    padding: 0.72rem 1.7rem;
    font-size: 0.95rem;
}

.hp-cta .hp-arr { display: inline-block; transition: transform 0.2s ease; }
.hp-cta:hover .hp-arr { transform: translateX(4px); }
[dir="rtl"] .hp-arr { transform: scaleX(-1); }
[dir="rtl"] .hp-course-btn span:last-child { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .hp-cta:hover .hp-arr { transform: scaleX(-1) translateX(4px); }

/* ---------- section headers ---------- */
.hp-head { margin: 2rem 0 1rem; }

.hp-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.p-section-title { margin: 0; }

.hp-jp-sub {
    font-family: 'Noto Sans JP', var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(247, 109, 142, 0.55);
    white-space: nowrap;
}

.hp-count-chip {
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: var(--glass-strong);
    border: 1px solid var(--border);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ---------- course cards ---------- */
.hp-grid-courses {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.hp-course {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.3rem;
    border-radius: var(--radius-2xl);
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.82) 0%, rgba(30, 27, 75, 0.8) 100%);
    border: 1px solid transparent;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hp-course::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--course-accent, var(--grad-main));
    opacity: 0.9;
}

.hp-course::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(140deg,
        rgba(247, 109, 142, 0.55) 0%,
        rgba(30, 27, 75, 0.15) 45%,
        rgba(255, 159, 104, 0.45) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.25s ease;
}

.hp-course:hover::after { opacity: 1; }

.hp-card-kana {
    position: absolute;
    inset-inline-end: -8px;
    bottom: -22px;
    font-family: 'Noto Sans JP', var(--font-ui);
    font-weight: 900;
    font-size: 6rem;
    line-height: 1;
    color: #ffffff;
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    transform: rotate(-6deg);
}

.hp-course:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.12),
        0 18px 48px rgba(0, 0, 0, 0.42),
        0 0 26px rgba(247, 109, 142, 0.14);
}

.hp-course-top { display: flex; align-items: flex-start; gap: 0.85rem; }

.hp-course-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    border-radius: 15px;
    background: var(--course-accent, var(--grad-main));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.hp-course-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: anywhere;
}

.hp-course-desc {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-course-meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }

.hp-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.62rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--glass-strong);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.hp-course .p-progress-label { margin-bottom: 0.4rem; }

/* shimmer sweep on progress fills */
.p-bar-fill { position: relative; overflow: hidden; }

.p-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        transparent 25%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 75%);
    transform: translateX(-130%);
    animation: hp-bar-shimmer 2.6s ease-in-out infinite;
}

@keyframes hp-bar-shimmer {
    55%, 100% { transform: translateX(130%); }
}

.hp-course-btn {
    margin-top: auto;
    width: 100%;
    justify-content: space-between;
}

/* ---------- timeline (recent activity) ---------- */
.hp-panel {
    border-radius: var(--radius-2xl);
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1.35rem 1.45rem;
}

.hp-timeline {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    position: relative;
}

.hp-timeline::before {
    content: '';
    position: absolute;
    inset-inline-start: 7px;
    top: 0.55rem;
    bottom: 0.55rem;
    width: 2px;
    border-radius: 99px;
    background: linear-gradient(180deg, rgba(247, 109, 142, 0.6), rgba(255, 159, 104, 0.25), transparent);
}

.hp-tl-item {
    position: relative;
    padding: 0.55rem 0 0.55rem 0;
    padding-inline-start: 2rem;
}

.hp-tl-item::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0.95rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--grad-main);
    box-shadow: 0 0 0 4px rgba(214, 48, 49, 0.16);
}

.hp-tl-item::after {
    content: '✓';
    position: absolute;
    inset-inline-start: 0;
    top: 0.95rem;
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    font-size: 0.56rem;
    font-weight: 800;
    color: #fff;
}

/* status-colored timeline dots */
.hp-tl-item.st-graded::before,
.hp-tl-item.st-teacher_complete::before {
    background: linear-gradient(135deg, #34d399, #2dd4bf);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16), 0 0 14px rgba(52, 211, 153, 0.55);
}

.hp-tl-item.st-turned_in::before {
    background: linear-gradient(135deg, #fbbf24, #ff9f68);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16), 0 0 14px rgba(255, 159, 104, 0.55);
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    margin-inline-end: 0.35rem;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    animation: hp-pulse-ring 1.8s ease-out infinite;
}

@keyframes hp-pulse-ring {
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hp-tl-title {
    font-weight: 700;
    font-size: 0.93rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.hp-tl-sub {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.79rem;
}

.hp-tl-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.14rem 0.6rem;
    border-radius: 999px;
    background: rgba(247, 178, 103, 0.12);
    border: 1px solid rgba(247, 178, 103, 0.25);
    color: #fcd9a8;
    font-size: 0.71rem;
    font-weight: 700;
    white-space: nowrap;
}

.hp-tl-grade {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.14rem 0.6rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #6ee7b7;
    font-size: 0.71rem;
    font-weight: 800;
    white-space: nowrap;
}

.hp-tl-grade-max { color: rgba(110, 231, 183, 0.75); font-weight: 600; }

.hp-tl-grade[data-gslot] { display: none; }

/* ---------- quick actions (student home only) ---------- */
.hp-bottom-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.hp-qa-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.4rem;
}

.hp-qa {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.25rem;
    border-radius: 999px;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.75), rgba(30, 27, 75, 0.65));
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.hp-qa:hover {
    transform: translateY(-2px);
    border-color: rgba(247, 109, 142, 0.55);
    background: linear-gradient(160deg, rgba(247, 109, 142, 0.12), rgba(255, 159, 104, 0.08));
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 10px 26px rgba(214, 48, 49, 0.28);
}

.hp-qa-ico {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--grad-soft);
    border: 1px solid rgba(247, 109, 142, 0.3);
}

.hp-qa-ico svg { width: 24px; height: 24px; }

/* full label always visible — no truncation */
.hp-qa-txt {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
}

.hp-qa-arrow {
    margin-inline-start: auto;
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-pink);
    transition: transform 0.2s ease;
}

.hp-qa:hover .hp-qa-arrow { transform: translateX(3px); }
[dir="rtl"] .hp-qa-arrow { transform: scaleX(-1); }
[dir="rtl"] .hp-qa:hover .hp-qa-arrow { transform: scaleX(-1) translateX(3px); }

/* hover-only icon animation — static until mouseenter */
.hp-qa .npic,
.hp-qa .npic.anim-slide-right,
.hp-qa .npic.anim-flip-y,
.hp-qa .npic.anim-breathe,
.hp-qa .npic.anim-bounce { animation: none !important; }

.hp-qa:hover .npic.anim-slide-right { animation: npSlideRight 1s ease-in-out infinite !important; }
.hp-qa:hover .npic.anim-flip-y      { animation: npFlipY 1.6s linear infinite !important; }
.hp-qa:hover .npic.anim-breathe     { animation: npBreathe 1.6s ease-in-out infinite !important; }
.hp-qa:hover .npic.anim-bounce      { animation: npBounce 1.2s cubic-bezier(.28,.84,.42,1) infinite !important; }

.hp-qa:hover .hp-qa-arrow { transform: translateX(3px); }
[dir="rtl"] .hp-qa-arrow { transform: scaleX(-1); }
[dir="rtl"] .hp-qa:hover .hp-qa-arrow { transform: scaleX(-1) translateX(3px); }

/* ---------- link card / teacher banner ---------- */
.hp-linkcard, .hp-teacher {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-radius: var(--radius-2xl);
    padding: 1.3rem 1.45rem;
    margin-bottom: 1.5rem;
    background: var(--glass);
    border: 1px solid rgba(247, 178, 103, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* GPU promotion — kills the gradient flicker/glitch on scroll + mousemove
   (paired with body background-attachment switched to scroll). */
.hp-linkcard {
    transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hp-teacher { border-color: rgba(52, 211, 153, 0.35); align-items: center; justify-content: space-between; flex-wrap: wrap; }

.hp-linkcard-ico {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    border-radius: 14px;
    background: rgba(247, 178, 103, 0.14);
    border: 1px solid rgba(247, 178, 103, 0.3);
}

.hp-linkcard-body { flex: 1; min-width: 220px; }
.hp-linkcard-body h3 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.hp-linkcard-body > p { margin: 0 0 0.85rem; color: var(--text-muted); font-size: 0.86rem; }

.hp-linkrow { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.hp-linkrow .p-input { max-width: 340px; }
.hp-linkstatus { margin: 0.65rem 0 0; font-size: 0.84rem; color: var(--text-muted); }

.hp-teacher-info b { font-size: 0.98rem; }
.hp-teacher-info p { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.84rem; }

/* ---------- empty states ---------- */
.hp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    padding: 2.4rem 1.4rem;
    border-radius: var(--radius-xl);
    border: 1.5px dashed rgba(247, 109, 142, 0.35);
    background: rgba(255, 255, 255, 0.025);
}

.hp-empty-ico { font-size: 2.2rem; filter: drop-shadow(0 4px 14px rgba(247, 109, 142, 0.35)); }
.hp-empty-jp { font-family: 'Noto Sans JP', var(--font-ui); font-size: 0.82rem; color: rgba(247, 109, 142, 0.65); letter-spacing: 0.12em; }
.hp-empty-msg { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.9rem; max-width: 360px; }

/* ---------- skeletons ---------- */
.hp-sk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.hp-sk-stat { min-height: 84px; border-radius: 1rem; }
.hp-sk-block { border-radius: var(--radius-2xl); }
.hp-sk-card { min-height: 210px; border-radius: var(--radius-2xl); }
.hp-sk-row { min-height: 58px; border-radius: 0.9rem; margin-bottom: 0.6rem; }
.hp-sk-line { min-height: 14px; border-radius: 99px; margin-bottom: 0.7rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .hp-hero-grid, .hp-bottom-grid { grid-template-columns: 1fr; }
    .hp-continue-slot { min-height: 260px; }
}

@media (max-width: 640px) {
    .hp-welcome { padding: 1.3rem 1.15rem; }
    .float-anim { animation: none; }
    .hp-petal { animation-duration: 16s; }
    .hp-card-kana { font-size: 4.2rem; bottom: -14px; }
    .hp-stats { gap: 0.5rem; }
    .hp-stat { padding: 0.6rem 0.65rem; }
    .hp-stat-value { font-size: 1.05rem; }
    .hp-stat-label { font-size: 0.6rem; }
    .hp-glyph { width: 66px; height: 66px; border-radius: 18px; font-size: 2.05rem; }
    .hp-continue { padding: 1.2rem 1.15rem; min-height: 270px; }
    .hp-continue-info h2 { font-size: 1.15rem; }
    .hp-continue-main { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .hp-cta { width: 100%; justify-content: center; }
    .hp-grid-courses { grid-template-columns: 1fr; }
    .hp-qa-txt { font-size: .9rem; }
    .hp-panel { padding: 1.1rem 1.05rem; }
    .hp-linkcard { flex-direction: column; }
    .hp-deco-hide-sm { display: none; }
}

/* ============================================================
   HOME V2 � To-do � Announcements � Level bar � Mid-grid
   ============================================================ */
.hp-mid-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:1.5rem;align-items:start;margin-top:2rem;}

/* --- To-do --- */
#todoSection{margin-top:2rem;}
.hp-todo-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.6rem;}
.hp-todo-item{display:flex;align-items:center;gap:.9rem;padding:.8rem 1rem;background:var(--hp-card-bg,rgba(255,255,255,.05));
  border:1px solid var(--hp-card-border,rgba(255,255,255,.12));border-radius:14px;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;}
.hp-todo-item:hover,.hp-todo-item:focus-within{transform:translateY(-2px);border-color:rgba(246,178,181,.45);box-shadow:0 8px 22px rgba(0,0,0,.28);}
.hp-todo-item.is-overdue{border-inline-start:3px solid #ef4444;}
.hp-todo-ico{font-size:1.25rem;flex:none;}
.hp-todo-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:.15rem;}
.hp-todo-title{font-weight:700;font-size:.95rem;color:var(--text-color,#f8fafc);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hp-todo-sub{font-size:.78rem;color:var(--text-muted,#94a3b8);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hp-due-chip{flex:none;}
.hp-due-overdue{background:rgba(239,68,68,.16)!important;color:#fca5a5!important;border-color:rgba(239,68,68,.4)!important;}
.hp-todo-btn{flex:none;}
.hp-todo-more{display:inline-block;margin-top:.7rem;font-size:.85rem;font-weight:600;color:#f6b2b5;text-decoration:none;}
.hp-todo-more:hover{text-decoration:underline;}

/* --- Announcements preview --- */
.hp-ann-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.8rem;}
.hp-ann-item{background:var(--hp-card-bg,rgba(255,255,255,.05));border:1px solid var(--hp-card-border,rgba(255,255,255,.12));
  border-radius:14px;padding:.85rem 1rem;display:flex;flex-direction:column;gap:.35rem;transition:border-color .18s ease;}
.hp-ann-item:hover{border-color:rgba(246,178,181,.4);}
.hp-ann-head{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;font-size:.88rem;color:var(--text-color,#e2e8f0);}
.hp-ann-txt{margin:0;font-size:.85rem;color:var(--text-muted,#cbd5e1);line-height:1.6;}
.hp-ann-course{font-size:.75rem;color:var(--text-muted,#94a3b8);}
.hp-ann-link{font-size:.82rem;font-weight:700;color:#f6b2b5;text-decoration:none;align-self:flex-start;}
.hp-ann-link:hover{text-decoration:underline;}
.hp-ann-ico{font-size:1.1rem;}

/* --- Course card topic line --- */
.hp-course-topic{margin:.55rem 0 0;font-size:.8rem;color:var(--text-muted,#cbd5e1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hp-topic-kicker{color:#f6b2b5;font-weight:700;}

/* --- Hero level progress (renders only with real data) --- */
#levelProgress{margin-top:.9rem;display:flex;align-items:center;gap:.7rem;max-width:340px;}
.hp-levelbar{flex:1;height:10px;border-radius:999px;background:rgba(255,255,255,.1);overflow:hidden;border:1px solid rgba(255,255,255,.14);}
.hp-levelbar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#f6b2b5,#f76d8e,#d63031);}
.hp-levelbar-pct{font-size:.8rem;font-weight:800;color:#f8fafc;}

/* --- Responsive --- */
@media (max-width:1024px){.hp-mid-grid{grid-template-columns:1fr;}}
@media (max-width:768px){
  .hp-todo-item{flex-wrap:wrap;}
  .hp-todo-main{flex-basis:100%;order:3;}
  .hp-todo-btn{margin-inline-start:auto;}
}
@media (prefers-reduced-motion:reduce){
  .hp-todo-item,.hp-todo-item:hover,.hp-ann-item{transition:none;}
  .hp-fill-animated{animation:none!important;}
}

/* ============================================================
   HOME V2.1 — empty-state actions, add-course card,
   announcement author row, disabled quick action (Huroof)
   ============================================================ */
.hp-empty-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.8rem;margin-top:1.1rem;}

.hp-course-add{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.5rem;min-height:210px;text-align:center;text-decoration:none;
  color:var(--text-muted,#94a3b8);
  border:1.5px dashed rgba(247,109,142,.5);
  background:rgba(255,255,255,.03);
  cursor:pointer;
}
.hp-course-add:hover{
  transform:translateY(-4px);
  border-color:rgba(247,109,142,.85);
  color:#f6b2b5;
  box-shadow:0 14px 38px rgba(0,0,0,.35),0 0 24px rgba(247,109,142,.14);
}
.hp-add-plus{font-size:2.1rem;font-weight:800;line-height:1;color:#f6b2b5;}
.hp-add-label{font-size:.9rem;font-weight:700;}

.hp-ann-head{align-items:center;}
.hp-ann-author{display:inline-flex;align-items:center;gap:.55rem;min-width:0;}
.hp-ann-avatar{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:50%;
  font-size:.78rem;font-weight:800;color:#fff;background:linear-gradient(135deg,#e03a3b,#f76d8e);
  box-shadow:0 2px 8px rgba(214,48,49,.35);}
.hp-ann-date{background:transparent!important;border:0!important;color:var(--text-muted,#94a3b8)!important;font-weight:600!important;padding:0!important;}

.hp-qa-disabled{width:100%;font-family:inherit;font-size:inherit;color:var(--text-main);cursor:not-allowed;opacity:.6;filter:saturate(.45);}
.hp-qa-disabled:hover{transform:none;border-color:var(--border);background:linear-gradient(160deg,rgba(15,23,42,.75),rgba(30,27,75,.65));box-shadow:inset 0 1px 1px rgba(255,255,255,.08);}
.hp-qa-disabled .hp-qa-arrow{color:inherit;}
.hp-qa-soon{margin-inline-start:auto;font-size:.66rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  padding:.18rem .55rem;border-radius:999px;color:#fcd9a8;background:rgba(247,178,103,.14);border:1px solid rgba(247,178,103,.3);white-space:nowrap;}
