/* Maths in a Flash: website styles. Colours come from the approved mockup (see CLAUDE.md). */
:root {
  --orange: #C2410C;
  --orange-ink: #9A3412;
  --orange-ink-hover: #7C2D12;
  --pale: #FFF4E6;
  --band: #FFF1E0;
  --chip: #FFEDD5;
  --circle: #FFD9A8;
  --border: #FCE3C7;
  --border-2: #F3D9BF;
  --border-3: #F0C9A0;
  --heading: #1F2430;
  --text: #3F4654;
  --quiet: #4B5361;
  --footer: #1F2430;
  --footer-small: #C9CDD6;
  --footer-flash: #FDBA74;
  --radius: 22px;
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: "Lexend", Verdana, Arial, sans-serif; font-size: 17px; line-height: 1.6;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 .5em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--orange); }
a:hover { color: var(--orange-ink-hover); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; padding: 12px 18px; z-index: 10; font-weight: 600; }
.skip:focus { left: 12px; top: 12px; }
.accent { color: var(--orange); }
.intro { font-size: 1.15rem; color: var(--text); max-width: 46em; }
.quiet { color: var(--quiet); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { border-bottom: 2px solid var(--border); background: #fff; position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); font-weight: 700; font-size: 1.3rem; min-height: 44px; }
.logo img { width: 44px; height: 44px; }
.logo b { color: var(--orange); }
.nav-toggle { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--heading); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--pale); color: var(--orange-ink); }
.site-nav a.btn { color: #fff; margin-left: 6px; }
.site-nav a.btn:hover { background: var(--orange-ink); color: #fff; }

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--orange);
  background: var(--orange); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--orange-ink); border-color: var(--orange-ink); color: #fff; }
.btn.ghost { background: #fff; color: var(--orange-ink); border-color: var(--border-3); }
.btn.ghost:hover { background: var(--pale); color: var(--orange-ink-hover); }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: 0 30px; }
.chips { display: flex; flex-wrap: nowrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; overflow: hidden; }
.chip { display: inline-flex; align-items: center; white-space: nowrap; background: var(--chip); color: var(--orange-ink); border-radius: 999px; padding: 3px 12px; font-size: .88rem; font-weight: 600; }
.players { display: inline-flex; align-items: center; gap: 6px; color: var(--quiet); font-size: .95rem; font-weight: 500; }

/* ---------- Hero ---------- */
.hero { background: var(--pale); border-bottom: 2px solid var(--border); }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.hero p.intro { font-size: 1.2rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
/* The circle is sized to Flash, never to the page, so it can't spread over the text. */
.hero-art { justify-self: center; width: min(400px, 100%); aspect-ratio: 1; border-radius: 50%; background: var(--circle); display: grid; place-items: center; overflow: hidden; }
.hero-art img { width: 70%; height: auto; }

.page-head { background: var(--pale); border-bottom: 2px solid var(--border); }
.page-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 34px; padding-bottom: 34px; }
.page-head .art { flex: 0 0 auto; width: 150px; height: 150px; border-radius: 50%; background: var(--circle); display: grid; place-items: center; }
.page-head .art img { width: 120px; }
.page-head p:last-child { margin-bottom: 0; }

section.block { padding: 52px 0; }
section.block.pale { background: var(--pale); border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }

/* ---------- Practise tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 26px 16px;
  border: 2px solid var(--border-2); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--heading);
}
.tile:hover { border-color: var(--orange); background: var(--pale); color: var(--heading); }
.tile .sym { width: 84px; height: 84px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: 2.8rem; font-weight: 700; line-height: 1; }
.tile strong { font-size: 1.2rem; }
.tile span.count { color: var(--quiet); font-size: .95rem; }

/* ---------- Game cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; }
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border: 2px solid var(--border-2); border-radius: var(--radius); background: #fff; overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--orange); transform: translateY(-2px); }
.card:focus-within { border-color: var(--orange); }
.card-band { position: relative; background: var(--band); height: 118px; border-bottom: 2px solid var(--border); }
.card-band .syms { position: absolute; left: 18px; top: 12px; display: flex; gap: 6px; color: var(--orange); font-size: 3.2rem; font-weight: 700; line-height: 1; }
.card-band .syms.small { font-size: 2.2rem; top: 18px; }
.card-band img { position: absolute; right: 12px; bottom: 0; height: 108px; width: auto; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 20px 18px; }
.card h2, .card h3 { font-size: 1.2rem; margin: 0 0 10px; }
.card h2 a, .card h3 a { color: var(--heading); text-decoration: none; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h2 a:focus-visible, .card h3 a:focus-visible { outline: none; }
.card h2 a:focus-visible::after, .card h3 a:focus-visible::after { outline: 3px solid var(--orange); outline-offset: -3px; }
.card p.explainer { font-size: 1rem; margin: 0 0 14px; }
.card .card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .play { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--orange); color: #fff; font-weight: 600; }
.card:hover .play { background: var(--orange-ink); }
.card .versions { font-size: .9rem; color: var(--quiet); }

/* ---------- Filters ---------- */
.filters { border: 2px solid var(--border-2); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; background: #fff; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row .label { font-weight: 600; color: var(--heading); min-width: 128px; }
.filter-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--border-3);
  background: #fff; color: var(--orange-ink); font: inherit; font-size: .98rem; font-weight: 600; cursor: pointer;
}
.filter-btn:hover { background: var(--pale); }
.filter-btn[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search label { font-weight: 600; color: var(--heading); min-width: 128px; }
.search input {
  font: inherit; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--border-3);
  width: min(420px, 100%); color: var(--heading);
}
.result-count { font-weight: 600; color: var(--heading); margin: 0 0 16px; }
.no-results { display: flex; align-items: center; gap: 20px; border: 2px dashed var(--border-3); border-radius: var(--radius); padding: 22px; background: var(--pale); }
.no-results img { width: 90px; flex: 0 0 auto; }
.no-results p { margin: 0; font-size: 1.05rem; }
[hidden] { display: none !important; }

/* ---------- Game page ---------- */
.breadcrumb { font-size: .95rem; margin: 22px 0 14px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px 0 4px; color: var(--quiet); }
.breadcrumb a { color: var(--orange-ink); }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.game-meta .chips { margin: 0; }
.bubble { display: flex; align-items: flex-start; gap: 16px; margin: 0 0 22px; }
.bubble img { width: 86px; flex: 0 0 auto; }
.bubble p {
  position: relative; margin: 6px 0 0; background: var(--pale); border: 2px solid var(--border-3);
  border-radius: var(--radius); padding: 14px 18px; font-size: 1.1rem; color: var(--heading);
}
.bubble p::before {
  content: ""; position: absolute; left: -12px; top: 22px; width: 20px; height: 20px; background: var(--pale);
  border-left: 2px solid var(--border-3); border-bottom: 2px solid var(--border-3); transform: rotate(45deg);
}
.versions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.versions-bar .label { font-weight: 600; color: var(--heading); margin-right: 4px; }
.game-frame {
  position: relative; border: 2px solid var(--border-2); border-radius: var(--radius); overflow: hidden;
  background: var(--band) url("/img/flash-jump-sm.webp") no-repeat center / 180px auto;
}
.game-frame iframe { display: block; width: 100%; height: 540px; border: 0; background: transparent; }
.game-frame.loaded { background: #fff; }
.game-frame:fullscreen { border-radius: 0; border: 0; background: #fff; }
.game-frame:fullscreen iframe { height: 100%; }
.game-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0 8px; }
.game-text { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 34px; }
.panel { border: 2px solid var(--border-2); border-radius: var(--radius); padding: 22px 24px; background: #fff; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { font-size: 1.4rem; }
.panel ol, .panel ul { margin: 0; padding-left: 1.3em; }
.panel li { margin: 0 0 8px; }
ol.steps { list-style: none; padding: 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-left: 46px; min-height: 34px; margin-bottom: 12px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.year-line { display: inline-block; background: var(--chip); color: var(--orange-ink); font-weight: 600; border-radius: 999px; padding: 8px 18px; margin: 26px 0 0; }

/* ---------- Text pages ---------- */
.prose { max-width: 46em; font-size: 1.06rem; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 8px; }
.split { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.flash-aside { text-align: center; }
.flash-aside .circle { width: 240px; height: 240px; margin: 0 auto; border-radius: 50%; background: var(--circle); display: grid; place-items: center; }
.flash-aside img { width: 190px; }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; counter-reset: t; }
.tips li { counter-increment: t; border: 2px solid var(--border-2); border-radius: var(--radius); background: #fff; padding: 22px; }
.tips li::before {
  content: counter(t); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 1.2rem; margin-bottom: 12px;
}
.tips strong { display: block; color: var(--heading); font-size: 1.15rem; margin-bottom: 4px; }
.feature { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center; }
.feature .circle { width: 220px; height: 220px; border-radius: 50%; background: var(--circle); display: grid; place-items: center; }
.feature .circle img { width: 170px; }
.feature.flip { grid-template-columns: 1fr 220px; }
.feature.flip .circle { order: 2; }
.op-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: #fff; margin-top: 64px; padding: 44px 0 30px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.2fr 2fr; gap: 30px; }
.site-footer .logo { color: #fff; }
.site-footer .logo b { color: var(--footer-flash); }
.site-footer p { color: var(--footer-small); font-size: .95rem; margin: 10px 0 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
.site-footer a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--footer-flash); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--footer-flash); }
.site-footer .small { grid-column: 1 / -1; border-top: 1px solid #3A4152; padding-top: 18px; font-size: .9rem; color: var(--footer-small); }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .flash-aside { order: -1; }
}
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
    border: 2px solid var(--border-3); background: #fff; color: var(--orange-ink); font: inherit; font-weight: 600; cursor: pointer;
  }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 2px solid var(--border); padding: 10px 20px 18px; }
  .site-nav.open { display: block; }
  .no-js .site-nav { display: block; position: static; padding: 0 0 12px; }
  .no-js .nav-toggle { display: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { width: 100%; }
  .site-nav a.btn { margin: 6px 0 0; }
  .hero .wrap { grid-template-columns: 1fr; padding-top: 30px; padding-bottom: 34px; }
  .hero-art { order: -1; width: min(240px, 64%); }
  .game-text { grid-template-columns: 1fr; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 18px; }
  .feature .circle, .feature.flip .circle { order: -1; width: 170px; height: 170px; }
  .feature .circle img { width: 130px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .page-head .art { width: 104px; height: 104px; }
  .page-head .art img { width: 84px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .tiles { gap: 12px; }
  .tile { padding: 18px 10px; }
  .tile .sym { width: 64px; height: 64px; font-size: 2.2rem; }
  .tile strong { font-size: 1.02rem; }
  .tile span.count { font-size: .88rem; }
  .cards { grid-template-columns: 1fr; }
  .filter-row .label, .search label { min-width: 0; width: 100%; }
  .game-frame iframe { height: 75vh; min-height: 480px; }
  .page-head .art { display: none; }
  .bubble img { width: 62px; }
  .logo { font-size: 1.12rem; }
  .logo img { width: 38px; height: 38px; }
  .chip { font-size: .8rem; padding: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
@media print { .site-header, .site-footer, .game-frame, .game-actions, .filters { display: none; } }
