:root {
  --sky: #0d0f3a; --ink: #0b0b16; --paper: #fff; --blush: #ff9fd0; --lamp: #f2c35e; --cash: #3fae6a;
  --teal: #66afb2; --navy: #0a2470; --red: #ff3b5c; --cream: #2a2c78; --mute: #4c4f6c; --mblue: #001bfd;
  --f-display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --f-hand: "Gaegu", "Comic Sans MS", cursive;
  --f-body: "Nunito", ui-rounded, system-ui, sans-serif;
  --f-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --shadow: 6px 7px 0 var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(#ffffff22 1px, transparent 1.5px) 0 0 / 34px 34px, linear-gradient(#070820, #12145a) fixed; color: #e8eaf3; font-family: var(--f-body); min-height: 100vh; }
.card, .actions, dialog, .hud, #cta, #goalBox, .toast, #unmute, #cutCap, #bubble, #banner { color: var(--ink); }
a { color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1480px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-size: 26px; white-space: nowrap; }
.brand img { border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
.brand b { color: #7f96ff; -webkit-text-stroke: 1px var(--ink); }
.top-right { display: flex; gap: 10px; }
.btn { font: 800 16px var(--f-body); background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 10px 16px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; color: var(--ink); }
.btn.small { font-size: 14px; padding: 7px 12px; }
.btn.dark { background: var(--ink); color: #fff; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.holder { background: var(--lamp); color: var(--ink); }

/* stream on the left, chat column on the right (stacks on phones) */
main { max-width: 1480px; margin: 0 auto; padding: 0 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); column-gap: 20px;
  grid-template-areas: "stage chat" "actions chat" "hint chat" "panels panels"; }
.stage-wrap { grid-area: stage; }
.actions { grid-area: actions; }
.hint { grid-area: hint; }
.panels { grid-area: panels; }
.stage-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 5px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 8px 10px 0 var(--ink); background: var(--cream); }
#stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; user-select: none; }
.layer { position: absolute; left: 0; top: 0; }
#world { width: 1280px; height: 720px; }
#cutaway { z-index: 5; } #fx { z-index: 6; } #burger, .cameo { z-index: 4; }
#banner, #toasts { z-index: 9; } .hud, #ticker, #cta { z-index: 8; }
#sky { width: 100%; height: 100%; transition: filter .8s;
  background: radial-gradient(circle at 18% 26%, #fff7d6 0 30px, #fff7d655 31px 40px, transparent 41px), radial-gradient(#fff 1.4px, transparent 2px) 0 0 / 42px 42px, radial-gradient(#cfd8ff 1px, transparent 1.6px) 21px 17px / 42px 42px, linear-gradient(#03051a, #0f1b5e); }
#sky.night { filter: brightness(.7); }
#sky.moon { background: radial-gradient(circle at 22% 52%, #fff7d6 0 92px, #f2e3a8 93px 98px, #fff7d633 99px 128px, transparent 129px), radial-gradient(#fff 1.4px, transparent 2px) 0 0 / 36px 36px, linear-gradient(#060a2e, #2a1a6e); }
.unlock { display: none; }
.unlock.on { display: inline; }

#wildeWrap { left: 568px; top: 196px; width: 440px; height: 401px; transform-origin: 50% 100%; }
#wilde { position: relative; width: 100%; height: 100%; }
#wildeFront, #face { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#face { overflow: visible; }
#wildeFront { filter: drop-shadow(0 0 1px var(--ink)); }
#wildeBack { position: absolute; left: 60px; top: -84px; width: 400px; display: none; } /* stands up: the whole butt clears the desk */
#wildeBack img { display: block; width: 100%; filter: drop-shadow(0 0 1px var(--ink)); }
#buttNames { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#buttNames text { font-family: var(--f-hand); font-weight: 700; fill: #fff; stroke: #141414; stroke-width: 4px; paint-order: stroke fill; text-anchor: middle; dominant-baseline: middle; }
#buttNames .fresh { animation: scribble .7s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes scribble { from { opacity: 0; transform: scale(2.2); } }
#wilde.back #wildeFront, #wilde.back #face { display: none; }
#wilde.back #wildeBack { display: block; }

#monitor { left: 302px; top: 312px; width: 276px; height: 166px; border-radius: 6px; overflow: hidden; }
#chart { display: block; }
#pool { top: 480px; width: 1280px; height: 194px; display: none; background: linear-gradient(rgba(127, 191, 255, .72), rgba(64, 132, 224, .82)); }
#pool.on { display: block; }
#pool svg { position: absolute; left: 0; top: -22px; width: 1280px; height: 40px; }
#dim { width: 1280px; height: 720px; background: #10125a; opacity: 0; pointer-events: none; transition: opacity 1.2s; mix-blend-mode: multiply; }
#fx { pointer-events: none; }
#burger { display: none; }
.cameo { width: 330px; display: none; filter: drop-shadow(0 0 1px var(--ink)); }

#cutaway { width: 1280px; height: 720px; display: none; background: radial-gradient(circle at 50% 45%, #2a3cff 0, #0d1060 45%, #05061c 80%); }
#cutImg { position: absolute; inset: 40px 0 120px; background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; }
#cutCap { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); white-space: nowrap; font: 900 44px var(--f-body); background: #fff; border: 6px solid var(--ink); border-radius: 22px; padding: 12px 30px; box-shadow: 8px 9px 0 var(--ink); }

.hud { position: absolute; top: 18px; font: 900 22px var(--f-body); background: #fff; border: 5px solid var(--ink); border-radius: 999px; padding: 6px 18px; box-shadow: 5px 5px 0 var(--ink); }
#hudLive { left: 18px; display: flex; align-items: center; gap: 8px; }
#hudLive i { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#hudMcap { right: 18px; font-family: var(--f-mono); }
#hudMcap small { font: 800 14px var(--f-body); color: var(--mute); }
#banner { position: absolute; left: 50%; top: 150px; transform: translate(-50%, -50%) scale(0); font: 112px var(--f-display); color: #fff; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; text-shadow: 9px 10px 0 var(--ink); white-space: nowrap; pointer-events: none; }
#toasts { position: absolute; left: 18px; bottom: 60px; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; pointer-events: none; }
.toast { max-width: 370px; overflow: hidden; text-overflow: ellipsis; font: 800 22px var(--f-body); background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 6px 16px; box-shadow: 4px 4px 0 var(--ink); animation: toast 3.2s forwards; white-space: nowrap; }
.toast b.buy { color: #2f8a2f; } .toast b.sell { color: var(--red); }
.toast .tier { font-size: 14px; background: var(--lamp); border: 2px solid var(--ink); border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; }
@keyframes toast { 0% { transform: translateY(-20px) scale(.6); opacity: 0; } 10% { transform: none; opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
#ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: var(--ink); display: flex; align-items: center; gap: 10px; padding: 0 12px; overflow: hidden; }
.tk { flex: none; font: 800 18px var(--f-body); color: #fff; padding: 3px 12px; border-radius: 999px; border: 2px solid #fff; animation: tk .4s; }
.tk-wait { font: 700 17px var(--f-body); color: #9b9792; }
.tk.buy { background: #2f8a2f; } .tk.sell { background: var(--red); }
@keyframes tk { from { transform: translateX(-60px); opacity: 0; } }
#goalBox { position: absolute; left: 50%; bottom: 58px; width: 470px; transform: translateX(-50%); z-index: 8; background: #fff; border: 5px solid var(--ink); border-radius: 18px; padding: 8px 14px 10px; box-shadow: 5px 6px 0 var(--ink); display: none; }
#goalBox.on { display: block; }
#goalBox.done { background: var(--lamp); animation: goalPulse .8s ease-in-out infinite alternate; }
#goalBox.pick { background: var(--blush); }
@keyframes goalPulse { to { transform: translateX(-50%) scale(1.04); } }
#goalTitle { font: 900 20px/1.2 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#goalTitle b { font-family: var(--f-display); font-weight: 400; color: var(--red); margin-right: 6px; }
.gbar { height: 16px; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; background: #ebebeb; margin: 6px 0 4px; }
.gbar i { display: block; height: 100%; width: 0; background: var(--cash); transition: width .6s; }
#goalMeta { font: 800 15px var(--f-body); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#unmute { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; font: 900 30px var(--f-body); background: var(--lamp); border: 5px solid var(--ink); border-radius: 18px; padding: 12px 24px; box-shadow: 6px 7px 0 var(--ink); cursor: pointer; display: none; }
#unmute.on { display: block; }
#nowPlaying { position: absolute; right: 18px; top: 84px; z-index: 8; font: 800 16px var(--f-body); background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 12px; display: none; }
#nowPlaying.on { display: block; }
.goals { list-style: none; margin: 0; padding: 0; font-weight: 800; display: grid; gap: 10px; }
.goals .empty { color: var(--mute); }
.goals .gbar { height: 12px; margin: 4px 0 0; }
.goals .done { color: #2f8a2f; }
.goals .queued { color: var(--mute); font-size: 14px; }
#cta { position: absolute; right: 18px; bottom: 60px; font: 900 24px var(--f-body); background: var(--lamp); border: 5px solid var(--ink); border-radius: 16px; padding: 6px 16px; box-shadow: 5px 5px 0 var(--ink); display: none; }
body.stream #cta { display: block; }

.actions { display: flex; gap: 14px; justify-content: center; margin: 22px 0 6px; }
.act { flex: 1; max-width: 220px; display: flex; flex-direction: column; align-items: center; background: #fff; border: 5px solid var(--ink); border-radius: 18px; padding: 10px 8px; box-shadow: var(--shadow); cursor: pointer; color: var(--ink); }
.act .big { font: 34px var(--f-display); }
.act small { font: 800 14px var(--f-body); color: var(--mute); }
.act[data-act="slap"] { background: var(--blush); }
.act[data-act="feed"] { background: var(--lamp); }
.act[data-act="pet"] { background: #cfeabf; }
.act:active { transform: translate(4px, 5px); box-shadow: 2px 2px 0 var(--ink); }
.act:disabled { opacity: .6; }
.act.spent { opacity: .55; filter: grayscale(.6); }
.hint { text-align: center; font: 700 15px var(--f-body); margin: 8px 0 22px; }

#bubble { position: absolute; left: 470px; top: 22px; width: 580px; z-index: 7; background: #fff; border: 5px solid var(--ink); border-radius: 28px; padding: 12px 22px 14px; box-shadow: 7px 8px 0 var(--ink); opacity: 0; transform: scale(.6); transform-origin: 70% 100%; transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
#bubble.on { opacity: 1; transform: none; }
#bubble::after { content: ""; position: absolute; left: 380px; bottom: -26px; width: 34px; height: 34px; background: #fff; border-right: 5px solid var(--ink); border-bottom: 5px solid var(--ink); transform: skewX(-30deg) rotate(45deg); }
#bubbleReply { font: 800 17px var(--f-body); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bubbleReply:empty { display: none; }
#bubbleText { font: 900 26px/1.2 var(--f-body); min-height: 31px; }
#chatOverlay { position: absolute; left: 18px; top: 86px; width: 400px; max-height: 206px; overflow: hidden; z-index: 7; display: none; flex-direction: column; justify-content: flex-end; gap: 6px; }
body.stream #chatOverlay { display: flex; }
#chatOverlay div { flex: none; font: 800 16px/1.25 var(--f-body); background: rgba(255, 255, 255, .92); border: 3px solid var(--ink); border-radius: 12px; padding: 4px 10px; animation: tk .3s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#chatOverlay b { color: var(--navy); }

.card.chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; margin-bottom: 22px; }
.card.chat h3 small { font: 700 13px var(--f-body); color: var(--mute); }
#chatList { list-style: none; margin: 0 0 10px; padding: 0; height: 0; flex: 1 1 auto; min-height: 160px; overflow: auto; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
#chatList li { line-height: 1.35; overflow-wrap: anywhere; }
#chatList li.wilde { background: var(--cream); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px; }
#chatList .empty { color: var(--mute); }
#chatList b { color: var(--navy); }
#chatList .tier { font-size: 11px; background: var(--lamp); border: 2px solid var(--ink); border-radius: 5px; padding: 0 4px; margin-left: 4px; vertical-align: 2px; }
#chatForm { display: flex; flex-wrap: wrap; gap: 8px; }
#chatForm[hidden] { display: none; }
#chatGate p { margin: 0 0 8px; }
#chatForm input { font: 700 16px var(--f-body); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 10px; min-width: 0; }
#chatText { flex: 1; }
@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "actions" "hint" "chat" "panels"; }
  #chatList { height: 260px; flex: none; }
}

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card { background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 8px; font: 26px var(--f-hand); font-weight: 700; }
.card label { display: block; font: 800 13px var(--f-body); margin-top: 8px; color: var(--mute); }
.mood { font: 28px var(--f-display); }
.moodDesc { margin: 2px 0 6px; font-weight: 700; }
.bar { height: 18px; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; background: #ebebeb; }
.bar i { display: block; height: 100%; width: 0; background: var(--lamp); transition: width .6s; }
.bar.happy i { background: var(--blush); }
.bar.room i { background: var(--cash); }
.lvl { font: 800 18px var(--f-body); }
.lvl b { font: 30px var(--f-display); }
.small { font-size: 14px; color: var(--mute); font-weight: 700; }
.stats { display: grid; grid-template-columns: auto auto; gap: 6px 10px; margin: 0; font-weight: 800; }
.stats dt { color: var(--mute); } .stats dd { margin: 0; text-align: right; font-family: var(--f-mono); }
.board { margin: 0; padding-left: 22px; font-weight: 800; }
.board li { display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 14px; }
.board .empty { color: var(--mute); font-family: var(--f-body); }
.feed { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-weight: 700; }
.feed li { padding: 5px 0; border-bottom: 2px dashed #ebebeb; display: flex; gap: 10px; }
.feed time { font: 13px var(--f-mono); color: var(--mute); flex: none; padding-top: 2px; }
.feed .buy { color: #2f8a2f; } .feed .sell { color: var(--red); }

footer { text-align: center; padding: 10px 16px 40px; font-weight: 800; }
footer p { font-weight: 600; font-size: 13px; color: var(--mute); }

dialog { border: 5px solid var(--ink); border-radius: 20px; box-shadow: 8px 9px 0 var(--ink); padding: 20px; max-width: 360px; width: calc(100% - 32px); }
dialog h3 { margin: 0 0 4px; font: 24px var(--f-display); }
#walletList { display: grid; gap: 8px; margin: 14px 0; }
#walletList button { display: flex; align-items: center; gap: 10px; font: 800 16px var(--f-body); background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
#walletList img { width: 26px; height: 26px; }
#nameStep[hidden], #walletList[hidden] { display: none; }
#walletErr.ok { color: #2f8a2f; }
#nameStep label { display: block; margin: 6px 0 8px; }
.nameRow { display: flex; gap: 8px; }
#nameInput { flex: 1; min-width: 0; font: 700 16px var(--f-body); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 10px; }
.err { color: var(--red); }

@media (max-width: 900px) { .panels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .panels { grid-template-columns: 1fr; }
  .brand { font-size: 19px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .top { padding: 12px; }
  .top-right { gap: 6px; }
  .btn.small { font-size: 12px; padding: 6px 9px; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); }
  .act .big { font-size: 24px; }
  .stage-wrap { border-width: 4px; border-radius: 14px; box-shadow: 5px 6px 0 var(--ink); }
}

/* stream mode: just the stage, filling the window */
body.stream { background: #000; overflow: hidden; }
body.stream .top, body.stream .actions, body.stream .hint, body.stream .panels, body.stream footer { display: none; }
body.stream main { max-width: none; padding: 0; display: block; }
body.stream .stage-wrap { border: 0; border-radius: 0; box-shadow: none; width: 100vw; height: 100vh; aspect-ratio: auto; }

/* ===================== Midnight theme (MEPE) =====================
   Midnight's own type (Outfit + DM Mono), black/navy surfaces, white text, Midnight-blue accents.
   Overrides the cartoon defaults above. */
:root {
  --f-display: "Outfit", system-ui, sans-serif; --f-body: "Outfit", system-ui, sans-serif;
  --f-hand: "Outfit", system-ui, sans-serif; --f-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --mid-bg: #05061a; --mid-card: rgba(14, 17, 48, .82); --mid-line: rgba(255, 255, 255, .12); --mid-text: #e8eaf3;
  --mid-mute: #8d93ab; --mid-blue: #0000f5; --mid-blue2: #2b44ff; --mid-ice: #b8c3ff; --mid-green: #45c96b;
}
body { background: radial-gradient(#ffffff1c 1px, transparent 1.4px) 0 0 / 30px 30px, radial-gradient(ellipse at 50% -10%, #131a6a 0, #05061a 60%) fixed; color: var(--mid-text); }
.brand { font: 800 26px var(--f-display); letter-spacing: -.02em; }
.brand img { border: 2px solid #fff; background: var(--mid-blue); }
.brand b { color: var(--mid-blue2); -webkit-text-stroke: 0; font-weight: 300; letter-spacing: .12em; font-size: .7em; vertical-align: 3px; }
.btn { font: 600 14px var(--f-body); letter-spacing: .04em; background: transparent; color: #fff; border: 1px solid var(--mid-line); border-radius: 999px; box-shadow: none; }
.btn.dark { background: var(--mid-blue); border-color: var(--mid-blue); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.stage-wrap { border: 1px solid var(--mid-line); border-radius: 20px; box-shadow: 0 0 0 1px #000, 0 30px 90px rgba(0, 0, 245, .25); background: #05061a; }

/* side + panels: dark glass cards */
.card, .actions, dialog { color: var(--mid-text); }
.card { background: var(--mid-card); border: 1px solid var(--mid-line); border-radius: 18px; box-shadow: none; backdrop-filter: blur(6px); }
.card h3 { font: 400 13px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mid-ice); }
.card label, .small, .stats dt, .goals .empty, .goals .queued, .board .empty, #chatList .empty, .card.chat h3 small, .feed time, footer p { color: var(--mid-mute); }
.mood, .lvl b { font: 600 28px var(--f-display); letter-spacing: -.02em; color: #fff; }
.bar, .gbar { border: 1px solid var(--mid-line); background: rgba(255, 255, 255, .06); }
.bar i, .bar.room i, .gbar i { background: linear-gradient(90deg, var(--mid-blue), var(--mid-blue2)); }
.bar.happy i { background: linear-gradient(90deg, #6f86ff, #b8c3ff); }
.feed li { border-bottom: 1px solid var(--mid-line); }
.feed .buy, .goals .done { color: var(--mid-green); }
#chatList b, #chatOverlay b { color: var(--mid-ice); }
#chatList li.wilde { background: rgba(0, 0, 245, .22); border: 1px solid rgba(91, 120, 255, .5); }
#chatList .tier, .toast .tier { background: var(--mid-blue); color: #fff; border: 0; }
#chatForm input, #nameInput { background: rgba(255, 255, 255, .05); color: #fff; border: 1px solid var(--mid-line); }
.act { background: var(--mid-card) !important; color: #fff; border: 1px solid var(--mid-line); box-shadow: none; }
.act .big { font: 800 30px var(--f-display); letter-spacing: .04em; }
.act small { color: var(--mid-mute); }
.act[data-act="slap"] .big { color: #ff6b8b; } .act[data-act="feed"] .big { color: #ffd27a; } .act[data-act="pet"] .big { color: var(--mid-ice); }
.act:active { transform: translateY(2px); box-shadow: none; }
dialog { background: #0b0d26; border: 1px solid var(--mid-line); box-shadow: 0 30px 80px #000; }
dialog h3 { font: 700 22px var(--f-display); }
#walletList button { background: rgba(255, 255, 255, .05); color: #fff; border: 1px solid var(--mid-line); }
footer a { color: var(--mid-ice); }

/* stream overlays */
.hud, #cta, #goalBox, .toast, #unmute, #cutCap, #bubble, #chatOverlay div { color: #fff; background: rgba(5, 6, 26, .86); border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 8px 30px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); }
.hud { font: 600 20px var(--f-body); }
#hudLive i { background: #ff3b5c; }
#hudMcap { font-family: var(--f-mono); } #hudMcap small { font: 400 13px var(--f-mono); letter-spacing: .14em; color: var(--mid-ice); }
#banner { font: 900 104px var(--f-display); letter-spacing: -.02em; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 0 30px rgba(43, 68, 255, .95), 0 0 80px rgba(0, 0, 245, .8), 0 6px 0 #000; }
.toast { font: 600 20px var(--f-body); border-radius: 12px; }
.toast b.buy { color: var(--mid-green); }
#goalBox { border-radius: 16px; }
#goalBox.done { background: rgba(0, 0, 245, .55); }
#goalBox.pick { background: rgba(5, 6, 26, .9); border-color: rgba(91, 120, 255, .7); }
#goalTitle { font: 600 19px/1.2 var(--f-body); }
#goalTitle b { font: 700 13px var(--f-mono); letter-spacing: .14em; color: var(--mid-ice); }
#goalMeta { font: 400 14px var(--f-mono); color: #c9cfe6; }
#cta { font: 600 22px var(--f-body); background: var(--mid-blue); border-color: #5b78ff; }
#ticker { background: #000; border-top: 1px solid var(--mid-line); }
.tk { font: 600 17px var(--f-body); border: 1px solid rgba(255, 255, 255, .5); }
.tk.buy { background: #1d7a43; } .tk.sell { background: #b3243f; }
.tk-wait { font: 400 15px var(--f-mono); color: var(--mid-mute); }
#bubble { border-radius: 22px; }
#bubble::after { background: rgba(5, 6, 26, .86); border-right: 1px solid rgba(255, 255, 255, .18); border-bottom: 1px solid rgba(255, 255, 255, .18); }
#bubbleReply { font: 400 15px var(--f-mono); color: var(--mid-ice); }
#bubbleText { font: 600 26px/1.22 var(--f-body); }
#chatOverlay div { font: 500 16px/1.25 var(--f-body); border-radius: 10px; }
#nowPlaying { font: 400 14px var(--f-mono); background: rgba(0, 0, 0, .7); border: 1px solid var(--mid-line); }
#cutCap { font: 700 40px var(--f-body); border-radius: 18px; }
#unmute { background: var(--mid-blue); }

/* MEPE-only stage pieces */
#mepeGreen { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
#blackout { width: 1280px; height: 720px; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--sx, 790px) var(--sy, 330px), transparent 0 150px, rgba(0, 0, 0, .55) 210px, #000 360px); }
#hudStreak { left: 18px; top: 74px; font: 700 18px var(--f-body); display: none; border-color: rgba(91, 120, 255, .6); }
#hudStreak.on { display: block; }
#hudStreak b { font-family: var(--f-mono); color: #9fb0ff; margin-left: 4px; }
#hudStreak.hot { background: rgba(0, 0, 245, .7); animation: pulse 1s infinite; }
#proof { position: absolute; left: 50%; top: 92px; transform: translateX(-50%) scale(.6); opacity: 0; z-index: 8; min-width: 330px; text-align: center; pointer-events: none;
  background: rgba(5, 6, 26, .92); border: 1px solid rgba(91, 120, 255, .7); border-radius: 16px; padding: 10px 22px 12px; box-shadow: 0 0 40px rgba(0, 0, 245, .45); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.5, .4, 1); }
#proof.on { opacity: 1; transform: translateX(-50%) scale(1); }
.pf-top { font: 400 12px var(--f-mono); letter-spacing: .22em; color: var(--mid-ice); }
.pf-name { font: 700 30px var(--f-mono); color: #fff; margin: 2px 0; white-space: nowrap; }
.pf-meta { font: 500 17px var(--f-body); color: var(--mid-green); }
.pf-ok { font: 500 12px var(--f-mono); letter-spacing: .18em; color: #fff; background: var(--mid-blue); border-radius: 999px; display: inline-block; padding: 2px 10px; margin-top: 6px; opacity: 0; transition: opacity .3s; }
#proof.ok .pf-ok { opacity: 1; }
#constellation text { font: 600 13px var(--f-mono); fill: #e3e9ff; letter-spacing: .04em; }
#constellation .fresh { animation: starIn 2.4s ease-out; }
@keyframes starIn { from { opacity: 0; } 30% { opacity: 1; fill: #fff; } }

/* ===================== MEPE layout (night-shift console) ===================== */
.top { max-width: 1560px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand .mk { width: 30px; height: 30px; color: #fff; }
.brand .wm { font: 600 28px var(--f-display); letter-spacing: -.03em; }
.brand .sub { font: 400 12px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mid-ice); border-left: 1px solid var(--mid-line); padding-left: 10px; }
.pill { font: 500 13px var(--f-body); letter-spacing: .03em; color: #fff; background: transparent; border: 1px solid var(--mid-line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.pill:hover { border-color: rgba(255, 255, 255, .4); }
.pill.solid { background: var(--mid-blue); border-color: var(--mid-blue); }
.pill.holder, #walletBtn.holder { background: transparent; border-color: var(--mid-green); color: var(--mid-green); }

/* dock | stage | channel */
main { max-width: 1560px; grid-template-columns: 150px minmax(0, 1fr) 340px; column-gap: 16px;
  grid-template-areas: "dock stage chat" "hint hint chat" "panels panels panels"; }
.actions { grid-area: dock; flex-direction: column; justify-content: flex-start; margin: 0; gap: 10px; }
.act { max-width: none; flex: none; align-items: flex-start; text-align: left; gap: 4px; padding: 14px 12px; border-radius: 16px; transition: border-color .2s, background .2s; }
.act:hover { border-color: rgba(91, 120, 255, .7); background: rgba(0, 0, 245, .16) !important; }
.act .ic { width: 30px; height: 30px; }
.act[data-act="expose"] .ic { color: #fff2b0; } .act[data-act="coffee"] .ic { color: #fff; } .act[data-act="secret"] .ic { color: #9fb0ff; }
.act .big { font: 700 18px var(--f-display); letter-spacing: .12em; color: #fff !important; }
.act .what { font: 400 12px var(--f-body); color: var(--mid-mute); line-height: 1.25; }
.act small { font: 400 12px var(--f-mono); color: var(--mid-ice); margin-top: 4px; }
.hint { font: 400 13px var(--f-mono); color: var(--mid-mute); text-align: left; margin: 12px 0 18px; }
.hint b { color: var(--mid-ice); font-weight: 500; }

/* the shielded channel: a terminal */
.card.chat { background: #03040f; border-color: rgba(91, 120, 255, .35); padding: 0; overflow: hidden; margin-bottom: 0; }
.ch-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--mid-line); background: rgba(0, 0, 245, .12); }
.ch-title { display: flex; align-items: center; gap: 8px; font: 500 12px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: #fff; }
.ch-title .mk { width: 16px; height: 16px; }
.ch-state { font: 400 11px var(--f-mono); color: var(--mid-green); letter-spacing: .08em; display: flex; align-items: center; gap: 6px; }
.ch-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--mid-green); box-shadow: 0 0 8px var(--mid-green); }
#brainNote { display: block; padding: 0 14px; font: 400 11px var(--f-mono); color: var(--mid-mute); }
#chatList { padding: 10px 14px; margin: 0; gap: 4px; font: 400 14px/1.45 var(--f-mono); }
#chatList li { padding: 2px 0; }
#chatList li b { font-weight: 500; }
#chatList li.wilde { background: none; border: 0; border-left: 2px solid var(--mid-blue2); padding: 4px 0 4px 10px; color: #fff; }
#chatList li.wilde b { color: #9fb0ff; }
#chatGate, #chatForm, .card.chat .err { padding: 0 14px 14px; }
#chatForm { align-items: center; border-top: 1px solid var(--mid-line); padding-top: 12px; gap: 8px; }
#chatForm .prompt { font: 500 16px var(--f-mono); color: var(--mid-blue2); }
#chatForm input { font: 400 14px var(--f-mono); background: transparent; border: 0; border-bottom: 1px solid var(--mid-line); border-radius: 0; padding: 6px 2px; }
#chatForm input:focus { outline: none; border-bottom-color: var(--mid-blue2); }

/* status board */
.panels { margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { border-radius: 14px; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 6px; height: 6px; background: var(--mid-blue2); border-radius: 1px; }

/* proof dialog */
.dlg-steps { display: flex; gap: 6px; margin-bottom: 12px; }
.dlg-steps span { font: 400 11px var(--f-mono); letter-spacing: .06em; color: var(--mid-mute); border: 1px solid var(--mid-line); border-radius: 999px; padding: 3px 9px; }
.dlg-steps span.on { color: #fff; border-color: var(--mid-blue2); background: rgba(0, 0, 245, .3); }
#walletErr.ok { color: var(--mid-green); }

@media (max-width: 1100px) {
  main { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "stage chat" "dock chat" "hint hint" "panels panels"; }
  .actions { flex-direction: row; margin-top: 14px; } .act { flex: 1; }
}
@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "dock" "hint" "chat" "panels"; }
  .act .what { display: none; }
}

/* ---- stream overlay layout ---- */
#hudLive { left: 18px; top: 18px; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; border-radius: 16px; font: 500 15px var(--f-body); }
#hudLive .mk { width: 34px; height: 34px; color: #fff; }
#hudLive .st { display: flex; flex-direction: column; font: 700 20px/1 var(--f-display); letter-spacing: -.02em; }
#hudLive .st small { font: 400 10px var(--f-mono); letter-spacing: .2em; color: var(--mid-ice); margin-top: 3px; }
#hudLive .live { display: flex; align-items: center; gap: 6px; border-left: 1px solid var(--mid-line); padding-left: 12px; font: 400 14px var(--f-mono); }
#hudMcap { right: 18px; top: 18px; padding: 10px 14px; border-radius: 14px; display: grid; gap: 4px; min-width: 210px; font: 400 14px var(--f-mono); }
#hudMcap > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
#hudMcap small { font: 400 11px var(--f-mono); letter-spacing: .16em; color: var(--mid-ice); }
#hudMcap b { font: 500 18px var(--f-mono); color: #fff; }
#hudStreak { position: static; display: none !important; background: none; border: 0; box-shadow: none; padding: 0; animation: none; }
#hudStreak.on { display: flex !important; }
#hudStreak.hot b { color: #ffd27a; text-shadow: 0 0 10px rgba(255, 210, 122, .8); }
#goalBox { left: auto; right: 18px; top: 150px; bottom: auto; transform: none; width: 300px; display: none; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; }
#goalBox.on { display: flex; }
#goalBox.done { animation: goalGlow .9s ease-in-out infinite alternate; }
@keyframes goalGlow { to { box-shadow: 0 0 40px rgba(43, 68, 255, .9); } }
#goalBox .ring { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
#goalBox .ring rect { fill: #fff; transform-origin: 32px 32px; transform: rotate(90deg); }
#goalBox .rbg { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 5; }
#goalBox .rfg { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .6s; filter: drop-shadow(0 0 4px rgba(120, 140, 255, .9)); }
#goalBox .gtxt { min-width: 0; flex: 1; }
#goalBox .gbar { display: none; }
#goalTitle { white-space: normal; font: 600 16px/1.2 var(--f-body); }
#goalTitle b { display: block; margin: 0 0 2px; }
#goalMeta { white-space: normal; font: 400 12px/1.35 var(--f-mono); margin-top: 3px; }
#chatOverlay { left: 18px; right: auto; top: 330px; width: 262px; max-height: 210px; }   /* stream chat on the left (user) */
#chatOverlay div { font: 400 14px/1.3 var(--f-mono); border-radius: 8px; padding: 4px 9px; }
#toasts { top: 92px; bottom: auto; flex-direction: column; }
.toast { font: 500 17px var(--f-body); max-width: 340px; }
#cta { left: 18px; right: auto; bottom: 58px; display: none; flex-direction: column; padding: 6px 14px; border-radius: 12px; font: 600 19px var(--f-body); }
body.stream #cta { display: flex; }
#cta small { font: 400 10px var(--f-mono); letter-spacing: .2em; color: #dfe6ff; }
#nowPlaying { top: auto; bottom: 58px; right: 18px; }
#tickerLab { position: absolute; left: 0; bottom: 0; height: 46px; width: 92px; z-index: 9; display: grid; place-items: center; background: var(--mid-blue); color: #fff; font: 500 12px var(--f-mono); letter-spacing: .22em; }
#ticker { padding-left: 104px; }
.tk { font: 400 15px var(--f-mono); border-radius: 6px; }
/* EXPOSE: an interrogation lamp drops from the ceiling; its cone shines straight down on him (room goes dark via #blackout) */
#flashlight { width: 1280px; height: 720px; z-index: 8; opacity: 0; pointer-events: none; }
#flashlight .beam { position: absolute; inset: 0; mix-blend-mode: screen; filter: blur(16px);
  background: linear-gradient(180deg, rgba(255, 248, 220, .55) 0%, rgba(255, 248, 220, .16) 30%, rgba(255, 248, 220, .07) 60%, rgba(255, 248, 220, .04) 100%);
  clip-path: polygon(768px 96px, 812px 96px, 1010px 600px, 570px 600px); }
#flashlight .glow { position: absolute; left: 600px; top: 150px; width: 380px; height: 380px; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 248, 220, .22), transparent); }
#stage.exposing #bubble { opacity: .2; transition: opacity .2s; }
#flashlight .pool { position: absolute; left: 540px; top: 520px; width: 500px; height: 70px; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 248, 220, .45), transparent); }
#flashlight .lamp { position: absolute; left: 790px; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#flashlight .lamp i { position: absolute; left: -2px; top: 0; width: 4px; height: 58px; background: #1a1c33; }
#flashlight .lamp b { position: absolute; left: -46px; top: 54px; width: 92px; height: 42px; background: #22264d; border: 4px solid #0b0b16;
  border-radius: 46px 46px 8px 8px; box-shadow: inset 0 -10px 0 #2f3466; }
#flashlight .lamp b::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -10px; height: 12px; border-radius: 0 0 50% 50%;
  background: #fff8dc; box-shadow: 0 0 28px 10px rgba(255, 248, 220, .8); }
#envelope { display: none; z-index: 4; }
.dlg-steps span { white-space: nowrap; }
.feed .tier, #chatList .tier { margin: 0 4px; font: 400 10px var(--f-mono); padding: 1px 5px; border-radius: 4px; }
.pill { white-space: nowrap; }
@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 8px; }
  .brand .sub { display: none; }
  .top-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .pill { font-size: 12px; padding: 6px 10px; }
}

/* ---- the three MEPEs on the night shift (shift change) ---- */
.form3d { position: absolute; display: none; pointer-events: none; }
.form3d img { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
.form3d .greenimg, #mepeGreen { opacity: 0; transition: opacity 1.2s; }
#formClay { left: 6px; top: 6px; width: 428px; }
#formClay img:not(.irlf) { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
#formIrl { left: -93px; top: -108px; width: 575px; }   /* seated, folded hands resting on the desk edge */
#world[data-form="irl"] #kbd { display: none; }       /* standing behind the desk, waist down hidden */
#formIrl img:not(.irlf) { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6)); }
#wilde.form-clay #formClay, #wilde.form-irl #formIrl { display: block; }
#wilde.form-clay #wildeFront, #wilde.form-clay #mepeGreen, #wilde.form-clay #face,
#wilde.form-irl #wildeFront, #wilde.form-irl #mepeGreen, #wilde.form-irl #face { display: none; }

/* ---- wallet: buy prompt + disconnect ---- */
.buyBox { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid rgba(91, 120, 255, .45); background: rgba(0, 0, 245, .12); }
.buyBox p { margin: 0 0 10px; }
.buyRow { display: flex; flex-wrap: wrap; gap: 8px; }
.buyRow a { text-decoration: none; }
.dlgRow { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.dlgRow form { margin: 0; }
#logoutBtn { color: #ff8fa6; border-color: rgba(255, 107, 139, .45); }

/* two laptops: $MEPE (left) and NIGHT (right) */
#monitor { top: 326px; }
#monitor2 { left: 967px; top: 359px; width: 222px; height: 140px; border-radius: 6px; overflow: hidden; }
#chart2 { display: block; }
/* Midnight logo clock: the three dots tick around like a hand */
#clockHand { transform-box: view-box; transform-origin: 150px 167px; transition: transform .4s cubic-bezier(.3, 1.9, .5, 1); }

/* irl MEPE: talking/blinking head frames over the seated render (same pixel space) */
.form3d img.irlf { display: none; height: auto; }   /* left/top/width set by app.js from irl-frames.js */
.form3d[data-f="talk1"] img.irlf[data-f="talk1"], .form3d[data-f="talk2"] img.irlf[data-f="talk2"], .form3d[data-f="blink"] img.irlf[data-f="blink"] { display: block; }

#fxBack { pointer-events: none; }
