/* Fernwood: one small palette, square pixel borders, a pixel font. Nothing smooth or glossy. */
@font-face { font-family: 'Jersey'; src: url('fonts/jersey10.woff2') format('woff2'); font-display: block; }
:root {
  --ink: #3a2418; --ink2: #5e4c42; --paper: #f0dcae; --paper2: #f2c29b; --wood: #8a5e3c; --wood2: #5a3a26; --wood3: #3a2418;
  --leaf: #5fae4a; --leaf2: #3f8a3a; --gold: #f0c43c; --rose: #d8413f; --night: #2a2131; --sky: #bfe4f8;
  --px: 3px; --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font: 18.67px/1.15 'Jersey', ui-monospace, monospace; letter-spacing: 0.3px; -webkit-font-smoothing: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#game { position: fixed; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
b, strong, h1, h4, em { font-weight: 400; font-style: normal; }
.ic { width: 28px; height: 28px; image-rendering: pixelated; vertical-align: middle; }
.ic.big { width: 56px; height: 56px; }

/* pixel frames: square corners notched by one step, flat colours, a hard drop shadow */
.notch { clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px))); }
.plaque, .sq, .btn, .box, .card, .toast, .tab, .slot, #banner { clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px))); }

/* HUD */
#hud { position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; padding: calc(8px + var(--st)) calc(8px + var(--sr)) 0 calc(8px + var(--sl)); pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
#hearts { display: flex; gap: 1px; }
#hearts .ic { width: 28px; height: 28px; }
.plaque { background: var(--wood2); color: var(--paper); padding: 5px 10px 6px; box-shadow: inset 0 -3px 0 var(--wood3), inset 0 3px 0 var(--wood); font-size: 18.67px; white-space: nowrap; }
.coins { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 4px 5px; }
.coins .ic { width: 28px; height: 28px; }
.hr { display: flex; gap: 5px; align-items: flex-start; }
.sq { width: 40px; height: 40px; border: 0; padding: 0; background: var(--wood) center/28px no-repeat; box-shadow: inset 0 -3px 0 var(--wood2), inset 0 3px 0 #a8733f; image-rendering: pixelated; }
.sq:active { box-shadow: inset 0 3px 0 var(--wood2); }
.sq.x { width: 40px; height: 40px; background: var(--wood2) center/28px no-repeat; }
.sq.mini { width: 36px; height: 36px; color: var(--paper); font-size: 28px; line-height: 30px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; } .pips { display: inline-flex; gap: 4px; } .pips i { width: 14px; height: 20px; background: var(--paper2); box-shadow: inset 0 -3px 0 #c8955a; } .pips i.on { background: var(--leaf); box-shadow: inset 0 -3px 0 var(--leaf2); }
.row.wanted { box-shadow: inset 3px 0 0 var(--gold); } .row em { color: var(--wood); }
#floats { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 3; }
.float { position: absolute; left: 0; top: 0; white-space: nowrap; color: #fff; font-size: 18.67px; text-shadow: 2px 0 var(--night), -2px 0 var(--night), 0 2px var(--night), 0 -2px var(--night); }
.card { scrollbar-width: thin; scrollbar-color: var(--wood) var(--paper2); }
.card::-webkit-scrollbar { width: 8px; } .card::-webkit-scrollbar-thumb { background: var(--wood); } .card::-webkit-scrollbar-track { background: var(--paper2); }
#actHint { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); color: var(--paper); text-shadow: 2px 0 var(--night), -2px 0 var(--night), 0 2px var(--night), 0 -2px var(--night); font-size: 18.67px; pointer-events: none; z-index: 4; }
@media (pointer: coarse) { #actHint { display: none; } }

@media (orientation: portrait) {
  #hud { flex-wrap: wrap; row-gap: 5px; }
  .hl { order: 1; } .hr { order: 2; } #hearts .ic { width: 28px; height: 28px; margin-right: -4px; } #clock { order: 3; font-size: 18.67px; padding: 4px 9px 5px; }
  .sq { width: 40px; height: 40px; }

}
/* touch controls (phones and tablets only) */
#touch { display: none; }
@media (pointer: coarse) { #touch { display: block; } }
#stickZone { position: fixed; left: 0; bottom: 0; width: 50%; height: 62%; z-index: 3; }
#stick { position: fixed; width: 96px; height: 96px; margin: -48px 0 0 -48px; background: center/96px no-repeat; image-rendering: pixelated; z-index: 3; pointer-events: none; opacity: 0.85; }
#knob { position: absolute; left: 28px; top: 28px; width: 40px; height: 40px; background: center/40px no-repeat; image-rendering: pixelated; }
#bAct, #bJump { position: fixed; border: 0; z-index: 4; background: center/contain no-repeat; image-rendering: pixelated; color: var(--ink); text-shadow: 0 2px 0 rgba(251,246,238,0.4); }
#bAct { right: calc(18px + var(--sr)); bottom: calc(26px + var(--sb)); width: 92px; height: 92px; font-size: 18.67px; padding-top: 2px; }
#bAct.idle { opacity: 0.55; }
#bAct.bite { animation: bob 0.18s steps(2) infinite; }
#bJump { right: calc(118px + var(--sr)); bottom: calc(18px + var(--sb)); width: 68px; height: 68px; font-size: 18.67px; }
#bAct.down, #bJump.down { transform: translateY(3px); filter: brightness(0.92); }
@keyframes bob { 50% { transform: translateY(-4px); } }
/* portrait phones: the controls sit lower and smaller */


/* dialogue */
#dialog { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 10px calc(10px + var(--sb)); z-index: 8; }
.box { position: relative; width: min(640px, 100%); background: var(--paper); padding: 16px 18px 18px; box-shadow: inset 0 0 0 3px var(--wood2), inset 0 0 0 6px var(--paper2), inset 0 -9px 0 0 var(--paper2); min-height: 110px; }
.box .name { display: inline-block; background: var(--wood2); color: var(--paper); padding: 3px 12px 5px; font-size: 18.67px; margin: -4px 0 2px -4px; box-shadow: inset 0 -3px 0 var(--wood3); }
#dText { margin: 6px 0 0; font-size: 28px; line-height: 1.2; min-height: 48px; color: var(--ink); }
#dMore { position: absolute; right: 14px; bottom: 10px; width: 28px; height: 28px; background: center/28px no-repeat; image-rendering: pixelated; animation: bob 0.6s steps(2) infinite; }
#dChoices { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: var(--leaf); color: #fff; padding: 8px 16px 10px; font-size: 18.67px; box-shadow: inset 0 -4px 0 var(--leaf2), inset 0 3px 0 #9ad46a; text-shadow: 0 2px 0 var(--leaf2); min-height: 40px; font-size: 18.67px; }
.btn:active { box-shadow: inset 0 3px 0 var(--leaf2); padding-top: 10px; padding-bottom: 8px; }
.btn.soft { background: var(--paper2); color: var(--ink); text-shadow: none; box-shadow: inset 0 -4px 0 #c8955a, inset 0 3px 0 #f0dcae; }
.btn.big { font-size: 28px; padding: 10px 28px 12px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn .ic { width: 28px; height: 28px; margin: -6px 0; }

/* panels */
#panel { position: fixed; inset: 0; background: rgba(42,33,49, 0.55); display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--st)) 10px calc(12px + var(--sb)); z-index: 9; }
.card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--paper); box-shadow: inset 0 0 0 3px var(--wood2), inset 0 0 0 6px var(--paper2); padding: 12px 16px 16px; scrollbar-width: thin; }
.card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card .head b { font-size: 28px; color: var(--wood2); }
.card h4 { margin: 14px 0 6px; color: var(--wood); font-weight: 600; }
.card p { margin: 6px 0; }
.muted { color: var(--ink2); font-size: 18.67px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.tab { border: 0; background: var(--paper2); padding: 6px 14px 8px; color: var(--ink2); box-shadow: inset 0 -3px 0 #c8955a; }
.tab.on { background: var(--wood2); color: var(--paper); box-shadow: inset 0 -3px 0 var(--wood3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 5px; }
.slot { position: relative; height: 54px; border: 0; background: var(--paper2); box-shadow: inset 0 3px 0 #c8955a; display: grid; place-items: center; padding: 0; }
.slot .ic { width: 42px; height: 42px; }
.slot.found .ic { width: 28px; height: 28px; }
.slot b { position: absolute; right: 4px; bottom: 1px; font-size: 18.67px; color: var(--ink); }
.slot.on { background: #fbf6ee; box-shadow: inset 0 0 0 3px var(--gold); }
.slot[disabled] { cursor: default; opacity: 0.7; }
.slot.cant .ic { opacity: 0.38; }
#knob.run { box-shadow: 0 0 0 3px var(--gold); }
.grid.foundgrid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.foundgrid .slot { height: 42px; } .foundgrid .slot .ic { width: 32px; height: 32px; } .foundgrid .slot.unknown { font-size: 18.67px; }
.stickydetail { position: sticky; bottom: -16px; margin-bottom: -16px; box-shadow: 0 -8px 0 var(--paper), inset 0 0 0 2px #e2b77a; }
.goldstar { position: absolute; right: 2px; top: 2px; width: 7px; height: 7px; background: #f0c43c; clip-path: polygon(50% 0, 65% 35%, 100% 40%, 72% 62%, 80% 100%, 50% 80%, 20% 100%, 28% 62%, 0 40%, 35% 35%); }
#petName { font: inherit; font-size: 24px; width: 100%; padding: 6px 10px; margin: 4px 0 10px; border: 0; background: #fbf6ee; color: var(--ink); box-shadow: inset 0 0 0 3px var(--wood2); }
.slot b.price { color: #8a5e3c; font-size: 16px; }
.slot.wanted { box-shadow: inset 0 -4px 0 var(--gold); }
.slot.wanted.on { box-shadow: inset 0 0 0 3px var(--gold); }
.wearing { display: grid; grid-template-columns: auto 54px auto 54px auto; align-items: center; gap: 6px 8px; margin-top: 10px; }
.wearing small { font-size: 18.67px; }
#pBody .slot[data-slot], #pBody .slot[data-b], #pBody .slot[data-c] { touch-action: none; }
.slot.lifted .ic { opacity: 0.3; }
.slot .ic { -webkit-user-drag: none; user-select: none; }
.slot.hover { box-shadow: inset 0 0 0 3px var(--leaf2); }
.ic.ghost { position: fixed; z-index: 60; width: 48px; height: 48px; transform: translate(-50%, -60%); pointer-events: none; image-rendering: pixelated; }
.grid.recipes { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
.detail .needs { display: block; color: var(--ink2); font-size: 18.67px; margin-bottom: 6px; }
.detail .makes { display: flex; gap: 6px; flex-wrap: wrap; }
.slot.found { height: auto; padding: 6px 2px 4px; text-align: center; }
.slot.found small { display: block; font-size: 18.67px; line-height: 1.1; color: var(--ink2); }
.slot.unknown { color: #c8955a; font-size: 18.67px; }
.tools { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.tool { display: inline-flex; align-items: center; gap: 2px; font-size: 18.67px; color: var(--ink2); }
.tool .ic { width: 28px; height: 28px; }
.detail { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; min-height: 70px; background: #fbf6ee; padding: 10px; }
.detail p { margin: 2px 0 4px; font-size: 18.67px; }
.list { display: grid; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; background: #fbf6ee; padding: 6px 8px; }
.row .grow { flex: 1; min-width: 0; }
.row small { display: block; color: var(--ink2); font-size: 18.67px; }
.row .btn { padding: 4px 10px 6px; min-height: 34px; font-size: 18.67px; }
.owned { color: var(--leaf2); font-size: 18.67px; }
.row .who { color: var(--ink2); font-weight: 400; }
.row small.say { color: var(--wood2); }
.coinsline { display: flex; align-items: center; gap: 4px; margin: 0 0 6px; font-size: 18.67px; }
.quest { background: #fbf6ee; padding: 8px 10px; margin-bottom: 6px; }
.quest small { color: var(--ink2); }
.quest p { font-size: 18.67px; }
.quest .prog { color: var(--wood); }
.quest .prog.ready { color: var(--leaf2); font-weight: 600; }
.quest.done { color: var(--ink2); padding: 4px 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 18.67px; color: var(--ink2); margin: 8px 0; }
.stats .ic { width: 28px; height: 28px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.set input { flex: 1; max-width: 240px; accent-color: var(--leaf2); }

/* toasts and the day banner */
#toasts > :nth-child(n+4) { display: none; }
#toasts { position: fixed; left: 50%; top: calc(104px + var(--st)); transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; z-index: 7; pointer-events: none; }
.toast { background: var(--paper); color: var(--ink); padding: 6px 12px 8px; box-shadow: inset 0 0 0 3px var(--wood2); font-size: 18.67px; max-width: 86vw; text-align: center; animation: drop 0.25s steps(3); }
.toast.out { opacity: 0; transition: opacity 0.4s steps(3); }
@keyframes drop { from { transform: translateY(-10px); } }
#banner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); background: var(--wood2); color: var(--paper); font-size: 56px; padding: 10px 28px 14px; box-shadow: inset 0 -5px 0 var(--wood3), inset 0 4px 0 var(--wood); z-index: 7; pointer-events: none; }
#banner.show { animation: drop 0.4s steps(4); }

/* title */
#title { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(42,33,49,0.35); }
.tbox { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#title h1 { margin: 0; font-size: 112px; font-weight: 400; color: var(--paper); letter-spacing: 2px; text-shadow: 0 5px 0 var(--wood2), 4px 0 0 var(--wood2), -4px 0 0 var(--wood2), 0 -4px 0 var(--wood2), 4px 9px 0 var(--wood3); line-height: 1; }
#title p { margin: 0 0 14px; color: var(--paper); font-size: 28px; text-shadow: 0 2px 0 var(--wood3); }
.credit { position: absolute; bottom: calc(12px + var(--sb)); color: var(--paper2); opacity: 0.8; }
@media (max-width: 520px) { #title h1 { font-size: 74.67px; } }

/* hotbar and the sandbox bits */
.hl { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
#hotbar { display: flex; gap: 3px; }
.hb { position: relative; width: 44px; height: 44px; border: 0; padding: 0; background: rgba(42,33,49,0.6); box-shadow: inset 0 0 0 3px var(--wood2); display: grid; place-items: center; }
.hb.on { background: rgba(240,220,174,0.85); box-shadow: inset 0 0 0 3px var(--gold); }
.hb .ic { width: 28px; height: 28px; }
.hb b { position: absolute; right: 3px; bottom: 0; font-size: 18.67px; color: var(--paper); text-shadow: 1px 0 var(--night), -1px 0 var(--night), 0 1px var(--night), 0 -1px var(--night); font-weight: 400; }
.hb.on b { color: var(--ink); text-shadow: none; }
#heldName { color: var(--paper); font-size: 18.67px; text-shadow: 2px 0 var(--night), -2px 0 var(--night), 0 2px var(--night), 0 -2px var(--night); min-height: 20px; }
#place { position: fixed; left: 50%; bottom: calc(44px + var(--sb, 0px)); transform: translateX(-50%); color: var(--paper); font-size: 18.67px; text-shadow: 2px 0 var(--night), -2px 0 var(--night), 0 2px var(--night), 0 -2px var(--night); pointer-events: none; z-index: 4; }
.grid.inv { grid-template-columns: repeat(8, 1fr); }
.gridbreak { grid-column: 1 / -1; height: 4px; }
/* on a phone on its side the bag is two columns: the slots, and beside them what you're wearing and what you picked */
@media (orientation: landscape) and (max-height: 500px) {
  #panel.wide .card { width: min(860px, 100%); }
  .bagwrap { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
  .bagwrap .grid.inv { grid-template-columns: repeat(8, 46px); gap: 4px; }
  .bagwrap .grid.inv .slot { height: 46px; } .bagwrap .grid.inv .slot .ic { width: 36px; height: 36px; }
  .bagwrap .wearing { grid-template-columns: 54px 1fr; margin-top: 0; } .bagwrap .wearing > span { grid-column: 1 / -1; }
  .bagwrap .detail { margin-top: 8px; }
  .twocol { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
  .twocol .detail { margin-top: 0; }
  .twocol .grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; }
  .twocol .slot { height: 46px; } .twocol .slot .ic { width: 36px; height: 36px; }
}
.small { font-size: 18.67px; }
.row.dim { opacity: 0.6; }
.got { color: var(--leaf2); } .miss { color: #8a3a2a; }
.btn[disabled] { opacity: 0.55; }
.hearts .ic { width: 28px; height: 28px; margin-left: -6px; }
.notes { display: grid; gap: 8px; }
.note { background: #fbf6ee; padding: 10px 12px; box-shadow: inset 0 0 0 2px var(--paper2); transform: rotate(-0.5deg); }
.note:nth-child(2n) { transform: rotate(0.6deg); background: #fbf6ee; }
@media (orientation: portrait) { .hb { width: 40px; height: 40px; } #hotbar { flex-wrap: wrap; max-width: 180px; } }
@media (orientation: portrait) { #toasts { top: calc(200px + var(--st)); } }
/* clock with the weather, food buffs, the calendar, Elsie's pages */
#clock { display: flex; align-items: center; gap: 6px; }
#clock .ic { width: 24px; height: 24px; }
#buffs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.buff { background: rgba(42,33,49,0.72); color: #c4ec98; font-size: 18.67px; line-height: 1; padding: 2px 6px 3px; }
.buff.fog { color: #bfe4f8; }
.cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0; }
.day { background: var(--paper2); min-height: 58px; padding: 3px 5px; display: flex; flex-direction: column; gap: 1px; box-shadow: inset 0 -3px 0 #c8955a; }
.day.today { background: #fbf6ee; box-shadow: inset 0 0 0 3px var(--wood2); }
.day.past { opacity: 0.5; }
.day .ic { width: 22px; height: 22px; }
.day small { font-size: 18.67px; line-height: 0.9; }
.day .ev { color: #3f6fa8; } .day .bd { color: #8a3a2a; }
.page { background: #fbf6ee; padding: 8px 10px; margin: 6px 0; box-shadow: inset 0 -3px 0 #e2b77a; }
.page p { margin: 4px 0 0; color: #3b2e4f; }
.page.big p { font-size: 18.67px; line-height: 1.25; }
.note.big { grid-column: 1 / -1; background: #f0c43c; }
.small { font-size: 18.67px; }
@media (orientation: portrait) { .cal { grid-template-columns: repeat(5, 1fr); } .day { min-height: 50px; } }
#bAct .ic { width: 36px; height: 36px; opacity: 0.6; }
.btn.five { margin-left: 4px; padding-left: 8px; padding-right: 8px; }
/* ending cards */
#cards { position: fixed; inset: 0; background: #2a2131; z-index: 20; display: grid; place-items: center; padding: 16px; }
#cards .cardbox { max-width: min(92vw, 640px); text-align: center; color: var(--paper); }
#cImg { width: 100%; image-rendering: pixelated; display: block; box-shadow: 0 0 0 4px var(--wood2); }
#cText { font-size: 18.67px; line-height: 1.3; margin: 14px 0 8px; min-height: 3em; }
#cards small { font-size: 18.67px; opacity: 0.6; }
@media (orientation: landscape) and (max-height: 500px) { #cards .cardbox { max-width: 70vh; } #cImg { width: auto; height: 48vh; margin: 0 auto; } }
/* portrait phones: hearts and clock, then the hotbar in one row, then what you hold and the buttons (about half the old height) */
@media (orientation: portrait) {
  .hl { display: contents; }
  #hud { flex-wrap: wrap; align-items: center; row-gap: 4px; column-gap: 5px; }
  #hearts { order: 1; } #clock { order: 2; margin-left: auto; }
  #hotbar { order: 3; flex: 0 0 100%; flex-wrap: nowrap; max-width: none; gap: 3px; }
  #heldName { order: 4; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hr { order: 5; gap: 4px; } .hr .sq { width: 36px; height: 36px; background-size: 24px; } .coins .ic { width: 24px; height: 24px; }
  #buffs { order: 6; flex: 0 0 100%; }
  #toasts { top: calc(150px + var(--st)); }
}
/* no zooming, ever: touch-action isn't inherited, so every element opts out; only panels may scroll */
*, *::before, *::after { touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.card, .card * { touch-action: pan-y; }
@media (orientation: portrait) { #place { bottom: auto; top: calc(134px + var(--st)); } }
/* the title backdrop: a painted dusk, sharp pixels, cropped to fill */
#title { background: #1a2448; }
#tCanvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; z-index: 0; }
#title .tbox { position: relative; z-index: 1; }
#title .trow { display: flex; gap: 10px; justify-content: center; }
#panel.top { z-index: 11; }                                     /* Settings opened from the title sits above it */
#title .credit { z-index: 1; }
#title .tbox { background: rgba(26,36,72,0.0); }
/* small phones held sideways: tighter hotbar and buttons, the clock tucks under the buttons */
@media (orientation: landscape) and (max-width: 780px) {
  .hb { width: 36px; height: 36px; } .hb .ic { width: 24px; height: 24px; } #hotbar { gap: 2px; }
  .hr { gap: 4px; } .hr .sq { width: 34px; height: 34px; background-size: 22px; } .coins .ic { width: 22px; height: 22px; }
  #hearts .ic { width: 24px; height: 24px; }
  #clock { position: fixed; top: calc(48px + var(--st)); right: calc(8px + var(--sr)); font-size: 18.67px; padding: 3px 8px 4px; }
  #clock .ic { width: 20px; height: 20px; }
}
.tabs { flex-wrap: wrap; }
@media (max-width: 420px) { .tab { padding-left: 9px; padding-right: 9px; } }
/* the goal line, the wanted tool, first-time hints */
#caption { position: fixed; left: 50%; bottom: calc(120px + var(--sb, 0px)); transform: translateX(-50%); background: rgba(42,33,49,0.82); color: var(--paper); font-size: 18.67px; padding: 3px 10px 5px; z-index: 6; pointer-events: none; max-width: 80vw; text-align: center; }
#caption.show { animation: drop 0.25s steps(3); }
html.big-text #dText { font-size: 37.33px; }
html.big-text .toast, html.big-text #caption, html.big-text #goal, html.big-text .muted, html.big-text .quest p, html.big-text .detail p, html.big-text .row small, html.big-text .page.big p, html.big-text #cText, html.big-text #heldName, html.big-text #actHint, html.big-text .stats, html.big-text .float { font-size: 28px; }
#goal { color: var(--paper); font-size: 18.67px; background: rgba(42,33,49,0.72); padding: 2px 8px 4px; max-width: 44vw; }
#goal b { color: #f0c43c; font-weight: 400; margin-right: 4px; }
#goal:empty { display: none; }
.hb.want { animation: want 0.9s steps(2) infinite; }
@keyframes want { 50% { box-shadow: inset 0 0 0 3px #f0c43c; } }
#hintWalk { position: fixed; left: calc(18px + var(--sl)); bottom: calc(150px + var(--sb)); z-index: 4; color: var(--paper); background: rgba(42,33,49,0.8); padding: 4px 10px 6px; font-size: 18.67px; pointer-events: none; animation: bob 1.2s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
#bAct.teach { animation: teach 0.9s steps(2) infinite; }
@keyframes teach { 50% { filter: brightness(1.18); } }
@media (orientation: portrait) { #goal { order: 7; flex: 0 0 auto; max-width: 100%; } }
.coinsline { gap: 6px; } .coinsline .grow { flex: 1; } .coinsline .btn { font-size: 18.67px; padding: 4px 10px 6px; }

/* village projects on the notice board */
.needs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0; }
.need { display: inline-flex; align-items: center; gap: 3px; color: var(--ink2); }
.need.met { color: #3f8a3a; }
.quest .btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
