@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("nunito-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("nunito-600.woff2") format("woff2");
}

:root {
  --yolk: #FFD400;
  --grass: #3D9E3A;
  --asphalt: #3A3A3A;
  --hen: #F08A24;
  --sky: #7EC8E8;
  --lane: #FFFFFF;
  --danger: #E23B2E;
  --ink: #241c12;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { overflow: hidden; }
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: Nunito, "Trebuchet MS", sans-serif;
  font-weight: 600;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.18), transparent 26%),
    radial-gradient(circle at 90% 84%, rgba(18, 70, 16, 0.28), transparent 32%),
    var(--grass);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button, h1, h2, h3, .splash-title, .tile strong, .cornchip, .stripe, .btn, .ladder span {
  font-family: Fredoka, Nunito, "Trebuchet MS", sans-serif;
  font-weight: 700;
}
h1, h2, h3, p { margin: 0; }
img { max-width: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.stripe:focus-visible { outline-color: var(--yolk); }

#app {
  width: min(480px, 100%);
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--sky);
}
.layer { display: none; height: 100%; }
.layer.on { display: block; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#splash.layer.on {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  background: linear-gradient(var(--sky) 0 64%, var(--grass) 64% 100%);
}
.splash-title {
  font-size: 40px;
  letter-spacing: -0.03em;
  background: var(--yolk);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 6px 14px;
  box-shadow: 0 6px 0 var(--ink);
}
.splash-sub { font-size: 16px; }
.splash-stage {
  position: relative;
  width: min(320px, 86vw);
  height: 210px;
  margin-top: 12px;
}
.splash-road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  height: 58px;
  background: var(--asphalt);
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.splash-road:before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 24px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--lane) 0 18px, transparent 18px 32px);
}
.splash-cone-wrap {
  position: absolute;
  left: 126px;
  bottom: 58px;
  width: 58px;
  height: 72px;
  z-index: 1;
}
.splash-cone-wrap img,
.splash-cone-wrap .css-cone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.jumper {
  position: absolute;
  left: 4px;
  bottom: 52px;
  width: 112px;
  height: 112px;
  z-index: 2;
  animation: peckhop 1.2s linear forwards;
}
.jumper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.jumper .css-hen { position: absolute; left: 16px; bottom: 0; }
@keyframes peckhop {
  0% { transform: translate(0, 0) rotate(-8deg); }
  42% { transform: translate(92px, -102px) rotate(-16deg); }
  100% { transform: translate(176px, 8px) rotate(10deg); }
}

.css-hen {
  --c: var(--hen);
  --c2: #d87416;
  width: 76px;
  height: 72px;
  position: relative;
  margin: 0 auto 6px;
}
.css-hen i { position: absolute; display: block; }
.css-hen .tail {
  width: 22px;
  height: 16px;
  left: 4px;
  top: 34px;
  background: var(--c2);
  border-radius: 12px 4px 12px 10px;
  transform: rotate(-18deg);
}
.css-hen .body {
  width: 42px;
  height: 30px;
  left: 14px;
  top: 30px;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.35), transparent 42%), var(--c);
  border-radius: 48% 52% 46% 50%;
  box-shadow: inset -7px -6px 0 rgba(0, 0, 0, 0.12);
}
.css-hen .body:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 12px;
  left: 8px;
  top: 12px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}
.css-hen .wing {
  width: 20px;
  height: 14px;
  left: 26px;
  top: 40px;
  background: var(--c2);
  border-radius: 50%;
}
.css-hen .head {
  width: 26px;
  height: 24px;
  left: 40px;
  top: 16px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 40%), var(--c);
  border-radius: 50%;
}
.css-hen .comb {
  width: 16px;
  height: 12px;
  left: 48px;
  top: 6px;
  background: var(--danger);
  clip-path: polygon(8% 100%, 22% 28%, 40% 100%, 55% 18%, 74% 100%, 90% 34%, 100% 100%);
}
.css-hen .beak {
  box-sizing: content-box;
  left: 62px;
  top: 26px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 10px solid var(--yolk);
}
.css-hen .eye {
  width: 5px;
  height: 5px;
  left: 52px;
  top: 23px;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 1px 1px 0 #fff;
}
.css-hen .leg {
  width: 3px;
  height: 12px;
  top: 56px;
  background: #c45a12;
  border-radius: 2px;
}
.css-hen .leg.left { left: 28px; }
.css-hen .leg.right { left: 42px; }
.css-cone {
  background: linear-gradient(#fff 0 56%, #F08A24 56% 70%, #fff 70% 100%);
  clip-path: polygon(50% 0, 86% 100%, 14% 100%);
}

#onboarding.layer.on {
  display: flex;
  flex-direction: column;
  background: linear-gradient(var(--sky) 0 26%, var(--grass) 26% 100%);
  padding-top: env(safe-area-inset-top);
}
.ob-head, .scene-no { text-align: center; flex: none; }
.ob-head {
  padding-top: 14px;
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 700;
  font-size: 22px;
}
.scene-no { font-size: 13px; padding-bottom: 4px; }
.ob-stage { flex: 1; min-height: 0; overflow: auto; touch-action: pan-y; }
.scene {
  display: none;
  margin: 4px 14px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 8px 0 rgba(36, 28, 18, 0.16);
}
.scene.on { display: flex; flex-direction: column; gap: 8px; }
.scene h2 { font-size: 28px; letter-spacing: -0.03em; }
.scene p { line-height: 1.35; }
.dots { display: flex; justify-content: center; gap: 8px; padding: 2px 0 4px; flex: none; }
.dots button {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
}
.dots button.on { width: 28px; border-radius: 8px; background: var(--yolk); }
.ob-bar {
  display: flex;
  gap: 10px;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
  flex: none;
}
.ob-bar .btn { flex: 1; }
.btn.glow { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px #fff, 0 0 0 7px var(--yolk); }

.swipe-lanes { display: grid; gap: 8px; touch-action: none; }
.mini-lane {
  position: relative;
  height: 46px;
  border-radius: 12px;
  background: var(--asphalt);
  border: 3px solid var(--ink);
  overflow: hidden;
  transition: transform 0.3s ease;
}
.mini-lane:after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 18px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--lane) 0 16px, transparent 16px 28px);
}
.mini-lane.hot { background: var(--yolk); }
.mini-lane.hot:after {
  background: repeating-linear-gradient(90deg, var(--ink) 0 16px, transparent 16px 28px);
}
.swipe-lanes.done .mini-lane { transform: translateX(26px); }
.watch {
  position: relative;
  height: 96px;
  border-radius: 14px;
  background: var(--asphalt);
  border: 3px solid var(--ink);
  overflow: hidden;
}
.watch:after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 46px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--lane) 0 18px, transparent 18px 32px);
}
.roller {
  position: absolute;
  z-index: 1;
  bottom: 8px;
  width: 46px;
  height: 56px;
  animation: roll 2.2s linear infinite;
}
.roller img, .roller .css-cone { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@keyframes roll {
  0% { left: -52px; transform: rotate(0deg); }
  100% { left: calc(100% - 8px); transform: rotate(-360deg); }
}
.tap-demo {
  position: relative;
  height: 120px;
  border-radius: 14px;
  background: var(--asphalt);
  border: 3px solid var(--ink);
  overflow: hidden;
  touch-action: manipulation;
}
.yolk-window {
  position: absolute;
  z-index: 1;
  left: 32%;
  width: 36%;
  top: 16px;
  bottom: 16px;
  background: rgba(255, 212, 0, 0.92);
  border: 3px solid var(--yolk);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.puck {
  position: absolute;
  z-index: 2;
  top: 44px;
  width: 22px;
  height: 28px;
  background: #fff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: slidepuck 1.7s linear infinite;
  pointer-events: none;
}
@keyframes slidepuck {
  from { left: 8px; }
  to { left: calc(100% - 30px); }
}
#trial {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--sky);
  touch-action: none;
}
.status { min-height: 2.4em; }
.status.bad { color: var(--danger); }
.status.good { color: #1d6b28; }

.btn {
  border: 3px solid var(--ink);
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 0 var(--ink);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn.yolk { background: var(--yolk); }
.btn.ghost {
  background: rgba(36, 28, 18, 0.28);
  color: #fff;
  border-color: #fff;
  box-shadow: none;
}
.btn.wide { width: 100%; margin-top: 10px; }
.btn.hot {
  box-shadow: 0 4px 0 var(--ink), 0 0 0 4px #fff, 0 0 0 8px var(--yolk);
}

#shell.layer.on {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  position: relative;
  overflow: hidden;
}
.rail {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: var(--grass);
  box-shadow: inset -4px 0 0 var(--lane);
  overflow: visible;
}
.stripe {
  appearance: none;
  border: 0;
  height: 78px;
  width: 86px;
  margin: 0;
  padding: 0 12px;
  border-radius: 0 18px 18px 0;
  background: var(--asphalt);
  color: var(--lane);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  text-align: left;
  box-shadow: 4px 5px 0 rgba(20, 16, 8, 0.25);
  transition: width 0.28s cubic-bezier(0.2, 0.85, 0.2, 1), transform 0.28s cubic-bezier(0.2, 0.85, 0.2, 1), background 0.2s linear, color 0.2s linear;
}
.stripe i {
  width: 8px;
  height: 28px;
  border-radius: 6px;
  background: var(--lane);
  display: block;
  flex: none;
}
.stripe.on {
  width: 138px;
  transform: translateX(16px);
  background: var(--yolk);
  color: var(--ink);
  box-shadow: 8px 8px 0 rgba(20, 16, 8, 0.28);
}
.stripe.on i { background: var(--ink); }
main {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: var(--sky);
}
#shell.has-banner main { padding-top: 78px; }
.view { display: none; }
#view-road.view.on, #view-coop.view.on { display: block; min-height: 100%; }
#view-skip.view.on {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 10px 10px 12px;
  background: linear-gradient(var(--sky), var(--grass));
}

#banner { display: none; }
#banner.on {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 72px;
  right: 8px;
  background: var(--yolk);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 6px 0 rgba(36, 28, 18, 0.18);
}
#banner p { flex: 1; font-size: 14px; }
#banner .btn { padding: 8px 10px; }

#view-road {
  padding: 16px 14px calc(24px + env(safe-area-inset-bottom)) 16px;
  background: linear-gradient(var(--sky) 0 168px, #d7f2c8 168px, var(--grass) 100%);
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#view-road h1, .coop-head h1 { font-size: 36px; letter-spacing: -0.04em; }
.hud { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tile {
  background: #fff;
  border: 3px solid var(--ink);
  border-top: 8px solid var(--yolk);
  border-radius: 18px;
  padding: 8px 12px 10px;
  box-shadow: 0 5px 0 rgba(36, 28, 18, 0.12);
}
.tile span { display: block; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.tile strong { display: block; font-size: 42px; line-height: 0.95; }
.tile small { color: #5c5146; }
.cornchip {
  margin: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-size: 18px;
}
.cornchip img { width: 32px; height: 32px; object-fit: contain; }
.scenic {
  position: relative;
  height: 230px;
  margin: 4px 0 10px;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--sky);
  box-shadow: 0 6px 0 rgba(36, 28, 18, 0.16);
}
.scenic .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scenic .car {
  position: absolute;
  z-index: 1;
  width: 96px;
  height: 62px;
  object-fit: contain;
  bottom: 78px;
  left: -120px;
  animation: drive 8.5s linear infinite;
}
.scenic .cone {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 64px;
  object-fit: contain;
  left: 112px;
  bottom: 28px;
}
.scenic .hen {
  position: absolute;
  z-index: 3;
  width: 108px;
  height: 120px;
  object-fit: contain;
  left: 8px;
  bottom: 10px;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes drive {
  from { left: 110%; }
  to { left: -140px; }
}
@keyframes bob {
  50% { transform: translateY(-6px); }
}
.worn, .ladder-label, .week-label { margin-top: 8px; }
.ladder { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
.ladder span {
  text-align: center;
  background: var(--asphalt);
  color: #fff;
  border-radius: 8px;
  padding: 6px 0;
  border: 2px solid var(--ink);
  font-size: 13px;
}
.ladder span.on { background: var(--yolk); color: var(--ink); }
.blurb {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 12px;
  line-height: 1.4;
}
.week { display: flex; gap: 6px; margin-top: 6px; }
.week i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  display: block;
}
.week i.on { background: var(--yolk); }
.block {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 12px;
}
.block h2 { font-size: 22px; margin-bottom: 4px; }
.block p { line-height: 1.35; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.form-row input[type="time"], .form-row input[type="text"], .note-row input, .jrow input, #noteInput {
  border: 2px solid var(--asphalt);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  min-width: 0;
}
#noteInput { flex: 1; }
#remindStatus { margin-top: 8px; }
#remindOff { display: none; }
#remindOff.on { display: inline-flex; }

#view-coop {
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(8, 16, 32, 0.08) 0 220px, rgba(8, 16, 32, 0.78) 480px),
    #102033 url("bg-night.jpg") center top / 100% auto no-repeat;
}
.coop-head { color: #fff; text-shadow: 0 2px 0 var(--ink); margin-bottom: 8px; }
.coop-head .eyebrow { color: #fff; }
#weekText { font-family: Fredoka, Nunito, sans-serif; font-size: 28px; }
#bestDayText, #journalCount, #trailCount, #lookMsg { margin: 4px 0 8px; }
.journal {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow: auto;
}
.jrow {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 2px dashed rgba(36, 28, 18, 0.16);
}
.jrow span { font-size: 13px; color: #5c5146; }
.jrow.empty span { color: #8d8378; }
.jrow input { width: 100%; }
.skins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.skin {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 8px 6px 10px;
  text-align: center;
}
.skin.on { background: var(--yolk); }
.skin p { font-size: 13px; min-height: 32px; margin-bottom: 6px; }
.skin button {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  padding: 6px 4px;
  font-size: 12px;
  box-shadow: 0 3px 0 var(--ink);
}
.skin button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.trail { list-style: none; margin: 0; padding: 0; }
.trail li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 2px solid rgba(36, 28, 18, 0.1);
}
.trail i {
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  flex: none;
  position: relative;
}
.trail i.on { background: var(--yolk); }
.trail i.on:after {
  content: "";
  box-sizing: content-box;
  position: absolute;
  left: 3px;
  top: 4px;
  width: 8px;
  height: 4px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(-45deg);
}

.skip-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 14px;
}
.skip-hud b { font-family: Fredoka, Nunito, sans-serif; font-size: 18px; }
.skip-hud img { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.stage {
  position: relative;
  flex: 1;
  min-height: 240px;
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--sky);
}
.stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.veil { display: none; }
.veil.on {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  padding: 16px;
  background: rgba(36, 28, 18, 0.28);
  text-align: center;
}
.veil .card {
  width: min(100%, 280px);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 0 rgba(36, 28, 18, 0.2);
}
.veil h2 { margin-bottom: 6px; }
.veil p { margin-bottom: 12px; line-height: 1.35; }
#playHop { display: none; width: 100%; margin-top: 8px; font-size: 22px; }
#playHop.on { display: block; }
.fine {
  margin: 6px 0 0;
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  font-size: 13px;
}

@media (min-width: 860px) {
  body { display: grid; place-items: center; min-height: 100dvh; }
  #app {
    height: min(900px, calc(100dvh - 32px));
    border: 4px solid var(--ink);
    border-radius: 28px;
    box-shadow: 0 18px 0 rgba(20, 40, 10, 0.18);
  }
}
@media (max-height: 640px) {
  .stripe { height: 62px; font-size: 16px; }
  .splash-title { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .scenic .car, .scenic .hen, .btn.glow { animation: none; }
  .scenic .car { left: 46%; }
}
