/* Farm v2: scrolling map, tool bar, buildings, orders and build panels. Loaded after style.css. */
.farm .map-wrap { flex: 1; min-height: 0; max-width: none; overflow: auto; direction: ltr; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; position: relative; }
.farm .map-wrap::-webkit-scrollbar { display: none; }
.map-size { position: relative; }
.farm .map { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.hud-name .lvl { display: flex; align-items: center; gap: 6px; }
.hud-name .star { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.hud-name .star i { font-style: normal; }
.xpbar { flex: 1; max-width: 120px; height: 8px; border-radius: 4px; background: var(--sand-2); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #f5d76e); border-radius: 4px; transition: width .4s; }
.res { align-items: center; }
.res .plan-chips { background: #fff3cf; display: inline-flex; gap: 2px; font-size: .85rem; }
.res .plan-chips i { font-style: normal; }
.bottom { gap: 8px; padding-top: 6px; background: linear-gradient(rgba(243, 230, 196, 0), var(--sand) 18px); }
.bottom .dog-say { min-height: 56px; padding: 6px 10px; }
.bottom .dog-say img { width: 42px; }
.bottom .dog-say p { font-size: .95rem; }
.seeds { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.seeds::-webkit-scrollbar { display: none; }
.seed { flex: none; display: flex; align-items: center; gap: 6px; border: 2px solid var(--sand-2); background: var(--paper); border-radius: 14px; padding: 4px 10px 4px 8px; text-align: start; }
.seed span { display: flex; flex-direction: column; line-height: 1.15; }
.seed b { font-size: .95rem; }
.seed small { font-size: .72rem; color: var(--ink-2); white-space: nowrap; }
.seed.on { border-color: var(--green); background: #e7f3dc; box-shadow: 0 0 0 2px rgba(79, 138, 53, .25); }
.seed:disabled { opacity: .5; }
.tools { gap: 6px; flex-wrap: nowrap; }
.tool { position: relative; flex: 1; border: 0; background: var(--paper); border-radius: 14px; padding: 6px 2px; font-size: 1.35rem; display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 3px 0 var(--sand-2); }
.tool small { font-size: .7rem; color: var(--ink-2); white-space: nowrap; }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sand-2); }
.tool .dot { position: absolute; top: 4px; right: 18%; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.ico { display: inline-block; vertical-align: middle; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }

.bld { pointer-events: auto; cursor: pointer; display: flex; justify-content: center; }
.bld > img:first-child { display: block; }
.bld.ghost > img:first-child { filter: grayscale(.8) brightness(1.1); opacity: .45; }
.bld .badge { position: absolute; top: -10px; left: 50%; translate: -50% 0; font-style: normal; font-size: 26px; white-space: nowrap; display: flex; align-items: center; }
.bld .plaque { font-size: 15px; font-weight: 700; background: var(--paper); border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); top: 30%; direction: rtl; }
.bld .idle { font-size: 20px; opacity: .7; }
.critter { position: absolute; bottom: -6px; margin-left: -20px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.ring.big { width: 40px; height: 40px; top: -18px; -webkit-mask: radial-gradient(circle, transparent 11px, #000 12px); mask: radial-gradient(circle, transparent 11px, #000 12px); }
.crop-tag { position: absolute; top: -16px; left: 50%; translate: 4px 0; font-style: normal; }
.map-badge { pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 250, 240, .95); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: 18px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); position: relative; overflow: hidden; white-space: nowrap; isolation: isolate; }
.pill.dim { opacity: .6; }
.pill .fill { position: absolute; inset: 0; background: #9fd3ef; transform-origin: left; animation: fillup 2.5s linear forwards; z-index: -1; }
.flash .pill { animation: flash .9s 2; }
.coin-glint { animation: twinkle .8s ease-in-out infinite; font-size: 30px !important; }
.critter-ev { pointer-events: auto; cursor: pointer; animation: hop 1s ease-in-out infinite; }
.tourist { font-size: 56px; }
.rain { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s; z-index: 5; background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(120, 170, 220, .4) 14px 16px); background-size: 60px 60px; }
.rain.on { opacity: 1; animation: rainfall .5s linear infinite; }
.farm .map-wrap { isolation: isolate; }
.farm .rain { position: fixed; }

.modal h3 { margin: 10px 0 2px; font-size: 1rem; text-align: start; color: var(--ink-2); }
.blist { display: flex; flex-direction: column; gap: 6px; text-align: start; }
.brow { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 6px 10px; border: 2px solid transparent; }
.brow.focus { border-color: var(--gold); background: #fff8df; }
.brow.done { opacity: .7; }
.brow.locked { opacity: .55; }
.bicon { width: 52px; flex: none; display: grid; place-items: center; font-size: 30px; }
.bicon img { max-width: 52px; max-height: 46px; }
.binfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.binfo small { color: var(--ink-2); font-size: .78rem; }
.bact { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bact .cost { font-weight: 700; white-space: nowrap; }
.tag { font-size: .8rem; background: var(--sand); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.ok { color: var(--green-d); }
.no { color: var(--red); }
.pic { width: 140px; align-self: center; }
.recipes { display: flex; flex-direction: column; gap: 8px; }
.recipe { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 8px; text-align: start; flex-wrap: wrap; }
.recipe .out { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; }
.recipe .out small { display: block; color: var(--ink-2); font-size: .75rem; }
.ins { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.need { display: inline-flex; align-items: center; gap: 2px; background: var(--sand); border-radius: 999px; padding: 2px 8px 2px 4px; font-weight: 700; font-size: .9rem; }
.orders { display: flex; flex-direction: column; gap: 10px; }
.order { background: #fffdf5; border-radius: 6px; padding: 12px; text-align: start; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 6px; rotate: -.5deg; }
.order:nth-child(even) { rotate: .6deg; }
.order.special { background: #fff3cf; }
.order .who { font-weight: 700; margin: 0; }
.order .note-text { margin: 0; line-height: 1.9; font-size: 1.05rem; }
.order .row { justify-content: flex-start; }
.order .ins { justify-content: flex-start; }
.stock { display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 8px; text-align: start; }
.sinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sinfo small { color: var(--ink-2); font-size: .78rem; }
.modal .note { text-align: center; }
.modal .note-text { line-height: 2; font-size: 1.1rem; }
.modal .note-text input.word { min-width: 3.2em; padding: 2px 8px; font-size: 1.1rem; }
.modal .note-text .check { width: 32px; height: 32px; font-size: 1rem; }
.levelup { background: linear-gradient(#fff6d6, var(--paper)); }
.lvl-burst { font-size: 70px; position: relative; line-height: 1; animation: pop .6s; }
.lvl-burst b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; padding-top: 8px; color: #7a4d00; }
.unlocks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; text-align: start; }
.unlocks li { background: #fff; border-radius: 12px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.sentence.practice { border: 2px dashed var(--gold); display: flex; flex-direction: column; gap: 6px; }
.sentence.practice .ptitle { font-size: .9rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kid table + .legend { font-size: .8rem; color: var(--ink-2); }
.causes { display: flex; flex-direction: column; gap: 8px; }
.cause { background: #fff; border-radius: 14px; padding: 10px; text-align: start; display: flex; flex-direction: column; gap: 6px; }
.cause small { color: var(--ink-2); }
.cause .row { justify-content: flex-start; gap: 6px; }
.book { text-align: start; background: #fff8e6; border-radius: 12px; padding: 8px 12px; }
.book summary { font-weight: 700; cursor: pointer; }
.book p { margin: 6px 0; font-size: .9rem; }
.pic.small { width: 90px; }
.thanks .note-text { font-size: 1.15rem; }
.theme-evening .cause, .theme-evening .book { background: var(--paper); color: var(--ink); }
.math .math-q { font-size: 1.5rem; font-weight: 700; }
.math-a { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.math-a.ok input { border-color: var(--green); background: #f1f9ea; }
input.num { width: 6em; text-align: center; font-size: 1.4rem; direction: ltr; }
.chip.big { font-size: 1.5rem; min-width: 64px; padding: 8px 14px; }
.math-morning { align-self: center; }
.chip.right { background: #d8f0c6; border-color: var(--green); color: var(--green-d); }
.math-ok { font-size: 1.8rem; font-weight: 700; color: var(--green-d); background: #e7f3dc; border: 3px solid var(--green); border-radius: 16px; padding: 8px 14px; animation: pop .35s; }
.math-ok b { display: block; font-size: 1.3rem; }
.theme-evening .math-ok { background: #2d4221; color: #b6e39a; }
.fly-coin { position: fixed; z-index: 9500; font-size: 30px; font-style: normal; pointer-events: none; translate: -50% -50%; animation: fly 1s ease-in forwards; }
@keyframes fly { to { transform: translate(var(--tx), var(--ty)) scale(.6); opacity: .3; } }
.sign-board {
  background: linear-gradient(#d9b07a, #c99a5e); border: 6px solid #8a5a33; border-radius: 10px; padding: 14px 10px;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
}
.sign-word { border: 0; background: rgba(255, 248, 230, .85); color: #3b2a1a; border-radius: 8px; padding: 6px 10px; font-size: 1.25rem; font-weight: 700; font-family: 'Secular One', 'Rubik', sans-serif; }
.sign-word.nope { opacity: .5; }
.sign-word.found { background: #ffd6cc; outline: 3px solid var(--red); }
.sign-word.fixed { background: #d8f0c6; outline: 3px solid var(--green); }
.sign-fix { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.deco-spot { pointer-events: auto; cursor: pointer; display: flex; justify-content: center; }
.deco-spot img { display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15)); }
.spot-mark {
  display: inline-block; font-size: 22px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 250, 240, .75);
  border: 2px dashed #c9a24a; color: #7a5a1e; font-weight: 700; white-space: nowrap;
}
.deco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.deco-item { border: 2px solid var(--sand-2); background: #fff; border-radius: 14px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.deco-item img { height: 56px; width: auto; max-width: 90%; object-fit: contain; }
.deco-item b { font-size: .85rem; }
.deco-item small { font-size: .72rem; color: var(--ink-2); }
.deco-item.on { border-color: var(--gold); background: #fff3cf; }
.deco-item:disabled { opacity: .45; }
.plaque-line { background: linear-gradient(#e9cf9a, #d9b77a); border: 3px solid #8a5a33; border-radius: 8px; padding: 8px 12px; font-family: 'Secular One', 'Rubik', sans-serif; color: #3b2a1a; }
.library .story .note-text { text-align: start; line-height: 1.8; }
.library .q { margin: 0; }
.answers { display: flex; flex-direction: column; gap: 8px; }
.answers .chip { font-size: 1.05rem; text-align: start; }
.note.bonus p { margin: 2px 0; }
.theme-evening .deco-item { background: var(--paper); color: var(--ink); }
.theme-evening .spot-mark { background: rgba(51, 39, 28, .85); color: var(--gold); }
.pasture { pointer-events: auto; cursor: pointer; width: 270px; height: 110px; translate: -50% -100%; display: flex; align-items: flex-end; justify-content: center; }
.herd { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: flex-end; }
.herd img { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { border: 2px solid var(--sand-2); background: #fff; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; }
.choice b { font-size: 1.1rem; }
.choice small { color: var(--ink-2); }
.choice .ins { justify-content: flex-start; }
.choice.urgent { border-color: var(--terra); background: #fff1ea; }
.choice:disabled { opacity: .5; }
.fert-tag { position: absolute; bottom: 2px; left: 50%; translate: 18px 0; font-style: normal; font-size: 18px; }
.seed.fert { border-style: dashed; }
.theme-evening .choice { background: var(--paper); color: var(--ink); }
/* district names on the map, and the district jump bar */
.district-label { font-family: 'Secular One', 'Rubik', sans-serif; font-size: 34px; fill: #6e5a2e; opacity: .8; paint-order: stroke; stroke: rgba(255, 250, 235, .7); stroke-width: 6px; }
.jump {
  position: absolute; top: 6px; left: 50%; translate: -50% 0; z-index: 10; display: flex; gap: 4px; max-width: calc(100% - 16px);
  overflow-x: auto; scrollbar-width: none; background: rgba(255, 250, 240, .85); border-radius: 999px; padding: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.jump::-webkit-scrollbar { display: none; }
.jump button { flex: none; border: 0; background: transparent; border-radius: 999px; padding: 2px 8px; font-size: 1.15rem; display: flex; flex-direction: column; align-items: center; line-height: 1.05; min-width: 44px; min-height: 44px; justify-content: center; }
.jump button small { font-size: .6rem; color: var(--ink-2); white-space: nowrap; }
.jump button:active { background: var(--sand-2); }
.theme-evening .jump { background: rgba(51, 39, 28, .9); }
/* small objects get a bigger invisible tap area */
.deco.tappable { padding: 14px 14px 0; box-sizing: content-box; }
@keyframes fillup { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes flash { 50% { background: #ffd0c8; scale: 1.2; } }
@keyframes hop { 50% { translate: -50% -108%; } }
@keyframes rainfall { to { background-position: -20px 60px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* arrows at the screen edge pointing to ready things off screen */
.edge-arrows { position: absolute; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.edge-arrow { position: absolute; translate: -50% -50%; pointer-events: auto; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold, #e0a526); background: rgba(255, 252, 245, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; font-size: 22px; padding: 0; animation: nudge 1.6s ease-in-out infinite; }
.edge-arrow .pointer { position: absolute; inset: -17px; font-style: normal; font-size: 14px; line-height: 1; color: var(--terra, #c4643a); display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.edge-arrow b { position: absolute; bottom: -6px; left: -6px; background: var(--terra, #c4643a); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; }
.calm .edge-arrow { animation: none; }
.theme-evening .edge-arrow { background: var(--paper); }
@keyframes nudge { 50% { scale: 1.08; } }
/* one clear badge per object: things to do stand out, status stays quiet */
.badge.quiet { font-size: 16px !important; opacity: .55; filter: none; }
.bld .plaque.soon { font-size: 12px; font-weight: 500; opacity: .75; box-shadow: none; background: rgba(255, 250, 240, .8); }
.bld .plaque.go { background: #ffe9a8; border: 2px solid var(--gold, #e0a526); }
.pill.dim { opacity: .55; font-size: 14px; box-shadow: none; padding: 2px 8px; }
.vision .pill.dim, .vision .badge.quiet, .vision .bld .plaque.soon { opacity: .85; }
.ground { filter: saturate(.85); }
/* the ring that marks each stop of a district tour */
.tour-ring { position: absolute; width: 190px; height: 110px; translate: -50% -50%; border: 6px solid var(--gold, #e0a526); border-radius: 50%; z-index: 3600; pointer-events: none; animation: tourpulse 1.2s ease-in-out infinite; }
.calm .tour-ring { animation: none; }
@keyframes tourpulse { 50% { scale: 1.12; opacity: .6; } }
/* the map grows with the farm: only open districts have land, and new land rises into view */
.map-size { position: relative; overflow: hidden; }
.jump button[hidden] { display: none; }
.new-land { transform-box: fill-box; transform-origin: center; animation: landrise 1.8s ease-out; }
.calm .new-land { animation: none; }
@keyframes landrise { from { opacity: 0; transform: scale(.8); } }
/* wild edge of the land, and the signpost toward the next district */
.edge-prop { pointer-events: none; opacity: .95; }
.signpost { pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 10px; }
.signpost img { display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15)); }
.sign-plate { position: absolute; top: -6px; left: 50%; translate: -50% 0; background: var(--paper); border: 2px solid #8a5a33; border-radius: 12px; padding: 3px 10px; font-size: 15px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); direction: rtl; text-align: center; }
.sign-plate small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.vision .sign-plate { font-size: 22px; border-width: 3px; }
