/* header */
.site-header { position: relative; top: 0; z-index: 50; background: var(--bg-1); border-bottom: 1px solid var(--line); }
.site-header__bar { display: flex; align-items: center; gap: var(--s-3); min-height: var(--header-h); }
.brand { display: block; flex: none; }
.brand img { height: 1.75rem; width: auto; }
.nav-toggle { margin-left: auto; display: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; background: var(--bg-3); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; }
.js .nav-toggle { display: inline-flex; }
.site-nav { flex-basis: 100%; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: block; padding: var(--s-3) 0; min-height: 2.75rem; color: var(--text); text-decoration: none; font-weight: var(--fw-medium); border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--red-300); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red-500); }
.header-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.site-header__bar { flex-wrap: wrap; padding-block: var(--s-2); }
.header-actions { margin-left: auto; }
.js .header-actions { margin-left: 0; }
@media (min-width: 48em) { .site-header { position: sticky; } }
@media (min-width: 64em) {
  .site-header__bar { flex-wrap: nowrap; gap: var(--s-5); }
  .nav-toggle, .js .nav-toggle { display: none; }
  .site-nav, .js .site-nav { display: block; flex: 1; }
  .site-nav ul { display: flex; gap: var(--s-5); flex-wrap: wrap; }
  .site-nav a { padding: var(--s-2) 0; min-height: 0; font-size: var(--fs-sm); }
  .brand img { height: 2rem; }
  .header-actions { margin-left: auto; }
}
/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 2.75rem; padding: 0 var(--s-5); border-radius: var(--r-sm); border: 1px solid transparent; font: inherit; font-size: .8125rem; font-weight: var(--fw-bold); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red-600); color: #fff; }
.btn--primary:hover { background: var(--red-700); color: #fff; }
.btn--ghost { background: var(--bg-3); color: var(--text); }
.btn--ghost:hover { background: var(--line-strong); color: #fff; }
.btn--outline { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--outline:hover { background: var(--bg-3); color: #fff; }
.btn--sm { padding: 0 var(--s-4); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* breadcrumbs / page head */
.breadcrumbs { padding-block: var(--s-4) 0; font-size: var(--fs-sm); color: var(--text-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--text-faint); }
.page-head { padding-block: var(--s-6) var(--s-5); }
.age-badge { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 2px solid var(--red-500); border-radius: 50%; font-weight: var(--fw-black); font-size: var(--fs-sm); }
/* sections */
.section { padding-block: var(--section-y); }
.section--band { background: var(--bg-1); }
.section > .container > h2, .section > .container > section > h3 { }
.section section { margin-top: var(--s-5); }
.section section > h3 { margin-top: 0; }
.lead { font-size: var(--fs-md); color: var(--text-muted); max-width: var(--prose); }
.prose-block { max-width: var(--prose); }
/* hero */
.hero { padding-block: var(--s-6); background: radial-gradient(ellipse at top right, var(--red-glow), transparent 60%), var(--bg-0); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; gap: var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.hero__panel { display: none; }
@media (min-width: 48em) {
  .hero { padding-block: var(--s-8); }
  .hero__grid { grid-template-columns: 7fr 5fr; align-items: center; }
  .hero__panel { display: grid; place-items: center; position: relative; min-height: 16rem; }
}
.hero__ring { position: absolute; border: 2px solid var(--red-500); border-radius: 50%; opacity: .35; }
.hero__ring--1 { width: 14rem; height: 14rem; }
.hero__ring--2 { width: 10rem; height: 10rem; opacity: .6; }
.hero__panel img { position: relative; width: 11rem; }
/* notice */
.notice { display: flex; gap: var(--s-3); padding: var(--s-4); background: var(--warn-bg); border-left: 4px solid var(--warn); border-radius: var(--r-sm); }
.notice .icon { color: var(--warn); margin-top: .2rem; }
.notice p { margin: 0; }
.notice-wrap { padding-block: var(--s-5); }
/* toc */
.toc { margin-bottom: var(--s-5); }
.toc ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.toc li { margin: 0; }
.toc a { display: inline-block; padding: var(--s-2) var(--s-4); background: var(--bg-3); border-radius: var(--r-pill); color: var(--text); text-decoration: none; font-size: var(--fs-sm); min-height: 2.75rem; line-height: 1.8rem; }
.toc a:hover { background: var(--line-strong); }
.with-toc { display: block; }
@media (min-width: 64em) {
  .with-toc { display: grid; grid-template-columns: 15rem 1fr; gap: var(--s-7); align-items: start; }
  .toc { position: sticky; top: calc(var(--header-h) + 1rem); }
  .toc ul { flex-direction: column; }
  .toc a { border-radius: var(--r-sm); display: block; }
}
:target, section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
/* cards */
.task-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (min-width: 48em) { .task-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
.task-grid li { margin: 0; }
.task-card, .tile { display: block; height: 100%; padding: var(--s-4); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); text-decoration: none; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
a.task-card:hover { border-color: var(--red-500); background: var(--bg-3); color: var(--text); }
.card__title { margin: var(--s-2) 0 var(--s-1); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.card__text { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.task-card .icon { color: var(--red-300); }
.tile-grid { display: grid; gap: var(--s-4); }
@media (min-width: 48em) { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
.tile-grid .tile { height: auto; }
.card-pair { list-style: none; padding: 0; display: grid; gap: var(--s-4); }
@media (min-width: 48em) { .card-pair { grid-template-columns: 1fr 1fr; } }
.card-pair li { margin: 0; }
/* steps */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--s-4); }
.steps > li { counter-increment: step; position: relative; padding: var(--s-4) var(--s-4) var(--s-4) 4rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: var(--s-4); top: var(--s-4); width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 2px solid var(--red-500); border-radius: 50%; font-weight: var(--fw-black); }
.steps--row { }
@media (min-width: 64em) { .steps--row { grid-template-columns: repeat(5, 1fr); } .steps--row > li { padding: 4rem var(--s-4) var(--s-4); } }
/* tables */
.table-wrap { margin: 0 0 var(--s-5); }
.table { width: 100%; border-collapse: collapse; background: var(--bg-2); }
.table caption { text-align: left; padding: var(--s-3) 0; font-weight: var(--fw-bold); color: var(--text-muted); font-size: var(--fs-sm); }
.table th, .table td { padding: var(--s-3) var(--s-4); text-align: left; border: 1px solid var(--line); vertical-align: top; }
.table thead th { background: var(--bg-3); }
@media (max-width: 40em) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td, .table th[scope="row"] { display: block; width: 100%; }
  .table tr { margin-bottom: var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
  .table td, .table th[scope="row"] { border: 0; border-bottom: 1px solid var(--line); }
  .table td::before, .table th[scope="row"]::before { content: attr(data-label); display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
}
/* lists */
.checklist, .signs { list-style: none; padding: 0; }
.checklist li, .signs li { position: relative; padding-left: 1.75rem; }
.checklist li::before { content: ""; position: absolute; left: .25rem; top: .45rem; width: .5rem; height: .9rem; border: solid var(--red-300); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.signs li::before { content: "!"; position: absolute; left: 0; top: 0; width: 1.25rem; text-align: center; font-weight: var(--fw-black); color: var(--warn); }
.kv { display: grid; gap: 0; margin: 0 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kv div { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; font-weight: var(--fw-medium); }
@media (min-width: 48em) { .kv div { grid-template-columns: 14rem 1fr; } }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { margin: 0; padding: var(--s-2) var(--s-4); background: var(--bg-3); border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: var(--fs-sm); }
.glossary { margin: 0 0 var(--s-4); }
.glossary dt { font-weight: var(--fw-bold); margin-top: var(--s-4); }
.glossary dd { margin: var(--s-1) 0 0; color: var(--text-muted); }
.qa-item { padding: var(--s-4); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.qa-item h3 { font-size: var(--fs-md); }
.qa-item p { margin: 0; color: var(--text-muted); }
.next-steps { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.next-steps li { margin: 0; }
/* footer */
.site-footer { margin-top: var(--s-8); background: var(--bg-1); border-top: 1px solid var(--line); padding-block: var(--s-6); }
.site-footer__grid { display: grid; gap: var(--s-5); }
.site-footer nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.site-footer nav a { display: inline-block; padding: var(--s-2) 0; min-height: 2.75rem; color: var(--text); }
.site-footer img { height: 2rem; width: auto; margin-bottom: var(--s-3); }
.site-footer p { margin: 0 0 var(--s-2); color: var(--text-muted); font-size: var(--fs-sm); }
@media (min-width: 48em) { .site-footer__grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* page-head with image */
.page-head__grid { display: grid; gap: var(--s-5); }
.page-head__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.page-head .lead { margin-top: var(--s-3); }
@media (min-width: 48em) {
  .page-head__grid { grid-template-columns: 7fr 5fr; align-items: center; gap: var(--s-6); }
  .page-head__media img { aspect-ratio: 3 / 2; }
}

/* step illustrations */
.step__img { display: block; width: 100%; max-width: 16rem; height: auto; margin: var(--s-4) auto 0; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); }
.prose-block--wide { max-width: none; }
.prose-block--wide > h2, .prose-block--wide > p { max-width: var(--prose); }

/* game center */
.gc-tabs { display: none; flex-wrap: wrap; gap: var(--s-2); margin-block: var(--s-4); }
.js .gc-tabs { display: flex; }
.gc-tabs [aria-pressed="true"] { background: var(--red-600); border-color: transparent; color: #fff; }
.gc-grid { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 48em) { .gc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64em) { .gc-grid { grid-template-columns: repeat(4, 1fr); } }
.gc-card { margin: 0; padding: var(--s-2) var(--s-2) var(--s-3); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.gc-card[hidden] { display: none; }
.gc-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); margin-bottom: var(--s-2); }
.gc-card .card__title, .gc-card .card__text { margin: 0 var(--s-2); }
.gc-card__btn { display: flex; margin: var(--s-3) var(--s-2) 0; }

/* mobile app bar (fixed, not dismissible) */
.app-bar { display: none; }
@media (max-width: 47.99em) {
  .app-bar { display: flex; align-items: center; gap: var(--s-3); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom)); background: var(--bg-1); border-top: 2px solid var(--red-500); box-shadow: 0 -8px 24px rgba(0, 0, 0, .45); }
  .app-bar img { border-radius: var(--r-sm); flex: none; }
  .app-bar__text { display: grid; margin: 0; flex: 1; min-width: 0; line-height: var(--lh-snug); }
  .app-bar__text span { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body { padding-bottom: 4.25rem; }
}
.section-img { display: block; width: 100%; max-width: var(--prose); height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: var(--s-4) 0; border-radius: var(--r-md); border: 1px solid var(--line); }

/* desktop: text column + image beside it */
@media (min-width: 64em) {
  .prose-block:has(> .section-img) { max-width: none; display: grid; grid-template-columns: minmax(0, var(--prose)) minmax(0, 1fr); column-gap: var(--s-7); align-items: start; }
  .prose-block:has(> .section-img) > * { grid-column: 1; }
  .prose-block:has(> .section-img) > .section-img { grid-column: 2; grid-row: 1 / span 14; max-width: none; margin: 0; position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}

/* step cards with illustrations */
.step-cards { list-style: none; padding: 0; margin: var(--s-4) 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 48em) { .step-cards { grid-template-columns: repeat(4, 1fr); } }
.step-cards li { margin: 0; padding: var(--s-3); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.step-cards img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-sm); margin-bottom: var(--s-3); }
.step-cards p { margin: 0 0 var(--s-2); font-size: var(--fs-sm); color: var(--text-muted); }
.step-cards .step-cards__t { display: flex; align-items: center; gap: var(--s-2); color: var(--text); font-weight: var(--fw-bold); font-size: var(--fs-base); }
.step-cards__t span { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 2px solid var(--red-500); border-radius: 50%; font-size: var(--fs-sm); }
.page-head__note { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

.task-grid--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 48em) { .task-grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 48em) { .tile-grid--2 { grid-template-columns: repeat(2, 1fr); } }
