@charset "utf-8";
:root {
  --bg: #10201a; --panel: #183028; --ink: #eef3e6; --muted: #a9b9a6; --line: #2e4a3e;
  --accent: #f2c14e; --accent-ink: #1c1a10; --bubble: #fffdf2; --bubble-ink: #1d2420;
  --npc: #f2c14e; --bad: #ff9b8f;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.3rem; margin: 0; letter-spacing: .02em; }
h2 { font-size: .85rem; margin: 20px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
input, select, button { font: inherit; border-radius: 8px; border: 1px solid var(--line); padding: 10px 12px;
                        background: var(--panel); color: var(--ink); min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
button { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; cursor: pointer; }
button:disabled, input:disabled { opacity: .5; cursor: default; }

/* Pages outside the game: front page, account forms, changelog */
* { -webkit-tap-highlight-color: transparent; }   /* no blue flash when tapping on phones */
body.page { min-height: 100vh; padding: 16px; }
body.page > main.card { margin: 6vh auto 0; }
.card.wide { max-width: 760px; }
.splash { max-width: 900px; margin: 0 auto; display: grid; gap: 16px; }
.hero h1 { font-size: 2.2rem; letter-spacing: .04em; color: var(--accent); }
.hero .account { color: var(--muted); font-size: .92rem; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.splash .card, .splash .card.wide { max-width: none; width: auto; }
.card h2 { margin-top: 0; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 1.1rem; }
.card textarea { font: inherit; width: 100%; border-radius: 8px; border: 1px solid var(--line); padding: 10px 12px;
                 background: var(--bg); color: var(--ink); resize: vertical; }
.card input:not([type=checkbox]), .card select { background: var(--bg); }
.help { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair div { display: grid; gap: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; color: var(--ink); }
.check input { margin-top: 4px; }
.flash { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--accent); }
.flash.error { border-color: var(--bad); color: var(--bad); }
.crumbs { margin: 0 0 8px; font-size: .9rem; }
form.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; text-decoration: underline; }
button.quiet { margin-top: 16px; background: var(--panel); color: var(--ink); border-color: var(--line); }
.entry { padding: 10px 0; border-top: 1px solid var(--line); }
.entry:first-of-type { border-top: 0; padding-top: 0; }
.entry h3 { margin: 0; font-size: 1rem; }
.entry .when { margin: 2px 0 6px; color: var(--muted); font-size: .85rem; }
.entry .major { color: var(--accent); }
.entry ul { margin: 0; padding-left: 20px; }
.entry li + li { margin-top: 3px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
        border-radius: 14px; padding: 24px; }
.lead { color: var(--muted); margin: 6px 0 18px; }
.card form { display: grid; gap: 8px; }
.card label { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.card button { margin-top: 12px; }
.error { color: var(--bad); margin: 0; font-size: .9rem; }

/* Menu, system window and announcements */
/* The backpack and menu buttons, on the top right corner of the game view */
.corner { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2000; }
.icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
        background: rgba(8, 16, 12, .78); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.icon:hover { border-color: var(--accent); }
.icon svg { image-rendering: pixelated; }
#coin-badge, #group-badge, #clan-badge { position: absolute; right: -5px; bottom: -6px; min-width: 18px; padding: 0 4px; border-radius: 9px;
              background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 17px; }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--accent); border-radius: 12px;
         padding: 18px 20px; width: min(92vw, 460px); max-height: 86vh; overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { margin: 0 0 10px; color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 1.15rem; }
dialog h3 { margin: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
dialog p { margin: 0 0 8px; }
dialog .links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
dialog ul { margin: 0 0 14px; padding-left: 20px; }
dialog dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: .92rem; }
dialog dt { color: var(--muted); }
dialog dd { margin: 0; overflow-wrap: anywhere; }
dialog .rows { margin-bottom: 14px; }
#banner { margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
#log .announce { color: var(--accent); }

/* Game */
body.game main { max-width: 1500px; margin: 0 auto; padding: 12px 16px; }
/* Wide screens: the game on the left, the conversation in a column on the right, all within one window height. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 16px; align-items: start; }
.play { min-width: 0; }
.side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 24px); min-height: 0; }
.conversation { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.conversation h2 { margin-top: 0; }
header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
         margin-bottom: 10px; }
header p { margin: 0; color: var(--muted); font-size: .88rem; }
#stage { position: relative; width: min(100%, calc((100vh - 300px) * 1.6)); min-width: min(100%, 320px); aspect-ratio: 480 / 300; border: 1px solid var(--line);
         border-radius: 10px; overflow: hidden; background: #0c1813; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated;
        image-rendering: crisp-edges; cursor: pointer; display: block; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 10px; line-height: 1;
       padding: 2px 4px; border-radius: 4px; background: rgba(8, 16, 12, .55); color: var(--ink);
       transition: opacity .2s; }
/* Name tags show only when they matter (2026-11-21): yours, whoever you talk to or point at, whoever is speaking,
   and those close to you. The rest fade out; N shows every name. */
.tag.faded { opacity: 0; }
.tag.npc { color: var(--npc); }
.tag.you { outline: 1px solid var(--accent); }
.tag.target { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tag.exit { background: rgba(255, 248, 214, .9); color: #2a2412; font-weight: 600; }
.bubbles { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column;
           align-items: center; gap: 3px; width: max-content; max-width: min(240px, 60%); }
.bubble { background: var(--bubble); color: var(--bubble-ink); border-radius: 9px; padding: 4px 8px;
          font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.bubble.npc { background: #fff3c9; }
.bubble.thinking { letter-spacing: .2em; font-weight: 700; }
#tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
#tools button { background: var(--panel); color: var(--ink); border-color: var(--line); font-weight: 600; padding: 7px 12px; }
#tools button[aria-pressed="true"] { background: #3f8f35; border-color: #6cc24f; color: #fff; }
#basket { color: var(--muted); font-size: .9rem; }
#cook p { margin: 0 0 6px; color: var(--muted); font-size: .88rem; }
#trade, #cook, #craft { margin-top: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; }
#trade h2, #cook h2, #craft h2 { margin: 0 0 8px; color: var(--accent); }
#craft h3 { margin: 10px 0 4px; font-size: .95rem; }
#craft p, #trade p { margin: 0 0 6px; color: var(--muted); font-size: .88rem; }
.item-icon { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; margin-right: 6px; }
#pack dd small { display: block; color: var(--muted); }
#pack dd button { margin-top: 4px; padding: 4px 12px; }
/* Worn gear in slots across the top of the backpack (2026-11-28) */
.gear-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin: 4px 0 8px; }
.gear-slots button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; }
.gear-slots .item-icon, .gear-slots .empty { width: 24px; height: 24px; image-rendering: pixelated; }
.gear-slots .empty { display: block; border: 1px dashed var(--muted); border-radius: 4px; }
.gear-slots small { font-size: .7rem; }
.gear-slots button[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -2px; }
.quest-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.quest-tabs button[aria-selected="true"] { outline: 2px solid currentColor; outline-offset: -2px; }
.slot-choice { border-left: 3px solid var(--muted); padding-left: 8px; margin-bottom: 8px; }
.skill-row { display: grid; grid-template-columns: 9.5em 1fr; gap: 2px 10px; align-items: center; margin: 3px 0; }
.skill-row progress { width: 100%; height: 8px; accent-color: var(--accent); }
.skill-row small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
#seed-choice { margin-left: 6px; padding: 6px; }
.letter-form { display: flex; flex-wrap: wrap; gap: 6px; }
.letter-form input { flex: 1 1 120px; padding: 6px; }
.trade-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 0; }
.trade-row span { flex: 1 1 150px; }
.trade-row span::first-letter { text-transform: uppercase; }
.trade-row button { padding: 6px 10px; font-size: .88rem; }
#chat { display: flex; gap: 8px; margin-top: 10px; }
#say { flex: 1; }
#notice { min-height: 1.4em; margin: 6px 0 0; color: var(--accent); font-size: .9rem; }
#log { list-style: none; margin: 0; padding: 10px 12px; overflow-y: auto; background: var(--panel);
       border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; line-height: 1.45;
       height: calc(100vh - 150px); min-height: 180px; }
#log:empty::after { content: "Nothing said yet."; color: var(--muted); }
#log li { overflow-wrap: anywhere; }
#log li + li { margin-top: 3px; }
#log .who { font-weight: 700; }
#log .npc .who { color: var(--npc); }
#log .system { color: var(--muted); font-style: italic; }
#log .group .who, #log .group { color: var(--group, #7fd1a8); }
#group { margin: 0 0 10px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
         font-size: .9rem; }
#group h2 { margin: 0 0 4px; font-size: .95rem; }
#group .member { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; padding: 3px 0; }
#group .member small { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
#group .member.away { opacity: .6; }
#group progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: #d9534f; }
#group .invite { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
#group .invite span { flex: 1 1 100%; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
.hint summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.hint ul { margin: 6px 0 0; padding-left: 18px; }
.hint li + li { margin-top: 4px; }
.hint[open] { max-height: 45vh; overflow-y: auto; }
.hint[open] ~ * { }
@media (max-width: 900px) {      /* phones and narrow windows: one column, conversation under the game */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
  #stage { width: 100%; }
  #log { height: auto; max-height: 220px; min-height: 0; }
}
@media (max-width: 520px) {
  .tag { font-size: 9px; padding: 1px 3px; }
  .bubble { font-size: 11px; }
}

/* The action bar: what the player can do right here, in a strip of its own directly under the game view. */
/* Split in two (2026-11-30, Derek): the combat bar on the left (Abilities, Spellbook, Potions, then six slots the
   player fills), what can be done right here on the right. */
#bars { display: flex; gap: 6px; align-items: stretch; width: min(100%, calc((100vh - 300px) * 1.6)); min-width: min(100%, 320px);
  margin-top: 4px; }
#combatbar { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; padding: 4px; box-sizing: border-box; min-height: 62px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#combatbar .slot.menu { flex-basis: 40px; width: 40px; background: #1e2a3a; align-content: center; }
#combatbar .slot.menu img { width: 28px; height: 28px; }
/* one line each, cut short: a long name never makes its slot taller (2026-11-30) */
#combatbar .lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#combatbar.editing .cslot:not(.empty) { border-color: #d2483c; }
#combatbar .clear { position: absolute; top: -1px; right: 2px; color: #ff8a7a; font-size: 14px; font-weight: 700; line-height: 1; }
#combatbar.editing .count { display: none; }
#combatbar .slot.done { flex-basis: 46px; width: 46px; align-content: center; background: #3f8f35; border-color: #6cc24f; color: #fff; }
#combatbar .count { position: absolute; top: 1px; right: 3px; font-size: 9px; color: var(--accent); font-weight: 700; }
#combatbar .slot.menu:last-of-type { margin-right: 4px; }
#combatbar .cslot.empty { background: transparent; border-style: dashed; }
#combatbar .cslot.off { opacity: .45; filter: grayscale(1); }
#combatbar.assigning .cslot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#combatbar .slot, dialog.picker .assignable { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#actionbar { position: relative; display: flex; justify-content: center; align-items: center; gap: 4px;
  flex: 1 1 0; min-width: 0; min-height: 62px;
  padding: 4px; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#actionbar .empty { color: var(--muted); font-size: .85rem; }
.slot { position: relative; flex: 0 0 54px; width: 54px; min-height: 52px; padding: 4px 2px 3px; display: grid;
  justify-items: center; align-content: start; gap: 2px; background: #14251e; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 10px; line-height: 1.05; font-weight: 600; cursor: pointer; }
.slot:hover { border-color: var(--accent); }
.slot.gap { background: transparent; border-style: dashed; opacity: .35; cursor: default; }   /* an empty slot: holds its place */
.slot.gap:hover { border-color: var(--line); }
.slot img { width: 26px; height: 26px; image-rendering: pixelated; margin: 0; }
.slot .key { position: absolute; top: 1px; left: 4px; font-size: 9px; color: var(--muted); font-weight: 400; }
.slot.on { background: #3f8f35; border-color: #6cc24f; color: #fff; }
.slot.on .key { color: #dff3d8; }
.slot.arrow { flex-basis: 24px; width: 24px; font-size: 16px; align-content: center; }
.slot.arrow:disabled { opacity: .35; cursor: default; }
/* The seed picker that opens above the Plant slot. */
.flyout { position: absolute; bottom: calc(100% + 6px); z-index: 5; display: grid; gap: 4px; padding: 8px; width: 220px; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.flyout h3 { margin: 0 0 2px; font-size: .8rem; color: var(--accent); }
.flyout button { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #14251e; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; font-weight: 600; text-align: left; cursor: pointer; }
.flyout button:hover { border-color: var(--accent); }
.flyout button.on { background: #3f8f35; border-color: #6cc24f; color: #fff; }
.flyout button .key { color: var(--muted); font-weight: 400; font-size: .75rem; }
.flyout button.on .key { color: #dff3d8; }
.flyout button:disabled { opacity: .5; cursor: default; }
.flyout button:disabled:hover { border-color: var(--line); }
/* The greenhouse window's beds (2026-11-28) */
#greenhouse .gh-bed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
#greenhouse .gh-bed h3 { flex: 1 1 100%; margin: 0; font-size: .9rem; }
#greenhouse .gh-bed p { margin: 0; display: flex; align-items: center; gap: 6px; }
#greenhouse .gh-bed select { flex: 1 1 auto; min-width: 0; }
.flyout button::first-letter { text-transform: uppercase; }
.flyout p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
/* The picker window (Ride, Spells, Drink, Plant...): a scrolling list under a header with a close button. */
dialog.picker { width: min(360px, 92vw); max-height: 80vh; padding: 0; overflow: hidden; flex-direction: column; }
dialog.picker[open] { display: flex; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 8px 14px;
  border-bottom: 1px solid var(--line); flex: none; }
.picker-head h3 { margin: 0; color: var(--accent); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.picker-close { flex: none; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid var(--line);
  background: #14251e; color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.picker-close:hover { border-color: var(--accent); }
dialog.picker .flyout { position: static; width: auto; padding: 8px 12px; overflow-y: auto; flex: 1 1 auto; min-height: 0;
  align-content: start; grid-auto-rows: max-content;   /* cards keep their size in a tall window and the list scrolls (2026-11-28) */
  border: 0; border-radius: 0; box-shadow: none; background: none; scrollbar-color: var(--line) transparent; }
dialog.picker > p { margin: 0; padding: 8px 14px 12px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); flex: none; }
@media (max-width: 600px) { .slot { flex-basis: 46px; width: 46px; font-size: 9px; } .slot img { width: 22px; height: 22px; }
  #bars { flex-direction: column; gap: 4px; }
  #combatbar { justify-content: center; min-height: 0; flex-wrap: wrap; }
  #combatbar .slot { flex-basis: 34px; width: 34px; min-height: 44px; font-size: 7.5px; padding: 3px 1px 2px; }
  #combatbar .slot.menu { flex-basis: 34px; width: 34px; }
  #combatbar .slot.menu img { width: 24px; height: 24px; }
  #combatbar .slot.menu:last-of-type { margin-right: 2px; }
  #combatbar .slot img { width: 20px; height: 20px; } }

/* Action windows (cook, build, make tools, trade, send a letter): the panel sits inside a modal. */
dialog.panel { width: min(560px, 92vw); max-height: 86vh; box-sizing: border-box; }
dialog.panel > #cook, dialog.panel > #craft, dialog.panel > #trade { margin: 0 0 14px; padding: 0; border: 0; background: none; }
dialog.panel h3 { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); }

/* Phones held sideways (2026-11-23), and any window as short: the game fills the screen. The action bar is
   a strip down the right edge; the conversation, the group and the chat box slide in from the left behind
   the Chat button, with the latest line shown briefly over the game; the notch is kept clear. */
.phone-only { display: none !important; }
#latest { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  /* only the game page stays put; the front page, privacy and the rest scroll as usual (fixed 2026-11-23) */
  html:has(> body.game), body.game { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body.game main { max-width: none; padding: 0; }
  body.game header, .hint { display: none; }
  .phone-only { display: grid !important; }
  .layout { display: block; }
  #stage { position: fixed; top: 0; bottom: 0; left: env(safe-area-inset-left); right: calc(64px + env(safe-area-inset-right));
           width: auto; min-width: 0; aspect-ratio: auto; border: 0; border-radius: 0; }
  #view { touch-action: none; }
  .corner { top: max(6px, env(safe-area-inset-top)); right: 6px; }
  .icon { width: 38px; height: 38px; }
  #bars { display: contents; }
  #stage { left: calc(60px + env(safe-area-inset-left)); }
  #combatbar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 2100; width: calc(60px + env(safe-area-inset-left));
               min-height: 0; margin: 0; padding: 3px 3px 3px calc(3px + env(safe-area-inset-left)); box-sizing: border-box;
               flex-direction: column; justify-content: flex-start; gap: 2px; overflow: hidden;
               border-width: 0 1px 0 0; border-radius: 0; background: rgba(24, 48, 40, .92); }
  #combatbar .slot { flex: 0 0 auto; width: 52px; min-height: 0; height: calc((100vh - 30px) / 9); font-size: 8px; padding: 1px;
                     overflow: hidden; }
  #combatbar .slot img { width: 18px; height: 18px; }
  #combatbar .slot.menu:last-of-type { margin: 0 0 3px; }
  #combatbar.editing .slot.menu { display: none; }   /* room for Done in the strip */
  #combatbar .slot.done { width: 52px; height: calc((100vh - 30px) / 9); }
  #actionbar { position: fixed; top: 0; bottom: 0; right: 0; z-index: 2100; width: calc(64px + env(safe-area-inset-right));
               min-width: 0; min-height: 0; margin: 0; padding: 4px calc(4px + env(safe-area-inset-right)) 4px 4px;
               flex-direction: column; justify-content: flex-start; gap: 3px; overflow: hidden;
               border-width: 0 0 0 1px; border-radius: 0; background: rgba(24, 48, 40, .92); }
  #actionbar .empty { display: none; }
  .slot { flex: 0 0 auto; width: 56px; min-height: 46px; }
  .slot.arrow { flex: 0 0 26px; width: 56px; min-height: 26px; }
  .flyout { bottom: auto; top: 0; right: calc(100% + 6px); max-height: 90vh; overflow-y: auto; }
  .side, #chat { display: none; }
  body.chat-open .side { display: flex; position: fixed; z-index: 2200; left: calc(60px + env(safe-area-inset-left));
                         top: calc(52px + env(safe-area-inset-top));   /* below the top icons: Chat closes it (2026-11-30) */
                         bottom: 54px; max-height: none;   /* beside the combat bar, not under it (2026-11-30) */
                         width: min(360px, 48vw); box-sizing: border-box; padding: 8px 8px 0 8px;
                         background: rgba(16, 32, 26, .95); }
  body.chat-open #chat { display: flex; position: fixed; z-index: 2200; left: calc(60px + env(safe-area-inset-left)); bottom: 0;
                         width: min(360px, 48vw); box-sizing: border-box; margin: 0; padding: 8px;
                         background: rgba(16, 32, 26, .95); }
  .conversation h2 { display: none; }
  #log { height: auto; flex: 1 1 auto; min-height: 0; max-height: none; }
  #notice { position: fixed; z-index: 2150; left: 50%; bottom: 8px; transform: translateX(-50%); max-width: 55vw; margin: 0;
            min-height: 0; padding: 4px 10px; border-radius: 8px; background: rgba(8, 16, 12, .82); pointer-events: none; }
  #notice:empty { display: none; }
  #banner { position: fixed; z-index: 2300; top: 6px; left: 50%; transform: translateX(-50%); max-width: 70vw; }
  #latest { position: fixed; z-index: 2150; left: calc(68px + env(safe-area-inset-left));   /* clear of the combat bar */ top: 30px; max-width: 40vw;
            padding: 4px 9px; border-radius: 8px; background: rgba(8, 16, 12, .78); color: var(--ink); font-size: .82rem;
            line-height: 1.3; pointer-events: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3;
            -webkit-box-orient: vertical; transition: opacity .4s; }
  #latest.hidden, body.chat-open #latest { opacity: 0; }
  #chat-toggle.unread::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px;
                               border-radius: 50%; background: var(--accent); }
}
/* The zoom setting in the menu */
.zoom-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.zoom-row button { width: 36px; padding: 4px 0; }
.zoom-row output { min-width: 3.5em; text-align: center; }
.phone-only[hidden] { display: none !important; }
/* The close × in the top right corner of every window: it stays there while the window scrolls. */
.dialog-x { position: sticky; top: 0; float: right; z-index: 1; width: 34px; height: 34px; margin: -8px -10px 4px 8px;
  padding: 0; border-radius: 8px; border: 1px solid var(--line); background: #14251e; color: var(--ink);
  font-size: 1.4rem; line-height: 1; cursor: pointer; }
.dialog-x:hover { border-color: var(--accent); }

/* The public front page (2026-11-23): what Edshis is, for visitors and search engines. */
.landing { max-width: 980px; padding: 8px 0 24px; }
.landing .hero { text-align: center; }
.landing .hero h1 { font-size: 2.8rem; }
.landing .lead { font-size: 1.15rem; color: var(--ink); max-width: 36em; margin: 8px auto 14px; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 6px; }
a.button { display: inline-block; padding: 10px 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
           border: 1px solid var(--accent); font-weight: 700; text-decoration: none; }
a.button.quiet { background: var(--panel); color: var(--ink); border-color: var(--line); }
a.button:hover { filter: brightness(1.08); }
.landing figure { margin: 0; }
.landing img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.landing figcaption { margin-top: 6px; color: var(--muted); font-size: .88rem; text-align: center; }
.landing .card p { margin: 0; }
.gallery h2 { text-align: center; }
.art { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.landing .hero { display: block; margin-bottom: 8px; }
.landing .hero .help { margin: 0; }
.landing .columns { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.art { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.gallery > .help { text-align: center; }
.landing .footer { text-align: center; }

/* Staff dashboards (world/insights.py, world/charts.py; superusers only, 2026-11-23). Chart colours: the reference
   palette's dark steps, validated against the panel (#183028): every check passes. */
.staff { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.staff .card { max-width: none; width: auto; }
.staff h1 { font-size: 1.6rem; }
.staff nav a { margin-right: 14px; }
.staff .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.staff table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.staff th, .staff td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.staff td.n, .staff th.n { text-align: right; font-variant-numeric: tabular-nums; }
.staff .points { margin: 0 0 10px; padding-left: 18px; }
.staff .points li { margin: 2px 0; }
.staff .tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.staff .tile { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 110px; }
.staff .tile b { display: block; font-size: 1.4rem; color: var(--ink); }
.staff .tile span { color: var(--muted); font-size: .8rem; }
.staff .risk-high { color: #e66767; font-weight: 700; }
.staff .risk-medium { color: #c98500; font-weight: 700; }
.staff .risk-low { color: var(--muted); }
.staff details > summary { cursor: pointer; color: var(--accent); }
svg.viz { width: 100%; height: auto; display: block; overflow: visible;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #0ca30c;
  --series-7: #9085e9; --series-8: #e66767; }
svg.viz .s1, .swatch.s1 { fill: var(--series-1); background: var(--series-1); }
svg.viz .s2, .swatch.s2 { fill: var(--series-2); background: var(--series-2); }
svg.viz .s3, .swatch.s3 { fill: var(--series-3); background: var(--series-3); }
svg.viz .s4, .swatch.s4 { fill: var(--series-4); background: var(--series-4); }
svg.viz .s5, .swatch.s5 { fill: var(--series-5); background: var(--series-5); }
svg.viz .s6, .swatch.s6 { fill: var(--series-6); background: var(--series-6); }
svg.viz .s7, .swatch.s7 { fill: var(--series-7); background: var(--series-7); }
svg.viz .s8, .swatch.s8 { fill: var(--series-8); background: var(--series-8); }
svg.viz .gap { stroke: var(--panel); stroke-width: 2px; }
svg.viz .hit { fill: transparent; }
svg.viz g:hover .s1, svg.viz g:hover [class^="s"] { filter: brightness(1.2); }
svg.viz .axis { stroke: var(--line); stroke-width: 1px; }
svg.viz text { font-size: 11px; fill: var(--muted); }
svg.viz text.val { fill: var(--ink); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.legend b { color: var(--ink); font-weight: 600; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* The in-game survey (2026-11-23) */
dialog.survey .scale { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
dialog.survey .scale button { width: 36px; padding: 6px 0; background: var(--bg); color: var(--ink); border-color: var(--line); }
dialog.survey .scale button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
dialog.survey textarea { width: 100%; box-sizing: border-box; font: inherit; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
/* survey: the "enjoy most" choice */
dialog.survey select { width: 100%; margin: 0 0 8px; padding: 6px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }

/* The analytics dashboard (2026-11-23): a quiet, dense layout. Numbers tabular; findings in a call-out; status
   (better/worse) carries an arrow as well as a colour. */
main.analytics { max-width: 1380px; padding: 0 16px 40px; }
.an-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.an-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 1px; padding: 12px 0; font-size: .86rem; }
.an-nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 6px; }
.an-nav a:hover { color: var(--ink); background: #1a3229; }
.an-nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 10px; width: auto; }
.an-brand { margin: 0 10px 10px; color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.an-main { min-width: 0; display: grid; gap: 22px; }
.an-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px; padding-top: 8px; }
.an-head h1 { font-size: 1.7rem; margin: 0 0 2px; }
.an-period { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: .85rem; }
.an-period a, .an-period b { padding: 6px 12px; text-decoration: none; }
.an-period a { color: var(--muted); }
.an-period b { background: var(--accent); color: var(--accent-ink); }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.an-kpi { display: grid; gap: 4px; padding: 12px 14px; background: #13241d; border: 1px solid var(--line); border-radius: 10px; }
.an-kpi-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.an-kpi-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.an-kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.an-kpi-foot svg.spark { width: 90px; height: 24px; flex: none; }
.an-delta { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-delta.good { color: #5fd38a; } .an-delta.bad { color: #ff8a80; } .an-delta.flat { color: var(--muted); font-weight: 400; }
.an-section { background: #13241d; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 14px; scroll-margin-top: 12px; }
.an-section > header h2 { margin: 0; font-size: 1.15rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.an-question { margin: 2px 0 12px; color: var(--muted); font-size: .88rem; }
.an-findings { border-left: 3px solid var(--accent); background: rgba(242, 193, 78, .06); border-radius: 0 8px 8px 0;
  padding: 8px 14px; margin: 0 0 14px; font-size: .9rem; }
.an-findings ul { margin: 0; padding-left: 16px; } .an-findings li + li { margin-top: 3px; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.an-grid .wide { grid-column: 1 / -1; }
.an-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.an-figure { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.an-figure b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.an-figure span { color: var(--muted); font-size: .76rem; }
.an-panel { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.an-panel figcaption { font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.an-scroll { overflow-x: auto; }
.an-panel table { width: 100%; border-collapse: collapse; font-size: .83rem; font-variant-numeric: tabular-nums; }
.an-panel th { text-align: left; font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.an-panel td { padding: 5px 8px 5px 0; border-bottom: 1px solid rgba(46, 74, 62, .55); vertical-align: top; }
.an-panel tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.an-panel .n { text-align: right; }
.an-note, .an-empty { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.an-about { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.an-about summary { cursor: pointer; }
.an-about p { margin: 6px 0 0; }
/* heat: the cohort table and the room maps (validated sequential blue, dark panel) */
.cell.h0 { color: var(--muted); }
.cell.h1, svg.viz .h1, .heat-legend .h1 { background: #256abf; fill: #256abf; }
.cell.h2, svg.viz .h2, .heat-legend .h2 { background: #3987e5; fill: #3987e5; }
.cell.h3, svg.viz .h3, .heat-legend .h3 { background: #6da7ec; fill: #6da7ec; color: #0b1a14; }
.cell.h4, svg.viz .h4, .heat-legend .h4 { background: #9ec5f4; fill: #9ec5f4; color: #0b1a14; }
.cell.h5, svg.viz .h5, .heat-legend .h5 { background: #cde2fb; fill: #cde2fb; color: #0b1a14; }
table.heat td.cell { border-bottom: 2px solid var(--bg); padding-left: 8px; }
svg.viz.room { max-height: 300px; }
.an-picker { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.an-picker label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.an-picker select { max-width: min(100%, 28rem); }
.an-room-map svg.viz.room { max-height: 460px; }
.an-room-map.loading { opacity: .5; transition: opacity .15s; }
svg.viz .floor { fill: #1d362c; } svg.viz .wall { fill: #0b1712; }
.heat-legend { display: flex; align-items: center; gap: 3px; margin: 6px 0 0; font-size: .76rem; color: var(--muted); }
.heat-legend .cell { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
/* lines and their dots, in the categorical order */
svg.viz .line { fill: none; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
svg.viz .l1 { stroke: var(--series-1); } svg.viz .l2 { stroke: var(--series-2); } svg.viz .l3 { stroke: var(--series-3); } svg.viz .l4 { stroke: var(--series-4); }
svg.viz .dashed { stroke-dasharray: 5 4; stroke: var(--muted); }
svg.viz .dot1 { fill: var(--series-1); } svg.viz .dot2 { fill: var(--series-2); } svg.viz .dot3 { fill: var(--series-3); } svg.viz .dot4 { fill: var(--series-4); }
svg.viz [class^="dot"] { stroke: var(--bg); stroke-width: 2px; }
svg.viz .grid { stroke: var(--line); stroke-width: 1px; stroke-dasharray: 2 4; }
svg.viz text.lbl { fill: var(--ink); font-size: 12px; }
.swatch.dash { background: none; border-top: 2px dashed var(--muted); height: 0; width: 14px; border-radius: 0; vertical-align: 3px; }
@media (max-width: 900px) {
  .an-layout { grid-template-columns: minmax(0, 1fr); }
  .an-nav { position: static; flex-direction: row; flex-wrap: wrap; padding: 0; }
  .an-nav hr, .an-brand { display: none; }
  .an-grid { grid-template-columns: minmax(0, 1fr); }
}
#group .member .heal { grid-column: 2; justify-self: end; padding: 2px 10px; font-size: .78rem; margin-top: 2px; }

/* The marketplace (2026-11-24) */
.market-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.market-tabs button[aria-pressed="true"] { background: var(--accent, #f2c14e); color: #1e1612; }
#market input[type="number"] { width: 7em; }
#market input[type="search"] { width: 100%; margin: 0 0 8px; }
#market select { max-width: 100%; }

/* The quest panel (2026-11-24) */
.quest-entry { border-top: 1px solid rgba(255,255,255,.12); padding: 8px 0; }
.quest-entry h3 { margin: 0 0 4px; }
.quest-entry.done h3 { opacity: .75; }
.quest-steps { margin: 6px 0; padding-left: 1.4em; }
.quest-steps li.finished { opacity: .7; }
.quest-steps li.current { font-weight: 600; }
.quest-steps li.later { list-style: none; opacity: .6; font-style: italic; }
.quest-task { font-weight: normal; margin: 2px 0 0; opacity: .9; }
.quest-rewards { opacity: .85; font-size: .9em; }

/* Orrin's staff panel (2026-11-24) */
dialog.desk { width: min(94vw, 640px); }
dialog.desk [hidden] { display: none; }
dialog.desk .tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; border-bottom: 1px solid var(--muted); }
dialog.desk .tabs button { border: 0; border-radius: 6px 6px 0 0; padding: 6px 12px; background: transparent; color: var(--muted); }
dialog.desk .tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
dialog.desk .said { font-size: .9rem; color: var(--accent); }
dialog.desk .said:empty { display: none; }
dialog.desk table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 10px; }
dialog.desk td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
dialog.desk td.acts { text-align: right; white-space: nowrap; }
dialog.desk td.acts button, dialog.desk .row button { padding: 3px 8px; margin-left: 4px; font-size: .85rem; }
dialog.desk .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
dialog.desk .row select, dialog.desk .row input { min-width: 0; flex: 1 1 140px; }
dialog.desk .row input.num { flex: 0 0 56px; }
dialog.desk .muted { color: var(--muted); }

/* The Look window (2026-11-25): swatches of colour and a picture of the player as they would look. */
dialog.look canvas { display: block; width: 160px; height: 160px; margin: 0 auto 12px; image-rendering: pixelated;
                     background: var(--bg); border-radius: 8px; }
dialog.look .swatches { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0 0 10px; }
dialog.look .swatches span { flex: 0 0 72px; color: var(--muted); font-size: .9rem; }
dialog.look .swatches button { width: 24px; height: 24px; padding: 0; border: 2px solid rgba(255,255,255,.25); border-radius: 50%; }
dialog.look .swatches button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* The home page's technical specs (2026-11-26): an accordion of <details>. */
.specs details { border-top: 1px solid rgba(255,255,255,.1); }
.specs details:last-of-type { border-bottom: 1px solid rgba(255,255,255,.1); }
.specs summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex;
                 justify-content: space-between; align-items: center; }
.specs summary::-webkit-details-marker { display: none; }
.specs summary::after { content: "▾"; color: var(--accent); font-size: 1.2rem; line-height: 1; }   /* a down arrow: closed */
.specs details[open] summary::after { content: "▴"; }                                           /* an up arrow: open */
.specs summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.specs details p { margin: 0 0 14px; color: var(--muted); }

/* The paintings' carousel on the home page (2026-11-26): one painting at a time, swiped or stepped. */
.carousel { max-width: 860px; margin: 0 auto; }
.carousel .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
                   scrollbar-width: none; border-radius: 10px; }
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel figure { flex: 0 0 100%; scroll-snap-align: start; }
.carousel .controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 10px; }
.carousel .prev, .carousel .next { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
                                   background: var(--panel); color: var(--ink); font-size: 1.5rem; line-height: 1;
                                   cursor: pointer; padding: 0 0 3px; }
.carousel .prev:hover, .carousel .next:hover { border-color: var(--accent); color: var(--accent); }
.carousel .dots { display: flex; gap: 8px; }
.carousel .dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
                         background: var(--line); }
.carousel .dots button[aria-current="true"] { background: var(--accent); }
.carousel button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .carousel .track { scroll-behavior: auto; } }

/* The group window (2026-11-27): its own window, opened from the top bar, floating at the top right and not
   stopping the game while it is open. */
/* (the group window's placement: see the shared window rules at the end) */   /* under the top bar (2000) */
dialog.panel.floating #group { margin: 0; padding: 0; background: none; border: 0; }


/* The group window's buttons (2026-11-27): invite by name, kick (the leader), leave and disband. */
#group .group-invite { display: flex; gap: 6px; margin: 6px 0 8px; }
#group .group-invite input { flex: 1 1 auto; min-width: 0; }
#group .group-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }

/* Every window placed the same way for the screen it is on (2026-11-27, Derek: "make modal windows behave in a
   uniform way depending on the platform and orientation"): docked at the top right under the top bar on a computer
   or tablet; a sheet rising from the bottom on a phone held upright; a full-height panel beside the action bar on a
   phone held sideways. Windows that pause the game still dim it; the group and clan windows (.floating) don't. */
dialog { position: fixed; margin: 0; inset: auto; box-sizing: border-box; }
dialog.panel.floating { z-index: 1950; }
dialog.floating #group, dialog.floating #clan { margin: 0; padding: 0; background: none; border: 0; font-size: .9rem; }
#clan .member { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 4px 0;
                border-bottom: 1px solid rgba(255,255,255,.06); }
#clan .member > span:nth-child(2) { color: var(--muted); font-size: .8rem; }
#clan .member-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
#clan .member-acts button, #clan .group-actions button { padding: 2px 8px; font-size: .78rem; }
#clan .group-actions { flex-wrap: wrap; }
#clan .clan-chat { max-height: 160px; overflow-y: auto; padding: 4px 6px; margin: 4px 0; border: 1px solid var(--line);
  border-radius: 6px; font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; }
#clan .clan-chat:empty::before { content: 'Nothing said yet.'; color: var(--muted); }
#clan .invite { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
#clan .invite span { flex: 1 1 100%; }
#clan .group-invite { display: flex; gap: 6px; margin: 6px 0 8px; }
#clan .group-invite input { flex: 1 1 auto; min-width: 0; }
/* a computer or a tablet (the phone rules below take over on phones) */
dialog { top: 64px; right: 12px; max-height: calc(100vh - 80px); max-width: calc(100vw - 24px); }
dialog.panel.floating { width: min(340px, calc(100vw - 24px)); }
@media (max-width: 900px) and (orientation: portrait) {                      /* a phone held upright */
  dialog, dialog.panel, dialog.panel.floating, dialog.picker, dialog.desk {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 72vh;
    border-radius: 14px 14px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 500px) {                     /* a phone held sideways */
  dialog, dialog.panel, dialog.panel.floating, dialog.picker, dialog.desk {
    top: 0; bottom: 0; left: auto; right: calc(64px + env(safe-area-inset-right)); width: min(440px, 62vw);
    max-width: 62vw; height: 100vh; max-height: 100vh; border-radius: 0; }
}

/* The farm's corner (2026-11-28): the house and door buttons, bottom right above the action bar. */
/* On the game view's bottom left, like the backpack and menu buttons on its top right (2026-11-28, Derek) */
#farm-corner { position: absolute; left: 8px; bottom: 8px; z-index: 2000; display: flex; gap: 6px; }
#farm-corner[hidden], #farm-corner button[hidden] { display: none; }
/* A building's tag (2026-11-28): its name and a star for each upgrade, shown when near, like a name tag. */
.tag.building { color: #f2c14e; }

/* Coins (2026-11-29): a gold coin and the number, wherever something is bought or sold (game.js coinsEl). */
.coins { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: -2px; }
.coin-icon { width: 12px; height: 12px; image-rendering: pixelated; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The Decorate pages as a grid (farm and clan, 2026-11-29): picture, name, price, Place. */
.decor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; margin: 8px 0; }
.decor-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; text-align: center;
              border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); }
.decor-pic { width: 64px; height: 56px; display: grid; place-items: center; }
.decor-pic img { max-width: 64px; max-height: 56px; image-rendering: pixelated; }
.decor-pic img:only-child[src^="data"] { min-width: 28px; }
.decor-name { font-size: .8rem; line-height: 1.2; }
.decor-cost { font-size: .75rem; color: var(--muted); }
.decor-cell button { margin-top: auto; padding: 2px 14px; font-size: .78rem; }

/* The free camera (2026-11-29): its switch in the Menu, and "Centre on me" on the view while it looks elsewhere. */
.free-cam-row { display: block; margin: 8px 0; }
.free-cam-row small { display: block; color: var(--muted); margin-left: 24px; }
#cam-centre { position: absolute; right: 8px; bottom: 8px; z-index: 2000; padding: 4px 10px; font-size: .8rem; }
#cam-centre[hidden] { display: none; }
/* What a greyed-out build or make button is still short of: "2/30" and the item. */
button .short { display: inline-flex; align-items: center; gap: 2px; margin: 0 3px; white-space: nowrap; }
button .short .item-icon { width: 12px; height: 12px; }

/* The Build grids (farm and clan windows, 2026-11-29): what each building needs, "have/need" and the item. */
.decor-cost .need { display: inline-flex; align-items: center; gap: 2px; margin: 0 3px; white-space: nowrap; }
.decor-cost .need .item-icon { width: 12px; height: 12px; }
.decor-cost .need.short { color: var(--bad); }
