/* ===== Home dashboard (#page-home, filled by js/home.js) =====
   switchPage() sets the page to display:block, so spacing between the
   sections comes from margins rather than a flex/grid gap on the page. */
.home-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.home-label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--text-label);
}
.home-big {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 2px 0;
}
.home-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- mascot greeting --- */
.home-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid var(--primary);
}
.home-mascot {
    width: 58px;
    flex: none;
}
.home-bubble {
    flex: 1;
    min-width: 0;
}
.home-greet {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.home-msg {
    margin-top: 3px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.home-streak {
    align-self: flex-start;
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.9rem;
}
.home-streak.cold {
    color: var(--text-muted);
    filter: grayscale(1);
}

/* --- 今天 (renderHome / homeTodaySteps): the goal ring, today's steps, one button --- */
.home-card.home-today {
    border: 2px solid var(--primary);
}
.home-today-head {
    display: flex;
    align-items: center;
    gap: 18px;
}
.home-steps {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}
.home-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px dashed var(--line);
    font-size: 0.92rem;
    line-height: 1.45;
}
.home-step-ck {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid var(--line);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary);
}
.home-step-text small {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.home-step.next { font-weight: 800; }
.home-step.next .home-step-ck { border-color: var(--primary); color: var(--primary); }
.home-step.done { color: var(--text-secondary); }
.home-step.done .home-step-ck { border-color: var(--success); background: var(--success); color: var(--on-primary); }
.home-ring {
    --p: 0;
    width: 92px;
    height: 92px;
    flex: none;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--track) 0);
    transition: transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.home-ring.done {
    background: conic-gradient(var(--success) 100%, var(--track) 0);
}
.home-ring > span {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding-top: 22px;
}
.home-ring b {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
}
.home-ring small {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.home-ring:active {
    transform: scale(0.96);
}
.home-goal-text {
    min-width: 0;
}
.home-week {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.home-week i {
    font-style: normal;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--track);
    color: var(--text-muted);
}
.home-week i.on {
    background: var(--primary);
    color: var(--on-primary);
}
.home-week i.today {
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}
.home-week i.today.on {
    outline-color: var(--primary-edge);
}

/* --- the 今天 card's button --- */
.next-btn.home-continue {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    padding: 14px 16px;
    font-size: 1.05rem;
    text-align: center;
}

/* --- review / mistakes --- */
.home-review {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
}
/* sized by its text: when a long language (Слов к повторению: 122) can't fit beside
   the button, the button goes under it instead of squeezing the heading onto 3 lines */
.home-review-text {
    flex: 1 1 auto;
    min-width: 0;
}
.home-review.quiet .home-big {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.back-btn.home-review-btn {
    flex: none;
    padding: 8px 16px;
}

/* --- word sets --- */
.home-section-title {
    font-size: 1rem;
    margin: 6px 2px 10px;
    color: var(--text);
}
.home-courses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.lang-btn.home-course {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    padding: 12px;
    font-size: 0.9rem;
    text-align: left;
}
.home-course-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 900;
    font-size: 0.85rem;
}
.home-course-name {
    font-weight: 700;
    line-height: 1.3;
}
.home-course-bar {
    display: block;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--track);
    overflow: hidden;
}
.home-course-bar i {
    display: block;
    height: 100%;
    background: var(--primary);
}
.home-course small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.home-empty {
    grid-column: 1 / -1;
    padding: 4px 2px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

@media (max-width: 560px) {
    /* 7 x 24px + 6 x 4px = 192px, fits next to the ring at 360px wide */
    .home-week { gap: 4px; }
    .home-week i { width: 24px; height: 24px; font-size: 0.68rem; }
    .home-mascot { width: 48px; }
    .home-today-head { gap: 14px; }
    .home-ring { width: 80px; height: 80px; }
    .home-ring > span { width: 64px; height: 64px; padding-top: 18px; }
    .home-ring b { font-size: 1.3rem; }
}
/* 360px phones leave the dots less than 192px: smaller, and never a lone 7th on its own line */
@media (max-width: 400px) {
    .home-week { gap: 3px; flex-wrap: nowrap; }
    .home-week i { width: 21px; height: 21px; flex: none; font-size: 0.62rem; }
}

/* computers: 1180px wide (css/base.css) in two columns so the page fits one 1080p screen —
   the greeting across the top, 今天 on the left, the rest on the right (big check 2026-10-24) */
@media (min-width: 1024px) {
    #page-home {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 22px;
        align-items: start;
        align-content: start;
    }
    #page-home > * { grid-column: 2; }
    #page-home > .home-hero { grid-column: 1 / -1; }
    #page-home > .home-today { grid-column: 1; grid-row: 2 / span 6; }
    .home-section-title:first-of-type { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
}
