:root {
  color-scheme: light;
  --ink: #18281d;
  --muted: #536457;
  --forest: #245438;
  --deep: #173d29;
  --paper: #f7f8f0;
  --line: #dfe6d8;
  --white: #fff;
  --lime: #eaf6bf;
  --mint: #e1f2dc;
  --peach: #ffead6;
  --lilac: #eee8ff;
  --blue: #e3f1ff;
  --pink: #fce7eb;
  --shadow: 0 4px 10px #1e3b2210;
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
:focus-visible { outline: 3px solid #8059cc; outline-offset: 3px; }
main:focus { outline: none; }
.lime { background: var(--lime); }
.mint { background: var(--mint); }
.peach { background: var(--peach); }
.lilac { background: var(--lilac); }
.blue { background: var(--blue); }
.pink { background: var(--pink); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 18px;
  background: var(--white);
  border-radius: 10px;
  clip-path: inset(50%);
}
.skip-link:focus { clip-path: none; }
.topbar { background: #fffefb; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.topbar-inner, .shell { max-width: 1280px; margin-inline: auto; padding-inline: 34px; }
.topbar-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand { justify-self: start; display: flex; align-items: center; gap: 10px; font-size: 27px; font-weight: 1000; letter-spacing: -.07em; }
.topbar-inner:has(.view-switch[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
.brand-accent { color: #50782c; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px;
  aspect-ratio: 1;
  border-radius: 13px;
  background: #dbeeb3;
}
.brand-mark i { width: 2px; height: 15px; background: #264a2c; border-radius: 6px; transform: rotate(-12deg) translateY(3px); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: #315e30; width: 13px; height: 8px; }
.brand-mark::before { top: 14px; left: 8px; border-radius: 3px 9px 3px 9px; transform: rotate(13deg); }
.brand-mark::after { top: 10px; right: 8px; border-radius: 9px 3px 9px 3px; transform: rotate(-12deg); }
.view-switch { display: flex; gap: 3px; padding: 4px; background: #f0f3e9; border-radius: 999px; white-space: nowrap; }
.view-switch a { padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 900; color: var(--muted); }
.view-switch a span { margin-right: 3px; font-size: 16px; line-height: 1; }
.view-switch a[aria-current] { background: var(--white); box-shadow: 0 2px 4px #19341e12; color: var(--forest); }
.view-switch a:hover { color: var(--deep); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 15px; white-space: nowrap; }
.demo-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.demo-label span { width: 7px; height: 7px; border-radius: 100%; background: #79a150; }
.explore { position: relative; }
.explore summary { display: flex; gap: 5px; align-items: center; border-radius: 12px; padding: 8px 10px; font-size: 14px; list-style: none; font-weight: 900; }
.explore summary::-webkit-details-marker { display: none; }
.explore[open] summary, .explore summary:hover { background: #eff3e7; }
.explore[open] summary span { transform: rotate(180deg); }
.product-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  display: grid;
  gap: 2px;
  width: 286px;
  max-height: calc(100dvh - 88px);
  overflow: auto;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px #15271d28;
}
.product-menu a { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 12px; }
.product-menu a:hover, .product-menu a[aria-current] { background: #f2f5ec; }
.product-menu i { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; font-size: 21px; font-style: normal; }
.product-menu strong { display: block; font-size: 15px; font-weight: 950; }
.product-menu span { display: block; font-size: 12px; color: var(--muted); white-space: normal; }

.shell { padding-block: 26px 56px; }
.hero {
  border-radius: 28px;
  overflow: hidden;
  min-height: 332px;
  background:
    linear-gradient(90deg, #e8efbb 0%, #e8efbb 27%, #e8efbbf5 35%, #e8efbb30 56%, transparent 70%),
    url('./assets/garden-story.jpg') right 51% / 76% auto no-repeat #e8efbb;
  box-shadow: 0 4px 12px #33612712;
}
.hero-content { padding: 29px 38px 32px; position: relative; max-width: 57%; }
.eyebrow { color: #3b5936; font-size: 12px; font-weight: 1000; letter-spacing: .12em; }
.eyebrow span { margin-right: 4px; font-size: 16px; }
.hero h1, .family-hero h1 { margin: 10px 0 12px; font-size: clamp(42px, 5.1vw, 66px); font-weight: 1000; line-height: .99; letter-spacing: -.065em; color: var(--deep); overflow-wrap: anywhere; }
.hero-content > p:not(.eyebrow) { max-width: 370px; margin: 0 0 18px; color: #354e31; font-size: 16px; line-height: 1.47; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 950;
  min-height: 42px;
  padding: 8px 14px;
  line-height: 1.2;
  transition: background-color .16s, border-color .16s, transform .16s;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: var(--forest); color: var(--white); padding: 10px 18px; box-shadow: 0 3px 0 #173d29; }
.button.primary:hover { background: #316949; }
.button.primary span { font-size: 17px; }
.button.secondary { background: var(--white); border-color: var(--line); color: var(--deep); }
.button.secondary:hover { background: #edf5e2; border-color: #a7c189; }
.button.small { font-size: 13px; padding-inline: 12px; min-height: 36px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 17px 0 28px; }
.student-homework-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .student-homework-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 12px 15px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow);
}
.stat-icon, .activity-icon, .panel-icon, .avatar { display: grid; place-items: center; flex: none; font-style: normal; }
.stat-icon { width: 46px; aspect-ratio: 1; border-radius: 13px; font-size: 24px; color: #426627; }
.stat-icon.lilac { color: #6f50a9; }
.stat strong { display: block; font-size: 26px; font-weight: 1000; line-height: 1; letter-spacing: -.045em; }
.stat div span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.2; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .435fr); align-items: start; gap: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading h2, .panel h2 { font-size: 24px; line-height: 1.1; letter-spacing: -.045em; font-weight: 1000; }
.section-heading p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.students { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.student-card, .panel { border: 1px solid var(--line); background: var(--white); border-radius: 19px; box-shadow: var(--shadow); min-width: 0; }
.student-card { padding: 13px; }
.student-top { display: flex; align-items: start; justify-content: space-between; gap: 5px; }
.avatar { position: relative; width: 46px; height: 46px; border-radius: 15px; font-size: 27px; }
.avatar.large { width: 76px; height: 76px; border-radius: 23px; font-size: 45px; }
.avatar-accessory {
  position: absolute;
  inset: -4px -4px auto auto;
  display: grid;
  place-items: center;
  width: 1.65em;
  aspect-ratio: 1;
  background: #fffde9;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px #20331d23;
  font-size: 13px;
  line-height: 1;
}
.avatar.large .avatar-accessory { font-size: 19px; }
.balance, .points { display: inline-flex; flex: none; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 9px; background: #edf5d8; color: #315127; font-size: 12px; font-weight: 1000; white-space: nowrap; }
.student-card h3 { font-size: 19px; font-weight: 1000; margin-block: 7px; letter-spacing: -.024em; overflow-wrap: anywhere; }
.student-actions { display: flex; gap: 6px; }
.inbox-roster-link { display: inline-block; padding-block: 4px; margin-top: 3px; font-size: 12px; }
.student-actions .button { flex: 1; min-height: 31px; font-size: 12px; border-radius: 8px; padding: 5px 6px; }
.award-button { background: #eaf4dd; color: #25492e; }
.award-button:hover { background: #d8edc5; }
.garden-button { background: #f7f7f1; color: #3b533d; }
.garden-button:hover { background: #edf1e6; }
.panel { padding: 16px; }
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title h2 { font-size: 20px; }
.panel-icon { width: 31px; height: 31px; border-radius: 10px; background: #edf4e7; color: #346744; font-size: 20px; }
.activity-list, .collection-list, .skill-list { list-style: none; padding: 0; margin: 9px 0 0; }
.activity-row { display: flex; align-items: start; gap: 9px; padding-block: 10px; }
.activity-row + .activity-row { border-top: 1px solid #e9ede5; }
.activity-icon { width: 35px; height: 35px; border-radius: 10px; font-size: 17px; }
.activity-copy { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.activity-copy strong { font-size: 14px; font-weight: 1000; }
.activity-copy span, .activity-copy time { font-size: 12px; color: var(--muted); }
.activity-copy time { font-size: 11px; margin-top: 2px; }
.activity-result { display: grid; justify-items: end; gap: 1px; }
.points { padding: 3px 8px; }
.points.spent { background: var(--peach); color: #734319; }
.points.muted { background: #eff0ec; color: var(--muted); }
.text-button { border: 0; background: transparent; color: var(--forest); font-size: 12px; font-weight: 950; padding: 5px 0; }
.text-button:hover { text-decoration: underline; }
.more { display: block; margin-inline: auto; }
.empty { padding-block: 13px 5px; color: var(--muted); font-size: 14px; }

.story { max-width: 900px; margin-inline: auto; }
.family-hero.story-hero {
  justify-content: space-between;
  padding: clamp(20px, 4.8vw, 36px);
  border: 1px solid #dbe9c6;
  background: linear-gradient(120deg, #f4f7dc, #e5f3dc);
  gap: 16px;
}
.story-intro { min-width: 0; }
.story-classroom-name { color: var(--forest); font-weight: 950; font-size: 14px; overflow-wrap: anywhere; }
.story-intro-description { color: #355541; line-height: 1.35; max-width: 32em; }
.story-hero .button { flex: none; }
.story-demo-nav {
  width: fit-content;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 4px;
  font-size: 13px;
}
.story-demo-nav > span { color: var(--muted); margin-inline: 8px 5px; }
.story-demo-nav a { padding: 7px 10px; border-radius: 10px; font-weight: 950; }
.story-demo-nav a:hover { background: #f1f4ea; }
.story-demo-nav a[aria-current] { background: var(--mint); color: var(--deep); }
.story-posts { display: grid; gap: 12px; list-style: none; margin: 16px 0 0; padding: 0; }
.story-post { padding: clamp(16px, 3vw, 23px); }
.story-post-pinned { border-color: #bacf9f; background: #fefff9; }
.story-post-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.story-post-heading .activity-icon { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }
.story-post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; color: var(--muted); font-size: 12px; }
.story-post-meta strong { color: var(--forest); font-weight: 950; }
.story-badge { background: #edf4d7; color: #3c532b; border-radius: 999px; padding: 2px 7px; font-weight: 950; }
.story-family-badge { background: #ede8f8; color: #50416b; }
.story-post h2 { margin-top: 4px; overflow-wrap: anywhere; font-size: clamp(20px, 4vw, 26px); }
.story-post-text { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.story-post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 13px; }
.story-post-actions .text-button { min-height: 36px; padding-inline: 5px; }
.story-empty { margin-top: 16px; padding: clamp(18px, 3.5vw, 28px); }
.story-empty p { margin-top: 6px; color: var(--muted); }
.story-archive { margin-top: 16px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 14px; }
.story-archive summary { padding: 7px 2px; color: var(--forest); font-weight: 950; }
.story-archive summary span { margin-left: 2px; color: var(--muted); }
.story-archive .story-posts { margin-block: 6px 10px; }
.story-form textarea, .story-form select {
  width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #c7d3c0;
  border-radius: 10px; background: var(--white); font: inherit; color: inherit;
}
.story-form textarea { resize: vertical; line-height: 1.4; }
.story-form small { color: var(--muted); font-weight: 700; }
.story-form-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); width: 100%; gap: 10px; }
.story-form .story-pin-control { display: flex; align-items: center; gap: 7px; }
.story-pin-control input { width: 18px; min-height: auto; height: 18px; margin: 0; accent-color: var(--forest); }

@media (max-width: 480px) {
  .story-form-options { grid-template-columns: minmax(0, 1fr); }
  .story-demo-nav a { flex: 1; text-align: center; }
}

.look-layout { display: grid; align-items: start; grid-template-columns: minmax(220px, .48fr) minmax(0, 1fr); gap: 16px; }
.look-preview.panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(18px, 3vw, 29px);
  text-align: center;
  background: radial-gradient(ellipse at 50% 36%, #fffef1 15%, #f7f8e8 50%, #e9f2d7 100%);
}
.avatar.look-avatar {
  width: clamp(98px, 14vw, 143px);
  height: auto;
  aspect-ratio: 1;
  border: 4px solid #fffeef;
  border-radius: 30%;
  box-shadow: 0 7px 18px #26401722;
  font-size: clamp(62px, 9vw, 93px);
  line-height: 1;
}
.look-avatar .avatar-accessory { inset: -7px -7px auto auto; font-size: clamp(23px, 4vw, 35px); }
.look-preview-label { display: grid; justify-items: center; gap: 4px; }
.look-preview-label strong { color: var(--deep); font-size: 24px; font-weight: 1000; line-height: 1.05; }
.look-preview-label span { padding: 3px 9px; border-radius: 999px; background: #fffdf2; color: #614b22; font-size: 12px; }
.look-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.look-controls.panel { padding: clamp(15px, 2.4vw, 24px); }
.look-section + .look-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.look-section h2 { margin-bottom: 12px; }
.look-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.look-option {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px 5px;
  min-height: 88px;
  text-align: center;
  overflow-wrap: anywhere;
  border: 1px solid #cedbc7;
  border-radius: 13px;
  background: #fcfdf8;
  color: var(--deep);
}
.look-option:not(:disabled):hover { background: #eef6e4; border-color: #6c995b; }
.look-option[aria-pressed='true'] { background: #e8f3da; border-color: #3b733c; box-shadow: inset 0 0 0 1px #3b733c; }
.look-option[aria-pressed='true']::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 10px;
  border: solid #285739;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.look-option:disabled { background: #f3f3ef; border-style: dashed; border-color: #a8afa5; color: #3f5146; }
.look-option strong { font-size: 14px; line-height: 1.1; }
.look-option small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.look-icon { display: grid; place-items: center; width: 36px; aspect-ratio: 1; border-radius: 11px; font-size: 24px; }

.garden-hero { min-height: 270px; margin-bottom: 25px; }
.garden-hero .hero-content { padding-block: 26px 31px; }
.garden-hero h1 { font-size: clamp(39px, 5vw, 63px); }
.garden-hero-bottom { display: flex; flex-wrap: wrap; align-items: end; gap: 15px; }
.hero-balance { min-height: 38px; background: #fffbdf; border: 1px solid #d5de9f; font-size: 16px; padding: 4px 13px; }
.profile-picker { display: grid; gap: 3px; font-size: 11px; color: var(--muted); }
.profile-picker select { min-width: 105px; max-width: 230px; background: #fffef8; color: var(--deep); border: 1px solid var(--line); border-radius: 9px; min-height: 35px; padding: 4px 9px; font-size: 14px; font-weight: 900; }
.plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plot {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 166px;
  padding: 14px 6px;
  border: 1px solid #dbe7ca;
  border-radius: 19px;
  background: #f0f5e4;
  color: var(--deep);
  transition: background-color .15s, transform .15s;
}
.plot:hover { background: #e5f0d7; transform: translateY(-2px); }
.plot.is-ready { background: #fff3cc; border-color: #e8d694; }
.plot strong { font-size: 15px; font-weight: 1000; margin-top: 5px; }
.plot-status { min-height: 18px; color: #4e6344; font-size: 11px; }
.soil {
  display: grid;
  place-items: center;
  width: min(80%, 105px);
  height: 53px;
  border-radius: 44% 46% 37% 41% / 55% 55% 43% 44%;
  margin-top: 12px;
  background: radial-gradient(ellipse at 36% 32%, #a87348 0 3%, transparent 4%),
    radial-gradient(ellipse at 70% 60%, #b48153 0 3%, transparent 4%), #916242;
  box-shadow: inset 0 -7px #714a32, 0 5px #cbdab7;
  color: #fff4d4;
  font-size: 24px;
}
.soil.planted span { font-size: 45px; transform: translateY(-16px); filter: drop-shadow(0 3px 5px #3e391d35); }
.collection-list li { display: flex; align-items: center; gap: 8px; padding-block: 6px; font-size: 14px; }
.collection-list li strong { flex: 1; }
.milestone { margin-top: 14px; background: #f5f0ff; border-radius: 13px; padding: 11px; }
.milestone p { font-size: 13px; margin-block: 3px 7px; color: #59496b; }
progress { display: block; border: 0; height: 8px; width: 100%; border-radius: 999px; background: #e9eee3; overflow: hidden; }
progress::-webkit-progress-bar { background: #e8ebdf; border-radius: 999px; }
progress::-webkit-progress-value { background: #6f9d49; border-radius: 999px; }
progress::-moz-progress-bar { background: #6f9d49; border-radius: 999px; }

.family-hero { display: flex; align-items: center; gap: 18px; background: #ecf3d9; padding: 28px; border-radius: 24px; }
.family-hero > div { min-width: 0; flex: 1; }
.family-hero h1 { font-size: clamp(33px, 5vw, 54px); margin-block: 5px; }
.family-hero p:not(.eyebrow) { color: var(--muted); }
.course-hero.lilac { background: #eee8fb; }
.course-hero.blue { background: #e7f2fa; }
.course-hero .avatar { background: #ffffffb0; }
.family-course { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.family-course + .family-course { border-top: 1px solid var(--line); }
.family-course > div { flex: 1; }
.family-course > div span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.family-course:hover strong { text-decoration: underline; }
.practice-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  max-width: 720px;
  margin: 16px auto 0;
}
.practice-track {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--deep);
  text-decoration: none;
}
.practice-track[aria-current] { border-color: var(--forest); background: #eff6e6; }
.practice-track:not([aria-current]):hover { border-color: #75956c; }
.practice-track-icon { font-size: 20px; }
.practice-track strong { font-size: 15px; }
.practice-track strong + span { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.practice-track-count { color: var(--forest); font-size: 12px; font-weight: 900; white-space: nowrap; }
.practice-audio { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 12px; }
.practice-audio [data-audio-message] { color: var(--muted); font-size: 13px; }
.practice-panel { margin: 20px auto 0; max-width: 720px; padding: 24px; }
.practice-progress { display: grid; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
#question-title { line-height: 1.2; font-size: clamp(22px, 4vw, 31px); }
.answers { display: grid; gap: 8px; margin-top: 18px; }
.answer { text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #f8faf3; min-height: 45px; padding: 9px 12px; font-weight: 900; }
.answer:hover:not(:disabled) { background: #f0f5e6; }
.answer.incorrect { background: #fff1e2; border-color: #e9b778; }
.answer.correct { background: #e6f4d8; border-color: #90b56d; }
.practice-slots, .practice-pieces { display: flex; flex-wrap: wrap; gap: 8px; }
.practice-slots { list-style: none; margin: 18px 0 12px; padding: 0; }
.practice-slots li {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px dashed #b2bcaa;
  border-radius: 10px;
  background: #f6f8ef;
  color: var(--deep);
  font-weight: 950;
}
.practice-pieces { margin-bottom: 14px; }
.practice-pieces button { min-width: 44px; }
.practice-pieces button:disabled { opacity: .45; }
.practice-sort { display: grid; gap: 12px; margin: 14px 0 16px; }
.sort-instructions { color: var(--muted); font-size: 14px; }
.sort-instructions strong { color: var(--deep); }
.sort-cards, .sort-bins { display: grid; gap: 8px; }
.sort-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 146px), 1fr)); }
.sort-bins { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.sort-card, .sort-bin { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.sort-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-height: 65px;
  padding: 8px 10px;
  border: 1px solid #d2ddca;
  border-radius: 12px;
  background: #fbfcf7;
  color: var(--deep);
}
.sort-card:hover:not(:disabled) { border-color: #8da979; }
.sort-card[aria-pressed='true'] { border-color: #457347; box-shadow: inset 0 0 0 1px #457347; background: #edf6e2; }
.sort-card strong, .sort-bin strong { font-weight: 950; line-height: 1.18; }
.sort-chip {
  max-width: 100%;
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--sort-fill, #eef1e8);
  color: var(--sort-ink, var(--muted));
  font-size: 11px;
  font-weight: 950;
  line-height: 1.24;
}
.practice-sort [data-sort-tone='0'] { --sort-fill: #e7f1da; --sort-border: #8da971; --sort-ink: #334a22; }
.practice-sort [data-sort-tone='1'] { --sort-fill: #e4effb; --sort-border: #80a2c6; --sort-ink: #27425c; }
.practice-sort [data-sort-tone='2'] { --sort-fill: #f2e7fb; --sort-border: #ab8ac6; --sort-ink: #543b6a; }
.sort-bin {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px dashed var(--sort-border);
  border-radius: 12px;
  background: var(--sort-fill);
  color: var(--sort-ink);
}
.sort-bin:not(:disabled) { border-style: solid; box-shadow: 0 2px 0 var(--sort-border); }
.sort-bin:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--sort-border), 0 2px 0 var(--sort-border); }
.sort-bin span, .sort-progress { font-size: 12px; font-weight: 900; }
.sort-actions { align-items: center; }
.sort-progress { margin-inline-start: auto; color: var(--muted); }
.sort-actions .button:disabled { opacity: .55; box-shadow: none; }
.practice-sort.needs-retry .sort-cards { outline: 1px solid #c18652; outline-offset: 3px; border-radius: 12px; }
@media (max-width: 480px) {
  .sort-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); }
  .sort-bins { grid-template-columns: repeat(auto-fit, minmax(min(100%, 98px), 1fr)); }
  .sort-actions .button { min-height: 44px; }
  .sort-progress { margin-inline-start: 0; }
}
.practice-feedback { margin: 10px 0; color: var(--forest); font-weight: 950; }
.practice-feedback:empty { margin-top: 0; }
.hint { padding: 9px 12px; margin: 8px 0 12px; color: #59431e; background: #fff5d9; border-radius: 10px; }
.hint strong { margin-right: 6px; }
.practice-panel > p:not([class]) { margin: 8px 0 15px; color: var(--muted); }

.assignment-heading { align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 14px; }
.assignment-heading .profile-picker { margin: 0; }
.assignment-list { display: grid; gap: 12px; list-style: none; padding: 0; margin: 16px 0; }
.assignment-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.assignment-card h2 { font-size: clamp(17px, 2.5vw, 22px); line-height: 1.25; }
.assignment-club, .assignment-meta { color: var(--muted); font-size: 13px; }
.assignment-meta { margin-top: 4px; }
.assignment-body progress { display: block; margin-top: 8px; max-width: 240px; }
.assignment-roster { margin-top: 8px; max-width: 370px; }
.assignment-roster ul { margin: 5px 0 0; padding: 0; list-style: none; }
.assignment-roster li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.assignment-history { margin-top: 18px; }
.assignment-roster summary, .assignment-history summary { color: var(--forest); font-weight: 900; }
.assignment-form select { width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid #c7d3c0; border-radius: 10px; background: var(--white); }
.assignment-instructions { margin: 8px 0; color: var(--muted); font-size: 14px; }
.assignment-instructions summary { cursor: pointer; color: var(--forest); font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.assignment-instructions p { max-width: 70ch; margin-top: 6px; }
.assignment-result { margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--forest); }
.assigned-adventure-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 18px; margin: 8px 0 16px; border: 1px solid #c9d9c5; border-radius: 18px; background: #edf5e6; }
.assigned-adventure-banner h1 { font-size: clamp(21px, 3vw, 28px); line-height: 1.15; }
.assigned-adventure-banner p { margin-top: 4px; max-width: 72ch; font-size: 13px; }
.assigned-adventure-banner .eyebrow { font-size: 11px; margin: 0 0 5px; }
.assigned-adventure-status { font-weight: 800; color: var(--forest); }
.assigned-adventure-error { color: #8d3928; }
.assigned-adventure-result { margin-top: 16px; border-color: #a9c6a4; background: #edf5e6; }
.assigned-adventure-result > p { font-weight: 800; margin-bottom: 10px; }
.assigned-adventure-result[hidden] { display: none; }
.assigned-adventure-links { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.assigned-adventure-links .button { min-height: 44px; }
[data-assigned-adventure-root] .market-header,
[data-assigned-adventure-root] .picnic-header,
[data-assigned-adventure-root] .grove-header,
[data-assigned-adventure-root] .picnic-active-header,
[data-assigned-adventure-root] .grove-active-header { display: none; }
@media (max-width: 700px) {
  .assigned-adventure-banner { align-items: flex-start; flex-direction: column; padding: 14px; }
  .assigned-adventure-links { width: 100%; flex-shrink: 1; }
  .assigned-adventure-links .button { flex: 1 1 auto; }
}
@media (max-width: 620px) {
  .assignment-card { grid-template-columns: auto minmax(0, 1fr); }
  .assignment-card > .button { grid-column: 2; justify-self: start; }
}

dialog {
  width: min(510px, calc(100vw - 24px));
  max-height: min(90vh, 720px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  color: var(--ink);
  background: #fffefb;
  box-shadow: 0 22px 70px #09261c60;
}
dialog::backdrop { background: #18312375; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-header h2 { font-size: 28px; font-weight: 1000; letter-spacing: -.045em; line-height: 1.15; }
.close-button { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; background: #eff3e9; border: 0; border-radius: 10px; font-size: 25px; line-height: 1; }
.close-button:hover { background: #dce8d4; }
dialog p { color: var(--muted); margin: 8px 0 13px; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skill-option { display: flex; align-items: center; gap: 7px; min-height: 51px; padding: 8px; flex-wrap: wrap; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.skill-option:hover:not(:disabled) { background: #f1f7e8; border-color: #a9c591; }
.skill-option:disabled { opacity: .62; }
.skill-option strong { flex: 1 1 60px; font-size: 13px; font-weight: 950; overflow-wrap: anywhere; }
.skill-option small { flex: 1 1 100%; color: var(--muted); }
.dialog-note { font-size: 13px; }
form { display: grid; justify-items: start; gap: 12px; margin: 12px 0 5px; }
form label { display: grid; gap: 3px; font-size: 13px; width: 100%; font-weight: 900; }
form input { min-width: 0; width: 100%; border: 1px solid #c7d3c0; padding: 8px 10px; min-height: 42px; border-radius: 10px; background: var(--white); }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; width: 100%; }
.form-error { color: #a43026; font-size: 13px; margin-block: 8px 0; }
.form-error:empty { display: none; }
.skill-list { max-height: 210px; overflow: auto; }
.skill-list li { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 14px; }
.skill-list strong { flex: 1; }
.toast {
  position: fixed;
  z-index: 4;
  inset: auto 18px 18px auto;
  max-width: min(460px, calc(100vw - 36px));
  padding: 10px 15px;
  color: var(--white);
  background: var(--deep);
  border-radius: 12px;
  box-shadow: 0 4px 20px #192b2350;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast.error { background: #833b2e; }

@media (max-width: 1130px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding-block: 9px; }
  .view-switch { grid-row: 2; grid-column: 1 / -1; justify-self: center; max-width: 100%; flex-wrap: wrap; justify-content: center; }
  .header-actions { grid-row: 1; grid-column: 2; }
}
@media (max-width: 1010px) {
  .topbar-inner, .shell { padding-inline: 22px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) minmax(217px, .43fr); gap: 13px; }
  .students { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-size: auto, auto 112%; }
  .hero-content { padding-inline: 28px; }
}
@media (max-width: 690px) {
  .topbar-inner, .shell { padding-inline: 14px; }
  .topbar-inner { gap: 7px; }
  .header-actions { gap: 0; }
  .demo-label { display: none; }
  .shell { padding-top: 14px; }
  .hero { min-height: 370px; border-radius: 21px; background:
    linear-gradient(180deg, #e8efbb 0%, #e8efbb 26%, #e8efbbf0 42%, #e8efbb00 70%),
    url('./assets/garden-story.jpg') right bottom / auto 69% no-repeat #e8efbb; }
  .hero-content { max-width: 100%; padding: 20px; }
  .hero h1 { font-size: 44px; }
  .hero-content > p:not(.eyebrow) { max-width: 290px; font-size: 14px; margin-bottom: 11px; }
  .garden-hero { min-height: 310px; }
  .garden-hero .hero-content { padding: 16px 20px; }
  .stats { gap: 5px; margin-bottom: 21px; }
  .stat { min-height: 73px; align-items: flex-start; justify-content: center; flex-direction: column; padding: 8px; gap: 5px; }
  .stat-icon { width: 27px; border-radius: 8px; font-size: 14px; }
  .stat strong { font-size: 19px; }
  .stat div span { font-size: 11px; }
  .dashboard { grid-template-columns: 1fr; gap: 16px; }
  .section-heading h2 { font-size: 22px; }
  .student-card { padding: 10px; }
  .plots { gap: 6px; }
  .plot { min-height: 133px; }
  .plot strong { font-size: 13px; }
  .family-hero { align-items: start; flex-wrap: wrap; padding: 15px; gap: 9px; }
  .family-hero > div { flex: 1 1 70%; }
  .family-hero .avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 26px; }
  .profile-picker select { max-width: 145px; }
  .look-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .look-preview.panel { gap: 13px; }
}
@media (max-width: 400px) {
  .brand { gap: 6px; font-size: 21px; white-space: nowrap; }
  .brand-mark { width: 27px; height: 27px; }
  .look-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
  .section-heading { align-items: start; flex-direction: column; gap: 6px; }
  .plots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
.button.primary:disabled { opacity: .52; box-shadow: none; }
.access-panel { max-width: 490px; margin: 34px auto 0; padding: 25px; }
.access-panel h1 { margin: 9px 0 5px; color: var(--deep); font-size: 36px; line-height: 1.06; letter-spacing: -.05em; font-weight: 1000; }
.access-panel > p { color: var(--muted); margin-bottom: 14px; }
.access-panel > .form-error { color: #a43026; margin-top: 12px; }
.empty-roster p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.invite-result { margin-top: 12px; }
.invite-result label { display: block; font-size: 13px; font-weight: 900; }
.invite-copy { display: flex; gap: 8px; margin-top: 4px; }
.invite-copy input { flex: 1; min-width: 0; border: 1px solid #c7d3c0; padding: 8px 10px; border-radius: 10px; }
.invite-copy .button { white-space: nowrap; }

.quest-hero {
  min-height: 270px;
  margin-bottom: 25px;
  background:
    linear-gradient(90deg, #eee6fb 0%, #eee6fb 25%, #eee6fbf5 35%, #eee6fb38 56%, transparent 70%),
    url('./assets/quest-meadow.jpg') right 48% / 76% auto no-repeat #eee6fb;
}
.quest-hero .hero-content { padding-block: 30px; }
.quest-hero .eyebrow { color: #604488; }
.quest-hero h1 { color: #332149; }
.quest-hero .hero-content > p:not(.eyebrow) { color: #544363; }
.quest-hero .hero-balance { color: #523570; background: #fff9ff; border-color: #e0cef4; }
.quest-heading { display: flex; align-items: center; gap: 11px; }
.quest-heading p, .quest-active > p { color: var(--muted); margin-top: 5px; font-size: 14px; }
.quest-active > .stat-icon { margin-bottom: 10px; }
.quest-needs, .quest-list { list-style: none; padding: 0; margin: 13px 0 0; }
.quest-needs li, .quest-list li { display: flex; align-items: center; gap: 9px; padding: 9px 0; }
.quest-needs li + li, .quest-list li + li { border-top: 1px solid var(--line); }
.quest-needs li > .button { flex: none; }
.quest-needs .button:disabled { opacity: .58; }
.quest-need, .quest-list li > div { flex: 1; min-width: 0; }
.quest-need strong, .quest-list li strong { display: block; font-size: 14px; font-weight: 1000; }
.quest-need > span, .quest-list li > div > span {
  display: block;
  color: var(--muted);
  margin: 2px 0 5px;
  font-size: 12px;
}
.quest-reward {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f5f0ff;
  border-radius: 13px;
  padding: 9px;
  margin-top: 10px;
}
.quest-reward p { color: #59496b; font-size: 12px; }
.quest-return { margin-top: 13px; }
.quest-garden-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 8px;
  background: #f0f5e4;
  border-radius: 10px;
  color: var(--deep);
  font-size: 13px;
  font-weight: 950;
}
.quest-garden-link span:nth-child(2) { flex: 1; }
.quest-garden-link:hover { background: #e6eed5; }
@media (max-width: 1010px) {
  .quest-hero { background-size: auto, auto 116%; }
}
@media (max-width: 690px) {
  .view-switch a { padding-inline: clamp(7px, 2.3vw, 13px); font-size: 13px; }
  .quest-hero { min-height: 300px; background:
    linear-gradient(180deg, #eee6fb 0%, #eee6fb 24%, #eee6fbec 39%, #eee6fb00 75%),
    url('./assets/quest-meadow.jpg') right bottom / auto 74% no-repeat #eee6fb; }
  .quest-hero .hero-content { padding-block: 18px; }
}

.classroom-side { display: grid; gap: 12px; min-width: 0; }
.group-panel .panel-title h2 { flex: 1; }
.group-panel .panel-title .button:disabled { opacity: .55; }
.group-list { list-style: none; padding: 0; margin: 8px 0 0; }
.group-list li { display: flex; align-items: center; gap: 7px; padding-block: 7px; }
.group-list li + li { border-top: 1px solid var(--line); }
.group-list li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.group-list li strong, .group-list li > div > span { display: block; }
.group-list li strong { font-size: 14px; }
.group-list li > div > span { color: var(--muted); font-size: 12px; }
.group-list .button { min-height: 30px; padding-inline: 9px; }
.selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--deep);
  font-size: 14px;
}
.selection-bar .button { margin-left: auto; }
.student-selected { border-color: #7aa567; box-shadow: 0 0 0 1px #7aa567; }
.student-report-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.roster-checkbox, .group-members label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.roster-checkbox { margin: 3px 0 7px; }
.roster-checkbox input, .group-members input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: none;
  margin: 0;
  accent-color: var(--forest);
}
.group-members { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.group-members legend { padding-inline: 4px; font-size: 13px; }
.group-members > div { display: grid; gap: 8px; max-height: 170px; overflow: auto; padding: 3px; }
.award-note { margin: 9px 0 13px; }
.award-note summary { color: var(--forest); font-size: 13px; font-weight: 950; }
.award-note label { display: grid; gap: 4px; margin-top: 7px; font-size: 13px; }
.award-note textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #c7d3c0;
  border-radius: 10px;
  color: inherit;
  font: inherit;
  resize: vertical;
}
.award-recipients { font-size: 13px; font-weight: 950; overflow-wrap: anywhere; }
.activity-note {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: pre-wrap;
}
.point-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.point-history .activity-copy strong { font-size: 15px; }
.report-skill-list li { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .section-heading { flex-wrap: wrap; }
}

.island-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
.island-header h1 { color: var(--deep); font-size: clamp(36px, 5.2vw, 62px); line-height: 0.99; letter-spacing: -.065em; font-weight: 1000; margin-block: 6px; }
.island-header p:not(.eyebrow) { color: var(--muted); }
.island-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-secondary { display: contents; }
.studio-menu-dismiss { display: none; }
.island-actions .button { white-space: nowrap; }
.island-actions .button:disabled, .island-edit-panel button:disabled { opacity: .48; cursor: default; }
.island-live-launch { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.island-live-launch label { display: grid; gap: 3px; color: var(--deep); font-size: 13px; font-weight: 950; }
.island-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(232px, .35fr); align-items: start; gap: 14px; }
.island-layout:has(> .island-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
.island-stage { position: relative; min-width: 0; overflow: hidden; border: 1px solid #c3e1db; background: #e9f8f5; border-radius: 23px; box-shadow: var(--shadow); }
.island-toolbar { min-height: 47px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 13px; }
.island-toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.island-toolbar select, .island-game-picker select, .island-live-launch select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--deep); }
.island-live-launch select { min-height: 42px; max-width: 100%; }
.island-toolbar strong { color: var(--forest); font-size: 13px; }
.island-ghost-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4d3272;
  font-size: 12px;
  font-weight: 950;
}
.island-ghost-key::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid #69459d;
  border-radius: 50%;
  background: #eadbff;
}
.island-canvas { height: clamp(330px, 49vw, 560px); }
:where(.island-stage:has(> .island-play-panel:not([hidden]))) .island-canvas { height: clamp(240px, min(44vw, 53dvh), 500px); }
.island-canvas canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.island-canvas canvas:active { cursor: grabbing; }
.island-status { min-height: 42px; display: grid; align-items: center; padding: 7px 13px; color: var(--deep); font-size: 13px; }
.island-status.is-error { color: #903c27; }
.island-panel > label { display: grid; gap: 4px; color: var(--deep); font-size: 13px; font-weight: 950; }
.island-panel h2 { margin-block: 14px 9px; }
.island-panel p { color: var(--muted); font-size: 13px; margin-block: 9px; }
.island-course-rules {
  margin-block: 12px;
  padding: 11px;
  border: 1px solid #d5dfc9;
  border-radius: 13px;
  background: #f4f8ed;
}
.island-course-rules h2 { margin: 0 0 8px; font-size: 17px; }
.island-course-fields { display: grid; gap: 7px; }
.island-course-fields label {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--deep);
  font-size: 13px;
  font-weight: 900;
}
.island-course-fields select {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--deep);
  font: inherit;
}
.island-course-fields .island-course-check { justify-content: start; }
.island-course-check input { width: 17px; height: 17px; accent-color: var(--forest); }
.island-course-summary { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; margin: 0; color: var(--deep); font-size: 13px; }
.island-course-summary dt { color: var(--muted); }
.island-course-summary dd { margin: 0; text-align: right; font-weight: 900; }
@media (pointer: coarse) {
  .island-course-fields label { min-height: 44px; }
}
.island-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.island-palette button {
  display: grid;
  align-items: center;
  justify-items: start;
  grid-template-columns: auto 1fr;
  gap: 6px;
  min-height: 44px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--deep);
  font-size: 12px;
  font-weight: 950;
}
.island-palette button[aria-pressed="true"] { background: #edf5e2; border-color: #7aa567; }
.block-icon { width: 29px; height: 29px; display: grid; place-items: center; font-size: 15px; border-radius: 7px; background: var(--lilac); }
.block-g { background: #c9eaa2; }
.block-w { background: #ffe1b9; }
.block-s { background: #e7dff5; }
.block-a { background: #d2eff8; }
.block-start, .block-finish { background: var(--pink); }
.block-star { background: #fff3c1; }
.island-grid-wrap { display: grid; place-items: center; min-height: min(78vw, 560px); padding: 12px; background: #bce9ec; }
.island-grid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); width: min(100%, 485px); gap: 2px; }
.island-grid button { aspect-ratio: 1; padding: 0; display: grid; place-items: center; border: 1px solid #47803b3b; border-radius: 5px; color: var(--deep); font-size: clamp(10px, 1.9vw, 20px); font-weight: 1000; }
.island-grid button:hover { border-color: #3c644d; box-shadow: inset 0 0 0 1px #3c644d; }
.island-grid button.tile-best-run { box-shadow: inset 0 0 0 2px #69459d, inset 0 0 0 4px #eadbff; }
.island-grid button:has(.tile-actor-landmark, .tile-avatar-accessory) { position: relative; }
.tile-actor { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; }
.tile-minda { position: relative; width: 88%; border-radius: 50%; overflow: hidden; background: #f8e6bf; box-shadow: 0 0 0 1px #886b41; pointer-events: none; }
.tile-minda-portrait { position: absolute; top: -7%; left: 50%; width: 200%; max-width: none; height: auto; transform: translateX(-50%); }
.tile-actor:is(.team-sun, .team-sky, .is-tagger) {
  width: 1.25em;
  border-radius: 50%;
  background: var(--team-panel, #f4e8ff);
  box-shadow: 0 0 0 1px var(--team-border, #7f539e);
}
.tile-actor-landmark { position: absolute; inset: auto auto -.17em -.13em; font-size: .62em; line-height: 1; pointer-events: none; }
.tile-avatar-accessory {
  position: absolute;
  inset: -0.25em -0.27em auto auto;
  display: grid;
  place-items: center;
  width: 1.4em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffde9;
  box-shadow: 0 1px 2px #20331d40;
  font-size: .6em;
  line-height: 1;
  pointer-events: none;
}
.tile-g { background: #a8d975; }
.tile-w { background: #e7b079; }
.tile-s { background: #cbc1df; }
.tile-a { background: #79cee8; }
.team-sun, .tile-team-sun {
  --team-tile: #f3a64d;
  --team-panel: #fff1da;
  --team-border: #a55725;
  --team-ink: #683113;
}
.team-sky, .tile-team-sky {
  --team-tile: #78a6ed;
  --team-panel: #e8f0ff;
  --team-border: #486da5;
  --team-ink: #14346a;
}
.island-grid button:is(.tile-team-sun, .tile-team-sky) {
  background: var(--team-tile);
  border-color: var(--team-border);
  color: var(--team-ink);
}
.island-grid button:is(.tile-team-sun, .tile-team-sky):hover {
  border-color: var(--team-ink);
  box-shadow: inset 0 0 0 1px var(--team-ink);
}
.island-play-panel { padding: 12px 14px; border-top: 1px solid #c3e1db; background: #f7fbf6; }
.island-play-panel h2 { color: var(--deep); font-size: 18px; line-height: 1.2; }
.island-play-panel h2:has(+ .island-team-identity:not([hidden])) { display: inline-block; margin-inline-end: 7px; }
.island-team-identity {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-block: 2px;
  padding: 2px 9px;
  border: 1px solid var(--team-border);
  border-radius: 999px;
  background: var(--team-panel);
  color: var(--team-ink);
  font-size: 12px;
  font-weight: 950;
  vertical-align: middle;
}
.island-play-panel p { margin: 3px 0 9px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.island-play-panel .island-keyboard-hint { margin: 8px 0 0; }
.island-play-controls { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: end; gap: 10px 16px; }
.island-play-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.island-play-actions button { min-height: 46px; padding-inline: 10px; white-space: normal; }
.island-dpad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 5px; }
.island-dpad [data-island-move="up"] { grid-area: 1 / 2; }
.island-dpad [data-island-move="left"] { grid-area: 2 / 1; }
.island-dpad [data-island-move="down"] { grid-area: 2 / 2; }
.island-dpad [data-island-move="right"] { grid-area: 2 / 3; }
.island-dpad .button { min-height: 0; padding: 0; font-size: 21px; }
.island-dpad button { touch-action: none; }
.island-play-actions button, .island-palette button, .island-grid button { touch-action: manipulation; }
.island-play-panel button:disabled { opacity: .48; }
.island-play-panel button[aria-pressed="true"] { background: #edf5e2; border-color: #7aa567; }
.island-stage:has(> .island-play-panel:not([hidden])) .island-grid-wrap { min-height: 0; }
.island-stage:has(> .island-play-panel:not([hidden])) .island-grid { width: min(100%, 485px, calc(51dvh - 24px)); }
@media (pointer: coarse) {
  .island-play-panel .island-keyboard-hint { display: none; }
}
@media (max-width: 700px) {
  .island-layout { grid-template-columns: 1fr; }
  .island-header { align-items: start; flex-direction: column; }
  .island-live-launch { flex-basis: 100%; }
  .island-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .island-canvas { height: clamp(280px, 78vw, 450px); }
  :where(.island-stage:has(> .island-play-panel:not([hidden]))) .island-canvas { height: clamp(195px, min(78vw, 43dvh), 420px); }
}
@media (max-width: 420px) {
  .island-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .island-play-panel { padding: 10px 11px; }
  .island-play-controls { column-gap: 10px; }
  .island-play-actions { flex-direction: column; align-items: stretch; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 550px) {
  :where(.island-stage:has(> .island-play-panel:not([hidden]))):not(:where(.is-immersive *)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(178px, 30%);
    grid-template-areas: "toolbar toolbar" "presence presence" "board controls" "status status";
  }
  .island-toolbar { grid-area: toolbar; }
  .island-presence { grid-area: presence; }
  .island-canvas, .island-grid-wrap { grid-area: board; }
  .island-status { grid-area: status; }
  :where(.island-stage:has(> .island-play-panel:not([hidden]))) .island-canvas { height: clamp(160px, 48dvh, 250px); }
  .island-play-panel { grid-area: controls; padding: 9px 10px; border-top: 0; border-left: 1px solid #c3e1db; }
  .island-play-controls { grid-template-columns: 1fr; gap: 8px; }
}

.island-share-dialog label { display: block; color: var(--deep); font-size: 13px; font-weight: 950; }
.island-share-dialog .island-share-feedback { margin: 8px 0 0; min-height: 1.2em; color: var(--forest); font-size: 13px; }

.island-presence {
  display: grid;
  gap: 8px;
  padding: 10px 13px;
  border-block: 1px solid #c3e1db;
  background: #e2f3e7;
  color: var(--deep);
  font-size: 13px;
}
.island-party-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.island-party-heading h2 { color: var(--deep); font-size: 16px; line-height: 1.2; }
.island-party-heading span { color: var(--muted); font-weight: 900; }
.island-builders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 119px), 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.island-builders:empty { display: none; }
.island-builder {
  display: grid;
  grid-template: "avatar name" auto "avatar role" auto "reaction reaction" minmax(18px, auto) / auto minmax(0, 1fr);
  align-items: center;
  column-gap: 7px;
  min-width: 0;
  padding: 6px 7px 3px;
  border: 1px solid #c7dfce;
  border-radius: 12px;
  background: #fffefa;
}
.island-builder.is-you { border-color: #88ab80; background: #f5fbec; }
.island-builder .avatar { grid-area: avatar; width: 30px; height: 30px; border-radius: 9px; font-size: 18px; }
.island-builder .avatar-accessory { inset: -4px -4px auto auto; font-size: 9px; }
.island-builder strong { grid-area: name; align-self: end; font-size: 12px; line-height: 1.2; }
.island-builder:not(:has(small)) strong { align-self: center; grid-row: 1 / 3; }
.island-builder small { grid-area: role; align-self: start; color: var(--muted); font-size: 10px; font-weight: 900; }
.island-builder-reaction {
  grid-area: reaction;
  align-self: end;
  justify-self: start;
  color: #48306e;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.22;
}
.island-reaction-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.island-reaction-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 3px 8px;
  border: 1px solid #c6d7c7;
  border-radius: 9px;
  background: #fff;
  color: var(--deep);
  font-size: 12px;
  font-weight: 950;
  touch-action: manipulation;
}
.island-reaction-buttons button:hover:not([aria-disabled="true"]) { background: var(--lime); border-color: #8da085; }
.island-reaction-buttons button[aria-disabled="true"] { opacity: .55; cursor: default; }
.island-reaction-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.island-reaction-error { margin-top: 5px; color: #903c27; font-weight: 900; }
@media (pointer: coarse) {
  .island-reaction-buttons button { min-height: 44px; }
}

.island-score { margin-block: 13px; border-top: 1px solid var(--line); }
.island-score ol { list-style: none; display: grid; gap: 5px; margin: 0; padding: 0; }
.island-score li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  background: #f3f7e9;
  font-size: 13px;
}
.island-score li span { color: var(--muted); white-space: nowrap; }
.island-score ol.island-team-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.island-team-scores .island-team-score {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--team-border);
  border-top-width: 3px;
  border-radius: 10px;
  background: var(--team-panel);
  color: var(--team-ink);
}
.island-team-scores .island-team-score span { color: inherit; font-size: 12px; font-weight: 950; white-space: normal; }
.island-team-score strong { font-size: clamp(16px, 1.65vw, 21px); line-height: 1.15; font-variant-numeric: tabular-nums; }

.island-library {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--deep);
  font-size: 13px;
}
.island-library label { display: flex; align-items: center; gap: 8px; font-weight: 950; }
.island-library select, [data-library-template] {
  padding: 7px;
  max-width: min(100%, 220px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--deep);
}
.island-challenge {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid #cfc1ed;
  border-radius: 14px;
  background: #f4efff;
  color: var(--deep);
}
.island-challenge h2 { margin: 0 0 3px; font-size: 19px; }
.island-challenge p { margin: 0; font-size: 14px; }
.island-challenge strong { font-size: 13px; }
.island-grid button.tile-build-area { box-shadow: inset 0 0 0 2px #513383; }

.studio-dock {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  padding: 5px;
  background: #fffdf5;
  border-top: 1px solid #dddfca;
}
.studio-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}
.studio-palette .studio-tool, .studio-undo, .studio-camera button {
  display: grid;
  justify-items: center;
  align-content: center;
  place-content: center;
  gap: 2px;
  min-height: 50px;
  min-width: 52px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #183c31;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1.1;
  touch-action: manipulation;
}
.studio-palette .studio-tool:hover, .studio-undo:not(:disabled):hover, .studio-camera button:hover { background: #edf5de; }
.studio-palette .studio-tool[aria-pressed="true"] {
  border-color: #7d9445;
  background: #eef8c9;
  box-shadow: inset 0 -2px #bccd8b;
}
.studio-undo { border-inline-start-color: #dedfc9; }
.studio-undo span { font-size: 26px; }
.studio-undo small { font-size: inherit; }
.studio-picker-panel { display: contents; }
.studio-picker-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 146px;
  min-height: 50px;
  padding: 5px 10px;
  border: 1px solid #d2dfb3;
  border-radius: 12px;
  background: #f2f8dd;
  color: #183c31;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
}
.studio-picker-toggle:hover { background: #e8f2cb; }
.studio-picker-toggle:focus-visible { outline: 3px solid #316e54; outline-offset: 3px; }
.studio-picker-toggle .studio-swatch { width: 29px; height: 29px; }
.studio-picker-label { display: grid; gap: 2px; }
.studio-picker-label small { font-size: 10px; font-weight: 800; color: #55705d; }
.studio-picker-label strong { font-size: 14px; line-height: 1.2; }
.studio-picker-caret { margin-left: auto; font-size: 18px; }
.studio-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-picker-heading > strong { font-size: 15px; }
.studio-picker-heading .close-button { min-width: 44px; min-height: 44px; margin: 0; }
.studio-tools-dismiss { position: absolute; z-index: 3; inset: 0; background: #173f3514; touch-action: manipulation; }
.is-immersive .studio-picker-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: block;
  width: min(350px, calc(100vw - 26px));
  max-height: calc(100dvh - var(--studio-bottom) - var(--builder-dock-height, 64px) - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 10px 12px;
  border: 1px solid #fff;
  border-radius: 19px;
  background: #fffef7;
  box-shadow: 0 12px 36px #17453640;
}
.is-immersive .studio-picker-panel .studio-palette { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 5px; }
.is-immersive .studio-picker-panel .studio-palette .studio-tool { min-height: 60px; min-width: 44px; padding: 5px 3px; }
.is-immersive .studio-picker-panel .studio-palette .studio-tool-name { font-size: 11px; }
.is-immersive.studio-picker-open .studio-dock { z-index: 4; }
.studio-camera {
  position: absolute;
  z-index: 1;
  inset: 55px 10px auto auto;
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid #fff;
  border-radius: 17px;
  background: #fffdf5ee;
  box-shadow: 0 3px 10px #194d4830;
}
.studio-camera button { min-width: 44px; min-height: 44px; font-size: 23px; }
.studio-camera .studio-camera-overview {
  grid-auto-flow: column;
  align-items: center;
  gap: 4px;
  padding-inline: 7px;
  font-size: 11px;
}
.studio-camera-overview span { font-size: 17px; }
.island-level-goal {
  margin: 0 0 12px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 14px;
}
.is-immersive .island-level-goal {
  position: absolute;
  z-index: 2;
  top: calc(var(--studio-top) + clamp(108px, 12vw, 139px));
  left: var(--studio-x);
  width: min(290px, 58vw);
  padding: 9px 12px;
  border: 1px solid #ffffffc0;
  border-radius: 12px;
  background: #fffdf2ee;
  color: #254d3a;
  font-size: 13px;
  pointer-events: none;
}
.island-level-clear {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  padding: 25px;
  border: 2px solid #fffce2;
  border-radius: 24px;
  background: #fffdf2fa;
  box-shadow: 0 10px 60px #153e4380;
  color: #1b4834;
  text-align: center;
}
.island-level-clear h2 { margin-bottom: 9px; font-size: 29px; line-height: 1.1; }
.island-level-clear p { margin-block: 0 16px; font-size: 14px; }
.island-level-clear .section-actions { justify-content: center; }
.studio-showcase-link { background: #edf5c3; border-color: #bbcc85; }

body:has(.island-view.is-immersive) { overflow: hidden; }
body:has(.island-view.is-immersive) > :is(.topbar, .skip-link) { visibility: hidden; }
.island-view.is-immersive {
  --studio-x: max(15px, env(safe-area-inset-left));
  --studio-right: max(15px, env(safe-area-inset-right));
  --studio-top: max(15px, env(safe-area-inset-top));
  --studio-bottom: max(14px, env(safe-area-inset-bottom));
  position: fixed;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100dvh;
  isolation: isolate;
  background: #83d5e7;
}
.is-immersive .island-layout, .is-immersive .island-stage {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #83d5e7;
}
.is-immersive .island-stage :is(.island-canvas, .island-grid-wrap) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  grid-area: auto;
}
.is-immersive .island-grid-wrap { display: grid; place-items: center; padding: 86px 10px 93px; }
.is-immersive .island-stage .island-grid { width: min(96%, 660px, calc(100dvh - 178px)); }
.is-immersive .island-header {
  position: absolute;
  z-index: 4;
  inset: var(--studio-top) var(--studio-right) auto var(--studio-x);
  flex-flow: row nowrap;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  pointer-events: none;
}
.is-immersive .studio-title {
  color: #103d36;
  text-shadow: 0 1px 1px #f0ffdf80;
}
.is-immersive .studio-title .eyebrow {
  color: inherit;
  font-size: 10px;
  letter-spacing: .16em;
}
.is-immersive .studio-title h1 {
  margin: 3px 0 0;
  color: inherit;
  font-size: clamp(26px, 4.8vw, 49px);
  text-wrap: balance;
}
.is-immersive .studio-title [data-island-description],
.is-immersive .island-play-panel :is(h2, .island-keyboard-hint, [data-island-instructions]) { display: none; }
.is-immersive .island-actions { justify-content: flex-end; flex: none; pointer-events: auto; gap: 5px; }
.is-immersive .island-actions .button {
  min-height: 45px;
  padding: 8px 15px;
  border: 1px solid #fff;
  border-radius: 13px;
  background: #fffdf3;
  color: #163b31;
  box-shadow: 0 2px 5px #21534b2b;
  font-size: 13px;
}
.is-immersive .island-actions .primary {
  border-color: #235a3a;
  background: #245a3a;
  color: #fffce4;
}
.is-immersive .studio-secondary {
  display: none;
  position: absolute;
  top: 53px;
  right: 0;
  width: min(276px, calc(100vw - 28px));
  max-height: calc(100dvh - var(--studio-top) - 69px);
  overflow: auto;
  padding: 8px;
  gap: 5px;
  border: 1px solid #fff;
  border-radius: 16px;
  background: #fffdf6;
  box-shadow: 0 12px 32px #184e4c44;
}
.is-immersive.studio-menu-open .studio-secondary { display: grid; }
.is-immersive.studio-menu-open .studio-menu-dismiss {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
}
.is-immersive .studio-secondary .button { width: 100%; justify-content: center; background: #eff4e8; box-shadow: none; }
.is-immersive .studio-secondary .primary { background: #245a3a; }
.is-immersive .island-toolbar {
  position: absolute;
  z-index: 2;
  top: calc(var(--studio-top) + clamp(59px, 7.2vw, 88px));
  left: var(--studio-x);
  min-height: 0;
  justify-content: start;
  gap: 5px;
  padding: 0;
}
.is-immersive .island-toolbar label span { display: none; }
.is-immersive .island-toolbar :is(select, [data-island-progress], .island-ghost-key) {
  padding: 6px 8px;
  border: 1px solid #ffffffd0;
  border-radius: 9px;
  background: #fffdf4ee;
  color: #205544;
  font-size: 12px;
  box-shadow: 0 2px 5px #21534b1f;
}
.is-immersive .island-toolbar select { min-height: 44px; }
.is-immersive .studio-camera { inset: auto var(--studio-right) calc(var(--studio-bottom) + 110px) auto; }
.is-immersive .studio-dock {
  position: absolute;
  z-index: 2;
  bottom: var(--studio-bottom);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 22px);
  width: max-content;
  padding: 5px;
  border: 1px solid #fff;
  border-radius: 18px;
  background: #fffdf5f5;
  box-shadow: 0 6px 0 #1b57452b, 0 10px 28px #11574833;
}
.is-immersive .island-status {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--studio-bottom) + 72px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(85%, 630px);
  min-height: 0;
  padding: 6px 12px;
  border-radius: 20px;
  background: #153d37e8;
  color: #fffdeb;
  text-align: center;
  pointer-events: none;
}
.is-immersive .island-status.is-error { background: #813d27; }
.is-immersive .island-play-panel {
  position: absolute;
  z-index: 2;
  inset: auto var(--studio-right) var(--studio-bottom) var(--studio-x);
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.is-immersive .island-play-controls { grid-template-columns: 1fr auto; align-items: end; }
.is-immersive .island-play-controls button { pointer-events: auto; box-shadow: 0 3px 0 #1b574545; }
.is-immersive .island-play-controls .button, .is-immersive .island-restart {
  background: #fffdf5ee;
  color: #174636;
  border: 1px solid #fff;
  border-radius: 13px;
}
.is-immersive .island-play-controls [aria-pressed="true"] { background: #f2e66d; border-color: #928748; }
.is-immersive .island-stage:has(.island-play-panel:not([hidden])) .island-status {
  bottom: calc(var(--studio-bottom) + 57px);
  max-width: min(53%, 620px);
}
.is-immersive .island-dpad { grid-template-columns: repeat(3, clamp(42px, 7.2vw, 63px)); grid-template-rows: repeat(2, clamp(42px, 7.2vw, 63px)); }
.is-immersive .island-presence { position: absolute; z-index: 2; top: 123px; left: var(--studio-x); max-width: min(73%, 430px); }
.is-immersive :is(.island-panel, .island-library) { margin: 0; padding: 10px; box-shadow: none; }
.is-immersive .island-library :is(label, button) { margin-block: 3px; }
.is-immersive .island-challenge {
  position: absolute;
  z-index: 3;
  top: calc(var(--studio-top) + 112px);
  left: var(--studio-x);
  width: min(290px, 60vw);
  margin: 0;
  pointer-events: none;
}
@media (max-width: 620px) {
  .is-immersive .island-header .button { padding-inline: 8px; font-size: 12px; }
  .is-immersive .studio-title .eyebrow { font-size: 9px; }
  .is-immersive .studio-palette .studio-tool, .is-immersive .studio-undo { min-width: 44px; min-height: 48px; padding-inline: 2px; }
  .is-immersive .studio-palette .studio-tool-name { font-size: 9px; }
}
@media (max-width: 430px) {
  .island-view.is-immersive { --studio-x: max(8px, env(safe-area-inset-left)); --studio-right: max(8px, env(safe-area-inset-right)); }
  .is-immersive .studio-title h1 { font-size: clamp(20px, 6vw, 27px); }
  .is-immersive .studio-palette { flex: 1 1 235px; }
  .is-immersive .studio-dock { width: min(100% - 18px, 325px); }
  .is-immersive .island-status { bottom: calc(var(--studio-bottom) + 117px); }
  .is-immersive .studio-camera { bottom: calc(var(--studio-bottom) + 146px); }
  .is-immersive .island-stage:has(.island-play-panel:not([hidden])) .island-status { bottom: calc(var(--studio-bottom) + 105px); max-width: 90%; }
}
[data-library-challenge-prompt] { margin: 0; color: var(--muted); font-size: 14px; }

.product-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: var(--deep);
  background: transparent;
  text-align: left;
}
.product-menu button:hover { background: #f0f7e7; }

.inbox { max-width: 1050px; margin-inline: auto; }
.inbox-hero {
  padding: clamp(16px, 4vw, 29px);
  background: linear-gradient(115deg, #eaf1d7 35%, #e3f1e9);
}
.inbox-hero h1 { margin-top: 0; }
.inbox-symbol {
  display: grid;
  width: clamp(48px, 8vw, 74px);
  aspect-ratio: 1;
  flex: none;
  place-items: center;
  border-radius: 20px;
  background: #f9fbf1;
  color: var(--forest);
  font-size: clamp(25px, 5vw, 37px);
  line-height: 1;
}
.inbox-layout { display: grid; gap: 14px; margin: 14px auto 0; }
.inbox-layout:not(.inbox-layout-teacher) { max-width: 760px; }
.inbox-layout-teacher { grid-template-columns: minmax(190px, .44fr) minmax(0, 1fr); align-items: start; }
.inbox-roster, .inbox-conversation { min-width: 0; }
.inbox-roster { padding: 14px; }
.inbox-roster h2, .inbox-thread-header h2 { font-size: 20px; line-height: 1.2; }
.inbox-roster [data-inbox-threads] { max-height: min(63dvh, 540px); overflow: auto; padding: 4px; margin: 4px -4px -4px; }
.inbox-empty-roster { padding: 8px 4px; color: var(--muted); font-size: 14px; }
.inbox-thread-list { list-style: none; display: grid; gap: 5px; padding: 0; margin: 0; }
.inbox-thread {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 57px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--deep);
  text-align: start;
}
.inbox-thread:hover { background: #f3f6ec; }
.inbox-thread[aria-current] { border-color: #8cac77; background: #edf5e6; }
.inbox-initials {
  display: grid;
  width: 37px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 11px;
  background: #e6ecd7;
  color: #354f30;
  font-size: 13px;
  font-weight: 950;
}
.inbox-thread-person { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.inbox-thread-person strong { font-size: 14px; line-height: 1.15; }
.inbox-thread-person > span { color: var(--muted); font-size: 12px; }
.inbox-unread {
  min-width: 23px;
  padding: 3px 5px;
  border-radius: 99px;
  background: var(--forest);
  color: white;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}
.inbox-conversation { padding: 0; }
.inbox-thread-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.inbox-thread-header p { color: var(--muted); margin-top: 2px; font-size: 13px; }
.inbox-back { display: none; flex: none; }
.inbox-scroll {
  min-height: 228px;
  max-height: max(228px, min(52dvh, 480px));
  padding: 16px 17px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.inbox-scroll:focus-visible { outline-offset: -3px; }
.inbox-message-list { list-style: none; display: grid; gap: 11px; padding: 0; margin: 0; }
.inbox-message {
  width: fit-content;
  max-width: min(90%, 570px);
  padding: 8px 12px 9px;
  border: 1px solid #d6e1d8;
  border-radius: 5px 14px 14px;
  background: #f0f5f2;
  color: var(--ink);
}
.inbox-message-own {
  justify-self: end;
  border-color: #d2dfbe;
  border-radius: 14px 5px 14px 14px;
  background: #eaf3df;
}
.inbox-message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 11px; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.inbox-message-meta strong { color: var(--deep); font-size: 12px; }
.inbox-message-body { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; }
.inbox-history-empty { display: grid; align-content: center; gap: 6px; min-height: 193px; text-align: center; color: var(--muted); }
.inbox-history-empty > span { color: var(--forest); font-size: 23px; }
.inbox-history-empty h2, .inbox-history-empty h3 { color: var(--deep); font-size: 19px; }
.inbox-history-empty p { font-size: 14px; }
.inbox-more { display: flex; justify-content: center; padding-bottom: 13px; }
.inbox-problem { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 9px; margin-bottom: 10px; color: #903c27; font-size: 14px; }
.inbox-compose {
  display: grid;
  justify-items: stretch;
  gap: 7px;
  margin: 0;
  padding: 12px 17px 14px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 17px 17px;
  background: #f8faf4;
}
.inbox-compose textarea {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid #aebca8;
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}
.inbox-compose-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; }
.inbox-compose-controls > span, .inbox-send-status { color: var(--muted); font-size: 12px; }
.inbox-send-status:empty { position: absolute; clip-path: inset(50%); }
.inbox-send-status[data-error] { color: #903c27; }
@media (max-width: 650px) {
  .inbox-layout-teacher { grid-template-columns: minmax(0, 1fr); }
  .inbox-layout-teacher.inbox-layout-selected .inbox-roster { display: none; }
  .inbox-layout-teacher:not(.inbox-layout-selected) .inbox-conversation:not(:has(.inbox-problem)) { display: none; }
  .inbox-back { display: inline-flex; }
  .inbox-scroll { padding-inline: 11px; scrollbar-gutter: auto; }
  .inbox-message { max-width: 94%; }
  .inbox-compose, .inbox-thread-header { padding-inline: 11px; }
  .inbox-compose textarea { font-size: 16px; }
}

.arcade-hero {
  background: linear-gradient(115deg, #eaf3d5, #e2f0ed 80%);
  border: 1px solid #d8e5d4;
}
.arcade-hero p { margin-top: 7px; }
.arcade-bay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 15px;
  padding: clamp(17px, 3vw, 25px);
  border: 1px solid #e3d6aa;
  border-radius: 20px;
  background: linear-gradient(110deg, #fff1c6, #def5df 86%);
}
.arcade-bay h2 { margin: 0; font-size: 24px; }
.arcade-bay p { margin-top: 3px; color: #485d49; }
.arcade-kart {
  display: grid;
  grid-template-columns: 1fr minmax(0, .95fr);
  align-items: center;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid #d6dfa8;
  border-radius: 20px;
  background: #eef3dc;
}
.arcade-kart-art { display: block; width: 100%; }
.arcade-kart-copy { padding: clamp(18px, 3.5vw, 40px); }
.arcade-kart-copy h2 { margin: 0; color: #215441; font-size: clamp(26px, 3vw, 40px); line-height: 1.07; }
.arcade-kart-copy p { max-width: 38ch; margin: 10px 0 16px; color: #405c46; }
@media (max-width: 600px) {
  .arcade-kart { grid-template-columns: minmax(0, 1fr); }
}
.arcade-vault {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 15px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid #304d43;
  border-radius: 20px;
  color: #f5f0df;
  background: linear-gradient(110deg, #182923, #264437);
}
.arcade-vault-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #a38550;
  border-radius: 15px;
  background: #393a29;
  font-size: 26px;
}
.arcade-vault > div:nth-child(2) { flex: 1 1 230px; }
.arcade-vault h2 { margin: 0; color: inherit; font-size: 24px; }
.arcade-vault p { margin: 4px 0 0; color: #d6e0d3; }
.arcade-vault .button { border: 0; background: #f6da8b; color: #2c291d; }
.arcade-vault .button:hover { background: #ffe9ac; }
.vault-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.arcade-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-block: 16px;
}
.arcade-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--deep);
  font-size: 13px;
  font-weight: 950;
}
.arcade-filters a:hover { border-color: #a7c189; background: #edf5e2; }
.arcade-filters a[aria-current] { border-color: var(--forest); background: var(--forest); color: var(--white); }
.arcade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.arcade-card article { display: flex; min-height: 100%; flex-direction: column; }
.arcade-scenery {
  --arcade-sky: #d5f2d9;
  --arcade-edge: #a2d4c2;
  --arcade-ripple: #4d928a35;
  display: grid;
  min-height: 164px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  border-bottom: 1px solid #435c5124;
  background:
    radial-gradient(ellipse at 50% 120%, transparent 45%, var(--arcade-ripple) 45.5%, transparent 47%) center / 145px 62px,
    radial-gradient(ellipse at 68% 10%, #ffffff98, transparent 66%),
    linear-gradient(150deg, var(--arcade-sky), var(--arcade-edge));
}
.arcade-tone-lime { --arcade-sky: #e5f3b9; --arcade-edge: #9dcba1; --arcade-ripple: #4d976b32; }
.arcade-tone-peach { --arcade-sky: #ffedce; --arcade-edge: #e9bfa0; --arcade-ripple: #b9867330; }
.arcade-tone-lilac { --arcade-sky: #eee8ff; --arcade-edge: #b8addd; --arcade-ripple: #8a78bc3d; }
.arcade-tone-blue { --arcade-sky: #d8f4ff; --arcade-edge: #98cce1; --arcade-ripple: #588cae38; }
.arcade-tone-pink { --arcade-sky: #ffe7ee; --arcade-edge: #e5b5cb; --arcade-ripple: #9f668938; }
.arcade-miniature {
  display: grid;
  grid-template: repeat(11, minmax(0, 1fr)) / repeat(11, minmax(0, 1fr));
  width: 127px;
  aspect-ratio: 1;
  padding: 2px;
  border: 2px solid #4d7455;
  border-radius: 7px;
  background: #526e4b;
  box-shadow: 3px 4px 0 #426048, 8px 10px 16px #254d4f45;
  transform: rotate(-12deg);
}
.arcade-mini-tile {
  display: grid;
  position: relative;
  place-items: center;
  box-shadow: inset 0 0 0 0.5px #243e2930;
}
.arcade-mini-ground { background: #c3de91; }
.arcade-mini-ground:nth-child(2n) { background: #b6d782; }
.arcade-mini-g { background: #84b962; }
.arcade-mini-w { background: #d9a46d; }
.arcade-mini-s { background: #a29bb7; }
.arcade-mini-a { background: #76bcd7; }
.arcade-mini-raised { box-shadow: inset 1px 1px #fff6, inset -1.5px -1.5px #3e394956; }
.arcade-marker-start, .arcade-marker-finish, .arcade-marker-star {
  position: absolute;
  z-index: 1;
  transform: rotate(12deg);
}
.arcade-marker-start {
  width: 7px;
  height: 7px;
  border: 1.5px solid #fff9dc;
  border-radius: 50%;
  background: #a44c40;
}
.arcade-marker-finish {
  width: 8px;
  height: 8px;
  border: 1px solid #34373d;
  border-radius: 1px;
  background: repeating-conic-gradient(#34373d 0 25%, #fff 0 50%) center / 6px 6px;
}
.arcade-marker-star {
  color: #fff7a0;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  text-shadow: 0 1px #805329, 0 -1px #805329, 1px 0 #805329, -1px 0 #805329;
}
.arcade-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 15px 16px 17px;
}
.arcade-card-meta, .arcade-card-actions { display: flex; align-items: center; gap: 10px; }
.arcade-card-meta { flex-wrap: wrap; justify-content: space-between; }
.arcade-card-content h2 { overflow-wrap: anywhere; }
.arcade-card-content p { color: var(--muted); font-size: 14px; line-height: 1.45; }
.arcade-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.arcade-mode-stars { background: #fff4ca; color: #674515; }
.arcade-mode-tag { background: #efe7fb; color: #593f80; }
.arcade-mode-paint { background: #e0f1fa; color: #255076; }
.arcade-difficulty { color: var(--muted); font-size: 12px; font-weight: 900; }
.arcade-card-actions { justify-content: space-between; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.arcade-best { display: grid; gap: 1px; color: var(--muted); font-size: 11px; line-height: 1.2; text-align: end; }
.arcade-best strong { color: var(--forest); font-size: 14px; }
.arcade-record-note, .arcade-no-courses { margin-top: 13px; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .arcade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .arcade-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .arcade-scenery { min-height: 151px; }
  .arcade-miniature { width: 115px; }
  .arcade-filters { margin-block: 11px; }
}

.math-garden { width: min(100%, 1080px); margin-inline: auto; }
.math-hero { background: linear-gradient(119deg, #e8f2ce, #e1efe8); }
.math-hero p { margin-top: 7px; }
.math-chooser-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-block: 20px 11px;
}
.math-chooser-controls label { display: inline-flex; align-items: center; gap: 8px; color: var(--deep); font-weight: 900; }
.math-chooser-controls select {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--deep);
  font: inherit;
}
.math-games {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.math-game-card {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--deep);
  box-shadow: var(--shadow);
  text-align: start;
}
.math-game-card:hover { border-color: #99b38b; }
.math-game-art {
  --math-art-top: #e3f1c6;
  --math-art-base: #bcddaf;
  --math-art-trim: #89ad75;
  display: grid;
  min-height: 124px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--math-art-trim) 35%, transparent);
  border-radius: 12px;
  background: radial-gradient(ellipse at 26% 5%, #fff9, transparent 53%), linear-gradient(140deg, var(--math-art-top), var(--math-art-base));
}
.math-tone-blue { --math-art-top: #def5fd; --math-art-base: #abcee3; --math-art-trim: #729ead; }
.math-tone-lilac { --math-art-top: #eee7ff; --math-art-base: #cbc0e8; --math-art-trim: #9181b8; }
.math-game-art .math-seed-frame {
  width: min(80%, 144px);
  gap: 3px;
  padding: 4px;
  border: 1px solid #6f976b;
  border-radius: 11px;
  background: #759b68;
  box-shadow: 0 4px 0 #607f57, 0 10px 15px #3049282e;
  transform: rotate(-6deg);
}
.math-game-art .math-seed-slot { border-radius: 6px; }
.math-art-tiles { display: flex; align-items: center; gap: 5px; transform: rotate(-6deg); }
.math-art-tiles span {
  display: grid;
  width: clamp(25px, 4vw, 40px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--math-art-trim);
  border-radius: 9px;
  background: #fffbefd9;
  color: #2b4b50;
  box-shadow: 0 3px 0 var(--math-art-trim);
  font-size: clamp(15px, 2.8vw, 24px);
  font-weight: 1000;
}
.math-art-tiles b { color: #224c59; font-size: 24px; font-weight: 1000; }
.math-game-copy { display: grid; gap: 4px; margin-inline: 5px; }
.math-game-copy strong { font-size: 21px; font-weight: 1000; line-height: 1.15; }
.math-game-copy span { color: var(--muted); font-size: 14px; line-height: 1.35; }
.math-game-play {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  margin: auto 5px 5px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--forest);
  color: var(--white);
  font-weight: 950;
}
.math-game-card:hover .math-game-play { background: #316949; }
.math-round-top, .math-round, .math-results { width: min(100%, 700px); margin-inline: auto; }
.math-round-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.math-round, .math-results { padding: clamp(13px, 4vw, 30px); }
.math-round-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}
.math-round-meta strong { margin-right: 6px; color: var(--deep); font-weight: 1000; }
.math-round progress { display: block; width: 100%; margin-block: 6px 18px; accent-color: var(--forest); }
.math-round h1, .math-results h1 { color: var(--deep); font-size: clamp(26px, 5vw, 40px); font-weight: 1000; line-height: 1.13; letter-spacing: -.04em; }
.math-seed-activity, .math-model {
  margin-top: 16px;
  padding: clamp(9px, 3vw, 16px);
  border: 1px solid #dce7cd;
  border-radius: 14px;
  background: #f4f8ed;
}
.math-seed-board { display: flex; justify-content: center; }
.math-seed-frame { display: grid; width: min(100%, 294px); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.math-seed-slot {
  display: grid;
  aspect-ratio: 1.16;
  place-items: center;
  border: 1px solid #91a98e;
  border-radius: 9px;
  background: #fffdf7;
  box-shadow: inset 0 1px 4px #4c523015;
}
.math-seed-start::after, .math-seed-added::after, .math-seed-legend span::before {
  width: 51%;
  height: 58%;
  border: 1px solid #8b602b;
  border-radius: 65% 50% 65% 45%;
  background: linear-gradient(133deg, #ffce76, #cc8b49);
  box-shadow: 0 2px 2px #4d3d0e30;
  content: '';
  transform: rotate(28deg);
}
.math-seed-added::after, .math-seed-legend span + span::before { border-color: #4d743e; background: linear-gradient(133deg, #a4d584, #619356); }
.math-seed-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 850; }
.math-seed-legend span { display: inline-flex; align-items: center; gap: 4px; }
.math-seed-legend span::before { display: inline-block; width: 11px; height: 11px; }
.math-seed-counter { display: grid; grid-template-columns: 1fr max-content 1fr; align-items: stretch; gap: 8px; width: min(100%, 426px); margin: 13px auto 0; }
.math-seed-counter .math-seed-step { min-height: 46px; gap: 5px; padding-inline: clamp(5px, 2vw, 12px); }
.math-seed-step span { font-size: 19px; line-height: 1; }
.math-seed-step:disabled { opacity: .54; }
.math-seed-count { display: grid; min-width: 46px; align-self: center; color: var(--deep); font-size: 23px; font-weight: 1000; line-height: 1; text-align: center; }
.math-seed-count span { color: var(--muted); font-size: 11px; font-weight: 900; }
.math-seed-overflow { margin-top: 8px; color: #7b2f1f; font-weight: 850; text-align: center; }
.math-model { display: flex; justify-content: center; align-items: center; gap: clamp(4px, 1.8vw, 10px); }
.math-model-tile, .math-model-sign { color: var(--deep); font-size: clamp(19px, 6vw, 34px); font-weight: 1000; }
.math-model-tile {
  display: grid;
  min-width: 0;
  width: clamp(43px, 13vw, 76px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #b1c2a4;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 3px 0 #c8d7bf;
}
.math-model-blank { border-style: dashed; background: #e6efda; }
.math-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.math-choices .math-choice { min-height: 51px; padding-inline: 3px; font-size: clamp(18px, 4vw, 24px); }
.math-choice[aria-pressed="true"] { border-color: var(--forest); background: #dcefcf; box-shadow: inset 0 0 0 1px var(--forest); }
.math-choice:disabled:not([aria-pressed="true"]) { opacity: .54; }
.math-round-actions, .math-result-actions { margin-top: 14px; }
.math-round-actions .button, .math-result-actions .button, .math-round-top .button { min-height: 44px; }
.math-feedback, .math-round-hint { margin-top: 12px; padding: 8px 10px; border-radius: 8px; font-weight: 850; }
.math-feedback:empty { margin-top: 0; padding: 0; }
.math-feedback-correct { background: #e5f1dd; color: #285636; }
.math-feedback-retry { background: #fbede1; color: #762b20; }
.math-round-hint { background: #fbf1d1; color: #614718; }
.math-results { text-align: center; }
.math-results > p { margin-top: 6px; color: var(--muted); }
.math-result-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 12px; place-items: center; border-radius: 17px; background: #e6f2d0; font-size: 29px; }
.math-result-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block: 15px 10px; }
.math-result-scores div { display: grid; gap: 3px; padding: 10px 15px; border-radius: 12px; background: #edf4e4; }
.math-result-scores strong { color: var(--forest); font-size: 25px; font-weight: 1000; }
.math-result-scores span { color: var(--muted); font-size: 13px; font-weight: 850; }
.math-record-note { font-size: 13px; }
.math-result-actions { justify-content: center; }
@media (max-width: 700px) {
  .math-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 465px) {
  .math-games { grid-template-columns: minmax(0, 1fr); }
  .math-game-art { min-height: 92px; }
  .math-game-art .math-seed-frame { max-width: 112px; }
  .math-seed-counter { gap: 4px; }
  .math-seed-counter .math-seed-step { font-size: 12px; }
}

.vault-game {
  --vault-ink: #1a3030;
  --vault-teal: #245a54;
  --vault-muted: #455f58;
  --vault-divider: #d7e0d7;
  max-width: 980px;
  margin-inline: auto;
  color: var(--vault-ink);
}
.vault-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--vault-teal);
  font-size: 14px;
  font-weight: 900;
}
.vault-back:hover { text-decoration: underline; }
.vault-back span { font-size: 20px; line-height: 1; }
.vault-banner {
  display: flex;
  position: relative;
  isolation: isolate;
  min-height: 137px;
  align-items: center;
  overflow: hidden;
  padding: clamp(17px, 4vw, 31px);
  border: 1px solid #1d4542;
  border-radius: 21px;
  background: radial-gradient(ellipse at 91% 125%, #36726a, transparent 72%), linear-gradient(121deg, #163231, #224d48);
  box-shadow: inset 0 1px #ffffff21, 0 5px 0 #c6d6c9;
  color: #fff5df;
}
.vault-banner::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 9px solid #23534b31;
  border-radius: inherit;
  content: '';
  pointer-events: none;
}
.vault-banner h1 { font-size: clamp(28px, 6.5vw, 56px); font-weight: 1000; letter-spacing: -.055em; line-height: 1; }
.vault-banner p { margin-top: 9px; color: #e7ead5; font-size: clamp(13px, 2.7vw, 17px); font-weight: 750; }
.vault-banner-art {
  position: absolute;
  z-index: -1;
  inset: 4px 18px 4px auto;
  width: 175px;
  transform: rotate(-9deg);
}
.vault-banner-art .vault-icon-exit { inset: 15% 1% 8% 46%; }
.vault-banner-art .vault-icon-key { inset: 45% 42% 15% 15%; transform: rotate(-34deg); }
.vault-stage {
  margin-top: 21px;
  padding: clamp(10px, 2.2vw, 21px);
  border: 1px solid var(--vault-divider);
  border-radius: 20px;
  background: #fffdf5;
  box-shadow: 0 5px 14px #254c4510;
}
.vault-mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px 20px;
  padding: 1px 2px 15px;
}
.vault-room-label { color: var(--vault-teal); font-size: 12px; font-weight: 1000; letter-spacing: .075em; text-transform: uppercase; }
.vault-mission h2 { font-size: clamp(22px, 5vw, 34px); font-weight: 1000; letter-spacing: -.045em; line-height: 1.18; }
.vault-brief { max-width: 48ch; margin-top: 4px; color: var(--vault-muted); font-size: 14px; line-height: 1.4; }
.vault-stats { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.vault-stats div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  min-width: 57px;
  padding: 6px 8px;
  border: 1px solid #e2d7b9;
  border-radius: 10px;
  background: #f7f0dc;
  color: #514a3a;
  font-size: 11px;
  font-weight: 900;
}
.vault-stats dd { margin: 0; color: #3a3c27; font-size: 24px; font-weight: 1000; font-variant-numeric: tabular-nums; line-height: 1.1; }
.vault-play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(222px, 260px);
  align-items: start;
  column-gap: clamp(14px, 3vw, 31px);
}
.vault-stone {
  padding: clamp(5px, 1.3vw, 14px);
  border: 1px solid #34534c;
  border-radius: clamp(8px, 1.6vw, 16px);
  background: linear-gradient(#263b36, #253934);
  box-shadow: inset 0 1px 0 #5e7162, 0 4px 0 #1a2e26;
}
.vault-stone[data-vault-won="true"] { border-color: #cd9e41; box-shadow: inset 0 1px 0 #ffda8a, 0 4px 0 #aa7d35; }
.vault-board {
  display: grid;
  gap: clamp(1px, .33vw, 4px);
  border-radius: 4px;
  background: #1b2c29;
}
.vault-board:focus-visible { outline: 3px solid #ffe49f; outline-offset: 3px; }
.vault-row {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: inherit;
}
.vault-tile {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: clamp(2px, .55vw, 6px);
  background: linear-gradient(146deg, #7e8670, #657762 60%, #64735d);
  box-shadow: inset 0 1px #bec29a52, inset 0 -2px #30463755;
}
.vault-row:nth-child(odd) .vault-tile-floor:nth-child(even),
.vault-row:nth-child(even) .vault-tile-floor:nth-child(odd) {
  background: linear-gradient(146deg, #858a75, #6e7b65 70%, #687861);
}
.vault-row .vault-tile.vault-tile-wall {
  border: 1px solid #1a302b;
  background: linear-gradient(146deg, #485f55, #344f46 62%, #2e473f);
  box-shadow: inset 0 1px #b0c2a548, inset 0 -3px #1a312c99;
}
.vault-tile-wall::before {
  position: absolute;
  inset: 34% 2px 29%;
  border-block: 1px solid #1a342967;
  background: linear-gradient(90deg, #0000 31%, #263f3799 31% 34%, #0000 34% 67%, #293f37aa 67% 70%, #0000 70%);
  content: '';
}
.vault-row .vault-tile.vault-tile-start { background: linear-gradient(140deg, #697e8a, #4d686c); }
.vault-row .vault-tile.vault-tile-exit { background: radial-gradient(ellipse at 50% 58%, #a8d7a6, #457e71); }
.vault-row .vault-tile.vault-tile-spikes,
.vault-row .vault-tile.vault-tile-spikes-active { background: linear-gradient(145deg, #595750, #474848); }
.vault-tile-danger::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 2px dashed #ffe098;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, #ffd47225 0 3px, #0000 3px 7px);
  content: '';
  pointer-events: none;
}
.vault-icon {
  display: block;
  position: absolute;
  inset: 15%;
  pointer-events: none;
}
.vault-icon-exit {
  inset: 13% 19% 12%;
  border: max(1px, .12em) solid #c8ef9f;
  border-radius: 50% 50% 10% 10%;
  background: radial-gradient(ellipse at 50% 70%, #ecffc0, #83c395 62%, #367f6b);
  box-shadow: 0 0 8px #b5e79077, inset 0 -2px #4b8d62;
}
.vault-icon-exit::after {
  position: absolute;
  inset: 26% 26% 21%;
  background: #faffd1;
  clip-path: polygon(50% 0, 59% 42%, 100% 50%, 59% 60%, 50% 100%, 41% 60%, 0 50%, 41% 42%);
  content: '';
}
.vault-icon-key {
  inset: 16% 13%;
  transform: rotate(-32deg);
}
.vault-icon-key::before {
  position: absolute;
  top: 17%;
  left: 0;
  width: 43%;
  height: 63%;
  border: clamp(2px, .33vw, 4px) solid #ffdb81;
  border-radius: 50%;
  background: #405342;
  box-shadow: 0 1px #55422d, inset 0 0 0 1px #af6a3c;
  content: '';
}
.vault-icon-key::after {
  position: absolute;
  top: 41%;
  left: 35%;
  width: 61%;
  height: 37%;
  background: linear-gradient(#ffe49f, #e4a44e);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 80%, 80% 48%, 65% 48%, 65% 100%, 46% 100%, 46% 45%, 0 45%);
  content: '';
}
.vault-icon-door, .vault-icon-door-open {
  inset: 11% 17% 8%;
  border: 1px solid #412c21;
  border-radius: 30% 30% 7% 7%;
  background: repeating-linear-gradient(90deg, #ac7951 0 24%, #694927 24% 29%);
  box-shadow: inset 0 1px #f3c885, 0 2px #3e3229;
}
.vault-icon-door::after {
  position: absolute;
  inset: 36% 29% 18%;
  border: 1px solid #56371f;
  border-radius: 30% 30% 16% 16%;
  background: radial-gradient(circle at 50% 58%, #553621 0 22%, transparent 26%), #ffca73;
  content: '';
}
.vault-icon-door-open { background: #28372c; }
.vault-icon-door-open::after {
  position: absolute;
  inset: 0 52% 0 0;
  border-right: 1px solid #412c21;
  border-radius: 36% 0 10% 6%;
  background: #b78656;
  clip-path: polygon(0 0, 93% 16%, 93% 86%, 0 100%);
  content: '';
}
.vault-icon-crate {
  inset: 19%;
  border: 1px solid #562e1e;
  border-radius: 12%;
  background: linear-gradient(43deg, #9a4c39 0 32%, #efb77a 32% 46%, #9a4c39 46% 55%, #efb77a 55% 69%, #9a4c39 69%);
  box-shadow: inset 0 0 0 1px #f5c085, inset 0 0 0 max(2px, .23em) #ad633f, 0 2px 0 #593c30;
}
.vault-tile-crate .vault-icon-plate { inset: 5%; background: #457b96; outline-color: #bcfbf5; }
.vault-icon-plate {
  inset: 17%;
  border: 1px solid #1d565d;
  border-radius: 18%;
  outline: 1px solid #85cfce;
  background: radial-gradient(ellipse, #9df2e6 0 22%, #5196a0 24% 39%, #316976 41%);
  box-shadow: inset 0 -2px #2d545e;
}
.vault-icon-gate, .vault-icon-gate-open {
  inset: 10% 13%;
  border: 1px solid #c6c5ea;
  border-radius: 22% 22% 8% 8%;
  background: repeating-linear-gradient(90deg, #342e46 0 16%, #b4b0d7 16% 27%, #342e46 27% 34%);
  box-shadow: 0 2px 0 #394045;
}
.vault-icon-gate-open {
  border-color: #9eebcc;
  border-bottom-color: transparent;
  background: linear-gradient(#b0e4dc 0 14%, #0000 14%), linear-gradient(90deg, #45797666, #345856 50%, #45797666);
}
.vault-icon-checkpoint, .vault-icon-checkpoint-active {
  inset: 13% 28% 11%;
  border-bottom: 2px solid #374b39;
  background: linear-gradient(90deg, transparent 30%, #374b39 30% 43%, transparent 43%);
}
.vault-icon-checkpoint::after, .vault-icon-checkpoint-active::after {
  position: absolute;
  inset: 4% 0 48% 30%;
  background: #f1dd96;
  clip-path: polygon(0 0, 100% 38%, 0 100%);
  content: '';
}
.vault-icon-checkpoint-active::after { background: #ccffac; }
.vault-icon-spikes, .vault-icon-spikes-active {
  inset: 20% 14%;
  border-bottom: 2px solid #2b3030;
  border-radius: 12%;
  background: repeating-linear-gradient(90deg, #757574 0 23%, #3b4040 23% 33%);
  box-shadow: 0 1px #8b8e86;
}
.vault-icon-spikes-active::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(#fff5de, #ea9a77 65%, #ba5d4e);
  clip-path: polygon(0 92%, 17% 12%, 33% 92%, 50% 0, 66% 92%, 83% 12%, 100% 92%);
  content: '';
}
.vault-icon-player {
  inset: 13% 15% 15%;
  border: 1px solid #442e27;
  border-radius: 36% 43% 35% 36%;
  background: radial-gradient(circle at 36% 65%, #402d2b 0 5%, transparent 6%),
    radial-gradient(circle at 68% 65%, #402d2b 0 5%, transparent 6%),
    linear-gradient(#c58748 0 25%, #6a4426 25% 35%, #ffd29a 35% 75%, #c57349 75%);
  box-shadow: inset 0 1px #fff0ae, 0 2px 0 #363b28;
}
.vault-icon-player::before {
  position: absolute;
  inset: 24% -9% auto;
  height: 17%;
  border: 1px solid #694928;
  border-radius: 40%;
  background: #ffcb6b;
  content: '';
}
.vault-icon-sentry {
  inset: 15% 14%;
  border: 1px solid #452132;
  border-radius: 47% 47% 26% 26%;
  background: radial-gradient(circle at 32% 53%, #ffe4d8 0 7%, transparent 8%),
    radial-gradient(circle at 67% 53%, #ffe4d8 0 7%, transparent 8%),
    linear-gradient(150deg, #e799af, #a14c68 38%, #743a56 74%);
  box-shadow: inset 0 1px #f5bbcd, 0 2px 0 #34382c;
}
.vault-icon-sentry::after {
  position: absolute;
  inset: auto 31% 15%;
  height: 10%;
  border-radius: 4px;
  background: #532c42;
  content: '';
}
.vault-tile-crate .vault-icon-sentry { inset: 4% 4% 53% 53%; }
.vault-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: clamp(8px, 2vw, 14px);
  border: 1px solid #e1ddc7;
  border-radius: 15px;
  background: #f4f1e4;
}
.vault-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: '. up .' 'left down right' 'wait wait wait';
  gap: 5px;
}
.vault-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #a8ada3;
  border-radius: 9px;
  background: #fffdf4;
  box-shadow: 0 2px 0 #c4c5b5;
  color: var(--vault-ink);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  touch-action: manipulation;
}
.vault-button:disabled { opacity: .5; }
.vault-button:not(:disabled):hover, .vault-button[aria-pressed="true"] { background: #e6eee2; }
.vault-button:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.vault-button-symbol { flex: none; font-size: 19px; line-height: 1; }
.vault-pad .vault-button:not(.vault-button-wait) {
  border-color: #23544d;
  background: linear-gradient(#34756b, #285a52);
  box-shadow: inset 0 1px #5d9588, 0 2px 0 #173e39;
  color: #fff6df;
}
.vault-pad .vault-button:not(.vault-button-wait):not(:disabled):hover { background: #27685e; }
.vault-pad .vault-button:not(.vault-button-wait):active { box-shadow: inset 0 1px #5d9588; }
.vault-pad .vault-button:not(.vault-button-wait) .vault-button-symbol { font-size: 25px; }
.vault-button-up { grid-area: up; }
.vault-button-left { grid-area: left; }
.vault-button-down { grid-area: down; }
.vault-button-right { grid-area: right; }
.vault-button-wait { grid-area: wait; }
.vault-keys { color: var(--vault-muted); font-size: 12px; line-height: 1.35; }
.vault-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.vault-options .vault-button { flex-direction: column; gap: 3px; padding: 3px; font-size: 11px; }
.vault-feedback, .vault-hint {
  padding: 8px 10px;
  border: 1px solid #c6d8cc;
  border-radius: 9px;
  background: #eaf4e8;
  color: #264c3f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.vault-hint { border-color: #dec28f; background: #fff2cf; color: #574126; }
.vault-win { display: grid; gap: 5px; background: #e1efd5; text-align: center; }
.vault-win strong { font-size: 19px; font-weight: 1000; }
.vault-button-next { border-color: #1f5148; background: #285d51; color: #fffbef; box-shadow: 0 2px 0 #1a473d; }
.vault-button-next:not(:disabled):hover { background: #1e4d42; }
.vault-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
  color: var(--vault-muted);
  font-size: 12px;
  font-weight: 850;
}
.vault-legend li { display: inline-flex; align-items: center; gap: 4px; }
.vault-legend-mark {
  position: relative;
  display: inline-block;
  width: 19px;
  height: 19px;
  border: 1px solid #405945;
  border-radius: 4px;
  background: #5e7661;
  font-size: 8px;
}
.vault-legend-mark .vault-icon-key::before { border-width: 2px; }
.vault-legend-danger {
  border: 2px dashed #ffe098;
  background: repeating-linear-gradient(-45deg, #7b7659 0 3px, #4a5e52 3px 7px);
  outline: 1px solid #455d46;
}
.vault-replay { margin: 13px 1px 0; color: var(--vault-teal); font-size: 13px; font-weight: 900; }
.vault-rooms { padding-block: 14px 2px; }
.vault-rooms ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.vault-rooms button {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 50px;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #d3dcce;
  border-radius: 11px;
  background: #fffdf5;
  color: var(--vault-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
  touch-action: manipulation;
}
.vault-room-number {
  display: grid;
  flex: 0 0 24px;
  min-height: 24px;
  place-items: center;
  border: 1px solid #d2bf92;
  border-radius: 7px;
  background: #f2e8c8;
  color: #654a30;
  font-weight: 1000;
}
.vault-rooms button[aria-current] { border-color: #568376; background: #e8f2e5; box-shadow: inset 0 0 0 1px #568376; }
.vault-rooms button:not(:disabled):hover { background: #e8f2e5; }
.vault-rooms button:disabled { border-color: #dbe1d6; background: #f3f3e9; color: #596758; }
.vault-rooms button:disabled .vault-room-number { border-color: #cdd8cb; background: #e8ede2; color: #526552; }
.vault-rooms small { display: block; margin-top: 2px; font-size: 10px; font-weight: 850; }
.vault-rooms .vault-cleared { color: var(--vault-teal); }
@media (min-width: 701px) {
  .vault-stone { grid-row: 1; }
  .vault-tools { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 700px) {
  .vault-mission { flex-wrap: wrap; }
  .vault-stats div { flex-direction: row; gap: 4px; min-width: auto; }
  .vault-stats dd { font-size: 16px; }
  .vault-play { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .vault-tools { margin-top: 4px; }
  .vault-pad { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: '. up . wait' 'left down right wait'; }
  .vault-legend { margin-top: 0; }
}
@media (max-width: 580px) {
  .vault-banner { min-height: 0; }
  .vault-banner-art { inset-inline-end: -12px; opacity: .2; }
}
@media (max-width: 410px) {
  .vault-tile-danger::after { border-width: 1px; }
  .vault-rooms ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .vault-button:not(:disabled):active { transform: none; }
}

.studio-swatch {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: none;
  font-size: 27px;
  font-weight: 950;
  line-height: 1;
}
.studio-swatch:has(.studio-cube-top) { filter: drop-shadow(0 2px 1px #23384938); }
.studio-swatch :is(.studio-cube-top, .studio-cube-left, .studio-cube-right) { position: absolute; inset: 0; }
.studio-cube-top {
  background: var(--swatch-top);
  clip-path: polygon(50% 7%, 94% 29%, 50% 51%, 6% 29%);
}
.studio-cube-left {
  background: var(--swatch-left);
  clip-path: polygon(6% 29%, 50% 50%, 51% 91%, 6% 69%);
}
.studio-cube-right {
  background: var(--swatch-right);
  clip-path: polygon(50% 50%, 94% 29%, 94% 69%, 50% 91%);
}
.studio-swatch-g {
  --swatch-top: linear-gradient(150deg, #d1ef86 22%, #9ccd4a 60%, #70a43f 93%);
  --swatch-left: linear-gradient(#8ca94d 43%, #9b7045 45%, #79553c 89%);
  --swatch-right: linear-gradient(#779740 42%, #805838 45%, #67452e 89%);
}
.studio-swatch-g::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, #d8f995, #559a37 53%);
  clip-path: polygon(34% 33%, 31% 20%, 42% 28%, 43% 16%, 50% 26%, 57% 12%, 57% 28%, 68% 19%, 62% 33%, 51% 39%);
  content: '';
}
.studio-swatch-w {
  --swatch-top: repeating-linear-gradient(154deg, #f7bd6b 0 4px, #eaa654 4px 5.5px);
  --swatch-left: repeating-linear-gradient(27deg, #cc884c 0 3px, #b47746 3px 4px);
  --swatch-right: repeating-linear-gradient(153deg, #ad713c 0 3px, #925932 3px 4px);
}
.studio-swatch-s {
  --swatch-top: linear-gradient(147deg, #ece9f3 32%, #dcd6e7 36%, #c0b8d0 65%);
  --swatch-left: linear-gradient(#b5abc7 54%, #9487ad 55%, #a49db8 61%, #9991ad 90%);
  --swatch-right: linear-gradient(#9e94b3 54%, #746a90 55%, #897fa2 59%, #776d90 90%);
}
.studio-swatch-a {
  --swatch-top: repeating-linear-gradient(158deg, #37bdde 0 5px, #83eaf1 6px 8px, #54d3e9 9px 11px);
  --swatch-left: linear-gradient(#5ed7ed, #218fc9 72%);
  --swatch-right: linear-gradient(#38bce5, #1a81b7 72%);
}
.studio-swatch-a :is(.studio-cube-top, .studio-cube-left, .studio-cube-right) {
  transform: scaleY(.72);
  transform-origin: center 65%;
}
.studio-swatch-start { color: #27814c; text-shadow: 0 2px #d3e4a9; }
.studio-swatch-star { color: #ffc650; text-shadow: 0 2px #996329, 1px 0 #ae7130, -1px 0 #ae7130; }
.studio-swatch-finish {
  background: repeating-conic-gradient(#ecf6ff 0% 25%, #2e5272 0% 50%) 50% 48% / 10px 10px;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px #2e5272);
}
.studio-swatch-erase { color: #a64f5c; }

.bay-map { max-width: 1120px; margin-inline: auto; }
.bay-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: #285d50;
  font-size: 14px;
  font-weight: 900;
}
.bay-back:hover { text-decoration: underline; }
.bay-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 35px;
  padding: clamp(20px, 4vw, 38px);
  overflow: hidden;
  border: 1px solid #b9d6bd;
  border-radius: 24px;
  background: radial-gradient(ellipse at 88% 80%, #fcf3cf, #fcf3cf00 55%), linear-gradient(125deg, #e1f2df, #ddf0e6 55%, #f7efc7);
  box-shadow: 0 5px 0 #d4dfc8;
}
.bay-map-heading { max-width: 610px; }
.bay-map-heading h1 { font-size: clamp(38px, 7vw, 68px); font-weight: 1000; line-height: .98; letter-spacing: -.055em; color: #1b4c3c; }
.bay-map-heading > p { max-width: 45ch; margin-top: 13px; color: #435f4f; font-size: clamp(14px, 1.8vw, 17px); line-height: 1.5; }
.bay-map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 19px; margin-top: 22px; }
.bay-continue, .bay-play {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 10px 18px;
  border: 1px solid #17482f;
  border-radius: 12px;
  background: #24583d;
  box-shadow: 0 3px 0 #173e2e;
  color: #fffdec;
  font-size: 14px;
  font-weight: 1000;
  touch-action: manipulation;
}
.bay-continue:hover, .bay-play:hover { background: #326c47; }
.bay-continue:active, .bay-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #173e2e; }
.bay-freebuild { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; font-weight: 900; color: #285642; text-decoration: underline; text-underline-offset: 4px; }
.bay-map-progress {
  display: flex;
  flex: 0 0 190px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 23px 18px;
  border: 1px solid #d5d8b0;
  border-radius: 19px;
  background: #fffef0c7;
  color: #496443;
  font-size: 13px;
  font-weight: 950;
}
.bay-map-progress strong { color: #285b3d; font-size: 48px; font-weight: 1000; line-height: 1; letter-spacing: -.04em; }
.bay-map-progress strong span { font-size: 24px; font-weight: 900; color: #6b7c5b; }
.bay-map-progress progress { display: block; width: 100%; height: 8px; margin-top: 10px; border: 0; border-radius: 10px; accent-color: #568044; overflow: hidden; }
.bay-map-progress progress::-webkit-progress-bar { border-radius: 10px; background: #e5ead8; }
.bay-map-progress progress::-webkit-progress-value { border-radius: 10px; background: #689348; }
.bay-save-note { margin: 15px 2px 0; color: #586b54; font-size: 12px; line-height: 1.5; }
.bay-chapter { margin-top: 31px; }
.bay-chapter-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 15px; margin-bottom: 12px; }
.bay-chapter-heading h2 { color: #254e38; font-size: clamp(22px, 3vw, 29px); font-weight: 1000; line-height: 1.2; letter-spacing: -.035em; }
.bay-chapter-heading > span { color: #60725a; font-size: 12px; font-weight: 900; }
.bay-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0; padding: 0; list-style: none; }
.bay-level { overflow: hidden; min-width: 0; border: 1px solid #d9dfd0; border-radius: 18px; background: #fffef7; box-shadow: 0 3px 0 #e2e7d9; }
.bay-level > article { display: flex; flex-direction: column; height: 100%; }
.bay-level-current { border-color: #76995a; box-shadow: 0 0 0 2px #c4d5a0, 0 4px 0 #b8cc95; }
.bay-miniature { position: relative; display: grid; height: 166px; place-items: center; overflow: hidden; border-bottom: 1px solid #c9e1d0; background: radial-gradient(ellipse at 50% 62%, #b5e1db, #c8e9e3 65%, #d6ede4); }
.bay-mini-island { display: grid; grid-template-columns: repeat(11, 1fr); gap: 1px; width: 143px; height: 143px; transform: rotateX(37deg) rotateZ(-30deg); filter: drop-shadow(-4px 8px 0 #547e4e5c); }
.bay-tile { position: relative; display: grid; min-width: 0; place-items: center; aspect-ratio: 1; border-radius: 2px; background: #8ebd63; box-shadow: inset 0 1px #d5eea575, inset 0 -2px #63834a99; color: #fff0a0; font-size: 10px; font-weight: 1000; line-height: 1; text-shadow: 0 1px 1px #664c17; }
.bay-tile:nth-child(even) { background: #a1cb70; }
.bay-mini-island .bay-tile-g { background: #94c759; box-shadow: inset 0 1px #d9ec9c, inset 0 -3px #896e40; }
.bay-mini-island .bay-tile-w { background: repeating-linear-gradient(0deg, #e8ac62 0 3px, #c58b4f 3px 4px); box-shadow: inset 0 -3px #a87543; }
.bay-mini-island .bay-tile-s { background: linear-gradient(130deg, #e0d9e8, #aea5c1); box-shadow: inset 0 -3px #8f85a1; }
.bay-mini-island .bay-tile-a { background: #7bcbd4; box-shadow: inset 0 1px #e1f7ef80; text-shadow: none; }
.bay-tile-raised { z-index: 1; transform: translateY(-4px); filter: drop-shadow(0 3px 0 #65735780); }
.bay-level-body { display: flex; flex: 1; flex-direction: column; padding: 13px 14px 15px; }
.bay-level-kind { display: flex; justify-content: space-between; gap: 6px; color: #627653; font-size: 11px; font-weight: 950; }
.bay-level-body h3 { margin-top: 5px; color: #244933; font-size: 19px; font-weight: 1000; letter-spacing: -.035em; line-height: 1.15; }
.bay-level-description { flex: 1; margin-top: 7px; color: #607059; font-size: 12px; line-height: 1.5; }
.bay-level-footer { display: flex; flex-wrap: wrap; min-height: 44px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.bay-play { min-height: 44px; padding: 8px 13px; font-size: 12px; border-radius: 10px; }
.bay-best { display: grid; gap: 3px; color: #507044; font-size: 10px; font-weight: 900; line-height: 1.3; text-align: right; }
.bay-level-cleared .bay-play { border-color: #bccdaf; background: #edf4e5; box-shadow: 0 2px 0 #ced9c0; color: #31553a; }
.bay-level-cleared .bay-play:hover { background: #dce9ce; }
.bay-level-locked .bay-miniature { filter: saturate(.38); opacity: .78; }
.bay-locked { display: inline-flex; align-items: center; gap: 5px; color: #68765e; font-size: 12px; font-weight: 950; }
.bay-locked > span { font-size: 19px; }
.bay-unlock-note { color: #75816a; font-size: 10px; }
@media (max-width: 980px) {
  .bay-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bay-miniature { height: 175px; }
  .bay-mini-island { width: 157px; height: 157px; }
}
@media (max-width: 580px) {
  .bay-map-header { flex-wrap: wrap; gap: 20px; border-radius: 19px; }
  .bay-map-progress { flex: 1; flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 6px 15px; padding: 12px 15px; }
  .bay-map-progress strong { font-size: 31px; }
  .bay-map-progress strong span { font-size: 19px; }
  .bay-map-progress progress { flex-basis: 100%; margin-top: 3px; }
  .bay-levels { gap: 10px; }
  .bay-miniature { height: 137px; }
  .bay-mini-island { width: 115px; height: 115px; }
  .bay-level-body { padding: 11px 10px 13px; }
  .bay-level-body h3 { font-size: 17px; }
  .bay-level-description { font-size: 11px; }
  .bay-level-footer { align-items: start; flex-direction: column; gap: 6px; }
  .bay-best { text-align: left; }
}
@media (max-width: 360px) {
  .bay-levels { grid-template-columns: 1fr; }
  .bay-miniature { height: 168px; }
  .bay-mini-island { width: 149px; height: 149px; }
}
@media (prefers-reduced-motion: reduce) {
  .bay-continue:active, .bay-play:active { transform: none; }
}

body:has(.fox-game) { overflow: hidden; }
body:has(.fox-game) > .topbar { visibility: hidden; }
.fox-game {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: #e9eddf;
  color: #1e4537;
}
.fox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 11px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid #dce3ce;
  background: #fffdf4;
}
.fox-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #d5ddc6;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 950;
}
.fox-back:hover { background: #edf4e2; }
.fox-back > span { font-size: 22px; line-height: 1; }
.fox-title { text-align: center; }
.fox-title h1 { font-size: clamp(24px, 3.1vw, 37px); font-weight: 1000; line-height: 1; letter-spacing: -.055em; }
.fox-title p { margin-top: 5px; color: #63806b; font-size: 11px; font-weight: 900; }
.fox-view-control { display: flex; min-height: 44px; align-items: center; gap: 6px; color: #61735d; font-size: 12px; font-weight: 900; }
.fox-view-control select { min-height: 44px; padding: 5px 8px; border: 1px solid #cbd8bc; border-radius: 10px; background: #f8faed; color: #234c39; }
.fox-levels {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  min-height: 55px;
  padding: 5px 12px;
  border-bottom: 1px solid #d6e1cf;
  background: #edf3e4;
  scrollbar-width: thin;
}
.fox-levels button {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 3px;
  border: 1px solid #cbd9ba;
  border-radius: 10px;
  background: #fffdf4;
  color: #31593d;
  font-size: 13px;
  font-weight: 1000;
}
.fox-levels button[aria-current] { border-color: #2c634c; background: #2c634c; box-shadow: 0 2px 0 #174631; color: #fffbdc; }
.fox-levels button:not(:disabled):hover { outline: 2px solid #91af79; outline-offset: 1px; }
.fox-levels button:disabled { border-color: #d9dfce; background: #e5eadc; color: #7a896f; }
.fox-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(325px, 360px); min-width: 0; min-height: 0; }
.fox-world { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #82d0d6; }
.fox-canvas, .fox-grid-wrap { position: absolute; inset: 0; width: 100%; height: 100%; }
.fox-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.fox-canvas canvas:active { cursor: grabbing; }
.fox-mission {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  width: min(295px, calc(100% - 110px));
  padding: 12px 14px;
  border: 1px solid #fff;
  border-radius: 15px;
  background: #fffdf3ed;
  box-shadow: 0 4px 12px #214c4021;
  pointer-events: none;
}
.fox-mission h2 { font-size: 21px; font-weight: 1000; line-height: 1.12; letter-spacing: -.035em; }
.fox-mission p { margin-top: 5px; color: #4d6d55; font-size: 12px; font-weight: 850; line-height: 1.4; }
.fox-run-count { position: absolute; z-index: 1; top: 16px; right: 12px; padding: 7px 9px; border-radius: 11px; background: #fffdf3ed; color: #2e5b48; font-size: 10px; font-weight: 900; }
.fox-run-count > span { display: block; margin-bottom: 2px; text-align: center; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.fox-status {
  position: absolute;
  z-index: 1;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 9px 14px;
  border: 1px solid #d4e5bc;
  border-radius: 15px;
  background: #174f40ed;
  box-shadow: 0 3px 9px #20584322;
  color: #fffce1;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}
.fox-status.is-error { border-color: #edba9b; background: #91492f; }
.fox-status.is-success { border-color: #e5da86; background: #32673b; }
.fox-camera { position: absolute; z-index: 1; bottom: 85px; right: 12px; display: grid; padding: 3px; border: 1px solid #fff; border-radius: 14px; background: #fffdf4ed; box-shadow: 0 3px 10px #254d3f24; }
.fox-camera button { min-width: 44px; min-height: 44px; padding: 4px; border: 0; border-radius: 10px; background: transparent; color: #28503a; font-size: 23px; font-weight: 850; line-height: 1; }
.fox-camera button:hover { background: #e7f1d8; }
.fox-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 11px;
  padding: 19px 17px max(16px, env(safe-area-inset-bottom));
  border-left: 1px solid #ccd8c0;
  background: #fffdf4;
  box-shadow: -6px 0 21px #244f3a12;
}
.fox-editor-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.fox-editor-heading h2 { color: #254b38; font-size: 24px; font-weight: 1000; letter-spacing: -.04em; line-height: 1.1; }
.fox-editor-heading > span { color: #667b5d; font-size: 11px; font-weight: 900; white-space: nowrap; }
.fox-editor-help { color: #65745b; font-size: 12px; line-height: 1.4; }
.fox-editor-modes { display: grid; flex: none; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #eaf0df; }
.fox-editor-mode { min-height: 44px; padding: 7px; border: 0; border-radius: 9px; background: transparent; color: #637c59; font-size: 12px; font-weight: 950; }
.fox-editor-mode[aria-pressed="true"] { background: #fffdf4; color: #244f3d; box-shadow: 0 2px 5px #405b3620; }
.fox-editor [hidden] { display: none !important; }
.fox-editor [data-fox-block-pane] { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 10px; overflow: auto; }
.fox-code-pane { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 8px; overflow: auto; padding: 0 2px 3px; }
.fox-code-help, .fox-code-limit { margin: 0; color: #667b5e; font-size: 11px; line-height: 1.45; }
.fox-code-label { color: #345e49; font-size: 11px; font-weight: 900; }
.fox-code-source { display: block; flex: 1 0 160px; width: 100%; min-height: 160px; resize: vertical; padding: 14px; border: 1px solid #adcbb0; border-radius: 12px; background: #173c35; color: #f5f5d7; caret-color: #ffd67e; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; }
.fox-code-source:focus { outline: 3px solid #e6ba67; outline-offset: 1px; }
.fox-code-source[readonly] { border-color: #dcae56; }
.fox-code-inserts { display: flex; flex-wrap: wrap; gap: 5px; }
.fox-code-insert { min-height: 44px; padding: 6px 8px; border: 1px solid #c9d9bf; border-radius: 8px; background: #edf4e2; color: #385c43; font-size: 11px; font-weight: 800; }
.fox-code-insert code { font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.fox-code-limit { font-size: 10px; }
.fox-code-examples { color: #58754f; font-size: 11px; }
.fox-code-examples summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 900; }
.fox-code-examples pre { overflow-x: auto; margin: 5px 0; padding: 12px; border-radius: 10px; background: #eaf0e0; color: #274d3c; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.fox-code-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.fox-code-tools .fox-button { min-height: 44px; padding: 6px 8px; font-size: 10px; }
.fox-code-line { display: none; }
.fox-code-error { margin: 0; padding: 10px; border: 1px solid #d8a481; border-radius: 9px; background: #fff0de; color: #893d29; font-size: 11px; line-height: 1.45; }
.fox-code-parts { display: grid; gap: 7px; margin: 9px 0; padding-left: 18px; line-height: 1.5; }
.fox-code-parts code, .fox-code-examples p code { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.fox-trace { flex: none; min-width: 0; padding: 9px 10px; border: 1px solid #cedfc0; border-radius: 12px; background: #edf4e3; }
.fox-trace-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: #29533e; font-size: 12px; line-height: 1.3; }
.fox-trace-mark { font-size: 17px; font-weight: 900; line-height: 1; }
.fox-trace-loop { margin-left: auto; max-width: 100%; padding: 3px 6px; border-radius: 6px; background: #dceace; color: #476236; font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.fox-trace-result { margin: 4px 0 0; color: #506a48; font-size: 11px; line-height: 1.4; }
.fox-trace-result[data-tone="star"], .fox-trace-result[data-tone="won"] { color: #376327; font-weight: 850; }
.fox-trace-result[data-tone="blocked"] { color: #8b452d; }
.fox-trace-source { display: block; overflow: hidden; margin-top: 4px; color: #45654b; font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.fox-save-status { flex: none; min-height: 13px; margin: 0; color: #61735b; font-size: 10px; line-height: 1.3; }
.fox-save-status[data-state="too-large"], .fox-save-status[data-state="unavailable"] { color: #8b452d; }
.fox-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.fox-add {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #a9c4ad;
  border-radius: 11px;
  background: #d6ebd6;
  box-shadow: inset 0 1px #fff9, 0 2px #aac8ac;
  color: #244d36;
  font-size: 13px;
  font-weight: 950;
  touch-action: manipulation;
}
.fox-add > span { font-size: 24px; line-height: 1; }
.fox-add-coral { border-color: #d99f8f; background: #f5c3aa; box-shadow: inset 0 1px #fff9, 0 2px #dba38c; color: #6c382b; }
.fox-add-gold { border-color: #d2bb70; background: #f4dfa2; box-shadow: inset 0 1px #fff9, 0 2px #d4be78; color: #66502a; }
.fox-add-blue { border-color: #91b8ca; background: #c7e3eb; box-shadow: inset 0 1px #fff9, 0 2px #97bfcc; color: #285164; }
.fox-add:hover:not(:disabled) { filter: brightness(1.035); }
.fox-add:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.fox-add:disabled, .fox-button:disabled { opacity: .5; }
.fox-program {
  flex: 1 1 130px;
  min-height: 75px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 11px 9px;
  border: 1px solid #d9dfc8;
  border-radius: 15px;
  background-color: #eff2e6;
  background-image: radial-gradient(#cbd6bf 1px, transparent 1px);
  background-size: 14px 14px;
  scrollbar-width: thin;
}
.fox-empty-program { display: grid; min-height: 155px; align-content: center; justify-items: center; gap: 14px; padding: 10px; color: #6c805f; text-align: center; }
.fox-empty-program > span { color: #8fa982; font-size: 35px; font-weight: 1000; }
.fox-empty-program p { max-width: 25ch; font-size: 12px; line-height: 1.45; }
.fox-command-list, .fox-repeat-body > ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fox-command {
  position: relative;
  min-width: 0;
  padding: 5px;
  border: 1px solid #a7c2ab;
  border-radius: 10px;
  background: #d5e9d3;
  box-shadow: 0 2px #a7c2ab;
  color: #244c35;
}
.fox-command-coral { border-color: #d6a28d; background: #f5c7af; box-shadow: 0 2px #d6a28d; color: #713d2c; }
.fox-command-gold { border-color: #cbbb79; background: #f3dfa5; box-shadow: 0 2px #cbbb79; color: #695028; }
.fox-command-blue { border-color: #96bdc9; background: #cee5ea; box-shadow: 0 2px #96bdc9; color: #2d5262; }
.fox-command-active { outline: 3px solid #ef9741; outline-offset: 2px; }
.fox-command-selected { border-color: #316b80; box-shadow: 0 0 0 2px #6d9ead; }
.fox-command-line { display: flex; min-width: 0; min-height: 44px; align-items: center; gap: 7px; }
.fox-command-symbol { flex: none; padding-inline: 3px; font-size: 24px; font-weight: 900; line-height: 1; }
.fox-command-line strong { flex: 1 1 auto; font-size: 13px; }
.fox-command-tools { display: flex; flex: none; align-items: center; gap: 1px; margin-left: auto; }
.fox-command-tools button { width: 44px; min-width: 44px; min-height: 44px; padding: 3px; border: 0; border-radius: 7px; background: #ffffff7a; color: inherit; font-size: 17px; font-weight: 900; line-height: 1; touch-action: manipulation; }
.fox-command-tools button:hover:not(:disabled) { background: #fffaf0; }
.fox-command-tools button:disabled { background: transparent; opacity: .3; }
.fox-repeat-label { display: inline-flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 3px; font-size: 13px; font-weight: 1000; }
.fox-repeat-label select { min-width: 66px; min-height: 44px; padding: 3px; border: 1px solid #83a5b3; border-radius: 7px; background: #f6fdfb; font-size: 12px; }
.fox-repeat-body { margin: 3px 2px 1px 13px; padding: 8px; border-left: 3px solid #8bb0bb; border-radius: 0 8px 8px 0; background: #e8f2ee; }
.fox-repeat-body .fox-command { margin-bottom: 1px; }
.fox-repeat-body .fox-command-line { flex-wrap: wrap; gap: 5px; }
.fox-repeat-body .fox-command-tools { margin-left: auto; }
.fox-loop-empty { padding: 9px 5px; color: #6c8588; font-size: 11px; font-weight: 850; text-align: center; }
.fox-loop-edit { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 5px; border: 1px dashed #9db8bf; border-radius: 7px; background: #f7fbf4; color: #325d68; font-size: 11px; font-weight: 950; }
.fox-loop-edit[aria-pressed="true"] { border-style: solid; background: #c8e0e6; }
.fox-insertion-note { margin: 10px 3px 0; color: #355e6a; font-size: 11px; line-height: 1.4; }
.fox-editor-actions { flex: none; display: grid; gap: 8px; }
.fox-run-actions, .fox-edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.fox-run-actions { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.fox-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border: 1px solid #c8d4bc; border-radius: 11px; background: #f1f5e8; color: #2f533e; font-size: 12px; font-weight: 950; line-height: 1.15; }
.fox-button > span { font-size: 18px; line-height: 1; }
.fox-button:hover:not(:disabled) { background: #e5eed7; }
.fox-button-primary { border-color: #26593d; background: #2c6445; box-shadow: 0 3px #17472f; color: #fffbdf; }
.fox-button-primary:hover:not(:disabled) { background: #23583a; }
.fox-button-primary:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.fox-edit-actions .fox-button { min-height: 44px; font-size: 11px; }
.fox-grid-wrap { display: grid; place-items: center; padding: 125px 12px 65px; background: #bce6df; }
.fox-grid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 2px; width: min(96%, 600px, calc(100dvh - 300px)); aspect-ratio: 1; }
.fox-grid-cell { display: grid; min-width: 0; place-items: center; aspect-ratio: 1; border: 1px solid #6e985e; border-radius: 4px; background: #9bc769; color: #244f37; font-size: clamp(10px, 1.5vw, 19px); line-height: 1; }
.fox-grid-cell.is-water { border-color: #83c5d1; background: #8acbd4; }
.fox-grid-cell.is-player { outline: 3px solid #fff1a5; outline-offset: -3px; background: #f3cb83; color: #734d28; }
.fox-grid-cell.is-finish { border-color: #ba8c9f; background: #e8b8ca; }
.fox-grid > [role="row"] { display: contents; }
.fox-levels .fox-level-cleared { border-color: #73a277; background: #ddf0ce; }
.fox-run-count small { display: block; margin-top: 3px; font-size: 11px; }

@media (max-width: 900px) and (orientation: portrait) {
  .fox-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 45dvh) minmax(0, 1fr); }
  .fox-editor { gap: 8px; padding: 12px 15px max(10px, env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid #c4d6bd; }
  .fox-editor-help { font-size: 11px; }
  .fox-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .fox-add { justify-content: center; gap: 5px; padding-inline: 5px; font-size: 11px; }
  .fox-editor-actions { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .fox-editor-actions > #fox-action-next { grid-column: 1 / -1; }
  .fox-program { flex-basis: 90px; }
  .fox-empty-program { min-height: 70px; gap: 4px; }
  .fox-empty-program > span { font-size: 24px; }
  .fox-mission { top: 10px; left: 11px; padding: 9px 11px; }
  .fox-mission h2 { font-size: 18px; }
  .fox-mission p { font-size: 11px; }
  .fox-run-count { top: 11px; right: 10px; padding: 6px; }
  .fox-status { bottom: 10px; padding: 7px 11px; font-size: 12px; }
  .fox-camera { bottom: 54px; right: 9px; }
  .fox-grid-wrap { padding: 102px 10px 50px; }
  .fox-grid { width: min(96%, calc(45dvh - 135px)); }
}
@media (max-width: 580px) and (orientation: portrait) {
  .fox-header { gap: 7px; padding: max(8px, env(safe-area-inset-top)) 9px 8px; }
  .fox-back { min-width: 44px; padding: 6px 7px; font-size: 11px; }
  .fox-title h1 { font-size: 25px; }
  .fox-title p { font-size: 10px; }
  .fox-view-control { gap: 0; }
  .fox-view-control label { display: none; }
  .fox-view-control select { max-width: 65px; font-size: 11px; }
  .fox-levels { justify-content: flex-start; padding-inline: 8px; }
  .fox-main { grid-template-rows: minmax(190px, 39dvh) minmax(0, 1fr); }
  .fox-editor { padding-inline: 9px; gap: 6px; }
  .fox-editor-heading h2 { font-size: 21px; }
  .fox-editor-heading > span { font-size: 10px; }
  .fox-editor-help { display: none; }
  .fox-palette { gap: 4px; }
  .fox-add { flex-direction: column; gap: 2px; min-height: 51px; font-size: 10px; }
  .fox-add > span { font-size: 21px; }
  .fox-editor-actions { grid-template-columns: 1fr; gap: 5px; }
  .fox-command-line { flex-wrap: wrap; }
  .fox-repeat-body { padding: 6px; margin-left: 8px; }
  .fox-grid { width: min(96%, calc(39dvh - 135px)); }
}
@media (max-height: 550px) and (orientation: landscape) {
  .fox-header { padding-top: 7px; padding-bottom: 7px; }
  .fox-title h1 { font-size: 25px; }
  .fox-title p { margin-top: 3px; font-size: 10px; }
  .fox-main { grid-template-columns: minmax(0, 1fr) minmax(290px, 40%); }
  .fox-editor { padding: 10px; gap: 6px; overflow-y: auto; }
  .fox-editor-heading h2 { font-size: 20px; }
  .fox-editor-help { display: none; }
  .fox-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .fox-add { min-height: 44px; justify-content: center; flex-direction: column; gap: 1px; padding: 4px 2px; font-size: 9px; }
  .fox-program { min-height: 55px; padding: 6px; }
  .fox-empty-program { min-height: 55px; gap: 2px; }
  .fox-empty-program > span { display: none; }
  .fox-editor-actions { grid-template-columns: 1fr 1fr; gap: 5px; }
  .fox-editor-actions > #fox-action-next { grid-column: 1 / -1; }
  .fox-button { min-height: 44px; padding-inline: 5px; font-size: 10px; }
  .fox-edit-actions { grid-template-columns: 1fr 1fr; gap: 3px; }
  .fox-mission { top: 10px; left: 10px; max-width: 240px; padding: 8px 10px; }
  .fox-mission h2 { font-size: 17px; }
  .fox-mission p { font-size: 10px; }
  .fox-status { bottom: 9px; font-size: 11px; padding: 6px 9px; }
  .fox-camera { bottom: 47px; right: 8px; }
  .fox-camera button { font-size: 20px; }
}

@media (max-height: 760px), (max-width: 580px) {
  .fox-editor { gap: 7px; padding: 12px; }
  .fox-editor-heading h2 { font-size: 21px; }
  .fox-trace { padding: 7px 9px; }
  .fox-trace-heading { font-size: 11px; }
  .fox-trace-result { font-size: 10px; }
  .fox-code-help, .fox-code-limit { display: none; }
  .fox-code-source { flex-basis: 160px; min-height: 160px; padding: 10px; }
  .fox-editor-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .fox-run-actions, .fox-edit-actions { display: contents; }
  .fox-editor-actions .fox-button { min-height: 44px; gap: 4px; padding: 6px 4px; font-size: 10px; }
  .fox-editor-actions > #fox-action-next { grid-column: 1 / -1; }
}
@media (max-height: 760px) and (min-width: 581px) {
  .fox-title h1 { font-size: 30px; }
  .fox-title p { margin-top: 3px; }
}
@media (max-width: 580px) and (orientation: portrait) {
  .fox-main { grid-template-rows: minmax(180px, 32dvh) minmax(0, 1fr); }
  .fox-grid { width: min(96%, calc(32dvh - 135px)); }
  .fox-editor { gap: 6px; padding: 9px; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .fox-editor { overflow-y: auto; overscroll-behavior: contain; }
  .fox-code-pane, .fox-editor [data-fox-block-pane] { flex: none; overflow: visible; }
  .fox-code-source { flex: none; height: 160px; }
  .fox-program { max-height: 240px; }
}

.tutor-page {
  --tutor-ink: #234e40;
  --tutor-muted: #62796a;
  --tutor-line: #dce4d5;
  --tutor-green: #2f6d51;
  --tutor-cream: #fffdf4;
  min-height: calc(100dvh - 140px);
  margin-inline: auto;
  color: var(--tutor-ink);
}
.tutor-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.tutor-page-header h1 { margin-top: 9px; color: var(--tutor-ink); font-size: clamp(34px, 4.6vw, 57px); font-weight: 1000; line-height: 1.07; letter-spacing: -.055em; }
.tutor-page-header > div > p:not(.tutor-kicker) { margin-top: 11px; color: var(--tutor-muted); font-size: 15px; line-height: 1.5; }
.tutor-back { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 4px 0; border: 0; background: transparent; color: #547361; font-size: 13px; font-weight: 950; text-align: left; }
.tutor-back:hover { color: #234e40; text-decoration: underline; }
.tutor-back > span { font-size: 20px; line-height: 1; }
.tutor-kicker { color: #5d8068; font-size: 11px; font-weight: 1000; letter-spacing: .055em; text-transform: uppercase; line-height: 1.5; }
.tutor-hub-layout, .tutor-lesson-layout { display: grid; grid-template-columns: minmax(245px, .72fr) minmax(0, 1.8fr); align-items: start; gap: clamp(22px, 3.6vw, 43px); }
.tutor-guide-card { position: sticky; top: 20px; overflow: hidden; border: 1px solid #d3dfcc; border-radius: 25px; background: linear-gradient(145deg, #f0f3dd, #e1eeda); }
.tutor-guide-copy { padding: 0 clamp(20px, 2.5vw, 29px) 30px; }
.tutor-guide-copy h2 { max-width: 13ch; margin-top: 7px; color: #2b5844; font-size: clamp(25px, 2.5vw, 35px); font-weight: 1000; letter-spacing: -.045em; line-height: 1.12; }
.tutor-guide-copy > .tutor-guide-description { margin-top: 12px; color: #637b61; font-size: 14px; line-height: 1.55; }
.tutor-portrait {
  --guide-skin: #dfa77d;
  --guide-light: #edbc91;
  --guide-hair: #5b3c2d;
  --guide-hair-dark: #422c24;
  --guide-shirt: #fbecd0;
  --guide-cardigan: #638771;
  position: relative;
  isolation: isolate;
  width: min(100%, 340px);
  height: clamp(245px, 27vw, 327px);
  margin-inline: auto;
  overflow: hidden;
}
.tutor-portrait-spelling { --guide-cardigan: #b37a6d; --guide-hair: #61493a; --guide-hair-dark: #48392f; }
.tutor-portrait-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.tutor-portrait-cartoon { object-fit: contain; object-position: center bottom; }
.tutor-next-practice { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 22px; margin: 0 0 16px; border: 1px solid #d6dfc9; border-radius: 20px; background: #edf2df; }
.tutor-next-practice p { margin: 5px 0 0; }
.tutor-next-practice .tutor-kicker { margin: 0 0 7px; }
.tutor-next-practice strong { color: #204f3c; font-size: 1.2rem; }
.tutor-next-practice .tutor-button { flex-shrink: 0; }
.tutor-attempt-note { display: block; margin-top: 10px; font-size: .88rem; font-weight: 700; color: #42634b; }
.tutor-history-note { margin: 14px 0 0; font-size: .85rem; color: #586b5a; }
.tutor-help { margin-top: 8px; }
.tutor-letter-link { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; padding: 20px; border: 1px solid #d7dcce; border-radius: 20px; background: #f3edfa; color: #254f3c; text-decoration: none; }
.tutor-letter-link > span:first-child { display: grid; place-items: center; flex: 0 0 54px; height: 54px; border-radius: 15px; background: #e3d8f1; font-size: 1.6rem; font-weight: 900; }
.tutor-letter-link strong { font-size: 1.15rem; }
.tutor-letter-link p { margin: 6px 0 0; }
.tutor-letter-link > span:last-child { margin-left: auto; }
.tutor-practice-summary { margin: 22px 0; padding: 24px; border: 1px solid #d7e1ca; border-radius: 20px; background: #f1f5e8; }
.tutor-practice-summary > strong { display: block; font-size: 2.4rem; color: #295d42; }
.tutor-practice-summary > p { margin: 6px 0 12px; }
.tutor-practice-summary > small { display: block; margin-top: 12px; }
.tutor-finish-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 600px) { .tutor-next-practice { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px; } }
.tutor-portrait-math { --guide-cardigan: #8293a7; --guide-hair: #69513a; --guide-hair-dark: #503a2c; }
.tutor-portrait-science { --guide-cardigan: #9a9f65; --guide-hair: #4c3930; --guide-hair-dark: #3b2b25; }
.tutor-portrait-arch { position: absolute; z-index: -2; inset: 14% 13% 2%; border: 1px solid #c9d9bd; border-radius: 48% 48% 18% 18%; background: linear-gradient(140deg, #d8e7c7, #bcd4b1); box-shadow: inset 0 2px #f7fceca3; }
.tutor-portrait-leaf { position: absolute; z-index: -1; width: 15%; height: 29%; bottom: 6%; border-radius: 90% 0 80% 0; background: #91b18c; transform: rotate(-22deg); }
.tutor-portrait-leaf-left { left: 5%; }
.tutor-portrait-leaf-right { right: 5%; bottom: 13%; transform: rotate(58deg) scale(.8); background: #a5bd91; }
.tutor-guide-hair { position: absolute; top: 14%; left: 28%; width: 44%; height: 58%; border-radius: 47% 48% 34% 33%; background: linear-gradient(110deg, var(--guide-hair), var(--guide-hair-dark)); box-shadow: inset 5px 1px #b58b6033, inset -8px -1px #30231d30; transform: rotate(-3deg); }
.tutor-guide-body { position: absolute; z-index: 3; top: 62%; left: 15%; width: 72%; height: 48%; overflow: hidden; border: 1px solid #3d67523d; border-radius: 44% 44% 12% 12%; background: linear-gradient(95deg, var(--guide-cardigan), var(--guide-cardigan) 25%, var(--guide-shirt) 25% 73%, var(--guide-cardigan) 73%); transform: rotate(-2deg); box-shadow: inset 4px 5px #ffffff19; }
.tutor-guide-body::before { position: absolute; inset: 0 auto 0 48%; width: 1px; background: #cfb69080; content: ''; }
.tutor-guide-body::after { position: absolute; top: 25%; left: 51%; width: 5px; height: 5px; border: 1px solid #af987f; border-radius: 50%; background: #d4bd99; box-shadow: 0 23px #cfb897, 0 46px #cfb897; content: ''; }
.tutor-guide-collar { position: absolute; top: 2%; left: 28%; width: 23%; height: 25%; border: 1px solid #ddcbaa; border-radius: 1px 1px 7px 1px; background: #fff5dc; transform: rotate(-24deg); }
.tutor-guide-collar-right { left: 49%; transform: rotate(24deg); border-radius: 1px 1px 1px 7px; }
.tutor-guide-neck { position: absolute; z-index: 2; top: 49%; left: 42%; width: 18%; height: 20%; border-radius: 0 0 40% 40%; background: linear-gradient(180deg, #bf835f 2%, var(--guide-skin) 38%); transform: rotate(-3deg); }
.tutor-guide-ear { position: absolute; z-index: 1; top: 35%; left: 31%; width: 7%; height: 14%; border: 1px solid #cc9069; border-radius: 50%; background: var(--guide-skin); transform: rotate(-4deg); }
.tutor-guide-ear-right { left: 65%; }
.tutor-guide-ear::after { position: absolute; bottom: 3%; left: 48%; width: 4px; height: 7px; border: 1px solid #b69559; border-radius: 50%; background: #f4df9f; content: ''; }
.tutor-guide-face { position: absolute; z-index: 2; top: 20%; left: 34%; width: 35%; height: 38%; overflow: hidden; border-radius: 39% 46% 46% 45%; background: radial-gradient(ellipse at 30% 24%, var(--guide-light), var(--guide-skin) 75%); box-shadow: inset -5px -1px #c58e6966; transform: rotate(-3deg); }
.tutor-guide-fringe { position: absolute; top: -9%; left: -13%; width: 104%; height: 33%; border-radius: 12% 1% 75% 5%; background: linear-gradient(125deg, var(--guide-hair), var(--guide-hair-dark)); transform: rotate(-15deg); }
.tutor-guide-brow { position: absolute; top: 36%; left: 18%; width: 22%; height: 6%; border-top: 3px solid #694836; border-radius: 60% 55% 0 0; transform: rotate(-4deg); }
.tutor-guide-brow-right { left: 58%; transform: rotate(5deg); }
.tutor-guide-eye { position: absolute; top: 45%; left: 24%; width: 7%; height: 8%; border-radius: 50%; background: #3c352e; box-shadow: 0 1px #f4cfac; }
.tutor-guide-eye-right { left: 66%; }
.tutor-guide-eye::after { position: absolute; top: 15%; left: 15%; width: 34%; height: 29%; border-radius: 50%; background: #f9e6d4; content: ''; }
.tutor-guide-nose { position: absolute; top: 45%; left: 46%; width: 11%; height: 24%; border-right: 1px solid #b67853; border-bottom: 2px solid #bd815b; border-radius: 0 0 60% 0; transform: rotate(5deg); }
.tutor-guide-cheek { position: absolute; top: 62%; left: 11%; width: 23%; height: 10%; border-radius: 50%; background: #cf876c44; }
.tutor-guide-cheek-right { left: 65%; }
.tutor-guide-smile { position: absolute; top: 73%; left: 35%; width: 33%; height: 10%; border-bottom: 3px solid #9f5f4e; border-radius: 0 0 50% 50%; transform: rotate(-3deg); }
.tutor-guide-hair-side { position: absolute; z-index: 4; top: 23%; left: 65%; width: 10%; height: 43%; border-radius: 30% 75% 45% 50%; background: linear-gradient(80deg, var(--guide-hair), var(--guide-hair-dark)); transform: rotate(-7deg); box-shadow: inset 2px 0 #9c765532; }
.tutor-guide-book { position: absolute; z-index: 4; right: 6%; bottom: -6%; width: 35%; height: 29%; border: 3px solid #eee5c8; border-radius: 7px 9px 0 0; background: #819d79; transform: rotate(18deg); box-shadow: 0 0 0 2px #627e60; }
.tutor-guide-book::before { position: absolute; top: 0; left: 12%; width: 2px; height: 100%; background: #607c5d; content: ''; }
.tutor-guide-book span { position: absolute; top: 22%; left: 30%; width: 50%; height: 19%; border-block: 2px solid #dde8cd; }
.tutor-library { display: grid; gap: 26px; min-width: 0; }
.tutor-subjects h2, .tutor-levels h2, .tutor-section-heading h2 { margin-bottom: 12px; color: #335c48; font-size: 19px; font-weight: 1000; letter-spacing: -.025em; }
.tutor-subject-buttons, .tutor-level-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tutor-subject-button { display: grid; justify-items: center; gap: 9px; min-width: 0; min-height: 107px; padding: 13px 5px 11px; border: 1px solid #d8e1d1; border-radius: 16px; background: #fffef9; color: #647661; font-size: 13px; font-weight: 950; }
.tutor-subject-button[aria-pressed="true"] { border-color: #79a184; background: #e8f1dd; box-shadow: inset 0 0 0 1px #79a184; color: #2c5d42; }
.tutor-subject-button:hover { border-color: #91ac87; background: #f0f5e7; }
.tutor-subject-mark { position: relative; display: grid; place-items: center; width: 45px; height: 40px; color: #718b61; font-size: 25px; font-family: Georgia, serif; font-weight: 900; line-height: 1; }
.tutor-subject-mark-book::before, .tutor-subject-mark-book::after { position: absolute; width: 20px; height: 29px; border: 2px solid #73976d; border-radius: 5px 2px 2px 4px; background: #cedebb; box-shadow: inset 3px 0 #eaf0d4; content: ''; }
.tutor-subject-mark-book::before { left: 3px; top: 6px; transform: skewY(9deg); }
.tutor-subject-mark-book::after { right: 3px; top: 6px; transform: skewY(-9deg); border-radius: 2px 5px 4px 2px; box-shadow: inset -3px 0 #eaf0d4; }
.tutor-subject-mark-letters { color: #9e7b73; }
.tutor-subject-mark-numbers { color: #7b88a1; font-family: Nunito, system-ui, sans-serif; font-size: 27px; letter-spacing: -.13em; }
.tutor-subject-mark-leaf::before, .tutor-subject-mark-leaf::after { position: absolute; top: 9px; width: 22px; height: 15px; border: 1px solid #799162; border-radius: 4px 17px 3px 16px; background: #a7bb80; transform: rotate(16deg); content: ''; }
.tutor-subject-mark-leaf::before { left: 2px; }
.tutor-subject-mark-leaf::after { right: 1px; top: 3px; transform: rotate(-26deg); border-radius: 16px 4px 17px 3px; }
.tutor-subject-mark-leaf > i { position: absolute; top: 15px; left: 22px; width: 2px; height: 22px; background: #73895e; transform: rotate(-5deg); }
.tutor-level-button { display: flex; min-width: 0; min-height: 77px; flex-direction: column; align-items: start; justify-content: center; gap: 5px; padding: 11px 12px; border: 1px solid #e0e3d4; border-radius: 13px; background: #fffef8; color: #65745c; text-align: left; }
.tutor-level-button strong { font-size: 12px; font-weight: 1000; line-height: 1.2; }
.tutor-level-button span { font-size: 10px; font-weight: 850; }
.tutor-level-button[aria-pressed="true"] { border-color: #8f9f6c; background: #edf0da; box-shadow: inset 0 0 0 1px #8f9f6c; color: #52633c; }
.tutor-level-button:hover { background: #f3f4e7; border-color: #aab68e; }
.tutor-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 15px; margin-bottom: 12px; }
.tutor-section-heading h2 { margin: 0; }
.tutor-section-heading > span { color: #829074; font-size: 11px; font-weight: 900; }
.tutor-lesson-cards { display: grid; gap: 11px; }
.tutor-lesson-card { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 18px; min-height: 136px; padding: 21px 23px; border: 1px solid #dae3d1; border-radius: 17px; background: #fffef8; box-shadow: 0 3px 0 #e7ebdf; color: #2e5742; text-align: left; }
.tutor-lesson-card:hover { border-color: #8cac86; background: #f8fbf0; }
.tutor-lesson-card-copy { display: grid; gap: 6px; min-width: 0; }
.tutor-lesson-skill { color: #77916d; font-size: 10px; font-weight: 1000; letter-spacing: .055em; text-transform: uppercase; }
.tutor-lesson-card strong { font-size: 22px; font-weight: 1000; letter-spacing: -.035em; line-height: 1.2; }
.tutor-lesson-intro { max-width: 49ch; color: #72816a; font-size: 12px; line-height: 1.5; }
.tutor-lesson-card-action { display: flex; flex: none; align-items: center; gap: 11px; color: #64805a; font-size: 11px; font-weight: 950; }
.tutor-card-arrow { display: grid; min-width: 37px; height: 37px; place-items: center; border-radius: 50%; background: #e7efda; color: #5d7b4b; font-size: 20px; }
.tutor-completed { display: grid; justify-items: center; gap: 4px; color: #5c815e; font-size: 10px; }
.tutor-completed > span { font-size: 18px; }
.tutor-no-lessons { padding: 20px; border: 1px solid #dce4d5; border-radius: 14px; background: #fffdf3; color: #687e68; font-size: 14px; line-height: 1.5; }
.tutor-voice-settings { position: relative; flex: 0 1 290px; min-width: 120px; padding-top: 9px; }
.tutor-voice-toggle { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; margin-left: auto; padding: 9px 15px; border: 1px solid #d5dfcc; border-radius: 12px; background: #fffef8; color: #5b765f; font-size: 12px; font-weight: 950; }
.tutor-voice-toggle > span:last-child { margin-left: 9px; }
.tutor-voice-toggle:hover { background: #eff5e7; }
.tutor-voice-icon { display: inline-flex; height: 19px; align-items: center; justify-content: center; gap: 3px; color: #6e8c66; }
.tutor-voice-icon > i { width: 3px; height: 10px; border-radius: 2px; background: currentColor; }
.tutor-voice-icon > i:nth-child(2) { height: 18px; }
.tutor-voice-icon > i:nth-child(3) { height: 13px; }
.tutor-voice-panel { position: absolute; z-index: 40; right: 0; top: 100%; width: min(300px, calc(100vw - 44px)); max-height: min(72vh, 500px); overflow: auto; display: grid; gap: 8px; margin-top: 9px; padding: 15px; border: 1px solid #dce4d1; border-radius: 15px; background: #fffef8; box-shadow: 0 4px 15px #354f3420; }
.tutor-voice-panel label { color: #526c56; font-size: 12px; font-weight: 950; }
.tutor-voice-panel select { width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid #cbd8be; border-radius: 9px; background: #f5f8ee; color: #365e43; font-size: 12px; }
.tutor-voice-label { overflow-wrap: anywhere; color: #7a8870; font-size: 10px; line-height: 1.5; }
.tutor-voice-intro { margin: 0 0 6px; color: #647b65; font-size: 12px; line-height: 1.5; }
.tutor-voice-actions { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
.tutor-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 11px 17px; border: 1px solid #c9d8c2; border-radius: 12px; background: #f5f8eb; color: #46684a; font-size: 13px; font-weight: 950; line-height: 1.2; }
.tutor-button:hover:not(:disabled) { border-color: #89a680; background: #eaf2df; }
.tutor-button-small { min-height: 44px; padding: 7px 10px; font-size: 11px; }
.tutor-button-primary { border-color: #2e684e; background: #337655; box-shadow: 0 3px 0 #235239; color: #fffef0; }
.tutor-button-primary:hover:not(:disabled) { border-color: #275a41; background: #2c684a; }
.tutor-button-primary > span { font-size: 19px; }
.tutor-button-primary:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.tutor-button:disabled { opacity: .45; cursor: default; }
.tutor-message { min-height: 24px; margin: 18px 2px 0; color: #5b775d; font-size: 12px; line-height: 1.5; }
.tutor-lesson .tutor-page-header h1 { max-width: 22ch; margin-top: 8px; font-size: clamp(30px, 3.8vw, 44px); }
.tutor-lesson .tutor-page-header .tutor-kicker { margin-top: 10px; }
.tutor-activity { display: flex; min-height: 525px; flex-direction: column; padding: clamp(22px, 3.3vw, 39px); border: 1px solid #dce4d1; border-radius: 24px; background: #fffef9; box-shadow: 0 5px 0 #e8ecdf; }
.tutor-activity-progress { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 25px; color: #7a8d71; font-size: 11px; font-weight: 900; }
.tutor-activity-progress > span { flex: none; }
.tutor-activity-progress progress { display: block; width: min(58%, 290px); height: 7px; overflow: hidden; border: 0; border-radius: 10px; accent-color: #8aaa74; background: #eaf0e0; }
.tutor-activity-progress progress::-webkit-progress-bar { border-radius: 10px; background: #eaf0e0; }
.tutor-activity-progress progress::-webkit-progress-value { border-radius: 10px; background: #8aaa74; }
.tutor-teaching, .tutor-question { flex: 1; }
.tutor-teaching { padding-top: 20px; }
.tutor-teaching h2, .tutor-question h2 { max-width: 23ch; margin-top: 13px; color: #2e5842; font-size: clamp(27px, 3.8vw, 43px); font-weight: 1000; letter-spacing: -.04em; line-height: 1.2; }
.tutor-teaching-text { max-width: 35ch; margin-top: 25px; color: #617859; font-size: clamp(19px, 2.3vw, 26px); font-weight: 800; line-height: 1.65; white-space: pre-line; }
.tutor-question h2 { margin-top: 5px; }
.tutor-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.tutor-answer { display: flex; min-height: 84px; align-items: center; justify-content: center; gap: 10px; padding: 15px 13px; border: 2px solid #dce4d0; border-radius: 17px; background: #f4f7e9; color: #3c6347; font-size: clamp(20px, 2.6vw, 30px); font-weight: 950; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.tutor-answer:hover:not(:disabled) { border-color: #9fba8a; background: #ecf2de; }
.tutor-answer-selected { border-color: #709d74; background: #e1efdc; }
.tutor-answer-correct { border-color: #6a996b; background: #deecd6; color: #315b39; }
.tutor-answer-wrong { border-color: #c1a78c; background: #f0e7d7; color: #7a664f; }
.tutor-feedback { margin-top: 24px; padding: 16px 18px; border: 1px solid #e3d7be; border-radius: 14px; background: #f7f0df; color: #796b50; line-height: 1.5; }
.tutor-feedback-correct { border-color: #cadfbc; background: #edf5e4; color: #52764d; }
.tutor-feedback strong { display: block; margin-bottom: 4px; font-size: 17px; font-weight: 1000; }
.tutor-feedback p { margin-top: 5px; font-size: 14px; }
.tutor-activity-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid #e9ecdf; }
.tutor-playback-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; min-width: 0; }
.tutor-rate-control { display: grid; gap: 5px; min-width: 125px; max-width: 100%; color: #58725b; font-size: 11px; font-weight: 900; }
.tutor-rate-control select { width: 100%; min-width: 0; min-height: 48px; padding: 9px 28px 9px 12px; border: 1px solid #cbd9bf; border-radius: 12px; background: #fffef6; color: #365d43; font-size: 12px; font-weight: 850; }
.tutor-guide-copy .tutor-rate-control { width: 100%; min-width: 0; max-width: 220px; margin-top: 19px; }
.tutor-activity-actions > [data-tutor-next] { margin-left: auto; }
.tutor-playback-controls .tutor-button { min-height: 48px; }
.tutor-button-stop > span { color: #7c8f74; font-size: 11px; }
.tutor-recording-status { margin: 11px 0 0; color: #62796a; font-size: 12px; line-height: 1.5; }
.tutor-finished { display: grid; flex: 1; align-content: center; justify-items: center; gap: 19px; padding: 25px 0; text-align: center; }
.tutor-finished-mark { display: grid; width: 69px; height: 69px; place-items: center; border: 1px solid #c6dcad; border-radius: 50%; background: #e8f1d6; color: #698d54; font-size: 33px; font-weight: 950; }
.tutor-finished h2 { color: #305a40; font-size: clamp(29px, 4vw, 39px); font-weight: 1000; letter-spacing: -.04em; line-height: 1.1; }
.tutor-finished > p { max-width: 33ch; color: #74846a; font-size: 16px; line-height: 1.6; }

@media (max-width: 950px) {
  .tutor-playback-controls { flex-basis: 100%; }
  .tutor-hub-layout, .tutor-lesson-layout { grid-template-columns: minmax(205px, .75fr) minmax(0, 1.65fr); gap: 21px; }
  .tutor-level-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tutor-level-button { min-height: 65px; }
  .tutor-subject-button { min-height: 94px; font-size: 11px; }
  .tutor-lesson-card { align-items: flex-start; flex-direction: column; gap: 13px; padding: 19px; }
  .tutor-lesson-card-action { width: 100%; justify-content: space-between; }
  .tutor-completed { display: flex; align-items: center; }
  .tutor-voice-settings { flex-basis: 235px; }
  .tutor-guide-copy { padding-inline: 20px; }
  .tutor-guide-copy h2 { font-size: 28px; }
  .tutor-guide-copy > .tutor-guide-description { font-size: 12px; }
  .tutor-activity { min-height: 510px; padding: 25px; }
  .tutor-activity-actions { gap: 9px; }
  .tutor-button { padding-inline: 13px; font-size: 12px; }
  .tutor-answer { min-height: 78px; font-size: 23px; }
}
@media (max-width: 700px) {
  .tutor-page-header { gap: 12px; margin-bottom: 20px; }
  .tutor-page-header h1 { font-size: 40px; }
  .tutor-page-header > div > p:not(.tutor-kicker) { max-width: 24ch; font-size: 13px; }
  .tutor-hub-layout, .tutor-lesson-layout { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .tutor-guide-card { position: static; display: grid; grid-template-columns: 145px minmax(0, 1fr); align-items: center; min-height: 157px; border-radius: 20px; }
  .tutor-portrait { width: 153px; height: 173px; align-self: end; margin-bottom: -4px; margin-left: -3px; }
  .tutor-guide-copy { padding: 17px 20px 17px 3px; }
  .tutor-guide-copy h2 { max-width: 22ch; margin-top: 5px; font-size: 25px; }
  .tutor-guide-copy > .tutor-guide-description { max-width: 33ch; margin-top: 8px; font-size: 12px; }
  .tutor-guide-copy .tutor-kicker { font-size: 9px; }
  .tutor-library { gap: 24px; }
  .tutor-subject-button { min-height: 92px; font-size: 12px; }
  .tutor-subject-buttons { gap: 6px; }
  .tutor-level-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tutor-level-button { min-height: 74px; padding: 10px; }
  .tutor-level-button strong { font-size: 11px; }
  .tutor-level-button span { font-size: 9px; }
  .tutor-lesson-card { flex-direction: row; align-items: center; }
  .tutor-lesson-card strong { font-size: 22px; }
  .tutor-lesson-card-action { width: auto; flex-direction: column; justify-content: center; gap: 6px; font-size: 10px; }
  .tutor-completed { display: grid; }
  .tutor-voice-settings { flex: 0 1 190px; min-width: 105px; }
  .tutor-voice-toggle { padding-inline: 11px; }
  .tutor-voice-toggle > span:last-child { margin-left: 1px; }
  .tutor-voice-panel { padding: 12px; }
  .tutor-voice-actions { grid-template-columns: 1fr; }
  .tutor-lesson .tutor-page-header h1 { font-size: 34px; }
  .tutor-lesson .tutor-page-header .tutor-kicker { font-size: 10px; }
  .tutor-guide-card-lesson { grid-template-columns: 120px minmax(0, 1fr); min-height: 130px; }
  .tutor-guide-card-lesson .tutor-portrait { width: 127px; height: 144px; }
  .tutor-guide-card-lesson .tutor-guide-copy h2 { font-size: 22px; }
  .tutor-guide-card-lesson .tutor-guide-copy > .tutor-guide-description { font-size: 11px; }
  .tutor-activity { min-height: 470px; padding: 26px; border-radius: 21px; }
  .tutor-teaching { padding-top: 10px; }
  .tutor-teaching h2, .tutor-question h2 { max-width: 28ch; font-size: 31px; }
  .tutor-teaching-text { margin-top: 20px; font-size: 21px; }
}
@media (max-width: 440px) {
  .tutor-playback-controls { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tutor-playback-controls .tutor-rate-control { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
  .tutor-rate-control select, .tutor-playback-controls .tutor-button { min-height: 46px; }
  .tutor-activity-actions > [data-tutor-next] { width: 100%; margin-left: 0; }
  .tutor-guide-copy .tutor-rate-control { gap: 4px; margin-top: 12px; font-size: 10px; }
  .tutor-guide-copy .tutor-rate-control select { min-height: 44px; padding-left: 9px; font-size: 11px; }
  .tutor-page-header h1 { font-size: 32px; }
  .tutor-page-header > div > p:not(.tutor-kicker) { font-size: 12px; }
  .tutor-page-header .tutor-back { font-size: 11px; }
  .tutor-voice-settings { flex-basis: 112px; }
  .tutor-voice-toggle { gap: 5px; font-size: 11px; }
  .tutor-voice-panel { width: min(300px, calc(100vw - 44px)); }
  .tutor-guide-card { grid-template-columns: 122px minmax(0, 1fr); min-height: 145px; }
  .tutor-portrait { width: 136px; height: 155px; margin-left: -8px; }
  .tutor-guide-copy { padding-right: 13px; }
  .tutor-guide-copy h2 { font-size: 23px; }
  .tutor-guide-copy > .tutor-guide-description { font-size: 11px; line-height: 1.5; }
  .tutor-level-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tutor-level-button { min-height: 64px; padding-inline: 13px; }
  .tutor-level-button strong { font-size: 12px; }
  .tutor-level-button span { font-size: 10px; }
  .tutor-subject-button { min-height: 83px; padding-top: 9px; gap: 5px; font-size: 10px; }
  .tutor-subject-mark { width: 40px; transform: scale(.9); }
  .tutor-lesson-card { min-height: 139px; padding: 17px; gap: 10px; }
  .tutor-lesson-card strong { font-size: 20px; }
  .tutor-lesson-intro { font-size: 11px; }
  .tutor-card-arrow { min-width: 32px; height: 32px; font-size: 18px; }
  .tutor-lesson .tutor-page-header h1 { font-size: 29px; }
  .tutor-lesson .tutor-page-header .tutor-kicker { max-width: 22ch; }
  .tutor-guide-card-lesson { grid-template-columns: 107px minmax(0, 1fr); min-height: 123px; }
  .tutor-guide-card-lesson .tutor-portrait { width: 118px; height: 137px; }
  .tutor-guide-card-lesson .tutor-guide-copy h2 { font-size: 20px; }
  .tutor-guide-card-lesson .tutor-guide-copy { padding-block: 12px; }
  .tutor-guide-card-lesson .tutor-guide-copy > .tutor-guide-description { display: none; }
  .tutor-activity { min-height: 450px; padding: 22px 19px; }
  .tutor-teaching h2, .tutor-question h2 { font-size: 28px; }
  .tutor-teaching-text { font-size: 20px; line-height: 1.65; }
  .tutor-answers { gap: 9px; margin-top: 23px; }
  .tutor-answer { min-height: 76px; padding: 12px 8px; border-radius: 14px; font-size: 21px; }
  .tutor-activity-actions { gap: 8px; margin-top: 24px; padding-top: 18px; }
  .tutor-button { min-height: 46px; gap: 6px; padding-inline: 11px; font-size: 11px; }
  .tutor-voice-panel .tutor-button { min-height: 44px; }
}

.tutor-phonemes { margin-top: 26px; padding: 17px 18px; background: #eef6ec; border: 1px solid #d6e4d1; border-radius: 15px; }
.tutor-phonemes > p { margin: 0 0 11px; color: #355748; font-size: 12px; font-weight: 800; }
.tutor-phonemes > div { display: flex; flex-wrap: wrap; gap: 10px; }
.tutor-phoneme-button { min-height: 48px; background: #fffef7; border-color: #b9d1b5; }
.tutor-phoneme-button strong { color: #275b43; font-size: 19px; font-weight: 800; }
.tutor-phonemes > small { display: block; margin-top: 10px; color: #5b6f5e; font-size: 11px; line-height: 1.5; }
.tutor-audio-credits { width: fit-content; padding-block: 8px; color: #476451; font-size: 11px; text-underline-offset: 3px; }
@media (max-width: 440px) {
  .tutor-phonemes { padding: 15px 13px; margin-top: 21px; }
  .tutor-phoneme-button { min-height: 48px; font-size: 12px; }
}

/* Island Kart keeps the circuit behind the driving controls. */
.kart-shell { position: fixed; inset: 0; z-index: 120; width: 100%; height: 100dvh; overflow: hidden; color: #204a40; background: #bfeefa; font-family: inherit; isolation: isolate; touch-action: none; }
.kart-shell *, .kart-shell *::before, .kart-shell *::after { box-sizing: border-box; }
.kart-shell button, .kart-shell input, .kart-shell a { -webkit-tap-highlight-color: transparent; }
.kart-shell button { cursor: pointer; font: inherit; }
.kart-shell button:focus-visible, .kart-shell a:focus-visible { outline: 3px solid #f2b547; outline-offset: 4px; }
.kart-shell button:disabled { opacity: .48; cursor: default; }
.kart-canvas { position: absolute; inset: 0; overflow: hidden; }
.kart-canvas > canvas { display: block; width: 100%; height: 100%; }
.kart-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #1b493d0d, transparent 28%, transparent 77%, #174e3026); }
.kart-header { position: absolute; z-index: 4; inset: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) auto max(24px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 20px; pointer-events: none; }
.kart-brand { display: flex; align-items: center; gap: 10px; filter: drop-shadow(0 2px 0 #ffffff7d); }
.kart-brand strong { font-size: 23px; font-weight: 950; letter-spacing: -.8px; line-height: 1.1; }
.kart-brand-mark { position: relative; display: block; width: 34px; height: 34px; transform: rotate(-12deg); }
.kart-brand-mark::before { content: ''; position: absolute; inset: 6px 0 5px; border-radius: 6px; background: #244f43; box-shadow: 0 2px 0 #fff7d47d; }
.kart-brand-mark i { position: absolute; z-index: 1; width: 8px; height: 8px; background: #fff8df; }
.kart-brand-mark i:first-child { left: 7px; top: 8px; box-shadow: 9px 9px 0 #fff8df; }
.kart-brand-mark i:last-child { left: 16px; top: 8px; background: #f7b766; box-shadow: -9px 9px 0 #f7b766; }
.kart-navigation { display: flex; gap: 9px; pointer-events: auto; }
.kart-top-button { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 44px; gap: 9px; padding: 10px 17px; border: 1px solid #ffffffc7; border-radius: 15px; background: #fffbeeeb; color: #264d40; box-shadow: 0 3px 0 #254f4026, 0 7px 18px #245c3614; text-decoration: none; font-size: 12px; font-weight: 900; backdrop-filter: blur(10px); }
.kart-top-button > span:first-child { font-size: 19px; line-height: 1; }
.kart-exit { min-width: 44px; }
.kart-exit > span:first-child { font-size: 24px; font-weight: 600; }
.kart-hud { position: absolute; z-index: 3; left: 50%; top: max(20px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 0; padding: 10px 6px; border: 1px solid #ffffffbd; border-radius: 19px; background: #fffbeaeb; box-shadow: 0 3px 0 #3760521a, 0 8px 22px #37605214; transform: translateX(-50%); backdrop-filter: blur(10px); }
.kart-hud > div { min-width: 78px; padding-inline: 18px; text-align: center; }
.kart-hud > div + div { border-left: 1px solid #d9dfca; }
.kart-hud > div > span { display: block; color: #69806c; font-size: 8px; font-weight: 900; line-height: 1.3; text-transform: uppercase; letter-spacing: 1.3px; }
.kart-hud strong { display: block; margin-top: 1px; color: #214e40; font-size: 24px; line-height: 1.15; font-weight: 950; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kart-hud strong small { color: #7b8e76; font-size: 12px; font-weight: 800; }
.kart-hud .kart-hud-time { min-width: 119px; }
.kart-hud-time strong { padding-top: 4px; font-size: 18px; }
.kart-overlay { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding: 94px max(28px, env(safe-area-inset-right)) 22px max(28px, env(safe-area-inset-left)); pointer-events: none; }
.kart-picker { width: 346px; max-height: calc(100dvh - 112px); overflow: auto; padding: 22px; border: 1px solid #fffffff2; border-radius: 26px; background: #fffbedf5; box-shadow: 0 8px 0 #38644c14, 0 20px 60px #204b3b26; pointer-events: auto; touch-action: pan-y; scrollbar-width: thin; }
.kart-eyebrow { margin: 0; color: #6c856b; font-size: 9px; font-weight: 900; line-height: 1.5; letter-spacing: 1.35px; text-transform: uppercase; }
.kart-track-list { display: grid; gap: 9px; margin-top: 19px; }
.kart-track-card { position: relative; display: flex; align-items: center; min-height: 91px; gap: 9px; padding: 10px 11px 10px 7px; border: 2px solid #e2e5d5; border-radius: 17px; background: #fffef5; color: #355b49; text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.kart-track-card:hover { background: #f4f7e7; transform: translateY(-1px); }
.kart-track-card[aria-pressed='true'] { border-color: #54876c; background: #eef4df; box-shadow: 0 3px 0 #4e7b5717; }
.kart-track-art { display: flex; align-items: center; flex: 0 0 83px; align-self: stretch; border-radius: 11px; background: #dcefe6; }
.kart-track-bay .kart-track-art { background: #d6eeec; }
.kart-track-forest .kart-track-art { background: #dcebcf; }
.kart-track-village .kart-track-art { background: #ece1e4; }
.kart-track-map { display: block; width: 100%; height: auto; overflow: visible; }
.kart-track-copy { display: grid; flex: 1; min-width: 0; gap: 3px; padding-right: 8px; }
.kart-track-theme { color: #7f9473; font-size: 7px; font-weight: 900; letter-spacing: 1.35px; text-transform: uppercase; }
.kart-track-copy > strong { font-size: 13px; font-weight: 950; letter-spacing: -.2px; line-height: 1.15; }
.kart-track-description { max-width: 25ch; color: #819077; font-size: 8px; line-height: 1.45; }
.kart-track-record { margin-top: 2px; color: #69805e; font-size: 8px; font-weight: 800; }
.kart-track-selected { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #4e8063; color: #fff9e8; font-size: 10px; font-weight: 950; opacity: 0; }
.kart-track-card[aria-pressed='true'] .kart-track-selected { opacity: 1; }
.kart-picker-bottom { display: grid; gap: 14px; margin-top: 15px; }
.kart-auto { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 12px; padding: 3px 1px; cursor: pointer; }
.kart-auto input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.kart-auto > span:first-of-type { display: grid; gap: 3px; }
.kart-auto strong { font-size: 11px; font-weight: 900; }
.kart-auto small { color: #7b8b72; font-size: 9px; line-height: 1.35; }
.kart-auto-switch { position: relative; flex: 0 0 39px; height: 23px; border: 1px solid #c5ceba; border-radius: 30px; background: #dce0ce; transition: background .15s; }
.kart-auto-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fffced; box-shadow: 0 2px 2px #36574026; transition: transform .15s; }
.kart-auto input:checked ~ .kart-auto-switch { border-color: #568666; background: #689572; }
.kart-auto input:checked ~ .kart-auto-switch::after { transform: translateX(16px); }
.kart-auto input:focus-visible ~ .kart-auto-switch { outline: 3px solid #e8b246; outline-offset: 4px; }
.kart-button { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 13px 20px; border: 1px solid #d2ddc7; border-radius: 15px; background: #f2f5e5; color: #355e47; font-size: 12px; font-weight: 900; text-decoration: none; box-shadow: 0 3px 0 #69835a1f; }
.kart-button-primary { border-color: #e1a34e; background: #f8bf6b; color: #654828; box-shadow: 0 4px 0 #bb803c; }
.kart-button-primary:hover { background: #ffcc81; }
.kart-start { min-height: 52px; font-size: 15px; }
.kart-button-quiet { border-color: transparent; background: transparent; box-shadow: none; color: #75886c; font-size: 11px; }
.kart-controls { position: absolute; z-index: 4; bottom: max(25px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
.kart-steering { left: max(25px, env(safe-area-inset-left)); }
.kart-pedals { right: max(25px, env(safe-area-inset-right)); }
.kart-touch { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 73px; height: 73px; gap: 1px; border: 1px solid #fff9e0e0; border-radius: 22px; background: #fffbeaeb; color: #2b5b46; box-shadow: 0 5px 0 #2b584b42, 0 7px 25px #1f584426; backdrop-filter: blur(8px); touch-action: none; -webkit-touch-callout: none; }
.kart-touch:active, .kart-touch.kart-control-active, .kart-touch[aria-pressed='true'] { transform: translateY(4px); box-shadow: 0 1px 0 #2b584b42; background: #e5f0d6; }
.kart-touch > span { font-size: 36px; line-height: 1; font-weight: 600; }
.kart-touch small { font-size: 9px; font-weight: 950; letter-spacing: .3px; }
.kart-touch-brake { background: #ffe2c5eb; color: #96603d; }
.kart-touch-drift { width: 81px; height: 81px; border-color: #ffe7a8; background: #f7ca7deb; color: #7a572e; }
.kart-touch-drift > span { font-size: 44px; line-height: .75; }
.kart-touch-go { background: #d7ecc3eb; }
.kart-touch .kart-brake-symbol { display: flex; align-items: center; gap: 4px; height: 30px; transform: rotate(-14deg); }
.kart-brake-symbol i { width: 3px; height: 19px; border-radius: 3px; background: currentColor; }
.kart-speed { position: absolute; z-index: 3; bottom: max(30px, env(safe-area-inset-bottom)); left: 50%; display: flex; align-items: baseline; gap: 5px; color: #fffbe9; transform: translateX(-50%); text-shadow: 0 2px 1px #31523e4d; }
.kart-speed > strong { font-size: 34px; font-weight: 950; line-height: 1; font-variant-numeric: tabular-nums; }
.kart-speed > span { font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.kart-keyboard-hint { position: absolute; z-index: 3; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: 42%; margin: 0; color: #fffbe4d9; transform: translateX(-50%); text-align: center; font-size: 8px; font-weight: 700; text-shadow: 0 1px 2px #2249327d; }
.kart-keyboard-hint > span { margin-left: 12px; }
.kart-countdown { position: absolute; z-index: 6; top: 44%; left: 50%; color: #fff8d8; font-size: clamp(90px, 14vw, 168px); font-weight: 950; line-height: 1; letter-spacing: -6px; transform: translate(-50%, -50%) rotate(-6deg); text-shadow: 0 6px 0 #315e47, 0 13px 0 #315e4733, 0 20px 36px #164d4d26; pointer-events: none; }
.kart-message { position: absolute; z-index: 6; bottom: max(128px, calc(env(safe-area-inset-bottom) + 112px)); left: 50%; max-width: min(460px, 72vw); margin: 0; padding: 9px 16px; border: 1px solid #fff9df9e; border-radius: 30px; background: #fff9eae8; color: #4f6b4d; box-shadow: 0 3px 10px #234b3924; transform: translateX(-50%); text-align: center; font-size: 10px; line-height: 1.5; font-weight: 800; pointer-events: none; }
.kart-message:empty { display: none; }
.kart-shell:has(.kart-overlay > section) .kart-controls { visibility: hidden; }
.kart-shell:has(.kart-picker) .kart-hud, .kart-shell:has(.kart-picker) .kart-speed, .kart-shell:has(.kart-picker) .kart-keyboard-hint { visibility: hidden; }
.kart-overlay:has(.kart-pause) { justify-content: center; padding: 85px 20px 25px; background: #173e3629; backdrop-filter: blur(4px); }
.kart-pause { width: min(355px, 100%); max-height: calc(100dvh - 112px); overflow: auto; padding: 28px; border: 1px solid #fffdf0; border-radius: 27px; background: #fffdf2; color: #254f40; box-shadow: 0 9px 0 #315b4624, 0 20px 70px #254e3e33; text-align: center; pointer-events: auto; touch-action: pan-y; }
.kart-pause h2 { margin: 9px 0 11px; color: #284f40; font-size: 29px; font-weight: 950; line-height: 1.05; letter-spacing: -.9px; }
.kart-pause .kart-auto { margin: 13px 0 19px; text-align: left; }
.kart-pause-actions { display: grid; gap: 11px; }
.kart-result-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 23px; padding: 17px 9px; border: 1px solid #e1e6ca; border-radius: 17px; background: #f1f5df; }
.kart-result-stats > div + div { border-left: 1px solid #d9e0c5; }
.kart-result-stats > div > span { display: block; margin-bottom: 4px; color: #81906f; font-size: 8px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.kart-result-stats > div > strong { color: #3c664c; font-size: 26px; font-weight: 950; letter-spacing: -.6px; }
.kart-result-stats strong > small { color: #879779; font-size: 12px; }
.kart-result-stats > p { grid-column: 1 / -1; display: flex; justify-content: center; gap: 7px; margin: 13px 0 0; padding-top: 13px; border-top: 1px solid #dce4ca; color: #849271; font-size: 9px; }
.kart-result-stats > p > strong { color: #4e7150; font-weight: 900; }
@media (max-width: 900px) {
  .kart-header { inset-inline: 18px; }
  .kart-brand strong { font-size: 20px; }
  .kart-brand-mark { width: 31px; transform: scale(.9) rotate(-12deg); }
  .kart-top-button { min-width: 66px; padding-inline: 12px; }
  .kart-exit { min-width: 44px; padding-inline: 12px; }
  .kart-exit > span:last-child { display: none; }
  .kart-hud { top: max(19px, env(safe-area-inset-top)); padding: 8px 3px; }
  .kart-hud > div { min-width: 60px; padding-inline: 12px; }
  .kart-hud .kart-hud-time { min-width: 100px; }
  .kart-hud strong { font-size: 21px; }
  .kart-hud-time strong { font-size: 16px; }
  .kart-overlay { padding-inline: 20px; }
  .kart-picker { width: 320px; padding: 20px; }
  .kart-track-art { flex-basis: 74px; }
  .kart-touch { width: 65px; height: 65px; border-radius: 20px; }
  .kart-touch-drift { width: 73px; height: 73px; }
}
@media (max-height: 660px) and (min-width: 700px) {
  .kart-header { top: max(13px, env(safe-area-inset-top)); }
  .kart-hud { top: max(13px, env(safe-area-inset-top)); }
  .kart-overlay { align-items: flex-end; padding: 76px 24px 22px; }
  .kart-picker { width: min(100%, 1050px); max-height: calc(100dvh - 98px); padding: 18px 20px; }
  .kart-track-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
  .kart-track-card { min-height: 89px; padding-left: 6px; }
  .kart-track-art { flex-basis: 70px; }
  .kart-track-copy > strong { font-size: 12px; }
  .kart-track-description { font-size: 7px; }
  .kart-picker-bottom { grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-top: 13px; }
  .kart-picker-bottom .kart-auto { max-width: 330px; }
  .kart-start { min-height: 46px; justify-self: end; width: min(100%, 280px); }
  .kart-pause { padding: 21px; }
  .kart-pause h2 { font-size: 25px; }
  .kart-result-stats { padding-block: 11px; margin-bottom: 16px; }
  .kart-pause-actions { gap: 8px; }
  .kart-pause .kart-button { min-height: 44px; padding-block: 10px; }
  .kart-controls { bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (max-width: 699px) {
  .kart-header { inset: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) auto max(15px, env(safe-area-inset-left)); gap: 8px; }
  .kart-brand { gap: 5px; }
  .kart-brand strong { font-size: 18px; letter-spacing: -.6px; }
  .kart-brand-mark { width: 29px; margin-left: -2px; transform: scale(.8) rotate(-12deg); }
  .kart-navigation { gap: 6px; }
  .kart-top-button { min-height: 44px; min-width: 58px; gap: 5px; padding: 9px 11px; border-radius: 14px; font-size: 10px; }
  .kart-exit { min-width: 44px; }
  .kart-hud { top: max(73px, calc(env(safe-area-inset-top) + 59px)); border-radius: 16px; padding-block: 7px; }
  .kart-hud > div { min-width: 70px; padding-inline: 16px; }
  .kart-hud .kart-hud-time { min-width: 108px; }
  .kart-hud > div > span { font-size: 7px; }
  .kart-hud strong { font-size: 22px; }
  .kart-hud-time strong { font-size: 16px; }
  .kart-overlay { align-items: flex-end; justify-content: center; padding: 82px max(15px, env(safe-area-inset-right)) max(19px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)); }
  .kart-picker { width: 100%; max-width: 460px; max-height: calc(100dvh - 105px); padding: 19px 17px 18px; border-radius: 24px; }
  .kart-track-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 16px; }
  .kart-track-card { flex-direction: column; align-items: stretch; gap: 8px; min-height: 149px; padding: 7px 7px 10px; border-radius: 14px; }
  .kart-track-art { flex-basis: auto; min-height: 56px; border-radius: 8px; }
  .kart-track-map { height: 56px; }
  .kart-track-copy { gap: 5px; padding: 0 2px; }
  .kart-track-copy > strong { min-height: 26px; font-size: 11px; line-height: 1.15; letter-spacing: -.25px; }
  .kart-track-theme { font-size: 6px; letter-spacing: .9px; }
  .kart-track-description { display: none; }
  .kart-track-record { font-size: 7px; line-height: 1.3; }
  .kart-track-selected { top: 9px; right: 8px; width: 14px; height: 14px; font-size: 9px; }
  .kart-picker-bottom { grid-template-columns: 1.05fr 1fr; gap: 13px; margin-top: 17px; }
  .kart-auto { gap: 8px; }
  .kart-auto strong { font-size: 9px; }
  .kart-auto small { max-width: 14ch; font-size: 8px; }
  .kart-auto-switch { flex-basis: 33px; height: 21px; }
  .kart-auto-switch::after { width: 13px; height: 13px; }
  .kart-auto input:checked ~ .kart-auto-switch::after { transform: translateX(12px); }
  .kart-start { min-height: 48px; gap: 8px; padding-inline: 10px; border-radius: 14px; font-size: 12px; }
  .kart-steering { left: max(15px, env(safe-area-inset-left)); gap: 8px; }
  .kart-pedals { right: max(15px, env(safe-area-inset-right)); gap: 8px; }
  .kart-controls { bottom: max(25px, env(safe-area-inset-bottom)); }
  .kart-touch { width: 58px; height: 62px; border-radius: 18px; }
  .kart-touch > span { font-size: 30px; }
  .kart-touch small { font-size: 8px; }
  .kart-touch-drift { width: 63px; height: 70px; }
  .kart-touch-drift > span { font-size: 37px; }
  .kart-touch-go { width: 48px; }
  .kart-speed { bottom: max(113px, calc(env(safe-area-inset-bottom) + 88px)); }
  .kart-speed > strong { font-size: 28px; }
  .kart-keyboard-hint { display: none; }
  .kart-countdown { top: 42%; font-size: 116px; }
  .kart-message { bottom: max(158px, calc(env(safe-area-inset-bottom) + 133px)); max-width: 82%; width: max-content; font-size: 9px; }
  .kart-overlay:has(.kart-pause) { align-items: center; padding-top: 143px; }
  .kart-pause { max-height: calc(100dvh - 166px); padding: 24px; }
  .kart-pause h2 { font-size: 28px; }
  .kart-pause .kart-auto { margin-inline: 14px; }
  .kart-pause .kart-auto small { max-width: none; }
}
@media (max-height: 480px) and (max-width: 699px) {
  .kart-brand strong { font-size: 16px; }
  .kart-hud { top: 15px; padding-block: 5px; }
  .kart-hud > div { min-width: 48px; padding-inline: 9px; }
  .kart-hud .kart-hud-time { min-width: 77px; }
  .kart-hud strong { font-size: 18px; }
  .kart-hud-time strong { font-size: 13px; }
  .kart-overlay { padding-top: 69px; padding-bottom: 15px; }
  .kart-picker { max-width: none; padding: 14px; }
  .kart-track-list { margin-top: 0; gap: 8px; }
  .kart-track-card { min-height: 112px; gap: 5px; }
  .kart-track-art, .kart-track-map { height: 42px; min-height: 42px; }
  .kart-track-copy { gap: 2px; }
  .kart-track-copy > strong { min-height: 0; font-size: 11px; }
  .kart-track-record { margin-top: 1px; }
  .kart-picker-bottom { margin-top: 9px; }
  .kart-pause { padding: 18px; }
  .kart-overlay:has(.kart-pause) { padding-top: 70px; }
  .kart-pause { max-height: calc(100dvh - 90px); }
}
@media (hover: none) {
  .kart-keyboard-hint { display: none; }
  .kart-touch:hover { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kart-track-card, .kart-auto-switch, .kart-auto-switch::after { transition: none; }
}

.kart-driving-settings { display: grid; gap: 3px; }
.kart-driving-settings > .kart-auto { min-height: 47px; }
.kart-driving-settings .kart-auto small { max-width: 25ch; }
.kart-pause .kart-driving-settings { margin: 9px 0 20px; }
.kart-pause .kart-driving-settings > .kart-auto { margin: 0; text-align: left; }
@media (max-height: 660px) and (min-width: 700px) {
  .kart-picker-bottom { grid-template-columns: minmax(0, 1.8fr) minmax(170px, .8fr); gap: 24px; }
  .kart-picker-bottom .kart-driving-settings { grid-template-columns: 1fr 1fr; gap: 20px; }
  .kart-picker-bottom .kart-driving-settings > .kart-auto { min-width: 0; gap: 10px; }
  .kart-picker-bottom .kart-driving-settings .kart-auto small { font-size: 8px; }
}
@media (max-width: 699px) {
  .kart-picker-bottom { grid-template-columns: 1fr; gap: 13px; }
  .kart-picker-bottom .kart-driving-settings { grid-template-columns: 1fr 1fr; gap: 13px; }
  .kart-picker-bottom .kart-driving-settings > .kart-auto { min-height: 47px; }
  .kart-picker-bottom .kart-driving-settings .kart-auto small { max-width: 17ch; }
  .kart-picker-bottom .kart-start { width: 100%; }
  .kart-pause .kart-driving-settings { margin-inline: 2px; }
}
.kart-pause .kart-eyebrow, .kart-pause .kart-button-quiet, .kart-pause .kart-auto small,
.kart-pause .kart-result-stats > p, .kart-pause .kart-result-stats > div > span { color: #49654c; }

.kart-picker h1, .kart-picker h2 { color: #254e40; line-height: 1.1; }
.kart-picker h1 { margin: 0 0 10px; font-size: clamp(22px, 2.2vw, 29px); }
.kart-picker h2 { margin: 18px 0 9px; font-size: 18px; }
.kart-picker .kart-track-list { margin-top: 0; }
.kart-driver-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kart-driver-option {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 4px 8px;
  border: 2px solid #d9dfc9;
  border-radius: 15px;
  color: #254e40;
  background: #fffef6;
}
.kart-driver-option[aria-pressed=true] { border-color: #38765a; background: #eaf1dc; }
.kart-driver-option > strong { font-size: 16px; line-height: 1.2; }
.kart-driver-option > small { color: #54654f; font-size: 10px; }
.kart-driver-portrait {
  position: relative;
  display: block;
  overflow: hidden;
  width: 62px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d5eee3;
}
.kart-driver-bohi { background: #f7e7b9; }
.kart-driver-doro { background: #e0e8f0; }
.kart-driver-portrait img {
  position: absolute;
  left: 50%;
  top: 0;
  width: 158%;
  max-width: none;
  height: auto;
  transform: translateX(-50%);
}
.kart-driver-bohi img { left: 40%; top: -2%; }
.kart-driver-doro img { left: 47%; top: -4%; width: 135%; }
.kart-driver-check {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: white;
  background: #366649;
  text-align: center;
  font-size: 13px;
  line-height: 19px;
}
.kart-driver-option[aria-pressed=true] .kart-driver-check { display: block; }
.kart-hud .kart-hud-driver { display: grid; justify-items: center; gap: 2px; min-width: 48px; padding-inline: 8px; }
.kart-hud-driver .kart-driver-portrait { width: 27px; }
.kart-hud .kart-hud-driver strong { margin: 0; font-size: 10px; line-height: 1.1; }
.kart-pause > .kart-driver-portrait { width: 64px; margin: 0 auto 8px; }
@media (min-width: 700px) and (min-height: 661px) {
  .kart-track-card { min-height: 76px; }
}
@media (min-width: 700px) and (max-width: 820px) {
  .kart-shell:not(:has(.kart-picker)) .kart-brand-mark { display: none; }
  .kart-shell:not(:has(.kart-picker)) .kart-brand strong { font-size: 16px; }
}
@media (min-width: 700px) and (max-height: 480px) {
  .kart-picker { padding: 12px 16px; }
  .kart-picker h1 { margin-bottom: 6px; font-size: 20px; }
  .kart-picker h2 { margin: 8px 0 5px; font-size: 16px; }
  .kart-driver-option { grid-template-columns: 46px 1fr; grid-template-rows: 1fr 1fr; gap: 0 6px; align-items: center; justify-items: start; padding: 4px 9px; }
  .kart-driver-option .kart-driver-portrait { grid-row: 1 / 3; width: 46px; }
  .kart-driver-option > strong { align-self: end; }
  .kart-driver-option > small { align-self: start; }
  .kart-track-card { min-height: 66px; }
  .kart-picker-bottom { margin-top: 7px; }
}
@media (max-width: 699px) {
  .kart-hud > div { min-width: 49px; padding-inline: 9px; }
  .kart-hud .kart-hud-time { min-width: 80px; }
}
@media (max-height: 480px) and (max-width: 699px) {
  .kart-shell:not(:has(.kart-picker)) .kart-brand { visibility: hidden; }
  .kart-pause > .kart-driver-portrait { width: 40px; }
}

/* Sports Club keeps the arena full screen and match controls in the corners. */
.sport-shell { position: fixed; inset: 0; z-index: 120; width: 100%; height: 100dvh; overflow: hidden; isolation: isolate; color: #204c40; background: #c8ecfa; font-family: inherit; touch-action: none; }
.sport-shell *, .sport-shell *::before, .sport-shell *::after { box-sizing: border-box; }
.sport-shell button, .sport-shell select, .sport-shell a { -webkit-tap-highlight-color: transparent; font: inherit; }
.sport-shell button { cursor: pointer; }
.sport-shell button:disabled { cursor: default; opacity: .58; }
.sport-shell button:focus-visible, .sport-shell select:focus-visible, .sport-shell a:focus-visible { outline: 3px solid #eaa32d; outline-offset: 4px; }
.sport-canvas { position: absolute; inset: 0; overflow: hidden; }
.sport-canvas > canvas { display: block; width: 100%; height: 100%; }
.sport-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #294d3d0d, transparent 26%, transparent 77%, #214a3f26); }
.sport-header { position: absolute; z-index: 4; inset: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) auto max(24px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 18px; pointer-events: none; }
.sport-brand { display: flex; align-items: center; gap: 10px; filter: drop-shadow(0 2px 0 #fff9df7d); }
.sport-brand > span:last-child { display: grid; gap: 1px; }
.sport-brand small { color: #2f5746; text-transform: uppercase; letter-spacing: 2.7px; font-size: 8px; line-height: 1.3; font-weight: 900; }
.sport-brand strong { color: #214f40; font-size: 23px; font-weight: 950; letter-spacing: -.7px; line-height: 1.1; }
.sport-brand-mark { position: relative; display: block; width: 34px; height: 34px; border: 3px solid #254f40; border-radius: 50%; background: #fff5cd; transform: rotate(-14deg); }
.sport-brand-mark::before { content: ''; position: absolute; inset: 6px; background: #315e49; clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); }
.sport-brand-mark::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 4px dashed #315e49; }
.sport-navigation { display: flex; gap: 9px; pointer-events: auto; }
.sport-top-button { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 44px; gap: 9px; padding: 10px 17px; border: 1px solid #fff9e8; border-radius: 15px; background: #fff8e7; color: #2a5141; box-shadow: 0 3px 0 #31564426, 0 7px 18px #245c3614; text-decoration: none; font-size: 12px; font-weight: 900; }
.sport-top-button > span:first-child { font-size: 19px; line-height: 1; }
.sport-exit { min-width: 44px; }
.sport-exit > span:first-child { font-size: 24px; font-weight: 600; }
.sport-hud { position: absolute; z-index: 3; top: max(20px, env(safe-area-inset-top)); left: 50%; display: flex; align-items: stretch; min-height: 67px; overflow: hidden; border: 2px solid #fff9e3; border-radius: 19px; background: #fff8e7; box-shadow: 0 4px 0 #31594826, 0 8px 22px #31594814; transform: translateX(-50%); }
.sport-hud-team { display: grid; min-width: 78px; align-content: center; padding: 9px 17px 7px; text-align: center; }
.sport-hud-team > span { color: #fff9eb; font-size: 8px; font-weight: 900; letter-spacing: .5px; white-space: nowrap; }
.sport-hud-team > strong { color: #fffdf0; font-size: 30px; font-weight: 950; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sport-hud-blue { background: #286fa7; }
.sport-hud-orange { background: #b85828; }
.sport-hud-clock { display: grid; min-width: 83px; align-content: center; gap: 4px; padding: 8px 12px; text-align: center; }
.sport-hud-clock > span { color: #54705b; font-size: 7px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.sport-hud-clock > strong { color: #2b5843; font-size: 21px; line-height: 1.1; font-weight: 950; font-variant-numeric: tabular-nums; }
.sport-overlay { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding: 99px max(28px, env(safe-area-inset-right)) 22px max(28px, env(safe-area-inset-left)); pointer-events: none; }
.sport-picker { width: 352px; max-height: calc(100dvh - 121px); overflow: auto; padding: 21px; border: 1px solid #fffdf0; border-radius: 26px; background: #fff8e7; box-shadow: 0 7px 0 #365c4326, 0 20px 60px #244e3a26; pointer-events: auto; touch-action: pan-y; scrollbar-width: thin; }
.sport-eyebrow { margin: 0; color: #506f4e; font-size: 9px; font-weight: 900; line-height: 1.5; letter-spacing: 1.25px; text-transform: uppercase; }
.sport-picker-heading h1 { margin: 7px 0 8px; color: #254e40; font-size: 31px; font-weight: 950; line-height: 1.04; letter-spacing: -1px; }
.sport-picker-heading > p:last-child { max-width: 30ch; margin: 0; color: #4c674c; font-size: 11px; line-height: 1.55; }
.sport-arena-list { display: grid; gap: 8px; margin-top: 17px; }
.sport-arena-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 97px; padding: 7px 12px 7px 7px; border: 2px solid #d5ddc7; border-radius: 17px; background: #fffdf3; color: #2e5743; text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.sport-arena-card:hover { background: #f0f5e2; transform: translateY(-1px); }
.sport-arena-card[aria-pressed='true'] { border-color: #50846c; background: #eef4df; box-shadow: 0 3px 0 #4b725526; }
.sport-arena-art { flex: 0 0 64px; align-self: stretch; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; background: #e7edcf; }
.sport-arena-polo .sport-arena-art { background: #e2eee1; }
.sport-arena-hockey .sport-arena-art { background: #e5e9f1; }
.sport-field-preview { display: block; width: 100%; height: 84px; }
.sport-arena-copy { flex: 1; min-width: 0; display: grid; gap: 4px; padding-right: 5px; }
.sport-arena-kind { color: #58764c; font-size: 7px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; }
.sport-arena-copy > strong { color: #2b5442; font-size: 14px; font-weight: 950; letter-spacing: -.25px; line-height: 1.1; }
.sport-arena-description { color: #4e674c; font-size: 9px; line-height: 1.45; }
.sport-arena-record { color: #4f6c43; font-size: 8px; font-weight: 900; }
.sport-arena-selected { position: absolute; top: 8px; right: 8px; display: flex; justify-content: center; align-items: center; width: 16px; height: 16px; border-radius: 50%; background: #4c7e62; color: #fff9e5; font-size: 10px; font-weight: 950; opacity: 0; }
.sport-arena-card[aria-pressed='true'] .sport-arena-selected { opacity: 1; }
.sport-picker-bottom { display: grid; gap: 12px; margin-top: 16px; }
.sport-match-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.sport-match-options > label { display: grid; gap: 6px; color: #385a41; font-size: 9px; font-weight: 900; }
.sport-match-options select { width: 100%; min-height: 44px; padding: 10px 24px 10px 11px; border: 1px solid #b8c9ac; border-radius: 12px; background: #fffdf1; color: #355c43; font-size: 11px; font-weight: 900; cursor: pointer; }
.sport-direction { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 11px; border: 1px solid #d8e1c9; border-radius: 12px; background: #eef4dd; color: #435f43; font-size: 9px; line-height: 1.5; }
.sport-direction > span:first-child { color: #4b7454; font-size: 25px; font-weight: 800; }
.sport-blue-text { color: #205f92; }
.sport-orange-text { color: #a64b21; }
.sport-button { display: flex; align-items: center; justify-content: center; min-height: 48px; gap: 13px; padding: 12px 18px; border: 1px solid #c7d4b9; border-radius: 15px; background: #eef3df; color: #355c43; box-shadow: 0 3px 0 #708b5f26; font-size: 12px; font-weight: 900; }
.sport-button-primary { border-color: #d89b47; background: #f4bb67; color: #60451f; box-shadow: 0 4px 0 #b77b32; }
.sport-button-primary:hover { background: #ffca7c; }
.sport-button-quiet { border-color: transparent; background: transparent; box-shadow: none; color: #496444; font-size: 11px; }
.sport-controls { position: absolute; z-index: 4; bottom: max(24px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
.sport-dpad { left: max(24px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(3, 55px); grid-template-rows: repeat(2, 55px); gap: 6px; }
.sport-move-up { grid-column: 2; grid-row: 1; }
.sport-move-left { grid-column: 1; grid-row: 2; }
.sport-move-down { grid-column: 2; grid-row: 2; }
.sport-move-right { grid-column: 3; grid-row: 2; }
.sport-touch { display: flex; align-items: center; justify-content: center; flex-direction: column; min-width: 44px; min-height: 44px; padding: 7px; border: 1px solid #fff8df; border-radius: 16px; background: #fff8e7; color: #315c46; box-shadow: 0 4px 0 #31574766, 0 7px 18px #31574726; touch-action: none; -webkit-touch-callout: none; }
.sport-touch > span { font-size: 30px; font-weight: 700; line-height: 1; }
.sport-touch:active, .sport-touch.sport-control-active, .sport-touch[aria-pressed='true'] { transform: translateY(3px); box-shadow: 0 1px 0 #31574766; background: #dbeacd; }
.sport-abilities { right: max(24px, env(safe-area-inset-right)); display: flex; align-items: flex-end; gap: 11px; }
.sport-abilities .sport-touch { width: 83px; min-height: 76px; gap: 5px; border-radius: 21px; }
.sport-touch > strong { color: inherit; font-size: 10px; line-height: 1.15; font-weight: 950; text-align: center; }
.sport-touch > small { color: #6a4d22; font-size: 7px; line-height: 1; font-weight: 900; }
.sport-touch-action { min-height: 90px !important; border-color: #ffe2a4; background: #f6c572; color: #725124; }
.sport-touch-action > .sport-action-symbol { font-size: 35px; }
.sport-touch-brake { background: #edf1dc; }
.sport-touch-brake > .sport-brake-symbol { font-size: 25px; }
.sport-countdown { position: absolute; z-index: 6; top: 45%; left: 50%; color: #fff8d8; font-size: clamp(80px, 12vw, 150px); font-weight: 950; line-height: 1; letter-spacing: -4px; transform: translate(-50%, -50%) rotate(-5deg); text-shadow: 0 6px 0 #315e47, 0 12px 0 #315e4733, 0 18px 36px #164d4d26; pointer-events: none; }
.sport-keyboard-hint { position: absolute; z-index: 3; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: 42%; margin: 0; color: #fff9e7; transform: translateX(-50%); text-align: center; text-shadow: 0 1px 3px #214d39; font-size: 8px; line-height: 1.8; font-weight: 800; }
.sport-keyboard-hint > span { margin-left: 10px; }
.sport-message { position: absolute; z-index: 6; bottom: max(158px, calc(env(safe-area-inset-bottom) + 134px)); left: 50%; max-width: min(470px, 77vw); width: max-content; margin: 0; padding: 9px 16px; border: 1px solid #fffbe9; border-radius: 22px; background: #fff8e7; color: #375a40; box-shadow: 0 3px 12px #1c4d3626; transform: translateX(-50%); text-align: center; font-size: 10px; line-height: 1.5; font-weight: 800; pointer-events: none; }
.sport-message:empty { display: none; }
.sport-shell:has(.sport-overlay > section) .sport-controls, .sport-shell:has(.sport-overlay > section) .sport-message { visibility: hidden; }
.sport-shell:has(.sport-picker) .sport-hud, .sport-shell:has(.sport-picker) .sport-keyboard-hint { visibility: hidden; }
.sport-overlay:has(.sport-pause) { justify-content: center; padding: 99px 20px 24px; background: #173e3640; backdrop-filter: blur(4px); }
.sport-pause { width: min(352px, 100%); max-height: calc(100dvh - 123px); overflow: auto; padding: 29px; border: 1px solid #fffdf0; border-radius: 27px; background: #fff8e7; box-shadow: 0 8px 0 #315b4633, 0 20px 65px #254e3e40; text-align: center; pointer-events: auto; touch-action: pan-y; }
.sport-pause h2 { margin: 11px 0 12px; color: #294f3d; font-size: 30px; line-height: 1.05; letter-spacing: -.9px; font-weight: 950; }
.sport-pause-copy { margin: 0 auto 20px; color: #4d684b; font-size: 11px; line-height: 1.6; }
.sport-result-score { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: center; gap: 5px; margin-top: 18px; padding: 17px 10px 13px; border: 1px solid #d6dfc4; border-radius: 18px; background: #edf3dc; }
.sport-result-score > div { display: grid; gap: 6px; }
.sport-result-score > div > span { font-size: 9px; font-weight: 900; }
.sport-result-score > div > strong { color: #2e5642; font-size: 40px; line-height: 1; font-weight: 950; font-variant-numeric: tabular-nums; }
.sport-result-score > span { color: #738765; font-size: 25px; font-weight: 900; }
.sport-match-details { margin: 12px 0 22px; color: #506a48; font-size: 9px; font-weight: 800; }
.sport-pause-actions { display: grid; gap: 11px; }
@media (max-width: 900px) {
  .sport-header { inset-inline: 18px; }
  .sport-brand strong { font-size: 20px; }
  .sport-brand small { font-size: 7px; letter-spacing: 2.2px; }
  .sport-brand-mark { width: 30px; height: 30px; }
  .sport-top-button { min-width: 66px; padding-inline: 12px; }
  .sport-exit { min-width: 44px; }
  .sport-exit > span:last-child { display: none; }
  .sport-overlay { padding-inline: 20px; }
  .sport-picker { width: 330px; padding: 19px; }
  .sport-picker-heading h1 { font-size: 29px; }
  .sport-arena-art { flex-basis: 58px; }
  .sport-arena-description { font-size: 8px; }
  .sport-arena-copy > strong { font-size: 13px; }
}
@media (max-height: 700px) and (min-width: 700px) {
  .sport-header, .sport-hud { top: max(15px, env(safe-area-inset-top)); }
  .sport-overlay { align-items: flex-end; padding: 98px 24px 20px; }
  .sport-picker { width: min(100%, 1100px); max-height: calc(100dvh - 118px); padding: 17px 20px; }
  .sport-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .sport-picker-heading h1 { order: -1; margin: 0; font-size: 23px; letter-spacing: -.6px; }
  .sport-picker-heading h1 br { display: none; }
  .sport-picker-heading .sport-eyebrow { max-width: 160px; font-size: 8px; text-align: right; }
  .sport-picker-heading > p:last-child { display: none; }
  .sport-arena-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 13px; }
  .sport-arena-card { min-height: 88px; gap: 9px; padding: 6px 10px 6px 6px; }
  .sport-arena-art { flex-basis: 57px; }
  .sport-field-preview { height: 78px; }
  .sport-arena-copy > strong { font-size: 12px; }
  .sport-arena-description { font-size: 7px; }
  .sport-picker-bottom { grid-template-columns: 1.2fr 1.15fr .9fr; gap: 19px; align-items: center; margin-top: 14px; }
  .sport-direction { min-height: 61px; padding-block: 7px; font-size: 8px; }
  .sport-picker-bottom > .sport-button { align-self: stretch; }
  .sport-dpad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(2, 50px); gap: 5px; }
  .sport-controls { bottom: max(18px, env(safe-area-inset-bottom)); }
  .sport-pause { padding: 23px; }
  .sport-pause h2 { font-size: 26px; }
  .sport-pause-copy { margin-bottom: 14px; }
  .sport-result-score { padding-block: 12px; margin-top: 14px; }
  .sport-result-score > div > strong { font-size: 33px; }
  .sport-match-details { margin-bottom: 17px; }
}
@media (max-width: 699px) {
  .sport-header { inset: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) auto max(15px, env(safe-area-inset-left)); gap: 8px; }
  .sport-brand { gap: 7px; }
  .sport-brand strong { font-size: 18px; letter-spacing: -.5px; }
  .sport-brand small { font-size: 6px; letter-spacing: 1.8px; }
  .sport-brand-mark { width: 27px; height: 27px; border-width: 2px; }
  .sport-navigation { gap: 6px; }
  .sport-top-button { min-height: 44px; min-width: 58px; gap: 5px; padding: 9px 11px; border-radius: 14px; font-size: 10px; }
  .sport-exit { min-width: 44px; }
  .sport-hud { top: max(74px, calc(env(safe-area-inset-top) + 59px)); min-height: 59px; border-radius: 16px; }
  .sport-hud-team { min-width: 73px; padding: 7px 13px 6px; }
  .sport-hud-team > span { font-size: 7px; }
  .sport-hud-team > strong { font-size: 27px; }
  .sport-hud-clock { min-width: 76px; padding-inline: 9px; }
  .sport-hud-clock > strong { font-size: 19px; }
  .sport-overlay { align-items: flex-end; justify-content: center; padding: 80px max(15px, env(safe-area-inset-right)) max(19px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)); }
  .sport-picker { width: 100%; max-width: 480px; max-height: calc(100dvh - 100px); padding: 18px 16px; border-radius: 23px; }
  .sport-picker-heading .sport-eyebrow { font-size: 7px; letter-spacing: .9px; }
  .sport-picker-heading h1 { margin: 6px 0 7px; font-size: 26px; letter-spacing: -.7px; }
  .sport-picker-heading h1 br { display: none; }
  .sport-picker-heading > p:last-child { max-width: none; font-size: 10px; }
  .sport-arena-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
  .sport-arena-card { flex-direction: column; align-items: stretch; gap: 7px; min-height: 151px; padding: 6px 6px 9px; border-radius: 14px; }
  .sport-arena-art { flex-basis: auto; height: 79px; border-radius: 8px; }
  .sport-field-preview { height: 80px; }
  .sport-arena-copy { gap: 4px; padding: 0 2px; }
  .sport-arena-kind { font-size: 6px; letter-spacing: .7px; }
  .sport-arena-copy > strong { min-height: 25px; font-size: 11px; line-height: 1.15; }
  .sport-arena-description { display: none; }
  .sport-arena-record { font-size: 7px; }
  .sport-arena-selected { width: 14px; height: 14px; top: 8px; right: 7px; font-size: 9px; }
  .sport-picker-bottom { grid-template-columns: 1.15fr 1fr; gap: 10px; margin-top: 15px; align-items: stretch; }
  .sport-match-options { grid-column: 1 / -1; gap: 9px; }
  .sport-match-options > label { font-size: 8px; }
  .sport-match-options select { font-size: 10px; min-height: 44px; }
  .sport-direction { gap: 6px; padding: 8px; font-size: 8px; }
  .sport-direction > span:first-child { font-size: 21px; }
  .sport-picker-bottom > .sport-button { gap: 7px; padding-inline: 10px; font-size: 12px; }
  .sport-dpad { left: max(15px, env(safe-area-inset-left)); grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 5px; }
  .sport-controls { bottom: max(25px, env(safe-area-inset-bottom)); }
  .sport-touch { border-radius: 15px; }
  .sport-touch > span { font-size: 27px; }
  .sport-abilities { right: max(15px, env(safe-area-inset-right)); flex-direction: column; align-items: center; gap: 9px; }
  .sport-abilities .sport-touch { width: 77px; min-height: 58px; gap: 5px; border-radius: 18px; }
  .sport-touch-action { min-height: 83px !important; }
  .sport-touch-action > .sport-action-symbol { font-size: 29px; }
  .sport-touch > strong { font-size: 9px; }
  .sport-touch-brake > .sport-brake-symbol { display: none; }
  .sport-keyboard-hint { display: none; }
  .sport-countdown { top: 44%; font-size: 112px; }
  .sport-message { bottom: max(203px, calc(env(safe-area-inset-bottom) + 178px)); max-width: 81%; font-size: 9px; }
  .sport-overlay:has(.sport-pause) { align-items: center; padding-top: 153px; }
  .sport-pause { max-height: calc(100dvh - 179px); padding: 25px; }
  .sport-pause h2 { font-size: 28px; }
}
@media (max-height: 480px) and (max-width: 699px) {
  .sport-brand strong { font-size: 16px; }
  .sport-brand small { display: none; }
  .sport-hud { top: 15px; min-height: 49px; }
  .sport-hud-team { min-width: 60px; padding: 4px 10px; }
  .sport-hud-team > span { font-size: 6px; }
  .sport-hud-team > strong { font-size: 22px; }
  .sport-hud-clock { min-width: 66px; gap: 2px; }
  .sport-hud-clock > strong { font-size: 16px; }
  .sport-overlay { padding-top: 78px; padding-bottom: 15px; }
  .sport-picker { max-width: none; padding: 13px; }
  .sport-picker-heading { display: none; }
  .sport-arena-list { margin-top: 0; }
  .sport-arena-card { flex-direction: row; min-height: 87px; gap: 6px; padding: 5px; }
  .sport-arena-art { height: 71px; flex: 0 0 47px; }
  .sport-field-preview { height: 69px; }
  .sport-arena-copy > strong { min-height: 0; font-size: 10px; }
  .sport-arena-kind { font-size: 6px; }
  .sport-arena-record { font-size: 6px; }
  .sport-picker-bottom { grid-template-columns: 1.2fr 1fr .9fr; gap: 10px; margin-top: 10px; }
  .sport-match-options { grid-column: auto; gap: 7px; }
  .sport-match-options select { min-height: 44px; padding-left: 7px; padding-right: 17px; font-size: 9px; }
  .sport-direction { padding: 6px; font-size: 7px; }
  .sport-picker-bottom > .sport-button { font-size: 11px; }
  .sport-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 4px; }
  .sport-controls { bottom: max(15px, env(safe-area-inset-bottom)); }
  .sport-abilities { flex-direction: row; gap: 8px; }
  .sport-abilities .sport-touch { width: 66px; min-height: 61px; }
  .sport-touch-action { min-height: 78px !important; }
  .sport-message { bottom: 124px; }
  .sport-overlay:has(.sport-pause) { padding-top: 80px; }
  .sport-pause { max-height: calc(100dvh - 99px); padding: 20px; }
  .sport-pause h2 { font-size: 25px; margin-top: 7px; }
  .sport-pause-copy { margin-bottom: 12px; }
  .sport-result-score { margin-top: 10px; padding-block: 10px; }
  .sport-result-score > div > strong { font-size: 29px; }
  .sport-match-details { margin: 9px 0 15px; }
  .sport-pause-actions { gap: 8px; }
  .sport-pause .sport-button { min-height: 44px; padding-block: 10px; }
}
@media (hover: none) {
  .sport-keyboard-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sport-arena-card { transition: none; }
}
.sport-shell .sport-message[data-error='true'] { visibility: visible; z-index: 9; background: #fff8e7; color: #633f29; }

/* Dipolog Play Town keeps the neighborhood visible behind compact controls. */
.town-shell { position: fixed; inset: 0; z-index: 120; height: 100dvh; overflow: hidden; isolation: isolate; background: #cbeef4; color: #294f43; font-family: inherit; touch-action: none; }
.town-shell *, .town-shell *::before, .town-shell *::after { box-sizing: border-box; }
.town-shell button, .town-shell a { -webkit-tap-highlight-color: transparent; font: inherit; }
.town-shell button { cursor: pointer; }
.town-shell button:focus-visible, .town-shell a:focus-visible { outline: 3px solid #e6ae50; outline-offset: 4px; }
.town-canvas, .town-vignette { position: absolute; inset: 0; }
.town-canvas canvas { display: block; width: 100%; height: 100%; }
.town-vignette { pointer-events: none; background: linear-gradient(180deg, #3468550d, transparent 25%, transparent 75%, #2b614c21); }
.town-header { position: absolute; z-index: 8; inset: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) auto max(22px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.town-brand { display: grid; gap: 2px; filter: drop-shadow(0 2px 0 #fff6dbb3); }
.town-brand small { font-size: 8px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 900; }
.town-brand strong { font-size: 22px; line-height: 1.1; font-weight: 950; letter-spacing: -.7px; }
.town-header nav { display: flex; gap: 8px; pointer-events: auto; }
.town-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid #fff9e5; border-radius: 14px; background: #fff9e9; box-shadow: 0 3px 0 #2c55492b; color: #345b49; font-size: 11px; font-weight: 900; text-decoration: none; }
.town-button-primary { border-color: #e7b66a; background: #f5ca85; color: #5c492e; }
.town-hud { position: absolute; z-index: 3; top: max(80px, calc(env(safe-area-inset-top) + 62px)); left: max(22px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 20px; max-width: calc(100% - 44px); padding: 12px 16px; border: 1px solid #fff9e5; border-radius: 17px; background: #fff8e8ed; box-shadow: 0 4px 18px #3c64491a; }
.town-hud > div { display: grid; gap: 3px; }
.town-hud [data-town-job] { font-size: 11px; font-weight: 900; }
.town-hud [data-town-inventory] { color: #547054; font-size: 10px; font-weight: 700; }
.town-badge-count { border-left: 1px solid #d9dfc5; padding-left: 15px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.town-controls { position: absolute; z-index: 4; bottom: max(22px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
.town-dpad { display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); gap: 7px; left: max(22px, env(safe-area-inset-left)); }
.town-up { grid-column: 2; }.town-left { grid-row: 2; grid-column: 1; }.town-down { grid-row: 2; grid-column: 2; }.town-right { grid-row: 2; grid-column: 3; }
.town-touch { display: flex; align-items: center; justify-content: center; border: 1px solid #fffbe9; border-radius: 17px; background: #fff7e8f2; box-shadow: 0 4px 0 #41634b55, 0 7px 22px #41634b20; color: #355e4b; font-size: 30px; font-weight: 800; touch-action: none; -webkit-touch-callout: none; }
.town-touch:active, .town-control-active { transform: translateY(3px); background: #e5edcf; box-shadow: 0 1px 0 #41634b55; }
.town-abilities { right: max(22px, env(safe-area-inset-right)); display: flex; align-items: flex-end; gap: 10px; }
.town-abilities .town-touch { flex-direction: column; gap: 2px; padding: 9px 12px; min-width: 65px; min-height: 76px; }
.town-abilities .town-touch > span { font-size: 27px; line-height: 1; }
.town-abilities .town-touch strong { max-width: 19ch; font-size: 11px; line-height: 1.2; }
.town-abilities .town-touch small { font-size: 8px; font-weight: 700; opacity: .7; }
.town-interact { min-width: 125px !important; max-width: 180px; min-height: 88px !important; background: #f4d18ded; border-color: #ffe9b5; color: #665333; }
.town-keyboard-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 40%; margin: 0; color: #fcf7df; text-shadow: 0 1px 3px #31553f; font-size: 8px; text-align: center; font-weight: 800; }
.town-message { position: absolute; z-index: 6; bottom: max(152px, calc(env(safe-area-inset-bottom) + 130px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(650px, 84%); padding: 9px 17px; border-radius: 24px; background: #fff8e9f5; border: 1px solid #fff6d5; color: #486047; box-shadow: 0 3px 13px #365b3b21; font-size: 11px; line-height: 1.5; text-align: center; font-weight: 800; pointer-events: none; }
.town-message:empty { display: none; }
.town-panel-host { position: absolute; z-index: 7; inset: 0; display: flex; align-items: flex-start; justify-content: flex-end; padding: 83px max(22px, env(safe-area-inset-right)) 20px max(22px, env(safe-area-inset-left)); pointer-events: none; }
.town-panel { width: min(360px, 100%); max-height: calc(100dvh - 107px); overflow: auto; padding: 23px; border: 1px solid #fffef5; border-radius: 24px; background: #fffbee; box-shadow: 0 7px 0 #395f4824, 0 18px 65px #345e4738; pointer-events: auto; touch-action: pan-y; }
.town-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.town-eyebrow { margin: 0 0 7px; font-size: 7px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 900; color: #6c8060; }
.town-panel h1, .town-panel h2 { margin: 0; color: #315642; font-size: 27px; line-height: 1.08; letter-spacing: -.7px; font-weight: 950; }
.town-close { flex: 0 0 44px; height: 44px; margin: -8px -8px 0 0; border: 1px solid #e0e4cf; border-radius: 13px; background: #f2f4e2; color: #577052; font-size: 25px !important; }
.town-panel-intro { color: #5c7257; font-size: 11px; line-height: 1.6; margin: 16px 0; }
.town-job-list { display: grid; gap: 9px; }
.town-job-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 77px; padding: 12px; border: 1px solid #d9e2c9; border-radius: 15px; background: #f7f8ea; color: #3b6249; text-align: left; }
.town-job-card[aria-pressed='true'] { background: #eaf0d9; border-color: #8cb78d; box-shadow: 0 0 0 2px #8cb78d33; }
.town-job-number { flex: 0 0 34px; display: grid; place-items: center; height: 38px; border-radius: 11px; background: #e5ebd1; color: #709066; font-size: 12px; font-weight: 950; }
.town-job-card > span:last-child { display: grid; gap: 5px; }
.town-job-card strong { font-size: 13px; font-weight: 900; }
.town-job-card small { color: #65795b; font-size: 10px; line-height: 1.45; }
.town-panel .town-style-heading { margin: 21px 0 12px; font-size: 16px; letter-spacing: 0; }
.town-costumes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.town-costume { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 66px; border: 1px solid #d9e2c9; border-radius: 12px; background: #f5f5e5; color: #4c6c4f; font-size: 9px; font-weight: 900; }
.town-costume > span { width: 27px; height: 14px; border-radius: 14px 14px 4px 4px; background: #719eaa; border-bottom: 4px solid #597f90; }
.town-costume-chef > span { background: #fffae9; border: 1px solid #d8d7bc; height: 20px; box-shadow: -5px -3px 0 -1px #fffae9, 5px -3px 0 -1px #fffae9; }
.town-costume-builder > span { background: #e7bc62; border-bottom-color: #c49b48; }.town-costume-gardener > span { width: 34px; background: #d6bf81; border-bottom-color: #b59b60; }.town-costume-doctor > span { border-radius: 4px; background: #fff8e9; border: 1px solid #d0d3c0; }
.town-costume[aria-pressed='true'] { background: #e5efda; border-color: #7da37f; box-shadow: 0 0 0 2px #7da37f33; }
.town-private-note { margin: 17px 0 0; color: #79876b; font-size: 9px; line-height: 1.5; }
.town-dialogue { width: min(355px, 100%); }
.town-dialogue > p { margin: 20px 0; color: #476448; font-size: 16px; line-height: 1.7; }
.town-dialogue-actions { display: grid; gap: 10px; }
.town-map { width: 100%; display: block; margin: 18px 0 12px; border-radius: 18px; }
.town-map text { font: 700 8px system-ui,sans-serif; fill: #3f674f; }
.town-map text.town-map-note { font-size: 17px; font-weight: 950; fill: #8672a8; }
.town-map-key { display: flex; align-items: center; gap: 8px; margin: 10px 0 17px; font-size: 10px; color: #60775b; }
.town-map-you { width: 9px; height: 9px; border-radius: 50%; background: #26645b; }.town-map-note-key { margin-left: 7px; color: #8672a8; font-size: 14px; font-weight: 900; }
.town-map-panel > .town-button { width: 100%; }
.town-shell[data-panel]:not([data-panel='']) .town-controls { visibility: hidden; }
@media (max-width: 700px) {
  .town-header { inset-inline: 15px; top: max(14px, env(safe-area-inset-top)); gap: 8px; }
  .town-brand strong { font-size: 17px; max-width: 11ch; }.town-brand small { font-size: 6px; letter-spacing: 1.5px; }
  .town-header nav { gap: 5px; }.town-header .town-button { padding-inline: 10px; font-size: 9px; border-radius: 12px; }.town-exit { padding-inline: 8px !important; }
  .town-hud { top: max(80px, calc(env(safe-area-inset-top) + 64px)); left: 15px; max-width: calc(100% - 30px); padding: 10px 13px; gap: 12px; }
  .town-hud [data-town-job] { font-size: 10px; }.town-hud [data-town-inventory], .town-badge-count { font-size: 9px; }.town-badge-count { padding-left: 11px; }
  .town-dpad { left: 15px; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 6px; }
  .town-abilities { right: 15px; gap: 7px; }.town-abilities .town-touch { min-width: 53px; padding-inline: 8px; min-height: 70px; }.town-interact { min-width: 102px !important; max-width: 122px; min-height: 84px !important; }
  .town-abilities .town-touch strong { font-size: 10px; }.town-abilities .town-touch small { display: none; }
  .town-controls { bottom: max(24px, env(safe-area-inset-bottom)); }.town-touch { border-radius: 15px; font-size: 27px; }
  .town-message { bottom: max(155px, calc(env(safe-area-inset-bottom) + 132px)); font-size: 10px; max-width: 88%; }
  .town-keyboard-hint { display: none; }.town-panel-host { padding: 83px 15px 20px; }.town-panel { max-height: calc(100dvh - 108px); padding: 21px; }
}
@media (max-width: 380px) {
  .town-header .town-button { font-size: 8px; padding-inline: 7px; }.town-brand strong { font-size: 15px; }
  .town-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; left: 12px; }.town-abilities { right: 12px; }.town-interact { min-width: 90px !important; max-width: 90px; }.town-abilities .town-jump { min-width: 44px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .town-header { top: 12px; }.town-hud { top: 68px; padding: 8px 12px; }.town-panel-host { padding-top: 68px; }.town-panel { max-height: calc(100dvh - 85px); }.town-message { bottom: 115px; }.town-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; }.town-abilities .town-touch { min-height: 62px; }.town-interact { min-height: 72px !important; }
}
@media (hover: none) { .town-keyboard-hint { display: none; } }

.island-view.is-building-walk [data-island-instructions] { display: none; }
.island-view.is-building-walk:focus { outline: none; }
.island-builder-help {
  padding: 5px 8px;
  border-radius: 9px;
  background: #fffdf4ee;
  color: #205544;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}
.is-building-walk.is-immersive .island-toolbar {
  top: var(--builder-hud-top, 110px);
  max-width: calc(100% - var(--studio-x) - var(--studio-right));
}
.island-view.is-building-walk .island-play-actions { justify-content: flex-end; }
.island-view.is-building-walk.is-immersive .island-dpad {
  grid-template-columns: repeat(3, clamp(44px, 7.2vw, 63px));
  grid-template-rows: repeat(2, clamp(44px, 7.2vw, 63px));
}
.island-view.is-building-walk.is-immersive {
  --builder-key-size: clamp(44px, 7.2vw, 63px);
  --builder-controls-height: calc(clamp(44px, 7.2vw, 63px) * 2 + 5px);
  --builder-dock-height: 64px;
}
.is-building-walk.is-immersive .island-play-controls { position: relative; }
.is-building-walk.is-immersive .island-play-actions {
  position: absolute;
  left: calc(var(--builder-key-size) + var(--builder-key-size) + 10px);
  bottom: calc(var(--builder-key-size) + 5px);
}
.is-building-walk.is-immersive .island-play-actions [data-island-action="jump"] {
  width: var(--builder-key-size);
  min-width: var(--builder-key-size);
  height: var(--builder-key-size);
  min-height: var(--builder-key-size);
  padding: 3px;
  font-size: 12px;
}
.is-building-walk.is-immersive .studio-dock {
  bottom: var(--studio-bottom);
  right: var(--studio-right);
  left: auto;
  width: max-content;
  max-width: calc(100% - var(--studio-x) - var(--studio-right));
  transform: none;
}
.is-building-walk.is-immersive .studio-camera {
  bottom: calc(var(--studio-bottom) + var(--builder-dock-height) + 12px);
  grid-auto-flow: column;
  align-items: center;
}
.is-building-walk.is-immersive .island-stage:has(.island-play-panel:not([hidden])) .island-status {
  top: var(--builder-message-top, 160px);
  bottom: auto;
  left: var(--studio-x);
  transform: none;
  max-width: min(44%, 430px);
  border-radius: 12px;
  text-align: left;
}
@media (max-width: 620px) {
  .is-building-walk.is-immersive:not(.is-tile-view) .island-builder-help { display: none; }
  .is-building-walk.is-immersive .studio-palette {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    flex: 1 1 auto;
  }
  .is-building-walk.is-immersive .studio-undo { flex: 0 0 44px; min-width: 44px; }
  .is-building-walk.is-immersive .studio-camera { gap: 0; padding: 3px; }
  .is-building-walk.is-immersive .studio-camera .studio-camera-overview { padding-inline: 5px; font-size: 10px; }
}
@media (max-width: 430px) {
  .is-building-walk.is-immersive .studio-dock { width: min(190px, calc(100% - 170px)); flex-wrap: wrap; }
  .is-building-walk.is-immersive .studio-picker-toggle { flex: 1 1 100%; min-width: 0; }
  .is-building-walk.is-immersive .studio-undo { flex: 1 1 100%; min-height: 44px; grid-auto-flow: column; align-items: center; gap: 7px; }
  .is-building-walk.is-immersive .studio-undo span { font-size: 21px; }
}
.is-building-walk.is-immersive.is-tile-view .island-stage:has(.island-play-panel:not([hidden])) .island-status {
  top: auto;
  bottom: calc(var(--studio-bottom) + max(var(--builder-controls-height), var(--builder-dock-height)) + 12px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(85%, 630px);
  text-align: center;
}
.is-building-walk.is-immersive.is-tile-view .island-stage .island-grid-wrap {
  top: var(--builder-grid-top, 140px);
  bottom: var(--builder-grid-bottom, 280px);
  height: auto;
  min-height: 0;
  padding: 0 10px;
  container-type: size;
}
.is-building-walk.is-immersive.is-tile-view .island-stage .island-grid {
  width: min(100%, 100cqh, 660px);
  aspect-ratio: 1;
}

.island-toolbar:has(.bay-hint-toggle) { justify-content: flex-start; }
.island-view:not(.is-immersive):has(.bay-hint-toggle) :is(.studio-play, .island-play-actions .button) { min-height: 44px; }
.bay-hint-toggle, .bay-coach-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #a88b48;
  border-radius: 12px;
  background: #fff8db;
  color: #493916;
  box-shadow: 0 2px 0 #725a252e;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}
.bay-hint-toggle span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #f9d366;
  color: #4c3910;
}
.bay-hint-toggle[aria-expanded="true"] { border-color: #74551c; background: #ffedaf; }
.bay-coach {
  flex-basis: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #b6cd9d;
  border-radius: 14px;
  background: #fffef5;
  box-shadow: 0 3px 9px #3856311c;
  color: #254a37;
}
.bay-coach p { margin: 0; font-size: 15px; font-weight: 750; line-height: 1.35; }
.bay-coach-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.bay-coach-actions button { padding-inline: 9px; border-color: #becdb2; background: #f4f7ed; color: #2c543a; }
.bay-coach-actions [data-island-action="demonstrate"] { border-color: #25633f; background: #286844; color: white; }
.bay-hint-toggle:focus-visible, .bay-coach-actions button:focus-visible,
.bay-pass-dialog button:focus-visible { outline: 3px solid #554693; outline-offset: 2px; }
.island-view.bay-coaching .island-builder-help { display: none; }
.is-immersive .island-toolbar:has(.bay-hint-toggle) {
  width: min(294px, calc(100% - var(--studio-x) - var(--studio-right)));
  pointer-events: none;
}
.is-immersive .island-toolbar:has(.bay-hint-toggle) :is(select, button) { pointer-events: auto; }
.is-immersive.bay-coaching > :is(.island-challenge, .island-level-goal) { visibility: hidden; }
.is-immersive.is-tile-view:has(.bay-hint-toggle) .island-grid-wrap { background: transparent; }
.island-grid button.tile-hint {
  position: relative;
  z-index: 1;
  outline: 2px solid #66430c;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px #ffcf43;
}
.tile-hint::after {
  content: '⬇';
  position: absolute;
  bottom: 43%;
  left: 50%;
  transform: translateX(-50%);
  color: #ffce3c;
  font: 900 clamp(23px, 4vw, 32px)/1 Arial, sans-serif;
  -webkit-text-stroke: 1.5px #594113;
  paint-order: stroke fill;
  filter: drop-shadow(0 1px 0 #493410);
  pointer-events: none;
}
.bay-pass-dialog {
  width: min(355px, calc(100% - 32px));
  padding: 22px;
  border: 2px solid #b2c99d;
  border-radius: 20px;
  background: #fffdf4;
  color: #254a37;
}
.bay-pass-dialog h2 { margin: 0; font-size: 23px; line-height: 1.15; }
.bay-pass-dialog p { margin: 10px 0 16px; color: #405f49; }
.bay-pass-dialog [role="alert"] { color: #943d27; }
.bay-pass-dialog .section-actions { flex-wrap: wrap; gap: 8px; }
.bay-pass-dialog .button { flex: 1; min-height: 46px; }
@media (max-width: 620px) and (orientation: portrait) {
  .is-immersive:has(.bay-hint-toggle) .island-header { flex-direction: column; gap: 5px; }
  .is-immersive:has(.bay-hint-toggle) .studio-title h1 { font-size: clamp(22px, 5vw, 29px); }
  .is-immersive:not(.is-building-walk) .island-toolbar:has(.bay-hint-toggle) { top: calc(var(--studio-top) + 105px); }
  .is-immersive:not(.bay-coaching):has(.bay-hint-toggle) .island-level-goal { top: calc(var(--studio-top) + 155px); }
  .is-immersive:not(.bay-coaching):has(.bay-hint-toggle) .island-challenge { top: var(--builder-message-top, 164px); }
  .is-immersive.bay-coaching.is-tile-view:not(.is-building-walk) .island-stage .island-grid-wrap {
    inset: calc(var(--studio-top) + 245px) 0 calc(var(--studio-bottom) + 116px);
    height: auto;
    min-height: 0;
    padding: 0;
    container-type: size;
  }
  .is-immersive.bay-coaching.is-tile-view:not(.is-building-walk) .island-stage .island-grid {
    width: min(95%, 100cqh, 660px);
    aspect-ratio: 1;
  }
}
@media (min-width: 600px) and (orientation: landscape) {
  .is-immersive.bay-coaching.is-tile-view .island-stage .island-grid-wrap {
    inset: calc(var(--studio-top) + 60px) var(--studio-right) calc(var(--studio-bottom) + 84px) calc(var(--studio-x) + 302px);
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    container-type: size;
  }
  .is-immersive.bay-coaching.is-tile-view .island-stage .island-grid {
    width: min(100cqw, 100cqh, 660px);
    aspect-ratio: 1;
    grid-template-rows: repeat(11, minmax(0, 1fr));
  }
  .is-immersive.bay-coaching.is-tile-view .island-stage:has(.island-play-panel:not([hidden])) .island-status {
    top: auto;
    bottom: var(--studio-bottom);
    left: 50%;
    max-width: min(34%, 330px);
    transform: translateX(-50%);
  }
}
@media (min-width: 600px) and (max-height: 500px) {
  .is-immersive:has(.bay-hint-toggle) .studio-title h1 { font-size: 25px; }
  .island-view.is-immersive:has(.bay-hint-toggle) .island-dpad {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
  }
  .island-view.is-building-walk.is-immersive:has(.bay-hint-toggle) { --builder-key-size: 44px; }
}
@media (min-width: 800px) and (max-height: 500px) {
  .is-building-walk.is-immersive.bay-coaching:not(.is-tile-view) .studio-camera {
    bottom: var(--studio-bottom);
    right: calc(var(--studio-right) + 222px);
  }
  .is-building-walk.is-immersive.bay-coaching.is-tile-view .island-stage .island-grid-wrap {
    inset: calc(var(--studio-top) + 50px) calc(var(--studio-right) + 218px) var(--studio-bottom) calc(var(--studio-x) + 302px);
  }
  .is-building-walk.is-immersive.bay-coaching.is-tile-view .island-stage:has(.island-play-panel:not([hidden])) .island-status {
    top: var(--builder-message-top);
    bottom: auto;
    left: var(--studio-x);
    transform: none;
    max-width: 290px;
    text-align: left;
  }
}
/* Launch Lab */
.cannon-shell { position: fixed; inset: 0; z-index: 120; width: 100%; height: 100dvh; overflow: hidden; isolation: isolate; color: #264c42; background: #bfe9f3; font-family: inherit; touch-action: none; }
.cannon-shell *, .cannon-shell *::before, .cannon-shell *::after { box-sizing: border-box; }
.cannon-shell button, .cannon-shell select, .cannon-shell input, .cannon-shell a { font: inherit; -webkit-tap-highlight-color: transparent; }
.cannon-shell button { cursor: pointer; }
.cannon-shell button:disabled { cursor: default; opacity: .5; }
.cannon-shell button:focus-visible, .cannon-shell a:focus-visible, .cannon-shell select:focus-visible, .cannon-shell input:focus-visible { outline: 3px solid #e5a63d; outline-offset: 4px; }
.cannon-shell [hidden] { display: none !important; }
.cannon-canvas { position: absolute; inset: 0; }
.cannon-canvas canvas { display: block; width: 100%; height: 100%; outline: 0; }
.cannon-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#203c4720, transparent 24%, transparent 74%, #234c3d22); }
.cannon-header { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; gap: 15px; z-index: 8; }
.cannon-brand { display: flex; align-items: center; gap: 10px; color: #254e45; filter: drop-shadow(0 1px 0 #fff9); }
.cannon-brand-star { font-size: 41px; color: #fff8d9; text-shadow: 0 2px 0 #8bbda4; }
.cannon-brand small { display: block; text-transform: uppercase; font-size: 8px; letter-spacing: 3px; font-weight: 900; margin-bottom: 3px; }
.cannon-brand strong { font-size: 23px; letter-spacing: -.8px; font-weight: 950; }
.cannon-header nav { display: flex; gap: 8px; }
.cannon-top-button, .cannon-button, .cannon-small-button, .cannon-return { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid #fff8; border-radius: 15px; background: #fffbeded; color: #305246; box-shadow: 0 4px 0 #789d8c24, 0 6px 18px #2e5c4b0b; font-weight: 850; }
.cannon-top-button { min-height: 44px; gap: 7px; padding: 10px 15px; font-size: 13px; }
.cannon-hud { position: absolute; z-index: 3; top: max(94px, calc(env(safe-area-inset-top) + 72px)); left: 28px; display: flex; gap: 20px; align-items: center; padding: 11px 17px; border: 1px solid #fff9; border-radius: 17px; background: #fffbeded; box-shadow: 0 5px 18px #254b3710; }
.cannon-game-title small { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: 1.6px; color: #83927a; margin-bottom: 3px; font-weight: 900; }
.cannon-game-title strong { font-size: 15px; }
.cannon-team-score { display: flex; align-items: center; gap: 12px; font-size: 11px; }
.cannon-team-score > span { display: flex; align-items: center; gap: 6px; }.cannon-team-score strong { font-size: 21px; margin-left: 3px; }.cannon-team-score > b { color: #bbbfac; }
.cannon-coral-dot, .cannon-teal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f47c8d; }.cannon-teal-dot { background: #49b7bd; }
.cannon-timer { padding-left: 17px; border-left: 1px solid #dbe2cc; font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 900; min-width: 68px; }.cannon-timer[data-urgent='true'] { color: #b55943; }
.cannon-art-score { font-size: 12px; font-weight: 850; color: #6f8165; }
.cannon-controls { position: absolute; z-index: 4; bottom: max(27px, env(safe-area-inset-bottom)); }
.cannon-directions { left: 28px; }.cannon-control-caption { display: block; font-size: 11px; font-weight: 900; text-align: center; color: #335a4a; margin: 0 0 10px; text-shadow: 0 1px 2px #fff; }
.cannon-dpad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); gap: 7px; }
.cannon-touch { display: flex; align-items: center; justify-content: center; border: 1px solid #ffffffe0; border-radius: 18px; background: #fffbedec; box-shadow: 0 5px 0 #73957d4d, 0 8px 18px #315f3b11; color: #41654e; font-size: 29px !important; font-weight: 900; touch-action: none; user-select: none; }
.cannon-touch.cannon-control-active { transform: translateY(3px); background: #e3edbd; box-shadow: 0 2px 0 #73957d4d; }
.cannon-up { grid-column: 2; }.cannon-dpad > :nth-child(2) { grid-column: 1; }
.cannon-return { min-height: 44px; width: 100%; margin-top: 12px; padding: 9px; font-size: 10px; border-radius: 12px; }
.cannon-launch-controls { right: 28px; display: flex; align-items: center; gap: 18px; }
.cannon-launch { width: 113px; height: 113px; border: 4px solid #fff9; border-radius: 50%; background: #f8bd58; box-shadow: 0 6px 0 #bd8537, 0 10px 28px #776f3a33; color: #6a4927; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cannon-launch > span { font-size: 43px; line-height: 1; }.cannon-launch strong { font-size: 16px; font-weight: 950; margin-top: 6px; }.cannon-launch:active { transform: translateY(4px); box-shadow: 0 2px 0 #bd8537; }
.cannon-power { width: 130px; padding: 12px 15px; background: #fffbedeb; border: 1px solid #fff9; border-radius: 16px; box-shadow: 0 5px 18px #254b3710; }
.cannon-power label { display: flex; justify-content: space-between; font-size: 10px; font-weight: 850; margin-bottom: 7px; }.cannon-power strong { color: #9b783f; }.cannon-power input { width: 100%; height: 28px; margin: 0; accent-color: #edb255; cursor: pointer; touch-action: pan-x; }
.cannon-use { min-width: 150px; min-height: 75px; font-size: 15px; }
.cannon-keyboard-hint { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #335b49; background: #fff9; padding: 8px 12px; border-radius: 20px; font-size: 9px; font-weight: 750; white-space: nowrap; pointer-events: none; }.cannon-keyboard-hint span { color: #789172; margin: 0 8px; }
.cannon-message { position: absolute; z-index: 4; left: 50%; bottom: max(77px, calc(env(safe-area-inset-bottom) + 60px)); transform: translateX(-50%); max-width: 48%; margin: 0; padding: 9px 15px; border-radius: 20px; background: #fffbedf0; box-shadow: 0 3px 12px #3154390b; text-align: center; font-size: 11px; line-height: 1.5; font-weight: 800; pointer-events: none; }.cannon-message:empty { display: none; }
.cannon-studio-tools { position: absolute; z-index: 4; right: 28px; top: max(94px, calc(env(safe-area-inset-top) + 72px)); max-width: 370px; padding: 11px; border: 1px solid #fff9; background: #fffbedef; border-radius: 18px; box-shadow: 0 5px 18px #254b3710; }
.cannon-paints { display: flex; align-items: center; justify-content: center; gap: 5px; }.cannon-paint { width: 44px; min-width: 44px; height: 44px; border: 3px solid #fffc; border-radius: 12px; background: var(--paint); box-shadow: 0 2px 4px #56714412; }.cannon-paint span { display: none; color: #28413a; font-size: 17px; }.cannon-paint[aria-pressed='true'] { border-color: #547b5c; }.cannon-paint[aria-pressed='true'] span { display: inline; }.cannon-current-paint { display: block; margin-left: 6px; width: 28px; height: 28px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #b4c4ac; background: #ff7186; }
.cannon-art-actions { display: flex; align-items: center; gap: 5px; margin-top: 8px; }.cannon-small-button, .cannon-shape-label select { min-height: 44px; padding: 7px 9px; font-size: 9px; border-radius: 10px; box-shadow: none; }.cannon-small-button[aria-pressed='true'] { background: #dce9bd; }.cannon-shape-label select { background: #fffbed; border: 1px solid #dce1cd; color: #476148; font-weight: 850; max-width: 87px; }
.cannon-overlay { position: absolute; z-index: 6; inset: 0; padding: max(92px, calc(env(safe-area-inset-top) + 78px)) 28px 25px; display: flex; align-items: center; justify-content: center; background: #e4f1e91f; overflow: auto; touch-action: pan-y; }
.cannon-picker { width: min(1060px, 100%); padding: 24px 30px; border-radius: 28px; background: #fffbedf2; box-shadow: 0 20px 90px #32634b22; text-align: center; }
.cannon-eyebrow { margin: 0 0 10px; color: #87936f; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; font-weight: 900; }.cannon-picker h1 { margin: 0; font-size: clamp(36px, 4vw, 61px); line-height: .98; letter-spacing: -2.5px; font-weight: 950; }.cannon-picker h1 br { display: none; }.cannon-picker h1 em { color: #c38d4a; font-style: normal; }.cannon-picker-intro { margin: 15px 0 22px; font-size: 13px; color: #7b8b6e; }
.cannon-mode-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }.cannon-mode-card { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border: 2px solid #e2e6d5; border-radius: 20px; color: #315544; background: #fffef8; }.cannon-mode-card[aria-pressed='true'] { border-color: #6c9569; box-shadow: 0 0 0 3px #d5e2b755; }.cannon-card-art { position: relative; display: flex; justify-content: center; align-items: center; height: 100px; overflow: hidden; background: #d8edce; }.cannon-card-art i { z-index: 1; font-size: 73px; font-style: normal; color: #daaa53; transform: rotate(-12deg); text-shadow: 0 5px 0 #b4945e44; }.cannon-card-art b { position: absolute; width: 40px; height: 40px; border-radius: 13px; background: #b4d9ad; transform: rotate(-20deg); left: 18%; bottom: -14px; }.cannon-card-art b:nth-of-type(2) { left: auto; right: 17%; width: 59px; height: 59px; bottom: -24px; transform: rotate(16deg); }.cannon-card-art b:nth-of-type(3) { width: 22px; height: 22px; left: 23%; top: 15px; border-radius: 50%; background: #fff5c0; }.cannon-card-splash .cannon-card-art { background: #cbe8e7; }.cannon-card-splash .cannon-card-art i { color: #f08a8b; }.cannon-card-studio .cannon-card-art { background: #e3dbed; }.cannon-card-studio .cannon-card-art i { color: #9c8fc6; }
.cannon-mode-copy { display: grid; gap: 7px; padding: 16px 18px 18px; }.cannon-mode-copy small { color: #96a08a; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .9px; }.cannon-mode-copy strong { font-size: 19px; font-weight: 950; }.cannon-mode-copy > span { font-size: 11px; line-height: 1.65; color: #7c8a71; }.cannon-selected { position: absolute; right: 10px; top: 9px; border-radius: 50%; width: 24px; height: 24px; background: #fffbed; text-align: center; padding-top: 3px; font-weight: 900; opacity: 0; }.cannon-mode-card[aria-pressed='true'] .cannon-selected { opacity: 1; }
.cannon-button { min-height: 48px; padding: 12px 19px; gap: 8px; font-size: 12px; }.cannon-primary { background: #416e52; border-color: #416e52; color: #fff9e6; box-shadow: 0 4px 0 #315c42; }.cannon-start { margin-top: 20px; min-width: 220px; font-size: 14px; }.cannon-quiet { background: transparent; box-shadow: none; border-color: #dce1cc; color: #7a8d6c; }
.cannon-panel { width: min(430px, 100%); padding: 30px; border-radius: 27px; background: #fffbedf8; box-shadow: 0 20px 90px #32634b30; text-align: center; }.cannon-panel-symbol { display: block; font-size: 48px; color: #dbb361; margin-bottom: 16px; }.cannon-panel h2 { margin: 0 0 13px; font-size: 29px; letter-spacing: -1px; font-weight: 950; }.cannon-panel > p:not(.cannon-eyebrow) { color: #839174; font-size: 12px; line-height: 1.7; }.cannon-panel-actions { display: grid; gap: 9px; margin-top: 22px; }.cannon-result-scores { display: flex; justify-content: center; gap: 40px; margin: 22px 0; }.cannon-result-scores small { display: block; font-size: 9px; color: #88977a; }.cannon-result-scores strong { display: block; font-size: 35px; margin-top: 6px; }
.cannon-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cannon-shell:not([data-mode='play']) .cannon-controls, .cannon-shell:not([data-mode='play']) .cannon-keyboard-hint, .cannon-shell:not([data-mode='play']) .cannon-studio-tools, .cannon-shell[data-mode='picker'] .cannon-hud { visibility: hidden; }
.cannon-shell[data-phase='flying'] .cannon-dpad { opacity: .4; pointer-events: none; }
.cannon-message[data-error='true'] { z-index: 9; max-width: 80%; bottom: 20px; color: #854d35; background: #fff7df; }
@media (max-width: 850px) {
  .cannon-studio-tools { top: max(162px, calc(env(safe-area-inset-top) + 140px)); right: 18px; }.cannon-hud { left: 18px; }.cannon-header { left: 18px; right: 18px; }.cannon-directions { left: 18px; }.cannon-launch-controls { right: 18px; }.cannon-keyboard-hint { display: none; }.cannon-message { max-width: 48%; bottom: 165px; }
}
@media (max-width: 600px) {
  .cannon-header { top: max(12px, env(safe-area-inset-top)); left: 14px; right: 14px; }.cannon-brand { gap: 6px; }.cannon-brand-star { font-size: 32px; }.cannon-brand small { font-size: 6px; letter-spacing: 1.7px; }.cannon-brand strong { font-size: 18px; }.cannon-top-button { padding-inline: 10px; font-size: 10px; border-radius: 12px; }
  .cannon-hud { left: 14px; right: 14px; top: max(73px, calc(env(safe-area-inset-top) + 61px)); padding: 10px 13px; gap: 12px; justify-content: space-between; }.cannon-game-title strong { font-size: 12px; }.cannon-game-title small { font-size: 6px; }.cannon-team-score { gap: 7px; font-size: 9px; }.cannon-team-score strong { font-size: 17px; }.cannon-timer { min-width: 49px; padding-left: 11px; font-size: 18px; }.cannon-art-score { font-size: 10px; }
  .cannon-studio-tools { top: max(139px, calc(env(safe-area-inset-top) + 127px)); right: 14px; max-width: calc(100% - 28px); padding: 8px; }.cannon-paint { width: 36px; min-width: 36px; height: 44px; }.cannon-art-actions { gap: 4px; margin-top: 5px; }.cannon-small-button, .cannon-shape-label select { padding-inline: 7px; font-size: 8px; }
  .cannon-directions { left: 14px; }.cannon-dpad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); gap: 5px; }.cannon-touch { border-radius: 14px; font-size: 25px !important; }.cannon-control-caption { font-size: 9px; margin-bottom: 7px; }.cannon-return { font-size: 8px; margin-top: 9px; }
  .cannon-launch-controls { right: 14px; flex-direction: column; gap: 10px; align-items: flex-end; }.cannon-launch { width: 91px; height: 91px; }.cannon-launch > span { font-size: 32px; }.cannon-launch strong { font-size: 13px; margin-top: 3px; }.cannon-power { width: 110px; padding: 8px 11px; }.cannon-power label { font-size: 8px; margin-bottom: 1px; }.cannon-power input { height: 26px; }.cannon-use { min-width: 119px; min-height: 72px; font-size: 12px; }.cannon-controls { bottom: max(18px, env(safe-area-inset-bottom)); }.cannon-message { bottom: 235px; max-width: calc(100% - 44px); font-size: 10px; padding: 8px 12px; }
  .cannon-overlay { padding: 77px 13px 17px; align-items: center; }.cannon-picker { padding: 20px 15px; border-radius: 22px; }.cannon-picker h1 { font-size: 37px; letter-spacing: -1.9px; }.cannon-eyebrow { font-size: 7px; letter-spacing: 1.5px; }.cannon-picker-intro { font-size: 10px; margin: 12px 0 15px; }.cannon-mode-list { grid-template-columns: 1fr; gap: 8px; }.cannon-mode-card { flex-direction: row; border-radius: 14px; }.cannon-card-art { width: 75px; min-width: 75px; height: auto; }.cannon-card-art i { font-size: 48px; }.cannon-card-art b { opacity: .6; }.cannon-mode-copy { padding: 11px 27px 11px 11px; gap: 3px; }.cannon-mode-copy strong { font-size: 15px; }.cannon-mode-copy small { font-size: 6px; }.cannon-mode-copy > span { font-size: 9px; line-height: 1.45; }.cannon-selected { width: 20px; height: 20px; right: 6px; top: 6px; padding-top: 1px; font-size: 13px; }.cannon-start { margin-top: 14px; min-width: 190px; font-size: 12px; }.cannon-panel { padding: 24px; }
}
@media (max-height: 520px) and (min-width: 601px) {
  .cannon-header { top: 10px; }.cannon-hud { top: 65px; padding: 8px 12px; }.cannon-studio-tools { top: 65px; max-width: 330px; padding: 7px; }.cannon-paint { min-width: 34px; width: 34px; }.cannon-art-actions { margin-top: 4px; }.cannon-controls { bottom: 15px; }.cannon-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; }.cannon-launch { width: 83px; height: 83px; }.cannon-launch > span { font-size: 30px; }.cannon-launch strong { font-size: 12px; }.cannon-control-caption { font-size: 9px; margin-bottom: 5px; }.cannon-return { min-height: 44px; margin-top: 7px; font-size: 8px; }.cannon-message { bottom: 132px; font-size: 9px; max-width: 45%; }.cannon-keyboard-hint { display: none; }.cannon-overlay { padding-top: 62px; }.cannon-picker { padding: 15px 22px; }.cannon-picker h1 { font-size: 32px; }.cannon-picker-intro { margin: 8px 0 12px; font-size: 10px; }.cannon-card-art { height: 60px; }.cannon-card-art i { font-size: 48px; }.cannon-mode-copy { padding: 11px 13px; }.cannon-mode-copy strong { font-size: 15px; }.cannon-mode-copy > span { font-size: 9px; }.cannon-start { margin-top: 12px; min-height: 44px; }.cannon-panel { padding: 20px; max-height: calc(100dvh - 78px); overflow: auto; }
}
@media (hover: none) { .cannon-keyboard-hint { display: none; } }
@media (max-width: 600px) { .cannon-paint { width: 44px; min-width: 44px; } }
@media (max-width: 380px) { .cannon-paints { gap: 2px; }.cannon-current-paint { display: none; }.cannon-art-actions { display: grid; grid-template-columns: 1fr 1fr; }.cannon-shape-label select { width: 100%; max-width: none; }.cannon-small-button, .cannon-shape-label select { font-size: 10px; } }
@media (max-height: 520px) and (min-width: 601px) { .cannon-paint { min-width: 44px; width: 44px; }.cannon-current-paint { display: none; }.cannon-paints { gap: 3px; } }
.town-free-roam { width: 100%; margin-top: 11px; min-height: 44px; background: #f0f3df; border-color: #dae0c8; font-size: 10px; }


/* Playground Club: these rules are scoped to its full-window game. */
.playground-shell { position: fixed; inset: 0; z-index: 122; width: 100%; height: 100dvh; overflow: hidden; isolation: isolate; background: #c9eff9; color: #335b49; font-family: inherit; touch-action: none; }
.playground-shell *, .playground-shell *::before, .playground-shell *::after { box-sizing: border-box; }
.playground-shell [hidden] { display: none !important; }
.playground-shell button, .playground-shell select, .playground-shell a { font: inherit; -webkit-tap-highlight-color: transparent; }
.playground-shell button { cursor: pointer; }
.playground-shell button:focus-visible, .playground-shell a:focus-visible, .playground-shell select:focus-visible { outline: 3px solid #e8a43f; outline-offset: 4px; }
.playground-canvas, .playground-vignette { position: absolute; inset: 0; }
.playground-canvas canvas { display: block; width: 100%; height: 100%; outline: none; }
.playground-vignette { pointer-events: none; background: linear-gradient(180deg, #437f5b0b, transparent 24%, transparent 76%, #31594320); }
.playground-header { position: absolute; z-index: 7; top: max(20px, env(safe-area-inset-top)); left: max(24px, env(safe-area-inset-left)); right: max(24px, env(safe-area-inset-right)); display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.playground-brand { display: flex; align-items: center; gap: 10px; filter: drop-shadow(0 2px 0 #fff9dfb3); }
.playground-brand-mark { display: grid; place-items: center; width: 38px; height: 41px; color: #39634e; background: #ffe3a0; border: 2px solid #fff6d9; border-radius: 14px; font-size: 30px; transform: rotate(-9deg); }
.playground-brand > span:last-child { display: grid; gap: 1px; }
.playground-brand small { font-size: 9px; font-weight: 900; letter-spacing: 2.5px; text-transform: uppercase; }
.playground-brand strong { font-size: 25px; line-height: 1.1; letter-spacing: -.8px; font-weight: 950; }
.playground-header nav { display: flex; gap: 8px; pointer-events: auto; }
.playground-top-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 45px; padding: 9px 15px; border: 1px solid #fff9e8; border-radius: 15px; background: #fff8e9f2; box-shadow: 0 3px 0 #3d61452e; color: #3c604b; font-size: 13px !important; font-weight: 900 !important; text-decoration: none; }
.playground-top-button > span { font-size: 20px; line-height: 1; }
.playground-hud { position: absolute; z-index: 3; top: max(87px, calc(env(safe-area-inset-top) + 70px)); left: max(24px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 16px; max-width: min(570px, calc(100% - 190px)); padding: 12px 17px; border: 1px solid #fffbe8; border-radius: 18px; background: #fff8e9ed; box-shadow: 0 5px 20px #315c4420; pointer-events: none; }
.playground-clock { display: grid; gap: 1px; text-align: center; border-right: 1px solid #d9e1c7; padding-right: 16px; }
.playground-clock small { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.playground-clock strong { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.playground-role { display: grid; gap: 4px; min-width: 0; }
.playground-role > strong { font-size: 17px; line-height: 1.1; font-weight: 950; }
.playground-role > span { color: #5b765b; font-size: 13px; line-height: 1.35; font-weight: 800; }
.playground-team-progress { height: 6px; width: 100%; min-width: 140px; overflow: hidden; border-radius: 8px; background: #e4e7cd; }
.playground-team-progress i { display: block; height: 100%; background: #e3b859; border-radius: inherit; transition: width .2s; }
.playground-minimap { position: absolute; z-index: 3; top: max(86px, calc(env(safe-area-inset-top) + 68px)); right: max(24px, env(safe-area-inset-right)); width: 124px; height: 124px; border-radius: 18px; box-shadow: 0 5px 18px #31594427; pointer-events: none; }
.playground-overlay { position: absolute; z-index: 6; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding: 91px max(26px, env(safe-area-inset-right)) 24px max(26px, env(safe-area-inset-left)); pointer-events: none; }
.playground-picker { width: 421px; max-height: calc(100dvh - 115px); padding: 23px; overflow: auto; border: 1px solid #fff9e9; border-radius: 27px; background: #fff9e9; box-shadow: 0 7px 0 #3f674b2b, 0 20px 65px #315b4538; pointer-events: auto; touch-action: pan-y; scrollbar-width: thin; }
.playground-eyebrow { margin: 0 0 7px; color: #778667; font-size: 9px; font-weight: 900; letter-spacing: 1.3px; text-transform: uppercase; }
.playground-picker h1 { margin: 0; color: #385e46; font-size: 35px; line-height: 1.05; font-weight: 950; letter-spacing: -1px; }
.playground-intro { margin: 9px 0 17px; color: #63775a; font-size: 14px; line-height: 1.45; font-weight: 650; }
.playground-game-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.playground-game { position: relative; display: grid; grid-template-columns: 43px 1fr; gap: 3px 9px; align-items: center; min-height: 81px; padding: 12px 9px; border: 1px solid #dce4cd; border-radius: 16px; background: #f4f6e8; color: #49674e; text-align: left; }
.playground-game[aria-pressed='true'] { border-color: #7fa984; background: #e7eed6; box-shadow: 0 0 0 2px #8aae8438; }
.playground-game strong { align-self: end; font-size: 14px; line-height: 1.2; font-weight: 900; }
.playground-game small { grid-column: 2; align-self: start; color: #6c7b62; font-size: 10px; line-height: 1.3; font-weight: 750; }
.playground-game-art { position: relative; grid-column: 1; grid-row: 1 / 3; width: 43px; height: 48px; border-radius: 14px; background: #f8d18c; overflow: hidden; box-shadow: inset 0 -4px #c6a36c26; }
.playground-game-art i { position: absolute; z-index: 2; left: 8px; top: 4px; font-size: 25px; font-style: normal; color: #fff7dd; text-shadow: 0 2px #af8c6240; }
.playground-game-art b, .playground-game-art em { position: absolute; width: 22px; height: 18px; border-radius: 10px; background: #e5a757; bottom: -2px; right: -2px; }
.playground-game-art em { width: 16px; height: 13px; bottom: -3px; right: 16px; background: #f4e7c8; }
.playground-game-goo .playground-game-art { background: #bb9cdb; }.playground-game-goo .playground-game-art b { background: #9675be; }
.playground-game-freeze .playground-game-art { background: #9ed9e9; }.playground-game-freeze .playground-game-art i { color: #f9ebee; }.playground-game-freeze .playground-game-art b { background: #7cbfd8; }
.playground-game-stars .playground-game-art { background: #edc46b; }.playground-game-stars .playground-game-art i { color: #fff4be; }
.playground-picker-label { margin: 20px 0 10px; font-size: 15px; font-weight: 900; }
.playground-map-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.playground-map { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 49px; padding: 7px 8px; border: 1px solid #dde3cd; border-radius: 13px; background: #f5f5e7; color: #5a7257; }
.playground-map > span { font-size: 23px; color: #85a871; line-height: 1; }.playground-map strong { font-size: 12px; font-weight: 900; }
.playground-map-ruins > span { color: #a291b8; }.playground-map-winter > span { color: #8ab6cf; }
.playground-map[aria-pressed='true'] { background: #e7edda; border-color: #94b18d; box-shadow: 0 0 0 1px #a8bfa44d; }
.playground-picker-footer { position: sticky; bottom: -23px; margin: 15px -3px -3px; padding: 0 3px 3px; background: #fff9e9; }
.playground-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.playground-options label { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 850; }
.playground-options select { min-height: 38px; padding: 5px 28px 5px 10px; border: 1px solid #dce3cd; border-radius: 10px; background: #f2f4e4; color: #546e51; font-size: 12px; font-weight: 800; }
.playground-options > span { display: grid; gap: 2px; text-align: right; font-size: 11px; font-weight: 850; }.playground-options small { font-size: 9px; font-weight: 650; color: #899278; }
.playground-game-tip { min-height: 37px; margin: 12px 0; color: #71805f; font-size: 12px; font-weight: 700; line-height: 1.5; }
.playground-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 49px; padding: 11px 19px; border: 1px solid #d8dfc6; border-radius: 14px; background: #f2f2df; color: #4a674a; font-size: 14px !important; line-height: 1.2; font-weight: 900 !important; box-shadow: 0 3px 0 #385e4521; text-decoration: none; }
.playground-primary { width: 100%; border-color: #e5ba70; background: #f5ce87; color: #69532b; box-shadow: 0 4px 0 #b9985f48; }
.playground-primary > span { font-size: 23px; line-height: 1; }.playground-quiet { border-color: transparent; background: transparent; box-shadow: none; color: #758268; }
.playground-controls { position: absolute; z-index: 4; bottom: max(24px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
.playground-dpad { left: max(24px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(3, 57px); grid-template-rows: repeat(2, 57px); gap: 7px; }
.playground-up { grid-column: 2; }.playground-left { grid-row: 2; grid-column: 1; }.playground-down { grid-row: 2; grid-column: 2; }.playground-right { grid-row: 2; grid-column: 3; }
.playground-touch { display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #fffae9; border-radius: 18px; background: #fff8e9f2; box-shadow: 0 4px 0 #3e614455, 0 8px 24px #315b4521; color: #42654d; font-size: 31px !important; font-weight: 900 !important; touch-action: none; -webkit-touch-callout: none; }
.playground-held, .playground-touch:active { transform: translateY(3px); background: #e5eccf; box-shadow: 0 1px 0 #3e614455; }
.playground-abilities { right: max(24px, env(safe-area-inset-right)); display: flex; align-items: flex-end; gap: 10px; }
.playground-abilities .playground-touch { display: flex; flex-direction: column; gap: 4px; min-width: 77px; min-height: 86px; padding: 9px 13px; }
.playground-abilities .playground-touch > span { font-size: 28px; line-height: 1; }.playground-abilities .playground-touch strong { font-size: 14px; line-height: 1.2; font-weight: 950; }.playground-abilities .playground-touch small { font-size: 9px; line-height: 1.2; font-weight: 800; opacity: .75; }
.playground-jump { background: #f9e5b1f2; }.playground-boost { background: #e2eacff2; }.playground-ready { border-color: #f9f5c2; }
.playground-help { min-width: 157px !important; background: #f8dce5 !important; color: #a35d7c; }
.playground-keyboard-hint { position: absolute; bottom: 10px; left: 50%; width: max-content; max-width: 42%; margin: 0; transform: translateX(-50%); text-align: center; color: #fff8e2; text-shadow: 0 1px 3px #315b3f; font-size: 9px; font-weight: 900; pointer-events: none; }
.playground-message { position: absolute; z-index: 5; bottom: max(161px, calc(env(safe-area-inset-bottom) + 139px)); left: 50%; width: max-content; max-width: min(590px, 80%); margin: 0; padding: 9px 17px; transform: translateX(-50%); border: 1px solid #fff9e4; border-radius: 22px; background: #fff8eaf2; box-shadow: 0 3px 18px #315b4520; color: #587150; font-size: 13px; line-height: 1.45; text-align: center; font-weight: 850; pointer-events: none; }
.playground-message:empty { display: none; }.playground-message[data-error='true'] { z-index: 9; background: #fff3d7; color: #875c30; }
.playground-countdown { position: absolute; z-index: 5; left: 50%; top: 40%; display: grid; place-items: center; width: 95px; height: 95px; transform: translate(-50%, -50%); border: 3px solid #fff7d8; border-radius: 30px; background: #f5ce87e8; box-shadow: 0 7px 0 #59794e32; color: #756039; font-size: 51px; font-weight: 950; pointer-events: none; }
.playground-shell[data-phase='picker'] .playground-hud, .playground-shell[data-phase='picker'] .playground-minimap, .playground-shell[data-phase='picker'] .playground-controls, .playground-shell[data-phase='picker'] .playground-message:not([data-error='true']), .playground-shell[data-phase='picker'] .playground-keyboard-hint { visibility: hidden; }
.playground-shell[data-phase='paused'] .playground-controls, .playground-shell[data-phase='results'] .playground-controls, .playground-shell[data-phase='paused'] .playground-keyboard-hint, .playground-shell[data-phase='results'] .playground-keyboard-hint { visibility: hidden; }
.playground-shell[data-frozen='true'] .playground-ability, .playground-shell[data-frozen='true'] .playground-dpad { visibility: hidden; }
.playground-shell[data-phase='paused'] .playground-overlay, .playground-shell[data-phase='results'] .playground-overlay { justify-content: center; padding: 85px 20px 24px; background: #315b4545; backdrop-filter: blur(4px); }
.playground-pause { width: min(410px, 100%); max-height: calc(100dvh - 110px); overflow: auto; padding: 28px; border: 1px solid #fff9e8; border-radius: 26px; background: #fff9e9; box-shadow: 0 7px 0 #315b4530, 0 20px 55px #315b4540; text-align: center; pointer-events: auto; touch-action: pan-y; }
.playground-pause h2 { margin: 9px 0 13px; color: #416048; font-size: 34px; line-height: 1.05; font-weight: 950; letter-spacing: -.7px; }
.playground-pause-copy { margin: 0 auto 20px; max-width: 31ch; color: #7b886b; font-size: 14px; line-height: 1.55; font-weight: 650; }
.playground-pause-actions { display: grid; gap: 10px; }.playground-pause-actions .playground-button { width: 100%; }
.playground-result-badge { display: grid; place-items: center; width: 77px; height: 77px; margin: 0 auto 22px; border-radius: 25px; background: #f5e8b9; color: #d4a84f; font-size: 44px; }.playground-result-again { background: #e9edda; color: #8fa87e; }
.playground-result-number { display: grid; gap: 3px; margin-bottom: 23px; color: #7e8a69; font-size: 12px; font-weight: 800; }.playground-result-number > strong { font-size: 48px; line-height: 1.1; color: #ba984b; }.playground-result-number strong small { font-size: 24px; color: #b9b394; }.playground-result-number p { margin: 8px 0 0; font-size: 13px; }
@media (max-width: 650px) {
 .playground-header { top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); gap: 8px; }.playground-brand { gap: 7px; }.playground-brand-mark { width: 29px; height: 33px; border-radius: 10px; font-size: 23px; }.playground-brand small { font-size: 7px; letter-spacing: 1.8px; }.playground-brand strong { font-size: 20px; }.playground-header nav { gap: 5px; }.playground-top-button { padding: 8px 10px; min-height: 44px; font-size: 11px !important; border-radius: 12px; gap: 4px; }
 .playground-hud { top: max(72px, calc(env(safe-area-inset-top) + 58px)); left: 14px; max-width: calc(100% - 122px); padding: 10px 12px; gap: 10px; border-radius: 15px; }.playground-clock { padding-right: 10px; }.playground-clock strong { font-size: 24px; }.playground-clock small { font-size: 8px; }.playground-role > strong { font-size: 13px; }.playground-role > span { font-size: 10px; }.playground-minimap { top: max(73px, calc(env(safe-area-inset-top) + 59px)); right: 14px; width: 84px; height: 84px; border-radius: 13px; }.playground-team-progress { min-width: 90px; height: 5px; }
 .playground-overlay { padding: 72px 14px 17px; align-items: center; justify-content: center; }.playground-picker { max-height: calc(100dvh - 89px); width: min(390px, 100%); padding: 20px; }.playground-picker h1 { font-size: 31px; }.playground-eyebrow { font-size: 8px; }.playground-intro { font-size: 12px; margin-bottom: 14px; }.playground-game { min-height: 76px; grid-template-columns: 37px 1fr; padding: 9px 7px; gap: 3px 7px; }.playground-game strong { font-size: 12px; }.playground-game small { font-size: 9px; }.playground-game-art { width: 37px; height: 44px; }.playground-game-art i { left: 6px; }.playground-picker-label { margin-top: 17px; font-size: 13px; }.playground-map { min-height: 45px; gap: 5px; }.playground-map strong { font-size: 11px; }.playground-map > span { font-size: 21px; }.playground-picker-footer { bottom: -20px; }.playground-game-tip { font-size: 11px; }
 .playground-controls { bottom: max(21px, env(safe-area-inset-bottom)); }.playground-dpad { left: 14px; grid-template-columns: repeat(3, 49px); grid-template-rows: repeat(2, 49px); gap: 6px; }.playground-touch { border-radius: 15px; font-size: 28px !important; }.playground-abilities { right: 14px; gap: 7px; }.playground-abilities .playground-touch { min-width: 65px; min-height: 78px; padding: 9px 10px; }.playground-abilities .playground-touch strong { font-size: 12px; }.playground-abilities .playground-touch > span { font-size: 25px; }.playground-help { min-width: 137px !important; }.playground-keyboard-hint { display: none; }.playground-message { bottom: max(143px, calc(env(safe-area-inset-bottom) + 122px)); max-width: 86%; font-size: 11px; padding: 8px 13px; }.playground-pause { padding: 24px; }.playground-pause h2 { font-size: 30px; }
}
@media (max-height: 560px) and (min-width: 651px) {
 .playground-header { top: 12px; left: 16px; right: 16px; }.playground-brand strong { font-size: 20px; }.playground-brand small { font-size: 7px; }.playground-brand-mark { width: 30px; height: 33px; font-size: 23px; }.playground-top-button { min-height: 44px; padding: 8px 12px; }
 .playground-hud { top: 65px; left: 16px; padding: 8px 12px; }.playground-clock strong { font-size: 23px; }.playground-role > strong { font-size: 14px; }.playground-role > span { font-size: 11px; }.playground-minimap { width: 88px; height: 88px; top: 64px; right: 16px; }
 .playground-overlay { padding: 64px 16px 14px; }.playground-picker { width: 390px; max-height: calc(100dvh - 78px); padding: 17px; }.playground-picker h1 { font-size: 27px; }.playground-intro { margin: 7px 0 11px; font-size: 11px; }.playground-game { min-height: 67px; }.playground-picker-label { margin-top: 13px; }.playground-picker-footer { bottom: -17px; }.playground-map { min-height: 44px; }.playground-game-tip { margin: 8px 0; font-size: 10px; }.playground-options { margin-top: 0; }
 .playground-controls { bottom: 16px; }.playground-dpad { left: 16px; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 5px; }.playground-abilities { right: 16px; }.playground-abilities .playground-touch { min-width: 66px; min-height: 75px; }.playground-message { bottom: 116px; font-size: 11px; max-width: 60%; }.playground-keyboard-hint { bottom: 5px; font-size: 8px; }.playground-pause { max-height: calc(100dvh - 75px); padding: 20px; }.playground-pause h2 { font-size: 28px; }.playground-pause-copy { margin-bottom: 13px; }.playground-result-badge { width: 57px; height: 57px; font-size: 33px; margin-bottom: 13px; }
}
@media (max-width: 370px) { .playground-brand-mark { display: none; }.playground-brand strong { font-size: 19px; }.playground-game { grid-template-columns: 1fr; text-align: center; gap: 5px; }.playground-game-art { display: none; }.playground-game small { grid-column: 1; }.playground-dpad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); }.playground-abilities .playground-touch { min-width: 60px; }.playground-role > span { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { .playground-team-progress i { transition: none; } }

@media (max-height: 700px) {
 .playground-picker .playground-intro, .playground-picker .playground-game-tip { display: none; }.playground-picker h1 { margin-bottom: 15px; }.playground-picker .playground-game { min-height: 72px; }.playground-picker .playground-picker-label { margin: 14px 0 9px; }.playground-picker .playground-picker-footer { display: grid; gap: 10px; margin-top: 12px; }.playground-picker .playground-map { min-height: 43px; }
}

/* Letter Studio: a real drawing surface with separate watched and earned paths. */
.letter-page { width: 100%; max-width: 1120px; margin-inline: auto; padding-bottom: 24px; }
.letter-page [hidden] { display: none !important; }
.letter-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 25px; }
.letter-back { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 10px; color: #59715d; font-size: 14px; }
.letter-back:hover { color: #27583e; }
.letter-eyebrow { color: #71826b; font-size: 10px; font-weight: 1000; line-height: 1.4; letter-spacing: .13em; text-transform: uppercase; }
.letter-header h1 { margin: 5px 0 8px; color: #204b38; font-size: clamp(31px, 4vw, 44px); font-weight: 1000; line-height: 1.1; letter-spacing: -.045em; }
.letter-intro { color: #667661; font-size: 15px; line-height: 1.5; }
.letter-saved-count { flex: none; padding: 11px 15px; border: 1px solid #dde5d0; border-radius: 999px; background: #f0f4e6; color: #5e7757; font-size: 12px; }
.letter-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); align-items: start; gap: 25px; }
.letter-workspace { min-width: 0; padding: 24px; border: 1px solid #dce5d5; border-radius: 26px; background: #fffef9; box-shadow: 0 5px 0 #e7eadf, 0 14px 28px #2c512410; }
.letter-workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.letter-workspace-heading h2 { margin-top: 4px; color: #275442; font-size: 25px; font-weight: 1000; line-height: 1.2; letter-spacing: -.035em; }
.letter-workspace-heading h2 [data-letter-current] { display: inline-block; min-width: 20px; color: #4f896b; }
.letter-glyph { display: block; width: 36px; height: 36px; overflow: visible; }
.letter-workspace-heading h2 [data-letter-current] { width: 28px; height: 30px; vertical-align: -7px; }
.letter-workspace-heading h2 .letter-glyph { width: 100%; height: 100%; }
.letter-stroke-count { flex: none; padding: 8px 11px; border-radius: 10px; background: #eef4e7; color: #65815c; font-size: 11px; }
.letter-instruction { min-height: 47px; margin: 14px 0; color: #62745f; font-size: 14px; line-height: 1.55; }
.letter-board-frame { width: min(100%, 500px, var(--letter-board-limit, 500px)); margin-inline: auto; overflow: hidden; border: 1px solid #e5e5d5; border-radius: 21px; background: #fffdf5; box-shadow: inset 0 0 0 5px #faf8ee; }
.letter-board { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: inherit; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.letter-board:focus-visible { outline-offset: -5px; }
.letter-progress-row { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.letter-progress-row label { flex: none; color: #738169; font-size: 11px; }
.letter-progress-row label span { display: inline-block; min-width: 33px; margin-left: 7px; color: #467558; }
.letter-progress-row progress { appearance: none; display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; background: #e9eedf; }
.letter-progress-row progress::-webkit-progress-bar { border-radius: 999px; background: #e9eedf; }
.letter-progress-row progress::-webkit-progress-value { border-radius: 999px; background: #87ad77; }
.letter-progress-row progress::-moz-progress-bar { border-radius: 999px; background: #87ad77; }
.letter-feedback { min-height: 46px; margin-top: 13px; color: #68775f; font-size: 13px; line-height: 1.55; }
.letter-feedback[data-tone="success"] { color: #397451; }
.letter-feedback[data-tone="retry"] { color: #8a6b4c; }
.letter-primary-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 13px; }
.letter-button { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 15px; border: 1px solid #dbe3d1; border-radius: 14px; background: #f8faef; color: #4c6c4c; font-size: 13px; font-weight: 900; line-height: 1.3; }
.letter-button:hover:not(:disabled) { background: #edf4e4; border-color: #b8cbaa; }
.letter-button-primary { border-color: #37694d; background: #37694d; color: #fffbed; box-shadow: 0 3px 0 #24523a; }
.letter-button-primary:hover:not(:disabled) { border-color: #2c5d42; background: #2c5d42; }
.letter-button:disabled { opacity: .48; box-shadow: none; }
.letter-button-watch > span { font-size: 19px; }
.letter-secondary-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; color: #acb69e; }
.letter-text-button { min-height: 44px; padding: 8px 5px; border: 0; border-radius: 8px; background: transparent; color: #718065; font-size: 12px; }
.letter-text-button:hover:not(:disabled) { color: #315f42; }
.letter-text-button:disabled { opacity: .48; }
.letter-board-help { margin-top: 8px; color: #8a927c; font-size: 10px; line-height: 1.6; text-align: center; }
.letter-sidebar { display: grid; gap: 22px; min-width: 0; }
.letter-guide { display: flex; align-items: flex-end; gap: 5px; padding: 23px 15px 0; overflow: hidden; border: 1px solid #dae4cf; border-radius: 25px; background: linear-gradient(130deg, #eef2dc, #e2eddc); }
.letter-guide img { width: 44%; max-width: 155px; height: 202px; flex: none; object-fit: contain; object-position: center bottom; }
.letter-guide > div { align-self: center; min-width: 0; padding-bottom: 20px; }
.letter-guide .letter-eyebrow { color: #7d8d6e; font-size: 8px; letter-spacing: .1em; }
.letter-guide h2 { margin-top: 8px; color: #3c6548; font-size: 23px; font-weight: 1000; line-height: 1.15; letter-spacing: -.04em; }
.letter-guide p:last-child { margin-top: 11px; color: #728267; font-size: 11px; line-height: 1.6; }
.letter-collection { min-width: 0; padding: 22px; border: 1px solid #dfe5d6; border-radius: 24px; background: #fffef9; }
.letter-collection > h2 { color: #3a6046; font-size: 18px; font-weight: 1000; letter-spacing: -.02em; }
.letter-case-switch { display: flex; gap: 6px; margin: 15px 0 12px; padding: 4px; border-radius: 13px; background: #f0f3e8; }
.letter-case { display: grid; flex: 1; gap: 2px; align-content: center; min-width: 0; min-height: 54px; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #849075; font-size: 10px; }
.letter-case > span { color: #688164; font-size: 18px; font-weight: 1000; }
.letter-case[aria-pressed="true"] { border-color: #d7e1c9; background: #fffef8; color: #53754b; box-shadow: 0 2px 4px #2949200b; }
.letter-picker { margin-top: 5px; }
.letter-picker > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 0; border-radius: 7px; color: #667b5c; font-size: 12px; list-style: none; cursor: pointer; }
.letter-picker > summary::-webkit-details-marker { display: none; }
.letter-picker[open] > summary span { transform: rotate(180deg); }
.letter-alphabet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 7px 0 8px; }
.letter-choice { position: relative; display: grid; place-items: center; min-width: 0; min-height: 47px; padding: 6px; border: 1px solid #e2e7d8; border-radius: 11px; background: #f8faef; color: #78926a; font-family: Nunito, system-ui, sans-serif; font-size: 24px; font-weight: 800; line-height: 1; }
.letter-choice:hover { border-color: #a8c398; background: #f0f6e6; }
.letter-choice[aria-pressed="true"] { border-color: #83a66f; background: #eaf2d8; color: #3e6a43; box-shadow: 0 0 0 2px #eaf2d8; }
.letter-choice i { position: absolute; top: 4px; right: 4px; color: #6a9b54; font-size: 9px; font-style: normal; }
.letter-collection-note { margin-top: 13px; color: #8a947f; font-size: 10px; line-height: 1.6; }
@media (min-width: 901px) { .letter-picker:not([open]) .letter-alphabet { display: none; } }
@media (max-width: 900px) {
  .letter-layout { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 18px; }
  .letter-workspace { padding: 19px; }
  .letter-guide { display: grid; justify-items: center; gap: 0; padding: 20px 15px 0; text-align: center; }
  .letter-guide img { grid-row: 2; width: 136px; height: 155px; }
  .letter-guide > div { padding-bottom: 7px; }
  .letter-guide h2 br { display: none; }
  .letter-guide h2 { font-size: 22px; }
  .letter-guide p:last-child { font-size: 11px; }
  .letter-collection { padding: 17px; }
  .letter-alphabet { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .letter-workspace-heading { flex-wrap: wrap; gap: 9px; }
  .letter-primary-actions { flex-wrap: wrap; }
  .letter-button { min-width: 130px; }
}
@media (max-width: 650px) {
  .letter-header { align-items: flex-start; gap: 10px; margin-bottom: 17px; }
  .letter-header h1 { font-size: 32px; }
  .letter-back { min-height: 40px; margin-bottom: 8px; font-size: 12px; }
  .letter-header .letter-eyebrow { font-size: 8px; }
  .letter-intro { max-width: 230px; font-size: 12px; }
  .letter-saved-count { max-width: 98px; margin-top: 45px; padding: 9px 11px; border-radius: 13px; font-size: 10px; text-align: center; }
  .letter-layout { display: flex; flex-direction: column; gap: 17px; }
  .letter-sidebar { display: contents; }
  .letter-guide { order: -1; display: flex; align-items: center; width: 100%; gap: 17px; padding: 10px 16px 0; border-radius: 20px; text-align: left; }
  .letter-guide img { order: 1; width: 74px; height: 103px; margin-left: auto; }
  .letter-guide > div { padding-bottom: 11px; }
  .letter-guide .letter-eyebrow { font-size: 8px; }
  .letter-guide h2 { max-width: 200px; margin-top: 6px; font-size: 21px; }
  .letter-guide p:last-child { display: none; }
  .letter-workspace { width: 100%; padding: 17px; border-radius: 22px; }
  .letter-workspace-heading { flex-wrap: nowrap; }
  .letter-workspace-heading h2 { font-size: 23px; }
  .letter-workspace-heading .letter-eyebrow { font-size: 8px; }
  .letter-stroke-count { padding: 8px 9px; font-size: 10px; }
  .letter-instruction { min-height: 40px; margin: 12px 0; font-size: 12px; }
  .letter-board-frame { border-radius: 17px; }
  .letter-progress-row { margin-top: 13px; gap: 12px; }
  .letter-feedback { min-height: 44px; font-size: 12px; }
  .letter-primary-actions { gap: 8px; }
  .letter-button { min-width: 0; min-height: 48px; padding: 11px 8px; font-size: 11px; }
  .letter-button-watch > span { font-size: 17px; }
  .letter-board-help { font-size: 9px; }
  .letter-collection { width: 100%; padding: 19px; border-radius: 20px; }
  .letter-alphabet { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
  .letter-choice { min-height: 46px; font-size: 25px; }
}
@media (max-width: 360px) {
  .letter-header h1 { font-size: 29px; }
  .letter-saved-count { max-width: 86px; padding: 8px; }
  .letter-workspace { padding: 13px; }
  .letter-workspace-heading h2 { font-size: 21px; }
  .letter-guide { gap: 8px; }
  .letter-guide h2 { font-size: 19px; }
  .letter-alphabet { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Keep the whole drawing and its actions together on laptop/tablet landscape. */
@media (max-height: 1000px) and (min-width: 651px) {
  .letter-page { padding-bottom: 12px; }
  .letter-header { align-items: center; min-height: 40px; margin-bottom: 12px; gap: 15px; }
  .letter-header > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
  .letter-header .letter-eyebrow, .letter-header .letter-intro { display: none; }
  .letter-back { min-height: 40px; margin-bottom: 0; font-size: 12px; }
  .letter-header h1 { margin: 0; font-size: 29px; }
  .letter-saved-count { padding: 9px 12px; font-size: 11px; }
  .letter-layout { grid-template-columns: minmax(0, 1fr) 244px; gap: 18px; }
  .letter-workspace { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(172px, .65fr); align-items: center; column-gap: 18px; row-gap: 9px; padding: 14px; border-radius: 23px; }
  .letter-board-frame { grid-column: 1; grid-row: 1 / 7; align-self: center; }
  .letter-workspace-heading { grid-column: 2; grid-row: 1; align-items: flex-start; flex-wrap: wrap; gap: 7px; }
  .letter-workspace-heading .letter-eyebrow { font-size: 8px; }
  .letter-workspace-heading h2 { margin-top: 2px; font-size: 22px; }
  .letter-stroke-count { padding: 6px 8px; font-size: 10px; }
  .letter-instruction { grid-column: 2; grid-row: 2; min-height: 0; margin: 0; font-size: 12px; line-height: 1.5; }
  .letter-progress-row { grid-column: 2; grid-row: 3; flex-wrap: wrap; gap: 6px; margin: 0; }
  .letter-progress-row label { font-size: 10px; }
  .letter-progress-row progress { flex-basis: 100%; height: 6px; }
  .letter-feedback { grid-column: 2; grid-row: 4; min-height: 0; margin: 0; font-size: 12px; line-height: 1.5; }
  .letter-primary-actions { grid-column: 2; grid-row: 5; flex-wrap: nowrap; gap: 7px; margin: 0; }
  .letter-button { min-width: 0; min-height: 46px; padding: 10px 7px; font-size: 11px; }
  .letter-button-watch > span { font-size: 16px; }
  .letter-secondary-actions { grid-column: 2; grid-row: 6; flex-wrap: nowrap; gap: 8px; margin: 0; }
  .letter-text-button { min-height: 42px; padding: 7px 3px; font-size: 11px; }
  .letter-board-help { grid-column: 1 / -1; grid-row: 7; margin: 0; font-size: 9px; text-align: left; }
  .letter-sidebar { gap: 15px; }
  .letter-guide { display: flex; align-items: flex-end; gap: 2px; padding: 16px 10px 0; text-align: left; }
  .letter-guide img { width: 99px; height: 144px; }
  .letter-guide > div { padding-bottom: 14px; }
  .letter-guide h2 { font-size: 19px; }
  .letter-guide p:last-child { display: none; }
  .letter-collection { padding: 17px; }
}
@media (max-height: 1000px) and (min-width: 651px) and (max-width: 1040px) {
  .letter-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .letter-workspace { grid-template-columns: minmax(240px, 1fr) minmax(190px, .72fr); }
  .letter-sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .letter-guide { min-height: 170px; }
  .letter-guide img { width: 120px; height: 155px; }
}
/* On a phone the optional guide and letter collection follow the activity. */
@media (max-width: 650px) and (max-height: 1000px) {
  .letter-header { min-height: 40px; align-items: center; margin-bottom: 10px; }
  .letter-header > div { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .letter-header .letter-eyebrow, .letter-header .letter-intro { display: none; }
  .letter-back { min-height: 28px; margin-bottom: 0; padding-block: 2px; font-size: 11px; }
  .letter-header h1 { margin: 0; font-size: 27px; }
  .letter-saved-count { max-width: 96px; margin-top: 0; padding: 8px 10px; font-size: 10px; }
  .letter-workspace { order: 0; padding: 13px; }
  .letter-guide { order: 1; }
  .letter-collection { order: 2; }
  .letter-workspace-heading h2 { font-size: 21px; }
  .letter-workspace-heading h2 [data-letter-current] { height: 27px; width: 24px; vertical-align: -6px; }
  .letter-stroke-count { padding: 6px 8px; }
  .letter-instruction { min-height: 0; margin: 8px 0; font-size: 12px; line-height: 1.45; }
  .letter-progress-row { margin-top: 9px; }
  .letter-feedback { min-height: 0; margin-top: 9px; font-size: 12px; line-height: 1.45; }
  .letter-primary-actions { margin-top: 10px; }
  .letter-secondary-actions { margin-top: 4px; }
  .letter-text-button { min-height: 40px; }
  .letter-board-help { display: none; }
}

.startup-panel{max-width:640px;margin:clamp(24px,8vh,90px) auto;padding:clamp(22px,4vw,36px);text-align:center}
.startup-panel h1,.startup-panel h2{margin:0 0 14px;color:#244f3e;font-size:clamp(25px,4vw,36px);line-height:1.2}
.startup-panel p{max-width:43ch;margin:12px auto;color:#536b59;font-size:16px;line-height:1.65}
.startup-panel .startup-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:22px}
.startup-panel button,.startup-panel .button{min-width:44px;min-height:46px;margin:6px;font:inherit;font-weight:800}
.startup-panel [hidden]{display:none!important}
#offline-game{min-height:46px;text-align:left}
.offline-status{grid-column:1/-1;margin:4px 9px 9px;color:#536b59;font-size:13px;line-height:1.5;white-space:normal}
.pwa-update-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: auto;
  padding: clamp(20px, 5vw, 30px);
  border: 1px solid #fff;
  border-radius: 24px;
  background: #fffdf4;
  color: #214d3d;
  box-shadow: 0 22px 80px #102e384a;
}
.pwa-update-dialog::backdrop { background: #123e367d; backdrop-filter: blur(3px); }
.pwa-update-content h2 { margin: 0 0 14px; font-size: clamp(24px, 5vw, 30px); line-height: 1.2; }
.pwa-update-content p { font-size: 16px; line-height: 1.6; }
.pwa-update-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pwa-update-actions .button { flex: 1 1 160px; min-height: 48px; padding: 12px 16px; }
#pwa-update-accept { background: #275e46; border-color: #275e46; color: #fffdeb; }
#pwa-update-notice { padding: 10px 12px; border-radius: 12px; background: #fff0c9; color: #644623; }

.class-entry .class-entry-mascot { display: block; height: 88px; width: 88px; object-fit: contain; object-position: center bottom; border-radius: 50%; background: #e6f0d9; }
.class-code-form { display: grid; gap: 8px; max-width: 24rem; }
.class-code-form label { color: var(--deep); font-weight: 900; }
.class-code-form input { min-width: 0; width: 100%; box-sizing: border-box; border: 1px solid #96b69f; border-radius: 12px; background: #fff; padding: 12px; font: inherit; letter-spacing: .08em; text-transform: uppercase; }
.class-scan { border-top: 1px solid #d1decc; margin-top: 18px; padding-top: 16px; }
.class-scan video { display: block; width: 100%; max-height: 260px; margin-top: 12px; border-radius: 12px; background: #193d37; }
.class-scan-status:empty { display: none; }
.invite-pass { display: grid; justify-items: center; gap: 3px; text-align: center; border: 1px solid #bfd4be; border-radius: 16px; padding: 12px; }
.invite-qr { width: min(190px, 100%); }
.invite-qr svg { display: block; width: 100%; height: auto; }
.invite-code { font-family: ui-monospace, monospace; font-size: clamp(18px, 5vw, 23px); color: var(--deep); letter-spacing: .04em; }
.invite-result [data-print-invitation] { margin-block: 8px; }
@media print {
  body:has(dialog[open] .invite-pass) > :not(dialog) { display: none !important; }
  body:has(dialog[open] .invite-pass) dialog { display: block !important; position: static; height: auto; max-height: none; width: 90mm; border: 0; box-shadow: none; }
  body:has(dialog[open] .invite-pass) dialog *:not(:has(.invite-pass), .invite-pass, .invite-pass *) { display: none !important; }
  body:has(dialog[open] .invite-pass) .invite-qr { width: 46mm; }
}
[data-school-google]:not([hidden]) { margin-top: 18px; border-top: 1px solid #d1decc; padding-top: 16px; }
[data-school-google] p { margin: 8px 0 0; }

/* Learner garden and illustrated Philippine wildlife guide. */
.hero.garden-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  align-items: stretch;
  background: linear-gradient(90deg, #eff4db 5%, #eff4dbf5 29%, #eff4db88 48%, transparent 68%),
    url('./assets/garden-wildlife/forest-garden.webp') center 56% / cover no-repeat #dfead0;
}
.garden-hero .hero-content { max-width: none; align-self: center; }
.garden-explore { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.garden-explore .garden-water-link { background: #e5f4ec; border-color: #96bca9; color: #174b40; }
.garden-guide-link { min-height: 40px; padding: 4px 0; color: #204f3b; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 850; }
.garden-companion { display: grid; grid-template-rows: minmax(0, 1fr) auto; align-self: end; justify-items: center; gap: 4px; padding: 12px 16px; color: var(--deep); background: none; border: 0; }
.garden-companion .wildlife-portrait { width: 100%; max-width: 400px; height: clamp(170px, 19vw, 248px); filter: drop-shadow(0 4px 4px #263c3438); }
.garden-companion > span { display: grid; padding: 6px 16px; background: #fffbed; border: 1px solid #c8d1ad; border-radius: 14px; font-size: 12px; line-height: 1.3; }
.garden-companion strong { font-size: 18px; }
.wildlife-portrait, .island-builder .wildlife-portrait { width: 100%; height: 100%; object-fit: contain; display: block; }
.avatar > .wildlife-portrait, .wildlife-look-icon .wildlife-portrait { border-radius: inherit; }
.tile-wildlife-portrait { width: 1.65em; height: 1.65em; max-width: 100%; object-fit: contain; display: block; }
.look-icon.wildlife-look-icon { width: 100%; height: 74px; padding: 4px; }
.wildlife-guide { margin-top: 32px; }
#wildlife-title { scroll-margin-top: 20px; }
.wildlife-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.wildlife-card { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 8px 8px 12px; background: #fffef6; border: 1px solid var(--line); border-radius: 18px; text-align: left; color: var(--deep); }
.wildlife-card:hover, .garden-companion:hover > span { border-color: #658855; }
.wildlife-card strong, .wildlife-card-note { padding-inline: 4px; }
.wildlife-card strong { font-size: 17px; line-height: 1.15; }
.wildlife-card-note { font-size: 12px; color: #466443; }
.wildlife-plate { display: grid; place-items: center; padding: 8px; height: clamp(95px, 11vw, 148px); border-radius: 12px; }
.wildlife-plate .wildlife-portrait { min-height: 0; }
.wildlife-entry { display: grid; gap: 10px; }
.wildlife-entry .wildlife-plate { height: clamp(125px, 26vh, 230px); }
.wildlife-entry > p { margin: 0; line-height: 1.45; }
.wildlife-entry > i { color: var(--muted); }
.wildlife-entry .button { justify-self: start; }
.wildlife-water { background: #c8e4dc center / cover no-repeat; }
.wildlife-river { background-image: url('./assets/garden-wildlife/creek.webp'); background-position: 67% 68%; }
.wildlife-marsh { overflow: hidden; padding: 0; }
.wildlife-marsh img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.wildlife-water .wildlife-portrait { justify-self: end; align-self: end; width: 65%; height: 75%; object-position: right bottom; filter: drop-shadow(0 2px 2px #25413450); }
.freshwater-tour { min-inline-size: 0; margin: 4px 0 0; padding: 0; border: 0; }
.freshwater-tour legend { padding: 0; font-weight: 900; }
.freshwater-stops { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.freshwater-stops label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px; border: 1px solid #a4c9b5; border-radius: 12px; color: #204c3e; font-weight: 800; cursor: pointer; }
.freshwater-stops label:has(:checked) { background: #e1f2e7; border-color: #477b62; }
.freshwater-stops label:has(:focus-visible) { outline: 3px solid #205b43; outline-offset: 2px; }
.freshwater-stops input { width: 16px; height: 16px; margin: 0; accent-color: #286448; }
.freshwater-stop { margin: 0; }
.freshwater-stop figcaption { margin-top: 8px; font-weight: 700; color: #254c3c; line-height: 1.4; }
.freshwater-tour:has([value='river']:checked) #habitat-marsh,
.freshwater-tour:has([value='marsh']:checked) #habitat-river { display: none; }
@media (max-width: 690px) {
  .hero.garden-hero { grid-template-columns: 1fr; background: linear-gradient(180deg, #eff4db 12%, #eff4dbed 36%, #eff4db4a 62%, transparent 76%),
    url('./assets/garden-wildlife/forest-garden.webp') 68% bottom / auto 100% no-repeat #eff4db; }
  .garden-companion { justify-self: center; width: min(100%, 300px); padding: 0 12px 12px; }
  .garden-companion .wildlife-portrait { height: 132px; }
  .garden-hero .hero-content { width: 100%; }
  .garden-hero-bottom { gap: 8px; }
  .wildlife-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
}
