:root {
  --ink: #f2efe6;
  --dim: #b9b4a6;
  --bg: rgba(18, 20, 24, 0.72);
  --accent: #5cf2a0;
  --warn: #f2a65c;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0e1116; overflow: hidden; font-family: system-ui, Segoe UI, sans-serif; color: var(--ink); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#hud { position: fixed; inset: 0; pointer-events: none; }
.panel, .left-col { cursor: move; }
.panel button, .panel a, .panel input, .panel select, .holo-head, .holo-foot { cursor: default; }
.dragging { opacity: 0.85; }
.panel { position: absolute; padding: 10px 12px; background: var(--bg); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; backdrop-filter: blur(4px); pointer-events: auto; font-size: 13px; }
.left-col { position: absolute; top: 12px; left: 12px; width: 332px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.left-col .panel.top-left { position: static; max-width: none; width: 100%; }
.top-right { top: 12px; right: 12px; min-width: 200px; }
.bottom-left { bottom: 12px; left: 12px; font-family: var(--mono); font-size: 12px; }
.bottom-right { bottom: 12px; right: 12px; display: flex; gap: 6px; }
.name { font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.mode { font-weight: 400; letter-spacing: 0; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,0.08); color: var(--dim); margin-left: 6px; }
.mode.model { color: var(--accent); }
.mode.instinct { color: var(--warn); }
.mode.paused { color: #f25c5c; }
.mode.thinking { color: #7fe8ff; }
.dim { color: var(--dim); }
.activity { margin-top: 4px; color: #cfe9ff; }
.intention { margin-top: 4px; color: #f2d98a; font-size: 12px; }
.intention:empty, .small:empty { display: none; }
.small { font-size: 11px; margin-top: 2px; }
.label.sign { font-weight: 700; letter-spacing: 0.06em; color: #2a2a2a; background: #e8dcc0; border-color: #7a5a3a; }
.chat-line.event.weather { color: #cfd8ff; }
.thought { margin-top: 8px; font-style: italic; color: var(--ink); line-height: 1.35; opacity: 0.95; }
.needs { display: grid; grid-template-columns: 70px 1fr 36px; gap: 3px 8px; align-items: center; font-size: 12px; }
.needs .bar { height: 7px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.needs .bar i { display: block; height: 100%; background: var(--accent); }
.needs .bar i.hi { background: var(--warn); }
.needs .bar i.urgent { background: #f25c5c; }
/* his thinking fund, and what visitors can do about it (visitor.js) */
.fund { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); max-width: 260px; }
.fund:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* the island's browser: Gallery, Letters and Diary in a window inside the game (netwin.js) */
.panel.netwin { padding: 0; display: flex; flex-direction: column; overflow: hidden; resize: both; min-width: 320px; min-height: 260px; z-index: 10; cursor: default; background: rgba(18, 20, 24, 0.94); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
.net-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 8px; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.08); cursor: move; user-select: none; }
.net-tabs { display: flex; gap: 4px; }
.net-tabs button { padding: 4px 10px; font-size: 12px; }
.net-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 180px; }
.net-nav button, .net-nav a { padding: 2px 8px; font-size: 13px; line-height: 1.4; text-decoration: none; color: var(--ink); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; background: rgba(255,255,255,0.06); cursor: pointer; }
.net-url { flex: 1; min-width: 60px; font: 11px var(--mono); color: var(--dim); background: rgba(0,0,0,0.35); border-radius: 5px; padding: 4px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.net-body { position: relative; flex: 1; background: #fff; }
.net-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; background: #fff; }
.net-body iframe.on { display: block; }
.netwin.dragging .net-body iframe { pointer-events: none; }
.panel.netwin.hidden { display: none; }
/* god mode: only his maker sees this bar (godmode.js) */
.godbar { position: absolute; z-index: 11; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 20px; font-size: 12px; pointer-events: auto; backdrop-filter: blur(4px); white-space: nowrap; }
.godbar.god { background: rgba(120, 40, 160, 0.82); border: 1px solid #c58bff; color: #fff; }
.godbar.public { background: rgba(18, 20, 24, 0.82); border: 1px dashed #f2d98a; color: #f2d98a; }
.godbar b { letter-spacing: 0.14em; }
.godbar span { opacity: 0.85; }
.godbar button { padding: 3px 10px; border-radius: 12px; font-size: 11px; }
.godbar.hidden { display: none; }
.is-maker .banner { top: 54px; }
@media (max-width: 760px) { .godbar span { display: none; } }
.fund-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.fund-bar { height: 6px; margin: 5px 0 2px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.fund-bar i { display: block; height: 100%; width: 0; background: #7fe0ff; }
.fund-bar i.low { background: var(--warn); }
.fund-bar i.healthy { background: var(--accent); }
.fund-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.fund-btns .btn, .fund-btns button { padding: 4px 8px; font-size: 11px; }
button, .btn { font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: var(--ink); cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: rgba(255,255,255,0.12); }
button.on { border-color: var(--accent); color: var(--accent); }
button.paused { border-color: #f25c5c; color: #f25c5c; }
.banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 8px 14px; background: rgba(242,166,92,0.15); border: 1px solid rgba(242,166,92,0.5); border-radius: 8px; color: #ffd9b3; font-size: 13px; pointer-events: auto; }
.hidden { display: none; }

/* the retro television showing Echo's point of view; the picture is drawn by WebGL underneath */
/* the frame is built from borders so the screen itself stays transparent over the canvas */
/* Echo-vision: a crisp, modern feed of what he sees (or what is on the screen in front of him) */
.tv { pointer-events: auto; width: 100%; position: relative; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.tv.hidden { display: none; }
.holo-head, .holo-foot { display: flex; align-items: center; gap: 8px; font-family: var(--mono); color: #dbe6ec; cursor: default; }
.holo-head { font-size: 10px; letter-spacing: 0.22em; padding: 6px 9px; background: rgba(14, 18, 24, 0.86); border: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 0; border-radius: 8px 8px 0 0; }
.holo-title { flex: 1; font-weight: 600; }
.holo-rec { width: 6px; height: 6px; border-radius: 50%; background: #ff5a6a; animation: holo-rec 1.6s infinite; }
@keyframes holo-rec { 0%, 60% { opacity: 1; } 70%, 100% { opacity: 0.25; } }
.holo-live { font-size: 8px; letter-spacing: 0.16em; padding: 2px 5px; border: 1px solid rgba(127, 224, 255, 0.5); border-radius: 3px; color: #7fe0ff; }
.holo-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.holo-bars i { width: 3px; background: #7fe0ff; }
.holo-bars i:nth-child(1) { height: 3px; } .holo-bars i:nth-child(2) { height: 5px; }
.holo-bars i:nth-child(3) { height: 7px; } .holo-bars i:nth-child(4) { height: 10px; opacity: 0.5; }
.tv-bezel { position: relative; border: 1px solid rgba(255, 255, 255, 0.12); overflow: hidden; } /* see-through: the feed is drawn on the canvas beneath */
.tv-screen { width: 100%; aspect-ratio: 4 / 3; background: transparent; }
.holo-corners i { position: absolute; width: 10px; height: 10px; border-color: rgba(127, 224, 255, 0.8); border-style: solid; border-width: 0; pointer-events: none; }
.holo-corners .tl { left: 4px; top: 4px; border-left-width: 1px; border-top-width: 1px; }
.holo-corners .tr { right: 4px; top: 4px; border-right-width: 1px; border-top-width: 1px; }
.holo-corners .bl { left: 4px; bottom: 4px; border-left-width: 1px; border-bottom-width: 1px; }
.holo-corners .br { right: 4px; bottom: 4px; border-right-width: 1px; border-bottom-width: 1px; }
.holo-foot { font-size: 9px; letter-spacing: 0.14em; padding: 5px 9px; color: #9fb0ba; background: rgba(14, 18, 24, 0.86); border: 1px solid rgba(255, 255, 255, 0.12); border-top: 0; border-radius: 0 0 8px 8px; }
.holo-foot #holo-place { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* his screen: a small browser while he reads, an editor and then the live page at the Loom */
.tv-overlay { position: absolute; inset: 0; background: #0d1117; color: #d7dde3; overflow: hidden; }
.tv-overlay.hidden, .tv-overlay .hidden { display: none; }
.sv-browser, .sv-editor { position: absolute; inset: 0; display: flex; flex-direction: column; }
.sv-bar { flex: none; display: flex; align-items: center; gap: 4px; padding: 4px 6px; background: #1b2129; border-bottom: 1px solid #2a323c; font: 9px var(--mono); color: #9fb0ba; }
.sv-bar > i { width: 6px; height: 6px; border-radius: 50%; background: #3a444f; }
.sv-url { flex: 1; margin-left: 4px; padding: 2px 6px; border-radius: 8px; background: #0f141a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sv-page { flex: 1; overflow: hidden; background: #f6f4ef; color: #222; }
.sv-inner { padding: 8px 10px 40px; font: 9px/1.45 Georgia, 'Times New Roman', serif; }
.sv-inner h1 { font: 600 12px/1.25 system-ui, Segoe UI, sans-serif; margin: 0 0 6px; }
.sv-inner p { margin: 0 0 6px; }
.sv-dim { color: #8a8a8a; font-style: italic; }
.sv-file { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sv-state { color: #7fe0ff; text-transform: uppercase; letter-spacing: 0.12em; }
.sv-code { flex: 1; margin: 0; padding: 6px 8px; overflow: hidden; font: 8px/1.35 var(--mono); white-space: pre-wrap; word-break: break-all; color: #c9d1d9; }
.sv-code b { font-weight: 400; } .sv-code .t { color: #7ee787; } .sv-code .a { color: #79c0ff; } .sv-code .s { color: #a5d6ff; } .sv-code .c { color: #8b949e; font-style: normal; }
.sv-caret { display: inline-block; width: 5px; height: 9px; background: #7fe0ff; vertical-align: -1px; animation: holo-rec 1s infinite; }
.sv-livebox { flex: 1; position: relative; overflow: hidden; background: #fff; }
.sv-live { position: absolute; left: 0; top: 0; width: 200%; height: 200%; border: 0; transform: scale(0.5); transform-origin: 0 0; pointer-events: none; }

/* CSS2D labels */
.label { font-size: 12px; color: var(--ink); background: rgba(18,20,24,0.55); padding: 2px 7px; border-radius: 10px; white-space: nowrap; border: 1px solid rgba(255,255,255,0.08); }
.label.unknown { color: var(--dim); font-style: italic; }
.label.star { color: #e8ecff; background: rgba(10,14,30,0.4); border-color: rgba(200,210,255,0.25); font-style: italic; font-size: 11px; }
/* chat window above Echo: anchored by its bottom edge, with a tail pointing at him */
.chat-anchor { pointer-events: none; }
.chat { position: relative; width: 260px; transform: translateY(-50%); opacity: 0; transition: opacity 0.6s ease; background: rgba(18, 20, 24, 0.78); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 6px 9px 7px; font-size: 12px; line-height: 1.3; color: var(--ink); text-align: left; box-shadow: 0 4px 14px rgba(0,0,0,0.35); backdrop-filter: blur(3px); }
.chat::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: rgba(18, 20, 24, 0.84); }
.chat-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: #cfe9ff; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; margin-bottom: 4px; }
.chat-head .chat-time { font-weight: 400; color: var(--dim); font-family: var(--mono); }
.chat.show { opacity: 1; }
.chat-line { margin: 2px 0; opacity: 0; transform: translateY(4px); transition: opacity 0.6s, transform 0.4s; word-wrap: break-word; }
.chat-line.in { opacity: 1; transform: translateY(0); }
.chat-line.out { opacity: 0; transform: translateY(-4px); }
.chat-line + .chat-line { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 4px; margin-top: 4px; }
.chat-line .t { color: #8c887c; font-family: var(--mono); font-size: 10px; margin-right: 5px; }
.chat-line.thought { font-style: italic; color: #f4f1e8; }
.chat-line.say { color: var(--accent); font-weight: 600; }
.chat-line.event { color: #b9c7d0; }
.chat-line.event.good { color: #cfe9ff; }
.chat-line.event.bad { color: #f2a65c; }
.chat-line.event.doing { color: #d8d4c8; font-style: italic; opacity: 0.9; }
/* little effects above whatever he is doing */
.fx { pointer-events: none; font-size: 15px; font-weight: 700; text-shadow: 0 0 6px rgba(0,0,0,0.35); will-change: transform, opacity; }
.fx-spark { color: #ffb347; font-size: 13px; text-shadow: 0 0 8px #ff8a1a; }
.fx-note { color: #f6f1e4; font-size: 18px; text-shadow: 0 0 8px rgba(255,240,200,0.6); }
.fx-paint { font-size: 14px; }
.fx-leaf { color: #9fd36a; }
.fx-read { color: #e9e4d6; font-size: 11px; opacity: 0.8; }
.fx-think { color: #cfd8e8; font-size: 18px; }
.fx-star { color: #dfe9ff; text-shadow: 0 0 10px #9fc0ff; }
.fx-ripple { color: rgba(220,240,255,0.8); font-size: 20px; font-weight: 300; }
.fx-shell { color: #f2e6cf; font-size: 12px; }
.fx-charge { color: #ffe36b; text-shadow: 0 0 8px #ffd000; }
.fx-code { color: #8ff0c0; font-family: var(--mono); font-size: 12px; text-shadow: 0 0 6px rgba(80,255,180,0.5); }
.zzz { font-size: 18px; color: #cfe9ff; font-weight: 700; animation: float 2s infinite ease-in-out; }
@keyframes float { 0% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-8px); opacity: 1; } 100% { transform: translateY(0); opacity: 0.4; } }
@media (max-width: 900px) {
  .tv { display: none; }
  .left-col { width: 60vw; }
}
@media (max-width: 700px) {
  .top-right { display: none; }
}

/* ---------- the island editor (?edit=1) ---------- */
body.editing #hud, body.editing #banner { display: none !important; }
#editor { position: fixed; top: 0; left: 0; bottom: 0; width: 300px; overflow-y: auto; padding: 12px; background: rgba(14, 17, 22, 0.94); border-right: 1px solid rgba(255, 255, 255, 0.08); color: #e8e4d8; font: 13px/1.4 system-ui, 'Segoe UI', sans-serif; z-index: 20; display: flex; flex-direction: column; gap: 10px; }
#editor h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9a968a; }
#editor button { background: #232831; color: #e8e4d8; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 5px 9px; font: inherit; cursor: pointer; }
#editor button:hover { border-color: rgba(255, 255, 255, 0.28); }
#editor button.on { border-color: #5cf2a0; color: #5cf2a0; }
#editor button.primary { background: #2f7d55; border-color: #3f9a6a; }
#editor button.bad { color: #f2867a; }
#editor button:disabled { opacity: 0.4; cursor: default; }
.ed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ed-head b { font-size: 15px; }
#ed-status { color: #9a968a; font-size: 12px; text-align: right; }
.ed-card { padding: 10px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; background: rgba(255, 255, 255, 0.02); }
.ed-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.ed-dim { color: #9a968a; }
.ed-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #c9c4b6; margin-top: 4px; }
#editor .small { font-size: 11px; }
#editor:not(.has-sel) #ed-tools, #editor:not(.is-placed) #ed-scale-row, #editor:not(.is-placed) #ed-delete { display: none; }
#editor:not(.has-part) #ed-swatches, #editor:not(.has-part) #ed-mat .ed-row { opacity: 0.35; pointer-events: none; }
#ed-scale { flex: 1; }
#ed-swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 8px; }
#editor .ed-swatch { display: flex; align-items: center; gap: 6px; padding: 4px 6px; text-align: left; }
.ed-swatch i { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid rgba(255, 255, 255, 0.25); }
.ed-swatch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ed-color { width: 34px; height: 24px; padding: 0; border: none; background: none; vertical-align: middle; }
.ed-group { margin: 8px 0 4px; color: #9a968a; font-size: 12px; }
.ed-items { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.ed-foot p { margin: 4px 0 0; flex-basis: 100%; }

/* Echo-vision at the telescope: what it is pointed at, along the bottom of the picture */
.tv.scope .tv-screen::after { content: attr(data-caption); position: absolute; left: 10px; bottom: 8px; font: 600 10px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; color: rgba(190, 240, 215, 0.85); text-shadow: 0 0 4px rgba(0, 0, 0, 0.9); pointer-events: none; }

/* clicking a station: what it is and how Echo uses it, pinned beside the spot clicked */
.panel.station-pop { width: 290px; cursor: default; z-index: 6; line-height: 1.45; }
.station-pop .sp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; letter-spacing: 0.04em; }
.station-pop .sp-x { background: none; border: 0; color: var(--dim); font-size: 17px; line-height: 1; padding: 0 2px; cursor: pointer; }
.station-pop .sp-x:hover { color: var(--ink); }
.station-pop p { margin: 6px 0 0; }

/* Echo-vision at the easel, the piano and the star charts (screenview.js) */
.sv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sv-cap { position: absolute; left: 8px; top: 6px; font: 600 9px/1 var(--mono); letter-spacing: 0.1em; color: rgba(215, 235, 225, 0.85); text-transform: uppercase; text-shadow: 0 0 4px rgba(0, 0, 0, 0.9); pointer-events: none; }
.sv-easel { position: absolute; inset: 0; background: #3b2a1c; display: flex; align-items: center; justify-content: center; }
/* the book he is reading: a page that follows his eye, captions underneath */
.sv-book { position: absolute; inset: 0; display: flex; flex-direction: column; background: #2a2018; }
.sv-leaf { flex: 1; overflow: hidden; margin: 5px 7px 0; padding: 7px 10px 60px; background: #f4ecd8; border-radius: 2px 2px 0 0; box-shadow: inset 0 0 18px rgba(120, 90, 50, 0.25); color: #3b342c; font: 8.5px/1.55 Georgia, 'Times New Roman', serif; }
.sv-leaf p { margin: 0 0 5px; }
.sv-leaf .sv-h { font: 600 10px/1.3 Georgia, serif; color: #2a241e; margin-top: 4px; }
.sv-leaf .sv-skip { text-align: center; color: #b3a68e; letter-spacing: 0.3em; }
.sv-leaf .w { color: #b0a48e; transition: color 0.3s; border-radius: 2px; }
.sv-leaf .w.read { color: #3b342c; }
.sv-leaf .w.on { color: #1d1a16; background: #ffe066; box-shadow: 0 0 0 1px #ffe066; }
.sv-leaf .w.kept { background: linear-gradient(transparent 45%, rgba(140, 230, 120, 0.75) 45%); color: #1d1a16; }
.sv-tags { position: absolute; right: 8px; top: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; }
.sv-tags span { font: 700 8px/1 system-ui, sans-serif; color: #fff; background: rgba(30, 30, 40, 0.72); padding: 3px 6px; border-radius: 9px; animation: sv-pop 0.4s ease-out both; }
.sv-captions { position: absolute; left: 6px; right: 6px; bottom: 9px; text-align: center; font: 800 14px/1.25 system-ui, 'Segoe UI', sans-serif; color: #fff; text-shadow: 0 0 1px #000, 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, 0.9); pointer-events: none; }
.sv-captions span { display: inline-block; padding: 0 2px; }
.sv-captions .on { color: #1a1a1a; background: #ffe066; border-radius: 4px; text-shadow: none; padding: 0 4px; animation: sv-pop 0.18s ease-out; }
.sv-captions.kept .on { background: #8ce678; }
@keyframes sv-pop { from { transform: scale(0.82); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.sv-board { height: 82%; aspect-ratio: 1; background: #f2ead8; box-shadow: 0 0 0 4px #6b4a2c, 0 6px 14px rgba(0, 0, 0, 0.5); }
.sv-board svg { width: 100%; height: 100%; display: block; }

/* ---------- the welcome (welcome.js): a splash painting under his story, how to get about and how to reach him;
   the words sit on the side of the painting away from Echo (.on-right when he stands on the left) ---------- */
.welcome { position: fixed; inset: 0; z-index: 50; display: flex; background: #0b1a2a; color: var(--ink); transition: opacity 0.45s ease; }
.welcome.hidden { display: none; }
.welcome.leaving { opacity: 0; pointer-events: none; }
.welcome-art { position: absolute; inset: 0; background: 70% center / cover no-repeat; opacity: 0; transform: scale(1.04); transition: opacity 0.9s ease, transform 9s ease-out; }
.welcome.on-right .welcome-art { background-position: 30% center; }
.welcome.art-in .welcome-art { opacity: 1; transform: scale(1); }
.welcome-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 14, 24, 0.88) 0%, rgba(8, 14, 24, 0.66) 40%, rgba(8, 14, 24, 0.1) 68%, rgba(8, 14, 24, 0) 100%), linear-gradient(0deg, rgba(8, 14, 24, 0.55), transparent 28%); }
.welcome.on-right .welcome-shade { background: linear-gradient(270deg, rgba(8, 14, 24, 0.88) 0%, rgba(8, 14, 24, 0.66) 40%, rgba(8, 14, 24, 0.1) 68%, rgba(8, 14, 24, 0) 100%), linear-gradient(0deg, rgba(8, 14, 24, 0.55), transparent 28%); }
.welcome-body { position: relative; display: flex; flex-direction: column; gap: 14px; width: min(680px, 100%); max-height: 100%; overflow-y: auto; padding: 30px 32px 0; }
.welcome.on-right .welcome-body { margin-left: auto; }
.welcome-kicker { font: 600 11px var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.welcome h1 { font: 700 44px/1.05 Georgia, 'Iowan Old Style', serif; margin: 6px 0 10px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55); }
.welcome-lede { font: 17px/1.45 Georgia, 'Iowan Old Style', serif; color: #ece6d6; margin: 0; max-width: 32em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }
.welcome-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; padding: 16px 20px; background: rgba(12, 18, 28, 0.64); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; backdrop-filter: blur(6px); font-size: 13px; line-height: 1.45; }
.welcome-card h2 { font: 600 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: #f2d98a; margin: 0 0 6px; }
.welcome-card p { margin: 0 0 8px; }
.welcome-card p:last-child { margin-bottom: 0; }
.welcome-card ul { margin: 0; padding: 0; list-style: none; }
.welcome-card li { margin: 0 0 7px; }
.welcome kbd { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-bottom-width: 2px; color: var(--ink); white-space: nowrap; }
/* the way in stays in view at the foot of the panel, however far the words scroll */
.welcome-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0 20px; background: linear-gradient(0deg, rgba(8, 14, 24, 0.97) 72%, rgba(8, 14, 24, 0)); }
.welcome-enter { font: 600 15px system-ui, 'Segoe UI', sans-serif; padding: 11px 24px; border-radius: 8px; border: 0; background: var(--accent); color: #0b1a14; cursor: pointer; box-shadow: 0 6px 22px rgba(92, 242, 160, 0.28); }
.welcome-enter:hover { filter: brightness(1.08); }
.welcome-enter:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.welcome-caption { font-size: 12px; font-style: italic; color: var(--dim); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
@media (max-width: 760px) {
  .welcome-shade, .welcome.on-right .welcome-shade { background: linear-gradient(180deg, rgba(8, 14, 24, 0.35) 0%, rgba(8, 14, 24, 0.78) 34%, rgba(8, 14, 24, 0.9) 100%); }
  .welcome-body { width: 100%; padding: 22px 16px 0; gap: 12px; }
  .welcome h1 { font-size: 32px; }
  .welcome-lede { font-size: 15px; }
  .welcome-card { grid-template-columns: 1fr; padding: 14px 14px; gap: 12px; }
}
@media (max-height: 700px) and (min-width: 761px) {
  .welcome-body { padding-top: 22px; gap: 12px; }
  .welcome h1 { font-size: 36px; }
}

/* ---------- phones: phone.js puts .phone on <html> when the screen is narrow, or short and touched, and .touch
   where the pointer is a finger. Nothing above changes; this rearranges the same panels:
   - a one-line status strip across the top (tap it for the rest), Echo-vision a small picture under it (tap it
     to make it big, and small again);
   - at the bottom, his fund, the pages (Gallery, Letters, Mind, Diary) and the buttons (Sound, TV, Chat,
     Follow), stacked in the HUD's own flow so nothing overlaps, whatever their heights; a place's note docks
     above them, and so do the banner and, for his maker, the GOD MODE pill;
   - turned on its side, the strip and Echo-vision down the left, the fund and pages top right, the buttons
     bottom right;
   - every control at least 44 px, nothing to drag, and the island's browser full screen ---------- */
.strip-time { display: none; }
.welcome-keys.touch-keys { display: none; }
.touch .welcome-keys.mouse-keys { display: none; }
.touch .welcome-keys.touch-keys { display: block; }
.touch .welcome-enter { min-height: 44px; }

.phone #hud { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; padding: 8px; }
.phone .panel, .phone .left-col { cursor: default; }
.phone #hud .panel { touch-action: manipulation; }
.phone #hud > .panel:not(.netwin), .phone .banner, .phone .godbar { position: static; transform: none; margin: 0; }
.phone .panel.bottom-left { display: none; } /* its clock and weather are on the strip; the spend is on the fund line */
/* the top: the strip, and Echo-vision under it on the right */
.phone .left-col { top: 8px; left: 8px; right: 8px; width: auto; gap: 6px; }
.phone .left-col .panel.top-left { order: -1; position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 30px 6px 12px; white-space: nowrap; overflow: hidden; cursor: pointer; }
.phone .panel.top-left::after { content: '▾'; position: absolute; right: 11px; top: 13px; color: var(--dim); font-size: 13px; transition: transform 0.2s; }
.phone .panel.top-left .name { flex: none; }
.phone .panel.top-left .activity { flex: 1 1 auto; min-width: 0; margin-top: 0; overflow: hidden; text-overflow: ellipsis; }
.phone .panel.top-left .strip-time { display: block; flex: none; font-size: 12px; }
.phone .panel.top-left > :is(#loc, .intention, #pockets, .thought) { display: none; }
.phone .left-col .panel.top-left.open { display: block; white-space: normal; }
.phone .panel.top-left.open::after { transform: rotate(180deg); }
.phone .panel.top-left.open > :is(#loc, .intention, #pockets, .thought) { display: block; }
.phone .panel.top-left.open > :is(.intention, #pockets):empty { display: none; }
.phone .panel.top-left.open .activity { margin-top: 4px; }
.phone .panel.top-left.open .strip-time { margin-top: 6px; }
.phone .panel.top-left.open .thought { max-height: 30vh; overflow-y: auto; }
.phone .tv:not(.hidden) { display: block; }
.phone .tv { width: 150px; align-self: flex-end; cursor: pointer; }
.phone .tv.big { width: 100%; }
.phone .tv:not(.big) :is(.holo-live, .holo-bars, .holo-foot) { display: none; }
.phone .tv:not(.big) .holo-head { padding: 4px 7px; font-size: 9px; letter-spacing: 0.14em; }
.phone .tv:not(.big) .tv-bezel { border-radius: 0 0 8px 8px; }
.phone .chat { width: 220px; }
/* the bottom, from the top down: the GOD MODE pill, the banner, a place's note, the fund and pages, the buttons */
.phone .godbar { order: 0; align-self: center; padding: 4px 4px 4px 14px; }
.phone .godbar span { display: none; }
.phone .godbar button { min-height: 44px; padding: 0 14px; border-radius: 22px; }
.phone .banner { order: 1; font-size: 12px; padding: 7px 10px; max-height: 22vh; overflow-y: auto; }
.phone .panel.station-pop { order: 2; width: auto; max-height: 38vh; overflow-y: auto; }
.phone .station-pop .sp-x { min-width: 44px; min-height: 44px; margin: -12px -10px -12px 0; font-size: 22px; }
.phone .panel.top-right { order: 3; display: block; min-width: 0; padding: 8px 10px; }
.phone .fund:not(.hidden) { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 10px; max-width: none; }
.phone .fund-bar { margin: 0; }
.phone #fund-line { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone .fund-btns { grid-column: 1 / -1; gap: 6px; margin-top: 5px; }
.phone .panel.bottom-right { order: 4; flex-wrap: wrap; gap: 6px; padding: 6px; }
.phone .fund-btns .btn, .phone .bottom-right > :is(button, .btn) { flex: 1 1 auto; min-width: 54px; min-height: 44px; padding: 0 8px; font-size: 13px; line-height: 42px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone #btn-listen { order: -1; flex-basis: 100%; } /* the music playing: a row of its own, for its title */
/* the island's browser: the whole screen, its tabs and buttons big enough for a finger */
.phone .panel.netwin { z-index: 30; border: 0; border-radius: 0; resize: none; min-width: 0; min-height: 0; }
.phone .net-bar { cursor: default; padding: 6px; gap: 6px; }
.phone .net-tabs { flex: 1 1 auto; gap: 6px; }
.phone .net-tabs button { flex: 1 1 auto; min-height: 44px; font-size: 14px; }
.phone .net-nav { gap: 6px; }
.phone .net-nav :is(button, a) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 18px; }
@media (orientation: landscape) {
  .phone #hud { align-items: flex-end; justify-content: flex-start; }
  .phone #hud > .panel:not(.netwin), .phone .banner { width: min(340px, 46vw); }
  .phone .left-col { right: auto; width: min(300px, 38vw); }
  .phone .tv { align-self: flex-start; }
  .phone .godbar { order: 0; align-self: flex-end; }
  .phone #hud > .panel.top-right { order: 1; margin-bottom: auto; }
  .phone .banner { order: 2; }
  .phone .panel.station-pop { order: 3; }
  .phone .welcome-body { padding-top: 14px; gap: 10px; }
  .phone .welcome h1 { font-size: 26px; margin: 2px 0 6px; }
  .phone .welcome-lede { font-size: 14px; }
  .phone .welcome-foot { padding: 10px 0 12px; }
}
