/* Tomorrow. Owner: lane A. Retrofuturist: cream, amber and sea-glass teal on deep space; wide space-age
   capitals (Michroma), a geometric body face (Jost), a typewriter mono for readouts (Space Mono), all OFL,
   self-hosted. Lane C may add style-button.css and lane F pay.css; lane A links them in index.html. */
@font-face { font-family: "Michroma"; src: url(fonts/michroma.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Jost"; src: url(fonts/jost.woff2) format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(fonts/spacemono.woff2) format("woff2"); font-display: swap; }
:root {
  --ink: #f4e8d0; --dim: #b3a790; --amber: #ffb24a; --teal: #6fd8c6; --red: #ff5a3c; --deep: #07060f;
  --glass: rgba(14, 11, 24, 0.70); --edge: rgba(244, 232, 208, 0.20); --edge2: rgba(255, 178, 74, 0.45);
  --display: "Michroma", "Eurostile", "Microgramma", "Bank Gothic", "Century Gothic", sans-serif;
  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  --mono: "Space Mono", "Courier New", ui-monospace, monospace;
  --gutter: max(16px, env(safe-area-inset-left));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep) url(still.jpg) center / cover no-repeat; color: var(--ink); font-family: var(--font); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 0; opacity: 0; transition: opacity 1.4s ease-out; }
body.live #c { opacity: 1; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui button { pointer-events: auto; font-family: var(--font); }

/* the title: letterbox bars, then the chrome word settling out of a wide blur */
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; height: 7.5vh; background: #000; z-index: 1; pointer-events: none; transition: transform 1.6s cubic-bezier(.6, 0, .2, 1) 0.2s; }
body::before { top: 0; } body::after { bottom: 0; }
body.born::before { transform: translateY(-100%); } body.born::after { transform: translateY(100%); }

.title { position: absolute; left: 6vw; top: 15vh; max-width: 88vw; transition: opacity 0.9s, transform 0.9s, filter 0.9s; }
.title::before { content: ""; display: block; width: min(52vw, 640px); height: 9px; margin: 0 0 22px 4px; opacity: 0; animation: rise 1.2s 1.2s ease-out forwards;
  background: linear-gradient(90deg, var(--amber), rgba(255, 178, 74, 0) 92%) top / 100% 1px no-repeat, repeating-linear-gradient(90deg, rgba(244, 232, 208, 0.55) 0 1px, transparent 1px 24px) bottom / 100% 6px no-repeat; }
.title h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5.2vw, 84px); letter-spacing: 0.16em; line-height: 1; white-space: nowrap;
  background: linear-gradient(176deg, #fffaf0 0%, #ffe3b0 34%, #f0a04a 49%, #6b3a1c 51%, #d98a42 60%, #fff0d0 86%, #ffe0a8 100%); background-size: 100% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255, 160, 70, 0.28)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
  animation: titleIn 2.6s cubic-bezier(.2, .7, .1, 1) both; }
.title h1::after { content: ""; }
.title .kick { margin: 18px 0 0 6px; font-size: clamp(12px, 1.45vw, 18px); font-weight: 500; letter-spacing: 0.42em; text-transform: uppercase; color: var(--teal); opacity: 0; animation: rise 1.2s 0.9s ease-out forwards; text-shadow: 0 0 18px rgba(111, 216, 198, 0.35); }
.title .ready { margin: 30px 0 0 6px; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95); font-family: var(--mono); font-size: clamp(12px, 1.1vw, 14px); color: var(--dim); letter-spacing: 0.08em; opacity: 0; animation: rise 1s 1.6s ease-out forwards; display: flex; align-items: center; gap: 12px; }
.title .ready::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle, #fff6e0 0 25%, #ffb24a 45%, rgba(255, 120, 40, 0) 72%); box-shadow: 0 0 14px 3px rgba(255, 170, 70, 0.55); animation: sunrise 1.8s ease-in-out infinite; }
.title.go .ready { color: var(--ink); }
.title.go .ready::before { animation: none; background: radial-gradient(circle, #fff 0 30%, #ffd08a 50%, rgba(255, 150, 60, 0) 74%); box-shadow: 0 0 18px 5px rgba(255, 190, 90, 0.7); }
.title.go .ready span, .title.go .ready { animation: rise 1s 1.6s ease-out forwards, breathe 2.6s 2.6s ease-in-out infinite; }
.title.gone { opacity: 0; transform: translateY(-24px) scale(1.04); filter: blur(6px); }
@keyframes titleIn { 0% { opacity: 0; letter-spacing: 0.7em; filter: blur(14px) drop-shadow(0 0 22px rgba(255, 160, 70, 0)); } 60% { opacity: 1; } 100% { opacity: 1; letter-spacing: 0.16em; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: 0.55; } }
@keyframes sunrise { 50% { transform: scale(0.72); opacity: 0.7; } }

.birth { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 10px); width: min(92vw, 820px); text-align: center; opacity: 0; transition: opacity 0.8s, transform 0.8s; }
.birth.show { opacity: 1; transform: translate(-50%, 0); }
.birth .big { margin: 0; font-family: var(--display); font-size: clamp(17px, 2.5vw, 30px); line-height: 1.45; letter-spacing: 0.06em; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.85); }
.birth .small { margin: 14px auto 0; max-width: 560px; color: var(--dim); font-size: clamp(14px, 1.4vw, 17px); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }

/* the HUD: glass chips with a fine cream edge and amber corner ticks */
.hud { opacity: 0; transition: opacity 0.8s 1.5s; }
body.born .hud { opacity: 1; }
.bar { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(56vw, 500px); text-align: center; }
.bar .lab { font-family: var(--display); font-size: 9px; letter-spacing: 0.42em; text-transform: uppercase; color: var(--dim); }
.bar .segs { position: relative; display: flex; gap: 2px; height: 7px; margin-top: 7px; padding: 0; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px var(--edge), 0 0 22px rgba(255, 178, 74, 0.14); }
.bar .segs::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 10px); pointer-events: none; }
.bar i { flex: 1 1 0; background: var(--c); transition: flex-grow 1.2s; pointer-events: auto; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }

.mood { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; display: flex; align-items: center; gap: 9px; padding: 5px 13px 5px 5px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge); font-size: 13px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mood .dial { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff8e8, #ecd8ae 58%, #b58444); position: relative; box-shadow: 0 0 0 2px #c79848, 0 0 0 3px #5a3d1c, 0 2px 8px rgba(0, 0, 0, 0.5); }
.mood .dial::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: repeating-conic-gradient(from -60deg, rgba(60, 30, 10, 0.55) 0 2deg, transparent 2deg 17deg); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.mood .dial i { position: absolute; left: 13px; top: 4px; width: 2px; height: 11px; background: var(--red); transform-origin: 1px 10px; transition: transform 0.8s cubic-bezier(.3, 1.6, .5, 1); border-radius: 1px; }
.mood .txt { font-family: var(--font); letter-spacing: 0.02em; }
.mood .txt:empty { display: none; }

.eye { position: absolute; top: 58px; right: 14px; display: flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 999px; background: rgba(54, 20, 6, 0.78); box-shadow: inset 0 0 0 1px rgba(255, 170, 90, 0.55), 0 0 24px rgba(255, 120, 40, 0.25); font-size: 13px; opacity: 0; transform: translateY(-6px); transition: opacity 0.4s, transform 0.4s; }
.eye.show { opacity: 1; transform: none; }
.eye .lamp { width: 12px; height: 12px; border-radius: 50%; background: #ffcf7a; box-shadow: 0 0 12px 4px rgba(255, 170, 80, 0.8); animation: lamp 0.9s ease-in-out infinite; }
@keyframes lamp { 50% { transform: scale(0.7); opacity: 0.7; } }

.hint { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); max-width: min(88vw, 560px); text-align: center; font-size: 14px; line-height: 1.4; color: var(--teal); opacity: 0; transition: opacity 0.6s; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }
.hint.show { opacity: 1; }
.msg { position: absolute; left: 50%; bottom: 168px; transform: translate(-50%, 8px); width: max-content; max-width: min(90vw, 640px); padding: 12px 20px; border-radius: 4px; font-size: 16px; line-height: 1.4; text-align: center; opacity: 0; transition: opacity 0.35s, transform 0.35s;
  background: linear-gradient(var(--amber), var(--amber)) left top / 10px 1px no-repeat, linear-gradient(var(--amber), var(--amber)) left top / 1px 10px no-repeat,
    linear-gradient(var(--amber), var(--amber)) right bottom / 10px 1px no-repeat, linear-gradient(var(--amber), var(--amber)) right bottom / 1px 10px no-repeat, var(--glass);
  box-shadow: inset 0 0 0 1px var(--edge), 0 8px 30px rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.msg.show { opacity: 1; transform: translate(-50%, 0); }
.msg[data-kind="god"]::before { content: "ODDMUND  "; font-family: var(--display); font-size: 0.66em; letter-spacing: 0.24em; color: var(--amber); vertical-align: 0.12em; }
.msg[data-kind="sys"] { color: var(--teal); }

.purse { position: absolute; left: var(--gutter); top: max(14px, env(safe-area-inset-top)); font-family: var(--mono); font-size: 13.5px; color: var(--amber); letter-spacing: 0.03em; text-shadow: 0 0 12px rgba(255, 178, 74, 0.45); }
.honest { position: absolute; left: var(--gutter); bottom: max(12px, env(safe-area-inset-bottom)); max-width: min(28vw, 400px); font-size: 12px; color: var(--dim); line-height: 1.4; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }
.mute, .say { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); border: 0; border-radius: 999px; padding: 9px 15px; background: var(--glass); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge); font-size: 12px; letter-spacing: 0.04em; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mute { right: 14px; }
#ui .say { right: 50%; transform: translateX(-124px); bottom: 34px; padding: 13px 19px; font-family: var(--display); font-size: 12px; letter-spacing: 0.2em; box-shadow: inset 0 0 0 1px var(--edge2), 0 0 18px rgba(255, 178, 74, 0.12); }

/* the big button: a chrome-rimmed dial; pending and the lock show on it at once */
.btn { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 132px; height: 132px; border: 0; border-radius: 50%; cursor: pointer; color: #2a1806;
  background: radial-gradient(circle at 50% 28%, #fff6e2 0%, #ffd38a 38%, #f0a040 70%, #b8661e 100%);
  box-shadow: 0 0 0 4px #f2efe8, 0 0 0 5px #9a9ca4, 0 0 0 8px #2b2a33, 0 0 0 9px rgba(244, 232, 208, 0.35), 0 12px 34px rgba(0, 0, 0, 0.55), 0 0 46px rgba(255, 170, 70, 0.35), inset 0 -6px 14px rgba(120, 50, 0, 0.35), inset 0 4px 8px rgba(255, 255, 255, 0.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 12px; user-select: none; touch-action: none; transition: transform 0.08s, filter 0.2s; }
#ui .btn { font-family: var(--display); }
.btn .w { font-size: 15px; font-weight: 400; letter-spacing: 0.1em; line-height: 1; }
.btn .sub { margin-top: 7px; font-family: var(--font); font-size: 10.5px; line-height: 1.2; max-width: 104px; text-align: center; color: #4a2c0c; }
.btn .ring { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); transform: rotate(-90deg); pointer-events: none; }
.btn .ring circle { fill: none; stroke-width: 3.5; }
.btn .ring .track { stroke: rgba(255, 255, 255, 0.07); }
.btn .ring .prog { stroke: var(--teal); stroke-dasharray: 289; stroke-dashoffset: calc(289 * (1 - var(--prog, 0))); transition: stroke-dashoffset 0.25s; filter: drop-shadow(0 0 4px rgba(111, 216, 198, 0.8)); }
.btn .ring .lock { stroke: #fff2d0; stroke-dasharray: 289; stroke-dashoffset: 289; opacity: 0; }
.btn.pending { transform: translateX(-50%) scale(0.94); filter: brightness(0.82) saturate(0.8); }
.btn.locked .ring .lock { opacity: 1; animation: fill var(--lock, 400ms) linear forwards; }
@keyframes fill { from { stroke-dashoffset: 289; } to { stroke-dashoffset: 0; } }
.btn.flash { box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--teal), 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 64px rgba(111, 216, 198, 0.85); }
.btn.nope { animation: shake 0.3s; }
.btn.idle { filter: grayscale(0.6) brightness(0.7); }
@keyframes shake { 25% { margin-left: -6px; } 75% { margin-left: 6px; } }

.panels { position: absolute; left: 50%; bottom: 178px; transform: translateX(-50%); display: none; max-height: calc(100% - 250px); overflow: auto; pointer-events: auto; }
.panels.show { display: block; }
.wheel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(92vw, 520px); padding: 12px; border-radius: 6px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.wheel .wp { pointer-events: auto; border: 0; border-radius: 4px; padding: 11px 8px; background: rgba(244, 232, 208, 0.08); box-shadow: inset 0 0 0 1px rgba(244, 232, 208, 0.12); color: var(--ink); font-size: 13px; cursor: pointer; }
.wheel .wp:hover { background: rgba(255, 178, 74, 0.16); }
.wheel .wp.gesture { color: var(--teal); }

/* the screens kit for HTML panels: phosphor text, scanlines, a curved dark glass (see handoffs/A-screens-kit.md) */
.crt { --ph: 255, 178, 74; position: relative; border-radius: 10px; padding: 14px 16px; color: rgb(var(--ph)); font-family: var(--mono); background: radial-gradient(ellipse at 50% 45%, rgba(var(--ph), 0.10), rgba(8, 7, 12, 0.92) 75%); box-shadow: inset 0 0 0 1px rgba(var(--ph), 0.28), inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 0 3px #1c1a20, 0 0 0 4px rgba(244, 232, 208, 0.18); text-shadow: 0 0 6px rgba(var(--ph), 0.7); overflow: hidden; }
.crt::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px); animation: roll 7s linear infinite; }
.crt.green { --ph: 120, 255, 150; } .crt.teal { --ph: 111, 216, 198; } .crt.red { --ph: 255, 90, 60; }
@keyframes roll { from { background-position: 0 0; } to { background-position: 0 60px; } }
.flipnum { display: inline-flex; gap: 3px; font-family: var(--mono); font-weight: 700; }
.flipnum b { display: inline-block; min-width: 0.8em; padding: 0.12em 0.1em; text-align: center; border-radius: 3px; color: #ffe6b8; background: linear-gradient(#26222c 0 49%, #000 49% 51%, #1d1a22 51%); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.6); }

/* the paper (src/paper.js): cream newsprint, a space-age masthead, columns that collapse on a phone */
.paper { width: min(94vw, 760px); max-height: 100%; overflow: auto; padding: 22px 24px 26px; color: #2a2118; background: #efe4cc linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(160, 120, 60, 0.12)); border-radius: 3px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(120, 80, 30, 0.18); font-family: Georgia, "Times New Roman", serif; }
.paper .mast { text-align: center; border-bottom: 3px double #2a2118; padding-bottom: 10px; }
.paper .mast h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(20px, 4.4vw, 34px); letter-spacing: 0.08em; }
.paper .mast p { margin: 6px 0 0; font-family: var(--font); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #6a5638; }
.paper .dateline { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; padding: 6px 0; border-bottom: 1px solid #2a2118; margin-bottom: 14px; }
.paper .lead h3 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 32px); line-height: 1.1; }
.paper .lead p { margin: 0 0 14px; font-size: 16px; line-height: 1.5; }
.paper .cols { columns: 2 220px; column-gap: 22px; column-rule: 1px solid rgba(42, 33, 24, 0.3); }
.paper .item { break-inside: avoid; margin: 0 0 14px; }
.paper .item h4 { margin: 0 0 4px; font-size: 16px; line-height: 1.2; }
.paper .item p { margin: 0; font-size: 14px; line-height: 1.45; }
.paper .market { margin-top: 10px; padding-top: 8px; border-top: 1px solid #2a2118; font-family: var(--mono); font-size: 12px; display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; }
.paper .market .up { color: #2f6b3a; } .paper .market .down { color: #8a2a1a; }
.paper .slot:empty { display: none; }
.paper .slot { margin-top: 14px; padding: 10px; border: 1px dashed rgba(42, 33, 24, 0.5); }

body.stared #c { filter: saturate(1.1); }
.halt { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: var(--deep) url(still.jpg) center / cover no-repeat; z-index: 10; }
.halt.show { display: flex; }
.halt .hc { padding: 18px 22px; border-radius: 6px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge); text-align: center; max-width: 90vw; }
.halt .hb { margin-top: 12px; border: 0; border-radius: 999px; padding: 10px 20px; background: var(--amber); color: #2a1806; font-family: var(--display); font-size: 12px; letter-spacing: 0.12em; cursor: pointer; }

@media (max-width: 600px) {
  body::before, body::after { height: 5.5vh; }
  .title { left: 7vw; top: 12vh; }
  .title::before { width: 70vw; margin-bottom: 16px; }
  .title .kick { letter-spacing: 0.3em; }
  .btn { width: 112px; height: 112px; bottom: max(20px, env(safe-area-inset-bottom)); }
  .btn .w { font-size: 13px; }
  .btn .sub { font-size: 10px; max-width: 92px; }
  #ui .say { transform: translateX(-104px); bottom: 34px; padding: 12px 16px; }
  /* the AI line sits under the bar as a full caption chip: wrapped, never cut */
  .honest { top: calc(max(14px, env(safe-area-inset-top)) + 34px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: calc(100vw - 2 * var(--gutter)); max-width: none; padding: 5px 10px; border-radius: 4px; text-align: center; font-size: 11px; line-height: 1.35; color: var(--ink); background: rgba(14, 11, 24, 0.55); box-shadow: inset 0 0 0 1px rgba(244, 232, 208, 0.1); white-space: normal; text-wrap: balance; }
  .bar { top: calc(max(14px, env(safe-area-inset-top)) + 54px); width: 56vw; }   /* under the season chip */
  .bar .lab { display: none; } /* the season chip sits there on a phone; the bar's colours say it */
  .bar .segs { margin-top: 0; }
  .honest { top: calc(max(14px, env(safe-area-inset-top)) + 66px); padding: 3px 8px; font-size: 10.5px; line-height: 1.25; }
  .mood { padding: 4px; } .mood .txt { display: none; }
  .eye { top: 18px; right: 62px; padding: 8px; } .eye .txt, .eye span:not(.lamp) { display: none; }   /* just the lamp beside the clock; the incoming panel says it in words */
  .msg { bottom: 156px; font-size: 14.5px; }
  .hint { top: 128px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media (hover: hover) { body.born:not(.moving) #c { cursor: crosshair; } }

/* ---------------------------------------------------------------- one layout rule for the HUD (integrator, 26 Nov)
   Zones: top row = purse, season chip, the bar, the clock; under it the honest line (phone) or bottom left (wide);
   the middle = what you opened (the Board, a sheet, the wheel); above the button = Oddmund's message line; bottom =
   SAY, the button, the Counting House door, Sound. Whatever is opened on purpose owns the middle and everything
   that would sit on it steps aside: the message line, world price tags and toasts hide while a sheet, the Board or
   the wheel is open. Every tap target on a touch screen is at least 44 px. */
body.wheel-open .msg, body:has(#ui .panels.show) .msg, body:has(.eboard) .msg,
body:has(#ui .panels.show) .pay-tag, body:has(.eboard) .pay-tag, body.wheel-open .pay-tag,
body:has(#ui .panels.show) .etoast, body:has(.eboard) .etoast { opacity: 0 !important; pointer-events: none !important; }
body:has(.eboard) .hint, body.wheel-open .hint, body:has(#ui .panels.show) .hint { opacity: 0 !important; }
.eboard { background: rgb(16, 11, 24) !important; }

@media (pointer: coarse), (max-width: 900px) {
  .mute, .say, .echip, .pay-door, .pay-x, .wh .it, .eboard button, .vx-strip button, .card .acts button { min-height: 44px; min-width: 44px; box-sizing: border-box; }
  .wh .g { height: 44px; margin-top: -22px; }
  .echip { display: inline-flex; align-items: center; }
}
@media (max-width: 600px) { .etoast { top: auto !important; bottom: calc(300px + env(safe-area-inset-bottom)) !important; } }
@media (min-width: 601px) and (max-width: 1100px) { .honest { max-width: calc(50vw - 225px); } }
@media (max-width: 600px) { .msg { bottom: calc(176px + env(safe-area-inset-bottom)); } }
@media (max-width: 600px) { .jobcard { top: 234px !important; } }
@media (min-width: 601px) and (max-width: 1100px) { #ui .reply { bottom: calc(104px + env(safe-area-inset-bottom)); } }

/* The Brim Press on the interface (W2, 27 Nov): ART-BIBLE 8 and handoffs/BRAND-wiring.md section 3. Loaded after
   style.css; it restates the tokens and the component rules so every lane's interface reads as printed matter laid
   on the sky: paper and key, brass hairlines, the apricot dial, the vermilion misregistered plate. Owner: W2. */
:root {
  --paper: #f2e6cc; --paper-shade: #e2cfa8; --key: #241a2e; --key-soft: #4a3a52;
  --ink: #f2e6cc; --dim: #b3a790; --red: #e8452c; --apricot: #f39a3b; --amber: #ffb24a;
  --teal: #6fd8c6; --teal-ink: #2e9c93; --brass: #c8933a; --brass-hi: #ebc77a; --violet: #4b2e83; --cobalt: #3b6db3;
  --deep: #0e0b1a; --mis: 3px 4px 0;
  --glass: rgba(36, 26, 46, 0.9); --edge: rgba(200, 147, 58, 0.55); --edge2: rgba(243, 154, 59, 0.6);
}

/* ---------------------------------------------------------------- the title: printed TOMORROW, Oddmund as host */
.title { top: 13vh; }
.title::before { display: none; }
.title .kick { order: -1; display: flex; align-items: center; gap: 14px; margin: 0 0 18px 4px; font-family: var(--display); font-size: clamp(10px, 1vw, 13px); letter-spacing: 0.24em; color: var(--paper); text-shadow: none; }
.title .kick::before, .title .kick::after { content: ""; flex: 0 0 clamp(28px, 4vw, 64px); height: 1.5px; background: var(--brass); }
.title h1 { position: relative; font-family: var(--display); font-weight: 400; letter-spacing: 0.12em; color: var(--paper); background: none; -webkit-background-clip: border-box; background-clip: border-box;
  text-shadow: 4px 5px 0 var(--red); filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55)); animation: printIn 1.1s cubic-bezier(.2, .7, .1, 1) both; }
.title h1 .ast { display: inline-block; margin-left: 0.08em; font-size: 0.36em; vertical-align: 1.7em; color: var(--apricot); text-shadow: none; letter-spacing: 0; }
@keyframes printIn { 0% { opacity: 0; text-shadow: 0 0 0 var(--red); transform: translateY(6px); } 55% { opacity: 1; text-shadow: 0 0 0 var(--red); transform: none; } 100% { opacity: 1; text-shadow: 4px 5px 0 var(--red); } }
.title { display: flex; flex-direction: column; }
.title .ready { order: 3; align-self: flex-start; margin: 28px 0 0 4px; padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--paper); color: var(--key); font-family: var(--display); font-size: clamp(10px, 0.95vw, 12px); letter-spacing: 0.16em; text-transform: uppercase; text-shadow: none;
  box-shadow: 0 0 0 2.5px var(--key), var(--mis) 2.5px var(--red); }
.title .ready:empty { display: none; }
.title .ready::before { background: radial-gradient(circle, #fff 0 25%, var(--apricot) 50%, rgba(243, 154, 59, 0) 74%); box-shadow: 0 0 10px 2px rgba(243, 154, 59, 0.7); }
.title.go .ready { color: var(--key); }
.title .foot { order: 4; margin: 16px 0 0 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--paper); opacity: 0; animation: rise 1s 2s ease-out forwards; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }
.host { position: absolute; left: 4vw; bottom: 9vh; width: clamp(120px, 15vw, 230px); pointer-events: none; opacity: 0; transform: translateY(18px); transition: opacity 0.9s, transform 0.9s; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55)); }
.host svg { display: block; width: 100%; height: auto; }
.host .tick { position: absolute; left: 70%; bottom: -2%; width: 46%; }
.host.show { opacity: 1; transform: none; animation: hostBob 5s 1s ease-in-out infinite; }
.host.gone { opacity: 0 !important; transform: translateY(30px) !important; animation: none; }
@keyframes hostBob { 50% { transform: translateY(-5px) rotate(-1deg); } }

/* ---------------------------------------------------------------- the main action: the apricot dial (component 3) */
#ui .btn { color: var(--key); background: radial-gradient(circle at 40% 35%, #ffd08a, var(--apricot) 60%, #d97a1f);
  box-shadow: 0 0 0 4px var(--key), 0 0 0 8px var(--paper), 0 0 0 10px var(--key), 4px 6px 0 10px rgba(232, 69, 44, 0.9), 0 14px 34px rgba(0, 0, 0, 0.5); }
#ui .btn .w { font-family: var(--display); font-size: 16px; letter-spacing: 0.08em; color: var(--key); }
#ui .btn .sub { font-family: var(--font); font-weight: 500; color: #3a2414; }
#ui .btn .ring .prog { stroke: var(--teal-ink); filter: none; }
#ui .btn.flash { box-shadow: 0 0 0 4px var(--key), 0 0 0 8px var(--paper), 0 0 0 10px var(--key), 4px 6px 0 10px rgba(232, 69, 44, 0.9), 0 0 54px rgba(243, 154, 59, 0.9); }

/* ---------------------------------------------------------------- secondary buttons: paper pills (component 4) */
#ui .say, #ui .mute, #ui .pay-door, #ui .btn2, #ui .second { background: var(--paper); color: var(--key); font-family: var(--display); letter-spacing: 0.16em; text-transform: uppercase; font-size: 11.5px;
  box-shadow: 0 0 0 2.5px var(--key), var(--mis) 2.5px var(--red); -webkit-backdrop-filter: none; backdrop-filter: none; }
#ui .say:hover, #ui .mute:hover { background: #fbf5e6; }

/* ---------------------------------------------------------------- pills and chips (component 1) */
.purse { padding: 6px 13px 6px 11px; border-radius: 999px; background: rgba(36, 26, 46, 0.92); color: var(--ink); text-shadow: none; box-shadow: inset 0 0 0 1.5px var(--brass), 0 3px 0 rgba(0, 0, 0, 0.35); font-family: var(--mono); }
.mood { background: rgba(36, 26, 46, 0.92); box-shadow: inset 0 0 0 1.5px var(--brass), 0 3px 0 rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: none; backdrop-filter: none; }
.mood .dial { background: radial-gradient(circle at 40% 35%, #fbf5e6, var(--paper) 60%, var(--paper-shade)); box-shadow: 0 0 0 2px var(--brass), 0 0 0 3.5px var(--key); }
.mood .dial i { background: var(--red); }
.eye { background: rgba(36, 26, 46, 0.92); box-shadow: inset 0 0 0 1.5px var(--red), 0 3px 0 rgba(0, 0, 0, 0.35); }
.eye .lamp { background: var(--red); box-shadow: 0 0 12px 4px rgba(232, 69, 44, 0.75); }
.bar .lab { font-family: var(--display); color: var(--paper); letter-spacing: 0.3em; }
.bar .segs { box-shadow: 0 0 0 1.5px var(--key), 0 0 0 3px var(--brass); }

/* ---------------------------------------------------------------- the message line: a paper note card (component 5) */
.msg { background: var(--paper); color: var(--key); border-radius: 3px; box-shadow: var(--mis) var(--teal-ink), 0 10px 30px rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: none; backdrop-filter: none; font-weight: 500; }
.msg[data-kind="god"]::before { content: "ODDMUND  "; color: var(--red); }
.msg[data-kind="sys"] { color: var(--teal-ink); }

/* ---------------------------------------------------------------- footnotes (component 6) */
.honest { font-family: var(--mono); font-size: 11px; color: var(--paper); opacity: 0.85; }
.honest::before { content: "* "; color: var(--apricot); }

/* ---------------------------------------------------------------- panels and the wheel (component 8) */
.wheel { background: rgba(36, 26, 46, 0.95); box-shadow: inset 0 0 0 1.5px var(--brass); -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 4px; }
.wheel .wp { background: var(--paper); color: var(--key); box-shadow: 0 0 0 1.5px var(--key); font-weight: 500; }
.wheel .wp:hover { background: #fbf5e6; box-shadow: 0 0 0 1.5px var(--key), 2px 3px 0 1.5px var(--red); }
.wheel .wp.gesture { color: var(--teal-ink); }
.crt { box-shadow: inset 0 0 0 1px rgba(var(--ph), 0.28), inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 0 3px var(--key), 0 0 0 4.5px var(--brass); }

/* the paper: the three house faces only (ART-BIBLE 5) */
.paper { font-family: var(--font); background: var(--paper); color: var(--key); }
.paper .lead h3, .paper .item h4 { font-family: var(--font); font-weight: 800; }

/* the letterbox on the title is key, never pure black */
body::before, body::after { background: #0b0812; }

@media (max-width: 600px) {
  .title { top: 11vh; }
  .title .kick { gap: 10px; letter-spacing: 0.18em; }
  .title .kick::before, .title .kick::after { flex-basis: 22px; }
  .host { left: 5vw; bottom: 11vh; width: 30vw; }
  #ui .btn { box-shadow: 0 0 0 3px var(--key), 0 0 0 6px var(--paper), 0 0 0 8px var(--key), 3px 5px 0 8px rgba(232, 69, 44, 0.9), 0 12px 28px rgba(0, 0, 0, 0.5); }
  #ui .btn .w { font-size: 13.5px; }
}

/* the title carries the AI line as its footnote until birth; the HUD's own copy appears with the HUD (W2) */
body:not(.born) .honest { opacity: 0; }
@media (max-width: 600px) { .host { display: none; } .title h1 { text-shadow: 2px 3px 0 var(--red); } }

/* ---- the dry dock (W2c, src/scene/arrival.js): the cut in from the title and the yard's work card ---- */
.dockcut { position: fixed; inset: 0; z-index: 30; pointer-events: none; background: var(--space, #14102a); opacity: 1; transition: opacity .5s ease-out; }
.dockcut.open { opacity: 0; }
.dockcard { position: fixed; left: 16px; bottom: 54px; z-index: 31; pointer-events: none; max-width: min(380px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 12px 16px 11px; background: var(--paper); color: var(--key); border-radius: 3px; box-shadow: 0 0 0 2px var(--key), var(--mis, 3px 3px 0 0) var(--teal-ink), 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(12px); transition: opacity .5s ease-out, transform .5s ease-out; }
.dockcard.show { opacity: 1; transform: none; }
.dockcard p { margin: 0; }
.dockcard .k { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--key-soft); }
.dockcard .k::after { content: ""; flex: 1; height: 1.5px; background: var(--brass); }
.dockcard .h { margin-top: 6px; font-family: "Jost", sans-serif; font-weight: 800; font-size: 19px; line-height: 1.15; }
.dockcard .f { margin-top: 7px; font-family: var(--mono); font-size: 10.5px; line-height: 1.35; color: var(--key-soft); }
@media (max-width: 480px) { .dockcard { bottom: 64px; } .dockcard .h { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .dockcut, .dockcard { transition: none; } }

/* ---------------------------------------------------------------- the second way: the bold pill beside the dial (W2c, 27 Nov)
   A paper pill cut on a slant, with a vermilion cap that carries Oddmund's needle: it reads as "the cheeky way" before
   the word is read. Beside the dial on the right on wide screens (SAY holds the left), above-left of the dial on a phone,
   clear of SAY, the message line and the Counting House door. Same timed lock as the dial: a ring that drains. */
@property --k { syntax: '<number>'; inherits: false; initial-value: 0; }
#ui .btn2 { position: absolute; left: calc(50% + 94px); bottom: 32px; z-index: 2; display: grid; grid-template-columns: 30px auto; grid-template-rows: auto auto; align-items: center;
  column-gap: 9px; min-height: 48px; min-width: 44px; max-width: min(240px, calc(50vw - 120px)); padding: 6px 16px 6px 6px; border: 0; border-radius: 999px 999px 999px 6px; cursor: pointer;
  pointer-events: auto; touch-action: none; user-select: none; text-align: left; transform: rotate(-3deg); transform-origin: 0 100%;
  background: var(--paper); color: var(--key); box-shadow: 0 0 0 2.5px var(--key), var(--mis) 2.5px var(--red), 0 10px 24px rgba(0, 0, 0, 0.45); transition: transform 0.08s, filter 0.2s; }
#ui .btn2[hidden] { display: none; }
#ui .btn2::before { content: ""; grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(var(--paper), var(--paper)) 50% 8px / 2px 13px no-repeat, radial-gradient(circle, var(--paper) 0 2.5px, transparent 3px), radial-gradient(circle at 40% 35%, #ff7a5a, var(--red) 70%, #a82a18);
  box-shadow: 0 0 0 2px var(--key); animation: wink 2.8s ease-in-out infinite; }
@keyframes wink { 0%, 70%, 100% { transform: rotate(-18deg); } 78% { transform: rotate(34deg); } 86% { transform: rotate(-6deg); } }
#ui .btn2 .or { grid-column: 2; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: lowercase; color: var(--red); line-height: 1; }
#ui .btn2 .w { grid-column: 2; font-family: var(--display); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
#ui .btn2 .sub { grid-column: 2; font-family: var(--font); font-size: 10px; letter-spacing: 0; text-transform: none; color: #4a2c0c; line-height: 1.2; }
#ui .btn2 .sub:empty { display: none; }
#ui .btn2:hover { background: #fbf5e6; }
#ui .btn2::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; pointer-events: none; opacity: 0; padding: 3px;
  background: conic-gradient(from -90deg, var(--paper) calc(var(--k) * 1turn), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
#ui .btn2.locked::after { opacity: 1; animation: drain var(--lock, 400ms) linear forwards; }
@keyframes drain { from { --k: 1; } to { --k: 0; } }
#ui .btn2.flip { animation: pop2 0.42s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop2 { from { transform: rotate(-3deg) scale(0.4); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
#ui .btn2.pending { transform: rotate(-3deg) scale(0.94); filter: brightness(0.86); }
#ui .btn2.flash { box-shadow: 0 0 0 2.5px var(--key), var(--mis) 2.5px var(--red), 0 0 34px rgba(232, 69, 44, 0.85); }
#ui .btn2.nope { animation: shake 0.3s; }
#ui .btn2.busy { filter: saturate(0.6); }
@media (max-width: 600px) {
  /* above-right of the dial: the reply chip holds the space above-left, the Counting House coin and Sound sit below */
  #ui .btn2 { left: auto; right: 10px; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 92px); max-width: calc(50vw - 66px); padding: 5px 12px 5px 5px; column-gap: 7px; grid-template-columns: 26px auto; transform: rotate(3deg); transform-origin: 100% 100%; }
  #ui .btn2.pending { transform: rotate(3deg) scale(0.94); }
  #ui .btn2::before { width: 26px; height: 26px; background-position: 50% 6px, 0 0, 0 0; background-size: 2px 11px, auto, auto; }
  #ui .btn2 .w { font-size: 11px; letter-spacing: 0.08em; }
  #ui .btn2 .sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { #ui .btn2::before { animation: none; } }

/* ---------------------------------------------------------------- fix pass, lane C (27 Nov): nothing lies on anything
   The birth line sits below the juice ribbon (INSIDE THE LAMPS rides at 27 % of the height, src/juice/css.js), so the
   two read one after the other. The drift hint waits below the room's little screen and the job card at tablet and
   phone widths. The Counting House door is the coin above Sound from 1100 px down (it lay on SAY on a tablet); the coin
   carries the euro in Jost (Michroma has no euro and drew an "O"). The second button keeps clear of Sound. */
.birth { top: 39%; }
@media (max-width: 1100px) { .hint { top: 268px; } }
@media (min-width: 601px) and (max-width: 1100px) { .jobcard { top: 226px !important; } }
@media (max-width: 600px) { .hint { top: 268px; } }
#ui .pay-door-coin { font-family: var(--font); font-weight: 800; letter-spacing: 0; }
@media (max-width: 1100px) {
  #ui .pay-door { left: auto; right: 14px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 56px); padding: 5px; min-width: 44px; min-height: 44px; justify-content: center; }
  #ui .pay-door span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #ui .pay-door-coin { width: 32px; height: 32px; font-size: 16px; }
}
/* fix pass 2 (27 Nov, D1): on a tablet the pill rides above Sound's row (Sound's top is 56 px up) so it only has to
   keep clear of the Counting House coin; with the phone's label size every pair label (STEAL, TAKE IT, UNMASK,
   RANSOM, BETRAY, PUSH LUCK) fits whole from 601 px. A label never breaks inside a word (overflow-wrap: normal). */
@media (min-width: 601px) and (max-width: 1100px) {
  #ui .btn2 { bottom: 64px; max-width: min(240px, calc(50vw - 94px - 72px)); }
  #ui .btn2 .w { font-size: 11px; letter-spacing: 0.08em; }
}
#ui .btn2 .w { overflow-wrap: normal; }
/* D2: Oddmund's screens card (src/scene/oddmund-acts.js) starts below the season bar (68 to 75 px) on a phone */
@media (max-width: 600px) { :root { --odd-card-top: 84px; } }
@media (max-width: 380px) {
  #ui .btn2 { max-width: calc(50vw - 30px); padding-right: 9px; column-gap: 5px; }
  #ui .btn2 .w { font-size: 10px; letter-spacing: 0.04em; }
}
/* what is opened on purpose owns the middle (the integrator's zone rule): a reward ribbon or stamp from the feel kit
   waits under an open sheet, the Board or the wheel instead of printing over the Counting House's clerks */
body:has(#ui .panels.show) .jz-rib, body:has(.eboard) .jz-rib, body.wheel-open .jz-rib { visibility: hidden !important; }
/* while a ribbon is up (the feel kit sets body.jz-rib-on, FIX-for-A.md) world price tags step aside */
body.jz-rib-on .pay-tag { opacity: 0 !important; pointer-events: none !important; }
/* the Board on tablet and phone (fix lane C, 27 Nov): a sheet up from the bottom row, so the world, the room's
   screen and the purse stay in view above it instead of the Board covering the whole picture */
@media (max-width: 1100px) {
  #ui .eboard { top: auto !important; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 138px) !important; max-height: min(54vh, calc(100% - 370px)) !important; }
}
/* lane C, after the fix tour: the dry dock is its own picture (the world's talk waits for the doors); the job card and
   the war chip step aside for what is opened on purpose (a sheet, the Board, the wheel); "or" sits above the verb */
body:has(.dockcard) #ui .tag.bub, body:has(.dockcard) #ui .tag.pin { visibility: hidden !important; }
body:has(#ui .panels.show) .jobcard, body:has(.eboard) .jobcard, body.wheel-open .jobcard { visibility: hidden !important; }
@media (max-width: 600px) { body.wheel-open .echip, body.wheel-open .honest { visibility: hidden !important; } }
#ui .btn2 .or { margin-bottom: 2px; }
/* phone: the greeting sits under the drift line, not on it; the second button keeps 44 px even mid-flip */
@media (max-width: 600px) { body .greet { top: 41%; } }
#ui .btn2 { min-height: 44px; }
/* fix pass 2 (27 Nov): the radio sheet takes its own width; the shrink-to-fit panel (left 50%) squeezed it to half the
   phone width, so the scale names overlapped and the caption ran one word a line at 390 */
#ui .panels:has(.feel-radio) { width: min(520px, calc(100vw - 24px)); }
