/* VIBE SHIFT — the whole game is a parody IDE window.
   Palette = syntax highlighting on deep indigo; tags map to token colors. */

:root {
  --bg: #100e1c;
  --panel: #1a1729;
  --panel-2: #231f37;
  --line: #322d4d;
  --text: #ece8ff;
  --dim: #9a93c2;
  --faint: #6a6391;
  --cash: #7dffaf;
  --danger: #ff5c7a;
  --warn: #ffcc4d;
  --brand: #6f4dff;
  --brand-2: #8f73ff;
  --tag-UI: #ff6ac1;
  --tag-API: #5ce1ff;
  --tag-GAME: #ffd84d;
  --tag-AGENT: #b49cff;
  --tag-DATA: #7dffaf;
  --tag-MOBILE: #ff9f5c;
  --hype: linear-gradient(115deg, #ff6ac1, #ffd84d 35%, #5ce1ff 65%, #b49cff);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Unbounded', system-ui, sans-serif;
  --r: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(111, 77, 255, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(255, 106, 193, 0.10), transparent 70%),
    #07060d;
  color: var(--text);
  font: 400 12px/1.35 var(--mono);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--warn); outline-offset: 2px; }

#stage { position: fixed; inset: 0; display: grid; place-items: center; }
#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
  will-change: transform;
}
@media (min-width: 560px) and (min-height: 700px) {
  #app {
    height: min(100dvh - 40px, 960px);
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  }
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ------------------------------------------------------------ titlebar */
#titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(44px + var(--safe-t));
  padding: var(--safe-t) 4px 0 12px;
  background: #0c0a16;
  border-bottom: 1px solid var(--line);
}
.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
#tb-file { flex: 1; min-width: 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
#tb-clock { font-weight: 800; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; }
#tb-clock.late { color: var(--warn); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--dim); font-size: 14px; border-radius: 8px; }
.icon-btn:active { background: var(--panel-2); }
.icon-btn.off { opacity: 0.4; text-decoration: line-through; }

/* ------------------------------------------------------------ statusbar */
#statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(30px + var(--safe-b));
  padding: 0 10px var(--safe-b);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
#statusbar .sb-branch { opacity: 0.8; }
#statusbar .sb-cash { font-weight: 800; font-size: 13px; }
#statusbar .sb-cash.neg { color: #ffd0d8; animation: blink 0.6s steps(2) infinite; }
#statusbar .sb-burn { opacity: 0.75; }
#statusbar .sb-val { margin-left: auto; font-weight: 800; font-size: 13px; }
#statusbar .sb-mult { opacity: 0.85; }
#statusbar .sb-flags { display: inline-flex; gap: 6px; }
#statusbar .sb-flag { padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.25); font-weight: 700; }
#statusbar .sb-flag.peak { background: var(--warn); color: #1a1300; }
#statusbar .sb-flag.yolo { background: var(--danger); }
.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes blink { 50% { opacity: 0.45; } }

/* ------------------------------------------------------------ screen */
#screen { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#overlay { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
#overlay > * { pointer-events: auto; }

/* run layout */
.run { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 4px;
  overflow: hidden;
}
.inbox { flex: 0 0 auto; height: 18px; color: var(--faint); font-size: 11px; padding: 0 4px; }
.inbox b { color: var(--warn); }

/* ------------------------------------------------------------ ticket */
.ticket {
  position: relative;
  flex: 1 1 96px;
  min-height: 74px;
  max-height: 118px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 3px;
  padding: 7px 9px 7px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.ticket::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--faint)); }
.ticket.enter { animation: ticket-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes ticket-in { from { transform: translateY(-14px) scale(0.96); opacity: 0; } }
.ticket.urgent { border-color: rgba(255, 92, 122, 0.55); }
.ticket.stalled { background: #2a1422; border-color: var(--danger); }
.ticket.target { border-color: var(--warn); background: var(--panel-2); transform: scale(1.015); }
.ticket.vip { box-shadow: 0 0 0 1px var(--warn) inset; }
.ticket .t-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ticket .t-emoji { font-size: 13px; }
.ticket .t-title { flex: 1; min-width: 0; font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket .t-pay { color: var(--cash); font-weight: 800; font-size: 12px; }
.ticket .t-meta { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--dim); font-size: 11px; }
.ticket .t-client { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 5px; border-radius: 4px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.size { padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); font-size: 11px; font-weight: 700; }
.ring {
  margin-left: auto; flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(var(--rc, var(--cash)) calc(var(--p, 1) * 360deg), var(--line) 0);
  display: grid; place-items: center;
}
.ring::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); }
.ticket .t-code {
  align-self: center;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.ticket .t-code::before { content: '> '; color: var(--brand-2); }
.ticket .t-code.quirk { color: var(--warn); }
.ticket .t-code.idle { color: var(--faint); font-style: italic; }
.ticket .t-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ticket .t-model { flex: 0 0 auto; max-width: 46%; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket .t-model i { font-style: normal; color: var(--mc); }
.bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--mc, var(--brand-2)); border-radius: 3px; }
.ticket.stalled .bar > i { background: var(--danger); }
.ticket .t-pct { width: 32px; text-align: right; color: var(--dim); font-size: 11px; }
.fitbadge {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 4px 8px; border-radius: 6px; font-weight: 800; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); pointer-events: none; z-index: 3;
}
.fitbadge.good { color: var(--cash); border-color: var(--cash); }
.fitbadge.bad { color: var(--danger); border-color: var(--danger); }
.fitbadge.ok { color: var(--warn); border-color: var(--warn); }
.fitbadge.unknown { color: var(--dim); }

.chip-act {
  position: absolute; right: 6px; bottom: 6px; z-index: 4;
  min-height: 44px; padding: 0 14px; border-radius: 8px;
  font-weight: 800; font-size: 12px; color: #120c00; background: var(--warn);
  box-shadow: 0 4px 18px rgba(255, 204, 77, 0.35);
  animation: pulse 0.7s ease-in-out infinite alternate;
}
.chip-act.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 18px rgba(255, 92, 122, 0.4); }
.chip-act.ok { background: var(--cash); }
@keyframes pulse { to { transform: scale(1.06); } }

/* bugs */
.bug {
  position: absolute; z-index: 5;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: grid; place-items: center;
  color: var(--danger);
  touch-action: none;
}
.bug svg { width: 22px; height: 22px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); animation: crawl 0.5s steps(2) infinite alternate; }
.bug.big svg { width: 28px; height: 28px; color: #ff2d55; }
.bug.hurt svg { color: var(--warn); }
.bug.new svg { animation: bug-in 0.3s ease-out, crawl 0.5s steps(2) infinite alternate 0.3s; }
@keyframes crawl { to { transform: rotate(14deg) translateX(2px); } }
@keyframes bug-in { from { transform: scale(0) rotate(-90deg); } }

/* boss */
.ticket.boss {
  flex: 0 0 auto; max-height: none; min-height: 112px;
  background: linear-gradient(135deg, #2b1640, #1a1729 60%);
  border-color: var(--tag-AGENT);
}
.ticket.boss::before { background: var(--hype); width: 5px; }
.ticket.boss .t-title { font-family: var(--display); font-weight: 900; font-size: 15px; letter-spacing: 0.01em; }
.stages { display: flex; gap: 4px; }
.stages span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.stages span.done { background: var(--cash); }
.stages span.now { background: var(--warn); animation: blink 0.8s steps(2) infinite; }

/* ------------------------------------------------------------ feed */
.feed { position: relative; flex: 0 0 52px; height: 52px; z-index: 20; }
.feed .toast { position: absolute; inset: 0; }
.ticker {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  border: 1px dashed var(--line); border-radius: var(--r); color: var(--faint); font-size: 11px; overflow: hidden; white-space: nowrap;
}
.ticker b { color: var(--dim); flex: 0 0 auto; }
.ticker .tk { flex: 1; min-width: 0; overflow: hidden; }
.ticker span { display: inline-block; animation: ticker 16s linear infinite; padding-left: 100%; }
@keyframes ticker { to { transform: translateX(-100%); } }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 8px 6px 10px;
  background: rgba(35, 31, 55, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
  backdrop-filter: blur(6px);
}
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(-16px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-12px); opacity: 0; } }
.toast .src { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .msg { font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast .body { flex: 1; min-width: 0; }
.toast .glyph { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; background: var(--panel); color: var(--gc, var(--text)); }
.toast.launch { border-color: transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--hype) border-box; border: 1.5px solid transparent; }
.toast.launch .msg b { color: var(--text); }
.toast.bad { border-color: rgba(255, 92, 122, 0.6); }
.toast.good { border-color: rgba(125, 255, 175, 0.5); }
.toast.intro { background: #ffcc4d; color: #1a1300; border: 0; }
.toast.intro .src { color: #5c4a00; font-weight: 800; }
.toast .add {
  flex: 0 0 auto; min-width: 64px; min-height: 44px; padding: 0 12px;
  border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 800;
}
.toast .add:active { transform: scale(0.95); }

/* ------------------------------------------------------------ controls */
.controls { flex: 0 0 auto; padding: 4px 8px 8px; border-top: 1px solid var(--line); background: #13111f; }
.powers { display: flex; gap: 6px; margin-bottom: 6px; overflow: hidden; }
.pw {
  min-width: 44px; height: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 8px; background: var(--panel); border: 1px solid var(--line);
  font-weight: 800; font-size: 12px;
}
.pw .n { color: var(--dim); }
.pw.armed { border-color: var(--warn); color: var(--warn); }
.pw.empty { opacity: 0.35; }
.pw.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.pw.work.on { background: #1e6bff; border-color: #1e6bff; }
.pw .itbar { width: 26px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pw .itbar i { display: block; height: 100%; background: var(--danger); transform-origin: left; transform: scaleX(var(--p, 0)); }
.powers .spacer { flex: 1; }

.dock { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px; }
.model {
  position: relative;
  height: 104px;
  padding: 8px 7px 7px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  overflow: hidden;
  touch-action: none;
  transition: transform 0.12s, border-color 0.12s, opacity 0.15s;
}
.model::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--mc); }
.model .m-head { display: flex; align-items: center; justify-content: space-between; }
.model .m-glyph { font-size: 15px; color: var(--mc); line-height: 1; }
.model .m-price { font-size: 11px; color: var(--dim); }
.model .m-price.free { color: var(--cash); }
.model .m-l1 { font-weight: 800; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model .m-l2 { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model .m-skills { display: flex; gap: 2px; align-items: flex-end; height: 12px; margin-top: auto; }
.model .m-skills i { flex: 1; height: var(--h, 2px); border-radius: 1px; background: var(--c); opacity: 0.9; }
.model .m-skills i.unk { height: 12px; background: transparent; border: 1px dashed color-mix(in srgb, var(--c) 45%, transparent); opacity: 0.6; }
.model .m-skills i.stale { opacity: 0.35; }
.model .meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 3px; }
.model .meter i { display: block; height: 100%; background: var(--tag-API); transform-origin: left; transform: scaleX(var(--p, 1)); }
.model .meter.low i { background: var(--warn); }
.model .meter.empty i { background: var(--danger); }
.model.sel { border-color: var(--warn); transform: translateY(-6px); box-shadow: 0 10px 24px rgba(255, 204, 77, 0.2); }
.model.busy { opacity: 0.55; }
.model.swap { border-color: var(--danger); animation: pulse 0.5s ease-in-out infinite alternate; }
.model .m-state {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px;
  font-size: 11px; font-weight: 800; text-align: center;
  background: rgba(16, 14, 28, 0.92); color: var(--warn);
}
.model .m-state.err { color: var(--danger); }
.model .m-state.dep { color: #fff; background: var(--danger); }
.model.hype { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--hype) border-box; border: 1.5px solid transparent; }
.model.hype::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.14) 45%, transparent 60%);
  background-size: 250% 100%; animation: holo 2.2s linear infinite;
}
@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.model .m-badge { position: absolute; right: 5px; top: 22px; padding: 0 4px; border-radius: 3px; font-size: 11px; font-weight: 800; color: #1a1300; background: var(--hype); }

.drag-ghost {
  position: fixed; z-index: 70; pointer-events: none;
  will-change: transform; transition: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.hand { position: absolute; z-index: 30; font-size: 30px; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }

/* ------------------------------------------------------------ chaos */
.chaos-panel {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 25;
  padding: 14px; border-radius: 12px;
  background: #1b0710; border: 1.5px solid var(--danger);
  box-shadow: 0 0 0 9999px rgba(40, 0, 10, 0.35), 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.2s ease-out;
}
.chaos-panel.leak { background: #1d1400; border-color: var(--warn); box-shadow: 0 0 0 9999px rgba(40, 28, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.6); }
.chaos-panel.leak h3 { color: var(--warn); }
.chaos-panel.leak p { color: #ffe3a3; }
.chaos-panel.leak .mash { background: var(--warn); color: #1a1300; }
.chaos-panel h3 { font-family: var(--mono); font-weight: 800; color: var(--danger); font-size: 15px; margin-bottom: 4px; }
.chaos-panel p { color: #ffb3c1; font-size: 12px; margin-bottom: 10px; }
.chaos-panel .mash { width: 100%; min-height: 64px; border-radius: 10px; background: var(--danger); color: #fff; font-family: var(--display); font-weight: 900; font-size: 18px; }
.chaos-panel .mash:active { transform: scale(0.97); }
.pips { display: flex; gap: 4px; margin-top: 8px; }
.pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 92, 122, 0.25); }
.pips i.on { background: var(--cash); }
.chaos-panel .timer { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.chaos-panel .timer i { display: block; height: 100%; background: var(--warn); transform-origin: left; transform: scaleX(var(--p, 1)); }
.bot {
  position: absolute; z-index: 26; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  display: grid; place-items: center; font-size: 24px; touch-action: none;
  animation: bot-bob 0.35s ease-in-out infinite alternate;
}
.bot::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid rgba(255, 92, 122, 0.7); }
@keyframes bot-bob { to { transform: translateY(-4px) rotate(8deg); } }

.bankrupt {
  position: absolute; inset: 0; z-index: 35; pointer-events: none;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255, 92, 122, 0.12), rgba(255, 92, 122, 0.3));
  animation: blink 0.5s steps(2) infinite;
}
.bankrupt b { font-family: var(--display); font-weight: 900; font-size: 30px; color: #fff; text-shadow: 0 4px 0 var(--danger), 0 0 40px var(--danger); text-align: center; }

/* ------------------------------------------------------------ juice */
.popup {
  position: fixed; z-index: 65; pointer-events: none;
  font-weight: 800; font-size: 14px; color: var(--cash);
  text-shadow: 0 2px 0 #000, 0 0 2px #000;
  animation: pop-up 0.95s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  white-space: nowrap;
}
.popup.big { font-family: var(--display); font-size: 22px; }
.popup.bad { color: var(--danger); }
.popup.warn { color: var(--warn); }
@keyframes pop-up {
  0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
  15% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -54px) scale(1); opacity: 0; }
}
.stamp {
  position: absolute; left: 50%; top: 50%; z-index: 8; pointer-events: none;
  padding: 4px 12px; border: 3px solid currentColor; border-radius: 8px;
  font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: 0.04em;
  color: var(--cash); background: rgba(16, 14, 28, 0.85);
  animation: stamp 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
.stamp.bad { color: var(--danger); }
.stamp.warn { color: var(--warn); }
@keyframes stamp {
  0% { transform: translate(-50%, -50%) scale(2.6) rotate(-14deg); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(0.95) rotate(-8deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
}
.ticket.leaving { animation: ship-out 0.5s 0.25s cubic-bezier(0.5, 0, 0.8, 0.5) forwards; }
.ticket.leaving.bad { animation-name: fail-out; }
@keyframes ship-out { to { transform: translateX(110%) rotate(6deg); opacity: 0; } }
@keyframes fail-out { 30% { transform: translateX(-6px); } 60% { transform: translateX(6px); } to { transform: translateY(40px) rotate(-6deg); opacity: 0; } }
.shake-x { animation: shake-x 0.3s; }
@keyframes shake-x { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.combo {
  position: absolute; right: 12px; bottom: 6px; z-index: 22; pointer-events: none;
  font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--warn);
  text-shadow: 0 2px 0 #000;
}

/* ------------------------------------------------------------ sheets */
.sheet {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: rgba(16, 14, 28, 0.97);
  overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 18px 16px calc(18px + var(--safe-b));
  animation: sheet-in 0.25s ease-out;
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } }
.sheet h2 { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.1; margin-bottom: 4px; }
.sheet .sub { color: var(--dim); margin-bottom: 14px; font-size: 12px; }
.sheet .section { margin: 16px 0 8px; color: var(--dim); font-size: 11px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-family: var(--display); font-weight: 900; font-size: 15px; letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.98); }
.btn.alt { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-family: var(--mono); font-weight: 800; font-size: 13px; }
.btn.brand { background: var(--brand); color: #fff; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1; }
.link { color: var(--dim); text-decoration: underline; min-height: 44px; padding: 0 8px; }

/* title */
.title-screen { justify-content: center; text-align: center; background: radial-gradient(ellipse 90% 60% at 50% 30%, rgba(111, 77, 255, 0.25), transparent 70%), var(--bg); }
.logo { font-family: var(--display); font-weight: 900; font-size: clamp(44px, 15vw, 72px); line-height: 0.92; letter-spacing: -0.01em; }
.logo span { display: block; }
.logo .shift { color: var(--text); text-shadow: 5px 5px 0 var(--tag-UI), 10px 10px 0 rgba(92, 225, 255, 0.55); animation: glitch 3.6s steps(1) infinite; }
@keyframes glitch { 0%, 86%, 100% { text-shadow: 5px 5px 0 var(--tag-UI), 10px 10px 0 rgba(92, 225, 255, 0.55); transform: none; } 88% { text-shadow: -6px 3px 0 var(--tag-API), 6px -3px 0 var(--tag-UI); transform: translateX(3px); } 91% { text-shadow: 8px -2px 0 var(--tag-GAME), -4px 4px 0 var(--tag-AGENT); transform: translateX(-2px); } }
.tagline { margin: 16px 0 26px; color: var(--warn); font-size: 13px; }
.tagline::before { content: '“'; } .tagline::after { content: '”'; }
.term { margin: 0 auto 22px; max-width: 340px; text-align: left; color: var(--dim); font-size: 11px; line-height: 1.6; min-height: 72px; }
.term .ok { color: var(--cash); } .term .err { color: var(--danger); }
.clockin { font-size: 20px; min-height: 64px; background: var(--hype); color: #120c00; box-shadow: 0 10px 40px rgba(255, 106, 193, 0.3); }
.title-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.title-foot { margin-top: 22px; color: var(--faint); font-size: 11px; }
.title-foot b { color: var(--dim); }
.streak { color: var(--warn); font-weight: 800; }

/* standup */
.ledger { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-size: 12px; }
.ledger div { display: flex; justify-content: space-between; padding: 3px 0; }
.ledger .pos { color: var(--cash); } .ledger .neg { color: var(--danger); }
.ledger .total { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 7px; font-weight: 800; }
.headline { margin: 12px 0 2px; padding: 10px 12px; border-left: 3px solid var(--warn); background: var(--panel); color: var(--text); font-size: 12px; }
.perks { display: grid; gap: 8px; }
.perk {
  display: block; width: 100%; text-align: left;
  min-height: 64px; padding: 12px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line);
}
.perk b { display: block; font-size: 13px; margin-bottom: 2px; }
.perk span { color: var(--dim); font-size: 12px; }
.perk.picked { border-color: var(--cash); background: #14261d; }
.perk:disabled:not(.picked) { opacity: 0.4; }

/* game over */
.big-num { font-family: var(--display); font-weight: 900; font-size: clamp(36px, 12vw, 54px); line-height: 1; margin: 6px 0; }
.cause { color: var(--danger); font-size: 13px; margin-bottom: 10px; }
.cause.win { color: var(--cash); }
.mini-grid { display: flex; flex-direction: column; gap: 3px; margin: 10px 0; }
.mini-grid div { display: flex; gap: 3px; align-items: center; }
.mini-grid em { width: 14px; color: var(--faint); font-style: normal; font-size: 11px; }
.mini-grid i { width: 14px; height: 14px; border-radius: 3px; }
.g-G { background: var(--cash); } .g-Y { background: var(--warn); } .g-R { background: var(--danger); }
.g-W { background: var(--tag-AGENT); } .g-L { background: #5a1022; border: 1px solid var(--danger); }
.goal { margin: 6px 0; }
.goal .gl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.goal .gb { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.goal .gb i { display: block; height: 100%; background: var(--brand-2); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.8s ease-out; }
.unlock-card {
  margin: 10px 0; padding: 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--hype) border-box; border: 2px solid transparent;
  animation: unlock-in 0.6s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.unlock-card .u-kind { color: var(--dim); font-size: 11px; }
.unlock-card .u-name { font-family: var(--display); font-weight: 900; font-size: 18px; margin: 4px 0; }
.unlock-card .u-desc { color: var(--dim); font-size: 12px; }
@keyframes unlock-in { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } }
.reel { height: 22px; overflow: hidden; font-family: var(--display); font-weight: 900; font-size: 18px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.stat b { display: block; font-size: 15px; }
.stat span { color: var(--dim); font-size: 11px; }
.board-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.board-list div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.board-list .me { color: var(--warn); font-weight: 800; }
.badge-inj { margin: 10px 0; padding: 10px; border-radius: 8px; background: #2a1422; border: 1px solid var(--danger); color: var(--danger); font-weight: 800; text-align: center; }
.input {
  width: 100%; min-height: 48px; padding: 0 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font: 700 14px var(--mono); -webkit-user-select: text; user-select: text;
}

/* desk / zoo */
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  min-height: 56px; padding: 10px 12px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line);
}
.opt .oi { font-size: 20px; width: 26px; text-align: center; }
.opt b { display: block; font-size: 12px; }
.opt span { color: var(--dim); font-size: 11px; }
.opt.on { border-color: var(--cash); background: #14261d; }
.opt.locked { opacity: 0.45; }
.zoo-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.zoo-row .zg { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--panel); color: var(--zc); font-size: 15px; }
.zoo-row .zn { flex: 1; min-width: 0; }
.zoo-row .zn b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoo-row .zn span { color: var(--dim); font-size: 11px; }
.zoo-row .zs { color: var(--cash); font-weight: 800; font-size: 12px; }
.check { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.check .ck { width: 18px; color: var(--faint); }
.check.done .ck { color: var(--cash); }
.check span { color: var(--dim); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); }
.switch { width: 68px; height: 44px; border-radius: 22px; background: var(--line); position: relative; }
.switch::after { content: ''; position: absolute; top: 5px; left: 5px; width: 34px; height: 34px; border-radius: 50%; background: var(--dim); transition: transform 0.15s; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(24px); background: #fff; }

.pause-sheet { justify-content: center; text-align: center; background: rgba(8, 7, 14, 0.96); }

/* ------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.calm *, .calm *::before, .calm *::after { animation-iteration-count: 1 !important; }
#screen.paused .run { filter: blur(14px) saturate(0.6); }

.model.offer { background: linear-gradient(#1f1a33, #1f1a33) padding-box, var(--hype) border-box; border: 1.5px dashed transparent; }
.model.offer .m-add { margin-top: auto; text-align: center; padding: 3px 0; border-radius: 6px; background: var(--text); color: var(--bg); font-weight: 800; font-size: 11px; }
.model.offer .m-claim { font-size: 11px; color: var(--warn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model.offer .ttl { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--warn); transform-origin: left; transform: scaleX(var(--p, 1)); width: 100%; }
