/* Ink-sketch theme (in color): paper, ink lines, hard offset shadows,
 * and one "highlighter" accent (yellow) for things you can act on. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --ink: #232323;
  --ink2: #555;
  --muted: #777;
  --paper: #f5f4ef;
  --paper2: #ecebe4;
  --white: #fffefa;
  --hl: #ffe14d;       /* highlighter */
  --hl-d: #f2c500;
  --line: 2.5px solid var(--ink);
  --shadow: 3px 3px 0 var(--ink);
  --rough: 14px 18px 13px 20px / 18px 13px 20px 14px; /* slightly uneven = hand-drawn */
  --fs: clamp(13px, 1.7vmin + 6px, 19px);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hatch: repeating-linear-gradient(-45deg, rgba(35, 35, 35, 0.32) 0 1.5px, transparent 1.5px 6px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--paper) var(--noise); color: var(--ink);
  font-family: var(--font); font-size: var(--fs);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: manipulation;
}
button { font-family: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
/* touch-action is NOT inherited, so set it on every element: no double-tap zoom anywhere.
 * (Canvases use 'none' below; the shop list allows vertical scrolling.) */
* { touch-action: manipulation; }
#list { touch-action: pan-y; }
#tutorMask .m, #tutorCover { touch-action: none; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- layout */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 46%);
  grid-template-areas: "hud" "scene" "panel";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
@media (min-aspect-ratio: 5/4) {
  #app {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "hud hud" "scene panel";
  }
}

#hud {
  grid-area: hud;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--paper) var(--noise);
  border-bottom: var(--line);
  z-index: 2; min-width: 0;
}
.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--white); border: var(--line); border-radius: var(--rough);
  box-shadow: var(--shadow);
  padding: 4px 12px 4px 6px;
  font-weight: 900; white-space: nowrap; min-width: 0;
}
.money { flex: 1 1 auto; font-size: 1.2em; overflow: hidden; }
.money .sub { font-size: 0.68em; color: var(--ink2); font-weight: 800; margin-left: 2px; overflow: hidden; text-overflow: ellipsis; }
.money.bump #money { animation: bump 0.25s ease-out; }
#money { display: inline-block; }
@keyframes bump { 40% { transform: scale(1.18) rotate(-2deg); } }
.coin-ico {
  width: 1.25em; height: 1.25em; border-radius: 50%; flex: none;
  background: var(--hl); border: 2px solid var(--ink);
  position: relative;
}
.coin-ico::after { content: "$"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.7em; font-weight: 900; }
.level { flex: none; }
.icon-btn {
  flex: none; width: 2.3em; height: 2.3em;
  background: var(--white); border: var(--line); border-radius: var(--rough); box-shadow: var(--shadow);
  font-size: 1em; font-weight: 900;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

#sceneWrap { grid-area: scene; position: relative; overflow: hidden; min-height: 0; }
#sceneWrap::after { /* paper grain over the drawing */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--noise); mix-blend-mode: multiply; opacity: 0.9;
}
#sceneWrap canvas, #jobWrap canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none;
}

/* ---- goal card (top-left of scene) */
#goal {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  width: min(310px, calc(100% - 20px));
  background: var(--white); border: var(--line); border-radius: var(--rough); box-shadow: var(--shadow);
  padding: 6px 10px 7px; display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.goal-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
#goalStage { font-weight: 900; font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#goalStep { flex: none; font-size: 0.72em; font-weight: 800; color: var(--ink2); background: var(--paper2); border-radius: 99px; padding: 1px 8px; }
.goal-bar { flex: 1 1 auto; height: 11px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--white); }
.goal-bar i { display: block; height: 100%; width: 0; background: var(--hatch), var(--white); border-right: 2px solid var(--ink); transition: width 0.4s; }
#goalPct { flex: none; font-size: 0.85em; font-weight: 900; min-width: 2.6em; text-align: right; }

/* ---- telop (status ticker, bottom of scene) */
#telop {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: var(--line); border-radius: var(--rough); box-shadow: var(--shadow);
  padding: 6px 10px 6px 6px; font-weight: 800; min-width: 0;
  pointer-events: none;
}
#telopTag { flex: none; background: var(--ink); color: #fff; font-size: 0.72em; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.05em; }
#telopText {
  min-width: 0; overflow: hidden; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: auto-phrase;
}
/* news: an announcement is playing (tag shows its icon) */
#telop.news #telopTag { background: var(--white); color: var(--ink); font-size: 1.1em; padding: 0 2px; letter-spacing: 0; }
#telop.big { font-size: 1.08em; border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }
#telop.big #telopText { font-weight: 900; }
#telop.warn { background: var(--paper2); }
#telop.pop { animation: telopPop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes telopPop { from { transform: scale(0.85); opacity: 0.4; } }
#telop.ready { background: var(--ink); color: #fff; }
#telop.ready #telopTag { background: #fff; color: var(--ink); }

/* ---------------------------------------------------------------- panel */
#panel {
  grid-area: panel;
  display: flex; flex-direction: column; gap: 9px;
  padding: 9px 10px 12px;
  background: var(--paper2) var(--noise);
  border-top: var(--line);
  min-height: 0; min-width: 0;
}
@media (min-aspect-ratio: 5/4) {
  #panel { border-top: 0; border-left: var(--line); }
}

#jobHeader {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  column-gap: 8px; row-gap: 4px; font-weight: 900; padding: 0 2px;
}
#jobIcon { grid-row: span 2; font-size: 1.5em; }
.job-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
#jobTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jobNew {
  flex: none; font-style: normal; font-size: 0.7em; font-weight: 900; letter-spacing: 0.05em;
  background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 7px;
}
.bar { height: 11px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--hatch), var(--white); border-right: 2px solid var(--ink); transition: width 0.15s; }

#jobWrap {
  position: relative; flex: 1 1 auto; min-height: 90px;
  border: var(--line); border-radius: var(--rough); box-shadow: var(--shadow);
  overflow: hidden; background: var(--white);
}

/* ---- big NEXT UPGRADE button */
#upgradeBar { display: flex; gap: 10px; flex: none; align-items: stretch; }
#btnNext {
  position: relative; overflow: hidden; flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 10px 12px; min-height: 4.6em;
  background: var(--white); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--rough); box-shadow: 4px 4px 0 var(--ink);
  text-align: left;
  transition: transform 0.08s;
}
#btnNext:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
#nextFill { /* pencil hatching fills up as you earn */
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--hatch);
  border-right: 2px dashed rgba(35, 35, 35, 0.6);
  transition: width 0.12s linear;
}
#btnNext > span { position: relative; }
#nextIcon { font-size: 2em; flex: none; }
#btnNext .txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.2; }
#nextLabel { font-size: 0.78em; font-weight: 900; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
#nextName { font-weight: 900; font-size: 1.32em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.costbox { flex: none; margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#nextCost {
  font-weight: 900; font-size: 1.3em;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 3px 10px;
}
#nextCost:empty { display: none; }
#nextNeed { font-size: 0.78em; font-weight: 900; white-space: nowrap; background: var(--white); padding: 0 4px; border-radius: 4px; }
/* Narrow button (small landscape phones): 2 rows -> name on top, price below, so the
 * item name the telop refers to is always visible. Queries the button's own width. */
#btnNext { container-type: inline-size; }
@container (max-width: 250px) {
  #nextIcon { display: none; }
  #btnNext .txt { flex: 1 1 100%; }
  .costbox { flex-direction: row; align-items: center; gap: 8px; margin-left: 0; }
}
#btnNext.ready { background: var(--hl); animation: ready 0.9s ease-in-out infinite; }
#btnNext.ready #nextFill { display: none; }
#btnNext.ready #nextNeed { background: transparent; animation: blink 0.9s steps(2) infinite; }
#btnNext.ready #nextIcon { animation: wiggle 1s infinite; }
#btnNext.done { background: var(--paper2); }
#btnNext.done #nextFill { display: none; }
#btnNext.nope { animation: nope 0.3s; }
@keyframes ready { 50% { transform: translateY(-3px) rotate(-0.6deg); box-shadow: 6px 7px 0 var(--ink); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-14deg) scale(1.12); } 85% { transform: rotate(10deg) scale(1.12); } }
@keyframes nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

#btnShop {
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 4.6em; padding: 6px 10px;
  background: var(--white); color: var(--ink); font-weight: 900; font-size: 0.85em;
  border: 3px solid var(--ink); border-radius: var(--rough); box-shadow: 4px 4px 0 var(--ink);
}
#btnShop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.shop-ico { font-size: 1.6em; line-height: 1.1; }
#shopBadge {
  position: absolute; top: -9px; right: -9px;
  min-width: 1.7em; height: 1.7em; padding: 0 5px; border-radius: 99px;
  background: var(--hl); color: var(--ink); border: 2px solid var(--ink);
  font-style: normal; font-weight: 900; font-size: 0.9em;
  display: flex; align-items: center; justify-content: center;
  animation: pop 1.4s infinite;
}
@keyframes pop { 0%, 80%, 100% { transform: scale(1); } 90% { transform: scale(1.25); } }

/* ---------------------------------------------------------------- toast */
#toast {
  position: absolute; left: 50%; top: 84px; z-index: 4; transform: translate(-50%, -30px);
  max-width: calc(100% - 32px);
  background: var(--white); color: var(--ink);
  border: var(--line); border-radius: var(--rough); box-shadow: var(--shadow);
  padding: 7px 16px;
  font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s;
  opacity: 0; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.good b { background: var(--hl); padding: 0 4px; }
#toast.warn { background: var(--paper2); }
#toast .ti { margin-right: 6px; }

/* home-income coins fly above the tutorial mask so the "house -> money" link stays visible */
.coinfly.home { z-index: 58; width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.homefloat {
  position: fixed; z-index: 58; transform: translate(-50%, -100%);
  font-weight: 900; font-size: 1.05em; color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: 99px; padding: 1px 9px;
  pointer-events: none; white-space: nowrap;
  animation: homeFloat 1.1s ease-out forwards;
}
@keyframes homeFloat {
  0% { transform: translate(-50%, -60%) scale(0.6); opacity: 0; }
  15% { transform: translate(-50%, -100%) scale(1.1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%, -220%) scale(1); opacity: 0; }
}
.coinfly {
  position: fixed; z-index: 50; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: var(--hl); border: 2px solid var(--ink);
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.5, -0.3, 0.7, 0.4), opacity 0.5s ease-in;
}

/* ---------------------------------------------------------------- tutorial */
/* Spotlight: four dark panels leave a hole over the target and block taps elsewhere. */
#tutorMask { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
#tutorMask .m {
  position: fixed; background: rgba(20, 22, 32, 0.6); pointer-events: auto;
}
/* panels jump to the new spot, then the whole mask fades in (sliding panels look broken mid-way) */
#tutorMask.fade { animation: maskIn 0.3s ease-out; }
@keyframes maskIn { from { opacity: 0; } }
#tutorCover { position: fixed; display: none; pointer-events: auto; }
#tutorMask.block #tutorCover { display: block; }
#tutorRing {
  position: fixed; display: none; pointer-events: none;
  border: 3px dashed #fff; border-radius: 16px;
  animation: ringPulse 1s ease-in-out infinite;
}
#tutorMask.ring #tutorRing { display: block; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.35); } }

#tutor {
  position: fixed; z-index: 60; left: 0; top: 0;
  max-width: min(330px, calc(100vw - 16px));
  background: var(--white); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--rough); box-shadow: 4px 4px 0 var(--ink);
  padding: 12px 16px 12px; font-weight: 900; font-size: 1.08em; line-height: 1.45;
  word-break: auto-phrase;
  pointer-events: none;
  display: flex; flex-direction: column;
  animation: tutFloat 2.6s ease-in-out infinite;
}
/* pop in on every new step, then float gently (small + slow so OK stays easy to hit) */
#tutor.pop { animation: tutPop 0.38s cubic-bezier(0.2, 1.6, 0.4, 1), tutFloat 2.6s ease-in-out 0.38s infinite; }
@keyframes tutPop { from { transform: scale(0.6); opacity: 0; } }
@keyframes tutFloat { 50% { transform: translateY(-5px); } }
#tutorNum {
  position: absolute; left: -12px; top: -15px;
  background: var(--ink); color: #fff; border: 2px solid var(--white);
  border-radius: 99px; padding: 2px 9px; font-size: 0.72em; letter-spacing: 0.04em;
}
#tutor .arrow {
  position: absolute; left: var(--ax, 50%); width: 18px; height: 18px; margin-left: -9px;
  background: var(--white); border: 3px solid var(--ink);
  transform: rotate(45deg);
}
#tutor[data-place="above"] .arrow { bottom: -11px; border-top: 0; border-left: 0; }
#tutor[data-place="below"] .arrow { top: -11px; border-bottom: 0; border-right: 0; }
#tutor[data-place="center"] .arrow, #tutor[data-place="inside"] .arrow { display: none; }
#tutorOk {
  display: none; align-self: flex-end;
  margin: 8px -4px -2px 0; min-width: 4.4em; padding: 7px 18px;
  font-size: 0.95em; font-weight: 900; color: var(--ink);
  background: var(--hl); border: 2.5px solid var(--ink); border-radius: var(--rough); box-shadow: 2px 2px 0 var(--ink);
  pointer-events: auto;
}
#tutor.has-ok #tutorOk { display: block; }
#tutorOk:active { transform: translate(2px, 2px); box-shadow: none; }

/* ---------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* The shop sits exactly over the job/button panel (position set from JS), never over
 * the house, so every purchase can be watched changing the house right away. */
#shop { inset: auto; padding: 6px; background: transparent; align-items: stretch; justify-content: stretch; }
.sheet {
  width: 100%; height: 100%; max-height: none;
  display: flex; flex-direction: column;
  background: var(--paper) var(--noise);
  border: 3px solid var(--ink); border-radius: var(--rough); box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  animation: sheetIn 0.28s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
.sheet-head h2 { margin: 0; font-size: 1.4em; font-weight: 900; background: linear-gradient(transparent 55%, var(--hl) 55%); padding: 0 4px; }
#tabs { display: flex; gap: 6px; padding: 8px 12px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 6px 14px; background: var(--white); font-weight: 900; font-size: 0.9em;
  border: 2px solid var(--ink); border-radius: var(--rough); box-shadow: 2px 2px 0 var(--ink); white-space: nowrap;
}
.tab.active { background: var(--ink); color: #fff; }
#list { overflow-y: auto; padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.card {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: var(--rough); box-shadow: var(--shadow);
  padding: 8px 10px;
}
.card .ic { font-size: 1.8em; width: 1.6em; text-align: center; flex: none; }
.card .info { flex: 1 1 auto; min-width: 0; }
.card .nm { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sb { font-size: 0.78em; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .sb:empty { display: none; }
.card .buy {
  flex: none; min-width: 5em; padding: 8px 12px;
  font-weight: 900; background: var(--white); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: var(--rough); box-shadow: 2px 2px 0 var(--ink); white-space: nowrap;
}
.card .buy:active { transform: translate(2px, 2px); box-shadow: none; }
.card.poor .buy { color: var(--muted); border-color: #999; box-shadow: 2px 2px 0 #999; }
.card.ready .buy { background: var(--hl); }
.card.owned .buy { background: var(--paper2); border-style: dashed; box-shadow: none; }
.card.use .buy { background: var(--ink); color: #fff; }
.card.locked { opacity: 0.5; }
.card.locked .buy { border-style: dashed; box-shadow: none; }

/* ---- title */
#title {
  flex-direction: column;
  background: linear-gradient(rgba(245, 244, 239, 0) 18%, rgba(245, 244, 239, 0.88) 58%, rgba(245, 244, 239, 0.98));
  align-items: center; justify-content: flex-end;
  padding-bottom: max(6vh, 24px);
}
.title-card { text-align: center; max-width: 520px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; animation: float 3s ease-in-out infinite; }
.logo-house { font-size: clamp(40px, 9vmin, 72px); }
.logo-text { font-size: clamp(42px, 10vmin, 86px); font-weight: 900; letter-spacing: -0.02em; line-height: 1; color: var(--ink); transform: rotate(-3deg); }
.logo-text .hl { background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); padding: 0 6px; }
@keyframes float { 50% { transform: translateY(-6px); } }
.logo-sub { word-break: auto-phrase; font-weight: 900; font-size: 1.05em; }
.tagline { margin: 0; word-break: auto-phrase; text-wrap: balance; color: var(--ink2); font-weight: 700; line-height: 1.5; max-width: 26em; }
.btn-primary {
  margin-top: 6px; min-width: 12em; padding: 14px 28px;
  font-size: 1.4em; font-weight: 900; letter-spacing: 0.04em;
  background: var(--hl); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--rough); box-shadow: 5px 5px 0 var(--ink);
  animation: breathe 1.6s ease-in-out infinite;
}
.btn-primary:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
@keyframes breathe { 50% { transform: scale(1.05) rotate(-1deg); } }
.lang-switch { display: flex; gap: 4px; background: var(--white); border: 2.5px solid var(--ink); border-radius: var(--rough); box-shadow: var(--shadow); padding: 4px; margin-top: 4px; }
.lang { padding: 7px 18px; border-radius: 10px; font-weight: 900; background: transparent; color: var(--ink2); min-width: 4.5em; }
.lang.active { background: var(--ink); color: #fff; }
body.on-title #goal, body.on-title #telop { visibility: hidden; }
.dev-reset {
  margin-top: 2px; padding: 6px 12px; background: transparent;
  font-size: 0.78em; font-weight: 800; color: var(--ink2);
  border: 2px dashed var(--ink2); border-radius: var(--rough);
}

@media (max-height: 420px) {
  #title { padding-bottom: 12px; }
  .title-card { gap: 6px; }
  .tagline { display: none; }
  .btn-primary { padding: 10px 24px; font-size: 1.15em; }
  #goal { width: min(280px, calc(100% - 20px)); }
}

/* ---- loading */
#loading {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--paper) var(--noise);
  transition: opacity 0.4s;
}
#loading.gone { opacity: 0; pointer-events: none; }
.loader-house { font-size: 64px; animation: float 1.2s ease-in-out infinite; }
.loader-bar { width: 160px; height: 14px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--white); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; background: var(--hatch); animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
