/* Sunny Meadow: layout and design tokens. Every --color-* token is defined here; the theme
   file (theme-meadow.css) only overrides these values and adds decoration such as blur,
   shadows and motion. No web fonts and no url() requests: the rounded display stack uses
   fonts already on the device. */
:root {
  /* Page and text */
  --color-page: #dff3ff;
  --color-text: #132238;
  --color-text-soft: #465770;
  --color-border: #d8eafa;
  --color-surface: #fff;
  --color-surface-glass: rgb(255 255 255 / 0.93);
  --color-surface-tint: #f3f9ff;
  --color-link: #0b62a4;
  --color-link-hover: #07497c;
  --color-accent: #0b72b3;
  --color-on-accent: #fff;
  --color-focus: #6d28d9;
  --color-scrim-top: rgb(225 245 255 / 0.45);
  --color-scrim-mid: rgb(255 250 238 / 0.78);
  --color-scrim-bottom: rgb(247 250 235 / 0.92);

  /* Header and footer */
  --color-header-bg: #4dbdf6;
  --color-header-bg-end: #2ea6ea;
  --color-header-border: rgb(255 255 255 / 0.55);
  --color-header-text: #0b2545;
  --color-header-link: #0b2545;
  --color-header-pill: rgb(255 255 255 / 0.55);
  --color-brand-bg: #042e24;
  --color-brand-border: rgb(255 255 255 / 0.42);
  --color-brand-shadow: rgb(15 76 129 / 0.28);
  --color-header-search-shadow: rgb(19 34 56 / 0.22);
  --color-footer-bg: rgb(255 255 255 / 0.9);
  --color-footer-border: rgb(22 134 201 / 0.18);
  --color-footer-text: #465770;
  --color-footer-link: #0b62a4;
  --color-mark-bg: #ffd84d;
  --color-mark-edge: #c78100;
  --color-key-bg: #ffefad;
  --color-key-edge: #e9b400;

  /* Primary button (search Go, video retry, active recording tab) */
  --color-primary: #ffd038;
  --color-primary-hover: #ffc61a;
  --color-primary-active: #f7b500;
  --color-on-primary: #132238;
  --color-primary-edge: #c78100;

  /* Secondary button (pager, recording tabs, link pills) */
  --color-secondary-bg: #fff;
  --color-secondary-hover: #e8f7ff;
  --color-secondary-active: #d4efff;
  --color-secondary-text: #0b62a4;
  --color-secondary-border: #0b62a4;
  --color-secondary-edge: #bfe0f7;
  --color-tab-text: #132238;
  --color-tab-border: #bfe0f7;

  /* Form */
  --color-input-bg: #fff;
  --color-input-text: #132238;
  --color-input-border: #b8dff9;
  --color-input-focus-border: #2ca8eb;
  --color-input-focus-ring: rgb(44 168 235 / 0.3);
  --color-search-bg: #f2f9ff;
  --color-search-border: #cde9fc;

  /* Messages, badges, pills, checks */
  --color-notice-bg: #fff4d4;
  --color-notice-border: #f3cf5a;
  --color-notice-text: #132238;
  --color-error-bg: #ffe4e8;
  --color-error-border: #f5b3c1;
  --color-error-text: #9b1535;
  --color-badge-bg: #fff0cf;
  --color-badge-text: #8a4a00;
  --color-badge-strong-bg: #ffe4e8;
  --color-badge-strong-text: #a3163a;
  --color-pill-bg: #eef6ff;
  --color-pill-border: #cbe4fa;
  --color-eyebrow-bg: #e8f7ff;
  --color-eyebrow-text: #0b62a4;
  --color-eyebrow-dot: #69b832;
  --color-success: #15803d;
  --color-success-bg: #dcfce7;
  --color-card-hover-border: #2ca8eb;
  --color-chip-bg: rgb(19 34 56 / 0.84);
  --color-chip-text: #fff;
  --color-art-frame: #f2cf9e;
  --color-art-from: #d7f1ff;
  --color-art-to: #ecfad8;

  /* Video placeholder */
  --color-video-bg: #131933;
  --color-video-text: #fff;
  --color-video-glow: rgb(255 208 56 / 0.28);
  --color-video-from: #2f4382;
  --color-video-to: #131933;
  --color-video-icon: #ffd038;
  --color-video-icon-glyph: #132238;
  --color-video-scrim: rgb(19 25 51 / 0.4);
  --color-video-scrim-edge: rgb(19 25 51 / 0.52);
  --color-video-label-border: rgb(255 255 255 / 0.22);

  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: Fredoka, ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-height: 64px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--color-page);
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  position: relative;
  background: transparent;
  color: var(--color-text);
  font: 16px/1.6 var(--font-body);
  overflow-wrap: break-word;
  overflow-x: clip;
}

/* Meadow backdrop: one fixed decorative <img> behind a soft scrim that keeps text readable. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, var(--color-scrim-top) 0%, var(--color-scrim-mid) 52%, var(--color-scrim-bottom) 100%);
}

a {
  color: var(--color-link);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
}

img,
svg {
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding-inline: 20px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--color-surface);
  padding: 6px 10px;
  z-index: 40;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  margin: 0 0 10px;
}

h3 {
  font-size: 1.05rem;
  margin: 18px 0 6px;
}

.lede {
  font-size: 1.04rem;
  color: var(--color-text-soft);
  max-width: 68ch;
  margin: 0 0 16px;
}

.hint {
  color: var(--color-text-soft);
  font-size: 14px;
}

/* Header & footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(100deg, var(--color-header-bg) 0%, var(--color-header-bg-end) 100%);
  border-bottom: 2px solid var(--color-header-border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  min-height: var(--header-height);
  flex-wrap: wrap;
  padding-block: 8px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 13px;
  background: var(--color-brand-bg);
  border: 1.5px solid var(--color-brand-border);
  box-shadow: 0 3px 0 var(--color-brand-shadow);
  color: var(--color-header-text);
  text-decoration: none;
}

.brand:hover {
  color: var(--color-header-text);
}

.brand-logo {
  display: block;
  height: 36px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

.main-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-header-link);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-header-pill);
  color: var(--color-header-link);
}

.site-footer {
  margin-top: 56px;
  border-top: 1.5px solid var(--color-footer-border);
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  font-size: 14px;
  padding: 22px 0 30px;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--color-footer-link);
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--color-link-hover);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 8px;
}

.footer-links a {
  padding: 4px 0;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

main {
  padding-top: 24px;
}

/* White rounded cards on the meadow */
.panel {
  background: var(--color-surface-glass);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
}

.section {
  margin-top: 44px;
}

.section > h2 {
  margin-bottom: 14px;
}

.page-head .level-search {
  margin-bottom: 0;
}

.prose {
  max-width: 860px;
}

.prose h2 {
  margin-top: 28px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

/* Breadcrumbs */
.crumbs {
  margin-bottom: 14px;
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-soft);
}

.crumbs a {
  font-weight: 600;
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs li[aria-current="page"] {
  font-weight: 700;
  color: var(--color-text);
}

.crumbs li + li::before {
  content: "›";
  margin-right: 6px;
}

/* Home hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 28px;
  align-items: center;
}

.hero-card {
  background: var(--color-surface-glass);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 32px 34px 28px;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-eyebrow-bg);
  color: var(--color-eyebrow-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-eyebrow-dot);
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-points li::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 12px;
  font-weight: 800;
}

.hero .level-search {
  margin: 0;
  max-width: none;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

.quick-links a {
  padding: 4px 11px;
  border: 1px solid var(--color-pill-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-weight: 700;
  text-decoration: none;
}

.quick-links a:hover {
  background: var(--color-secondary-hover);
}

.hero-board {
  display: block;
  justify-self: center;
  width: 100%;
  max-width: 380px;
  padding: 14px;
  border: 2px solid var(--color-surface);
  border-radius: 28px;
  background: var(--color-surface-glass);
  color: var(--color-text);
  text-decoration: none;
}

.hero-board img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 1032;
  border-radius: var(--radius-lg);
}

.hero-board-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 6px 6px 2px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Search */
.level-search {
  background: var(--color-search-bg);
  border: 1.5px solid var(--color-search-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 16px 0;
  max-width: 560px;
}

.level-search label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  font: 600 1rem var(--font-body);
  color: var(--color-input-text);
  padding: 0 16px;
  border: 2px solid var(--color-input-border);
  border-radius: var(--radius-md);
  background: var(--color-input-bg);
}

.search-row input:focus {
  outline: 3px solid var(--color-input-focus-ring);
  outline-offset: 1px;
  border-color: var(--color-input-focus-border);
}

.search-row button,
.video-retry {
  font: 700 1.05rem var(--font-display);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: 0 26px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--color-primary-edge);
}

.video-retry {
  padding: 8px 18px;
  font-size: 0.95rem;
}

.search-row button:hover,
.video-retry:hover {
  background: var(--color-primary-hover);
}

.search-row button:active,
.video-retry:active {
  background: var(--color-primary-active);
  box-shadow: 0 1px 0 var(--color-primary-edge);
}

.search-msg {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--color-notice-bg);
  border: 1px solid var(--color-notice-border);
  color: var(--color-notice-text);
  font-size: 15px;
}

.search-msg[data-state="invalid"] {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.level-search.level-search-header {
  position: relative;
  margin: 0;
  padding: 0;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.level-search-header .search-row {
  gap: 6px;
  align-items: center;
}

.level-search-header .search-row input {
  width: 148px;
  flex: 0 1 148px;
  height: 36px;
  padding: 0 11px;
  font-size: 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--color-surface);
  box-shadow: inset 0 1px 2px var(--color-header-search-shadow);
}

.level-search-header .search-row input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-surface);
}

.level-search-header .search-row button {
  height: 36px;
  padding: 0 14px;
  font-size: 0.92rem;
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--color-primary-edge);
  flex-shrink: 0;
}

.level-search-header .search-msg {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  margin: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  z-index: 30;
  box-shadow: 0 12px 28px -8px var(--color-header-search-shadow);
}

/* Section heading with a link on the right */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
}

.section-head .hint {
  margin: 4px 0 0;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-secondary-bg);
  border: 1.5px solid var(--color-secondary-edge);
  color: var(--color-secondary-text);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.link-pill:hover {
  background: var(--color-secondary-hover);
}

/* Level cards */
.level-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.level-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--color-surface);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  text-decoration: none;
}

.level-card a:hover {
  border-color: var(--color-card-hover-border);
  color: var(--color-text);
}

.card-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 12px;
  background: linear-gradient(135deg, var(--color-art-from), var(--color-art-to));
}

.art-frame,
.level-banner-art {
  display: block;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 4px solid var(--color-art-frame);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.art-frame img,
.art-frame svg,
.level-banner-art img,
.level-banner-art svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Board frames from the videos (480x419) fill the height of the card picture area at their
   own shape. Positioned, so the percentage height resolves against the 16:10 box. */
.art-frame.is-frame {
  position: absolute;
  top: 12px;
  left: 50%;
  width: auto;
  height: calc(100% - 24px);
  aspect-ratio: 480 / 419;
  transform: translateX(-50%);
}

.level-banner-art.is-frame {
  aspect-ratio: 480 / 419;
}

.card-chip {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--color-chip-bg);
  color: var(--color-chip-text);
  font-size: 0.75rem;
  font-weight: 700;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 16px 18px 18px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.level-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.level-pic {
  flex: 1;
  color: var(--color-text-soft);
  font-size: 0.92rem;
}

.card-cta {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-link);
}

.badge {
  display: inline-block;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-badge-bg);
  color: var(--color-badge-text);
  border-radius: 999px;
  padding: 3px 9px;
}

/* The hardest difficulty takes a stronger color. */
.badge-super-hard {
  background: var(--color-badge-strong-bg);
  color: var(--color-badge-strong-text);
}

.empty {
  background: var(--color-surface-glass);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* How guides are checked */
.checks-panel {
  margin-top: 44px;
}

.checks-panel > p {
  margin: 0 0 18px;
  color: var(--color-text-soft);
}

.check-tiles {
  list-style: none;
  counter-reset: check;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.check-tiles li {
  counter-increment: check;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-tint);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
}

.check-tiles li::before {
  content: counter(check);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-display);
}

/* Level page: the walkthrough video is the main content.
   --video-w keeps the whole portrait video inside the first screen on desktop. */
.level {
  --video-w: clamp(300px, calc((100svh - var(--header-height) - 150px) * 9 / 16), 460px);
}

.level:has(.switch-tabs) {
  --video-w: clamp(300px, calc((100svh - var(--header-height) - 235px) * 9 / 16), 460px);
}

.level-layout {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--video-w) + 32px) minmax(0, 1fr);
  grid-template-areas:
    "video head"
    "video steps"
    "video source";
  grid-template-rows: auto auto 1fr;
  gap: 18px 24px;
  align-items: start;
}

.level-head {
  grid-area: head;
  padding: 20px 24px;
}

.level-head-top {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.level-head .level-banner-art {
  width: 76px;
  height: 76px;
  border-width: 3px;
}

.level-head .level-banner-art.is-frame {
  height: auto;
}

.level-eyebrow {
  margin-bottom: 8px;
}

.level-head h1 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  margin: 0 0 8px;
}

.level-head .facts {
  margin: 0;
}

.board-check {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: var(--color-notice-bg);
  border: 1px solid var(--color-notice-border);
  color: var(--color-notice-text);
  font-size: 0.88rem;
  line-height: 1.48;
}

.level-layout > .recordings {
  grid-area: video;
  padding: 14px;
}

@media (min-width: 901px) and (min-height: 780px) {
  /* Only the player card sticks beside the steps when the viewport can show it whole. */
  .level-layout > .recordings {
    position: sticky;
    top: calc(var(--header-height) + 16px);
  }
}

.level-layout > .steps-panel {
  grid-area: steps;
}

.level-layout > .source-panel {
  grid-area: source;
  padding: 20px 24px;
}

.steps-panel .lede {
  margin: 0 0 14px;
  font-size: 1rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.overview-card {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-tint);
}

.overview-card-wide {
  grid-column: 1 / -1;
}

.overview-note {
  background: var(--color-pill-bg);
  border-color: var(--color-pill-border);
}

.overview-card h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--color-link);
}

.overview-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text);
}

.steps-heading {
  margin: 0 0 4px;
}

.steps-panel .steps-note {
  margin: 0 0 12px;
}

.level-picture {
  margin: 14px 0 0;
  color: var(--color-text-soft);
  font-size: 0.85rem;
}

.level-picture span {
  font-weight: 700;
}

/* Secondary source and check details live in their own card below the steps. */
.recordings > h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.recordings .video {
  margin: 0 auto;
}

.source-panel > h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.source-panel .source,
.source-panel .notes {
  color: var(--color-text-soft);
}

.source-panel .recording-meta h3 {
  margin: 12px 0 4px;
  font-size: 0.88rem;
}

.source-panel .recording-meta h3:first-child {
  margin-top: 0;
}

.source-panel .source p,
.source-panel .checks,
.source-panel .notes {
  font-size: 0.86rem;
}

.source-panel .checks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.facts li {
  padding: 4px 12px;
  border: 1px solid var(--color-pill-border);
  border-radius: 999px;
  background: var(--color-pill-bg);
  font-size: 0.84rem;
  font-weight: 700;
}

.facts span {
  color: var(--color-text-soft);
  font-weight: 600;
}

.facts span::after {
  content: ":";
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 11px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-tint);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-display);
  font-weight: 700;
}

/* Key time, action or check inside a step (written as **phrase** in the level data): a light
   highlighter band in the yellow of the primary buttons. Text stays the body color. */
.steps strong {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--color-key-bg);
  box-shadow: inset 0 -2px 0 var(--color-key-edge);
  color: var(--color-text);
  font-weight: 700;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.step-body {
  min-width: 0;
}

.step-title {
  margin: 1px 0 4px;
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--color-text);
}

.step-body p {
  margin: 0;
}

.recordings > .hint {
  margin-top: 0;
  font-size: 0.82rem;
}

/* Recording switcher: all players and source blocks are in the HTML, radios toggle visibility. */
.switch-input {
  grid-area: video;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.switch-tabs label {
  cursor: pointer;
  padding: 8px 14px;
  border: 2px solid var(--color-tab-border);
  border-radius: 999px;
  background: var(--color-secondary-bg);
  color: var(--color-tab-text);
  font-weight: 700;
  box-shadow: 0 3px 0 var(--color-secondary-edge);
}

.has-switcher > .recordings .recording-player,
.has-switcher > .source-panel .recording-meta {
  display: none;
}

.level-layout > .switch-input:nth-of-type(1):checked ~ .recordings .recording-player:nth-of-type(1),
.level-layout > .switch-input:nth-of-type(2):checked ~ .recordings .recording-player:nth-of-type(2),
.level-layout > .switch-input:nth-of-type(3):checked ~ .recordings .recording-player:nth-of-type(3),
.level-layout > .switch-input:nth-of-type(4):checked ~ .recordings .recording-player:nth-of-type(4),
.level-layout > .switch-input:nth-of-type(1):checked ~ .source-panel .recording-meta:nth-of-type(1),
.level-layout > .switch-input:nth-of-type(2):checked ~ .source-panel .recording-meta:nth-of-type(2),
.level-layout > .switch-input:nth-of-type(3):checked ~ .source-panel .recording-meta:nth-of-type(3),
.level-layout > .switch-input:nth-of-type(4):checked ~ .source-panel .recording-meta:nth-of-type(4) {
  display: block;
}

.level-layout > .switch-input:nth-of-type(1):checked ~ .recordings .switch-tabs label:nth-of-type(1),
.level-layout > .switch-input:nth-of-type(2):checked ~ .recordings .switch-tabs label:nth-of-type(2),
.level-layout > .switch-input:nth-of-type(3):checked ~ .recordings .switch-tabs label:nth-of-type(3),
.level-layout > .switch-input:nth-of-type(4):checked ~ .recordings .switch-tabs label:nth-of-type(4) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 3px 0 var(--color-primary-edge);
}

.level-layout > .switch-input:nth-of-type(1):focus-visible ~ .recordings .switch-tabs label:nth-of-type(1),
.level-layout > .switch-input:nth-of-type(2):focus-visible ~ .recordings .switch-tabs label:nth-of-type(2),
.level-layout > .switch-input:nth-of-type(3):focus-visible ~ .recordings .switch-tabs label:nth-of-type(3),
.level-layout > .switch-input:nth-of-type(4):focus-visible ~ .recordings .switch-tabs label:nth-of-type(4) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Video: the box reserves its final size before anything loads. */
.video {
  position: relative;
  width: min(100%, var(--video-w, 360px));
  aspect-ratio: var(--ratio, 9 / 16);
  margin: 0 auto 12px;
  border: 4px solid var(--color-video-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-video-bg);
}

.video .video-frame,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--color-video-text);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, var(--color-video-glow), transparent 60%),
    radial-gradient(circle at 50% 35%, var(--color-video-from) 0%, var(--color-video-to) 78%);
}

.video-play::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 48%, var(--color-video-scrim) 0%, transparent 46%, var(--color-video-scrim-edge) 100%),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 34%,
      var(--color-video-scrim) 44%,
      var(--color-video-scrim) 64%,
      transparent 74%,
      transparent 100%
    );
}

.video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  z-index: 0;
}

.video-play[hidden] {
  display: none;
}

.video-play:disabled {
  cursor: progress;
}

.video-play:disabled .video-play-text::after {
  content: "…";
}

.video-play-icon {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--color-video-icon);
  box-shadow:
    0 5px 0 var(--color-primary-edge),
    0 0 0 10px var(--color-video-glow),
    0 10px 24px var(--color-video-scrim);
}

.video-play-icon::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 21px;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--color-video-icon-glyph);
}

.video-play-label {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 16px);
  padding: 9px 15px;
  border-radius: 14px;
  background: var(--color-chip-bg);
  border: 1px solid var(--color-video-label-border);
  box-shadow: 0 8px 22px var(--color-video-scrim);
}

.video-play-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
}

.video-play-sub {
  font-size: 13px;
  line-height: 1.3;
  opacity: 0.92;
}

.video-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 18px;
  background: var(--color-error-bg);
  color: var(--color-error-text);
  text-align: center;
}

.video-status[hidden] {
  display: none;
}

.video-status p {
  margin: 4px 0;
}

.video-status-title {
  font-weight: 800;
}

.video-status a {
  color: var(--color-error-text);
  font-weight: 700;
  margin-right: 8px;
}

.video-noscript {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 10px;
  background: rgb(0 0 0 / 0.6);
  text-align: center;
}

.video-noscript a {
  color: #fff;
}

.source h3 {
  margin-top: 4px;
}

.source p {
  margin: 4px 0;
  font-size: 0.92rem;
}

.checked {
  font-weight: 700;
}

.checks,
.notes {
  margin: 6px 0;
  padding-left: 1.2em;
  font-size: 0.92rem;
}

.checks {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 4px;
}

.checks .ok span {
  color: var(--color-success);
  font-weight: 800;
}

.checks .no span {
  color: var(--color-error-text);
  font-weight: 800;
}

/* Prev / next verified levels */
.pager-panel {
  margin: 24px 0 8px;
  padding: 18px 22px;
}

.pager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.pager-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pager-all {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.pager-all:hover {
  text-decoration: underline;
}

.pager-note {
  margin: 4px 0 14px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border: 2px solid var(--color-tab-border);
  border-radius: var(--radius-md);
  background: var(--color-secondary-bg);
  color: var(--color-link);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--color-secondary-edge);
}

.pager-dir {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-soft);
}

.pager-num {
  font-family: var(--font-display);
  font-size: 1rem;
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

.pager a:hover {
  background: var(--color-secondary-hover);
  color: var(--color-link-hover);
}

.search-again .level-search {
  margin-top: 20px;
}

/* Focus: one violet ring everywhere, visible on yellow, white and sky blue. */
.level-card a:focus-visible,
.hero-board:focus-visible,
.pager a:focus-visible,
.link-pill:focus-visible,
.quick-links a:focus-visible,
.search-row button:focus-visible,
.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.video-play:focus-visible {
  outline: 3px solid var(--color-video-text);
  outline-offset: -6px;
  box-shadow: inset 0 0 0 3px var(--color-focus);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column in reading order: title, video, steps. The video uses the full panel width. */
  .level {
    --video-w: 460px;
  }

  .level-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "video"
      "steps"
      "source";
    grid-template-rows: auto;
  }

  .level-layout > .recordings {
    position: static;
  }

  .hero-board {
    max-width: 300px;
  }

  .check-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 92px;
  }

  .header-row {
    gap: 6px 10px;
    padding-block: 6px;
  }

  .header-tools {
    display: contents;
  }

  .main-nav {
    order: 2;
    margin-left: auto;
  }

  .level-search.level-search-header {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
  }

  .level-search-header .search-row input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 38px;
  }

  .level-search-header .search-row button {
    height: 38px;
    padding: 0 18px;
  }

  .level-search-header .search-msg {
    left: 0;
    right: 0;
    width: 100%;
    top: calc(100% + 6px);
  }
}

@media (max-width: 560px) {
  .wrap {
    padding-inline: 14px;
  }

  /* The brand already links home; one nav link keeps the top row compact. */
  .main-nav a[href="/"] {
    display: none;
  }

  .brand {
    padding: 4px 9px;
    border-radius: 11px;
  }

  .brand-logo {
    height: 28px;
  }

  .main-nav a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  main {
    padding-top: 14px;
  }

  .panel,
  .hero-card {
    padding: 18px 16px;
    border-radius: var(--radius-lg);
  }

  .hero {
    gap: 20px;
  }

  .eyebrow {
    margin-bottom: 10px;
  }

  .lede {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .hero-points {
    gap: 4px 10px;
    margin-bottom: 14px;
  }

  .hero-points li {
    font-size: 0.84rem;
    gap: 6px;
  }

  .hero-points li::before {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .level-search {
    padding: 12px;
  }

  .search-row input,
  .search-row button {
    height: 46px;
  }

  .search-row button {
    padding: 0 20px;
  }

  .hero-board {
    max-width: 250px;
    padding: 10px;
  }

  .section,
  .checks-panel {
    margin-top: 32px;
  }

  .check-tiles {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .level-layout {
    gap: 12px;
  }

  .level-head {
    padding: 14px 14px;
  }

  .level-head-top {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .level-eyebrow {
    display: none;
  }

  .level-head .level-banner-art {
    width: 52px;
    height: 52px;
  }

  .level-head .level-banner-art.is-frame {
    height: auto;
  }

  .level-head h1 {
    margin-bottom: 6px;
    font-size: 1.3rem;
  }

  .level-head .facts {
    margin: 0;
  }

  .level-head .facts li {
    padding: 2px 10px;
    font-size: 0.78rem;
  }

  .board-check {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-panel {
    padding: 16px;
  }

  .level-layout > .recordings {
    padding: 10px;
  }

  .level-layout > .source-panel {
    padding: 18px 16px;
  }

  .recordings > h2 {
    margin-bottom: 8px;
  }

  .steps li {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
  }

  .steps li::before {
    width: 26px;
    height: 26px;
  }
}

/* Theme "Sunny Meadow": frosted white cards over a soft sunlit meadow, sky-blue header,
   sunny-yellow game buttons. Adds depth (blur, shadows), hover lifts, per-card picture tints
   and one slow float on the home board picture. No images or requests of its own; all motion
   stops under reduced motion. */
:root {
  --shadow-card: 0 14px 36px -14px rgb(19 34 56 / 0.18), 0 2px 6px rgb(19 34 56 / 0.06);
  --shadow-hero: 0 26px 56px -18px rgb(15 65 110 / 0.28), 0 4px 14px rgb(19 34 56 / 0.08);
}

.site-header {
  box-shadow: 0 6px 24px -10px rgb(15 76 129 / 0.35);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    background: linear-gradient(100deg, rgb(77 189 246 / 0.92) 0%, rgb(46 166 234 / 0.92) 100%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .hero-card,
  .hero-board {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.panel,
.level-card a,
.empty {
  box-shadow: var(--shadow-card);
}

.hero-card,
.hero-board {
  box-shadow: var(--shadow-hero);
}

.art-frame,
.level-banner-art {
  box-shadow: 0 8px 18px -6px rgb(19 34 56 / 0.28);
}

.level-search:not(.level-search-header) {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8);
}

.link-pill,
.quick-links a {
  box-shadow: 0 4px 12px -6px rgb(19 34 56 / 0.18);
}

/* Picture tints cycle so neighbouring cards differ. */
.level-card:nth-child(3n + 2) .card-art {
  --color-art-from: #ffe2c4;
  --color-art-to: #d4effc;
}

.level-card:nth-child(3n + 3) .card-art {
  --color-art-from: #ffe1e4;
  --color-art-to: #f5e6ff;
}

.level-card a,
.hero-board,
.link-pill,
.search-row button,
.pager a,
.brand {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.level-card a:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px -16px rgb(22 134 201 / 0.3);
}

.search-row button:hover {
  transform: translateY(-1px);
}

.search-row button:active,
.video-retry:active,
.pager a:active {
  transform: translateY(2px);
}

.video-play-icon {
  transition: transform 0.16s ease;
}

.video-play:hover .video-play-icon {
  transform: scale(1.06);
}

.video-play:active .video-play-icon {
  transform: translateY(2px) scale(1.02);
}

/* The home board leans a little and floats; it straightens on hover. */
.hero-board {
  transform: rotate(1.5deg);
}

.hero-board:hover {
  transform: rotate(0deg) translateY(-4px);
}

.hero-board img {
  animation: cf-float 6s ease-in-out infinite alternate;
}

@keyframes cf-float {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-6px);
  }
}

@media (max-width: 900px) {
  .hero-board {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-board img {
    animation: none;
  }

  .level-card a,
  .hero-board,
  .link-pill,
  .search-row button,
  .pager a,
  .brand,
  .video-play-icon {
    transition: none;
  }

  .level-card a:hover,
  .hero-board:hover,
  .brand:hover,
  .search-row button:hover,
  .search-row button:active,
  .video-retry:active,
  .pager a:active,
  .video-play:hover .video-play-icon,
  .video-play:active .video-play-icon {
    transform: none;
  }
}
