/* ============================================================
   MILLER THE FARMER — universe3d.css
   Fullscreen overlay for Miller's Farm Universe (js/universe3d.js),
   the open-world 3D farm. DOM is built entirely by the script.
   Palette/typography come from css/site.css custom properties
   (with fallbacks so the game still looks right on its own).
   z-index 58: above nav (40), BELOW the #confetti layer (60) —
   same stack position as the other 3D games.
   ============================================================ */

.u3d-overlay {
  --u-bark: var(--bark, #4a2c1a);
  --u-cream: var(--cream, #fff9ec);
  --u-hay: var(--hay, #f7b731);
  --u-hay-d: var(--hay-dark, #d99a12);
  --u-barn: var(--barn, #e23b34);
  --u-grass: var(--grass, #6abf4b);
  --u-grass-d: var(--grass-dark, #4f9e33);
  --u-sky: var(--sky, #63c5ea);
  --u-glass: rgba(255, 249, 236, 0.94);
  --u-shadow: 0 4px 0 rgba(74, 44, 26, 0.16), 0 10px 24px rgba(30, 20, 10, 0.18);
  position: fixed; inset: 0; z-index: 58;
  display: flex; flex-direction: column;
  font-family: var(--font-body, "Nunito", system-ui, sans-serif); color: var(--u-bark);
  background: linear-gradient(180deg, #2f8fd8 0%, #9bd8f5 70%, #8fcf5a 100%);
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: contain;
}
body.u3d-lock { overflow: hidden !important; }
.u3d-overlay .hidden { display: none !important; }
.u3d-overlay button { font-family: inherit; color: inherit; touch-action: manipulation; }
.u3d-overlay button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(58, 168, 212, .8); }

.u3d-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.u3d-stage canvas.u3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.u3d-stage canvas.u3d-canvas:active { cursor: grabbing; }

/* ---------- loading ---------- */
.u3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5; }
.u3d-load-card {
  background: var(--u-glass); border-radius: 28px; padding: 26px 30px; text-align: center; box-shadow: var(--u-shadow);
  max-width: min(86vw, 360px);
}
.u3d-load-card img { width: 96px; height: 96px; object-fit: contain; animation: u3d-bob 1.2s ease-in-out infinite; }
.u3d-load-card p { font-family: var(--font-display, "Fredoka", sans-serif); font-size: 20px; font-weight: 600; margin: 8px 0 14px; }
.u3d-load-bar { height: 14px; border-radius: 99px; background: rgba(74, 44, 26, .12); overflow: hidden; }
.u3d-load-bar span { display: block; height: 100%; width: 8%; border-radius: 99px; background: linear-gradient(90deg, var(--u-hay), var(--u-grass)); transition: width .3s ease; }
@keyframes u3d-bob { 50% { transform: translateY(-8px); } }

/* ---------- HUD ---------- */
.u3d-hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.u3d-hud button { pointer-events: auto; }
.u3d-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
}
.u3d-top-l, .u3d-top-r { display: flex; gap: 8px; align-items: center; }
.u3d-ibtn {
  position: relative; width: 52px; height: 52px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--u-glass); box-shadow: var(--u-shadow); display: grid; place-items: center;
}
.u3d-ibtn svg { width: 26px; height: 26px; fill: var(--u-bark); }
.u3d-ibtn:active { transform: translateY(2px); }
.u3d-badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px;
  background: var(--u-barn); color: #fff; font: 800 12px/22px var(--font-body, sans-serif); border: 2px solid #fff;
}
.u3d-season {
  height: 52px; border: 0; border-radius: 18px; padding: 0 14px 0 8px; cursor: pointer; display: flex; align-items: center; gap: 6px;
  background: var(--u-glass); box-shadow: var(--u-shadow);
  font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 600; font-size: 18px;
}
.u3d-season-ic { font-size: 26px; line-height: 1; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: rgba(106, 191, 75, .2); }
[data-season="summer"] .u3d-season-ic { background: rgba(247, 183, 49, .25); }
[data-season="fall"] .u3d-season-ic { background: rgba(226, 120, 47, .22); }
[data-season="winter"] .u3d-season-ic { background: rgba(99, 197, 234, .25); }
.u3d-stars-chip {
  height: 52px; border: 0; border-radius: 18px; padding: 0 12px; cursor: pointer; background: var(--u-glass); box-shadow: var(--u-shadow);
  font-size: 22px; letter-spacing: 1px; color: rgba(74, 44, 26, .22);
}
.u3d-stars-chip .on { color: var(--u-hay-d); text-shadow: 0 1px 0 #fff; }

/* quest card */
.u3d-quest {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); left: max(10px, env(safe-area-inset-left));
  width: min(420px, calc(100% - 20px)); min-height: 64px; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  background: var(--u-glass); border-radius: 20px; box-shadow: var(--u-shadow);
}
.u3d-quest > img { width: 52px; height: 52px; object-fit: contain; border-radius: 14px; background: #fff3d4; flex: none; }
.u3d-q-main { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.u3d-q-main b { font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 600; font-size: 17px; line-height: 1.15; }
.u3d-q-main small { font-size: 13.5px; font-weight: 700; color: #6b4f3a; line-height: 1.25; }
.u3d-q-main small em { font-style: normal; color: var(--u-grass-d); font-weight: 800; white-space: nowrap; }
.u3d-q-ic { font-size: 16px; }
.u3d-q-bar { display: block; height: 7px; border-radius: 9px; background: rgba(74, 44, 26, .1); overflow: hidden; margin-top: 3px; }
.u3d-q-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--u-hay), var(--u-grass)); border-radius: 9px; transition: width .25s; }
.u3d-q-dots { display: flex; gap: 4px; flex: none; }
.u3d-quest .u3d-q-dots { flex-direction: column; }
.u3d-q-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(74, 44, 26, .16); }
.u3d-q-dots i.done { background: var(--u-grass); }
.u3d-q-dots i.now { background: var(--u-hay); box-shadow: 0 0 0 2px rgba(247, 183, 49, .35); }
.u3d-summon {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 134px); left: max(10px, env(safe-area-inset-left));
  min-height: 48px; padding: 0 16px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--u-hay); box-shadow: var(--u-shadow); font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 600; font-size: 16px;
}

/* toasts + speech line */
.u3d-toasts {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 66px); right: max(10px, env(safe-area-inset-right));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: min(360px, 46%);
}
.u3d-toast {
  background: #fff; border-radius: 16px; padding: 9px 14px; font-weight: 800; font-size: 14.5px; box-shadow: var(--u-shadow);
  border-left: 6px solid var(--u-grass); animation: u3d-in .35s cubic-bezier(.2, 1.4, .5, 1); transition: opacity .35s, transform .35s;
}
.u3d-toast.out { opacity: 0; transform: translateX(20px); }
.u3d-toast.gold, .u3d-toast.star { border-left-color: var(--u-hay); background: #fffbe8; }
.u3d-toast.journal { border-left-color: var(--u-sky); }
.u3d-toast.season { border-left-color: var(--u-barn); }
@keyframes u3d-in { from { opacity: 0; transform: translateX(30px) scale(.9); } }
.u3d-say {
  position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 120px); transform: translateX(-50%);
  max-width: min(560px, 84%); text-align: center; padding: 10px 18px; border-radius: 22px;
  background: rgba(74, 44, 26, .86); color: #fff; font-weight: 800; font-size: 17px; line-height: 1.3;
}

/* joystick (left) + action (right) */
.u3d-joy { position: absolute; inset: 0; pointer-events: none; }
.u3d-joy-base {
  position: absolute; left: 96px; top: auto; bottom: 40px; width: 128px; height: 128px; transform: translate(-50%, 0);
  border-radius: 50%; background: rgba(255, 255, 255, .22); border: 3px solid rgba(255, 255, 255, .55);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .08); display: none;
}
.u3d-joy.on .u3d-joy-base { display: block; transform: translate(-50%, -50%); bottom: auto; }
.u3d-joy-knob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9b0 60%, var(--u-hay)); box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}
@media (pointer: coarse) {
  .u3d-joy-base { display: block; opacity: .75; }
  .u3d-joy::after {
    content: ""; position: absolute; left: 96px; bottom: 104px; width: 0; height: 0;
  }
}
.u3d-right {
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.u3d-act {
  width: 104px; height: 104px; border-radius: 50%; border: 5px solid #fff; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ffe27a, var(--u-hay) 55%, var(--u-hay-d));
  box-shadow: 0 6px 0 #b77f0c, 0 14px 26px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  opacity: .78; transition: transform .12s, opacity .2s;
}
.u3d-act.ready { opacity: 1; animation: u3d-pulse 1.6s ease-in-out infinite; }
.u3d-act:active { transform: translateY(4px); box-shadow: 0 2px 0 #b77f0c, 0 8px 16px rgba(0, 0, 0, .25); }
.u3d-act-ic { font-size: 34px; line-height: 1; }
.u3d-act-tx { font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 700; font-size: 16px; line-height: 1; }
@keyframes u3d-pulse { 50% { transform: scale(1.06); } }

/* ---------- photo mode ---------- */
.u3d-photo-on .u3d-hud { display: none; }
.u3d-photo {
  position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 3;
}
.u3d-photo-cap { background: rgba(74, 44, 26, .8); color: #fff; padding: 8px 18px; border-radius: 99px; font-weight: 800; margin: 0; }
.u3d-photo-row { display: flex; gap: 12px; }
.u3d-photo-on .u3d-stage::before, .u3d-photo-on .u3d-stage::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7%; background: #120b05; z-index: 2; pointer-events: none;
}
.u3d-photo-on .u3d-stage::before { top: 0; }
.u3d-photo-on .u3d-stage::after { bottom: 0; }
.u3d-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.u3d-flash.go { animation: u3d-flash .6s ease-out; }
@keyframes u3d-flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- panels ---------- */
.u3d-panel-wrap {
  position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(30, 20, 10, .35);
}
.u3d-panel {
  position: relative; width: min(620px, 100%); max-height: calc(100% - 8px); overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--u-cream); border-radius: 28px; padding: 22px 22px 20px; box-shadow: 0 10px 0 rgba(74, 44, 26, .18), 0 24px 50px rgba(0, 0, 0, .3);
  animation: u3d-pop .32s cubic-bezier(.2, 1.4, .5, 1); user-select: text; -webkit-user-select: text;
}
@keyframes u3d-pop { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.u3d-panel h3 { font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 600; font-size: 24px; margin: 0 44px 10px 0; line-height: 1.2; }
.u3d-panel h3 small { font-size: 14px; font-weight: 600; }
.u3d-panel p { margin: 0 0 10px; line-height: 1.45; font-size: 16.5px; }
.u3d-x {
  position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(74, 44, 26, .08); font-size: 20px; font-weight: 800;
}
.u3d-muted { color: #7a5a44; }
.u3d-panel .small, .u3d-muted.small { font-size: 14px; }
.center { text-align: center; }
.u3d-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.u3d-btn {
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 99px; cursor: pointer;
  font-family: var(--font-display, "Fredoka", sans-serif); font-weight: 600; font-size: 18px;
  background: var(--u-grass); color: #fff; box-shadow: 0 4px 0 var(--u-grass-d); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.u3d-btn.hay { background: var(--u-hay); color: var(--u-bark); box-shadow: 0 4px 0 var(--u-hay-d); }
.u3d-btn.ghost { background: #fff; color: var(--u-bark); box-shadow: 0 4px 0 rgba(74, 44, 26, .15); }
.u3d-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(74, 44, 26, .2); }
.u3d-btn svg { width: 22px; height: 22px; fill: currentColor; }
.u3d-link { background: none; border: 0; color: #7a5a44; text-decoration: underline; cursor: pointer; font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 8px; }

/* offer */
.u3d-offer { display: flex; gap: 16px; align-items: flex-start; }
.u3d-portrait { width: 120px; height: 120px; object-fit: contain; flex: none; background: radial-gradient(circle, #fff 0 55%, #ffeec4 56%); border-radius: 50%; }
.u3d-portrait.sm { width: 64px; height: 64px; }
.u3d-bubble { position: relative; background: #fff; border-radius: 18px; padding: 12px 16px; font-weight: 700; font-size: 18px !important; box-shadow: 0 3px 0 rgba(74, 44, 26, .1); }
.u3d-offer h3 { margin-bottom: 8px; }
.u3d-offer h3 small { display: block; color: #7a5a44; }

/* quiz */
.u3d-quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.u3d-quiz-head h3 { margin: 0; }
.u3d-quiz-head p { margin: 0; }
.u3d-qtext { font-weight: 800; font-size: 19px !important; }
.u3d-visual { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.u3d-q-icons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 34px; line-height: 1.1; max-width: 340px; }
.u3d-q-icons.solo { font-size: 56px; justify-content: flex-start; margin: 6px 0; }
.u3d-q-plus { font: 700 34px var(--font-display, sans-serif); color: var(--u-grass-d); }
.u3d-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.u3d-opts.imgs { grid-template-columns: repeat(3, 1fr); }
.u3d-opts.dec { grid-template-columns: 1fr; }
.u3d-opt {
  min-height: 60px; padding: 10px 12px; border: 3px solid transparent; border-radius: 18px; cursor: pointer; background: #fff;
  box-shadow: 0 4px 0 rgba(74, 44, 26, .14); font-weight: 800; font-size: 17px; line-height: 1.25;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
}
.u3d-opts.dec .u3d-opt { align-items: flex-start; text-align: left; }
.u3d-opt img { width: 84px; height: 84px; object-fit: contain; }
.u3d-opt:hover { border-color: rgba(247, 183, 49, .6); }
.u3d-opt.yes { border-color: var(--u-grass); background: #effbe8; }
.u3d-opt.no { opacity: .45; }
.u3d-opt:disabled { cursor: default; }
.u3d-big { font: 700 34px/1 var(--font-display, sans-serif); }
.u3d-pips { font-size: 11px; letter-spacing: 2px; color: var(--u-hay-d); }
.u3d-swatch { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(74, 44, 26, .2); }
.u3d-cap { font-size: 14px; }
.u3d-emo { font-size: 48px; line-height: 1; }
.u3d-hint { background: #fff4d0; border-radius: 14px; padding: 10px 14px; font-weight: 700; margin-top: 10px !important; }
.u3d-after { margin-top: 12px; }
.u3d-fact { background: #effbe8; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.u3d-why { background: #fff; border-radius: 14px; padding: 10px 14px; border-left: 5px solid var(--u-sky); }
.u3d-quiz .u3d-spk { min-height: 48px; padding: 0 16px; font-size: 16px; }
.u3d-ledger { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; border-radius: 12px; overflow: hidden; }
.u3d-ledger td { padding: 6px 10px; border-bottom: 1px solid rgba(74, 44, 26, .08); }
.u3d-ledger td:last-child { text-align: right; font-weight: 800; white-space: nowrap; }
.u3d-ledger .neg { color: #b8322b; } .u3d-ledger .pos { color: var(--u-grass-d); }
.u3d-ledger-wrap { margin: 6px 0 12px; background: #fff; border-radius: 14px; padding: 8px 12px; }
.u3d-ledger-wrap summary { cursor: pointer; font-weight: 800; min-height: 32px; display: flex; align-items: center; }

/* celebrate */
.u3d-celebrate { text-align: center; }
.u3d-celebrate h3 { margin-right: 0; }
.u3d-crew-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.u3d-crew-row figure { margin: 0; width: 76px; animation: u3d-bob 1.4s ease-in-out infinite; }
.u3d-crew-row figure:nth-child(2n) { animation-delay: .3s; }
.u3d-crew-row img { width: 72px; height: 72px; object-fit: contain; }
.u3d-crew-row figcaption { font-size: 12px; font-weight: 800; }
.u3d-celebrate .u3d-row { justify-content: center; }

/* seasons */
.u3d-scards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.u3d-scard {
  position: relative; min-height: 120px; border: 3px solid transparent; border-radius: 22px; cursor: pointer; padding: 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; color: var(--u-bark);
  box-shadow: 0 4px 0 rgba(74, 44, 26, .14);
}
.u3d-scard.s-spring { background: linear-gradient(160deg, #e9f8dc, #c9edb0); }
.u3d-scard.s-summer { background: linear-gradient(160deg, #fff4cf, #ffe08a); }
.u3d-scard.s-fall { background: linear-gradient(160deg, #ffe6cc, #f7c08a); }
.u3d-scard.s-winter { background: linear-gradient(160deg, #f1f8ff, #cfe6f7); }
.u3d-scard.cur { border-color: var(--u-bark); }
.u3d-scard-ic { font-size: 34px; line-height: 1; }
.u3d-scard b { font-family: var(--font-display, sans-serif); font-weight: 600; font-size: 20px; }
.u3d-scard small { font-weight: 700; font-size: 13.5px; }
.u3d-scard .u3d-q-dots { margin-top: auto; }
.u3d-tag { position: absolute; top: 10px; right: 10px; background: var(--u-grass); color: #fff; border-radius: 99px; padding: 2px 10px; font-weight: 800; font-size: 12px; }
.u3d-daynight { justify-content: center; }
.u3d-daynight .u3d-btn { min-height: 48px; font-size: 16px; padding: 0 14px; }

/* goals */
.u3d-goals { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.u3d-goals li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 14px; }
.u3d-goals li.ok { background: #fffbe0; }
.u3d-goal-star { font-size: 32px; color: var(--u-hay-d); }
.u3d-goals b { display: block; font-size: 16.5px; }
.u3d-goals small { color: #7a5a44; font-weight: 700; }

/* journal */
.u3d-jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.u3d-jtile {
  min-height: 104px; border: 0; border-radius: 16px; background: #fff; cursor: pointer; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 3px 0 rgba(74, 44, 26, .1);
}
.u3d-jtile span { font-size: 34px; line-height: 1; }
.u3d-jtile img { width: 50px; height: 50px; object-fit: contain; }
.u3d-jtile small { font-size: 11.5px; font-weight: 800; line-height: 1.15; text-align: center; }
.u3d-jtile.locked { background: rgba(74, 44, 26, .06); box-shadow: none; color: rgba(74, 44, 26, .4); }
.u3d-jpage-in { display: flex; gap: 16px; align-items: flex-start; }
.u3d-jpage-ic { flex: none; width: 96px; height: 96px; border-radius: 22px; background: #fff; display: grid; place-items: center; font-size: 56px; }
.u3d-jpage-ic img { width: 84px; height: 84px; object-fit: contain; }
.u3d-jpage h4 { font: 600 22px var(--font-display, sans-serif); margin: 4px 0 8px; }
.u3d-deep { background: #fff; border-radius: 14px; padding: 10px 14px; border-left: 5px solid var(--u-sky); }

/* map */
.u3d-map { width: 100%; max-width: 520px; aspect-ratio: 1; display: block; margin: 0 auto; border-radius: 20px; cursor: crosshair; box-shadow: inset 0 0 0 3px rgba(74, 44, 26, .1); }
.u3d-map-key { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 13.5px; font-weight: 700; margin-top: 8px !important; }
.u3d-map-key i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.k-you { background: #e23b34; } .k-goal { background: #f7b731; } .k-cam { background: #3aa8d4; } .k-gold { background: #ffd54a; }

/* settings */
.u3d-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.u3d-chip {
  min-height: 60px; border: 3px solid transparent; border-radius: 18px; background: #fff; cursor: pointer;
  font-family: var(--font-display, sans-serif); font-weight: 600; font-size: 17px; box-shadow: 0 3px 0 rgba(74, 44, 26, .1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.u3d-chip small { font-family: var(--font-body, sans-serif); font-size: 12px; font-weight: 700; color: #7a5a44; }
.u3d-chip.active { border-color: var(--u-barn); background: #fff1ef; }

/* tutorial */
.u3d-tut { text-align: center; }
.u3d-tut h3 { margin-right: 0; }
.u3d-tut-ic { font-size: 64px; line-height: 1.1; margin: 4px 0 6px; }
.u3d-tut p { font-size: 18px; font-weight: 700; }
.u3d-tut-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.u3d-tut-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(74, 44, 26, .18); }
.u3d-tut-dots i.now { background: var(--u-hay); }
.u3d-tut .u3d-row { justify-content: center; }

/* Sprouts: bigger, fewer words */
[data-band="1"] .u3d-q-main small { font-size: 15px; }
[data-band="1"] .u3d-act { width: 116px; height: 116px; }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .u3d-ibtn { width: 48px; height: 48px; border-radius: 16px; }
  .u3d-top-r { gap: 6px; }
  .u3d-season { height: 48px; padding: 0 10px 0 6px; font-size: 16px; }
  .u3d-season-tx { display: none; }
  .u3d-stars-chip { height: 48px; padding: 0 8px; font-size: 18px; }
  .u3d-quest { top: calc(max(10px, env(safe-area-inset-top)) + 56px); min-height: 58px; padding: 6px 10px 6px 6px; }
  .u3d-quest > img { width: 44px; height: 44px; }
  .u3d-q-main b { font-size: 15.5px; }
  .u3d-q-main small { font-size: 12.5px; }
  .u3d-summon { top: calc(max(10px, env(safe-area-inset-top)) + 122px); }
  .u3d-toasts { top: calc(max(10px, env(safe-area-inset-top)) + 124px); right: 50%; transform: translateX(50%); align-items: center; max-width: 92%; width: max-content; }
  .u3d-summon:not(.hidden) ~ .u3d-toasts { top: calc(max(10px, env(safe-area-inset-top)) + 180px); }
  .u3d-toast { font-size: 13.5px; }
  .u3d-say { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 136px); font-size: 15.5px; }
  .u3d-act { width: 92px; height: 92px; }
  [data-band="1"] .u3d-act { width: 100px; height: 100px; }
  .u3d-act-ic { font-size: 30px; }
  .u3d-joy-base { left: 84px; bottom: 30px; width: 116px; height: 116px; }
  .u3d-panel { padding: 18px 14px 16px; border-radius: 24px; }
  .u3d-panel h3 { font-size: 21px; }
  .u3d-offer { flex-direction: column; align-items: center; text-align: center; }
  .u3d-offer .u3d-row { justify-content: center; }
  .u3d-offer .u3d-q-icons.solo { justify-content: center; }
  .u3d-portrait { width: 96px; height: 96px; }
  .u3d-opts { grid-template-columns: 1fr 1fr; }
  .u3d-opts.dec { grid-template-columns: minmax(0, 1fr); }
  .u3d-opt img { width: 64px; height: 64px; }
  .u3d-q-icons { font-size: 28px; }
  .u3d-jgrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .u3d-jpage-in { flex-direction: column; align-items: center; text-align: center; }
  .u3d-jpage .u3d-row { justify-content: center; }
  .u3d-scard { min-height: 108px; padding: 10px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .u3d-quest { width: min(360px, 46%); }
  .u3d-act { width: 84px; height: 84px; }
  .u3d-say { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .u3d-act.ready, .u3d-load-card img, .u3d-crew-row figure { animation: none; }
  .u3d-panel, .u3d-toast { animation: none; }
  .u3d-flash.go { animation-duration: .2s; }
}
.u3d-jtile svg.u3d-barn-ic { width: 46px; height: 46px; }
.u3d-jpage-ic svg.u3d-barn-ic { width: 76px; height: 76px; }

/* ============================================================
   BOOK MAKEOVER — HUD restyled on css/tokens.css: cream narration
   panels in the book's hand-lettered capitals (Patrick Hand),
   chunky outlined buttons with press-down depth, book sky.
   (Overrides the base rules above; fallbacks keep it standalone.)
   ============================================================ */
.u3d-overlay {
  --u-ink: var(--logo-outline, #2b1a10);
  --u-paper: var(--cream, #f8f2d6);
  --u-paper-edge: var(--cream-edge, #e9dfb4);
  --u-red: var(--barn-red, #d9332b);
  --u-yel: var(--tractor-yellow, #f5c400);
  --u-grn: var(--tractor-green, #2f9e3f);
  --u-grn-d: var(--tractor-green-dark, #1f6e2c);
  --u-book: var(--font-book, "Patrick Hand", "Comic Sans MS", cursive);
  --u-press: 0 4px 0 var(--u-ink);
  --u-glass: var(--u-paper);
  --u-shadow: 0 4px 0 var(--u-ink), 0 10px 22px rgba(43, 26, 16, .22);
  color: var(--text, #2b1a10);
  background: linear-gradient(180deg, var(--sky-top, #8ee7ee) 0%, var(--sky-low, #dffafa) 62%, var(--hill-grass, #9ed426) 100%);
}
/* chunky outlined chrome */
.u3d-ibtn, .u3d-season, .u3d-stars-chip, .u3d-quest, .u3d-summon {
  background: var(--u-paper); border: 3px solid var(--u-ink); box-shadow: var(--u-shadow);
  transition: transform .1s ease, box-shadow .1s ease;
}
.u3d-ibtn svg { fill: var(--u-ink); }
.u3d-ibtn:active, .u3d-season:active, .u3d-stars-chip:active, .u3d-quest:active, .u3d-summon:active { transform: translateY(4px); box-shadow: 0 0 0 var(--u-ink); }
.u3d-badge { background: var(--u-red); border: 2.5px solid var(--u-ink); }
.u3d-season-ic { background: #fff; border: 2px solid var(--u-ink); }
.u3d-stars-chip { color: rgba(43, 26, 16, .25); }
.u3d-stars-chip .on { color: var(--u-yel); text-shadow: 0 0 1px var(--u-ink), 0 2px 0 var(--u-ink); }
.u3d-quest { border-radius: 22px; }
.u3d-quest > img { background: #fff; border: 2px solid var(--u-ink); border-radius: 50%; }
.u3d-q-main b { font-family: var(--u-book); text-transform: uppercase; font-weight: 400; font-size: 19px; letter-spacing: .3px; }
.u3d-q-main small { color: var(--text-2, #5e4433); }
.u3d-q-bar { background: rgba(43, 26, 16, .12); border: 1.5px solid var(--u-ink); height: 9px; }
.u3d-q-bar span { background: linear-gradient(90deg, var(--u-yel), var(--hill-grass, #9ed426)); }
.u3d-q-dots i { border: 1.5px solid var(--u-ink); }
.u3d-q-dots i.done { background: var(--hill-grass, #9ed426); }
.u3d-q-dots i.now { background: var(--u-yel); }
.u3d-summon { background: var(--u-yel); border-radius: 999px; }

/* narration: the book's cream rounded boxes in capitals */
.u3d-say {
  background: var(--u-paper); color: var(--u-ink); border: 3px solid var(--u-ink); border-radius: 26px;
  box-shadow: 0 5px 0 rgba(43, 26, 16, .35);
  font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 21px; letter-spacing: .4px; line-height: 1.25;
  padding: 10px 22px;
}
.u3d-toast {
  background: var(--u-paper); border: 2.5px solid var(--u-ink); border-left-width: 8px; border-left-color: var(--hill-grass, #9ed426);
  box-shadow: 0 3px 0 var(--u-ink); font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 17px; letter-spacing: .3px;
}
.u3d-toast.gold, .u3d-toast.star { border-left-color: var(--u-yel); background: #fff6cf; }
.u3d-toast.journal { border-left-color: var(--sky-top, #8ee7ee); }
.u3d-toast.season { border-left-color: var(--u-red); }
.u3d-load-card { background: var(--u-paper); border: 3px solid var(--u-ink); box-shadow: 0 6px 0 var(--u-ink); }
.u3d-load-card p { font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 22px; }
.u3d-load-bar { border: 2px solid var(--u-ink); }
.u3d-load-bar span { background: linear-gradient(90deg, var(--u-yel), var(--hill-grass, #9ed426)); }

/* panels = cream book pages with an ink outline */
.u3d-panel-wrap { background: rgba(43, 26, 16, .38); }
.u3d-panel { background: var(--u-paper); border: 3px solid var(--u-ink); box-shadow: 0 8px 0 var(--u-ink), 0 24px 50px rgba(0, 0, 0, .3); }
.u3d-panel h3 { color: var(--u-ink); }
.u3d-bubble, .u3d-narr {
  font-family: var(--u-book) !important; font-weight: 400 !important; text-transform: uppercase; letter-spacing: .3px;
  font-size: 20px !important; line-height: 1.3 !important;
}
.u3d-bubble { background: #fff; border: 2.5px solid var(--u-ink); box-shadow: 0 3px 0 rgba(43, 26, 16, .3); }
.u3d-narr { background: #fffdf2; border: 2px dashed var(--u-paper-edge); border-radius: 18px; padding: 10px 14px; }
.u3d-x { background: #fff; border: 3px solid var(--u-ink); box-shadow: 0 3px 0 var(--u-ink); }
.u3d-x:active { transform: translateY(3px); box-shadow: none; }
.u3d-btn {
  border: 3px solid var(--u-ink); background: var(--u-grn); color: #fff; box-shadow: var(--u-press);
  text-shadow: 0 2px 0 rgba(43, 26, 16, .4);
}
.u3d-btn.hay { background: var(--u-yel); color: var(--u-ink); text-shadow: none; box-shadow: var(--u-press); }
.u3d-btn.ghost { background: #fff; color: var(--u-ink); text-shadow: none; box-shadow: var(--u-press); }
.u3d-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--u-ink); }
.u3d-opt { border: 3px solid var(--u-ink); box-shadow: 0 4px 0 var(--u-ink); }
.u3d-opt:hover { border-color: var(--u-ink); background: #fffbe6; }
.u3d-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--u-ink); }
.u3d-opt.yes { border-color: var(--u-grn-d); background: #effbe0; }
.u3d-hint, .u3d-fact, .u3d-why, .u3d-deep, .u3d-goals li, .u3d-ledger-wrap { border: 2px solid rgba(43, 26, 16, .18); }
.u3d-chip, .u3d-jtile, .u3d-scard { border: 3px solid var(--u-ink); box-shadow: 0 3px 0 var(--u-ink); }
.u3d-chip.active { border-color: var(--u-red); background: #fff1ef; box-shadow: 0 3px 0 var(--u-red); }
.u3d-scard.cur { border-color: var(--u-red); box-shadow: 0 3px 0 var(--u-red); }
.u3d-jtile.locked { border-style: dashed; border-color: rgba(43, 26, 16, .3); box-shadow: none; }
.u3d-jpage-ic, .u3d-portrait { border: 3px solid var(--u-ink); }
.u3d-tut p { font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 21px; letter-spacing: .3px; }

/* the big action button: a yellow tractor-wheel with an ink rim */
.u3d-act {
  border: 4px solid var(--u-ink);
  background: radial-gradient(circle at 35% 30%, #fff3a6, var(--u-yel) 55%, #d9a800);
  box-shadow: 0 6px 0 var(--u-ink), 0 14px 26px rgba(0, 0, 0, .25);
}
.u3d-act:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--u-ink), 0 8px 16px rgba(0, 0, 0, .25); }
.u3d-act-tx { font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 17px; color: var(--u-ink); }
.u3d-joy-base { border: 3px solid rgba(43, 26, 16, .55); background: rgba(248, 242, 214, .35); }
.u3d-joy-knob { background: radial-gradient(circle at 35% 30%, #fff, #fff3a6 55%, var(--u-yel)); border: 3px solid var(--u-ink); }
.u3d-photo-cap { background: var(--u-paper); color: var(--u-ink); border: 3px solid var(--u-ink); font-family: var(--u-book); font-weight: 400; text-transform: uppercase; font-size: 18px; }
@media (max-width: 560px) {
  .u3d-say { font-size: 18px; }
  .u3d-q-main b { font-size: 17px; }
  .u3d-toast { font-size: 15.5px; }
  .u3d-bubble, .u3d-narr { font-size: 18px !important; }
}
