/* MO: FUNCTIONAL — UI shell
   Palette: sickly CRT green, nicotine amber, Addison gold. */

:root {
  --ink: #0a0d0b;
  --ink-2: #111713;
  --ink-3: #18211b;
  --line: #35513f;
  --line-hot: #6fae82;
  --text: #cfe3cf;
  --dim: #7e9a86;
  --paper: #e9e3cf;
  --gold: #ffd24a;
  --gold-deep: #b9860f;
  --bad: #ff6b5e;
  --good: #7ddc9c;
  --warn: #ffb454;
  --violet: #b992ff;
  --mono: "Courier New", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #050706;
  color: var(--text);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: none;
}

.app { position: fixed; inset: 0; display: grid; place-items: center; background: #050806; }
.app::before {
  content: ""; position: fixed; inset: -10%;
  background: radial-gradient(circle at 50% 40%, #0d1512 0%, #050706 72%);
  z-index: -1;
}

/* ---------- stage ---------- */
.stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.stage canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: saturate(1.06) contrast(1.04);
}
.app.ratio43 .stage canvas { width: min(100%, calc(100vh * 4 / 3)); height: auto; }

/* ---------- CRT ---------- */
.crt { position: absolute; inset: 0; pointer-events: none; z-index: 5; display: block; }
.crt.hidden { display: none; }
.crt__scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.34) 0px, rgba(0,0,0,.34) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 3px);
  opacity: .62;
}
.crt__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 52%, rgba(0,0,0,.55) 100%),
    linear-gradient(rgba(120,255,170,.03), rgba(255,190,120,.03));
}
.crt__tracking {
  position: absolute; left: 0; right: 0; height: 42px;
  background: linear-gradient(rgba(255,255,255,0), rgba(180,240,200,.11), rgba(255,255,255,0));
  animation: tracking 7.5s linear infinite; opacity: .5;
}
@keyframes tracking {
  0% { transform: translateY(-60px); }
  100% { transform: translateY(105vh); }
}

/* film grain: the wet, noisy look of a tape that has been played too often */
.crt__grain {
  position: absolute; inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: .13;
  animation: grain 0.5s steps(3) infinite;
  pointer-events: none;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- ui root ---------- */
.ui { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.ui > * { pointer-events: auto; }

/* ---------- shared atoms ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(4, 7, 5, .86);
  z-index: 40; animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
.panel {
  background: linear-gradient(180deg, rgba(14,20,16,.97), rgba(9,13,10,.99));
  border: 2px solid var(--line);
  box-shadow: inset 0 0 0 2px #0b100d, inset 0 0 24px rgba(0,0,0,.8), 0 0 0 1px #050806;
  padding: 16px 18px;
}
.panel--gold { border-color: var(--gold-deep); box-shadow: inset 0 0 0 2px #0b100d, 0 0 20px rgba(255,210,74,.12); }
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--text); background: #16211a; border: 1px solid var(--line);
  padding: 7px 11px; cursor: pointer; text-transform: uppercase;
  transition: background .08s linear, color .08s linear, transform .06s;
}
.btn:hover:not(:disabled) { background: #24382b; color: #eaffed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--primary { background: #2c4a34; border-color: var(--line-hot); color: #effff2; }
.btn--gold { background: #3a2f0c; border-color: var(--gold-deep); color: var(--gold); }
.btn--gold:hover:not(:disabled) { background: #4d3f11; color: #fff0b8; }
.btn--danger { background: #3a1612; border-color: #8d3a2f; color: #ffb3a8; }
.btn--ghost { background: transparent; }
.btn--block { display: block; width: 100%; text-align: left; }
.btn--sm { font-size: 11px; padding: 4px 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 9px 0; opacity: .7; }
.mono-dim { color: var(--dim); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.gold { color: var(--gold); }
.violet { color: var(--violet); }
.tiny { font-size: 10.5px; letter-spacing: .03em; }
.tag {
  display: inline-block; font-size: 10px; padding: 1px 5px; border: 1px solid var(--line);
  color: var(--dim); text-transform: uppercase; letter-spacing: .06em;
}
.tag--gold { border-color: var(--gold-deep); color: var(--gold); }

/* ---------- main menu ---------- */
.menu {
  position: absolute; inset: 0; z-index: 30; display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end; padding: 28px 32px 26px; gap: 22px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3,6,4,.55) 0%, rgba(3,6,4,0) 34%, rgba(3,6,4,.55) 76%, rgba(3,6,4,.92) 100%);
}
.menu__left { align-self: start; max-width: 640px; pointer-events: auto; }
.menu__kicker { font-size: 10.5px; letter-spacing: .42em; color: var(--gold); opacity: .85; }
.menu__title {
  font-size: clamp(34px, 6.4vw, 78px); line-height: .88; margin: 8px 0 0;
  letter-spacing: .02em; color: #f3ffe9;
  text-shadow: 0 0 2px #b8ffd0, 3px 0 0 rgba(255,60,60,.35), -3px 0 0 rgba(60,180,255,.35);
  position: relative;
}
.menu__title .glitch { color: var(--gold); }
.menu__title::after {
  content: attr(data-text); position: absolute; left: 2px; top: 1px;
  color: rgba(255,210,74,.35); clip-path: inset(48% 0 32% 0);
  animation: glitchclip 5.5s steps(9) infinite; pointer-events: none;
}
@keyframes glitchclip {
  0%, 88%, 100% { transform: translate(0,0); opacity: .0; }
  90% { transform: translate(-4px, 2px); opacity: .8; }
  93% { transform: translate(5px, -2px); opacity: .5; }
  96% { transform: translate(-2px, 0); opacity: .7; }
}
.menu__tag { font-size: 12.5px; color: #a9c4b1; margin-top: 12px; line-height: 1.55; max-width: 480px; }
.menu__tag em { color: var(--paper); font-style: normal; }
.menu__list { position: absolute; right: 32px; bottom: 26px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; min-width: 290px; }
.menu__item {
  display: flex; align-items: baseline; gap: 10px; font-family: var(--mono);
  background: rgba(9,13,10,.72); border: 1px solid #2c4436; border-left: 3px solid transparent;
  color: #d8ecdb; font-size: 14px; letter-spacing: .16em; text-transform: uppercase;
  padding: 9px 12px; cursor: pointer; text-align: left; transition: all .1s linear;
}
.menu__item small { font-size: 10px; letter-spacing: .05em; color: var(--dim); margin-left: auto; text-transform: none; }
.menu__item:hover, .menu__item:focus-visible { background: #1a2a20; border-left-color: var(--gold); color: #fff; outline: none; transform: translateX(-3px); }
.menu__item:disabled { opacity: .34; cursor: not-allowed; transform: none; border-left-color: transparent; }
.menu__now {
  position: absolute; right: 32px; top: 26px; text-align: right; font-size: 10.5px;
  letter-spacing: .16em; color: var(--dim); line-height: 1.9; pointer-events: auto;
}
.menu__now b { color: var(--gold); font-weight: normal; }
.menu__eq { display: flex; gap: 2px; justify-content: flex-end; height: 20px; align-items: flex-end; margin-bottom: 6px; }
.menu__eq i { width: 3px; background: var(--gold); opacity: .55; display: block; height: 4px; transition: height .07s linear; }
.menu__footer { position: absolute; left: 32px; bottom: 26px; font-size: 10px; color: #5f7a68; letter-spacing: .12em; pointer-events: none; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud__top {
  position: absolute; left: 14px; top: 12px; display: flex; flex-direction: column; gap: 7px;
  background: rgba(6,10,8,.66); border: 1px solid #24382c; padding: 8px 10px;
  min-width: 250px; pointer-events: auto;
}
.hud__clockrow { display: flex; align-items: baseline; gap: 10px; }
.hud__time { font-size: 22px; letter-spacing: .06em; color: #efffe9; text-shadow: 0 0 6px rgba(120,255,160,.25); }
.hud__day { font-size: 10.5px; letter-spacing: .18em; color: var(--gold); }
.hud__money { margin-left: auto; font-size: 14px; color: var(--good); }
.hud__stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 3px 10px; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: .08em; color: var(--dim); }
.stat__label { width: 46px; text-transform: uppercase; }
.stat__bar { flex: 1; height: 5px; background: #131b15; border: 1px solid #223428; position: relative; overflow: hidden; }
.stat__fill { position: absolute; inset: 0 auto 0 0; width: 50%; background: #6fae82; }
.stat--energy .stat__fill { background: #8fd8ff; }
.stat--hunger .stat__fill { background: #ffc46b; }
.stat--stress .stat__fill { background: #ff8f7a; }
.stat--morale .stat__fill { background: #b992ff; }
.stat--addiction .stat__fill { background: #e0e0a0; }
.stat--risk .stat__fill { background: #ff5e5e; }
.stat__num { width: 20px; text-align: right; color: #b7cdba; }
.stat.flash .stat__bar { outline: 1px solid var(--bad); }

.hud__right { position: absolute; right: 14px; top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: auto; }
.hud__objective {
  max-width: 260px; font-size: 11px; line-height: 1.5; color: #cfe3cf;
  background: rgba(6,10,8,.7); border-left: 2px solid var(--gold); padding: 6px 9px;
  pointer-events: auto;
}
.hud__objective b { color: var(--gold); font-weight: normal; letter-spacing: .1em; font-size: 9.5px; display: block; margin-bottom: 2px; }
.hud__btns { display: flex; gap: 5px; pointer-events: auto; }
.hud__btn {
  font-family: var(--mono); font-size: 11px; padding: 5px 9px; letter-spacing: .1em;
  background: rgba(9,15,11,.86); border: 1px solid #2c4436; color: #cfe3cf; cursor: pointer;
}
.hud__btn:hover { background: #1c2c22; color: #fff; }
.hud__btn.on { border-color: var(--gold); color: var(--gold); }
.hud__phone { border-color: #4d7a5c; }

.hud__prompt {
  position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%);
  background: rgba(6,10,8,.82); border: 1px solid var(--line-hot); color: #eaffee;
  font-size: 12.5px; letter-spacing: .05em; padding: 7px 14px; white-space: nowrap;
  opacity: 0; transition: opacity .12s; text-align: center;
}
.hud__prompt.show { opacity: 1; }
.hud__prompt kbd {
  background: #25382b; border: 1px solid #4d7a5c; padding: 1px 5px; font-family: var(--mono);
  font-size: 11px; margin-right: 7px; color: var(--gold);
}
.hud__prompt small { display: block; color: var(--dim); font-size: 9.5px; letter-spacing: .12em; margin-top: 3px; }
.hud__hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-size: 10px; letter-spacing: .16em; color: #5c7563; }
.hud__toasts { position: absolute; right: 14px; bottom: 22px; display: flex; flex-direction: column-reverse; gap: 5px; align-items: flex-end; width: min(340px, 60vw); }
.toast {
  font-size: 11.5px; line-height: 1.4; padding: 6px 10px; background: rgba(7,11,9,.9);
  border-left: 2px solid var(--line-hot); color: #dbeedd; animation: toastin .18s ease;
  max-width: 100%;
}
.toast--bad { border-left-color: var(--bad); color: #ffd3cd; }
.toast--good { border-left-color: var(--good); }
.toast--gold { border-left-color: var(--gold); color: #ffeeb8; }
.toast--event { border-left-color: var(--violet); color: #e7ddff; }
.toast.out { animation: toastout .3s forwards; }
@keyframes toastin { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(18px); } }

.hud__log {
  position: absolute; left: 14px; bottom: 22px; width: min(330px, 44vw); max-height: 108px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; pointer-events: none;
}
.hud__log div { font-size: 10px; color: #7d9a85; letter-spacing: .02em; line-height: 1.35; opacity: .8; }
.hud__log div:last-child { color: #b6d0bb; opacity: 1; }

/* ---------- modal ---------- */
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3,5,4,.78); z-index: 45; }
.modal { width: min(560px, 92vw); max-height: 88vh; overflow: auto; }
.modal__kicker { font-size: 10px; letter-spacing: .3em; color: var(--gold); margin-bottom: 4px; }
.modal__title { font-size: 20px; letter-spacing: .04em; color: #f0ffe8; margin: 0 0 8px; }
.modal__body { font-size: 12.5px; line-height: 1.6; color: #bcd4c1; margin-bottom: 14px; }
.modal__body em { color: var(--paper); font-style: normal; }
.modal__choices { display: flex; flex-direction: column; gap: 6px; }
.choice {
  text-align: left; background: #141d17; border: 1px solid #2a4033; color: #d6e8d8;
  font-family: var(--mono); font-size: 12.5px; padding: 8px 11px; cursor: pointer; line-height: 1.45;
}
.choice:hover:not(:disabled) { background: #20301f; border-color: var(--line-hot); color: #fff; }
.choice:disabled { opacity: .4; cursor: not-allowed; }
.choice small { display: block; color: var(--dim); font-size: 10px; margin-top: 2px; }

/* ---------- phone ---------- */
.phone-wrap {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 38;
  background: radial-gradient(circle at 50% 60%, rgba(4,8,6,.72), rgba(2,4,3,.92));
}
.phone {
  width: 340px; height: min(600px, 88vh); display: flex; flex-direction: column;
  background: #0b0f0c; border: 2px solid #3a5a44; border-radius: 18px;
  box-shadow: 0 0 0 3px #070a08, 0 0 34px rgba(80,220,140,.1), inset 0 0 40px rgba(0,0,0,.75);
  overflow: hidden; animation: phonein .18s ease;
  position: relative;
}
@keyframes phonein { from { transform: translateY(14px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }
.phone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 16px;
  background: linear-gradient(115deg, rgba(255,255,255,.05), transparent 42%);
}
.phone__notch { height: 20px; background: #070a08; display: flex; align-items: center; justify-content: center; }
.phone__notch i { width: 56px; height: 5px; background: #182119; display: block; border-radius: 4px; }
.phone__bar {
  display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .1em;
  padding: 4px 12px; color: #93b09a; background: #0d1310; border-bottom: 1px solid #1c2a20;
}
.phone__bar .spacer { flex: 1; }
.phone__body { flex: 1; overflow: auto; }
.phone__body::-webkit-scrollbar { width: 5px; }
.phone__body::-webkit-scrollbar-thumb { background: #2c4436; }
.phone__home { padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.appbtn {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px;
  background: #111a13; border: 1px solid #213025; color: #cfe3cf; cursor: pointer; font-family: var(--mono);
}
.appbtn:hover { background: #1a2a1e; border-color: #3f6b50; }
.appbtn__icon {
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 15px;
  background: #0a110c; border: 1px solid #2c4436; color: var(--gold);
}
.appbtn__name { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.avatar { width: 40px; height: 40px; object-fit: cover; image-rendering: pixelated; border: 1px solid #2c4436; background: #0a110c; flex: none; }
.avatar--sm { width: 28px; height: 28px; }
.appbtn__dot { position: absolute; }
.appbtn .notif { color: var(--bad); font-size: 8px; margin-left: 3px; }

.papp { display: flex; flex-direction: column; height: 100%; }
.app__header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #1c2a20; background: #0e1611; position: sticky; top: 0; z-index: 2; }
.app__title { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #eaffee; }
.app__back { font-size: 11px; background: none; border: none; color: var(--gold); cursor: pointer; padding: 0; letter-spacing: .1em; }
.app__body { padding: 11px 12px 16px; font-size: 11.5px; line-height: 1.55; color: #c2d8c6; display: flex; flex-direction: column; gap: 9px; }
.app__h { font-size: 9.5px; letter-spacing: .22em; color: var(--dim); text-transform: uppercase; margin-top: 2px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px dotted #1e2c22; }
.kv b { font-weight: normal; color: #eaffee; }
.card { background: #0c1310; border: 1px solid #1e2c22; padding: 8px 9px; }
.list { display: flex; flex-direction: column; gap: 5px; }
.listitem { display: flex; align-items: center; gap: 8px; background: #0c1310; border: 1px solid #1e2c22; padding: 6px 8px; font-size: 11px; }
.listitem .meta { font-size: 9.5px; color: var(--dim); }
.listitem .grow { flex: 1; min-width: 0; }
.listitem .name { color: #e1f2e4; letter-spacing: .03em; }
.empty { color: #5f7a68; font-size: 10.5px; padding: 8px 0; letter-spacing: .06em; }
.creditv { color: var(--good); }
.debtv { color: var(--bad); }
.pill { display: inline-block; font-size: 9px; padding: 0 4px; border: 1px solid #2c4436; color: var(--dim); letter-spacing: .06em; }
.phone__nav { display: flex; border-top: 1px solid #1c2a20; background: #0a110c; }
.phone__nav button { flex: 1; background: none; border: none; color: #7e9a86; font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; padding: 7px 2px; cursor: pointer; }
.phone__nav button:hover { color: var(--gold); }
.phone__close { font-size: 11px; }

/* ---------- intro / endings ---------- */
.intro { max-width: 620px; padding: 22px 26px; }
.intro p { font-size: 12.5px; line-height: 1.75; color: #c2d8c6; margin: 0 0 12px; }
.intro .big { font-size: 19px; color: #f0ffe8; letter-spacing: .03em; line-height: 1.45; margin-bottom: 14px; }
.ending { max-width: 640px; padding: 20px 26px 24px; }
.ending__kicker { font-size: 10px; letter-spacing: .4em; color: var(--bad); }
.ending__title { font-size: clamp(26px, 4.4vw, 42px); line-height: 1; margin: 6px 0 12px; color: #f4ffe9; letter-spacing: .01em; }
.ending__body { font-size: 12.5px; line-height: 1.8; color: #bcd4c1; white-space: pre-line; }
.ending__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 12px; margin: 14px 0; font-size: 11px; }
.ending__stats div { display: flex; justify-content: space-between; border-bottom: 1px dotted #223428; padding-bottom: 2px; color: var(--dim); }
.ending__stats b { color: #eaffee; font-weight: normal; }
.ending--good .ending__kicker { color: var(--good); }
.ending--gold .ending__kicker, .ending--gold .ending__title { color: var(--gold); }

/* ---------- day summary ---------- */
.summary { width: min(520px, 92vw); }
.summary__row { display: flex; justify-content: space-between; font-size: 11.5px; padding: 3px 0; border-bottom: 1px dotted #223428; }

/* ---------- misc ---------- */
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #050807; z-index: 60; }
.loading__inner { text-align: center; }
.loading__bar { width: 220px; height: 4px; background: #141d17; border: 1px solid #26382b; margin: 10px auto 0; overflow: hidden; }
.loading__bar i { display: block; height: 100%; width: 30%; background: var(--gold); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { margin-left: -30% } 100% { margin-left: 100% } }

@media (max-width: 760px) {
  .menu { grid-template-columns: 1fr; padding: 18px; align-items: start; }
  .menu__list { position: static; width: 100%; margin-top: 8px; }
  .menu__now { display: none; }
  .menu__footer { display: none; }
  .hud__top { min-width: 0; width: 52vw; padding: 6px; }
  .hud__stats { grid-template-columns: 1fr; }
  .hud__log { display: none; }
  .phone { width: 92vw; height: 84vh; }
}

/* ---------- HUD portrait: Mo's face, by mood ---------- */
.hud__face {
  display: flex; gap: 9px; align-items: center;
  border-bottom: 1px solid #20342a; padding-bottom: 7px;
}
.hud__faceimg {
  width: 66px; height: 88px; display: block; image-rendering: auto; object-fit: cover;
  border: 1px solid #2c4436; background: #0a110c; flex: none;
}
.hud__facemeta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hud__mood { font-size: 13px; letter-spacing: .16em; color: #eef7ee; }
.hud__moodsub { font-size: 8.5px; letter-spacing: .16em; color: #7e9986; text-transform: uppercase; }
.hud__moodnote { font-size: 9px; color: #68826f; line-height: 1.35; }
.hud__face[data-mood="high"] .hud__mood { color: var(--gold); }
.hud__face[data-mood="stressed"] .hud__mood { color: #ff8f7a; }
.hud__face[data-mood="sick"] .hud__mood { color: #9fd8c0; }
.hud__face[data-mood="angry"] .hud__mood { color: #ff5e5e; }
.hud__face[data-mood="tired"] .hud__mood { color: #9fb6c8; }
.hud__face[data-mood="high"] .hud__faceimg { border-color: var(--gold-deep); }

/* ---------- HUD text threads ---------- */
.thread {
  position: absolute; left: 14px; bottom: 78px; width: 316px;
  background: rgba(8,12,10,.95); border: 1px solid #2c4436;
  box-shadow: 0 12px 34px rgba(0,0,0,.55); pointer-events: auto;
  animation: threadin .2s ease;
}
.thread.out { animation: threadout .22s forwards; }
@keyframes threadin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes threadout { to { opacity: 0; transform: translateY(10px); } }
.thread__head {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-bottom: 1px solid #1c2a20; background: #0a110c;
}
.thread__face { width: 33px; height: 44px; image-rendering: pixelated; border: 1px solid #2c4436; }
.thread__who { display: flex; flex-direction: column; line-height: 1.15; }
.thread__name { font-size: 10.5px; letter-spacing: .16em; color: #e6f2e7; }
.thread__sub { font-size: 8.5px; letter-spacing: .12em; color: #6d8877; }
.thread__close {
  margin-left: auto; background: none; border: 1px solid #22362a; color: #8aa895;
  font-family: var(--mono); font-size: 13px; line-height: 1; width: 20px; height: 20px; cursor: pointer;
}
.thread__close:hover { color: #fff; border-color: var(--gold); }
.thread__body { max-height: 190px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble { display: flex; gap: 6px; align-items: flex-end; }
.bubble--out { flex-direction: row; justify-content: flex-end; }
.bubble__face { width: 21px; height: 28px; image-rendering: pixelated; border: 1px solid #24382c; flex: none; }
.bubble__text {
  font-size: 10.5px; line-height: 1.45; padding: 5px 7px; max-width: 224px;
  background: #16241b; border: 1px solid #24382c; color: #dcf0dd; white-space: pre-line;
}
.bubble--out .bubble__text { background: #1d2f22; border-color: #3c6a4c; color: #eaffee; }
.thread__choices { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 8px; }
.thread__choice {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .03em;
  background: #101a13; border: 1px solid #2c4436; color: #cfe3cf; padding: 6px 8px; cursor: pointer;
}
.thread__choice:hover { background: #1c2c22; border-color: var(--gold-deep); color: #fff; }

/* ---------- phone: chat bubbles + inbox ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 10px; }
.chat__row { display: flex; gap: 6px; align-items: flex-end; }
.chat__row--out { justify-content: flex-end; }
.chat__face { width: 27px; height: 36px; image-rendering: pixelated; border: 1px solid #24382c; flex: none; }
.chat__bubble {
  font-size: 11.5px; line-height: 1.55; padding: 7px 9px; max-width: 74%; white-space: pre-line;
  background: #16241b; border: 1px solid #24382c; color: #dcf0dd;
}
.chat__bubble--out { background: #1d2f22; border-color: #3c6a4c; color: #eaffee; }
.chat__quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.chat__chip {
  font-family: var(--mono); font-size: 10px; padding: 5px 8px; cursor: pointer;
  background: #101a13; border: 1px solid #2c4436; color: #cfe3cf;
}
.chat__chip:hover { border-color: var(--gold-deep); color: #fff; }
.chatlist { display: flex; align-items: center; gap: 8px; }

/* ---------- phone chassis: bezel, status bar, dock ---------- */
.phone {
  border-radius: 18px;
  border: 1px solid #2f4a3a;
  box-shadow: inset 0 0 0 3px #0a0f0c, inset 0 0 0 4px #24382c, 0 22px 60px rgba(0,0,0,.6);
  background: #060a08;
}
.phone__notch {
  height: 22px; background: #050806; border-bottom: 1px solid #101a13;
  border-radius: 14px 14px 0 0; position: relative;
}
.phone__notch i { width: 62px; height: 6px; background: #0d1410; border-radius: 6px; }
.phone__bar {
  font-size: 10px; letter-spacing: .12em; color: #9fbfa9;
  padding: 4px 12px 5px; border-bottom: 1px solid #16241b; background: #070c09;
}
.phone__nav {
  border-top: 1px solid #16241b; background: #070c09;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 5px 6px 7px;
  border-radius: 0 0 16px 16px;
}
.phone__nav button {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; padding: 8px 2px;
  background: #0d1510; border: 1px solid #1b2c21; color: #a8c4ae; cursor: pointer; border-radius: 6px;
}
.phone__nav button:hover { background: #16241b; color: #fff; border-color: var(--gold-deep); }
.phone__nav button[data-nav="close"] { color: #d99a8a; }
.phone__body { background: #060a08; }
.appbtn { border-radius: 10px; }
.app__header { border-radius: 10px 10px 0 0; }

/* ============================================================================
   UI THEMES — one set of variables, four skins. Everything below is expressed
   in these so the phone, HUD, menus and modals recolour together.
   ============================================================================ */
:root {
  --screen: #08110c;
  --screen-2: #102018;
  --glow: rgba(120, 255, 170, .5);
  --ui-scale: 1;
  --bezel-a: #767d86;
  --bezel-b: #23272b;
  --bezel-c: #808894;
  --bezel-line: rgba(255, 255, 255, .16);
}
:root[data-theme="amber"] {
  --ink: #0b0805; --ink-2: #130e08; --ink-3: #1b140c;
  --line: #4a3a20; --line-hot: #c79a4e;
  --text: #f2e4c8; --dim: #a38d6a; --paper: #f8efdb;
  --gold: #ffcf7a; --gold-deep: #b8863a;
  --bad: #ff8a6a; --good: #b8e08a; --warn: #ffc06a; --violet: #d8a8ff;
  --screen: #120c06; --screen-2: #1d130a; --glow: rgba(255, 180, 80, .55);
}
:root[data-theme="ice"] {
  --ink: #050a0e; --ink-2: #08121a; --ink-3: #0b1a24;
  --line: #254a5e; --line-hot: #69c6ef;
  --text: #d8f1ff; --dim: #7ea2b5; --paper: #eaf7ff;
  --gold: #8ce0ff; --gold-deep: #3f8fae;
  --bad: #ff7f9e; --good: #7ef0c0; --warn: #ffd08a; --violet: #b9a8ff;
  --screen: #061016; --screen-2: #0a1b24; --glow: rgba(110, 210, 255, .5);
  --bezel-a: #6d7d8a; --bezel-b: #1d262d; --bezel-c: #7d8f9d;
}
:root[data-theme="vhs"] {
  --ink: #0b060c; --ink-2: #150a18; --ink-3: #1d0e21;
  --line: #4a2540; --line-hot: #e070b8;
  --text: #f3d9ec; --dim: #a4789a; --paper: #fff0fa;
  --gold: #ff9ede; --gold-deep: #a84486;
  --bad: #ff6f8f; --good: #9ef0d8; --warn: #ffbf8f; --violet: #c39bff;
  --screen: #0d0610; --screen-2: #1a0b1e; --glow: rgba(255, 120, 220, .5);
  --bezel-a: #6f6270; --bezel-b: #241a26; --bezel-c: #85748a;
}

/* scale: the in-game UI layers only, so the 3D stage never moves */
.phone, .hud__top, .hud__right, .hud__log, .hud__toasts, .hud__prompt, .hud__hint, .thread {
  zoom: var(--ui-scale, 1);
}

/* ---------------- phone chassis: brushed metal, chamfered, warm screen ---------------- */
.phone-wrap {
  background: radial-gradient(circle at 50% 45%, rgba(6, 9, 7, .55), rgba(2, 3, 3, .92));
}
.phone {
  width: 352px; height: min(648px, 92vh);
  position: relative; display: block; overflow: visible;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .7)) drop-shadow(0 0 26px var(--glow));
  animation: phonein .22s cubic-bezier(.2, .9, .2, 1);
}
.phone::after { display: none; }
.phone__shell {
  position: absolute; inset: 0; padding: 9px 10px 7px;
  display: flex; flex-direction: column;
  clip-path: polygon(30px 0, calc(100% - 30px) 0, 100% 30px, 100% calc(100% - 30px), calc(100% - 30px) 100%, 30px 100%, 0 calc(100% - 30px), 0 30px);
  background:
    linear-gradient(152deg, var(--bezel-a) 0%, #4a5058 9%, var(--bezel-b) 34%, #2b3036 58%, #4c525a 82%, var(--bezel-c) 100%);
  box-shadow: inset 0 0 0 1px var(--bezel-line);
}
.phone__shell::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 16%, rgba(0, 0, 0, .28) 86%, rgba(255, 255, 255, .1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px);
}
.phone__speaker { height: 15px; display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 5px; flex: none; }
.phone__speaker i {
  width: 22px; height: 3px; border-radius: 2px; display: block;
  background: #0b0d0f; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .35);
}
.phone__chin { height: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.phone__chin i { width: 78px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #262b30, #4c545c, #262b30); }
.phone__side {
  position: absolute; right: -4px; width: 5px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--bezel-c), #31363b 55%, var(--bezel-a));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.phone__side--1 { top: 21%; height: 52px; }
.phone__side--2 { top: 35%; height: 32px; }

.phone__screen {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  clip-path: polygon(21px 0, calc(100% - 21px) 0, 100% 21px, 100% calc(100% - 21px), calc(100% - 21px) 100%, 21px 100%, 0 calc(100% - 21px), 0 21px);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--screen-2), var(--screen) 72%),
    var(--screen);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .85), inset 0 0 34px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.phone__screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  opacity: .55;
}
.phone__screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: linear-gradient(118deg, rgba(255, 255, 255, .07), transparent 34%);
}

.phone__bar {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 7px 14px 6px; font-size: 9.5px; letter-spacing: .18em;
  color: var(--dim); background: transparent;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.phone__sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 8px; }
.phone__sig i { width: 2px; background: var(--gold); display: block; opacity: .85; }
.phone__sig i:nth-child(1) { height: 3px; }
.phone__sig i:nth-child(2) { height: 5px; }
.phone__sig i:nth-child(3) { height: 8px; opacity: .3; }
.phone__carrier { color: var(--gold); opacity: .9; }
.phone__body { flex: 1; overflow: auto; background: transparent; position: relative; z-index: 2; }
.phone__body::-webkit-scrollbar { width: 4px; }
.phone__body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--line) 80%, transparent); border-radius: 4px; }
.phone__nav {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 8px 10px 9px; border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .35));
  border-radius: 0; position: relative; z-index: 2;
}
.phone__nav button {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; padding: 8px 2px;
  background: color-mix(in srgb, var(--screen-2) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 8px; color: var(--text); cursor: pointer; transition: all .1s ease;
}
.phone__nav button:hover { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.phone__nav button[data-nav="close"] { color: color-mix(in srgb, var(--bad) 80%, var(--text)); }

/* phone home: glass tiles */
.phone__home { padding: 13px 13px 10px; gap: 9px; }
.appbtn {
  border-radius: 12px; padding: 12px 5px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  transition: transform .1s ease, border-color .1s ease, background .1s ease;
}
.appbtn:hover { border-color: var(--line-hot); background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); transform: translateY(-1px); }
.appbtn__icon {
  width: 36px; height: 36px; border-radius: 10px; font-size: 15px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .1), rgba(0, 0, 0, .5));
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--gold); text-shadow: 0 0 10px var(--glow);
}
.appbtn__name { font-size: 8.5px; letter-spacing: .08em; color: var(--text); }
.app__header { background: linear-gradient(180deg, color-mix(in srgb, var(--screen-2) 90%, #000), transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.app__title { color: var(--text); }
.card, .listitem { background: color-mix(in srgb, var(--screen-2) 55%, transparent); border-color: color-mix(in srgb, var(--line) 45%, transparent); }
.kv { border-bottom-color: color-mix(in srgb, var(--line) 35%, transparent); }

/* ---------------- HUD: sleeker panel, segmented LED bars ---------------- */
.hud__top {
  border-radius: 14px; padding: 10px 12px 11px; gap: 8px;
  background: linear-gradient(180deg, rgba(10, 15, 12, .84), rgba(5, 8, 7, .74));
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(7px) saturate(1.1);
}
.hud__face { border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); padding-bottom: 8px; }
.hud__faceimg {
  width: 63px; height: 84px; border-radius: 9px; image-rendering: auto; object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .6);
}
.hud__mood { font-size: 12.5px; letter-spacing: .2em; }
.hud__moodsub { color: var(--dim); }
.hud__clockrow { gap: 9px; padding-top: 1px; }
.hud__time { font-size: 23px; text-shadow: 0 0 10px var(--glow); font-variant-numeric: tabular-nums; }
.hud__day { color: var(--gold); }
.hud__money { font-variant-numeric: tabular-nums; text-shadow: 0 0 10px var(--glow); }
.hud__stats { gap: 5px 12px; }
.stat { gap: 7px; font-size: 9px; letter-spacing: .1em; }
.stat__label { width: 44px; color: var(--dim); }
.stat__bar {
  height: 8px; border-radius: 3px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #070b09, #121a14);
  border: 1px solid color-mix(in srgb, var(--line) 60%, #000);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, .8);
}
.stat__bar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 5px, rgba(0, 0, 0, .82) 5px 7px);
}
.stat__fill {
  background: var(--c, var(--line-hot));
  box-shadow: 0 0 8px -1px var(--c, var(--line-hot)), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: width .24s cubic-bezier(.2, .8, .2, 1), background .2s linear;
}
.stat__num { color: var(--text); font-variant-numeric: tabular-nums; width: 22px; }
.stat.flash .stat__bar { outline: 1px solid color-mix(in srgb, var(--bad) 80%, transparent); animation: statflash 1.1s steps(2) infinite; }
@keyframes statflash { 50% { outline-color: transparent; } }
.hud__objective { border-radius: 0 10px 10px 0; background: linear-gradient(90deg, rgba(8, 12, 10, .85), rgba(8, 12, 10, .55)); backdrop-filter: blur(6px); }
.hud__btn { border-radius: 8px; background: rgba(9, 15, 11, .8); transition: all .1s ease; }
.hud__btn:hover { border-color: var(--line-hot); }
.hud__prompt { border-radius: 10px; backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast { border-radius: 0 8px 8px 0; backdrop-filter: blur(6px); }

/* ---------------- theme swatches (settings) ---------------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.theme-swatch {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  padding: 7px 9px; border-radius: 9px; font-family: var(--mono);
  background: color-mix(in srgb, var(--screen-2) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--text);
}
.theme-swatch i { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: 0 0 10px -1px currentColor, inset 0 0 0 1px rgba(0, 0, 0, .5); }
.theme-swatch span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.theme-swatch b { font-weight: normal; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.theme-swatch em { font-style: normal; font-size: 8.5px; color: var(--dim); letter-spacing: .04em; }
.theme-swatch:hover { border-color: var(--line-hot); }
.theme-swatch.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 16px -6px var(--gold); }

/* ---------------- polish pass: controls, spacing, HUD legibility ---------------- */
input[type="range"] {
  accent-color: var(--gold);
  height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 55%, transparent), color-mix(in srgb, var(--line) 70%, transparent));
  border: 1px solid color-mix(in srgb, var(--line) 60%, #000);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -5px;
  border-radius: 50%; background: var(--gold); border: 1px solid #000;
  box-shadow: 0 0 10px -1px var(--gold);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--line) 70%, transparent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 1px solid #000; border-radius: 50%; background: var(--gold); }

.hud__top { min-width: 306px; }
.hud__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.stat { font-size: 9.5px; }
.stat__label { width: 42px; }
.stat__bar { min-width: 62px; }

/* modal + menu panels pick up the theme bezel instead of the old fixed greens */
.modal, .panel { border-radius: 12px; }
.panel { backdrop-filter: blur(6px); }
.menu__item { border-radius: 10px; }
.menu__item:hover, .menu__item:focus-visible { border-radius: 10px; }
.app__h { color: color-mix(in srgb, var(--dim) 90%, var(--gold)); }
.phone__screen { box-shadow: inset 0 0 0 2px rgba(0,0,0,.85), inset 0 0 30px rgba(0,0,0,.5), inset 0 0 24px -8px var(--glow); }

/* ============================================================================
   MODERN SHELL — vendored display type, hairline geometry, glass panels.
   The arcade voice lives in the type (Orbitron for machine numerals and
   headings, Chakra Petch for everything the player reads); the layout stays
   flat, thin and quiet so the 3D stage keeps its weight. Every rule below is
   expressed through the theme variables, so the four skins recolour together.
   ============================================================================ */

@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/chakra-petch-400.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/chakra-petch-500.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/chakra-petch-600.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/chakra-petch-700.woff2") format("woff2");
}
@font-face {
  font-family: "Orbitron"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/orbitron-500.woff2") format("woff2");
}
@font-face {
  font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/orbitron-700.woff2") format("woff2");
}
@font-face {
  font-family: "Orbitron"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("../assets/fonts/orbitron-900.woff2") format("woff2");
}

:root {
  --ui: "Chakra Petch", "Courier New", ui-monospace, monospace;
  --display: "Orbitron", "Chakra Petch", ui-monospace, monospace;
  --hair: color-mix(in srgb, var(--line) 62%, transparent);
  --hair-soft: color-mix(in srgb, var(--line) 32%, transparent);
  --hair-hot: color-mix(in srgb, var(--line-hot) 70%, transparent);
  --glass: linear-gradient(180deg, rgba(13, 19, 15, .86), rgba(6, 9, 7, .92));
  --panel-shadow: 0 20px 48px -16px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .07);
  --lift: 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 22px -10px rgba(0, 0, 0, .9);
}

html, body {
  font-family: var(--ui);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--gold) 34%, transparent); color: #fff; }

*:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ---------------- main menu ---------------- */
.menu { padding: 34px 40px 30px; }
.menu__kicker {
  font-family: var(--ui); font-weight: 600; font-size: 9.5px; letter-spacing: .48em;
  color: var(--gold); opacity: .92;
}
.menu__title {
  font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6.2vw, 82px);
  line-height: .92; letter-spacing: -.012em; margin-top: 12px;
  color: #f6fff1; text-shadow: 0 0 34px color-mix(in srgb, var(--glow) 70%, transparent);
}
.menu__title .glitch { color: var(--gold); }
.menu__title::after { opacity: 0; mix-blend-mode: screen; }
@keyframes glitchclip {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; }
  94% { transform: translate(-3px, 1px); opacity: .55; }
  97% { transform: translate(2px, -1px); opacity: .35; }
}
.menu__tag {
  font-family: var(--ui); font-size: 13px; line-height: 1.7; max-width: 430px;
  color: color-mix(in srgb, var(--text) 62%, transparent); margin-top: 16px;
}
.menu__tag em { color: var(--text); font-weight: 500; }

.menu__list { gap: 0; min-width: 316px; counter-reset: item; }
.menu__item {
  counter-increment: item;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ui); font-weight: 600; font-size: 12.5px; letter-spacing: .22em;
  padding: 11px 12px 11px 34px; border: 0; border-bottom: 1px solid var(--hair-soft);
  border-left: 2px solid transparent; border-radius: 0;
  background: linear-gradient(90deg, rgba(9, 14, 11, .5), rgba(9, 14, 11, .12));
  color: color-mix(in srgb, var(--text) 82%, transparent);
  position: relative; transition: color .12s, border-color .12s, background .14s, padding-left .16s;
}
.menu__item::before {
  content: counter(item, decimal-leading-zero);
  position: absolute; left: 11px; font-family: var(--display); font-weight: 500;
  font-size: 8.5px; letter-spacing: .06em; color: color-mix(in srgb, var(--gold) 55%, transparent);
}
.menu__item:last-child { border-bottom: 1px solid var(--hair-soft); }
.menu__item small {
  font-family: var(--ui); font-weight: 400; font-size: 9.5px; letter-spacing: .1em;
  color: color-mix(in srgb, var(--dim) 85%, transparent);
}
.menu__item:hover, .menu__item:focus-visible {
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 12%, transparent), transparent 78%);
  border-left-color: var(--gold); color: #fff; padding-left: 38px; transform: none;
}
.menu__item:hover::before, .menu__item:focus-visible::before { color: var(--gold); }
.menu__item:disabled { opacity: .3; border-left-color: transparent; }
.menu__now { font-family: var(--ui); font-weight: 500; font-size: 9.5px; letter-spacing: .2em; color: var(--dim); }
.menu__now b { font-family: var(--display); font-weight: 500; font-size: 9px; color: var(--gold); letter-spacing: .12em; }
.menu__footer { font-family: var(--ui); font-weight: 400; font-size: 9px; letter-spacing: .14em; color: color-mix(in srgb, var(--dim) 70%, transparent); }

/* ---------------- shared atoms ---------------- */
.panel {
  border: 1px solid var(--hair); border-radius: 14px; padding: 18px 20px;
  background: var(--glass); box-shadow: var(--panel-shadow);
}
.panel--gold { border-color: color-mix(in srgb, var(--gold-deep) 70%, transparent); }
.btn {
  font-family: var(--ui); font-weight: 600; font-size: 11.5px; letter-spacing: .14em;
  border-radius: 8px; padding: 8px 13px; border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--screen-2) 45%, transparent);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: var(--gold); color: #fff; }
.btn--primary { background: color-mix(in srgb, var(--line-hot) 26%, transparent); border-color: var(--hair-hot); }
.btn--gold { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: var(--gold); color: var(--gold); }
.btn--danger { background: color-mix(in srgb, var(--bad) 18%, transparent); border-color: color-mix(in srgb, var(--bad) 70%, transparent); }
.btn--sm { font-size: 9.5px; padding: 5px 9px; }
.tag { border-radius: 4px; font-family: var(--ui); font-weight: 600; letter-spacing: .14em; font-size: 8.5px; padding: 1px 6px; }
.hr { background: var(--hair-soft); }
.tiny { font-family: var(--ui); letter-spacing: .04em; }

/* ---------------- HUD ---------------- */
.hud__top {
  border-radius: 16px; padding: 11px 13px 12px;
  background: var(--glass); border: 1px solid var(--hair);
  box-shadow: var(--panel-shadow); backdrop-filter: blur(9px) saturate(1.15);
}
.hud__faceimg { border-radius: 10px; }
.hud__mood { font-family: var(--display); font-weight: 700; font-size: 11.5px; letter-spacing: .2em; }
.hud__moodsub { font-family: var(--ui); font-weight: 600; font-size: 8px; letter-spacing: .22em; }
.hud__moodnote { font-family: var(--ui); font-size: 8.5px; letter-spacing: .04em; }
.hud__time {
  font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}
.hud__day { font-family: var(--ui); font-weight: 600; font-size: 9px; letter-spacing: .24em; }
.hud__money { font-family: var(--display); font-weight: 500; font-size: 12px; letter-spacing: .04em; }
.stat { font-size: 9px; }
.stat__label { font-family: var(--ui); font-weight: 600; font-size: 8px; letter-spacing: .18em; }
.stat__num { font-family: var(--display); font-weight: 500; font-size: 8.5px; }
.stat__bar { height: 7px; border-radius: 2px; }
.stat__bar::after { background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(0, 0, 0, .85) 4px 6px); }
.hud__objective { font-family: var(--ui); font-size: 10.5px; border-left-width: 2px; }
.hud__objective b { font-family: var(--ui); font-weight: 700; letter-spacing: .22em; font-size: 8.5px; }
.hud__btn {
  font-family: var(--ui); font-weight: 600; font-size: 9px; letter-spacing: .16em;
  border-radius: 7px; padding: 6px 9px; border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--screen) 78%, transparent); color: var(--text);
}
.hud__btn.on { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.hud__prompt {
  border-radius: 999px; font-family: var(--ui); font-weight: 500; font-size: 12px; letter-spacing: .03em;
  border: 1px solid var(--hair-hot); background: rgba(8, 12, 9, .88);
  padding: 8px 16px; box-shadow: 0 16px 36px -14px #000;
}
.hud__prompt kbd {
  font-family: var(--ui); font-weight: 700; font-size: 10px; letter-spacing: .1em;
  border-radius: 5px; padding: 2px 6px; margin-right: 8px;
  background: color-mix(in srgb, var(--gold) 20%, transparent); border-color: var(--gold);
}
.hud__prompt small { font-family: var(--ui); font-size: 9px; letter-spacing: .16em; }
.hud__hint { font-family: var(--ui); font-size: 9px; letter-spacing: .2em; color: color-mix(in srgb, var(--dim) 75%, transparent); }
.toast { font-family: var(--ui); font-size: 11px; border-radius: 0 10px 10px 0; }
.hud__log div { font-family: var(--ui); font-size: 9.5px; letter-spacing: .02em; }

/* ---------------- phone ---------------- */
.phone__bar { font-family: var(--ui); font-weight: 600; font-size: 9px; letter-spacing: .2em; }
.phone__carrier { font-family: var(--display); font-weight: 500; font-size: 8px; letter-spacing: .18em; }
.phone__home { gap: 8px; }
.appbtn { border-radius: 13px; }
.appbtn__name { font-family: var(--ui); font-weight: 600; font-size: 8px; letter-spacing: .14em; }
.phone__nav button { font-family: var(--ui); font-weight: 600; font-size: 8px; letter-spacing: .16em; border-radius: 9px; }
.app__title { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: .2em; }
.app__back { font-family: var(--ui); font-weight: 600; font-size: 9.5px; letter-spacing: .16em; }
.app__body { font-family: var(--ui); font-size: 11px; line-height: 1.62; }
.app__h { font-family: var(--ui); font-weight: 700; font-size: 8px; letter-spacing: .3em; }
.kv { font-family: var(--ui); font-size: 10.5px; }
.kv b { font-weight: 600; }
.card, .listitem { border-radius: 9px; }
.listitem .name { font-weight: 600; letter-spacing: .04em; }
.listitem .meta, .empty { font-family: var(--ui); }
.phone__screen::before { opacity: .4; }
.theme-swatch b { font-family: var(--ui); font-weight: 600; }
.theme-swatch em { font-family: var(--ui); }

/* ---------------- modals, intro, endings ---------------- */
.modal { border-radius: 16px; padding: 20px 22px; box-shadow: var(--panel-shadow); }
.modal__kicker { font-family: var(--ui); font-weight: 700; font-size: 8.5px; letter-spacing: .38em; }
.modal__title { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.modal__body { font-family: var(--ui); font-size: 12px; line-height: 1.68; }
.choice {
  font-family: var(--ui); font-size: 11.5px; border-radius: 9px; padding: 9px 12px;
  background: color-mix(in srgb, var(--screen-2) 45%, transparent);
  border: 1px solid var(--hair); transition: border-color .12s, background .12s;
}
.choice:hover:not(:disabled) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.choice small { font-family: var(--ui); font-size: 9px; letter-spacing: .1em; }
.intro .big { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .02em; line-height: 1.5; }
.intro p { font-family: var(--ui); font-size: 12px; }
.ending__title { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 4vw, 38px); letter-spacing: .01em; }
.ending__kicker { font-family: var(--ui); font-weight: 700; letter-spacing: .42em; }
.ending__body, .ending__stats, .summary__row { font-family: var(--ui); }
.loading__inner { font-family: var(--ui); font-weight: 600; letter-spacing: .3em; font-size: 10px; }
.chat__bubble, .bubble__text, .thread__choice, .chat__chip { font-family: var(--ui); }
.thread__name { font-family: var(--ui); font-weight: 600; letter-spacing: .18em; }
.thread__sub { font-family: var(--ui); }
input[type="range"] { font-family: var(--ui); }

/* ============================================================================
   PRIMO PASS — the menu becomes a stack of soft pills on a lit gradient, and
   every conversation becomes an iMessage thread: tails, system blue for Mo,
   graphite for everyone else. Skins still drive it through --gold / --glow.
   ============================================================================ */

.menu::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 85% at 20% 14%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 60%),
    radial-gradient(90% 70% at 82% 88%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 66%),
    linear-gradient(180deg, rgba(4, 7, 6, .5), rgba(3, 5, 4, .18) 42%, rgba(2, 4, 3, .82));
}
/* only lift the left column into its own layer; the list and the now-playing block stay
   absolutely pinned to their corners, or the grid swallows them */
.menu__left { position: relative; z-index: 1; }
.menu__list { position: absolute; z-index: 1; width: 340px; min-width: 0; right: 34px; bottom: 28px; }
.menu__now { z-index: 1; }

.menu__list { gap: 10px; min-width: 336px; }
.menu__item {
  counter-increment: none;
  border: 0; border-radius: 999px;
  padding: 14px 24px;
  font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: .18em;
  color: #07110a;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 94%, #fff), color-mix(in srgb, var(--gold) 72%, #000));
  box-shadow: 0 14px 30px -16px var(--gold), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(0, 0, 0, .18);
  transition: transform .16s cubic-bezier(.2, .9, .2, 1), box-shadow .16s, filter .16s;
}
.menu__item::before { display: none; }
.menu__item small { color: rgba(5, 14, 9, .58); font-weight: 700; font-size: 9px; letter-spacing: .12em; }
.menu__item:hover:not(:disabled), .menu__item:focus-visible {
  transform: translateX(-5px) scale(1.012); padding-left: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 100%, #fff), color-mix(in srgb, var(--gold) 80%, #000));
  color: #04100a; filter: saturate(1.05);
}
.menu__item:active:not(:disabled) { transform: scale(.985); }
.menu__item:disabled { opacity: .32; filter: grayscale(.4); }

/* secondary items recede into glass, like the quiet buttons in a good launcher */
.menu__item:nth-child(n+3) {
  background: rgba(17, 23, 20, .74);
  border: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  color: color-mix(in srgb, var(--text) 90%, transparent);
  box-shadow: 0 12px 26px -18px #000, inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px) saturate(1.1);
  font-weight: 600;
}
.menu__item:nth-child(n+3) small { color: color-mix(in srgb, var(--dim) 90%, transparent); }
.menu__item:nth-child(n+3):hover:not(:disabled), .menu__item:nth-child(n+3):focus-visible {
  background: rgba(26, 34, 29, .88);
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
  color: #fff; transform: translateX(-5px);
}
.menu__item:disabled { border-color: color-mix(in srgb, var(--line) 30%, transparent); }

/* ---------------- iMessage threads ---------------- */
.chat__bubble, .bubble__text {
  position: relative; border: 0; border-radius: 18px; padding: 8px 12px;
  background: #26262b; color: #f2f2f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .38);
  font-size: 11px; line-height: 1.52;
}
.chat__bubble:not(.chat__bubble--out), .bubble:not(.bubble--out) .bubble__text { border-bottom-left-radius: 5px; }
.chat__bubble--out, .bubble--out .bubble__text {
  background: linear-gradient(180deg, #3aa0ff, #0a84ff);
  color: #fff; border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(10, 132, 255, .38);
}
.chat__bubble--out::after, .bubble--out .bubble__text::after {
  content: ""; position: absolute; right: -6px; bottom: 0; width: 12px; height: 12px;
  background: radial-gradient(circle at top left, transparent 70%, #0a84ff 72%);
}
.chat__bubble:not(.chat__bubble--out)::after,
.bubble:not(.bubble--out) .bubble__text::after {
  content: ""; position: absolute; left: -6px; bottom: 0; width: 12px; height: 12px;
  background: radial-gradient(circle at top right, transparent 70%, #26262b 72%);
}
.chat__quick { gap: 6px; }
.chat__chip {
  border-radius: 999px; padding: 6px 11px; font-size: 9.5px;
  background: rgba(38, 38, 43, .9); border: 1px solid #3a3a40; color: #e8e8ee;
}
.chat__chip:hover { border-color: #0a84ff; color: #fff; background: rgba(10, 132, 255, .22); }
.thread { border-radius: 16px; overflow: hidden; }
.thread__head { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.thread__choice { border-radius: 9px; }
.bubble__text { max-width: 232px; }
.chat__bubble { max-width: 76%; }

/* the phone's own message/list cards pick up the same graphite */
.card, .listitem { border-radius: 12px; }
.pill { border-radius: 999px; padding: 1px 7px; }
