/*
    EPIC 60 WP4 - This week, First look and the goal screen. Builds on the home.css tokens (forest-green
    header, gold accent, light body, white hairline cards, Fredoka display / Inter body). One component tree:
    phone first, two columns from 900px. State colours never use red.
*/

/* Tokens also reach the WP8 screens and Family-page parts (email, create a child, Played today, reissue),
   which reuse the hw- buttons and text styles. */
.hw-page,
.hw-setup,
.hm-email,
.hm-create,
.hm-card,
.hm-reissue {
    --hw-gold: #F2C14E;
    --hw-forest: var(--home-header-from, #1E3B34);
    --hw-forest-2: var(--home-header-to, #2A5547);
    --hw-ink: var(--home-text, #1C2421);
    --hw-ink-2: var(--home-text-muted, #5B6661);
    --hw-line: var(--home-hairline, #E3E6E0);
    --hw-card: var(--home-card, #FFFFFF);
    --hw-secure: var(--home-state-secure, #2F9E6E);
    --hw-getting: var(--home-state-getting-there, #1F66D6);
    --hw-stepback: var(--home-state-step-back, #E09A1C);
    --hw-notyet: var(--home-state-not-yet, #A7B0BF);
    --hw-display: var(--home-font-display, 'Fredoka', system-ui, sans-serif);
}

.hw-page,
.hw-setup {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--hw-ink);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- hero band (green, continues the header) ---------- */

.hw-hero {
    background: linear-gradient(180deg, var(--hw-forest), var(--hw-forest-2));
    color: #FFFFFF;
    border-radius: 0 0 16px 16px;
    margin: -24px calc(-1 * var(--home-gutter, 16px)) 0;
    padding: 16px var(--home-gutter, 16px) 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hw-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hw-hero__status {
    margin: 0;
    opacity: 0.85;
}

.hw-who {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hw-who__name {
    font-family: var(--hw-display);
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.1;
    margin: 0;
}

.hw-who__meta {
    font-size: 0.8rem;
    opacity: 0.82;
}

.hw-who__monsters {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hw-gold);
    margin-top: 2px;
}

.hw-plat {
    width: 72px;
    height: 72px;
    flex: none;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 72%, rgba(242, 193, 78, 0.55), rgba(242, 193, 78, 0) 66%);
    display: grid;
    place-items: center;
}

.hw-plat svg {
    width: 48px;
    height: 48px;
}

/* ---------- headline + badges ---------- */

.hw-headline__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
}

.hw-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.82;
}

.hw-badges {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hw-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    background: rgba(242, 193, 78, 0.18);
    color: var(--hw-gold);
}

.hw-card .hw-badge {
    background: #FFF4D6;
    color: #7A5A0B;
}

.hw-head {
    font-family: var(--hw-display);
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.25;
    margin: 6px 0 0;
    text-wrap: balance;
}

/* ---------- day circles ---------- */

.hw-days {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 440px;
}

.hw-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
}

.hw-day__dot {
    width: 100%;
    max-width: 36px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.32);
    box-sizing: border-box;
}

.hw-day--school .hw-day__dot {
    background: var(--hw-gold);
    border-color: var(--hw-gold);
}

.hw-day--home .hw-day__dot {
    background: var(--hw-gold);
    border-color: var(--hw-gold);
    box-shadow: inset 0 0 0 4px var(--hw-forest);
}

.hw-day.is-today .hw-day__dot {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.hw-day__name {
    opacity: 0.78;
}

.hw-key {
    display: flex;
    gap: 14px;
    font-size: 0.68rem;
    opacity: 0.8;
    margin-top: 8px;
}

.hw-key__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hw-gold);
    vertical-align: -1px;
    margin-right: 5px;
}

.hw-key__dot--home {
    box-shadow: inset 0 0 0 2px var(--hw-forest);
}

/* On a white card (First look) the empty circle and the home ring need dark-on-light contrast. */
.hw-strip:not(.hw-strip--dark) .hw-day__dot {
    border-color: #C9D1CB;
}

.hw-strip:not(.hw-strip--dark) .hw-day--school .hw-day__dot,
.hw-strip:not(.hw-strip--dark) .hw-day--home .hw-day__dot {
    border-color: var(--hw-gold);
}

.hw-strip:not(.hw-strip--dark) .hw-day--home .hw-day__dot,
.hw-strip:not(.hw-strip--dark) .hw-key__dot--home {
    box-shadow: inset 0 0 0 4px #FFFFFF;
}

.hw-strip:not(.hw-strip--dark) .hw-day.is-today .hw-day__dot {
    outline-color: var(--hw-forest-2);
}

/* ---------- body ---------- */

.hw-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.hw-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.hw-card {
    background: var(--hw-card);
    border: 1px solid var(--hw-line);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hw-card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.hw-k {
    font-family: var(--home-font-body, 'Inter', system-ui, sans-serif);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hw-ink-2);
    font-weight: 700;
    margin: 0;
}

.hw-title {
    font-family: var(--hw-display);
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0;
    text-wrap: balance;
}

.hw-subtitle {
    font-family: var(--hw-display);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0;
}

.hw-lede {
    color: var(--hw-ink-2);
    margin: 0;
}

.hw-small {
    font-size: 0.8rem;
    color: var(--hw-ink-2);
    margin: 0;
}

.hw-center {
    text-align: center;
}

.hw-note {
    font-size: 0.8rem;
    color: var(--hw-ink-2);
    margin: 0;
    padding: 0 4px;
}

.hw-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 0.9rem;
}

.hw-stats strong {
    font-family: var(--hw-display);
    font-size: 1.2rem;
}

.hw-focus {
    margin: 0;
    font-size: 0.88rem;
}

.hw-topics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--hw-line);
    padding-top: 10px;
}

.hw-topic-list,
.hw-moves {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hw-topic {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.hw-topic__name {
    flex: 1;
    min-width: 0;
}

.hw-topic__name small {
    display: block;
    color: var(--hw-ink-2);
    font-size: 0.74rem;
}

/* Quiet link to This term for the topics past the top three. */
.hw-more {
    align-self: flex-start;
    font-size: 0.84rem;
    color: var(--hw-ink-2);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hw-more:focus-visible {
    outline: 3px solid var(--hw-gold);
    outline-offset: 2px;
}

/* The one-line description only where there is room (laptop). */
.hw-topic__desc {
    display: none !important;
}

@media (min-width: 900px) {
    .hw-topic__desc {
        display: block !important;
    }
}

.hw-moves li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.9rem;
}

.hw-moves .hw-dot {
    margin-top: 6px;
}

.hw-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    box-sizing: border-box;
}

.hw-dot--secure { background: var(--hw-secure); }
.hw-dot--getting { background: var(--hw-getting); }
.hw-dot--stepback { background: var(--hw-stepback); }
.hw-dot--notyet { background: #FFFFFF; border: 2px dashed var(--hw-notyet); }
.hw-dot--plain { background: var(--hw-forest-2); }

.hw-state {
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}

.hw-state--secure { background: #E6F4EE; color: #1F7A55; }
.hw-state--getting { background: #E7EFFC; color: #1F66D6; }
.hw-state--stepback { background: #FCF1DC; color: #8A5A07; }
.hw-state--notyet { border: 1.5px dashed var(--hw-notyet); color: var(--hw-ink-2); }

.hw-quest__count {
    font-family: var(--hw-display);
    font-weight: 600;
}

.hw-progress {
    height: 8px;
    background: #E8ECE6;
    border-radius: 999px;
    overflow: hidden;
}

.hw-progress i {
    display: block;
    height: 100%;
    background: var(--hw-forest-2);
}

.hw-card--try {
    background: #FFF8EA;
    border-color: #F0DFB8;
}

.hw-try__text {
    margin: 0;
    font-size: 0.95rem;
}

.hw-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font: 600 0.88rem/1.2 var(--home-font-body, 'Inter', system-ui, sans-serif);
    border-radius: 10px;
    padding: 8px 16px;
    border: 1px solid var(--hw-line);
    background: #FFFFFF;
    color: var(--hw-ink);
    text-decoration: none;
    cursor: pointer;
    align-self: flex-start;
}

.hw-btn--primary {
    background: var(--hw-forest-2);
    border-color: var(--hw-forest-2);
    color: #FFFFFF;
}

.hw-btn--wide {
    align-self: stretch;
    width: 100%;
}

.hw-btn:focus-visible,
.hw-goal:focus-visible,
.hw-wide:focus-visible,
.hw-back:focus-visible {
    outline: 3px solid var(--hw-gold);
    outline-offset: 2px;
}

.hw-btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

.hw-wide {
    display: block;
    text-align: center;
    font-weight: 600;
    color: var(--hw-forest-2);
    padding: 12px;
    border: 1px solid #C8D6CC;
    border-radius: 10px;
    background: #FFFFFF;
    text-decoration: none;
}

.hw-message {
    background: #E6F4EE;
    border: 1px solid #BFE0D0;
    color: #1F5A40;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0;
}

/* ---------- set-up screens (goal, first look) ---------- */

.hw-back {
    color: var(--hw-forest-2);
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.hw-welcome p {
    color: var(--hw-ink-2);
    margin: 6px 0 0;
}

.hw-empty p {
    margin: 0;
}

.hw-goal-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.hw-goal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 8px;
    border-radius: 12px;
    border: 2px solid var(--hw-line);
    background: #FFFFFF;
    color: var(--hw-ink);
    cursor: pointer;
    text-align: center;
}

.hw-goal.is-on {
    border-color: var(--hw-forest-2);
    box-shadow: 0 0 0 3px rgba(42, 85, 71, 0.15);
}

.hw-goal__n {
    font-family: var(--hw-display);
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
}

.hw-goal__unit {
    font-size: 0.8rem;
    font-weight: 600;
}

.hw-goal__hint {
    font-size: 0.72rem;
    color: var(--hw-ink-2);
}

.hw-goal-week {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 420px;
}

.hw-goal-week li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--hw-ink-2);
}

.hw-goal-week i {
    width: 100%;
    max-width: 34px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid #C9D1CB;
    box-sizing: border-box;
}

.hw-goal-week li.is-on i {
    background: var(--hw-gold);
    border-color: var(--hw-gold);
}

/* ---------- laptop ---------- */

@media (min-width: 641px) {
    .hw-hero {
        margin: 0;
        border-radius: 16px;
        padding: 20px 24px 22px;
    }

    .hw-plat {
        width: 92px;
        height: 92px;
    }

    .hw-plat svg {
        width: 62px;
        height: 62px;
    }

    .hw-who__name {
        font-size: 1.7rem;
    }

    .hw-head {
        font-size: 1.55rem;
    }
}

@media (min-width: 900px) {
    .hw-grid {
        grid-template-columns: 3fr 2fr;
        align-items: start;
    }

    .hw-setup--wide {
        max-width: 720px;
    }
}
