:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --ink: #0f0f10;
    --ink-soft: #6b6b70;
    --line: #d4d4d4;
    --line-strong: #c0c0c0;
    --accent: #2f4ad0;
    --accent-soft: #eef1fc;
    --ok: #1f9d55;
    --ok-soft: #e7f6ec;
    --bad: #c53030;
    --bad-soft: #fdecec;
    --shadow-card: 0 8px 24px -12px rgba(15, 15, 16, 0.18);
    --shadow-focus: 0 0 0 4px rgba(15, 15, 16, 0.06);
    --shadow-toplink: 0 4px 14px -6px rgba(15, 15, 16, 0.12);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c0c0e;
    --surface: #141418;
    --surface-soft: #1c1c21;
    --ink: #f5f5f7;
    --ink-soft: #9b9ba3;
    --line: #2e2e35;
    --line-strong: #44444c;
    --accent: #7c8fff;
    --accent-soft: #1c2244;
    --ok: #4ade80;
    --ok-soft: #102a1a;
    --bad: #f87171;
    --bad-soft: #2c1414;
    --shadow-card: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-focus: 0 0 0 4px rgba(124, 143, 255, 0.18);
    --shadow-toplink: 0 4px 14px -6px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

a {
    color: inherit;
    text-decoration: none;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 30;
    background: var(--ink);
    color: var(--bg);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform 120ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Page shells */
.page-shell,
.practice-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 80px;
}

/* Top nav (shared with root) */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: clamp(24px, 4vw, 36px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    font-size: 13px;
}

.brand-dot {
    color: var(--ink-soft);
    margin: 0 2px;
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.nav-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 600;
}

.nav-tag i {
    font-size: 12px;
}

/* Theme toggle */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--ink);
    cursor: pointer;
    font-size: 14px;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.theme-toggle-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-icon-light {
    display: inline-block;
}

:root:not([data-theme="dark"]) .theme-toggle-icon-dark {
    display: inline-block;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 28px;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 120ms ease, border-color 120ms ease;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.breadcrumb i {
    font-size: 11px;
}

/* Hero */
.hero,
.practice-hero {
    padding: clamp(20px, 4vw, 32px) 0 clamp(28px, 5vw, 48px);
    max-width: 880px;
}

.eyebrow,
.card-kicker {
    margin: 0 0 14px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink);
}

h1 {
    font-weight: 600;
    font-size: clamp(2.2rem, 6.5vw, 4.4rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
}

.hero > p,
.practice-hero > p {
    margin: 20px 0 0;
    max-width: 600px;
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    color: var(--ink-soft);
}

.hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0 0;
    max-width: 480px;
}

.hero-facts div {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    padding: 16px;
}

.hero-facts dt {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.hero-facts dd {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Search (centered, below hero divider) */
.index-panel {
    padding-top: clamp(28px, 4vw, 40px);
    border-top: 1px solid var(--line);
}

.search-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: clamp(32px, 5vw, 48px);
}

.hero-search {
    position: relative;
    width: 100%;
    max-width: 520px;
}

.hero-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--ink-soft);
    pointer-events: none;
}

.hero-search-input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    padding: 10px 18px 10px 50px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.hero-search-input::placeholder {
    color: #9a9aa0;
}

.hero-search-input:focus {
    border-color: var(--ink);
    box-shadow: var(--shadow-focus);
    outline: 0;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

/* Cards list */
.card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card a {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.card a:hover,
.card a:focus-visible {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    outline: 0;
}

.card-kicker {
    margin: 0;
    color: var(--accent);
}

.card strong {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--ink);
}

.card span:not(.card-kicker):not(.card-meta) {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.card small {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.card-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
}

.card-featured a {
    border-color: var(--ink);
    background: var(--surface);
}

.card-featured .card-kicker {
    color: var(--accent);
}

.empty-message {
    grid-column: 1 / -1;
    margin: 24px 0 0;
    padding: 24px;
    text-align: center;
    color: var(--ink-soft);
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--surface-soft);
}

/* Practice / interactive cards */
.practice-card,
.difficulty-panel,
.interactive-card {
    display: grid;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    padding: clamp(20px, 4vw, 32px);
    margin-bottom: 16px;
}

.practice-card[hidden],
.difficulty-panel[hidden],
.interactive-card[hidden] {
    display: none;
}

.practice-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.practice-status p {
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
}

.practice-question {
    display: grid;
    gap: 10px;
}

.practice-question h2 {
    font-size: clamp(2rem, 6vw, 3.6rem);
    letter-spacing: -0.035em;
}

/* Difficulty */
.difficulty-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.difficulty-button {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.difficulty-button:hover,
.difficulty-button:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.difficulty-button.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.difficulty-help {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

/* Answer options */
.answer-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
}

.answer-button,
.restart-button {
    min-height: 56px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 16px;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.answer-button:hover,
.answer-button:focus-visible,
.restart-button:hover,
.restart-button:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.answer-button.correct {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: var(--ok);
}

.answer-button.incorrect {
    background: var(--bad-soft);
    border-color: var(--bad);
    color: var(--bad);
}

.answer-button:disabled {
    cursor: default;
    opacity: 1;
}

.next-button {
    width: min(100%, 320px);
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.next-button:hover,
.next-button:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* Feedback / notes */
.feedback,
.note-box,
.summary-box,
.step-hint {
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.95rem;
}

.feedback {
    min-height: 56px;
    font-weight: 500;
}

.step-hint {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.summary-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding-left: 1.2em;
    color: var(--ink-soft);
}

.summary-item {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.95rem;
    list-style-position: outside;
}

.summary-item.correct {
    background: var(--ok-soft);
    color: var(--ok);
}

.summary-item.incorrect {
    background: var(--bad-soft);
    color: var(--bad);
}

.summary-item.unanswered {
    color: var(--ink-soft);
    font-style: italic;
}

/* Step dots — progress indicator for stepper practice */
.step-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 4px;
    padding: 0;
    list-style: none;
}

.step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1px solid var(--line-strong);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.step-dot.current {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.2);
}

.step-dot.done.correct {
    background: var(--ok);
    border-color: var(--ok);
}

.step-dot.done.incorrect {
    background: var(--bad);
    border-color: var(--bad);
}

.summary-card {
    scroll-margin-top: 24px;
}

.summary-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 16, 0.44);
}

.summary-modal[hidden] {
    display: none;
}

.summary-modal-card {
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    margin: 0;
}

/* Drag-to-add practice */
.drag-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 16px;
    align-items: stretch;
}

.drag-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.drag-group,
.drag-total-zone {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 220px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.drag-total-zone {
    border-style: dashed;
    background: var(--surface);
    transition: background 120ms ease, border-color 120ms ease;
}

.drag-total-zone.ready,
.drag-total-zone.drop-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drag-total-zone.result-correct {
    border-color: var(--ok);
    border-style: solid;
    background: var(--ok-soft);
}

.drag-total-zone.result-incorrect {
    border-color: var(--bad);
    border-style: solid;
    background: var(--bad-soft);
}

.drag-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.drag-group h3,
.drag-total-zone h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--ink);
}

.count-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.drag-total-zone.ready .count-pill,
.drag-total-zone.drop-over .count-pill {
    background: var(--surface);
    color: var(--accent);
}

.drag-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 76px;
}

.drag-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(54px, 8vw, 72px);
    height: clamp(54px, 8vw, 72px);
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: grab;
    transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.drag-item:hover,
.drag-item:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    outline: 0;
}

.drag-item:active {
    cursor: grabbing;
}

.drag-item.moved {
    cursor: pointer;
    background: var(--surface);
    animation: slide-count-group 220ms ease both;
}

.drag-item img {
    display: block;
    width: 100%;
    height: 100%;
}

.drop-hint {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Make ten — example page */
.make-ten-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.make-ten-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.make-ten-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.make-ten-panel-title i {
    color: var(--accent);
    font-size: 12px;
}

.make-ten-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.ten-frame {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.ten-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    transition: background 160ms ease, border-color 160ms ease;
}

.ten-cell.filled-first {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.ten-cell.filled-first .ten-dot {
    background: var(--accent);
}

.ten-cell.filled-transfer {
    border-color: var(--ok);
    background: var(--ok-soft);
}

.ten-cell.filled-transfer .ten-dot {
    background: var(--ok);
}

.ten-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ten-frame-container {
    position: relative;
}

.frame-complete-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--ok-soft);
    border: 2px solid var(--ok);
    color: var(--ok);
    font-size: 1rem;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: badge-pop 400ms ease-out both;
}

.frame-complete-badge i {
    font-size: 16px;
}

@keyframes badge-pop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.available-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 54px;
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    align-items: center;
}

.pool-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    transition: transform 160ms ease, opacity 160ms ease;
}

.pool-item img {
    width: 100%;
    height: 100%;
}

.pool-item.used {
    opacity: 0.2;
    transform: scale(0.7);
}

.pool-item.leftover {
    border: 2px solid var(--ok);
    border-radius: 50%;
    animation: leftover-glow 600ms ease-in-out infinite alternate;
}

@keyframes leftover-glow {
    from { box-shadow: 0 0 0 0 var(--ok-soft); }
    to   { box-shadow: 0 0 0 6px transparent; }
}

.make-ten-meta h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    margin: 4px 0 0;
}

.make-ten-counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    flex-shrink: 0;
}

.make-ten-counter span[data-step-number] {
    font-size: 1.6rem;
    color: var(--accent);
    line-height: 1;
}

.make-ten-counter-of {
    font-size: 0.75rem;
    color: var(--ink-soft);
    font-weight: 500;
    margin: 0 2px;
}

.make-ten-counter span[data-step-total] {
    font-size: 1rem;
    color: var(--ink-soft);
}

.make-ten-main {
    display: grid;
    gap: 20px;
}

.make-ten-scene {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.make-ten-scene-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.make-ten-scene-label i {
    color: var(--accent);
    font-size: 11px;
}

.ten-frame-container {
    position: relative;
}

.ten-frame {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.ten-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    transition: background 160ms ease, border-color 160ms ease;
}

.ten-cell.filled-first {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.ten-cell.filled-first .ten-dot {
    background: var(--accent);
}

.ten-cell.filled-transfer {
    border-color: var(--ok);
    background: var(--ok-soft);
}

.ten-cell.filled-transfer .ten-dot {
    background: var(--ok);
}

.ten-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ten-frame .ten-cell {
    aspect-ratio: 1;
    min-height: 54px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    display: grid;
    place-items: center;
    transition: background 160ms ease, border-color 160ms ease;
}

.ten-cell.filled-first {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.ten-cell.filled-first .ten-dot {
    background: var(--accent);
}

.ten-cell.filled-transfer {
    border-color: var(--ok);
    background: var(--ok-soft);
}

.ten-cell.filled-transfer .ten-dot {
    background: var(--ok);
}

.ten-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--line-strong);
}

.frame-complete-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--ok-soft);
    border: 2px solid var(--ok);
    color: var(--ok);
    font-size: 1rem;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: badge-pop 400ms ease-out both;
}

.frame-complete-badge i {
    font-size: 16px;
}

@keyframes badge-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.available-container {
    padding-top: 4px;
}

.available-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 54px;
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    align-items: center;
}

.make-ten-equation {
    text-align: center;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.make-ten-equation.show-result {
    color: var(--ok);
    border-color: var(--ok);
    background: var(--ok-soft);
}

.step-text {
    margin: 0;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.pool-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.pool-item img {
    width: 100%;
    height: 100%;
}

.pool-item.used {
    opacity: 0.2;
    transform: scale(0.7);
}

.pool-item.leftover {
    border: 2px solid var(--ok);
    border-radius: 50%;
    animation: leftover-glow 600ms ease-in-out infinite alternate;
}

@keyframes leftover-glow {
    from { box-shadow: 0 0 0 0 var(--ok-soft); }
    to   { box-shadow: 0 0 0 6px transparent; }
}

@media (max-width: 760px) {
    .make-ten-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .make-ten-counter {
        align-self: flex-start;
    }
}

/* Interactive examples */
.interactive-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.interactive-equation {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--accent);
}

.interactive-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.group-zone {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 200px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.group-zone p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.total-zone {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
}

.total-zone p {
    color: var(--accent);
}

.visual-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.visual-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(48px, 8vw, 76px);
    height: clamp(48px, 8vw, 76px);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.visual-item img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Note: .moving / .joined are no longer applied via CSS keyframes.
     Motion for .visual-item is now driven by anime.js
     (see suma/js/ejemplos-interactivos.js). */

.join-symbol {
    align-self: center;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--ink-soft);
}

.interactive-feedback {
    margin: 0;
}

.interactive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.interactive-actions .restart-button {
    flex: 1 1 180px;
}

/* Slide-page (reveal.js) */
.reveal {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.reveal .slides {
    text-align: left;
}

.reveal section {
    min-height: 100%;
}

.slide-card {
    display: grid;
    align-content: center;
    gap: clamp(18px, 3vw, 30px);
    min-height: 78vh;
    padding: clamp(24px, 5vw, 56px);
    border: 0;
    background: transparent;
}

.slide-card.centered {
    text-align: center;
    justify-items: center;
}

.reveal h1,
.reveal h2,
.reveal h3 {
    margin: 0;
    color: var(--ink);
    font-family: inherit;
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-transform: none;
}

.reveal h1 {
    font-size: clamp(2.4rem, 7vw, 4.8rem);
    font-weight: 600;
}

.reveal h2 {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 600;
}

.reveal h3 {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 600;
}

.reveal p,
.reveal li,
.reveal button,
.reveal input {
    font-family: inherit;
}

.reveal p,
.reveal li {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    line-height: 1.5;
    color: var(--ink);
}

.lead {
    max-width: 820px;
    color: var(--ink-soft);
}

.starter-row {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.starter-row img {
    width: clamp(52px, 10vw, 86px);
    height: clamp(52px, 10vw, 86px);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.mini-equation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    font-weight: 600;
}

.mini-equation span {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.mini-equation strong {
    color: var(--accent);
}

.sum-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--accent);
    font-size: clamp(1.8rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.counter-board,
.object-stage {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 760px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.counter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.alt-group {
    animation: slide-count-group 1.7s ease both;
}

.counter-plus {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    color: var(--ink-soft);
}

.dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(36px, 8vw, 60px);
    height: clamp(36px, 8vw, 60px);
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
}

.dot.alt {
    background: var(--ok-soft);
    color: var(--ok);
}

.object-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(42px, 8vw, 68px);
    height: clamp(52px, 9vw, 86px);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.object-card img {
    display: block;
    width: 100%;
    height: 100%;
}

.object-card.moving {
    animation: slide-count-group 1.6s ease both;
}

.object-card.delay {
    animation-delay: 0.18s;
}

.object-card.late {
    animation-delay: 0.36s;
}

.pencils,
.stars {
    background: var(--surface-soft);
}

.example-grid {
    display: grid;
    gap: 24px;
}

/* Top link (slide pages) */
.top-link {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-toplink);
}

.top-link:hover,
.top-link:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.top-link i {
    font-size: 11px;
}

.top-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
    box-shadow: var(--shadow-toplink);
}

/* Slide head: eyebrow chip + counter */
.slide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    max-width: 920px;
}

.slide-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.slide-chip i {
    font-size: 12px;
}

.slide-counter {
    font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: var(--ink-soft);
    font-weight: 600;
}

/* Cover slide */
.slide-cover {
    text-align: center;
    justify-items: center;
    gap: clamp(20px, 3vw, 32px);
}

.cover-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.cover-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 14px;
}

.cover-brand-name {
    letter-spacing: -0.01em;
}

.reveal .slide-cover h1 em,
.reveal .slide-card h2 em {
    font-style: normal;
    color: var(--accent);
}

.cover-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 500;
}

.cover-hint i {
    color: var(--accent);
    font-size: 12px;
}

/* Practice intro steps */
.practice-steps {
    display: inline-flex;
    gap: 10px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.practice-steps li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.practice-steps li span {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Example caption */
.example-caption {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    color: var(--ink);
    text-align: center;
    max-width: 720px;
}

.example-caption strong {
    color: var(--accent);
    font-weight: 700;
}

/* Note box with icon (definition slide) */
.note-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    max-width: 720px;
}

.note-box p {
    margin: 0;
}

.note-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
}

/* Step hint with icon */
.step-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.step-hint i {
    font-size: 12px;
}

/* Exercise slides: bigger answer grid */
.exercise-slide {
    justify-items: center;
}

.exercise-slide h2 {
    text-align: center;
    font-size: clamp(2.4rem, 8vw, 4.4rem);
    color: var(--accent);
    letter-spacing: -0.035em;
}

.exercise-slide .answer-options {
    width: min(100%, 680px);
    max-width: 680px;
    gap: 14px;
}

.exercise-slide .answer-button {
    min-height: 84px;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.exercise-slide .feedback {
    width: min(100%, 680px);
    text-align: center;
}

/* Summary slide */
.slide-summary {
    text-align: left;
    justify-items: stretch;
}

.slide-summary h2 {
    font-size: clamp(2rem, 6vw, 3.4rem);
}

.slide-summary .summary-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    max-width: 880px;
}

.slide-summary .summary-box > div {
    flex: 1;
}

.slide-summary .summary-list {
    margin: 12px 0 0;
}

.slide-summary .next-button {
    justify-self: start;
    align-self: start;
    width: fit-content;
    min-width: 240px;
}

/* Reveal controls */
.reveal .controls,
.reveal .progress {
    color: var(--accent);
}

.reveal .controls button:focus,
.reveal a:focus,
.reveal button:focus {
    outline: 0;
    box-shadow: var(--shadow-focus);
}

@keyframes slide-count-group {
    from {
        opacity: 0;
        transform: translateX(28px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer (shared) */
.foot {
    margin-top: 80px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Responsive */
@media (max-width: 760px) {
    .nav {
        margin-bottom: 24px;
    }

    .hero-search-input {
        height: 52px;
    }

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

    .difficulty-options {
        grid-template-columns: 1fr;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }

    .drag-layout,
    .drag-source-grid {
        grid-template-columns: 1fr;
    }

    
    .interactive-actions {
        display: grid;
    }

    .interactive-stage {
        grid-template-columns: 1fr;
    }

    .join-symbol {
        text-align: center;
    }

    .slide-card {
        min-height: 82vh;
    }

    .slide-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .slide-summary .summary-box {
        flex-direction: column;
    }

    .practice-steps {
        flex-wrap: wrap;
        justify-content: center;
    }

    .top-link {
        font-size: 0.8rem;
    }
}
