/* WordFarm learner app: trustworthy red and white, uncluttered study screens (WF-033). */
:root {
    --wf-red: #d62311;
    --wf-red-deep: #a91b0d;
    --wf-white: #ffffff;
    --wf-neutral: #f6f5f3;
    --wf-charcoal: #292929;
    --wf-gray: #616161;
    --wf-border: #d9d9d9;
    --wf-green: #28734a;
    --wf-radius: 14px;
    --wf-font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC",
        "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body.wf-body {
    margin: 0;
    background: var(--wf-neutral);
    color: var(--wf-charcoal);
    font-family: var(--wf-font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

.wf-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wf-app > .wf-main { flex: 1; }

a { color: var(--wf-red-deep); }

.wf-loading {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: var(--wf-red);
    font-weight: 800;
    font-size: 1.4rem;
}

/* Header */
.wf-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--wf-white);
    border-bottom: 3px solid var(--wf-red);
}

/* The same width and height as the website's header, so moving between the two is seamless. */
.wf-header-row {
    display: flex;
    align-items: center;
    gap: 8px 24px;
    width: 100%;
    max-width: 1120px;
    min-height: 68px;
    margin: 0 auto;
    padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}

.wf-brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.wf-brand img { display: block; height: 32px; width: auto; }

.wf-nav { display: flex; gap: 4px; }

.wf-nav a {
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--wf-charcoal);
    text-decoration: none;
    font-weight: 600;
}

.wf-nav a.is-active,
.wf-nav a:hover { background: var(--wf-neutral); color: var(--wf-red-deep); }

.wf-header-links {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: auto;
}

.wf-signout,
.wf-support-link {
    white-space: nowrap;
    color: var(--wf-gray);
    font-size: 0.9rem;
}

.wf-support-link { font-weight: 600; color: var(--wf-red-deep); }

.wf-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    padding: 0 16px 32px;
    font-size: 0.9rem;
}

.wf-footer a { color: var(--wf-gray); }

.wf-main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* Messages */
.wf-flash {
    display: none;
    position: relative;
    /* Lined up with the cards below it. */
    width: calc(100% - 32px);
    max-width: 728px;
    margin: 16px auto 0;
    padding: 12px 46px 12px 48px;
    border-radius: var(--wf-radius);
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    box-shadow: 0 4px 16px rgba(41, 41, 41, 0.06);
    line-height: 1.45;
}

.wf-flash.is-visible { display: block; }
.wf-flash::before {
    content: "i";
    position: absolute;
    left: 14px;
    top: 12px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--wf-gray);
    color: var(--wf-white);
    font-size: 0.8rem;
    font-weight: 800;
}
.wf-flash.is-error { border-color: #f1b8b0; background: #fff4f2; color: var(--wf-red-deep); }
.wf-flash.is-error::before { content: "!"; background: var(--wf-red); }
.wf-flash.is-success { border-color: #b9dcc7; background: #f0f8f3; color: #1f5c3a; }
.wf-flash.is-success::before { content: "\2713"; background: var(--wf-green); }
.wf-flash-close {
    position: absolute;
    right: 8px;
    top: 7px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}
.wf-flash-close::before { content: "\00d7"; font-size: 1.35rem; line-height: 1; }
.wf-flash-close:hover,
.wf-flash-close:focus-visible { opacity: 1; background: rgba(41, 41, 41, 0.08); }

.wf-update {
    max-width: 760px;
    margin: 12px auto 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff4f2;
    border: 1px solid var(--wf-red);
}

.wf-notice {
    padding: 10px 14px;
    border-left: 4px solid var(--wf-red);
    background: var(--wf-neutral);
    border-radius: 6px;
}

/* Cards and layout */
.wf-card {
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.wf-center { text-align: center; }
.wf-center .wf-actions { justify-content: center; }
/* Centered screens (such as "You're all set") stack the install card and center its buttons. */
.wf-center .wf-install { flex-direction: column; justify-content: center; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
h3 { font-size: 1.1rem; margin: 0 0 4px; }
h3 a { color: var(--wf-charcoal); text-decoration: none; }

.wf-lead { font-size: 1.1rem; color: var(--wf-gray); }
.wf-hint { color: var(--wf-gray); font-size: 0.9rem; }

.wf-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

/* Buttons */
.wf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--wf-red);
    color: var(--wf-white);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.wf-button:hover { background: var(--wf-red-deep); }
.wf-button:disabled { opacity: 0.5; cursor: not-allowed; }
.wf-button-block { width: 100%; }

.wf-button-secondary {
    background: var(--wf-white);
    color: var(--wf-red-deep);
    border: 2px solid var(--wf-red);
}

.wf-button-secondary:hover { background: #fff4f2; }

.wf-link {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--wf-red-deep);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.wf-danger { color: var(--wf-red); }

/* Forms */
.wf-form { display: flex; flex-direction: column; gap: 12px; }

.wf-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    font-weight: 600;
}

.wf-field legend { font-weight: 600; margin-bottom: 4px; }
.wf-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }

.wf-field input,
.wf-field select,
.wf-field textarea,
.wf-birth select,
.wf-birth input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    background: var(--wf-white);
    color: var(--wf-charcoal);
    font: inherit;
    font-weight: 400;
}

.wf-inline input,
.wf-inline select { width: auto; min-width: 96px; }

.wf-field input:focus,
.wf-field select:focus,
.wf-field textarea:focus {
    outline: 2px solid var(--wf-red);
    outline-offset: 1px;
}

.wf-birth { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.wf-birth legend { grid-column: 1 / -1; }

.wf-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.wf-check input { width: 20px; height: 20px; accent-color: var(--wf-red); }

/* Welcome tabs */
.wf-tabs { display: flex; gap: 8px; margin: 16px 0; border-bottom: 1px solid var(--wf-border); }

.wf-tabs a {
    padding: 8px 4px;
    margin-bottom: -1px;
    color: var(--wf-gray);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 3px solid transparent;
}

.wf-tabs a.is-active { color: var(--wf-red-deep); border-bottom-color: var(--wf-red); }

.wf-tab {
    padding: 8px 4px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--wf-gray);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.wf-tab.is-active { color: var(--wf-red-deep); border-bottom-color: var(--wf-red); }

/* Onboarding */
.wf-steps { display: flex; gap: 6px; padding: 0; margin: 0 0 16px; list-style: none; }
.wf-steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--wf-border); }
.wf-steps li.is-active { background: var(--wf-red); }

.wf-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.wf-choice,
.wf-list-item {
    min-height: 52px;
    padding: 12px;
    border: 2px solid var(--wf-border);
    border-radius: 12px;
    background: var(--wf-white);
    color: var(--wf-charcoal);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.wf-choice:hover,
.wf-list-item:hover { border-color: var(--wf-red); }

.wf-list { display: flex; flex-direction: column; gap: 10px; }
.wf-list-item { display: flex; flex-direction: column; }
.wf-list-item span { color: var(--wf-gray); font-weight: 400; }

.wf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.wf-chips legend { width: 100%; font-weight: 600; margin-bottom: 4px; }
.wf-chip input { position: absolute; opacity: 0; }

.wf-chip span {
    display: inline-block;
    padding: 8px 14px;
    border: 2px solid var(--wf-border);
    border-radius: 999px;
    cursor: pointer;
}

.wf-chip input:checked + span { border-color: var(--wf-red); background: #fff4f2; color: var(--wf-red-deep); }
.wf-chip input:focus-visible + span { outline: 2px solid var(--wf-red); }

/* Home */
.wf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.wf-stat {
    padding: 14px;
    background: var(--wf-white);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    text-align: center;
}

.wf-stat strong { display: block; font-size: 1.8rem; color: var(--wf-red); }
.wf-stat span { color: var(--wf-gray); font-size: 0.85rem; }

.wf-deck,
.wf-resume,
.wf-install {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wf-deck p,
.wf-resume p { margin: 0; color: var(--wf-gray); }
.wf-deck .wf-actions,
.wf-resume .wf-actions,
.wf-install .wf-actions { margin-top: 0; }
.wf-deck.is-removed { opacity: 0.7; }
.wf-resume { border-color: var(--wf-red); }

/* Study */
.wf-study-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    color: var(--wf-gray);
}

.wf-with-audio { display: flex; align-items: center; gap: 8px; }
.wf-with-audio > :first-child { flex: 1 1 auto; min-width: 0; }

.wf-play {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 2px solid var(--wf-border);
    border-radius: 50%;
    background: var(--wf-white);
    color: var(--wf-red);
    cursor: pointer;
}

.wf-play:hover,
.wf-play:focus-visible { border-color: var(--wf-red); outline: none; }
/* While a sound loads (or is generated) a ring spins round the button; while it plays the button pulses. */
.wf-play { position: relative; }
.wf-play.is-loading { border-color: var(--wf-border); }
.wf-play.is-loading svg { opacity: 0.35; }
.wf-play.is-loading::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--wf-red);
    border-right-color: var(--wf-red);
    animation: wf-spin 0.8s linear infinite;
}
.wf-play.is-playing { border-color: var(--wf-red); animation: wf-pulse 1.2s ease-in-out infinite; }
@keyframes wf-spin { to { transform: rotate(360deg); } }
@keyframes wf-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 33, 18, 0.25); } 50% { box-shadow: 0 0 0 6px rgba(214, 33, 18, 0); } }

.wf-option-row { display: flex; align-items: center; gap: 8px; }
.wf-option-row .wf-option { flex: 1 1 auto; min-width: 0; }

.wf-task { text-align: center; }
/* Text with a play button stays centered on the card: an empty column balances the button. */
.wf-task .wf-with-audio { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.wf-task .wf-with-audio::before { content: ""; }
.wf-task .wf-actions { justify-content: center; }
.wf-study-toggles { display: inline-flex; gap: 16px; flex-wrap: wrap; }
.wf-task-title { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wf-gray); }

.wf-target { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 12px 0; }
.wf-target-text { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.wf-target.is-large .wf-target-text { font-size: 2.6rem; }
.wf-reading,
.wf-romanization { color: var(--wf-gray); }
.wf-romanization { font-style: italic; }
.wf-vocalized { font-size: 1.6rem; }

.wf-meanings { list-style: none; padding: 0; margin: 8px 0; font-size: 1.2rem; font-weight: 600; }
.wf-grammar { color: var(--wf-gray); font-style: italic; }
.wf-meaning-prompt { font-size: 1.6rem; font-weight: 700; margin: 16px 0; }

.wf-example { margin: 12px 0; }
.wf-example span:first-child { font-size: 1.15rem; }
.wf-example .wf-romanization { display: block; font-size: 0.95rem; }
.wf-translation { margin: 0; color: var(--wf-gray); }
/* A new word's examples: each one in its own labelled box, with its audio. */
.wf-examples { display: grid; gap: 10px; margin: 16px 0; text-align: start; }
.wf-example-pair {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--wf-border);
    border-left: 4px solid var(--wf-red);
    border-radius: 12px;
    background: var(--wf-neutral);
}
.wf-example-body { flex: 1 1 auto; min-width: 0; }
.wf-example-label {
    display: block;
    margin-bottom: 4px;
    color: var(--wf-red-deep);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.wf-example-pair .wf-example { margin: 0 0 4px; }

.wf-options { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }

.wf-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
    border: 2px solid var(--wf-border);
    border-radius: 12px;
    background: var(--wf-white);
    color: var(--wf-charcoal);
    font: inherit;
    font-size: 1.1rem;
    text-align: start;
    cursor: pointer;
}

.wf-option:hover,
.wf-option:focus-visible { border-color: var(--wf-red); outline: none; }

.wf-option-text { display: flex; flex-direction: column; min-width: 0; }
.wf-option-reading { font-size: 0.85rem; }
.wf-option-readings { margin: 8px 0 0; }

.wf-key {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--wf-neutral);
    color: var(--wf-gray);
    font-size: 0.85rem;
    font-weight: 700;
}

.wf-task .wf-form { text-align: left; margin-top: 16px; }
.wf-task .wf-form input { font-size: 1.2rem; }
.wf-secondary-actions { justify-content: center; }
.wf-report { display: block; margin: 16px auto 0; font-size: 0.85rem; color: var(--wf-gray); }

.wf-timer { height: 6px; margin: 8px 0 16px; border-radius: 3px; background: var(--wf-neutral); overflow: hidden; }
.wf-timer span { display: block; height: 100%; width: 100%; background: var(--wf-red); transition: width 0.1s linear; }

/* The result of an answer: a panel that slides up over the drill */
.wf-main.has-sheet { padding-bottom: 300px; }
.wf-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    padding: 0 12px max(12px, env(safe-area-inset-bottom));
    animation: wf-sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.wf-sheet.is-inline { position: static; padding: 0; animation: wf-enter 0.25s ease-out both; }
.wf-sheet.is-inline .wf-sheet-inner { box-shadow: none; }
.wf-sheet-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 20px 18px;
    border-radius: 18px;
    background: var(--wf-white);
    border: 2px solid var(--wf-border);
    box-shadow: 0 -8px 30px rgba(41, 41, 41, 0.16);
}
.wf-sheet.is-correct .wf-sheet-inner { border-color: var(--wf-green); background: #f0f8f3; }
.wf-sheet.is-wrong .wf-sheet-inner { border-color: var(--wf-red); background: #fff4f2; }
.wf-sheet-head { display: flex; align-items: center; gap: 12px; }
.wf-sheet-head h2 { margin: 0; font-size: 1.4rem; }
.wf-sheet.is-correct h2 { color: var(--wf-green); }
.wf-sheet.is-wrong h2 { color: var(--wf-red-deep); }
.wf-sheet-icon {
    flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
    color: var(--wf-white); font-weight: 800; animation: wf-pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.wf-sheet.is-correct .wf-sheet-icon { background: var(--wf-green); }
.wf-sheet.is-wrong .wf-sheet-icon { background: var(--wf-red); }
.wf-sheet-listen { margin-left: auto; }
.wf-sheet p { margin: 8px 0 0; }
.wf-sheet .wf-actions { justify-content: flex-end; margin-top: 12px; }
/* Keyboard shortcuts, shown where there is a keyboard to use them. */
.wf-kbd {
    display: none;
    margin-left: 8px;
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 5px;
    font: inherit;
    font-size: 0.72em;
    font-weight: 600;
    line-height: 1.5;
    opacity: 0.75;
}
@media (hover: hover) and (pointer: fine) {
    .wf-kbd { display: inline-block; }
}
.wf-sheet .wf-update { margin-top: 12px; background: #fff; }
/* After a correct answer the Continue button fills up, then moves on by itself. */
.wf-button.is-counting { position: relative; overflow: hidden; isolation: isolate; }
.wf-auto {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--wf-red-deep);
    transform: scaleX(0);
    transform-origin: left center;
    animation: wf-auto-fill 2s linear forwards;
}
@keyframes wf-auto-fill { to { transform: scaleX(1); } }
.wf-task.is-answered .wf-option:not(.is-right):not(.is-chosen-wrong) { opacity: 0.55; }
.wf-task.is-answered .wf-secondary-actions { visibility: hidden; }
.wf-option.is-right, .wf-task input.is-right { border-color: var(--wf-green); background: #f0f8f3; }
.wf-option.is-right { animation: wf-bounce 0.4s ease; }
.wf-option.is-chosen-wrong, .wf-task input.is-chosen-wrong { border-color: var(--wf-red); background: #fff4f2; }
.wf-option.is-chosen-wrong, .wf-task input.is-chosen-wrong { animation: wf-shake 0.35s ease; }
.wf-option:disabled { cursor: default; color: var(--wf-charcoal); }
.wf-label { color: var(--wf-gray); }
.wf-given,
.wf-expected { font-weight: 700; }
.wf-points { color: var(--wf-green); font-weight: 700; }
.wf-sheet-head .wf-points { animation: wf-pop-in 0.4s 0.1s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.wf-note { color: var(--wf-gray); }

/* Where new words start in a deck */
.wf-start-line { color: var(--wf-gray); }
.wf-start-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 12px; margin: 12px 0; }
.wf-start-tool { display: flex; gap: 8px; margin: 0; }
.wf-start-tool input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    font: inherit;
    background: var(--wf-white);
}
.wf-start-tool .wf-button { flex: none; padding: 10px 16px; }
.wf-start-found { list-style: none; padding: 0; margin: 0 0 12px; }
.wf-start-found li { margin: 4px 0; }
.wf-start-list { list-style: none; padding: 0; margin: 0 0 12px; background: var(--wf-white); border: 1px solid var(--wf-border); border-radius: var(--wf-radius); overflow: hidden; }
.wf-start-list > li + li { border-top: 1px solid var(--wf-border); }
.wf-start-row {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 0 12px;
    width: 100%;
    padding: 8px 14px;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: start;
    cursor: pointer;
}
.wf-start-row:hover,
.wf-start-row:focus-visible { background: var(--wf-neutral); outline: none; }
.wf-start-row.is-selected { background: #fff4f2; box-shadow: inset 4px 0 0 var(--wf-red); }
.wf-start-pos { color: var(--wf-gray); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.wf-start-word { font-weight: 700; overflow-wrap: anywhere; }
.wf-start-word small { display: block; font-weight: 400; color: var(--wf-gray); }
.wf-start-meaning { overflow-wrap: anywhere; }
.wf-start-learned,
.wf-start-here { grid-column: 2 / -1; justify-self: start; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; }
.wf-start-learned { background: #f0f8f3; color: var(--wf-green); }
.wf-start-here { background: var(--wf-neutral); color: var(--wf-gray); border: 1px solid var(--wf-border); }
.wf-start-more { display: block; width: 100%; padding: 12px; text-align: center; }
.wf-start-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: var(--wf-white);
    border-top: 1px solid var(--wf-border);
    box-shadow: 0 -6px 20px rgba(41, 41, 41, 0.08);
}
.wf-start-bar .wf-actions { margin-top: 0; }
.wf-start-choice { margin: 0 0 8px; font-weight: 700; }
@media (max-width: 520px) {
    .wf-start-tools { grid-template-columns: minmax(0, 1fr); }
    .wf-start-row { grid-template-columns: 2.8rem minmax(0, 1fr); }
    .wf-start-meaning { grid-column: 2; color: var(--wf-gray); }
}

/* Deck page */
.wf-back { display: inline-block; margin-bottom: 8px; }
.wf-table-wrap { overflow-x: auto; background: var(--wf-white); border: 1px solid var(--wf-border); border-radius: var(--wf-radius); }
.wf-table { width: 100%; border-collapse: collapse; }
.wf-languages { line-height: 1.9; }
.wf-chip-small { display: inline-block; margin-right: 4px; padding: 0 8px; border: 1px solid var(--wf-border); border-radius: 999px; background: var(--wf-neutral); font-size: 0.8rem; line-height: 1.6; }
.wf-table th,
.wf-table td { padding: 10px 12px; border-bottom: 1px solid var(--wf-border); text-align: start; vertical-align: top; }
.wf-table th { background: var(--wf-neutral); font-size: 0.9rem; }
.wf-table small { display: block; }
.wf-pager { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 12px 0; }
.wf-table-number { width: 3.5rem; color: var(--wf-gray); font-variant-numeric: tabular-nums; }
.wf-word-table td { vertical-align: middle; }
.wf-word-table .wf-play { width: 36px; height: 36px; }
.wf-word { display: inline-flex; flex-direction: column; font-weight: 700; overflow-wrap: anywhere; }
.wf-word small { font-weight: 400; }
.wf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Dashboard: flags, and the words-known chart */
.wf-flag {
    flex: none;
    width: 24px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(41, 41, 41, 0.14);
    object-fit: cover;
    vertical-align: -2px;
}
.wf-language-title { display: flex; align-items: center; gap: 10px; }
.wf-choice-flag { display: flex; align-items: center; gap: 12px; }
.wf-chip-small .wf-flag { width: 18px; height: 12px; margin-right: 5px; vertical-align: -1px; }
.wf-words-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.wf-words-head h2 { margin-bottom: 2px; }
.wf-words-total { min-height: 2.4rem; margin: 0; color: var(--wf-gray); }
.wf-words-total strong { margin-right: 4px; color: var(--wf-red); font-size: 2rem; line-height: 1.1; }
.wf-words-tabs { margin: 0; border-bottom: 0; }
.wf-words-chart { position: relative; height: 240px; margin: 12px 0 8px; }
.wf-words-chart:empty { display: none; }
.wf-words-chart.is-empty { height: 110px; }
.wf-words-empty {
    display: grid;
    place-items: center;
    height: 100%;
    margin: 0;
    padding: 0 16px;
    border: 1px dashed var(--wf-border);
    border-radius: 12px;
    background: var(--wf-neutral);
    color: var(--wf-gray);
    text-align: center;
}

/* Waiting for the words after a starting point */
.wf-spinner {
    width: 44px;
    height: 44px;
    margin: 8px auto 16px;
    border: 4px solid var(--wf-border);
    border-top-color: var(--wf-red);
    border-radius: 50%;
    animation: wf-spin 0.9s linear infinite;
}
.wf-preparing-count { min-height: 1.5em; font-weight: 700; }
.wf-known { padding-left: 20px; }

/* Dialogs */
.wf-dialog {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(41, 41, 41, 0.55);
}

.wf-dialog .wf-card { width: 100%; max-width: 440px; margin: 0; }

@media (min-width: 640px) {
    .wf-options { grid-template-columns: 1fr 1fr; }
    h1 { font-size: 1.9rem; }
}

@media (max-width: 560px) {
    .wf-header-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; }
    .wf-brand img { height: 26px; }
    .wf-nav { order: 3; width: 100%; }
}

@media (max-width: 420px) {
    .wf-nav a { padding: 6px 8px; }
    .wf-stat strong { font-size: 1.4rem; }
    .wf-target.is-large .wf-target-text { font-size: 2.1rem; }
}

/* Speaking (R4) */
.wf-speak-area { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.wf-speak { display: inline-flex; align-items: center; gap: 8px; }
.wf-recording { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--wf-charcoal); font-weight: 600; }
.wf-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wf-red); animation: wf-pulse 1s ease-in-out infinite; }
.wf-seconds { color: var(--wf-gray); font-variant-numeric: tabular-nums; }
.wf-score strong { font-size: 1.2rem; }
@keyframes wf-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .wf-dot { animation: none; } }

/* Personal decks and cards (R5) */
.wf-picture { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0 auto 16px; border-radius: 12px; }
.wf-picture-preview .wf-picture { width: 160px; margin: 8px 0; }
.wf-cropper { display: block; width: 320px; max-width: 100%; height: auto; aspect-ratio: 1; margin: 12px auto; border-radius: 8px; touch-action: none; cursor: grab; background: var(--wf-neutral); }
.wf-warning { color: var(--wf-red); font-weight: 600; }
.wf-form fieldset { border: 1px solid var(--wf-border); border-radius: 12px; padding: 12px 16px; }
.wf-form textarea { font: inherit; }

/* Sharing, community and leaderboards (R6) */
.wf-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 12px; }
.wf-community-deck { display: flex; gap: 16px; align-items: flex-start; }
.wf-community-deck h3 { margin: 0 0 4px; font-size: 1.1rem; }
.wf-community-deck p { margin: 2px 0; }
.wf-cover { flex: none; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.wf-share-link { margin: 12px 0 0; }
.wf-share-link input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--wf-border);
    border-radius: 10px;
    background: var(--wf-neutral);
    color: var(--wf-charcoal);
    font: inherit;
}
.wf-card > .wf-button + .wf-form { margin-top: 20px; }
.wf-button-secondary.is-selected { background: var(--wf-red); color: var(--wf-white); }
.wf-comments h2 { margin-top: 0; }
.wf-comment { padding: 12px 0; border-top: 1px solid var(--wf-border); }
.wf-comment .wf-hint { margin: 0; }
.wf-comment-body { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wf-comment-actions { display: flex; gap: 16px; }
.wf-comment.is-reply { margin: 8px 0 0 12px; padding: 4px 0 4px 12px; border-top: 0; border-left: 3px solid var(--wf-border); }
.wf-table tr.is-me td { background: #fff4f2; font-weight: 700; }

/* Lifetime access and deleting WordFarm (R7) */
.wf-price { margin: 0 0 4px; font-size: 1.1rem; }
.wf-price strong { font-size: 2rem; color: var(--wf-charcoal); }
.wf-features { padding-left: 20px; margin: 16px 0; }
.wf-features li { margin: 4px 0; }
.wf-danger-button { background: var(--wf-red-deep); }

/* Sign-up protection */
.wf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wf-captcha { min-height: 78px; }

/* Welcome offer */
.wf-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-color: var(--wf-red); background: #fff4f2; }
.wf-offer p { margin: 0; }
.wf-offer .wf-actions { margin-top: 0; }
.wf-offer-code { letter-spacing: 0.04em; }
.wf-offer-ends { white-space: nowrap; color: var(--wf-red-deep); font-weight: 700; }
.wf-countdown { display: inline-flex; align-items: flex-start; font-variant-numeric: tabular-nums; vertical-align: top; }
.wf-cd-part { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wf-cd-part small { font-size: 0.6em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.wf-cd-sep { padding: 0 2px; }
.wf-offer-line { padding: 10px 14px; border-radius: 10px; background: #fff4f2; }
.wf-price s { color: var(--wf-gray); font-weight: 600; }

/* The settings save result, next to the button */
.wf-save-actions {
    position: sticky; top: 76px; z-index: 2; padding: 6px 0;
    background: var(--wf-white); min-height: 36px;
}
.wf-save-status { margin: 0; font-weight: 600; }
.wf-save-status.is-success { color: var(--wf-green); }
.wf-save-status.is-error { color: var(--wf-red-deep); }

/* Motion: short, calm transitions so the app feels like an app */
@keyframes wf-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wf-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wf-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes wf-pop-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes wf-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes wf-sheet-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes wf-bounce { 0% { transform: none; } 40% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes wf-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.wf-main > * { animation: wf-enter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wf-main > :nth-child(2) { animation-delay: 0.04s; }
.wf-main > :nth-child(3) { animation-delay: 0.08s; }
.wf-main > :nth-child(n + 4) { animation-delay: 0.12s; }
.wf-flash.is-visible, .wf-update { animation: wf-enter 0.25s ease-out both; }
.wf-dialog { animation: wf-fade-in 0.2s ease-out both; }
.wf-dialog > * { animation: wf-pop-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wf-dialog.is-closing { pointer-events: none; animation: wf-fade-out 0.16s ease-in both; }
.wf-dialog.is-closing > * { animation: wf-pop-out 0.16s ease-in both; }
.wf-button, .wf-option, .wf-play, .wf-nav a, .wf-link {
    transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
        opacity 0.2s ease, box-shadow 0.15s ease;
}
.wf-option:not(:disabled):hover { box-shadow: 0 2px 10px rgba(41, 41, 41, 0.08); }
/* Hovering: whatever can be pressed lifts a little (owner request, 12 October 2026). Mouse pointers only. */
.wf-deck, .wf-community-deck, .wf-choice, .wf-list-item, .wf-chip span, .wf-flag, .wf-brand img, .wf-tab,
.wf-start-row, .wf-table td, .wf-example-pair {
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.15s ease, background-color 0.15s ease,
        color 0.15s ease;
}
@media (hover: hover) {
    .wf-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(214, 35, 17, 0.24); }
    .wf-button-secondary:not(:disabled):hover { box-shadow: 0 5px 14px rgba(41, 41, 41, 0.1); }
    .wf-deck:hover, .wf-community-deck:hover { border-color: #e7b3ac; box-shadow: 0 8px 22px rgba(41, 41, 41, 0.08); transform: translateY(-2px); }
    .wf-choice:hover, .wf-list-item:hover { box-shadow: 0 6px 16px rgba(41, 41, 41, 0.08); transform: translateY(-2px); }
    .wf-choice:hover .wf-flag { transform: scale(1.15) rotate(-4deg); }
    .wf-chip:hover span { border-color: var(--wf-red); }
    .wf-play:hover { transform: scale(1.07); }
    .wf-brand:hover img { transform: scale(1.03); }
    .wf-tab:hover { color: var(--wf-red-deep); }
    .wf-table tbody tr:hover td { background: #fbfaf8; }
    .wf-table tbody tr.is-me:hover td { background: #ffece8; }
    .wf-example-pair:hover { border-color: #e7b3ac; border-left-color: var(--wf-red); }
}
.wf-button:not(:disabled):active, .wf-option:not(:disabled):active, .wf-play:active { transform: scale(0.97); }
.wf-toast {
    position: fixed;
    left: 50%;
    top: 84px;
    z-index: 30;
    max-width: min(92vw, 460px);
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--wf-charcoal);
    color: var(--wf-white);
    box-shadow: 0 10px 30px rgba(41, 41, 41, 0.25);
    transform: translateX(-50%);
    animation: wf-toast-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.wf-toast.is-leaving { animation: wf-toast-out 0.3s ease-in both; }
@keyframes wf-toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes wf-toast-out { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -12px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}
.wf-why { font-weight: 400; }

/* Card editor (owner request, 14 October 2026): suggestions inside their field, examples in tabs. */
.wf-input-action { position: relative; display: block; }
.wf-field .wf-input-action input { padding-right: 116px; }
.wf-inline-action {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid #f1b8b0;
    border-radius: 999px;
    background: #fff4f2;
    color: var(--wf-red-deep);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.wf-inline-action:hover { background: #ffe9e5; border-color: var(--wf-red); }
.wf-inline-action:disabled { cursor: progress; }
.wf-button-small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.wf-button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wf-spin 0.8s linear infinite;
}
.wf-button.is-busy, .wf-inline-action.is-busy { gap: 8px; opacity: 1; cursor: progress; }
.wf-field input.is-filled, .wf-field textarea.is-filled { animation: wf-filled 1.2s ease; }
@keyframes wf-filled {
    from { background: #fff4f2; box-shadow: 0 0 0 3px rgba(214, 35, 17, 0.18); }
    to { background: var(--wf-white); box-shadow: none; }
}
.wf-examples-editor { gap: 0; }
.wf-ex-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--wf-border); }
.wf-ex-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -2px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--wf-gray);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.wf-ex-tab[aria-selected="true"] { border-bottom-color: var(--wf-red); color: var(--wf-red-deep); }
.wf-ex-tab:hover { color: var(--wf-red-deep); }
.wf-ex-tab:focus-visible { outline: 2px solid var(--wf-red); outline-offset: -2px; border-radius: 8px 8px 0 0; }
.wf-ex-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wf-green); }
.wf-ex-panel { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.wf-ex-panel[hidden] { display: none; }
.wf-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wf-panel-head .wf-hint { margin: 0; font-weight: 400; }
@media (max-width: 520px) {
    .wf-panel-head { flex-direction: column; align-items: stretch; }
    .wf-field .wf-input-action input { padding-right: 104px; }
}
@media (prefers-reduced-motion: reduce) {
    .wf-button-spinner { animation-duration: 2s; }
    .wf-field input.is-filled, .wf-field textarea.is-filled { animation: none; }
}

/* Deck pages and dashboard (owner request, 14 October 2026): clear card statuses, room under the buttons. */
.wf-deck-actions { margin: 16px 0 24px; flex-wrap: wrap; }
.wf-deck-actions + .wf-table-wrap, .wf-deck-actions + .wf-hint { margin-top: 0; }
.wf-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.wf-status.is-preparing { color: var(--wf-gray); }
.wf-status.is-preparing .wf-button-spinner { color: var(--wf-red); }
.wf-status.is-ready { color: var(--wf-green); }
.wf-status.is-failed { color: var(--wf-red-deep); }
.wf-deck .wf-status.is-preparing { min-height: 40px; }

/* Daily goal (owner request, 14 October 2026): a calendar of the last twelve weeks, and fireworks. */
.wf-goal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wf-goal-head h2 { margin: 0; }
.wf-goal-today { margin: 4px 0 0; color: var(--wf-gray); }
.wf-goal-streak { margin: 0; color: var(--wf-gray); }
.wf-goal-streak strong { color: var(--wf-red); font-size: 28px; }
.wf-goal-calendar {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 16px);
    grid-auto-columns: 16px;
    gap: 4px;
    margin: 16px 0 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.wf-day { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: #ecebe8; }
.wf-day.is-blank { visibility: hidden; }
.wf-day.is-part { background: #f6b4ab; }
.wf-day.is-met { background: var(--wf-red); }
.wf-day.is-today { box-shadow: 0 0 0 2px var(--wf-white), 0 0 0 3px var(--wf-charcoal); }
.wf-goal-legend { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--wf-gray); font-size: 13px; }
.wf-goal-legend span { margin: 0 4px; }
.wf-goal-legend .wf-day { width: 12px; height: 12px; border-radius: 3px; }
.wf-summary.is-goal h1 { color: var(--wf-red); animation: wf-pop-in 0.4s ease both; }
.wf-goal-done { margin-top: 0; }
.wf-fireworks { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; pointer-events: none; }
@media (max-width: 520px) {
    .wf-goal-calendar { grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; }
    .wf-day { width: 13px; height: 13px; }
}
.wf-main > .wf-status.is-preparing, .wf-card > .wf-status.is-preparing { margin-top: 12px; }
