:root {
  --ink: #2b1d12;
  --paper: #fff8e7;
  --orange: #e8a13a;
  --panel: rgba(43, 29, 18, 0.72);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fc6e8;
  color: var(--paper);
  font: 500 15px/1.4 'Inter', system-ui, sans-serif;
}

#farm {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
  touch-action: none;
  image-rendering: pixelated;
}
#farm.dragging { cursor: grabbing; }

.brand {
  position: fixed;
  top: 16px;
  left: 16px;
  margin: 0;
  pointer-events: none;
  font: 400 clamp(28px, 4.2vw, 46px)/0.9 'Anton', Impact, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(43, 29, 18, 0.35);
}
.brand small {
  display: block;
  margin-top: 6px;
  font: 600 12px/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.3em;
  color: var(--orange);
  text-shadow: 0 1px 0 var(--ink);
}

#minimap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 220px;
  height: 128px;
  border-radius: 10px;
  background: var(--panel);
  border: 2px solid rgba(255, 248, 231, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel);
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.6s ease;
  white-space: nowrap;
}
.hint.gone { opacity: 0; }

.projects {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.projects a {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(255, 248, 231, 0.35);
}
.projects a:hover, .projects button:hover { background: rgba(43, 29, 18, 0.9); }
.projects button {
  padding: 8px 14px; border-radius: 999px; background: var(--panel); color: var(--paper); cursor: pointer;
  font: 600 14px/1.4 'Inter', system-ui, sans-serif; border: 1px solid rgba(255, 248, 231, 0.35);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.viewpad {
  position: fixed;
  right: 16px;
  bottom: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(255, 248, 231, 0.35);
}
.viewpad button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--paper);
  font: 600 20px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
}
.viewpad button:hover:not(:disabled) { background: rgba(255, 248, 231, 0.15); }
.viewpad button:disabled { opacity: 0.35; cursor: default; }
.viewpad #tilt-up, .viewpad #tilt-down { font-size: 13px; height: 28px; }
.viewpad .sep { width: 22px; height: 1px; margin: 3px 0; background: rgba(255, 248, 231, 0.3); }
#tilt-level { display: flex; flex-direction: column-reverse; gap: 2px; }
#tilt-level i { display: block; width: 12px; height: 4px; border-radius: 1px; background: rgba(255, 248, 231, 0.25); }
#tilt-level i.on { background: var(--orange); }

.floorpad {
  position: fixed;
  right: 72px;
  bottom: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(255, 248, 231, 0.35);
}
.floorpad button {
  width: 36px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--paper);
  font: 600 13px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
}
.floorpad button:hover:not(:disabled) { background: rgba(255, 248, 231, 0.15); }
.floorpad button:disabled { opacity: 0.35; cursor: default; }
#floor-label { font: 600 11px/1 'Inter', system-ui, sans-serif; color: var(--orange); padding: 2px 0; }

.settings {
  position: fixed;
  left: 16px;
  bottom: 16px;
}
.gear {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 231, 0.35);
  background: var(--panel);
  color: var(--paper);
  cursor: pointer;
  transition: opacity 0.4s ease, transform 0.3s ease;
}
.gear svg { display: block; width: 100%; height: 100%; }
.gear:hover { background: rgba(43, 29, 18, 0.9); }
.settings.open .gear { transform: rotate(45deg); }
.tray {
  position: absolute;
  left: 0;
  bottom: 50px;
  width: 260px;
  padding: 12px 14px 14px;
  border-radius: 12px;
  background: rgba(43, 29, 18, 0.92);
  border: 1px solid rgba(255, 248, 231, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.tray h2 { margin: 0 0 8px; font: 400 18px/1 'Anton', Impact, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.tray label { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 14px; cursor: pointer; }
.tray input { margin: 3px 0 0; accent-color: var(--orange); width: 16px; height: 16px; flex: none; }
.tray small { display: block; margin-top: 2px; font-size: 12px; opacity: 0.7; }
.tray label:has(input:disabled) { opacity: 0.5; cursor: default; }

/* Hide UI: everything goes, and the settings button fades until the pointer finds it */
.brand, .projects, .viewpad, .floorpad, #minimap { transition: opacity 0.4s ease; }
body.ui-hidden .brand, body.ui-hidden .projects, body.ui-hidden .viewpad, body.ui-hidden .floorpad,
body.ui-hidden #minimap, body.ui-hidden .hint { opacity: 0; pointer-events: none; }
body.ui-hidden .settings:not(:hover):not(.open):not(:focus-within) .gear { opacity: 0; }

@media (max-width: 600px) {
  #minimap { width: 150px; height: 88px; right: 12px; bottom: 12px; }
  .viewpad { right: 12px; bottom: 112px; }
  .floorpad { right: auto; left: 12px; bottom: 62px; }
  .settings { left: 12px; bottom: 12px; }
  .tray { width: min(260px, calc(100vw - 24px)); }
  .viewpad button { width: 32px; height: 32px; font-size: 17px; }
  .projects { top: auto; bottom: 112px; right: 64px; flex-direction: column; align-items: flex-end; }
  .hint { bottom: auto; top: 96px; font-size: 13px; white-space: normal; width: max-content; max-width: calc(100vw - 24px); text-align: center; box-sizing: border-box; }
}

/* ---------- helping out: chore markers, the chore board, thank-yous ---------- */
.chore-layer { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.chore-marker {
  position: absolute; left: -13px; top: -30px; width: 26px; height: 26px; padding: 0;
  border-radius: 999px 999px 999px 4px; border: 2px solid var(--ink); background: var(--orange);
  color: var(--ink); font: 700 15px/1 'Inter', system-ui, sans-serif; cursor: pointer; pointer-events: auto;
  box-shadow: 0 3px 0 rgba(43, 29, 18, 0.45); transform-origin: 13px 30px; animation: bob 1.6s ease-in-out infinite;
}
.chore-marker:hover { background: #f4b95a; }
.chore-marker span { display: block; margin-top: -1px; }
.chore-marker.working { background: conic-gradient(var(--paper) 0 var(--p, 0%), var(--orange) 0); animation: fill var(--ms) linear forwards; }
.chore-marker.working span { opacity: 0; }
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes fill { to { --p: 100%; } }
@keyframes bob { 50% { margin-top: -4px; } }

.board-wrap { position: fixed; left: 66px; bottom: 16px; }
.board-btn {
  position: relative; width: 40px; height: 40px; padding: 9px; border-radius: 999px;
  border: 1px solid rgba(255, 248, 231, 0.35); background: var(--panel); color: var(--paper); cursor: pointer;
}
.board-btn svg { display: block; width: 100%; height: 100%; }
.board-btn:hover { background: rgba(43, 29, 18, 0.9); }
.board-count:not(:empty) {
  position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: var(--ink); font: 700 11px/18px 'Inter', system-ui, sans-serif;
}
.board {
  position: absolute; left: 0; bottom: 50px; width: 300px; max-height: min(560px, calc(100vh - 140px)); overflow: auto;
  padding: 12px 14px 12px; border-radius: 12px; background: rgba(43, 29, 18, 0.94);
  border: 1px solid rgba(255, 248, 231, 0.35); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); font-size: 13px;
}
.board h2 { margin: 0 0 4px; font: 400 18px/1 'Anton', Impact, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.board h3 { margin: 10px 0 2px; font: 600 11px/1.2 'Inter', system-ui, sans-serif; color: var(--orange); text-transform: uppercase; letter-spacing: 0.06em; }
.board .when { opacity: 0.75; font-size: 12px; margin-bottom: 8px; }
.board .who { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 6px 0; border-top: 1px solid rgba(255, 248, 231, 0.15); }
.board .who .doing { opacity: 0.85; }
.board .who .bars { grid-column: 1 / -1; display: flex; gap: 12px; }
.board .barwrap { display: flex; align-items: center; gap: 6px; flex: 1; }
.board .barwrap small { font-size: 11px; opacity: 0.7; }
.board .bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 248, 231, 0.18); overflow: hidden; }
.board .bar i { display: block; height: 100%; background: var(--orange); }
.board .job { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.board .by-them { opacity: 0.6; font-size: 12px; }
.board .by-you { color: var(--orange); font-size: 12px; }
.board .later { opacity: 0.5; font-size: 12px; }
.board .help-btn { font: 600 12px/1 'Inter', system-ui, sans-serif; padding: 4px 10px; border-radius: 999px; border: 0; background: var(--orange); color: var(--ink); cursor: pointer; }
.board .tally { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid rgba(255, 248, 231, 0.15); opacity: 0.85; }

.toasts { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 30; pointer-events: none; }
.toast { padding: 8px 14px; border-radius: 999px; background: rgba(43, 29, 18, 0.92); border: 1px solid rgba(255, 248, 231, 0.35); font-size: 14px; transition: opacity 0.6s ease; max-width: min(520px, 90vw); text-align: center; }
.toast.thanks, .toast.freed { border-color: var(--orange); }
.toast.gone { opacity: 0; }
body.ui-hidden .board-wrap:not(:hover):not(:focus-within) { opacity: 0; }
@media (max-width: 600px) { .board-wrap { left: 60px; bottom: 12px; } .board { width: min(300px, calc(100vw - 72px)); } }

/* ---------- a hog's card (game/card.js): on the farm, and in the Stud Book ---------- */
.hog-card { font-size: 13px; }
.hog-card .hc-head { display: flex; flex-direction: column; gap: 2px; }
.hog-card .hc-name { font: 400 22px/1 'Anton', Impact, sans-serif; letter-spacing: 0.03em; text-transform: uppercase; }
.hog-card .hc-kind { font-size: 12px; opacity: 0.8; }
.hog-card .hc-status { margin: 8px 0; color: var(--orange); }
.hog-card .hc-stats { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; }
.hog-card .hc-stat { font-size: 12px; }
.hog-card .hc-bar { height: 7px; border-radius: 4px; background: rgba(255, 248, 231, 0.18); overflow: hidden; min-width: 90px; }
.hog-card .hc-bar i { display: block; height: 100%; background: #c9a24f; }
.hog-card .hc-bar i.high { background: var(--orange); }
.hog-card .hc-num { font-weight: 600; min-width: 20px; text-align: right; }
.hog-card .hc-family, .hog-card .hc-life { margin: 8px 0 0; font-size: 12px; opacity: 0.8; }
.oinkos .hog-card { color: #000; }
.oinkos .hog-card .hc-name { color: #0a246a; font: 700 18px/1.1 'Trebuchet MS', Tahoma, sans-serif; text-transform: none; letter-spacing: 0; }
.oinkos .hog-card .hc-status { color: #1f6d1f; }
.oinkos .hog-card .hc-bar { background: #e6e3d6; }
.oinkos .hog-card .hc-bar i { background: #6b9be0; }
.oinkos .hog-card .hc-bar i.high { background: #2f7d2f; }
/* the card on the farm, next to the pig that was clicked */
.hog-pop { position: fixed; z-index: 40; width: 270px; padding: 12px 14px; border-radius: 12px; background: rgba(43, 29, 18, 0.95); border: 1px solid rgba(255, 248, 231, 0.35); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.hog-pop .hp-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--paper); font-size: 18px; cursor: pointer; opacity: 0.7; }
.hog-pop .hp-close:hover { opacity: 1; }
.hog-pop p.hp-plain { margin: 6px 0 0; font-size: 13px; opacity: 0.9; }
body.oink-open .hog-pop { visibility: hidden; }

/* ---------- the chores' little games (minigames.js) ---------- */
.mg-shade { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(20, 12, 6, 0.35); padding: 16px; }
.mg {
  position: relative; width: min(360px, 100%); padding: 14px 16px 16px; border-radius: 14px; color: var(--paper);
  background: rgba(43, 29, 18, 0.97); border: 1px solid rgba(255, 248, 231, 0.35); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.mg-head { display: flex; flex-direction: column; gap: 2px; padding-right: 24px; }
.mg-head b { font: 400 20px/1.05 'Anton', Impact, sans-serif; letter-spacing: 0.03em; text-transform: uppercase; }
.mg-head span { font-size: 12px; opacity: 0.75; }
.mg-tip { margin: 8px 0 10px; min-height: 1.4em; font-size: 13px; color: var(--orange); }
.mg-close { position: absolute; right: 10px; top: 8px; border: 0; background: none; color: var(--paper); font-size: 22px; cursor: pointer; opacity: 0.7; }
.mg-close:hover { opacity: 1; }
.mg-area { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 190px; justify-content: center; }
.mg-btn {
  min-width: 140px; padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer; touch-action: none;
  background: var(--orange); color: var(--ink); font: 700 15px/1 'Inter', system-ui, sans-serif; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.mg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.mg-result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mg-result b { font: 400 26px/1 'Anton', Impact, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.mg-stars { font-size: 34px; color: var(--orange); letter-spacing: 4px; }
/* pour */
.mg-tank { position: relative; width: 150px; height: 130px; border: 3px solid #b4bcc4; border-top: 0; border-radius: 0 0 12px 12px; overflow: hidden; background: rgba(255, 248, 231, 0.06); }
.mg-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.mg-fill.water { background: linear-gradient(#7cc3ec, #3f8fc9); }
.mg-fill.feed { background: repeating-linear-gradient(135deg, #c9a24f 0 6px, #b58f43 6px 12px); }
.mg-fill.spill { animation: mg-spill 0.4s ease 3; }
@keyframes mg-spill { 50% { filter: brightness(1.5); } }
.mg-band { position: absolute; left: 0; right: 0; border-top: 2px dashed #7bd36b; border-bottom: 2px dashed #7bd36b; background: rgba(123, 211, 107, 0.18); z-index: 1; }
/* pick */
.mg-field { position: relative; width: 100%; height: 170px; border-radius: 10px; background: rgba(255, 248, 231, 0.07); overflow: hidden; }
.mg-item { position: absolute; width: 22%; height: 30%; border: 0; background: none; font-size: 32px; line-height: 1; cursor: pointer; animation: mg-pop 0.18s ease-out; touch-action: none; }
.mg-item.got { animation: mg-got 0.25s ease-in forwards; }
.mg-item.oops { animation: mg-oops 0.25s ease-in forwards; }
@keyframes mg-pop { from { transform: scale(0.3); opacity: 0; } }
@keyframes mg-got { to { transform: scale(1.6) translateY(-20px); opacity: 0; } }
@keyframes mg-oops { 50% { transform: rotate(-20deg); } to { transform: rotate(20deg); opacity: 0; } }
.mg-timer { width: 100%; height: 6px; border-radius: 3px; background: rgba(255, 248, 231, 0.15); overflow: hidden; }
.mg-timer i { display: block; height: 100%; width: 100%; background: var(--orange); }
/* timing */
.mg-marks { display: flex; gap: 10px; font-size: 26px; }
.mg-marks span { opacity: 0.35; }
.mg-marks span.hit { opacity: 1; }
.mg-marks span.miss { opacity: 1; filter: grayscale(1) brightness(0.6); }
.mg-bar { position: relative; width: 100%; height: 34px; border-radius: 8px; background: rgba(255, 248, 231, 0.12); overflow: hidden; cursor: pointer; }
.mg-bar.hit { box-shadow: inset 0 0 0 2px #7bd36b; }
.mg-bar.miss { box-shadow: inset 0 0 0 2px #e0542d; }
.mg-zone { position: absolute; top: 0; bottom: 0; background: rgba(123, 211, 107, 0.45); border-left: 2px solid #7bd36b; border-right: 2px solid #7bd36b; }
.mg-needle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--paper); box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); }
/* scrub */
.mg-scrub { width: 100%; max-width: 300px; aspect-ratio: 300 / 170; border-radius: 10px; cursor: grab; touch-action: none; background: #d8c79a repeating-linear-gradient(90deg, #cdb988 0 14px, #d8c79a 14px 28px); }
/* count */
.mg-pen { position: relative; width: 100%; height: 150px; border-radius: 10px; border: 3px solid #a7afb7; background: #d9bd6a; overflow: hidden; transition: opacity 0.2s; }
.mg-pen.hidden { opacity: 0; height: 0; border-width: 0; }
.mg-piglet { position: absolute; font-size: 26px; }
.mg-choices { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mg-choices .mg-btn { min-width: 56px; }
body.oink-open .mg-shade { visibility: hidden; }

/* ---------- money, and hoof art ---------- */
.cash-pill {
  position: fixed; top: 16px; right: 170px; padding: 7px 14px; border-radius: 999px; z-index: 4;
  background: var(--panel); border: 1px solid rgba(255, 248, 231, 0.35); color: #b7e39a;
  font: 400 18px/1 'Anton', Impact, sans-serif; letter-spacing: 0.04em;
}
.cash-pill[hidden] { display: none; }
.cash-pop { position: absolute; right: 8px; top: 100%; margin-top: 4px; color: #b7e39a; font: 700 13px/1 'Inter', system-ui, sans-serif; animation: cash-pop 1.3s ease-out forwards; pointer-events: none; }
@keyframes cash-pop { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(14px); } }
body.ui-hidden .cash-pill { opacity: 0.4; }
body.oink-open .cash-pill { visibility: hidden; }
.art-marker { background: #f6f1e3; font-size: 13px; }
.art-marker:hover { background: #fffaf0; }
@media (max-width: 600px) { .cash-pill { top: 12px; right: 12px; } }

/* ---------- the petting pen ---------- */
.hp-action {
  display: block; width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--orange); color: var(--ink); font: 700 13px/1.2 'Inter', system-ui, sans-serif;
}
.hp-action:hover { background: #f4b95a; }

/* ---------- the farm stand, and posts ---------- */
.hog-card .hc-post { margin: -4px 0 8px; font-size: 13px; color: #b7e39a; }
.oinkos .hog-card .hc-post { color: #1f6d1f; }
.stand-card .sc-goods { display: grid; grid-template-columns: 1fr auto auto auto; gap: 3px 12px; font-size: 13px; margin: 4px 0 6px; }
.stand-card .sc-h { font-size: 11px; opacity: 0.65; text-align: right; }
.stand-card .sc-row { display: flex; gap: 8px; }
.stand-card .sc-row .hp-action { margin-top: 4px; }
/* the truffle shed's card (game/truffles.js) */
.truffle-card { max-width: 380px; }
.truffle-card .tc-rows { align-items: center; }
.truffle-card .tc-rows .hp-action { margin: 0; padding: 2px 8px; font-size: 12px; }
.truffle-card .sc-row { align-items: center; justify-content: space-between; }
/* the quarry (game/quarry.js): rocks on the face, the cart's gauge (its load against the hand's safe load) */
.rock-marker { width: 22px; height: 22px; left: -11px; top: -26px; font-size: 12px; background: #e6e0d2; transform-origin: 11px 26px; }
.rock-marker:hover { background: #fff6e0; }
.quarry-marker { background: #e6e0d2; }
.quarry-gauge { position: absolute; z-index: 1; left: -78px; top: 16px; width: 156px; padding: 4px 6px 5px; border-radius: 8px; border: 2px solid var(--ink); background: var(--panel); color: #f3ead6; font: 700 11px/1.1 'Inter', system-ui, sans-serif; cursor: pointer; pointer-events: auto; box-shadow: 0 3px 0 rgba(43, 29, 18, 0.45); text-align: left; }
.quarry-gauge[hidden] { display: none; }
.quarry-gauge:disabled { cursor: default; opacity: 0.85; }
.quarry-gauge .qg-bar { position: relative; display: block; height: 6px; margin-bottom: 3px; border-radius: 3px; background: rgba(255, 248, 231, 0.18); }
.quarry-gauge .qg-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #8fc96a; }
.quarry-gauge .qg-bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #f3ead6; }
.quarry-gauge.amber .qg-bar i { background: #f0b04a; }
.quarry-gauge.red .qg-bar i { background: #e0573f; }
.quarry-gauge.off { opacity: 0.8; }
.quarry-gauge:not(:disabled):hover { border-color: var(--orange); }
.hp-action:disabled { opacity: 0.45; cursor: default; background: var(--orange); }

.hp-jobs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; opacity: 0.95; }
.hp-jobs span { width: 100%; opacity: 0.75; }
.hp-job { flex: 1; padding: 6px 4px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(255, 248, 231, 0.45); background: rgba(255, 248, 231, 0.1); color: var(--paper); font: 600 12px/1.1 'Inter', system-ui, sans-serif; }
.hp-job:hover { background: rgba(255, 248, 231, 0.22); }

.rp-pill { position: fixed; top: 56px; right: 170px; padding: 5px 12px; border-radius: 999px; z-index: 4; background: var(--panel); border: 1px solid rgba(255, 248, 231, 0.35); color: #bfe3f0; font: 400 15px/1 'Anton', Impact, sans-serif; letter-spacing: 0.04em; }
.rp-pill[hidden] { display: none; }
body.oink-open .rp-pill { visibility: hidden; }
body.ui-hidden .rp-pill { opacity: 0.4; }
.hog-card .hc-genes { font-weight: 400; opacity: 0.6; font-size: 10px; }
@media (max-width: 600px) { .rp-pill { top: 50px; right: 12px; } }

.idea-marker { animation: idea-glow 1.6s ease-in-out infinite; } /* (a glow: its transform is its place on screen) */
@keyframes idea-glow { 50% { box-shadow: 0 0 0 5px rgba(255, 230, 120, 0.55); } }

/* ---------- the night (game/varmints.js) ---------- */
.varmint-pop { position: absolute; transform: translate(-50%, -100%); color: #fff6d8; font: 700 13px/1 'Inter', system-ui, sans-serif; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); white-space: nowrap; pointer-events: none; animation: varmint-pop 1.4s ease-out forwards; }
@keyframes varmint-pop { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -22px; } }

/* ---------- hog life: rarity, training, retiring ---------- */
.hog-card .hc-trait { margin: 6px 0 0; font-size: 12px; color: #f2d27a; }
.hog-card.hc-uncommon .hc-name { color: #9fe0a8; }
.hog-card.hc-rare .hc-name { color: #b8d4ff; text-shadow: 0 0 6px rgba(160, 200, 255, 0.5); }
.hog-card.hc-legendary .hc-name { color: #ffd76a; text-shadow: 0 0 8px rgba(255, 210, 90, 0.7); }
.hog-card.hc-epic .hc-name { color: #d2a8ff; text-shadow: 0 0 7px rgba(190, 140, 255, 0.6); }
.hog-card .hc-photo { display: block; width: 100%; height: auto; image-rendering: pixelated; border-radius: 6px; margin: 6px 0 2px; border: 2px solid #9aa0a6; box-sizing: border-box; }
.hog-card.hc-uncommon .hc-photo { border-color: #4caf50; } .hog-card.hc-rare .hc-photo { border-color: #3d7fe0; } .hog-card.hc-epic .hc-photo { border-color: #9b59d0; } .hog-card.hc-legendary .hc-photo { border-color: #e8b020; }
.hog-card .hc-trained { font-weight: 400; color: #b7e39a; font-size: 10px; }
.hp-retire { display: block; width: 100%; margin-top: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px dashed rgba(255, 248, 231, 0.5); background: none; color: var(--paper); font: 500 12px/1.3 'Inter', system-ui, sans-serif; text-align: left; }
.hp-retire:hover { background: rgba(255, 248, 231, 0.12); }
.hp-retire[data-sure] { border-style: solid; background: rgba(200, 69, 58, 0.35); }

/* ---------- job ratings (game/ratings.js) ---------- */
.hog-card .hc-jobs { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.hog-card .hc-jobs-h { font-size: 11px; opacity: 0.7; }
.hog-card .hc-job { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; align-items: baseline; padding: 3px 6px; border-radius: 6px; font: 400 11px/1.3 'Inter', system-ui, sans-serif; color: inherit; text-align: left; border: 1px solid transparent; background: rgba(255, 248, 231, 0.06); }
.hog-card button.hc-job { cursor: pointer; }
.hog-card button.hc-job:hover { border-color: rgba(255, 248, 231, 0.4); background: rgba(255, 248, 231, 0.14); }
.hog-card .hc-job.on { border-color: #b7e39a; }
.hog-card .hc-job-name { font-weight: 600; }
.hog-card .hc-job-stars { color: #f2c230; letter-spacing: -1px; }
.hog-card .hc-job-line { grid-column: 1 / -1; opacity: 0.8; }

/* ---------- the treadmill (game/treadmill.js) ---------- */
.power-pill { right: 262px; color: #f2d479; }
.mat-pill { right: 354px; color: #d9d3c4; }
@media (max-width: 600px) { .mat-pill { top: 122px; right: 12px; } }
@media (max-width: 600px) { .power-pill { top: 86px; right: 12px; } }

.hog-card .hc-origin { margin: 0 0 4px; font-size: 11px; opacity: 0.8; font-style: italic; }
.hog-card .hc-bio { margin: 2px 0 6px; font-size: 11.5px; line-height: 1.4; font-style: italic; opacity: 0.9; }

/* ---------- getting started (game/starter.js) ---------- */
.starter { position: fixed; top: clamp(78px, 9vw, 104px); left: 16px; z-index: 5; width: 270px; max-width: calc(100vw - 32px); box-sizing: border-box;
  border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 248, 231, 0.35); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); color: var(--paper); font-size: 13px; transition: opacity 0.4s ease; }
.starter[hidden] { display: none; }
.sg-head { display: flex; width: 100%; align-items: baseline; gap: 8px; padding: 9px 12px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.sg-head b { font: 400 16px/1.1 'Anton', Impact, sans-serif; letter-spacing: 0.04em; color: var(--orange); }
.sg-head span { margin-left: auto; font-size: 12px; opacity: 0.8; white-space: nowrap; }
.sg-list { list-style: none; margin: 0; padding: 0 12px 10px; }
.sg-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid rgba(255, 248, 231, 0.12); }
.sg-list li.done { opacity: 0.55; }
.sg-list li.done .sg-icon { color: #b7e39a; }
.sg-list li.later { opacity: 0.7; }
.sg-list li.now .sg-title { font-weight: 700; color: #fff; }
.sg-icon { width: 20px; text-align: center; }
.sg-title { flex: 1; }
.sg-how { width: 100%; margin: 2px 0 4px 26px; font-size: 12px; line-height: 1.4; opacity: 0.9; }
.starter > .sg-how { margin: 0 12px 8px; width: auto; }
.sg-btn { margin: 0 0 4px 26px; padding: 5px 10px; border-radius: 8px; cursor: pointer; border: 2px solid var(--ink); background: var(--orange); color: var(--ink); font: 700 12px/1.2 'Inter', system-ui, sans-serif; }
.starter > .sg-btn { margin: 0 12px 10px; }
.sg-btn:hover { background: #f4b95a; }
.sg-night { margin: 0 12px 10px; padding: 6px 8px; border-radius: 8px; background: rgba(120, 150, 220, 0.18); font-size: 12px; line-height: 1.4; }
body.oink-open .starter { visibility: hidden; }
body.ui-hidden .starter:not(:hover):not(:focus-within) { opacity: 0.25; }
@media (max-width: 600px) { .starter { top: 70px; left: 12px; width: min(270px, calc(100vw - 24px)); } body:has(.starter:not([hidden])) .hint { display: none; } }

/* ---------- a plot of land dropping into place (game/landapp.js) ---------- */
.land-drop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; image-rendering: pixelated; }
.land-drop[hidden] { display: none; }
.land-dust { position: fixed; z-index: 3; pointer-events: none; font-size: 30px; transform: translate(-50%, -50%); animation: land-dust 1.2s ease-out forwards; }
@keyframes land-dust { from { opacity: 0.95; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 0; transform: translate(-50%, -120%) scale(1.8); } }

/* ---------- the 3D renderer (in progress: ?r3d=1, r3d/farm3d.js) ---------- */
#farm3d { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; z-index: 0; }
#weather { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; z-index: 1; }
body.oink-open #weather { visibility: hidden; }
body.r3d #farm { opacity: 0; } /* (still there underneath: it takes the clicks and drags) */
body.oink-open #farm3d { visibility: hidden; }
