/* ==========================================================================
   ScienceHutch: Push & Pull (forces.html only).
   Colors, buttons and type come from main.css. Same playful layout as
   Spectrum Quest and Making Waves. Force arrows use one color per kind:
   orange = pushes, pink-red = friction, yellow = net force, blue = gravity/floor.
   Everything that moves stops for people who ask for reduced motion (bottom).
   ========================================================================== */

.fo-page {
  --push: #FF8A2B;
  --fric: #FF5A6E;
  --net: #FFE14D;
  --grav: #7FD0FF;
  --good: #7CFF9E;
  --bad: #FF9B8A;
  --glass: rgba(30, 22, 20, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
}
.fo-wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.fo-page [hidden] { display: none !important; }
.fo-page h1, .fo-page h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; }
.fo-page button { font: inherit; }
.fo-page button:focus-visible, .fo-page input:focus-visible, .fo-page summary:focus-visible, .fo-page a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ======= INTRO ======= */
.fo-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(ellipse 55% 50% at 80% 35%, rgba(255, 138, 43, 0.22), transparent 70%),
    radial-gradient(ellipse 45% 45% at 15% 80%, rgba(127, 208, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 60% 100%, rgba(255, 90, 110, 0.10), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.fo-sky, .fo-sky::after {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 30% 60%, #ffe9c7, transparent),
    radial-gradient(1.3px 1.3px at 48% 12%, #fff, transparent), radial-gradient(1px 1px at 66% 42%, #cfeaff, transparent),
    radial-gradient(1.2px 1.2px at 88% 20%, #fff, transparent), radial-gradient(1px 1px at 8% 70%, #fff, transparent);
  background-size: 380px 380px; opacity: 0.55;
}
.fo-sky::after { content: ""; background-size: 280px 280px; background-position: 90px 40px; animation: fo-twinkle 5s ease-in-out infinite alternate; }
@keyframes fo-twinkle { from { opacity: 0.1; } to { opacity: 0.8; } }
.fo-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.fo-hero h1 { margin: 0; font-size: clamp(2.8rem, 8.5vw, 5.4rem); }
.fo-hero h1 span {
  background: linear-gradient(90deg, #FFB86B, #FF8A2B 35%, #FF5A6E 65%, #FFE14D);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fo-shimmer 7s ease-in-out infinite alternate;
}
@keyframes fo-shimmer { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.fo-lead { max-width: 36em; margin: 18px 0 12px; font-size: clamp(1.08rem, 2.2vw, 1.25rem); }
.fo-promise { max-width: 40em; margin: 0 0 26px; color: var(--muted); }
.fo-hero-ctas { justify-content: flex-start; }
.fo-hero-art { width: 100%; max-width: 520px; justify-self: center; overflow: visible; }
.fo-tug { animation: fo-tug 2.6s ease-in-out infinite alternate; }
@keyframes fo-tug { 0% { transform: translateX(-7px); } 100% { transform: translateX(7px); } }
.fo-puller-l { animation: fo-lean-l 1.3s ease-in-out infinite alternate; transform-origin: 70px 194px; }
.fo-puller-r { animation: fo-lean-r 1.3s ease-in-out infinite alternate; transform-origin: 410px 194px; }
@keyframes fo-lean-l { from { transform: rotate(-4deg); } to { transform: rotate(-9deg); } }
@keyframes fo-lean-r { from { transform: rotate(4deg); } to { transform: rotate(9deg); } }
.fo-hero-arrows { animation: fo-pulse-op 1.6s ease-in-out infinite alternate; }
@keyframes fo-pulse-op { from { opacity: 0.65; } to { opacity: 1; } }
.fo-hero-label { fill: #FFB86B; font: 800 15px var(--font); }
.fo-hero-note { fill: var(--muted); font: 600 13px var(--font); }

/* How to play */
.fo-how {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  scroll-margin-top: 80px;
}
.fo-how::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, var(--push), var(--fric), var(--net), var(--grav)); }
.fo-how h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.fo-how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.fo-how-step { padding: 18px 18px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); }
.fo-how-step h3 { margin: 4px 0 6px; font-size: 1.2rem; }
.fo-how-step p { margin: 0; color: var(--muted); }
.fo-how-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: var(--on-accent); font-weight: 800; box-shadow: 0 0 18px rgba(255, 138, 43, 0.6); }
.fo-how-tip { margin: 18px 0 0; }

/* ======= STICKY PROGRESS BAR ======= */
.fo-questbar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 9, 8, 0.84);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.fo-questbar-inner { display: flex; align-items: center; gap: 8px 12px; min-height: 52px; padding-block: 6px; }
.fo-medals { display: flex; gap: 6px; margin-right: auto; }
.fo-medal {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 2px dashed #6B5A54; border-radius: 50%;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 0.85rem;
  transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.fo-medal.on { border: 2px solid #FFE9A8; background: radial-gradient(circle at 35% 30%, #FFF3C4, #FFB000 55%, #B87400); color: #3A2400; box-shadow: 0 0 14px rgba(255, 190, 60, 0.6); }
.fo-streak { color: #FFB86B; font-weight: 800; white-space: nowrap; }
.fo-bar-pill {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 6px 12px;
  border: 1px solid #9A6A58; border-radius: 999px;
  background: transparent; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap;
}
a.fo-bar-pill:hover, .fo-sound:hover { border-color: var(--orange); }
.fo-sound { gap: 6px; cursor: pointer; font-weight: 600; }
.fo-sound[aria-pressed="true"] { border-color: var(--orange); background: rgba(255, 138, 43, 0.12); }
@media (max-width: 599px) {
  .fo-sound-label { display: none; }
  .fo-questbar-inner { gap: 6px; flex-wrap: wrap; }
  .fo-bar-pill { padding: 6px 9px; }
  .fo-streak { order: 5; flex-basis: 100%; text-align: right; font-size: 0.85rem; }
  .fo-streak:empty { display: none; }
}

/* ======= LEVELS ======= */
.fo-level { padding-block: clamp(2.5rem, 6vw, 4.5rem); scroll-margin-top: 60px; }
.fo-level-alt {
  background: radial-gradient(ellipse 60% 40% at 10% 0%, rgba(255, 138, 43, 0.08), transparent 70%), radial-gradient(ellipse 50% 40% at 100% 100%, rgba(127, 208, 255, 0.07), transparent 70%), #0E0B0B;
  border-block: 1px solid var(--border);
}
.fo-level-head { margin-bottom: 28px; }
.fo-level-tag {
  display: inline-block; margin: 0 0 10px; padding: 4px 12px;
  border-radius: 999px; background: linear-gradient(90deg, var(--push), var(--net));
  color: #120A06; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
.fo-level h2 { margin: 0 0 12px; font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
.fo-intro { max-width: 46em; margin: 0; color: var(--muted); font-size: 1.1rem; }
.fo-intro strong { color: var(--ink); }

/* ======= GAME CARDS ======= */
.fo-game {
  position: relative;
  margin-top: 28px;
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(40, 28, 24, 0.75), rgba(18, 14, 14, 0.88));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  scroll-margin-top: 64px;
}
.fo-game-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.fo-game-head h3 { margin: 0 0 4px; font-size: clamp(1.3rem, 3vw, 1.6rem); }
.fo-game-head p { max-width: 52em; margin: 0; color: var(--muted); }
.fo-game-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font-size: 1.6rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.fo-law-icon { background: radial-gradient(circle at 35% 30%, #FFF3C4, #FFB000 55%, #B87400); color: #3A2400; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.2rem; border-radius: 50%; box-shadow: 0 0 18px rgba(255, 190, 60, 0.45); }
.fo-bigidea { margin-top: 22px; padding: 16px 18px; border-left: 4px solid var(--orange); border-radius: 0 14px 14px 0; background: rgba(255, 138, 43, 0.07); }
.fo-bigidea p { margin: 0; }

/* Lab layout: picture on the left, controls on the right */
.fo-crate, .fo-car, .fo-race, .fo-skate, .fo-sled { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 1.75rem); align-items: start; }
.fo-stage svg { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }
.fo-svg-text { fill: var(--ink); font: 700 15px var(--font); }
.fo-arrow-label { font: 800 14px var(--font); paint-order: stroke; stroke: #0B0A10; stroke-width: 4px; }
.fo-crate-label { fill: #3A2010; font: 800 16px var(--font); }
.fo-tick { fill: #5A4E48; font: 600 12px var(--font); }
.fo-bonk { fill: #FFE14D; font: 900 28px var(--font-display); }
.fo-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.88rem; }
.fo-legend li::before { content: ""; display: inline-block; width: 18px; height: 5px; margin-right: 6px; border-radius: 3px; vertical-align: middle; }
.fo-key-push::before { background: var(--push); } .fo-key-fric::before { background: var(--fric); } .fo-key-net::before { background: var(--net); } .fo-key-grav::before { background: var(--grav); }
.fo-controls { display: flex; flex-direction: column; gap: 12px; }
.fo-slider { display: grid; grid-template-columns: 1fr 4em; gap: 4px 10px; align-items: center; }
.fo-slider label { grid-column: 1 / -1; font-weight: 700; }
.fo-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.fo-slider input[type="range"] { width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.fo-slider input::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), var(--track, var(--push))); }
.fo-slider input::-moz-range-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), var(--track, var(--push))); }
.fo-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -8px; border: 3px solid #fff; border-radius: 50%; background: var(--track, var(--push)); box-shadow: 0 0 12px var(--track, var(--push)); }
.fo-slider input::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--track, var(--push)); }
.fo-slider-b { --track: #4FA8FF; }
.fo-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.fo-seg-btn, .fo-small-btn {
  min-height: 42px; padding: 6px 12px;
  border: 1px solid #6B5A54; border-radius: 999px;
  background: rgba(255, 255, 255, 0.03); color: var(--ink);
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}
.fo-seg-btn:hover, .fo-small-btn:hover { border-color: var(--orange); }
.fo-seg-btn[aria-pressed="true"] { border-color: var(--orange); background: rgba(255, 138, 43, 0.16); }
.fo-row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fo-check { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fo-check input { width: 20px; height: 20px; accent-color: var(--orange); }
.fo-status { min-height: 3em; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.fo-lane { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 14px; display: grid; gap: 8px; }
.fo-lane legend { padding: 0 6px; font-weight: 800; }
.fo-race-controls .fo-seg-btn { font-size: 0.82rem; padding: 6px 10px; }
.fo-toggle {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  min-height: 48px; padding: 8px 18px 8px 10px;
  border: 1px solid #9A6A58; border-radius: 999px;
  background: rgba(124, 255, 158, 0.06); color: var(--ink); font-weight: 600; cursor: pointer;
}
.fo-toggle-track { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #3A2622; transition: background-color 0.3s; }
.fo-toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.3s cubic-bezier(.2, 1.4, .4, 1); }
.fo-toggle[aria-pressed="true"] .fo-toggle-track { background: #2E9C52; box-shadow: 0 0 12px rgba(124, 255, 158, 0.5); }
.fo-toggle[aria-pressed="true"] .fo-toggle-knob { transform: translateX(20px); }

/* Discovery checklists */
.fo-finds { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fo-finds li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); transition: background-color 0.3s; }
.fo-check-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #6B5A54; border-radius: 50%; font-size: 0.85rem; font-weight: 900; }
.fo-finds li.done { background: rgba(124, 255, 158, 0.10); }
.fo-finds li.done .fo-check-dot { border-color: var(--good); background: var(--good); color: #062010; }
.fo-finds li.done .fo-check-dot::before { content: "✓"; }

/* ======= QUIZ GAMES ======= */
.fo-scorebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 14px; color: var(--muted); }
.fo-scorebar strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.fo-hearts { margin-left: auto; letter-spacing: 2px; }
.fo-card-stage { display: grid; place-items: center; min-height: 160px; margin-bottom: 16px; }
.fo-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(100%, 460px); padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px;
  background: linear-gradient(160deg, #2C211C, #171211);
  text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.fo-card-emoji { font-size: 3rem; line-height: 1; }
.fo-card-text { margin: 0; font-size: 1.2rem; font-weight: 700; }
.fo-law-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fo-law-btn {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 10px 14px;
  border: 1px solid #6B5A54; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); color: var(--ink); text-align: left; cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.fo-law-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--orange); box-shadow: 0 0 18px rgba(255, 138, 43, 0.25); }
.fo-law-btn small { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.fo-law-num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF3C4, #FFB000 55%, #B87400); color: #3A2400; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.fo-law-btn:disabled, .fo-choice:disabled { cursor: default; opacity: 0.55; }
.fo-law-btn.right, .fo-choice.right { opacity: 1; border: 2px solid var(--good); box-shadow: 0 0 22px rgba(124, 255, 158, 0.35); }
.fo-law-btn.wrong, .fo-choice.wrong { opacity: 1; border: 2px dashed var(--bad); }
.fo-choices { display: grid; gap: 10px; }
.fo-choice {
  min-height: 52px; padding: 12px 16px;
  border: 1px solid #6B5A54; border-radius: 14px;
  background: rgba(255, 255, 255, 0.03); color: var(--ink); text-align: left; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.fo-choice:hover:not(:disabled) { transform: translateX(3px); border-color: var(--orange); }
.fo-net-stage svg { display: block; width: 100%; height: auto; margin-bottom: 14px; border-radius: 18px; }
.fo-feedback { min-height: 1.5em; margin: 12px 0 0; }
.fo-feedback.good { color: var(--good); }
.fo-feedback.bad { color: var(--bad); }
.fo-next-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.fo-result { margin-top: 18px; padding: 22px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); text-align: center; }
.fo-result p { margin: 0 0 10px; }
.fo-result-stars { font-size: 2.4rem; color: #FFD45A; letter-spacing: 6px; text-shadow: 0 0 18px rgba(255, 212, 90, 0.6); }
.fo-result-title { font-weight: 800; font-size: 1.2rem; }
.finished .fo-card-stage, .finished .fo-law-btns, .finished .fo-net-stage, .finished .fo-choices, .finished .fo-case, .finished > .fo-feedback { display: none; }
.fo-case {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 16px; padding: 18px 20px;
  border: 1px solid rgba(255, 225, 77, 0.25); border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 225, 77, 0.08), rgba(255, 255, 255, 0.03));
  transition: border-color 0.4s, box-shadow 0.4s;
}
.fo-case.healed { border-color: var(--good); box-shadow: 0 0 30px rgba(124, 255, 158, 0.18); }
.fo-case-emoji { font-size: 2.6rem; line-height: 1; }
.fo-case-title { margin: 0 0 4px; color: #FFE38A; font-weight: 800; }
.fo-case-text { margin: 0; font-size: 1.1rem; }
.fo-hint { margin-top: 18px; }
.fo-hint summary, .fo-teacher summary { cursor: pointer; font-weight: 700; }
.fo-hint p { color: var(--muted); }

/* ======= FINISH ======= */
.fo-bigideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: idea; }
.fo-bigideas li { position: relative; padding: 16px 18px 16px 58px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); counter-increment: idea; }
.fo-bigideas li::before { content: counter(idea); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--on-accent); font-weight: 900; box-shadow: 0 0 14px rgba(255, 138, 43, 0.5); }
.fo-badges-title { margin: 40px 0 14px; font-size: 1.4rem; }
.fo-badges { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.fo-badge a { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; padding: 16px 8px; border: 1px dashed #6B5A54; border-radius: 18px; color: var(--muted); text-align: center; text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.fo-badge a:hover { border-color: var(--orange); transform: translateY(-2px); }
.fo-badge-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); font-size: 1.7rem; font-weight: 800; }
.fo-badge-name { color: var(--ink); font-weight: 800; font-size: 0.95rem; }
.fo-badge-desc { font-size: 0.8rem; }
.fo-badge.is-earned a { border: 1px solid rgba(255, 212, 90, 0.55); background: radial-gradient(ellipse at 50% 0%, rgba(255, 212, 90, 0.14), transparent 70%); }
.fo-badge.is-earned .fo-badge-icon { background: radial-gradient(circle, #FFE9A8, #FF9F43); box-shadow: 0 0 22px rgba(255, 180, 70, 0.55); }
.fo-cert-wrap { margin-top: 28px; }
.fo-cert-locked { padding: 18px 20px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.fo-cert-locked p { margin: 0; }
.fo-cert { max-width: 720px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3rem); border-radius: 22px; background: #FFFBF3; color: #2A1A12; text-align: center; box-shadow: 0 0 0 6px #120A06, 0 0 0 10px #FF8A2B, 0 30px 60px rgba(0, 0, 0, 0.5); }
.fo-cert p { margin: 0 0 10px; }
.fo-cert-eyebrow { color: #8A3A10; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.fo-cert-title { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; background: linear-gradient(90deg, #D9480F, #E2412F, #B87400); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fo-cert-name { display: inline-block; padding: 0 18px 4px; border-bottom: 2px solid #D9C7B5; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 5vw, 2.4rem); font-style: italic; }
.fo-cert-text, .fo-cert-date { color: #5A4436; }
.fo-cert-date { font-size: 0.9rem; }
.fo-cert-medals { display: flex; justify-content: center; gap: 12px; margin: 16px 0 12px !important; }
.fo-cert-medals span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF3C4, #FFB000 55%, #B87400); color: #3A2400; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.fo-cert-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.fo-cert-actions label { font-weight: 700; }
.fo-cert-actions input { min-height: 48px; padding: 8px 14px; border: 1px solid #9A6A58; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; }
.fo-reset-row { margin: 28px 0 0; color: var(--muted); font-size: 0.92rem; text-align: center; }
.fo-link-btn { min-height: 40px; padding: 4px 2px; border: 0; background: none; color: var(--orange); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fo-teacher { margin-top: 32px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255, 255, 255, 0.02); }
.fo-teacher h4 { margin: 18px 0 6px; }
.fo-teacher ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.fo-teacher li { margin-bottom: 6px; }
.fo-teacher strong { color: var(--ink); }
.fo-more { text-align: center; }
.fo-more h2 { margin: 0 0 20px; font-size: clamp(1.6rem, 4vw, 2.2rem); }

/* ======= LITTLE REACTIONS ======= */
.fo-pop { animation: fo-pop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes fo-pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.fo-shake { animation: fo-shake 0.35s; }
@keyframes fo-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.fo-feedback.good, .fo-feedback.bad { animation: fo-in 0.35s ease-out; }
@keyframes fo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fo-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fo-reveal.in { opacity: 1; transform: none; }

/* ======= POP-UP + CONFETTI LAYER ======= */
.fo-toast {
  position: fixed; left: 50%; top: 14px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  max-width: min(92vw, 460px); padding: 12px 18px 12px 12px;
  border: 1px solid rgba(255, 212, 90, 0.6); border-radius: 18px;
  background: rgba(24, 18, 16, 0.96);
  box-shadow: 0 0 30px rgba(255, 180, 70, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  transition: transform 0.5s cubic-bezier(.2, 1.4, .4, 1), opacity 0.3s;
}
.fo-toast.show { transform: translate(-50%, 0); opacity: 1; }
.fo-toast:empty { display: none; }
.fo-toast-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle, #FFE9A8, #FF9F43); color: #3A2400; font-family: Georgia, serif; font-weight: 700; font-size: 1.4rem; }
.fo-toast-body { display: flex; flex-direction: column; }
.fo-toast-body span { color: var(--muted); font-size: 0.9rem; }
.fo-fx { position: fixed; inset: 0; z-index: 55; width: 100vw; height: 100vh; pointer-events: none; }

/* ======= TABLETS ======= */
@media (max-width: 899px) {
  .fo-hero-inner { grid-template-columns: 1fr; }
  .fo-hero-art { max-width: 460px; }
  .fo-crate, .fo-car, .fo-race, .fo-skate, .fo-sled { grid-template-columns: 1fr; }
  .fo-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ======= PHONES ======= */
@media (max-width: 640px) {
  .fo-how-steps, .fo-bigideas, .fo-law-btns { grid-template-columns: 1fr; }
  .fo-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fo-game-head { flex-direction: column; gap: 10px; }
  .fo-game-icon { width: 44px; height: 44px; font-size: 1.35rem; }
  .fo-hero-ctas { flex-direction: column; align-items: stretch; }
  .fo-law-btn { min-height: 60px; }
  /* The pictures shrink on phones, so their labels get bigger to stay readable. */
  .fo-arrow-label { font-size: 21px; }
  .fo-svg-text { font-size: 22px; }
  .fo-tick { font-size: 18px; }
}
@media (max-width: 379px) {
  .fo-medal { width: 30px; height: 30px; font-size: 0.75rem; }
  .fo-bar-pill { padding: 5px 8px; font-size: 0.85rem; min-height: 38px; }
}

/* ======= REDUCED MOTION: everything holds still ======= */
@media (prefers-reduced-motion: reduce) {
  .fo-page *, .fo-page *::before, .fo-page *::after, .fo-toast { animation: none !important; transition: none !important; }
}

/* ======= PRINT: only the certificate when "Print certificate" is pressed ======= */
@media print {
  body.fo-print-cert * { visibility: hidden; }
  body.fo-print-cert .fo-cert, body.fo-print-cert .fo-cert * { visibility: visible; }
  body.fo-print-cert .fo-cert { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 6px double #FF8A2B; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
