:root {
  --sky: #76c2bd;
  --ink: #283033;
  --paper: #fbf8ef;
  --blue: #5ea9dd;
  --yellow: #f2c94c;
  --muted: #5f6b6e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); }
body {
  color: var(--ink);
  font: 20px/1.3 "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
}
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* Hand-drawn paper card: inked border, slight tilt, offset shadow. */
.card {
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 3px;
  box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85);
}

/* ---------------------------------------------------------------- title */

#title {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; align-content: center; gap: 28px;
  padding: 16px; text-align: center; transition: opacity .8s ease, transform .8s ease;
}
#title.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.logo { margin: 0; display: grid; gap: 10px; justify-items: center; }
.logo .row { display: flex; gap: 10px; }
.logo i {
  font: 400 clamp(44px, 11vw, 92px)/1 Bungee, Impact, sans-serif; font-style: normal;
  display: grid; place-items: center; width: 1.05em; height: 1.1em;
  background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 4px;
  box-shadow: 5px 6px 0 rgba(40, 48, 51, 0.85);
}
.logo i:nth-child(odd) { transform: rotate(-3deg); }
.logo i:nth-child(even) { transform: rotate(2.5deg) translateY(4px); }
.begin {
  font: 400 26px/1 Bungee, Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 3px;
  padding: 14px 34px; cursor: pointer; transform: rotate(-1.5deg);
  box-shadow: 4px 5px 0 rgba(40, 48, 51, 0.9); transition: transform .1s;
}
.begin:hover { transform: rotate(-1.5deg) translateY(-2px); }
.begin:active { transform: rotate(-1.5deg) translateY(2px); box-shadow: 2px 2px 0 rgba(40, 48, 51, 0.9); }
.verify { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; max-width: 520px; margin-top: -8px; }
.verify a {
  padding: 3px 10px; font-size: 16px; color: var(--ink); text-decoration: none; background: var(--paper);
  border: 2px solid var(--ink); border-radius: 3px; box-shadow: 2px 2px 0 rgba(40, 48, 51, .8);
}
.verify a:hover { background: var(--yellow); }
.office .note a { color: var(--ink); }
.office .admin { background: #fff6d6; }
.office .hunt .admin-hunt { margin-top: 10px; padding-top: 8px; border-top: 1.5px dashed #d8d2c2; }
.office .hunt .on { margin: 0 0 6px; font: 400 15px/1.2 Bungee, Impact, sans-serif; letter-spacing: .03em; color: #b8860b; }
.office .hunt .drop-card { margin: 6px 0 8px; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 3px; background: #fff8dc; }
.office .hunt .drop-card .note { margin: 2px 0; }
.hunt-bar { position: relative; height: 22px; margin: 6px 0 4px; border: 2px solid var(--ink); border-radius: 3px; background: #ece4cc; overflow: hidden; }
.hunt-bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--yellow); }
.hunt-bar span { position: relative; display: block; text-align: center; font: 400 12px/18px Bungee, Impact, sans-serif; letter-spacing: .03em; }
.office .hunt h4 { margin: 0 0 6px; font: 400 13px/1.2 Bungee, Impact, sans-serif; letter-spacing: .04em; }
.office .hunt .row2 { display: flex; gap: 6px; margin: 6px 0 8px; }
.office .hunt .row2 .pbtn { flex: 1; }
.board { list-style: none; margin: 4px 0 6px; padding: 0; font-size: 16px; }
.board li { display: grid; grid-template-columns: 24px 1fr auto auto 54px 46px; gap: 7px; align-items: baseline; padding: 3px 4px; border-bottom: 1.5px dashed #d8d2c2; }
.board li.hd { font: 400 11px/1 Bungee, Impact, sans-serif; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid #d8d2c2; padding-bottom: 5px; }
.board li.hd span:nth-child(n+4) { text-align: right; }
.board .er { text-align: right; font-weight: 700; color: #3f8f5a; }
.earned-all { margin: 2px 0 6px; font-size: 16px; }
.earned-all b { font-size: 19px; color: #3f8f5a; }
.board li:last-child { border-bottom: 0; }
.board li.me { background: #fff1c2; border-radius: 3px; }
.board li.gap { display: block; text-align: center; color: var(--muted); border-bottom: 0; }
.board .rk { font: 400 13px/1 Bungee, Impact, sans-serif; color: var(--muted); }
/* The first row is the column headings, so the medals start at the second. */
.board li:nth-child(2) .rk { color: #c9962a; } .board li:nth-child(3) .rk { color: #8f979b; } .board li:nth-child(4) .rk { color: #b06a3a; }
.board a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .tr { color: var(--muted); font-size: 14px; }
.board .pw { font-weight: 700; text-align: right; }
.board .sh { text-align: right; color: var(--muted); }
.office .admin h3 { display: flex; align-items: baseline; gap: 8px; }
.office .admin h4 { margin: 12px 0 4px; font: 400 13px/1.2 Bungee, Impact, sans-serif; letter-spacing: .04em; }
.office .admin h4 a, .office .admin .note a { color: var(--ink); }
.live { margin: -10px 0 0; padding: 3px 12px; font-size: 18px; background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; transform: rotate(.6deg); }
.credit {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) rotate(-.5deg); margin: 0; white-space: nowrap;
  padding: 3px 12px; font-size: 17px; background: var(--paper); border: 2px solid var(--ink); border-radius: 3px;
}

/* ---------------------------------------------------------------- HUD */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
/* While a token drop is on, the treasure hunt's running line goes across the top and the rest moves down for it. */
body.ticking #hud { top: 30px; }
body.ticking .office, body.ticking #toasts { top: 94px; }
.hunt-ticker {
  position: absolute; top: -30px; left: 0; right: 0; height: 30px; overflow: hidden; cursor: pointer;
  background: #1d1608; border-bottom: 2.5px solid var(--ink); color: #ffc23d; white-space: nowrap;
  font: 400 14px/28px Bungee, Impact, sans-serif; letter-spacing: .05em;
}
.hunt-ticker .track { display: inline-flex; animation: hunt-tick var(--secs, 60s) linear infinite; }
.hunt-ticker .track span { padding-right: 2.5em; }
.hunt-ticker b { color: #fff3c4; font-weight: 400; }
.hunt-ticker .hot { color: #ff7a6b; }
@keyframes hunt-tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hunt-ticker .track { animation: none; } }
#hud > * { pointer-events: auto; }
.bag { position: absolute; top: 14px; left: 14px; padding: 6px 14px; transform: rotate(-1deg); display: flex; align-items: center; gap: 6px; }
.bag b { font-size: 24px; }
.bag .sep { width: 2px; height: 20px; background: var(--ink); margin: 0 6px; opacity: .4; }
.bag .gold { color: #d9a21f; font-size: 18px; line-height: 1; -webkit-text-stroke: 1px var(--ink); }
.env {
  width: 26px; height: 19px; border: 2.5px solid var(--ink); background: var(--paper); position: relative; display: inline-block; margin-right: 2px;
}
.env::after {
  content: ""; position: absolute; left: 3px; top: -5px; width: 15px; height: 15px;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg) scaleY(.7);
}
#compass {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%) rotate(.6deg);
  padding: 6px 16px; display: flex; gap: 10px; align-items: center; white-space: nowrap; max-width: calc(100% - 28px);
}
/* The way to the goal: an arrow (a head and a shaft) turned toward it; up is straight ahead. */
#arrow { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; transition: transform .12s linear; }
#arrow svg { display: block; }
#target { overflow: hidden; text-overflow: ellipsis; }
#way { flex: none; margin-left: -5px; }
.help { position: absolute; right: 14px; bottom: 14px; padding: 4px 12px; font-size: 17px; transform: rotate(.8deg); }

#joy { position: absolute; right: 22px; bottom: 60px; width: 124px; height: 124px; border: 2.5px solid var(--ink); border-radius: 50%; background: rgba(251, 248, 239, .55); touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--ink); }
.jump-btn {
  position: absolute; left: 22px; bottom: 72px; width: 88px; height: 88px; border-radius: 50%; touch-action: none;
  font: 400 15px/1 Bungee, Impact, sans-serif; letter-spacing: .04em; color: var(--ink); background: var(--yellow);
  border: 2.5px solid var(--ink); box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85); -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
.jump-btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 rgba(40, 48, 51, 0.85); }
.talk-btn { bottom: 176px; left: 34px; width: 64px; height: 64px; background: var(--paper); }
/* The name of the place you've just walked into, like a title card. */
.place {
  position: absolute; left: 22px; bottom: 26px; max-width: calc(100vw - 44px); pointer-events: none !important;
  font: 400 clamp(30px, 6vw, 58px)/0.95 Bungee, Impact, sans-serif; letter-spacing: .02em; text-transform: uppercase;
  color: var(--paper); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 rgba(40, 48, 51, 0.85);
  opacity: 0; transform: translateY(10px) rotate(-1.5deg);
}
.place.show { animation: place 4.2s ease forwards; }
@keyframes place {
  0% { opacity: 0; transform: translateY(14px) rotate(-1.5deg); }
  10%, 75% { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
  100% { opacity: 0; transform: translateY(-6px) rotate(-1.5deg); }
}
@media (pointer: coarse) { .place { bottom: auto; top: 112px; left: 16px; } }

/* ---------------------------------------------------------------- dialog */

#dialog {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) rotate(-.4deg); z-index: 7;
  width: min(640px, calc(100vw - 32px)); min-height: 108px; padding: 26px 64px 18px 26px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 3px;
  box-shadow: 4px 5px 0 rgba(40, 48, 51, 0.85); cursor: pointer;
}
#dialog .name {
  position: absolute; left: -10px; top: -26px; padding: 6px 18px 4px; transform: rotate(-2deg);
  font: 400 18px/1 Bungee, Impact, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--blue); border: 2.5px solid var(--ink); border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(40, 48, 51, 0.85);
}
#dialog .name.you { background: #e46f5f; }
#dtext { margin: 0; font-size: 23px; line-height: 1.35; text-transform: uppercase; letter-spacing: .02em; min-height: 2.7em; }
#dnext {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; font-size: 18px; color: #fff; cursor: pointer;
  background: var(--blue); border: 2.5px solid var(--ink); border-radius: 3px; animation: nudge 1s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translateX(3px); } }

@media (max-width: 640px) {
  body { font-size: 18px; }
  #compass { top: 64px; font-size: 17px; }
  .help { display: none; }
  #dialog { bottom: 16px; padding: 22px 54px 14px 18px; }
  #dtext { font-size: 19px; }
}

/* ---------------------------------------------------------------- post office panel */

.office-btn {
  position: absolute; top: 14px; right: 14px; font: 400 15px/1 Bungee, Impact, sans-serif; letter-spacing: .04em;
  color: var(--ink); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 3px; padding: 9px 14px;
  cursor: pointer; transform: rotate(1deg); box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85);
}
.music-btn {
  position: absolute; top: 62px; right: 14px; width: 40px; height: 40px; font-size: 20px; line-height: 1;
  color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 3px; cursor: pointer;
  transform: rotate(-2deg); box-shadow: 2px 3px 0 rgba(40, 48, 51, 0.85);
}
.music-btn.off { opacity: .55; text-decoration: line-through; }
.sounds-btn { top: 110px; display: grid; place-items: center; padding: 0; }
.chat-btn { top: 158px; font-size: 18px; padding: 0; }
.set-btn { top: 206px; font-size: 22px; padding: 0; }
.full-btn { top: 254px; display: grid; place-items: center; padding: 0; }
.photo-btn { top: 302px; font-size: 19px; padding: 0; }
.full-btn.on { background: var(--yellow); }
.settings { position: absolute; top: 200px; right: 64px; width: 250px; padding: 10px 12px 12px; transform: rotate(-.5deg); }
.settings h3 { margin: 8px 0 5px; font: 400 13px/1.2 Bungee, Impact, sans-serif; letter-spacing: .03em; }
.settings h3:first-child { margin-top: 0; }
.settings .seg { display: flex; gap: 4px; }
.settings .seg button {
  flex: 1; font: 400 12px/1 Bungee, Impact, sans-serif; letter-spacing: .02em; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 3px; padding: 8px 2px; cursor: pointer;
}
.settings .seg button.on { background: var(--yellow); }
.settings .note { margin: 6px 0 0; font-size: 14px; line-height: 1.2; color: var(--muted); }
.fps { position: absolute; top: 62px; left: 150px; padding: 3px 10px; font: 700 14px ui-monospace, Menlo, monospace; transform: rotate(-.6deg); }
@media (max-width: 640px) { .fps { top: 110px; left: auto; right: 64px; } .settings { right: 60px; width: min(250px, calc(100vw - 80px)); } }
.phrases { position: absolute; top: 152px; right: 64px; display: grid; grid-template-columns: repeat(2, auto); gap: 6px; padding: 8px; transform: rotate(-.6deg); }
.phrases button {
  font: 400 13px/1 Bungee, Impact, sans-serif; letter-spacing: .03em; color: var(--ink); background: #fff; border: 2px solid var(--ink);
  border-radius: 3px; padding: 7px 10px; cursor: pointer; text-align: left; white-space: nowrap;
}
.phrases button:hover { background: var(--yellow); }
.phrases span { font-size: 17px; }
/* The emote bar: always there on screens with a mouse (phones use the button's menu). */
.emote-bar { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; padding: 6px; background: rgba(251, 248, 239, .85);
  border: 2.5px solid var(--ink); border-radius: 30px; box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85); }
.emote-bar button {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; cursor: pointer;
  font-size: 21px; line-height: 1; padding: 0; transition: transform .08s;
}
.emote-bar.away { opacity: 0; pointer-events: none; }
.emote-bar button:hover { background: var(--yellow); transform: translateY(-2px); }
.emote-bar button:active { transform: translateY(1px); }
.emote-bar kbd { position: absolute; right: -3px; bottom: -4px; font: 700 10px ui-monospace, Menlo, monospace; background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 3px; padding: 0 3px; color: var(--ink); }
@media (hover: none), (max-width: 640px) { .emote-bar { display: none; } }
/* Leave the emote bar its corner: the controls help wraps beside it, and steps aside on narrow windows. */
@media (hover: hover) and (min-width: 641px) { .help { max-width: calc(100% - 520px); } }
@media (hover: hover) and (min-width: 641px) and (max-width: 900px) { .help { display: none; } }
.online { position: absolute; top: 62px; left: 14px; padding: 3px 12px; font-size: 17px; transform: rotate(.8deg); }
.online b { font-size: 20px; }
@media (max-width: 640px) { .online { top: 110px; } } /* below the compass, which drops to the second row on phones */
.sounds-btn.off svg path:last-child { opacity: 0; }
.office-btn kbd { font: inherit; font-size: 11px; border: 2px solid var(--ink); border-radius: 3px; padding: 1px 4px; margin-left: 6px; background: var(--paper); }
.office {
  position: fixed; top: 64px; right: 14px; bottom: 14px; width: min(400px, calc(100vw - 28px)); z-index: 8;
  overflow-y: auto; overscroll-behavior: contain; padding: 0 0 8px; font-size: 18px;
}
.ohead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 2.5px solid var(--ink); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.ohead h2 { margin: 0; font: 400 20px/1 Bungee, Impact, sans-serif; }
.office section { padding: 12px 14px; border-bottom: 2px dashed #d8d2c2; }
.office h3 { margin: 0 0 8px; font: 400 15px/1.2 Bungee, Impact, sans-serif; letter-spacing: .03em; }
.office .muted { color: var(--muted); font-family: "Patrick Hand", sans-serif; font-size: 16px; letter-spacing: 0; }
.office .note { margin: 6px 0; color: var(--muted); font-size: 16px; line-height: 1.25; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 2px dashed #d8d2c2; }
.who select, .office input { font: 16px "Patrick Hand", sans-serif; border: 2px solid var(--ink); background: #fff; color: var(--ink); padding: 4px 6px; border-radius: 2px; min-width: 0; }
.who select { flex: 1 1 100%; }
.bal { font-size: 17px; }
.pbtn {
  font: 400 12px/1 Bungee, Impact, sans-serif; letter-spacing: .03em; color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 3px; padding: 7px 9px; cursor: pointer; box-shadow: 2px 2px 0 rgba(40, 48, 51, .8);
}
.pbtn.primary { background: var(--yellow); }
.pbtn.wide { width: 100%; margin: 8px 0 4px; padding: 10px; font-size: 13px; }
.pbtn:disabled { opacity: .45; cursor: default; }
.pbtn:active:not(:disabled) { transform: translateY(1px); box-shadow: 1px 1px 0 rgba(40, 48, 51, .8); }
.field { display: grid; gap: 4px; margin: 8px 0; font-size: 16px; color: var(--muted); }
.pending { display: grid; justify-items: center; padding: 2px 0 4px; }
.pending b { font: 400 30px/1.1 Bungee, Impact, sans-serif; color: #3f8f5a; }
.pending span { font-size: 15px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; font-size: 17px; }
.kv span { color: var(--muted); }
.meter { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-top: 6px; }
.meter .bar { flex: 1; height: 10px; border: 2px solid var(--ink); background: #fff; }
.meter .bar div { height: 100%; background: var(--blue); }
.couriers { display: grid; gap: 8px; }
.ccard { display: grid; grid-template-columns: 72px 1fr; gap: 4px 10px; align-items: center; border: 2px solid #d8d2c2; padding: 6px; background: #fff; }
.ccard.duty { border-color: var(--ink); background: #f3fbf6; }
.ccard img, .ccard .ph { width: 72px; height: 72px; grid-row: span 2; background: #e9e1cf; }
.cinfo { display: flex; flex-direction: column; font-size: 16px; line-height: 1.15; }
.cinfo .tag { align-self: flex-start; font: 400 10px/1 Bungee, sans-serif; background: #5e9f57; color: #fff; padding: 3px 5px; border: 1.5px solid var(--ink); margin-top: 2px; }
.cact { display: flex; gap: 5px; flex-wrap: wrap; }
.ccard.sealed { grid-template-columns: 48px 1fr; }
.env-big { width: 44px; height: 32px; border: 2.5px solid var(--ink); background: var(--paper); grid-row: span 2; position: relative; }
.env-big::after { content: ""; position: absolute; left: 9px; top: -9px; width: 22px; height: 22px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg) scaleY(.6); }
.mintrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.mintrow b { font: 400 18px Bungee, sans-serif; min-width: 22px; text-align: center; }
.office .link { width: 100%; font-size: 14px; }
.dev { background: #fff8e1; }

.seg { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.seg button {
  flex: 1; font: 400 13px/1 Bungee, Impact, sans-serif; letter-spacing: .03em; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 3px; padding: 8px 6px; cursor: pointer;
}
.seg button.on { background: var(--yellow); box-shadow: 2px 2px 0 rgba(40, 48, 51, .8); }
.seg.small button { font-size: 11px; padding: 5px 4px; }
.seg .muted { flex: 0 0 auto; margin-right: 2px; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.link-btn { font: 15px "Patrick Hand", sans-serif; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; }
.amt { display: flex; align-items: center; border: 2px solid var(--ink); background: #fff; border-radius: 2px; }
.office .amt input { flex: 1; width: 0; border: 0; font: 400 20px Bungee, Impact, sans-serif; padding: 8px; outline: none; background: transparent; }
.amt .unit { font: 400 12px Bungee, Impact, sans-serif; padding: 0 10px; color: var(--muted); }
.trade .kv b { text-align: right; }
.office .warn { color: #b23b33; }

#toasts { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 9; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { padding: 5px 14px; font-size: 18px; }
.toast.busy { background: #fff6cf; }
.toast.error { color: #b23b33; }

@media (max-width: 640px) {
  .office { top: auto; height: 62vh; left: 8px; right: 8px; width: auto; bottom: 8px; }
  .office-btn { top: 108px; right: 10px; }
  .music-btn { top: 156px; right: 10px; }
  /* (each its own spot down the right-hand side; they used to stack on one) */
  .sounds-btn { top: 204px; }
  .chat-btn { top: 252px; }
  .set-btn { top: 300px; }
  .full-btn { top: 348px; }
  .photo-btn { top: 396px; }
  .settings { top: 296px; right: 58px; }
}

/* ---------------------------------------------------------------- wallet login */

.wallets { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(40, 48, 51, .45); }
.wsheet { width: min(380px, 100%); padding-bottom: 12px; }
.wsheet .note { margin: 10px 14px; color: var(--muted); font-size: 17px; line-height: 1.25; }
.wlist { display: grid; gap: 8px; padding: 0 14px; }
.wallet {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; cursor: pointer; text-align: left;
  font: 400 15px/1 Bungee, Impact, sans-serif; color: var(--ink); background: #fff;
  border: 2.5px solid var(--ink); border-radius: 3px; box-shadow: 3px 3px 0 rgba(40, 48, 51, .85);
}
.wallet:hover { background: #fff8e1; }
.wallet img, .wallet .wicon { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.who .addr { font-size: 17px; color: var(--ink); }

/* Courier Skins */
.skin-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 10px; }
.skin-strip img { width: 100%; aspect-ratio: 1; display: block; }
.skins h4 { margin-top: 12px; }

/* "Mint Limited Courier Skin": on the title and in the corner while the skins sale is on */
.skin-mint {
  margin-top: -14px; font: 400 16px/1 Bungee, Impact, sans-serif; letter-spacing: .04em; color: var(--ink);
  background: #f7a8d8; border: 3px solid var(--ink); border-radius: 3px; padding: 10px 18px; cursor: pointer;
  transform: rotate(1deg); box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.9); transition: transform .1s;
}
.skin-mint:hover { transform: rotate(1deg) translateY(-2px); }
.skin-mint:active { transform: rotate(1deg) translateY(2px); box-shadow: 1px 2px 0 rgba(40, 48, 51, 0.9); }
.skin-mint-hud {
  position: absolute; top: 62px; right: 64px; font: 400 13px/1 Bungee, Impact, sans-serif; letter-spacing: .03em;
  color: var(--ink); background: #f7a8d8; border: 2.5px solid var(--ink); border-radius: 3px; padding: 8px 12px;
  cursor: pointer; transform: rotate(-1deg); box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85);
}
.skin-mint-hud .short { display: none; }
.skin-mint .em, .skin-mint-hud .em { margin-right: .45em; }
.skin-mint[hidden], .skin-mint-hud[hidden] { display: none; }
@media (max-width: 640px) {
  .skin-mint-hud { top: 150px; right: auto; left: 14px; }
  .skin-mint-hud .long { display: none; }
  .skin-mint-hud .short { display: inline; }
}

/* Chat: lines from everyone, above the emote bar (top left on touch screens, where the joystick is) */
.chat { position: absolute; left: 14px; bottom: 84px; width: min(380px, calc(100vw - 28px)); display: grid; gap: 6px; pointer-events: none !important; }
.chat > * { pointer-events: auto; }
.chat[hidden] { display: none; }
/* Lines sit at the bottom (the first one's auto margin) but older ones stay scrollable above. */
.chat-log { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 3px; scrollbar-width: none; }
.chat-log > :first-child { margin-top: auto; }
.chat.open .chat-log { max-height: min(300px, 42vh); scrollbar-width: thin; }
.chat .line {
  align-self: flex-start; flex: none; max-width: 100%; padding: 3px 10px 4px; background: rgba(251, 248, 239, .92); border: 2px solid var(--ink);
  border-radius: 12px; font: 400 16px/1.3 system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif; color: var(--ink);
  overflow-wrap: anywhere; transition: opacity .6s;
}
.chat .line.old { opacity: 0; pointer-events: none; }
.chat.open .line.old { opacity: 1; pointer-events: auto; }
.chat .who { display: inline; font: 700 13px ui-monospace, Menlo, monospace; color: #3f6fbf; background: none; border: 0; padding: 0 6px 0 0; cursor: pointer; }
.chat .who.me { color: #b4443c; cursor: default; }
.chat-open {
  justify-self: start; font: 400 12px/1 Bungee, Impact, sans-serif; letter-spacing: .03em; color: var(--ink);
  background: rgba(251, 248, 239, .88); border: 2px solid var(--ink); border-radius: 14px; padding: 6px 10px; cursor: pointer;
}
.chat-open[hidden], .chat-form[hidden] { display: none; }
.chat-form { display: flex; gap: 6px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 6px; padding: 5px; box-shadow: 3px 4px 0 rgba(40, 48, 51, 0.85); }
.chat-form input { flex: 1; min-width: 0; font: 400 16px system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif; border: 0; background: transparent; outline: none; color: var(--ink); padding: 4px; }
.chat-send { font: 400 12px/1 Bungee, Impact, sans-serif; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 3px; padding: 6px 10px; cursor: pointer; }
.settings .unmute { margin-top: 8px; font: 400 11px/1 Bungee, Impact, sans-serif; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 3px; padding: 6px 8px; cursor: pointer; }
@media (hover: none), (max-width: 640px) {
  .chat { top: 196px; bottom: auto; left: 10px; width: calc(100vw - 80px); }
  .chat-log { max-height: 118px; }
  .chat.open .chat-log { max-height: min(220px, 30vh); }
  .chat .line { font-size: 14px; }
}

/* The Orb's ad card (no "ad-" names: ad blockers hide those) */
.orb-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.4deg); z-index: 12; width: min(380px, calc(100vw - 32px)); padding: 14px 16px 12px; }
.orb-card[hidden] { display: none; }
.orb-close { position: absolute; top: 8px; right: 8px; }
.orb-tag { margin: 0 0 8px; font: 400 11px/1 Bungee, Impact, sans-serif; letter-spacing: .05em; color: #b4443c; }
.orb-img { display: block; width: min(200px, 60%); margin: 2px auto 0; aspect-ratio: 1; object-fit: cover; border: 2.5px solid var(--ink); border-radius: 50%; background: #0b1024; }
.orb-card h3 { margin: 10px 0 4px; font: 400 20px/1.15 Bungee, Impact, sans-serif; }
.orb-text { margin: 0 0 10px; font-size: 17px; line-height: 1.25; }
.orb-links { display: flex; gap: 8px; flex-wrap: wrap; }
.orb-links a { text-decoration: none; }
.orb-links a[hidden] { display: none; }
.orb-domain { margin: 8px 0 0; font: 600 13px ui-monospace, Menlo, monospace; color: var(--muted); }
.orb-note { margin: 8px 0 0; font-size: 14px; line-height: 1.2; color: var(--muted); }
.trip-card .orb-tag { color: #6b4fd8; }
.trip-card button.pbtn { font: inherit; cursor: pointer; }
.trip-pick { display: flex; gap: 8px; margin: 0 0 10px; }
.trip-pick .pbtn { flex: 1; }
.trip-pick .pbtn[aria-selected="true"] { background: var(--ink); color: #fbf8ef; }
/* The flight: a white-out with a line, while the world changes underneath. */
.flight-fade { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #f6f3ea; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.flight-fade.on { opacity: 1; pointer-events: auto; }
.flight-fade span { font: 400 clamp(26px, 6vw, 54px)/1.1 Bungee, Impact, sans-serif; color: var(--ink); text-align: center; padding: 16px; }

/* Your name on the planet, in the Post Office panel. */
.who .pname { font: 700 15px ui-monospace, Menlo, monospace; color: #3f6fbf; }
.pickname { border: 2px solid #3f6fbf; background: #eef3fb; }
.pickname .namerow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pickname .namerow input { flex: 1 1 160px; min-width: 0; }
.pickname .note { margin: 8px 0; }

/* ---------------------------------------------------------------- photo mode */

/* Everything on screen steps aside but the walking stick (on phones) and the photo controls. */
body.photo-on #hud > :not(#joy), body.photo-on .office, body.photo-on .orb-card { display: none !important; }
.photo { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.photo > * { pointer-events: auto; }
.photo-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%) rotate(-.4deg); display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; max-width: calc(100% - 24px); box-sizing: border-box;
}
.photo-bar .pbtn { padding: 7px 12px; }
.photo-bar .pbtn[aria-pressed="true"] { background: var(--yellow); }
.photo-time { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.photo-time input { width: 140px; accent-color: #3f6fbf; }
.photo-time b { min-width: 44px; font: 700 14px ui-monospace, Menlo, monospace; }
.photo-zoom { display: flex; gap: 4px; }
.photo-zoom .pbtn { width: 38px; padding: 7px 0; font-size: 18px; }
.photo-hint {
  position: absolute; bottom: 112px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; width: max-content; max-width: min(560px, calc(100% - 32px));
  box-sizing: border-box; text-align: center; font-size: 16px; pointer-events: none; animation: photoHint 8s forwards;
}
@keyframes photoHint { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.photo-shoot {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: 70px; height: 70px; border-radius: 50%;
  background: #fbf8ef; border: 5px solid var(--ink); box-shadow: 0 0 0 4px #fbf8ef, 3px 5px 0 6px rgba(40, 48, 51, 0.6); cursor: pointer;
}
.photo-shoot:active { transform: translateX(-50%) scale(.92); }
.photo-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; }
.photo-flash.go { animation: photoFlash .35s ease-out; }
@keyframes photoFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
.photo-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.6deg); z-index: 45; width: min(560px, calc(100% - 32px));
  padding: 12px; box-sizing: border-box;
}
.photo-card img { display: block; width: 100%; border: 2.5px solid var(--ink); border-radius: 2px; background: #e8e2d2; }
.photo-actions .pbtn.busy { opacity: .6; pointer-events: none; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-actions .pbtn { flex: 1 1 auto; text-align: center; text-decoration: none; }
@media (max-width: 640px) {
  .photo-time input { width: 110px; }
  .photo-shoot { width: 64px; height: 64px; bottom: 28px; }
  .photo-hint { bottom: auto; top: 192px; } /* (under the bar, clear of the stick) */
}

/* Courier Skins: the $STAMP button under the ETH one. */
.skins .stamp-mint { margin-top: 6px; background: #f2c94c; }

/* ---------------------------------------------------------------- the launchpad (pad.js) */

#padBody { padding: 10px 14px 4px; }
.pad .pad-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pad .pad-top .seg { margin: 0; }
.pad-search, .pad .field > input, .pad .field > textarea, .pad .admin input {
  box-sizing: border-box; width: 100%; border: 2px solid var(--ink); border-radius: 3px; padding: 7px 9px;
  font: 17px "Patrick Hand", sans-serif; color: var(--ink); background: #fff; outline: none;
}
.pad .field > textarea { resize: vertical; min-height: 54px; }
.pad-search { margin: 10px 0 8px; }
.pad-list { display: grid; gap: 6px; }
.pad-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 3px; padding: 6px 8px; cursor: pointer; font: inherit;
}
.pad-row:hover { background: #fff6d6; }
.pad-name { flex: 1; min-width: 0; display: grid; }
.pad-name b, .pad-name .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-name b { font: 400 14px/1.25 Bungee, Impact, sans-serif; }
.pad .pad-name .muted { font-size: 14px; }
.pad-mc { font: 400 13px/1 Bungee, Impact, sans-serif; white-space: nowrap; }
.pad-img { flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); background: #fff; }
.pad-badge {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink);
  background: #8b8f99; color: #fff; font: 400 12px/1 Bungee, Impact, sans-serif; text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}
.pad-head { display: flex; gap: 12px; align-items: center; margin: 10px 0 6px; }
.pad-head h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.pad-head p { margin: 0; }
.pad-desc { margin: 6px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.25; }
.pad-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pad-links .pbtn { font-size: 12px; text-decoration: none; }
.pad section.trade { padding: 12px 0; margin-top: 10px; border-top: 2px dashed #d8d2c2; border-bottom: 2px dashed #d8d2c2; }
.pad > #padBody > h3 { margin: 10px 0 4px; }
.pad-form { display: flex; gap: 12px; align-items: center; }
.pad-pic {
  flex: 0 0 92px; height: 92px; border: 2.5px dashed var(--ink); border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  overflow: hidden; background: #fff; font: 400 12px Bungee, Impact, sans-serif; color: var(--muted);
}
.pad-pic img { width: 100%; height: 100%; object-fit: cover; }
.pad-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.pad-form .pad-fields { grid-template-columns: 1fr; }
.pad .field { margin: 6px 0; }
.pad-facts { margin: 10px 0 4px; padding-left: 20px; font-size: 16px; line-height: 1.3; color: var(--muted); }
.pad-facts b { color: var(--ink); }
.pad .admin { margin-top: 12px; padding: 10px; border: 2px dashed var(--ink); border-radius: 3px; }
.pad .admin input { flex: 1; width: auto; min-width: 0; }
.office .padlink { padding: 4px 14px 8px; }
.office .padlink .pbtn { background: #e7dcff; }
.office .padlink .note { margin: 2px 0 0; font-size: 15px; }
