/* css/play.css: the game page. A full-screen 3D stage with an HTML HUD over it, in "Aegean blue and marble": a frieze
   bar across the top, a column rail of square buttons on the left, the town tablet (map and view controls) on the
   right, the pack shelf at the foot; navy glass with azure edges (the world stays visible), marble-white cards for
   full menus, cobalt for the primary action, sea teal for confirms, gold for coins. Class names are the client's (play.html, js/play);
   change the look here, never the names. Every tap target is at least 40 px (pack cells on the smallest landscape
   phones are 38 px with a 40 px hit area). */

html, body.play { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.play { background: var(--glaze-solid); color: var(--on-glaze); 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; transition: opacity .5s ease;
  background: radial-gradient(circle at 50% 40%, #1E2C3E, var(--glaze-solid) 58%, #090E13); }
.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 { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-card h1 { font-size: 2.8rem; margin: 0; letter-spacing: .16em; padding-left: .16em; text-transform: uppercase; }
.boot-card p { margin: .3em 0 1em; color: var(--ink-2); font-size: 1.05rem; }
.boot-bar { height: 6px; border-radius: 6px; background: rgba(16, 23, 32, .14); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(16, 23, 32, .2); }
.boot-bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--terracotta), var(--wine)); transition: width .4s ease; }

/* --- the HUD: a frieze bar across the top, a column rail on the left, the town tablet on the right ---------------
   Navy glass over the 3D with azure edges and a little gold for coins. Every tap target is at least 40 px. */
.hud { --bar: 56px; --gap: 12px; --rail: 58px; --mapw: 176px; }
.hud-top { top: var(--st); left: var(--sl); right: var(--sr); height: var(--bar); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 8px 0 7px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(42, 104, 236, .96), rgba(17, 62, 172, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(92, 200, 255, .8), 0 0 0 1px rgba(160, 205, 255, .3), 0 16px 30px -20px rgba(4, 20, 70, .85); }
/* the frieze under the bar: a thin meander, as under a temple's cornice */
.hud-top::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: -10px; height: 8px; pointer-events: none; opacity: .55;
  background: var(--meander-bronze) left center / 10px 8px repeat-x; }
.ht-town { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-home { flex: none; width: 42px; height: 42px; display: block; border-radius: 12px; overflow: hidden; background: var(--glaze-solid); box-shadow: 0 0 0 1px rgba(160, 205, 255, .4); }
.hud-home img, .hud-home svg { width: 100% !important; height: 100% !important; object-fit: cover; }
.ht-name { display: grid; line-height: 1.05; min-width: 0; }
.ht-name small { font-size: .62rem; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; color: var(--on-glaze-2); }
.plate { font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: .16em; text-transform: uppercase; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-tc { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.daychip { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; border-radius: 10px; min-height: 42px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24); }
.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: 700; font-size: .98rem; letter-spacing: .08em; color: var(--marble); }
.daytext small { font-size: .76rem; color: var(--on-glaze-2); font-weight: 700; }
.online { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 8px; font-weight: 800; font-size: .85rem; min-height: 30px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .2); }
.online i { width: 8px; height: 8px; border-radius: 50%; background: #5FD3B5; box-shadow: 0 0 0 3px rgba(95, 211, 181, .22); }
.ht-you { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.purse { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 10px; font-weight: 800; font-size: 1.05rem; color: var(--gold-hi);
  background: rgba(226, 184, 90, .12); box-shadow: inset 0 0 0 1px rgba(226, 184, 90, .5); }
.purse [data-icon] { color: var(--gold); display: grid; }
.purse .unit { color: var(--gold); font-size: .74rem; font-weight: 800; }
.roleseal { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 0; display: grid; place-items: center; color: #FFFFFF;
  background: linear-gradient(160deg, var(--wine-hi), var(--wine) 55%, var(--wine-lo)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 4px 10px -5px rgba(0, 0, 0, .7); }
.acct { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--on-glaze); max-width: 190px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24); }
.acct [data-icon] { color: var(--terracotta-hi); display: grid; }
.acct span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purse:hover, .acct:hover, .daychip:hover { filter: brightness(1.12); }

/* the task of the day, a banner under the frieze */
.hud-banner { top: calc(var(--st) + var(--bar) + var(--gap) + 4px); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 2 * (var(--mapw) + var(--sr) + 22px)); }
.taskpill { position: relative; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 34px; padding: 4px 14px 4px 9px; border: 0; border-radius: 8px; cursor: pointer;
  color: var(--on-glaze); font-weight: 700; font-size: .84rem; background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .26), inset 3px 0 0 var(--gold); }
.taskpill::before { content: ''; position: absolute; inset: -4px 0; }
.taskpill > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.taskpill .tp-ico { display: grid; color: var(--gold); flex: none; }

/* the rail: one column of square buttons down the left edge */
.hud-rail { left: var(--sl); top: calc(var(--st) + var(--bar) + var(--gap)); display: flex; flex-direction: column; gap: 6px; padding: 7px; border-radius: 14px;
  background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .22), inset 0 3px 0 rgba(10, 140, 245, .55), 0 14px 28px -18px rgba(0, 0, 0, .85); }
.rb { position: relative; width: 44px; height: 44px; border: 0; padding: 0; border-radius: 10px; display: grid; place-items: center; color: var(--on-glaze);
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .16); transition: background .12s ease, color .12s ease; -webkit-tap-highlight-color: transparent; }
.rb:hover { background: rgba(10, 140, 245, .3); color: #FFFFFF; }
.rb:active { transform: translateY(1px); }
.rb[aria-expanded='true'] { background: var(--terracotta); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.rb .badge { position: absolute; right: -6px; top: -6px; }
.rb .rb-ico { display: grid; place-items: center; }

/* the town tablet: the map and the view controls under it, top right */
.hud-map { right: var(--sr); top: calc(var(--st) + var(--bar) + var(--gap)); width: var(--mapw); display: grid; gap: 6px; }
.mm-tab { padding: 5px; border-radius: 14px; background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .22), inset 0 3px 0 rgba(10, 140, 245, .55), 0 14px 28px -18px rgba(0, 0, 0, .85); }
#minimap { width: 100%; height: auto; aspect-ratio: 1; display: block; border-radius: 10px; background: #E6E0CC; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(9, 22, 42, .45); }
.hud-br { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 12px; overflow: hidden; background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .22); }
.hud-br button { height: 42px; min-width: 40px; border: 0; padding: 0; display: grid; place-items: center; color: var(--on-glaze); background: transparent; border-left: 1px solid rgba(160, 205, 255, .14); }
.hud-br button:first-child { border-left: 0; }
.hud-br button:hover { background: rgba(10, 140, 245, .3); color: #FFFFFF; }

/* the chat slides out beside the rail */
.hud-bl { left: calc(var(--sl) + var(--rail) + 10px); bottom: var(--sb); }
.chat { width: min(340px, calc(100vw - var(--sl) - var(--rail) - 30px)); padding: 6px 8px 8px; display: grid; gap: 6px; border-radius: 14px; background: var(--glaze-2);
  box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24), inset 0 3px 0 rgba(10, 140, 245, .55), 0 16px 30px -18px rgba(0, 0, 0, .9); animation: chatin .2s ease; }
@keyframes chatin { from { transform: translateX(-12px); opacity: 0; } }
.chat.closed { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding-left: 6px; }
.chat-head b { font-family: var(--display); font-weight: 700; font-size: .84rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-glaze-2); }
.chat-x { width: 40px; height: 40px; border: 0; padding: 0; display: grid; place-items: center; border-radius: 8px; color: var(--on-glaze-2); background: none; }
.chat-x:hover { color: #FFFFFF; background: rgba(10, 140, 245, .25); }
.chat-log { max-height: 180px; overflow-y: auto; display: grid; gap: 3px; font-size: .9rem; line-height: 1.3; padding: 0 4px; user-select: text; -webkit-user-select: text; color: var(--on-glaze); }
.chat-log p { margin: 0; }
.chat-log b { color: var(--terracotta-hi); font-weight: 800; }
.chat-log .sys { color: var(--on-glaze-2); font-style: italic; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid rgba(10, 140, 245, .6); background: rgba(0, 0, 0, .28); color: var(--on-glaze); padding: 0 12px; }
.chat-form input::placeholder { color: rgba(167, 190, 216, .75); }
.chat-form .btn { width: 40px; padding: 0; border-radius: 10px; }

/* bottom centre: the context tablet over the pack */
.hud-bc { left: 50%; bottom: calc(var(--sb) + 64px); transform: translateX(-50%); width: max-content; min-width: 300px; max-width: calc(100vw - 2 * (var(--sl) + var(--rail) + 20px)); }
.ctx { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 9px; border-radius: 12px; background: var(--glaze-2);
  box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .26), inset 0 3px 0 rgba(10, 140, 245, .6), 0 16px 30px -18px rgba(0, 0, 0, .9); }
.ctx-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--ink); background: linear-gradient(160deg, #FFFFFF, var(--papyrus-2)); box-shadow: inset 0 0 0 1px rgba(9, 22, 42, .25); }
.ctx-txt { display: grid; line-height: 1.15; min-width: 0; }
.ctx-txt b { color: #FFFFFF; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-txt small { color: var(--on-glaze-2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-acts { display: flex; gap: 6px; margin-left: auto; flex-wrap: nowrap; }
.ctx-acts .btn { white-space: nowrap; }
.ctx-x { background: none; border: 0; color: var(--on-glaze-2); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.ctx-x:hover { color: #FFFFFF; background: rgba(10, 140, 245, .25); }
.guidebar .ctx { box-shadow: inset 0 0 0 1px rgba(226, 184, 90, .55), inset 0 3px 0 var(--gold), 0 16px 30px -18px rgba(0, 0, 0, .9); }

/* bottom centre: the pack, a shelf of square niches */
.hud-dock { left: 50%; bottom: var(--sb); transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px; }
.hud-pack { display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: var(--glaze);
  box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24), 0 12px 24px -16px rgba(0, 0, 0, .85); }
.pk { position: relative; width: 44px; height: 44px; border-radius: 9px; border: 0; display: grid; place-items: center; color: var(--ink); padding: 0;
  background: linear-gradient(160deg, #FFFFFF, var(--papyrus-2)); box-shadow: inset 0 0 0 1px rgba(9, 22, 42, .28); }
.pk.empty { background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .2); }
.pk b { position: absolute; right: 3px; bottom: 1px; font-size: .72rem; font-weight: 800; color: var(--ink); text-shadow: 0 0 3px #FFFFFF; }
.at-sea .hud-dock, .at-sea .hud-map, .at-sea .hud-banner, .at-sea .hud-tc { display: none; }
/* an open chat on screens too narrow for it beside the pack: the pack and the context tablet step aside */
@media (max-width: 1199px) { .hud.chat-open .hud-dock, .hud.chat-open .hud-bc { display: none !important; } }

/* on the road: the journey bar right of the rail, the stops panel where the town tablet was */
.vy-top { top: calc(var(--st) + 68px); left: calc(var(--sl) + 68px); display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 14px; width: min(560px, calc(100vw - var(--sl) - var(--sr) - 68px - 250px));
  background: var(--glaze-2); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .26), inset 0 3px 0 rgba(10, 140, 245, .6), 0 16px 30px -18px rgba(0, 0, 0, .9); }
.vy-side { right: var(--sr); top: calc(var(--st) + 68px); width: 220px; padding: 10px 12px; display: grid; gap: 8px; font-size: .9rem; border-radius: 14px; background: var(--glaze-2); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24); }
.vy-quay { right: calc(var(--sr) + 232px); top: calc(var(--st) + 68px); width: min(340px, 40vw); color: var(--ink); padding: 16px; max-height: calc(100vh - 140px); overflow: auto; }
.toasts { top: calc(max(10px, env(safe-area-inset-top)) + 72px); }
body:has(#taskPill:not([hidden])) .toasts { top: calc(max(10px, env(safe-area-inset-top)) + 112px); }

/* tablets and narrow desktops: the account name lives in Settings, the chips fold */
@media (max-width: 1100px) { .acct { display: none; } .hud { --mapw: 150px; } }
@media (max-width: 900px) and (min-height: 521px) { .hud-tc #modeChip, .hud-tc #online { display: none; } .ht-name small { display: none; } }

/* phones held sideways (the game's shape): a slim bar, the rail in two columns, a small tablet */
@media (max-height: 520px) {
  body.play { font-size: 14px; }
  .hud { --bar: 50px; --gap: 8px; --rail: 98px; --mapw: 100px; }
  .hud-top { border-radius: 12px; gap: 8px; padding: 0 5px; }
  .hud-top::after { display: none; }
  .hud-home { width: 40px; height: 40px; border-radius: 10px; }
  .ht-name small, .acct, #modeChip, #online { display: none; }
  .plate { font-size: .9rem; letter-spacing: .12em; }
  .daychip { min-height: 40px; padding: 2px 9px 2px 3px; gap: 6px; }
  .astro { width: 30px; height: 30px; }
  .daytext b { font-size: .84rem; }
  .daytext small { font-size: .7rem; }
  .purse { height: 40px; padding: 0 9px 0 6px; font-size: .95rem; }
  .roleseal { width: 40px; height: 40px; }
  .hud-rail { display: grid; grid-template-columns: 40px 40px; gap: 4px; padding: 5px; }
  .rb { width: 40px; height: 40px; }
  .hud-br { grid-template-columns: 1fr 1fr; }
  .hud-br button { height: 40px; }
  .hud-banner { display: none; }
  .chat { width: min(300px, calc(100vw - var(--sl) - var(--rail) - 30px)); }
  .chat-log { max-height: 90px; font-size: .82rem; }
  .hud-bc { bottom: calc(var(--sb) + 54px); min-width: 0; max-width: calc(100vw - 2 * (var(--mapw) + var(--sr) + 14px)); }
  .pk { width: 40px; height: 40px; }
  .pk .ico { width: 20px; height: 20px; }
  .hud-pack { padding: 3px; gap: 3px; }
  .ctx { padding: 4px 6px; gap: 6px; }
  .ctx-ico { width: 34px; height: 34px; }
  .ctx-txt small { display: none; }
  .ctx-acts .btn { min-height: 40px; padding: .25em .8em; font-size: .85rem; }
  .vy-top { top: calc(var(--st) + 58px); left: calc(var(--sl) + 106px); width: min(440px, calc(100vw - var(--sl) - var(--sr) - 106px - 190px)); padding: 5px 10px 5px 5px; gap: 8px; }
  .vy-side { top: calc(var(--st) + 58px); width: 170px; font-size: .8rem; max-height: calc(100vh - var(--st) - var(--sb) - 140px); overflow: auto; }
  .vy-quay { right: var(--sr); top: calc(var(--st) + 58px); width: min(320px, 46vw); max-height: calc(100vh - var(--st) - 54px - var(--sb) - 60px); }
  .voyage:has(#vyQuay:not([hidden])) .vy-side { display: none; }
  .toasts, body:has(#taskPill:not([hidden])) .toasts { top: calc(max(8px, env(safe-area-inset-top)) + 58px); }
}
/* the smallest sideways phones: eleven pack cells at 38 px (each with a 40 px hit area) */
@media (max-height: 520px) and (max-width: 600px) { .hud { --mapw: 92px; } .daytext small { display: none; } }

/* phones held upright (only when the player chose it): the rail lies along the bottom over the pack */
@media (max-width: 760px) and (orientation: portrait) {
  .hud { --bar: 52px; --rail: 98px; --mapw: 104px; }
  .hud-tc, .acct, .ht-name small, .hud-banner { display: none; }
  .hud-top { grid-template-columns: minmax(0, 1fr) auto; }
  /* the context and guide tablets span the width between the edges (never wider than the screen) */
  .hud-bc { left: var(--sl) !important; right: var(--sr); width: auto !important; transform: none !important; max-width: none !important; }
  .hud-bc .ctx { width: 100%; box-sizing: border-box; }
  .ctx-txt b, .ctx-txt small { white-space: normal; }
  .hud-home { width: 40px; height: 40px; }
  .hud-rail { display: grid; grid-template-columns: 40px 40px; gap: 4px; padding: 5px; }
  .rb { width: 40px; height: 40px; }
  .hud-br { grid-template-columns: 1fr 1fr; }
  .hud-pack { flex-wrap: wrap; justify-content: center; width: min(calc(6 * 40px + 5 * 4px + 10px), calc(100vw - 20px - 46px)); }
  .pk { width: 40px; height: 40px; }
  .hud-bl { left: var(--sl); right: var(--sr); bottom: calc(var(--sb) + 152px); }
  .chat { width: 100%; }
  .hud-bc { bottom: calc(var(--sb) + 152px); min-width: 0; max-width: calc(100vw - 20px); }
  .hud.chat-open .hud-bc { display: none !important; }
  .vy-top { left: calc(var(--sl) + 106px); width: calc(100vw - var(--sl) - var(--sr) - 106px); top: calc(var(--st) + 62px); }
  .vy-side { display: none; }
  .toasts, body:has(#taskPill:not([hidden])) .toasts { top: calc(max(10px, env(safe-area-inset-top)) + 120px); }
}

/* --- 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 [data-icon] { color: var(--bronze-hi); display: grid; }
.spect-plate b { font-family: var(--display); font-weight: 700; letter-spacing: .08em; color: #BBC8DC; }
.spect-ports { display: flex; gap: 4px; }
.spect-ports button { border: 1px solid rgba(44, 116, 194, .8); background: transparent; color: var(--on-glaze); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: .88rem; min-height: 40px; }
.spect-ports button[aria-selected='true'] { background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); color: var(--ink); border-color: var(--bronze-lo); }
#spectPlay { right: var(--sr); bottom: var(--sb); }
.spect .hud-home { position: fixed; top: var(--st); left: var(--sl); }

/* --- the road (journey) ----------------------------------------------------------------------------------------- */
/* the journey bar sits top-left beside the home button (the town minimap is hidden on the road), clear of the top-right cluster */
.vy-chart { width: 104px; height: 70px; flex: none; border-radius: 8px; background: #DAE1EC; box-shadow: inset 0 0 0 1.5px var(--terracotta); }
.vy-chart .sc-port text, .vy-chart .sc-min, .vy-chart .sc-title, .vy-chart .sc-note { display: none; }
.vy-info { display: grid; gap: 6px; flex: 1; min-width: 0; }
.vy-info b { font-family: var(--display); font-weight: 700; letter-spacing: .06em; font-size: 1.05rem; color: #BBC8DC; }
.vy-bar { height: 8px; border-radius: 8px; background: rgba(212, 220, 233, .12); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(44, 116, 194, .45); }
.vy-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--terracotta), var(--bronze-hi)); transition: width .5s linear; }
.vy-info small { color: var(--on-glaze-2); font-weight: 700; }
.vy-side h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .08em; color: var(--bronze-hi); }
.vy-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
/* a road call: a big red seal to tap */
.vy-call { left: 50%; bottom: calc(var(--sb) + 12px); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; border: 0; padding: 14px 28px 12px; border-radius: 999px; color: #DDE3ED; min-height: 64px;
  background: radial-gradient(120% 140% at 35% 25%, var(--wine-hi), var(--wine) 55%, var(--wine-lo));
  box-shadow: inset 0 0 0 2px rgba(90, 142, 217, .7), inset 0 0 0 5px rgba(17, 47, 69, .55), 0 0 0 3px var(--bronze-hi), 0 12px 26px -10px rgba(0, 0, 0, .85); animation: callpulse 1s ease-in-out infinite; }
.vy-call b { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .05em; }
.vy-call small { font-weight: 800; opacity: .9; }
.vy-call-ico { display: grid; color: var(--bronze-hi); }
@keyframes callpulse { 50% { box-shadow: inset 0 0 0 2px rgba(90, 142, 217, .7), inset 0 0 0 5px rgba(17, 47, 69, .55), 0 0 0 8px rgba(90, 142, 217, .35), 0 12px 26px -10px rgba(0, 0, 0, .85); } }

/* --- sheet: a papyrus panel for full menus ----------------------------------------------------------------------- */
.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(--ink), 0 0 0 4px var(--papyrus-2), 0 0 0 5.5px var(--terracotta), 0 20px 50px -20px rgba(0, 0, 0, .85); 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 { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 12px 18px 14px; }
.sheet-head::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 10px; background: var(--meander-ink) left center / 12.5px 10px repeat-x; opacity: .35; }
.sheet-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #DDE3ED;
  background: radial-gradient(circle at 35% 30%, var(--wine-hi), var(--wine) 55%, var(--wine-lo)); box-shadow: inset 0 0 0 1.5px rgba(90, 142, 217, .6), 0 0 0 1.5px var(--bronze-lo); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.3rem; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .btn { color: var(--ink); }
.sheet-body { flex: 1; overflow-y: auto; padding: 12px 14px 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: 700; font-size: 1.05rem; letter-spacing: .06em; color: var(--terracotta-lo); }
.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, bays */
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(244, 246, 249, .62); border: 1px solid rgba(24, 53, 92, .22); }
.row .g-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--papyrus-2); box-shadow: inset 0 0 0 1px rgba(24, 53, 92, .35); }
.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(--bronze-lo); }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(24, 53, 92, .45); }
.stepper button { width: 40px; height: 40px; 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: 42px; border-radius: 8px; border: 1.5px solid rgba(24, 53, 92, .4); background: #F3F5F8; padding: 0 10px; color: var(--ink); font-weight: 700; }
.inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
/* cart slots: the bed of a wagon, planks of cypress */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; padding: 10px; border-radius: 10px; background: repeating-linear-gradient(90deg, #26446A 0 18px, #1F3A5C 18px 20px); box-shadow: inset 0 4px 10px rgba(0, 0, 0, .45), 0 0 0 1.5px var(--ink); }
.slot { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; color: var(--ink); background: radial-gradient(circle at 35% 30%, #EDF0F6, var(--papyrus-2)); position: relative; border: 0; box-shadow: inset 0 0 0 1.5px rgba(24, 53, 92, .5); }
.slot.empty { background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1.5px rgba(206, 215, 229, .2); }
.slot.sealed::after { content: ''; position: absolute; right: 4px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--wine); box-shadow: 0 0 0 1.5px var(--bronze-hi); }
.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(24, 53, 92, .4); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 800; color: var(--ink-2); min-height: 40px; }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--papyrus); border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--terracotta); }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rolecard { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 10px; border: 1.5px solid rgba(24, 53, 92, .32); background: rgba(244, 246, 249, .62); text-align: center; font-weight: 800; }
.rolecard[aria-pressed='true'] { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(30, 76, 110, .16); background: #EFF2F6; }
.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: 10px; background: rgba(244, 246, 249, .62); border: 1px solid rgba(24, 53, 92, .22); text-align: center; }
.stat b { display: block; font-size: 1.35rem; }
.stat small { color: var(--ink-3); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bar { height: 7px; border-radius: 7px; background: rgba(16, 23, 32, .12); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--terracotta), var(--wine)); }
.sheet-chart svg { width: 100%; height: auto; border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(16, 23, 32, .35); }
.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(--terracotta-lo); }
.sheet-body code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86em; padding: 1px 6px; border-radius: 6px; background: rgba(16, 23, 32, .08); box-shadow: inset 0 0 0 1px rgba(24, 53, 92, .25); 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(24, 53, 92, .22); padding-top: 10px; }
/* 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(244, 246, 249, .75); box-shadow: inset 0 0 0 1.5px var(--terracotta), 0 0 0 1px var(--bronze); color: var(--ink-2); flex: none; }
.merchant-head b { display: block; font-family: var(--display, inherit); font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; }
.merchant-head small { color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; }
.merchant-line { margin: 0; padding: 8px 12px; border-left: 3px solid var(--terracotta); background: rgba(244, 246, 249, .55); border-radius: 0 10px 10px 0; font-style: italic; font-size: 1.02rem; color: var(--ink-2); line-height: 1.35; }
/* the landmark cards (temples, stoa, the Mint, the Workshop of Pheidias): history, then live realm facts */
.townc { display: grid; gap: 10px; }
.townc .tw-kick { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta-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(24, 53, 92, .22); 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: .06em; 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(--terracotta-lo); }
.townc .tw-err { padding: 10px 12px; border-radius: 10px; background: #EBEFF4; box-shadow: inset 0 0 0 1px rgba(42, 106, 162, .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(244, 246, 249, .55); border-radius: 10px; overflow: hidden; }
.townc .tw-prices th, .townc .tw-prices td { padding: 5px 8px; text-align: left; border-top: 1px solid rgba(24, 53, 92, .15); vertical-align: top; }
.townc .tw-prices thead th { border-top: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--terracotta-lo); }
.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: #EBEEF4; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(16, 23, 32, .28), 0 1px 0 rgba(16, 23, 32, .1); }
.townc .tw-mast { margin: 0; text-align: center; font-family: var(--display, inherit); font-weight: 700; font-size: 1.1rem; letter-spacing: .08em; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.townc .xc-changer { display: grid; gap: 6px; justify-items: start; border-top: 1px solid rgba(24, 53, 92, .22); 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-family: var(--flourish); font-size: 1rem; letter-spacing: .04em; }

/* --- modal ------------------------------------------------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(9, 14, 19, .6); padding: 12px; }
.modal-card { width: min(460px, 100%); max-height: calc(100vh - 24px); overflow: auto; color: var(--ink); padding: 30px 24px 24px; --rhumb-op: .16; }
.modal-card h2 { font-size: 1.7rem; margin: 0 0 .3em; letter-spacing: .06em; }
.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; min-height: 48px; border-radius: 10px; border: 1.5px solid rgba(24, 53, 92, .35); background: #F3F5F8; font-weight: 800; text-align: left; }
.wallets button:hover { border-color: var(--terracotta); }
.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)) + 58px); 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, var(--marble), var(--papyrus-2));
  box-shadow: 0 0 0 1.5px var(--bronze-lo), 0 0 0 3px rgba(212, 220, 233, .6), 0 0 0 4px var(--terracotta), 0 10px 20px -10px rgba(0, 0, 0, .75); animation: toastin .25s ease; text-align: center; }
.toast.bad { background: radial-gradient(120% 140% at 35% 20%, var(--wine-hi), var(--wine)); color: #DFE5EE; box-shadow: 0 0 0 1.5px var(--wine-lo), 0 0 0 3px rgba(90, 142, 217, .5); }
.toast.good { background: linear-gradient(180deg, var(--laurel-hi), var(--laurel)); color: #E8EBF2; box-shadow: 0 0 0 1.5px var(--laurel-lo), 0 0 0 3px rgba(90, 142, 217, .5); }
@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%, #1E2C3E, var(--glaze-solid) 58%, #090E13); 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: 1.8rem; letter-spacing: .06em; }
.rotate-card p { margin: 0 0 6px; color: var(--ink-2); }
.rotate-ico { display: grid; color: var(--wine); 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; }
  .pk { width: 40px; height: 40px; }
  .pk .ico { width: 20px; height: 20px; }
  .hud-pack { padding: 3px; gap: 3px; }
  .ctx { padding: 4px 6px 4px 6px; gap: 6px; }
  .ctx-ico { width: 34px; height: 34px; }
  .ctx-txt small { display: none; }
  .ctx-acts .btn { min-height: 40px; padding: .25em .8em; font-size: .85rem; }
  .sheet { width: min(400px, 52vw); }
  .sheet-head { padding: 6px 8px 14px 10px; }
  .sheet-head h2 { font-size: 1.1rem; }
  .sheet-ico { width: 34px; height: 34px; }
  .sheet-body { padding: 10px; gap: 10px; }
  .vy-chart { width: 64px; height: 43px; }
  .modal-card { padding: 20px 18px 16px; }
  .modal-card h2 { font-size: 1.35rem; }
}
/* phones (sideways, or upright by choice): a one-line journey bar and a low road call, icon beside the words */
@media (max-height: 520px), (max-width: 760px) and (orientation: portrait) {
  .vy-info { gap: 4px; }
  .vy-info b, .vy-info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vy-info b { font-size: .9rem; }
  .vy-call { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 0; justify-items: start; align-items: center; text-align: left; min-height: 52px; padding: 7px 20px 7px 12px; }
  .vy-call-ico { grid-row: span 2; }
  .vy-call { max-width: calc(100vw - 120px); }
  .vy-call b { font-size: .92rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .vy-call small { font-size: .8rem; }
}
@media (max-width: 760px) and (orientation: portrait) {
  /* only when the player chose to play upright: the pack wraps into two rows of 40 px cells */
  .hud-pack { flex-wrap: wrap; justify-content: center; width: min(calc(6 * 40px + 5 * 4px + 10px), calc(100vw - 20px)); bottom: calc(var(--sb) + 50px); }
  .pk { width: 40px; height: 40px; }
  .sheet { width: auto; left: 10px; top: auto; height: 62vh; }
  .vy-call { bottom: calc(var(--sb) + 60px); max-width: calc(100vw - 20px); }
  .spect-plate { left: calc(var(--sl) + 50px); right: var(--sr); transform: none; flex-wrap: wrap; white-space: normal; border-radius: 16px; }
}

/* on the road: the town minimap and plate mean nothing */

/* never let the HUD collide: tiny landscape phones drop the secondary chips; an open chat on a phone hides the pack bar */
/* tablets and narrow desktops: the day group sits beside the minimap so the top-right cluster keeps its room */
/* tablets: the view buttons stand in a column so the eleven pack cells keep the bottom row */
/* narrow desktops and tablets: chat folds behind its button (as on phones), slimmer pack slots */
@media (max-width: 1000px) {
  .pk { width: 40px; height: 40px; }
  .pk .ico { width: 20px; height: 20px; }
}

/* the smallest landscape phones (568 x 320; after the 1000 px rule above so it wins): eleven pack cells at 38 px, each with a 40 px hit area */
@media (max-height: 520px) and (max-width: 600px) {
  .pk { width: 38px; height: 38px; }
  .pk::before { content: ''; position: absolute; inset: -1px; }
  .hud-pack { gap: 2px; }
  .pk.tool { margin-right: 3px !important; }
  .pk.cart { margin-left: 3px !important; }
}
/* Free Day: the chip takes the mode chip's place while the window is open */
.chip.free { background: var(--wine); color: #DFE5EE; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(90, 142, 217, .55); }
.hud.free-day #modeChip { display: none; }
.freeday { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: rgba(30, 76, 110, .1); border: 1.5px solid rgba(30, 76, 110, .45); color: var(--ink); font-size: .98rem; line-height: 1.4; text-align: center; }
.freeday b { color: var(--wine); }
@media (max-height: 520px) {
  .freeday { margin-bottom: 10px; padding: 8px 12px; font-size: .92rem; }
}
/* tiny landscape phones: no room beside the day dial, so the chip sits under it */

/* --- 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(24, 53, 92, .5), 5px 0 0 -3.5px rgba(44, 116, 194, .7); }
.pk.tool.empty { color: rgba(90, 142, 217, .5); background: rgba(0, 0, 0, .3); }
.pk .dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 4px; border-radius: 3px; background: rgba(16, 23, 32, .25); overflow: hidden; }
.pk .dur i { display: block; height: 100%; background: var(--laurel); }
.pk .dur i.low { background: var(--wine); }
.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(--bronze-hi); box-shadow: 0 0 0 1.5px var(--bronze-lo); pointer-events: none; }
.tasks-btn .badge.all { background: #74C4B8; }
.tasks-btn .badge.gift { background: var(--wine-hi); color: #DFE5EE; box-shadow: 0 0 0 1.5px var(--papyrus); text-transform: uppercase; letter-spacing: .04em; font-size: .58rem; }
/* the wardrobe */
.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(244, 246, 249, .55); box-shadow: inset 0 0 0 1px rgba(24, 53, 92, .2); }
.wd-card.on { box-shadow: inset 0 0 0 2px var(--terracotta); background: rgba(90, 142, 217, .2); }
.wd-card .g-ico { grid-row: span 2; }
.wd-card small { color: var(--ink-2); font-size: .76rem; line-height: 1.3; }
.wd-card .wd-act { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  color: #D0D9E7; font-weight: 700; font-size: .82rem; cursor: pointer; }
/* sheets: tasks done, the first-journey steps, the bread rack 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(244, 246, 249, .45); border: 1px solid rgba(24, 53, 92, .16); }
ol.mission li.now { background: rgba(90, 142, 217, .3); border-color: var(--terracotta); 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: var(--laurel); }
ol.mission small { color: var(--ink-3); font-weight: 700; }
.slot.caskslot { box-shadow: inset 0 0 0 1.5px rgba(24, 53, 92, .55); background-image: repeating-linear-gradient(90deg, rgba(24, 53, 92, .12) 0 4px, transparent 4px 9px); }
/* toasts drop below the task pill while it shows */
/* the task board button sits in the top row, left of the purse, so the menu row keeps its width on phones */
/* 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: 40px; height: 40px; } .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 */

/* the first-journey 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 on the road */
.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: #D1DAE7; font-size: .84rem; line-height: 1.25; }
.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: 32px; height: 32px; } }

/* the task board: each open task says what to do next */
.row .g-txt small.task-hint { display: block; margin-top: 3px; color: var(--terracotta-lo); font-style: italic; line-height: 1.25; white-space: normal; }
.row .g-act { display: flex; align-items: center; gap: 6px; }
@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 carrying cell beside the pack (rules.CARTS: the yoke or the pack donkey): the stacks it adds */
.pk.cart { margin-left: 5px; background: radial-gradient(circle at 35% 30%, #CDD6E5, #8CAAD8); box-shadow: inset 0 0 0 1.5px rgba(24, 53, 92, .55), -5px 0 0 -3.5px rgba(44, 116, 194, .7); }
@media (max-width: 760px) and (orientation: portrait) { .pk.cart { margin-left: 3px; } }
.note.bad { color: var(--bad); }

/* the Statue of Zeus card (the Workshop of Pheidias; class names kept from the old yard card) */
.yd-bar { height: 12px; border-radius: 999px; background: rgba(24, 53, 92, .16); box-shadow: inset 0 0 0 1px rgba(24, 53, 92, .3); overflow: hidden; margin: 8px 0 4px; }
.yd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--bronze-hi)); 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(244, 246, 249, .5); box-shadow: inset 0 0 0 1px rgba(24, 53, 92, .16); opacity: .72; }
.yd-stages li small { grid-column: 1 / -1; color: var(--ink-2); font-size: .76rem; }
.yd-stages li span { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--ink-2); }
.yd-stages li.done { opacity: 1; background: rgba(90, 142, 217, .22); box-shadow: inset 0 0 0 1.5px rgba(46, 92, 156, .55); }
.yd-stages li.done b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--bronze); vertical-align: middle; }
.yd-stages li.next { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--terracotta); }

/* --- folds: every bar minimises and expands -----------------------------------------------------------------------
   The player folds a bar with its chevron (remembered on this device); on a crowded screen the client folds bars by
   itself in this order until nothing touches: the task banner, the town map, the menu rail, the pack (hud.js guard).
   .min-* = folded by the player, .auto-* = folded by the guard; both look the same. */
.fold { border: 0; padding: 0; display: grid; place-items: center; color: var(--on-glaze-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fold:hover { color: #FFFFFF; }
.fold .when-shut { display: none; }
.fold-ico { display: grid; place-items: center; }
.hud-top .fold { width: 40px; height: 40px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .18); }
.hud-top, .hud-rail, .mm-tab, .hud-pack { transition: opacity .18s ease; }
/* the top bar folded: a compact plate with the town, the drachmae and the chevron */
.hud.min-top .hud-top { right: auto; grid-template-columns: auto auto; gap: 10px; padding-right: 6px; }
.hud.min-top .hud-tc, .hud.min-top .acct, .hud.min-top .roleseal, .hud.min-top .ht-name small, .hud.min-top .hud-top::after { display: none; }
.hud.min-top #foldTop { transform: rotate(180deg); }
/* the rail folded: one button that opens it again */
.hud.min-rail .hud-rail > :not(.fold), .hud.auto-rail .hud-rail > :not(.fold) { display: none; }
.hud.min-rail .hud-rail, .hud.auto-rail .hud-rail { display: flex; grid-template-columns: none; }
.hud.min-rail #foldRail .when-open, .hud.auto-rail #foldRail .when-open { display: none; }
.hud.min-rail #foldRail .when-shut, .hud.auto-rail #foldRail .when-shut { display: grid; }
/* the town map folded: a square button where the tablet was */
.mm-tab { position: relative; }
.mm-fold { position: absolute; left: -9px; top: -9px; width: 26px; height: 26px; border-radius: 50%; background: var(--glaze-solid); box-shadow: 0 0 0 1px rgba(160, 205, 255, .45); }
.mm-fold::before { content: ''; position: absolute; inset: -7px; }
.mm-open { display: none; width: 44px; height: 44px; border: 0; padding: 0; border-radius: 12px; place-items: center; color: var(--on-glaze); justify-self: end;
  background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .26), inset 0 3px 0 rgba(10, 140, 245, .55); }
.mm-open:hover { color: #FFFFFF; background: rgba(10, 140, 245, .35); }
.hud.min-map .mm-tab, .hud.min-map .hud-br, .hud.auto-map .mm-tab, .hud.auto-map .hud-br { display: none; }
.hud.min-map .mm-open, .hud.auto-map .mm-open { display: grid; }
.hud.min-map .hud-map, .hud.auto-map .hud-map { width: auto; }
/* the pack folded: its button alone */
.pack-fold { width: 40px; height: 40px; border-radius: 10px; background: var(--glaze); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24); }
.hud.min-pack .hud-pack, .hud.auto-pack .hud-pack { display: none; }
.hud.min-pack .pack-fold .when-open, .hud.auto-pack .pack-fold .when-open { display: none; }
.hud.min-pack .pack-fold .when-shut, .hud.auto-pack .pack-fold .when-shut { display: grid; }
.hud.min-pack .pack-fold, .hud.auto-pack .pack-fold { width: 44px; height: 44px; color: var(--on-glaze); }
/* the guard's first step: the task banner steps aside */
.hud.auto-banner .hud-banner { display: none; }
/* with the pack folded the context tablet comes down to the foot of the screen */
.hud.min-pack .hud-bc, .hud.auto-pack .hud-bc { bottom: calc(var(--sb) + 54px); }
@media (max-height: 520px) {
  .hud-top .fold { width: 40px; height: 40px; }
  .hud.min-rail .hud-rail, .hud.auto-rail .hud-rail { padding: 4px; }
}

/* very short landscape phones (320 to 360 px tall): the rail in three columns so it ends well above the pack */
@media (max-height: 360px) {
  .hud { --rail: 144px; }
  .hud-rail { grid-template-columns: repeat(3, 40px); }
}
/* upright phones: the context tablet puts its buttons under its words, two lines of words at most */
@media (max-width: 760px) and (orientation: portrait) {
  .hud-bc .ctx { flex-wrap: wrap; row-gap: 6px; }
  .hud-bc .ctx-txt { flex: 1 1 0; }
  .hud-bc .ctx-txt small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hud-bc .ctx-acts { flex: 1 0 100%; justify-content: flex-end; flex-wrap: wrap; order: 3; }
  .hud-bc .ctx-x { order: 2; }
}
/* the narrowest upright phones: the role badge lives in the guild hall card, so the town name keeps its room */
@media (max-width: 380px) and (orientation: portrait) {
  .hud-top .roleseal { display: none; }
  .plate { font-size: .9rem; letter-spacing: .08em; }
  .purse { padding: 0 8px 0 6px; }
}
/* very short landscape phones: the journey bar starts right of the three-column rail */
@media (max-height: 360px) {
  .vy-top { left: calc(var(--sl) + 152px); width: min(400px, calc(100vw - var(--sl) - var(--sr) - 152px - 180px)); }
}

