/* css/play.css: the game page. A full-screen 3D stage with an HTML HUD over it. */

html, body.play { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.play { background: var(--sea-deep); color: var(--foam); font-size: 16px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage { position: fixed; inset: 0; }
#world { width: 100%; height: 100%; touch-action: none; display: block; outline: none; }

/* safe areas: phones with notches in landscape */
.hud, .spect, .voyage { --sl: max(10px, env(safe-area-inset-left)); --sr: max(10px, env(safe-area-inset-right)); --st: max(10px, env(safe-area-inset-top)); --sb: max(10px, env(safe-area-inset-bottom)); }
.hud > div, .spect > *, .voyage > * { position: fixed; z-index: 10; }

/* --- boot ------------------------------------------------------------------------------------------------------- */
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1E6470, var(--sea-deep) 60%, var(--sea-night)); transition: opacity .5s ease; }
.boot.out { opacity: 0; pointer-events: none; }
.boot-card { width: min(360px, 100% - 32px); text-align: center; padding: 30px 26px 26px; color: var(--ink); }
.boot-rose { display: grid; place-items: center; margin-bottom: 6px; }
.boot-rose img { box-shadow: 0 0 0 3px var(--brass), 0 8px 18px -8px rgba(0, 0, 0, .6); }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-card h1 { font-size: 3rem; margin: 0; letter-spacing: .08em; }
.boot-card p { margin: .3em 0 1em; color: var(--ink-2); font-size: 1.1rem; }
.boot-bar { height: 6px; border-radius: 6px; background: rgba(43, 29, 18, .12); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--brass), var(--wax)); transition: width .4s ease; }

/* --- top left: minimap ------------------------------------------------------------------------------------------ */
.hud-tl { top: var(--st); left: var(--sl); display: grid; justify-items: center; gap: 6px; }
.hud-home { position: absolute; left: -2px; top: -2px; z-index: 2; width: 36px; height: 36px; display: block; border-radius: 50%; overflow: hidden; background: #3E7FB0; box-shadow: 0 0 0 2px var(--brass), 0 4px 10px -4px rgba(0, 0, 0, .6); }
.hud-home img { width: 100% !important; height: 100% !important; border-radius: 50% !important; object-fit: cover; }
.mm-ring { width: 132px; height: 132px; }
#minimap { width: 100%; height: 100%; background: #CFE0D6; cursor: pointer; }
.plate { font-family: var(--display); letter-spacing: .14em; font-size: 1.05rem; color: var(--ink); padding: 2px 16px 1px; border-radius: 4px;
  background: linear-gradient(180deg, #F7EAC9, var(--parchment-2)); box-shadow: 0 0 0 1.5px var(--brass-lo), 0 4px 10px -4px rgba(0, 0, 0, .6); text-transform: uppercase; }

/* --- top centre: the day ---------------------------------------------------------------------------------------- */
.hud-tc { top: var(--st); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; }
.daychip { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border-radius: 999px; }
.astro { width: 34px; height: 34px; border-radius: 50%; display: block; }
.daytext { display: grid; line-height: 1.05; }
.daytext b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: .06em; color: #F7E9C6; }
.daytext small { font-size: .78rem; color: #9CC2BC; font-weight: 700; }
.online { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: .85rem; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: #5CC27A; box-shadow: 0 0 0 3px rgba(92, 194, 122, .2); }

/* --- top right: purse, role, account, menu ---------------------------------------------------------------------- */
.hud-tr { top: var(--st); right: var(--sr); display: grid; grid-template-columns: auto auto auto; grid-template-areas: 'purse role acct' 'menu menu menu'; gap: 8px; justify-items: end; align-items: center; }
.purse { grid-area: purse; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px; font-weight: 800; font-size: 1.05rem; color: #F7E9C6; }
.purse [data-icon] { color: var(--brass-hi); display: grid; }
.roleseal { grid-area: role; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #FBEBD6;
  background: radial-gradient(circle at 35% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo)); box-shadow: 0 0 0 2px rgba(233, 196, 106, .7), 0 6px 12px -6px rgba(0, 0, 0, .7); }
.acct { grid-area: acct; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--foam); max-width: 190px; }
.acct span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-menu { grid-area: menu; display: flex; gap: 6px; }

/* --- bottom left: chat ------------------------------------------------------------------------------------------ */
.hud-bl { left: var(--sl); bottom: var(--sb); display: flex; align-items: flex-end; gap: 8px; }
.chat { width: min(340px, calc(50vw - 270px)); min-width: 220px; padding: 8px; display: grid; gap: 6px; }
.chat-log { max-height: 150px; overflow-y: auto; display: grid; gap: 3px; font-size: .9rem; line-height: 1.3; padding-right: 4px; user-select: text; -webkit-user-select: text; }
.chat-log p { margin: 0; }
.chat-log b { color: var(--brass-hi); font-weight: 800; }
.chat-log .sys { color: #9CC2BC; font-style: italic; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; height: 36px; border-radius: 999px; border: 1px solid rgba(233, 196, 106, .45); background: rgba(0, 0, 0, .25); color: var(--foam); padding: 0 12px; }
.chat-form .btn { width: 36px; padding: 0; }
.chat.closed { display: none; }
.chat-toggle { display: none; }

/* --- bottom centre: context bar --------------------------------------------------------------------------------- */
.hud-bc { left: 50%; bottom: var(--sb); transform: translateX(-50%); max-width: calc(100vw - 2 * 360px - 40px); min-width: 300px; }
.ctx { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 18px; }
.ctx-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: radial-gradient(circle at 35% 30%, #FFF6DA, var(--parchment-2)); box-shadow: 0 0 0 2px var(--brass); }
.ctx-txt { display: grid; line-height: 1.15; min-width: 0; }
.ctx-txt b { color: #F7E9C6; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-txt small { color: #9CC2BC; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-acts { display: flex; gap: 6px; margin-left: auto; flex-wrap: nowrap; }
.ctx-x { background: none; border: 0; color: #9CC2BC; width: 30px; height: 30px; display: grid; place-items: center; }

/* --- bottom centre: the pack bar (always visible) ------------------------------------------------------------- */
.hud-pack { left: 50%; bottom: var(--sb); transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 14px;
  background: var(--glass); border: 1.5px solid rgba(233, 196, 106, .55); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); }
.pk { position: relative; width: 44px; height: 44px; border-radius: 9px; border: 0; display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #FFF6DA, var(--parchment-2)); box-shadow: inset 0 0 0 1.5px rgba(122, 85, 24, .45); padding: 0; }
.pk.empty { background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1.5px rgba(233, 196, 106, .18); }
.pk b { position: absolute; right: 2px; bottom: 0; font-size: .72rem; font-weight: 800; color: var(--ink); text-shadow: 0 0 3px #FFF6DA; }
.hud-bc { bottom: calc(var(--sb) + 64px) !important; }
.at-sea .hud-pack { display: none; }

/* --- bottom right: view --------------------------------------------------------------------------------------- */
.hud-br { right: var(--sr); bottom: var(--sb); display: flex; gap: 6px; }

/* --- spectate --------------------------------------------------------------------------------------------------- */
.spect-plate { top: var(--st); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.spect-plate b { font-family: var(--display); font-weight: 400; letter-spacing: .06em; color: #F7E9C6; }
.spect-ports { display: flex; gap: 4px; }
.spect-ports button { border: 1px solid rgba(233, 196, 106, .5); background: transparent; color: var(--foam); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .85rem; }
.spect-ports button[aria-selected='true'] { background: var(--brass); color: var(--ink); }
#spectPlay { right: var(--sr); bottom: var(--sb); }
.spect .hud-home { position: fixed; top: var(--st); left: var(--sl); }

/* --- voyage ----------------------------------------------------------------------------------------------------- */
.vy-top { top: var(--st); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 18px; width: min(560px, calc(100vw - 2 * var(--sl) - 300px)); }
.vy-chart { width: 84px; height: 90px; flex: none; border-radius: 10px; background: #F2E4C4; }
.vy-chart .sc-port text, .vy-chart .sc-min, .vy-chart .sc-title { display: none; }
.vy-info { display: grid; gap: 6px; flex: 1; min-width: 0; }
.vy-info b { font-family: var(--display); font-weight: 400; letter-spacing: .04em; font-size: 1.15rem; color: #F7E9C6; }
.vy-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.vy-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass), var(--brass-hi)); transition: width .5s linear; }
.vy-info small { color: #9CC2BC; font-weight: 700; }
.vy-side { left: var(--sl); top: calc(var(--st) + 190px); width: 220px; padding: 10px 12px; display: grid; gap: 8px; font-size: .9rem; }
.vy-side h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1rem; letter-spacing: .06em; color: var(--brass-hi); }
.vy-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.vy-call { left: 50%; bottom: calc(var(--sb) + 12px); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; border: 0; padding: 14px 26px 12px; border-radius: 999px; color: #FBEBD6;
  background: radial-gradient(circle at 35% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo)); box-shadow: 0 0 0 3px rgba(233, 196, 106, .8), 0 12px 26px -10px rgba(0, 0, 0, .8); animation: callpulse 1s ease-in-out infinite; }
.vy-call b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: .04em; }
.vy-call small { font-weight: 800; opacity: .85; }
.vy-call-ico { display: grid; }
@keyframes callpulse { 50% { box-shadow: 0 0 0 7px rgba(233, 196, 106, .35), 0 12px 26px -10px rgba(0, 0, 0, .8); } }
.vy-quay { right: var(--sr); top: calc(var(--st) + 110px); width: min(340px, 44vw); color: var(--ink); padding: 16px; max-height: calc(100vh - 140px); overflow: auto; }

/* --- sheet ------------------------------------------------------------------------------------------------------ */
.sheet { position: fixed; z-index: 30; top: var(--st, 10px); right: var(--sr, 10px); bottom: var(--sb, 10px); width: min(420px, calc(100vw - 20px)); color: var(--ink); border-radius: var(--r);
  box-shadow: 0 0 0 1.5px var(--brass-lo), 0 20px 50px -20px rgba(0, 0, 0, .8); display: flex; flex-direction: column; overflow: hidden; animation: sheetin .22s ease; --st: max(10px, env(safe-area-inset-top)); --sr: max(10px, env(safe-area-inset-right)); --sb: max(10px, env(safe-area-inset-bottom)); }
@keyframes sheetin { from { transform: translateX(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid rgba(90, 68, 48, .25); }
.sheet-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #FBEBD6; background: radial-gradient(circle at 35% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo)); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.45rem; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .btn { color: var(--ink); }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px; display: grid; align-content: start; gap: 14px; user-select: text; -webkit-user-select: text; overscroll-behavior: contain; }
.sheet-body h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: .04em; }
.sheet-body p { margin: 0; color: var(--ink-2); }
.note { font-size: .92rem; color: var(--ink-3) !important; }
.muted { color: var(--ink-3); }

/* rows of goods, offers, berths */
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: rgba(255, 250, 235, .6); border: 1px solid rgba(90, 68, 48, .2); }
.row .g-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--parchment-2); }
.row .g-txt { display: grid; line-height: 1.2; min-width: 0; }
.row .g-txt b { font-size: 1rem; }
.row .g-txt small { color: var(--ink-3); font-size: .84rem; }
.row .g-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row.wide { grid-template-columns: 1fr auto; }
.price { font-weight: 800; color: var(--ink); white-space: nowrap; }
.price .ico { display: inline-block; vertical-align: -3px; color: var(--brass-lo); }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(90, 68, 48, .4); }
.stepper button { width: 32px; height: 32px; border: 0; background: none; display: grid; place-items: center; }
.stepper input { width: 46px; text-align: center; border: 0; background: none; font-weight: 800; }
.field { display: grid; gap: 4px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.field input, .field select { height: 40px; border-radius: 10px; border: 1.5px solid rgba(90, 68, 48, .35); background: #FFF9EA; padding: 0 10px; color: var(--ink); font-weight: 700; }
.inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; padding: 10px; border-radius: 12px; background: repeating-linear-gradient(90deg, #6B4423 0 18px, #5E3B1E 18px 20px); box-shadow: inset 0 4px 10px rgba(0, 0, 0, .4); }
.slot { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; color: var(--parchment); background: linear-gradient(180deg, #A9773F, #8A5A2C); position: relative; border: 0; }
.slot.empty { background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 180, .2); }
.slot.sealed::after { content: ''; position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--wax); box-shadow: 0 0 0 1.5px #FBEBD6; }
.slot small { position: absolute; bottom: 2px; font-size: .64rem; font-weight: 800; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1.5px solid rgba(90, 68, 48, .35); background: transparent; border-radius: 999px; padding: 5px 14px; font-weight: 800; color: var(--ink-2); }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rolecard { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; border: 1.5px solid rgba(90, 68, 48, .3); background: rgba(255, 250, 235, .6); text-align: center; font-weight: 800; }
.rolecard[aria-pressed='true'] { border-color: var(--wax); box-shadow: 0 0 0 3px rgba(163, 36, 43, .15); background: #FFF7E4; }
.rolecard small { font-weight: 500; color: var(--ink-3); font-size: .78rem; line-height: 1.2; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 10px; border-radius: 12px; background: rgba(255, 250, 235, .6); border: 1px solid rgba(90, 68, 48, .2); text-align: center; }
.stat b { display: block; font-size: 1.35rem; }
.stat small { color: var(--ink-3); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.bar { height: 7px; border-radius: 7px; background: rgba(43, 29, 18, .12); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--wax)); }
.sheet-chart svg { width: 100%; height: auto; border-radius: 12px; }
.steps { margin: 0; padding-left: 1.5em; display: grid; gap: 7px; color: var(--ink-2); line-height: 1.35; }
.steps li::marker { font-weight: 800; color: var(--brass-lo); }
.sheet-body code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86em; padding: 1px 6px; border-radius: 6px; background: rgba(43, 29, 18, .08); box-shadow: inset 0 0 0 1px rgba(90, 68, 48, .22); color: var(--ink); overflow-wrap: anywhere; }
.steps code { display: inline-block; max-width: 100%; line-height: 1.35; }
.link-btns { display: grid; gap: 8px; }
.link-btns .btn { gap: 8px; box-sizing: border-box; }
.sheet-body .tribute { font-style: italic; border-top: 1px solid rgba(90, 68, 48, .2); padding-top: 10px; }
/* the Orbio House card (orbio.so): cream marble, brown ink, lime, the orb mark */
.sheet-ico[data-kind='orbio'] { background: radial-gradient(circle at 35% 30%, #FFFDF8, #EFE7D8 70%, #DCD0BA); box-shadow: 0 0 0 1.5px #B8924A; }
.orbio { display: grid; gap: 12px; --orb-ink: #302A21; --orb-lime: #D0F99E; --orb-lime-d: #5D7A2C; }
.orbio .orb-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--orb-lime-d); }
.orbio .orb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.orbio .orb-head small { color: var(--ink-3); font-size: .78rem; }
.orbio .orb-price { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, #FFFDF8, #F3EEE4); box-shadow: inset 0 0 0 1px rgba(48, 42, 33, .16); color: var(--orb-ink); }
.orbio .orb-price b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 2rem; line-height: 1; letter-spacing: -.02em; }
.orbio .orb-price span { font-weight: 700; color: rgba(48, 42, 33, .7); }
.orbio .orb-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--orb-lime); color: var(--orb-ink) !important; font-weight: 800; font-size: .88rem; box-shadow: inset 0 0 0 1px rgba(93, 122, 44, .3); }
.orbio .orb-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.orbio .orb-stats .stat { background: #FFFDF8; }
.orbio .orb-stats .stat b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.15rem; margin: 2px 0; }
.orbio .orb-box { padding: 10px 12px; border-radius: 12px; background: rgba(243, 238, 228, .8); box-shadow: inset 0 0 0 1px rgba(48, 42, 33, .14); display: grid; gap: 8px; justify-items: start; }
.orbio .orb-mine { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: #FFFDF8; color: var(--orb-ink); }
.orbio .orb-mine b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.2rem; }
.orbio .orb-mine small { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-3); }
.orbio .orb-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.orbio .orb-err p { color: var(--orb-ink); }
.orbio .btn.orb-go { background: var(--orb-lime); color: var(--orb-ink); box-shadow: inset 0 -2px 0 rgba(48, 42, 33, .16), 0 0 0 1.5px rgba(93, 122, 44, .45); }
/* the Oak Agent Kit card (oakagentkit.org, fan-made tribute): the parchment sheet with oak greens and bark browns */
.oakc { display: grid; gap: 12px; --ok-ink: #2E2418; --ok-leaf: #4A7D3B; --ok-bark: #80603F; }
.oakc .ok-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.oakc .ok-head small { color: var(--ink-3); font-size: .78rem; }
.oakc .ok-ver { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, #FBFAF2, #EEF1E2); box-shadow: inset 0 0 0 1px rgba(74, 106, 52, .22); color: var(--ok-ink); }
.oakc .ok-ver > div { display: grid; gap: 2px; }
.oakc .ok-ver small { color: var(--ink-3); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.oakc .ok-ver b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.7rem; line-height: 1.05; letter-spacing: -.02em; }
.oakc .ok-ver span { color: rgba(46, 36, 24, .72); font-size: .86rem; font-weight: 600; }
.oakc .ok-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #D9E8C2; color: #2F5224 !important; font-weight: 800; font-size: .86rem; box-shadow: inset 0 0 0 1px rgba(74, 106, 52, .35); }
.oakc .ok-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.oakc .ok-stats .stat { background: #FBFAF2; display: grid; gap: 1px; }
.oakc .ok-stats .stat b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.15rem; margin: 2px 0; color: var(--ok-ink); overflow-wrap: anywhere; }
.oakc .ok-stats .stat span { color: var(--ink-3); font-size: .74rem; }
.oakc .ok-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.oakc .ok-err p { color: var(--ok-ink); }
.oakc .ok-part { background: rgba(251, 241, 232, .6); }
.oakc .ok-cmd { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; flex-wrap: wrap; vertical-align: middle; }
.oakc .btn.ok-copy { min-height: 0; padding: 2px 10px; font-size: .76rem; line-height: 1.5; border-radius: 8px; }
.oakc .btn.ok-copy.done { color: var(--ok-leaf); box-shadow: inset 0 0 0 1.5px rgba(74, 106, 52, .5); }
/* the Texel Roads card (texel.run, fan-made tribute): cream paper, black ink, a pastel pink-mint-sky gradient */
.sheet-ico[data-kind='texel'] { background: linear-gradient(135deg, #FFB7D3, #AEF0D2 55%, #A0D1FF); box-shadow: 0 0 0 1.5px rgba(23, 23, 28, .4); }
.texel { display: grid; gap: 12px; --tx-ink: #17171C; }
.texel .tx-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #3a77c4; }
.texel .tx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.texel .tx-head small { color: var(--ink-3); font-size: .78rem; }
.texel .tx-list { display: grid; border-radius: 12px; overflow: hidden; background: #FFFDF8; box-shadow: inset 0 0 0 1px rgba(23, 23, 28, .14); }
.texel .tx-list::before { content: ''; height: 5px; background: linear-gradient(90deg, #FFB7D3, #FFD4B0, #AEF0D2, #A0D1FF); }
.texel .tx-row { display: grid; grid-template-columns: 3.4em 1fr auto; align-items: baseline; gap: 8px; padding: 7px 12px; border-top: 1px solid rgba(23, 23, 28, .08); }
.texel .tx-row:first-child { border-top: 0; }
.texel .tx-kind { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: rgba(23, 23, 28, .55); }
.texel .tx-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx-ink); }
.texel .tx-price { text-align: right; white-space: nowrap; color: var(--tx-ink); }
.texel .tx-price b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92rem; }
.texel .tx-price small { color: var(--ink-3); font-size: .74rem; }
.texel .tx-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.texel .tx-err p { color: var(--tx-ink); }
.texel .btn.tx-go { background: var(--tx-ink); color: #fff; box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .12), 0 0 0 1.5px rgba(23, 23, 28, .6); }
/* the Morpho House card (a fan-made tribute to Morpho): cream paper, Morpho blue, a compact market table */
.sheet-ico[data-kind='morpho'] { background: radial-gradient(circle at 35% 30%, #FFFDF8, #F6EFDC 70%, #E6DCC2); box-shadow: 0 0 0 1.5px rgba(47, 111, 232, .55); }
.morpho { display: grid; gap: 12px; --mo-ink: #1B2440; --mo-blue: #2F6FE8; --mo-blue-d: #1F4FB4; }
.morpho .mo-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mo-blue-d); }
.morpho .mo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.morpho .mo-head small { color: var(--ink-3); font-size: .78rem; }
.morpho .mo-table { display: grid; border-radius: 12px; overflow: hidden; background: #FFFDF8; box-shadow: inset 0 0 0 1px rgba(27, 36, 64, .14); }
.morpho .mo-table::before { content: ''; height: 4px; background: linear-gradient(90deg, var(--mo-blue-d), var(--mo-blue), #8DB4FF); }
.morpho .mo-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.4em 4.4em 3.6em; align-items: baseline; gap: 2px 8px; padding: 7px 12px; border-top: 1px solid rgba(27, 36, 64, .08); color: var(--mo-ink); }
.morpho .mo-row:first-of-type { border-top: 0; }
.morpho .mo-th { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: rgba(27, 36, 64, .55); padding-top: 6px; padding-bottom: 4px; }
.morpho .mo-th span:not(:first-child), .morpho .mo-n { text-align: right; }
.morpho .mo-pair { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.morpho .mo-pair small { color: var(--ink-3); font-size: .78rem; }
.morpho .mo-n { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .88rem; white-space: nowrap; }
.morpho .mo-sub { grid-column: 1 / -1; font-size: .74rem; color: rgba(27, 36, 64, .68); white-space: pre-wrap; }
.morpho .mo-risk { padding: 8px 12px; border-radius: 10px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .3); color: var(--mo-ink); font-size: .9rem; }
.morpho .mo-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.morpho .mo-err p { color: var(--mo-ink); }
.morpho .mo-again { display: flex; justify-content: flex-end; }
.morpho .btn.mo-go { background: var(--mo-blue); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .16), 0 0 0 1.5px rgba(31, 79, 180, .6); }
/* the Pons House card (fan-made, for the Pons launchpad): cream paper, wax red and gilt, a launch form */
.sheet-ico[data-kind='pons'] { background: radial-gradient(circle at 35% 30%, #FFFDF8, #F6EFDC 70%, #E6DCC2); box-shadow: 0 0 0 1.5px rgba(163, 36, 43, .55); }
.pons { display: grid; gap: 12px; --pn-ink: #2A1E14; --pn-wax: #A3242B; --pn-wax-d: #7D1A20; --pn-gilt: #B8862E; }
.pons .pn-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pn-wax-d); }
.pons .pn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pons .pn-head small { color: var(--ink-3); font-size: .78rem; }
.pons .pn-list { display: grid; border-radius: 12px; overflow: hidden; background: #FFFDF8; box-shadow: inset 0 0 0 1px rgba(42, 30, 20, .14); }
.pons .pn-list::before { content: ''; height: 4px; background: linear-gradient(90deg, var(--pn-wax-d), var(--pn-wax), var(--pn-gilt)); }
.pons .pn-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid rgba(42, 30, 20, .08); color: var(--pn-ink); }
.pons .pn-row:first-of-type { border-top: 0; }
.pons .pn-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pons .pn-txt small { color: var(--ink-3); font-size: .8rem; font-weight: 700; }
.pons .pn-sub { display: block; font-size: .76rem; color: rgba(42, 30, 20, .66); }
.pons .pn-warn { display: block; font-size: .76rem; font-weight: 700; color: var(--pn-wax-d); }
.pons .pn-row .btn { flex: none; }
.pons .pn-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.pons .pn-err p { color: var(--pn-ink); }
.pons .pn-again { display: flex; justify-content: flex-end; }
.pons .pn-form, .pons .pn-review, .pons .pn-done, .pons .pn-ro, .pons .pn-state { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: #FFFDF8; box-shadow: inset 0 0 0 1px rgba(42, 30, 20, .14); color: var(--pn-ink); }
.pons .pn-f textarea { min-height: 64px; border-radius: 10px; border: 1.5px solid rgba(90, 68, 48, .35); background: #FFF9EA; padding: 8px 10px; color: var(--ink); font: inherit; font-weight: 600; resize: vertical; }
.pons .pn-f input, .pons .pn-f select, .pons .pn-f textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.pons .pn-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.pons .pn-hint { font-weight: 500; font-size: .76rem; color: var(--ink-3); }
.pons .pn-bad { font-weight: 700; font-size: .78rem; color: var(--pn-wax-d); }
.pons .btn.pn-go { background: var(--pn-wax); color: #FBEFD8; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 0 0 1.5px rgba(125, 26, 32, .6); }
.pons .pn-warnbox { padding: 8px 12px; border-radius: 10px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .3); color: var(--pn-ink); font-size: .9rem; display: grid; gap: 4px; }
.pons .pn-review h4 { margin: 0; font-size: 1.05rem; }
.pons .pn-cost { display: grid; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(42, 30, 20, .12); }
.pons .pn-c { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-top: 1px solid rgba(42, 30, 20, .08); font-size: .9rem; }
.pons .pn-c:first-child { border-top: 0; }
.pons .pn-c b { text-align: right; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85rem; overflow-wrap: anywhere; }
.pons .pn-total { background: #F6EFDC; }
.pons .pn-ack { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; font-weight: 700; }
.pons .pn-ack input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--pn-wax); }
.pons .pn-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pons .pn-ok { font-weight: 800; color: #2F6B3A; }
.pons .pn-addr { display: block; padding: 8px 10px; border-radius: 8px; background: #F6EFDC; font-size: .82rem; overflow-wrap: anywhere; user-select: all; }
.pons .pn-link { color: var(--pn-wax-d); font-weight: 700; font-size: .9rem; }
/* a merchant's stall: name, trade, the merchant's own line */
.merchant-head { display: flex; align-items: center; gap: 10px; }
.merchant-head .mh-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 250, 235, .7); box-shadow: inset 0 0 0 1.5px var(--brass); color: var(--ink-2); flex: none; }
.merchant-head b { display: block; font-family: var(--display, inherit); font-size: 1.15rem; }
.merchant-head small { color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .76rem; }
.merchant-line { margin: 0; padding: 8px 12px; border-left: 3px solid var(--brass); background: rgba(255, 250, 235, .55); border-radius: 0 10px 10px 0; font-family: var(--flourish, inherit); font-style: italic; font-size: 1.04rem; color: var(--ink-2); line-height: 1.35; }
/* the district landmark cards (monastery, customs house, printing house, river light): history, then live realm facts */
.townc { display: grid; gap: 10px; }
.townc .tw-kick { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-lo); margin: 0; }
.townc p { line-height: 1.42; }
.townc .tw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid rgba(90, 68, 48, .2); padding-top: 10px; }
.townc .tw-head h3 { margin: 0; }
.townc .tw-head small { color: var(--ink-3); font-size: .78rem; }
.townc .tw-body { display: grid; gap: 8px; }
.townc .tw-body h4 { margin: 4px 0 0; font-size: .86rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.townc .tw-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.townc .tw-stats .stat b { font-size: 1.15rem; margin: 2px 0; }
.townc .tw-roll { margin: 0; padding-left: 1.6em; display: grid; gap: 4px; }
.townc .tw-roll li { display: flex; justify-content: space-between; gap: 8px; }
.townc .tw-roll li::marker { font-weight: 800; color: var(--brass-lo); }
.townc .tw-err { padding: 10px 12px; border-radius: 12px; background: #FBF1E8; box-shadow: inset 0 0 0 1px rgba(160, 82, 45, .35); display: grid; gap: 8px; justify-items: start; }
.townc .tw-again { display: flex; justify-content: flex-end; }
.townc .tw-prices { width: 100%; border-collapse: collapse; font-size: .9rem; background: rgba(255, 250, 235, .55); border-radius: 12px; overflow: hidden; }
.townc .tw-prices th, .townc .tw-prices td { padding: 5px 8px; text-align: left; border-top: 1px solid rgba(90, 68, 48, .14); vertical-align: top; }
.townc .tw-prices thead th { border-top: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.townc .tw-prices td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.townc .tw-g { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.townc .tw-sheet { padding: 12px 14px; background: #FBF6E6; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(43, 29, 18, .25), 0 1px 0 rgba(43, 29, 18, .1); }
.townc .tw-mast { margin: 0; text-align: center; font-family: var(--display, inherit); font-size: 1.15rem; letter-spacing: .04em; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.townc .xc-changer { display: grid; gap: 6px; justify-items: start; border-top: 1px solid rgba(90, 68, 48, .2); padding-top: 10px; }
.townc .xc-changer h3, .townc .xc-changer p { margin: 0; }
.townc .xc-ledger .stat b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.townc .tw-news { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; line-height: 1.35; }
.empty-note { text-align: center; padding: 18px 10px; color: var(--ink-3); font-style: italic; font-family: var(--flourish); font-size: 1.05rem; }

/* --- modal ------------------------------------------------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4, 18, 22, .55); padding: 12px; }
.modal-card { width: min(460px, 100%); max-height: calc(100vh - 24px); overflow: auto; color: var(--ink); padding: 26px 24px 22px; --rhumb-op: .12; }
.modal-card h2 { font-size: 1.9rem; margin: 0 0 .25em; }
.modal-card p { color: var(--ink-2); margin: 0 0 1em; }
.modal-card .stack { display: grid; gap: 10px; }
.wallets { display: grid; gap: 8px; }
.wallets button { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid rgba(90, 68, 48, .3); background: #FFF9EA; font-weight: 800; text-align: left; }
.wallets img { width: 28px; height: 28px; border-radius: 6px; }

/* --- toasts ----------------------------------------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 55; top: calc(max(10px, env(safe-area-inset-top)) + 54px); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(460px, 92vw); }
.toast { pointer-events: auto; padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: .95rem; color: var(--ink); background: linear-gradient(180deg, #F7EAC9, var(--parchment-2)); box-shadow: 0 0 0 1.5px var(--brass-lo), 0 10px 20px -10px rgba(0, 0, 0, .7); animation: toastin .25s ease; text-align: center; }
.toast.bad { background: linear-gradient(180deg, var(--wax-hi), var(--wax)); color: #FBEBD6; box-shadow: 0 0 0 1.5px var(--wax-lo); }
.toast.good { background: linear-gradient(180deg, #5FA36F, var(--good)); color: #F2F7EE; }
@keyframes toastin { from { transform: translateY(-8px); opacity: 0; } }

/* --- rotate card ------------------------------------------------------------------------------------------------ */
.rotate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1E6470, var(--sea-deep) 60%, var(--sea-night)); padding: 16px; }
.rotate-card { width: min(360px, 100%); text-align: center; color: var(--ink); display: grid; gap: 10px; justify-items: center; }
.rotate-card h2 { margin: 0; font-size: 2rem; }
.rotate-card p { margin: 0 0 6px; color: var(--ink-2); }
.rotate-ico { display: grid; color: var(--wax); animation: tilt 2.4s ease-in-out infinite; }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 50%, 80% { transform: rotate(90deg); } 100% { transform: rotate(0); } }
.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; }

/* --- phones and small screens (landscape is the game's shape) ------------------------------------------------- */
@media (max-height: 520px) {
  body.play { font-size: 14px; }
  .mm-ring { width: 92px; height: 92px; }
  .plate { font-size: .85rem; padding: 1px 10px; }
  .hud-home { width: 32px; height: 32px; }
  .daychip { padding: 3px 10px 3px 4px; }
  .astro { width: 26px; height: 26px; }
  .daytext b { font-size: .9rem; }
  .online { padding: 3px 8px; }
  .hud-tr { gap: 6px; }
  .purse { padding: 4px 10px 4px 6px; font-size: .95rem; }
  .roleseal { width: 36px; height: 36px; }
  .acct { display: none; }
  .btn.icon.sm { width: 36px; min-height: 36px; }
  .chat { width: min(300px, 40vw); }
  .chat-log { max-height: 76px; font-size: .82rem; }
  .chat.closed { display: none; }
  .chat-toggle { display: inline-flex; }
  .hud-bc { min-width: 0; max-width: calc(100vw - 2 * 200px); bottom: calc(var(--sb) + 48px) !important; }
  .pk { width: 34px; height: 34px; }
  .pk .ico { width: 18px; height: 18px; }
  .hud-pack { padding: 3px; gap: 3px; }
  .ctx { padding: 5px 6px 5px 6px; gap: 6px; }
  .ctx-ico { width: 32px; height: 32px; }
  .ctx-txt small { display: none; }
  .ctx-acts .btn { min-height: 34px; padding: .25em .7em; font-size: .85rem; }
  .hud-br { flex-direction: column; }
  .hud-br #bZoomIn, .hud-br #bZoomOut { display: none; }
  .sheet { width: min(400px, 52vw); }
  .sheet-head { padding: 8px 8px 6px 10px; }
  .sheet-head h2 { font-size: 1.2rem; }
  .sheet-ico { width: 32px; height: 32px; }
  .sheet-body { padding: 10px; gap: 10px; }
  .vy-top { width: min(460px, calc(100vw - 260px)); padding: 5px 10px 5px 5px; }
  .at-sea .purse, .at-sea .roleseal { display: none; }
  .vy-top { width: min(420px, calc(100vw - 2 * 150px)); }
  .vy-chart { width: 58px; height: 62px; }
  .vy-side { top: calc(var(--st) + 130px); width: 170px; font-size: .8rem; }
  .vy-quay { top: calc(var(--st) + 80px); width: min(320px, 46vw); }
  .modal-card { padding: 16px 18px; }
  .modal-card h2 { font-size: 1.4rem; }
  .toasts { top: calc(max(8px, env(safe-area-inset-top)) + 42px); }
}
@media (max-width: 760px) and (orientation: portrait) {
  /* only when the player chose to play upright */
  .hud-tr { grid-template-columns: auto auto; grid-template-areas: 'purse role' 'menu menu'; }
  .acct { display: none; }
  .hud-bc { max-width: calc(100vw - 20px); min-width: 0; bottom: calc(var(--sb) + 104px) !important; }
  .hud-pack { bottom: calc(var(--sb) + 52px); }
  .pk { width: 30px; height: 30px; }
  .chat { width: calc(100vw - 80px); }
  .chat.closed { display: none; }
  .chat-toggle { display: inline-flex; }
  .sheet { width: auto; left: 10px; top: auto; height: 62vh; }
  .vy-top { width: calc(100vw - 20px); top: calc(var(--st) + 150px); }
  .vy-side { display: none; }
  .mm-ring { width: 96px; height: 96px; }
  .hud-tc { left: auto; right: var(--sr); transform: none; top: calc(var(--st) + 104px); }
  .hud-tc #modeChip, .hud-tc #online { display: none; }
  .toasts { top: calc(max(10px, env(safe-area-inset-top)) + 160px); }
}

/* at sea: the port minimap and plate mean nothing */
.at-sea .mm-ring, .at-sea .plate { display: none; }

/* never let the HUD collide: tiny landscape phones drop the secondary chips; an open chat on a phone hides the pack bar */
@media (max-height: 520px) and (max-width: 640px) { .hud-tc #modeChip, .hud-tc #online { display: none; } }
@media (max-height: 520px) { .hud:has(.chat:not(.closed)) .hud-pack { display: none; } }
@media (min-height: 521px) and (max-width: 1100px) { .chat-log { max-height: 110px; } }
/* narrow desktops and tablets: chat folds behind its button (as on phones), slimmer pack slots */
@media (max-width: 1000px) {
  .chat-toggle { display: inline-flex; }
  .hud:has(.chat:not(.closed)) .hud-pack { display: none; }
  .pk { width: 36px; height: 36px; }
  .pk .ico { width: 20px; height: 20px; }
}

/* Free Day: the chip takes the mode chip's place while the window is open */
.chip.free { background: var(--wax); color: #FBEFD8; white-space: nowrap; }
.hud.free-day #modeChip { display: none; }
.freeday { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(163, 36, 43, .1); border: 1.5px solid rgba(163, 36, 43, .45); color: var(--ink); font-size: .98rem; line-height: 1.4; text-align: center; }
.freeday b { color: var(--wax); }
@media (max-height: 520px) {
  .freeday { margin-bottom: 10px; padding: 8px 12px; font-size: .92rem; }
  .chip.free .fd-x { display: none; }
  .hud.free-day .hud-tc #online { display: none; }
}
/* tiny landscape phones: no room beside the day dial, so the chip sits under it */
@media (max-height: 520px) and (max-width: 640px) { .hud.free-day .hud-tc { flex-direction: column; gap: 4px; } }

/* --- tools, tasks and the works --------------------------------------------------------------------------------- */
/* the tool slot at the head of the pack bar: the most worn tool in the belt and its durability */
.pk.tool { margin-right: 5px; box-shadow: inset 0 0 0 1.5px rgba(122, 85, 24, .45), 5px 0 0 -3.5px rgba(233, 196, 106, .55); }
.pk.tool.empty { color: rgba(233, 196, 106, .45); background: rgba(0, 0, 0, .28); }
.pk .dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 4px; border-radius: 3px; background: rgba(43, 29, 18, .25); overflow: hidden; }
.pk .dur i { display: block; height: 100%; background: #3F7D52; }
.pk .dur i.low { background: var(--wax); }
.pk.tool b { top: 0; bottom: auto; }
/* the task board button's badge and the pill under the day dial */
.tasks-btn { position: relative; }
.tasks-btn .badge { position: absolute; right: -5px; top: -5px; min-width: 22px; height: 17px; padding: 0 4px; border-radius: 9px; font-size: .66rem; font-weight: 800; line-height: 17px;
  color: var(--ink); background: var(--brass-hi); box-shadow: 0 0 0 1.5px var(--brass-lo); pointer-events: none; }
.tasks-btn .badge.all { background: #7FC08E; }
.tasks-btn .badge.gift { background: #c8343a; color: #fff6e8; box-shadow: 0 0 0 1.5px #f7f3ec; text-transform: uppercase; letter-spacing: .04em; font-size: .58rem; }
/* the wardrobe */
.wd-event { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: linear-gradient(160deg, rgba(184, 38, 44, .14), rgba(233, 196, 106, .2)); box-shadow: inset 0 0 0 1.5px rgba(184, 38, 44, .35); }
.wd-event h3 { margin: 0; display: flex; gap: 8px; align-items: center; color: #8e1d22; }
.wd-event p { margin: 0; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 10px 0; }
.wd-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 10px; border-radius: 10px; background: rgba(255, 250, 236, .55); box-shadow: inset 0 0 0 1px rgba(122, 85, 24, .18); }
.wd-card.on { box-shadow: inset 0 0 0 2px var(--brass-lo, #a26e26); background: rgba(233, 196, 106, .22); }
.wd-card .g-ico { grid-row: span 2; }
.wd-card small { color: var(--ink-2, #6b5a44); font-size: .76rem; line-height: 1.3; }
.wd-card .wd-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.hud-tc { flex-wrap: wrap; justify-content: center; }
.taskpill { order: 9; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; max-width: min(380px, calc(100vw - 580px)); padding: 4px 12px 4px 8px; border-radius: 999px; border: 0;
  color: #F7E9C6; font-weight: 700; font-size: .82rem; cursor: pointer; }
.taskpill > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.taskpill .tp-ico { display: grid; color: var(--brass-hi); flex: none; }
.hud-tc .taskpill { flex-basis: 100%; justify-content: center; }
@media (max-width: 780px) { .taskpill { display: none !important; } }
@media (max-height: 520px) { .taskpill { font-size: .74rem; padding: 2px 10px 2px 6px; max-width: min(320px, calc(100vw - 600px)); } .tasks-btn .badge { right: -4px; top: -4px; } }
@media (max-width: 760px) and (orientation: portrait) { .pk { width: 28px; height: 28px; } .pk.tool { margin-right: 3px; } }
/* sheets: tasks done, the first-voyage steps, the biscuit cask slot */
.row.done { opacity: .72; }
.row .g-txt .bar { margin: 4px 0 2px; }
ol.mission { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ol.mission li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 250, 235, .45); border: 1px solid rgba(90, 68, 48, .15); }
ol.mission li.now { background: rgba(233, 196, 106, .35); border-color: var(--brass); font-weight: 700; }
ol.mission li.done { opacity: .6; }
ol.mission .ms-ico { display: grid; place-items: center; color: var(--ink-2); }
ol.mission li.done .ms-ico { color: #3F7D52; }
ol.mission small { color: var(--ink-3); font-weight: 700; }
.slot.caskslot { box-shadow: inset 0 0 0 1.5px rgba(122, 85, 24, .55); background-image: repeating-linear-gradient(90deg, rgba(122, 85, 24, .12) 0 4px, transparent 4px 9px); }
/* toasts drop below the task pill while it shows */
body:has(#taskPill:not([hidden])) .toasts { top: calc(max(10px, env(safe-area-inset-top)) + 88px); }
@media (max-height: 520px) { body:has(#taskPill:not([hidden])) .toasts { top: calc(max(8px, env(safe-area-inset-top)) + 70px); } }
@media (max-width: 780px) { body:has(#taskPill:not([hidden])) .toasts { top: calc(max(8px, env(safe-area-inset-top)) + 42px); } }
/* the task board button sits in the top row, left of the purse, so the menu row keeps its width on phones */
.hud-tr { grid-template-columns: auto auto auto auto; grid-template-areas: 'tasks purse role acct' 'menu menu menu menu'; }
.tasks-btn { grid-area: tasks; }
@media (max-height: 520px) { .hud-tr { grid-template-columns: auto auto auto; grid-template-areas: 'tasks purse role' 'menu menu menu'; } }
@media (max-width: 760px) and (orientation: portrait) { .hud-tr { grid-template-columns: auto auto auto; grid-template-areas: 'tasks purse role' 'menu menu menu'; } }
/* eleven cells (the tool slot and ten pack slots) stay clear of the chat and the view buttons on mid widths */
@media (max-width: 1100px) and (min-width: 1001px) and (min-height: 521px) { .pk { width: 40px; height: 40px; } .hud-pack { gap: 3px; } }
@media (max-width: 1000px) and (min-height: 521px) { .pk { width: 33px; height: 33px; } .pk .ico { width: 20px; height: 20px; } .hud-pack { gap: 3px; } }
/* mid widths: the account name stays in Settings, so the top-right row leaves the day chip room */
@media (max-width: 900px) { .acct { display: none; } }

/* the first-voyage guide card: the context bar's slot, two lines of plain instruction and Show the way; it steps
   aside while the context bar is open and at sea */
.guidebar .guide-txt b { white-space: normal; }
.guidebar .guide-txt small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #E8F1EC; font-size: .84rem; line-height: 1.25; }
.guidebar .ctx { border: 1.5px solid rgba(233, 196, 106, .7); }
.guidebar #guideGo { white-space: nowrap; }
body:has(#ctx:not([hidden])) #guideBar, .at-sea #guideBar { display: none; }
@media (max-width: 760px) and (orientation: portrait) { .guidebar .guide-txt small { font-size: .78rem; -webkit-line-clamp: 3; } .guidebar .ctx-ico { display: none; } }
@media (max-height: 520px) { .guidebar .guide-txt b { font-size: .86rem; } .guidebar .guide-txt small { font-size: .74rem; -webkit-line-clamp: 2; } .guidebar .ctx-ico { width: 30px; height: 30px; } }

/* the task board: each open task says what to do next */
.row .g-txt small.task-hint { display: block; margin-top: 3px; color: #6B4A2A; font-style: italic; line-height: 1.25; white-space: normal; }
.row .g-act { display: flex; align-items: center; gap: 6px; }
@media (max-height: 520px) { .guidebar { bottom: calc(var(--sb) + 78px) !important; } }
@media (max-width: 760px) and (orientation: portrait) { .guidebar { left: 12px !important; right: 12px; transform: none !important; max-width: none !important; min-width: 0 !important; } .guidebar .ctx { width: 100%; box-sizing: border-box; } .guidebar .guide-txt b { font-size: .86rem; line-height: 1.2; } }

/* the Harmonic Observatory: the working of the day's proof */
ol.proof-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
ol.proof-steps li { line-height: 1.35; }

/* the cart cell beside the pack (rules.CARTS): the stacks the cart adds */
.pk.cart { margin-left: 5px; background: #e8d3a8; box-shadow: inset 0 0 0 1.5px rgba(122, 85, 24, .5), -5px 0 0 -3.5px rgba(233, 196, 106, .55); }
@media (max-width: 760px) and (orientation: portrait) { .pk.cart { margin-left: 3px; } }

/* the stock desk and the Morpho House loans (js/play/stocks.js) */
.sd-kick { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2, #6b5a44); font-weight: 800; }
.sd-wallet { margin: 4px 0 8px; }
.sd-table { display: grid; gap: 6px; margin: 8px 0; }
.sd-item { border-radius: 10px; background: rgba(255, 250, 236, .55); box-shadow: inset 0 0 0 1px rgba(122, 85, 24, .18); }
.sd-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding: 7px 9px; }
.sd-name { display: grid; line-height: 1.15; min-width: 0; }
.sd-name small { color: var(--ink-2, #6b5a44); font-size: .74rem; }
.sd-price { font-variant-numeric: tabular-nums; }
.sd-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sd-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 78px; font: 800 .74rem/1 'Alegreya Sans', sans-serif; letter-spacing: .04em; color: var(--ink, #2b2015); }
.sd-mk { flex: none; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2c4f3c, #173024 72%); box-shadow: inset 0 0 0 1.5px rgba(233, 196, 106, .7), 0 1px 2px rgba(43, 32, 21, .25); position: relative; }
.sd-mk::after { content: ''; position: absolute; inset: 0; background: #f3e6c4; -webkit-mask: var(--mk) center / var(--mks, 58%) no-repeat; mask: var(--mk) center / var(--mks, 58%) no-repeat; }
.sd-trade { display: grid; gap: 8px; padding: 0 9px 10px; }
.sd-pay { display: inline-flex; gap: 6px; align-items: center; }
.sd-amt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sd-amt input { flex: 1 1 120px; min-width: 0; }
.sd-quote { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: rgba(233, 196, 106, .18); }
.sd-quote p { margin: 0; }
.sd-stage { margin: 0; font-weight: 700; }
.note.bad { color: #8a1c22; }
.xc-desk { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(31, 58, 44, .08); box-shadow: inset 0 0 0 1px rgba(31, 58, 44, .25); }
.xc-desk h3 { margin-top: 0; }
.ln-card { display: grid; gap: 6px; padding: 9px 10px; margin: 6px 0; border-radius: 10px; background: rgba(255, 250, 236, .55); box-shadow: inset 0 0 0 1px rgba(122, 85, 24, .18); }
.ln-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ln-head small { color: var(--ink-2, #6b5a44); }
.ln-nums { display: grid; gap: 2px; font-size: .9rem; }
.ln-bar { position: relative; height: 8px; border-radius: 5px; background: rgba(43, 29, 18, .15); overflow: hidden; }
.ln-bar .ln-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #3F7D52; }
.ln-bar .ln-limit { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #8a1c22; }
@media (max-width: 520px) { .sd-row { grid-template-columns: auto 1fr auto; } .sd-row .sd-acts { grid-column: 1 / -1; justify-content: flex-end; } }

/* the Great Ship's yard card */
.yd-bar { height: 12px; border-radius: 999px; background: rgba(122, 85, 24, .16); box-shadow: inset 0 0 0 1px rgba(122, 85, 24, .25); overflow: hidden; margin: 8px 0 4px; }
.yd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a26e26, #e9c46a); border-radius: 999px; }
.yd-stages { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.yd-stages li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 250, 236, .5); box-shadow: inset 0 0 0 1px rgba(122, 85, 24, .15); opacity: .72; }
.yd-stages li small { grid-column: 1 / -1; color: var(--ink-2, #6b5a44); font-size: .76rem; }
.yd-stages li span { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--ink-2, #6b5a44); }
.yd-stages li.done { opacity: 1; background: rgba(233, 196, 106, .22); box-shadow: inset 0 0 0 1.5px rgba(162, 110, 38, .5); }
.yd-stages li.done b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #a26e26; vertical-align: middle; }
.yd-stages li.next { opacity: 1; box-shadow: inset 0 0 0 1.5px rgba(122, 85, 24, .45); }
