/* Shared: variables, buttons, settings dialog, phone */
:root {
  --bg: #08110c;
  --bg-2: #0e1a13;
  --panel: rgba(12, 22, 16, 0.86);
  --panel-solid: #101c15;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef3ea;
  --muted: #9fb0a3;
  --accent: #ff8a3d;
  --accent-2: #ffb15c;
  --amber: #f2c14e;
  --leaf: #4f9a5c;
  --danger: #ff5f5f;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.45em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font: 600 0.85em/1.4 var(--font-body);
  text-align: center;
  color: #fff;
}

/* Buttons */
.cbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 600 0.95rem/1 var(--font-body);
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}
.cbtn:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-1px); }
.cbtn:active { transform: translateY(0); }
.cbtn--primary {
  background: linear-gradient(135deg, var(--accent), #ff6a1a);
  border-color: transparent;
  color: #1a0c04;
  box-shadow: 0 8px 24px rgba(255, 122, 40, 0.35);
}
.cbtn--primary:hover { background: linear-gradient(135deg, #ff9a52, #ff7a2a); box-shadow: 0 10px 28px rgba(255, 122, 40, 0.45); }
.cbtn--ghost { background: transparent; }
.cbtn--small { padding: 0.5rem 0.85rem; font-size: 0.82rem; }
.cbtn--danger { background: var(--danger); border-color: transparent; color: #fff; }
.cbtn--big { font-size: 1.15rem; padding: 1.05rem 1.9rem; }
.cbtn[disabled] { opacity: 0.5; cursor: default; transform: none; }

/* Settings (engine/client/ui/settings-dialog.js): a screen of the game's own, not a web page's popup. It fills the
   window on every device: a rail of sections down the left on a wide screen, a row of tabs on a phone, one pane at a
   time, and the buttons always on the bottom bar. Touch first: nothing to press is under 44 px. */
.cdlg {
  position: fixed; inset: 0; z-index: 90;
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 138, 61, 0.12), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, rgba(60, 140, 110, 0.12), transparent 60%),
    #070f0b;
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  animation: cdlg-in 0.22s ease-out;
}
@keyframes cdlg-in { from { opacity: 0; transform: scale(0.99); } to { opacity: 1; transform: none; } }
.cdlg::backdrop { background: rgba(2, 8, 5, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cdlg__form {
  display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 1180px; margin-inline: auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}
.cdlg__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.cdlg__eyebrow { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); }
.cdlg__title { margin: 2px 0 0; font: 700 clamp(1.5rem, 4vw, 2.1rem)/1.1 var(--font-display, var(--font-body)); letter-spacing: 0.05em; }
.cdlg__x {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 1.1rem; cursor: pointer;
}
.cdlg__x:hover, .cdlg__x:focus-visible { color: #fff; border-color: var(--accent); outline: none; }
.cdlg__reason { flex: none; margin: 12px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255, 138, 61, 0.4); background: rgba(255, 138, 61, 0.12); color: var(--accent-2); font-size: 0.92rem; line-height: 1.45; }
.cdlg__main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.cdlg__nav { display: flex; flex-direction: column; gap: 6px; overflow: auto; padding-right: 2px; scrollbar-width: thin; }
.cdlg__navbtn {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 12px; text-align: left;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.04); color: var(--text); font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cdlg__navbtn[hidden] { display: none; }
.cdlg__navicon { flex: none; font-size: 1.3rem; line-height: 1; }
.cdlg__navtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cdlg__navtext b { font-size: 0.98rem; font-weight: 600; }
.cdlg__navtext small { font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.cdlg__navbtn:hover, .cdlg__navbtn:focus-visible { border-color: rgba(255, 190, 110, 0.6); background: rgba(255, 255, 255, 0.08); outline: none; }
.cdlg__navbtn.is-active { border-color: rgba(255, 138, 61, 0.7); background: linear-gradient(135deg, rgba(255, 164, 88, 0.22), rgba(255, 255, 255, 0.05)); }
.cdlg__navbtn.is-active .cdlg__navtext small { color: #ffd48f; }
.cdlg__panes { min-height: 0; overflow: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.cdlg__pane { display: flex; flex-direction: column; gap: 12px; }
.cdlg__pane[hidden] { display: none; }
.cdlg__card { padding: 14px 16px 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.045); }
.cdlg__card h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; letter-spacing: 0.01em; }
.cdlg__hidden-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cdlg__muted { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; line-height: 1.5; }
.cdlg__muted:empty { display: none; }
.cdlg__row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.cdlg__row--between { justify-content: space-between; }
.cdlg input[type="password"], .cdlg input[type="text"], .cdlg input[type="number"], .cdlg select, .cdlg__input {
  flex: 1; width: 100%; min-height: 46px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff; padding: 10px 12px; border-radius: 12px; font: 500 0.95rem var(--font-body);
}
.cdlg select option { color: #000; }
.cdlg input:focus, .cdlg select:focus { outline: 2px solid rgba(255, 138, 61, 0.6); outline-offset: 1px; }
.cdlg__label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; font-size: 0.88rem; color: var(--muted); }
.cdlg__label--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.cdlg__label--inline input { flex: 1; margin-left: 12px; max-width: 260px; min-height: 0; accent-color: var(--accent); }
.cdlg__fieldset { border: 0; margin: 6px 0 0; padding: 0; font-size: 0.88rem; }
.cdlg__fieldset label { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); line-height: 1.45; cursor: pointer; }
.cdlg__fieldset label:hover { background: rgba(255, 255, 255, 0.08); }
.cdlg__fieldset label:has(input:checked) { border-color: rgba(255, 138, 61, 0.6); background: rgba(255, 138, 61, 0.1); }
.cdlg__fieldset b { color: var(--text); }
.cdlg__check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 4px 0 0; font-size: 0.9rem; line-height: 1.4; cursor: pointer; }
.cdlg input[type="checkbox"], .cdlg input[type="radio"] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.cdlg__footer { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0 4px; margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.cdlg__footer .cbtn { min-height: 48px; min-width: 120px; justify-content: center; }
/* a phone, or any narrow screen: the rail becomes a row of tabs above the pane */
@media (max-width: 760px) {
  .cdlg__main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .cdlg__nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .cdlg__nav::-webkit-scrollbar { display: none; }
  .cdlg__navbtn { flex: none; min-height: 44px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
  .cdlg__navtext small { display: none; }
  .cdlg__footer .cbtn { flex: 1; min-width: 0; }
}
/* a phone on its side: everything a notch tighter */
@media (orientation: landscape) and (max-height: 540px) {
  .cdlg__form { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .cdlg__title { font-size: 1.3rem; }
  .cdlg__main { margin-top: 10px; gap: 12px; }
  .cdlg__card { padding: 10px 12px 12px; }
  .cdlg__footer { padding: 8px 0 2px; margin-top: 6px; }
  .cdlg__footer .cbtn { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .cdlg { animation: none; } }

/* Phone */
.phone {
  --phone-w: 340px;
  --phone-h: 690px;
  --phone-scale: 1;
  position: fixed;
  z-index: 60;
  right: 24px;
  top: 50%;
  transform: translateY(-50%) scale(var(--phone-scale));
  transform-origin: right center;
  width: var(--phone-w);
  height: var(--phone-h);
  font-family: var(--font-body);
  color: #f4f4f4;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.phone.is-open { opacity: 1; pointer-events: auto; }
.phone--center { right: auto; left: 50%; transform: translate(-50%, -50%) scale(var(--phone-scale)); transform-origin: center; }
.phone--center.is-open { transform: translate(-50%, -50%) scale(var(--phone-scale)); }
.phone__frame {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #2b2b30, #121216);
  border-radius: 44px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.phone__frame::before {
  content: '';
  position: absolute; inset: -6px; border-radius: 50px;
  background: linear-gradient(160deg, #ff8a3d, #b4410f);
  z-index: -1;
}
.phone__screen {
  position: absolute; inset: 12px; border-radius: 34px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #1a2c22 0%, #0a1410 55%, #060a08 100%);
  display: flex; flex-direction: column;
}
.phone__status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px 0; font-size: 0.78rem; font-weight: 600; color: #cfd8d0; height: 38px;
}
.phone__notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #0a0a0c; border-radius: 0 0 16px 16px; z-index: 3; }
.phone__body { flex: 1; overflow: hidden; position: relative; }
.phone__app { position: absolute; inset: 0; display: none; flex-direction: column; padding: 14px 18px 12px; overflow: auto; }
.phone__app.is-active { display: flex; }
.phone__homebar { height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.phone__homebar::after { content: ''; width: 110px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.45); }
.phone__close {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2); background: #1b1f1d; color: #fff; cursor: pointer; font-size: 1rem;
}
.phone__close:hover { background: #2a302c; }

.phone__clock { margin: 26px 0 4px; font-size: 2.6rem; font-weight: 300; letter-spacing: -0.02em; text-align: center; }
.phone__date { text-align: center; color: #b7c2b9; font-size: 0.85rem; margin-bottom: 18px; }
.phone__contact {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 14px;
}
.phone__avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; background: #2d4a3a; }
.phone__avatar svg { width: 100%; height: 100%; display: block; }
.phone__avatar--big { width: 108px; height: 108px; margin: 18px auto 10px; box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.35); }
.phone__contact-name { font-weight: 700; font-size: 1rem; }
.phone__contact-sub { color: #9db2a2; font-size: 0.78rem; }
.phone__callbtn {
  width: 100%; border: none; border-radius: 16px; padding: 14px; font: 700 1rem var(--font-body); cursor: pointer;
  background: linear-gradient(135deg, #3ddc84, #1fa85e); color: #062112; display: flex; justify-content: center; gap: 8px; align-items: center;
  box-shadow: 0 8px 20px rgba(61, 220, 132, 0.25);
}
.phone__callbtn:hover { filter: brightness(1.08); }
.phone__callbtn[disabled] { opacity: 0.6; cursor: default; }
.phone__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.phone__appicon { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; color: #e6ede8; cursor: pointer; font-size: 0.7rem; }
.phone__appicon span:first-child {
  width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); border: 1px solid rgba(255, 255, 255, 0.1);
}
.phone__appicon:hover span:first-child { background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)); }
.phone__hint { color: #8fa596; font-size: 0.75rem; text-align: center; margin-top: auto; line-height: 1.4; }

.phone__apphead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.phone__back { background: none; border: none; color: var(--accent-2); cursor: pointer; font-size: 0.9rem; padding: 4px 6px 4px 0; }
.phone__apptitle { font-weight: 700; font-size: 1.05rem; }

/* Call app */
.phone__call { display: flex; flex-direction: column; height: 100%; }
.phone__callname { text-align: center; font-weight: 700; font-size: 1.2rem; }
.phone__callstate { text-align: center; color: #9db2a2; font-size: 0.82rem; min-height: 1.2em; }
.phone__timer { text-align: center; color: #cfe3d4; font-variant-numeric: tabular-nums; font-size: 0.85rem; margin-top: 2px; }
.phone__wave { display: block; width: 100%; height: 44px; margin: 8px 0 4px; }
.phone__transcript { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; font-size: 0.82rem; line-height: 1.35; scrollbar-width: thin; }
.phone__bubble { max-width: 88%; padding: 7px 10px; border-radius: 14px; white-space: pre-wrap; }
.phone__bubble--user { align-self: flex-end; background: #2f6f4f; border-bottom-right-radius: 4px; }
.phone__bubble--cara { align-self: flex-start; background: rgba(255, 255, 255, 0.1); border-bottom-left-radius: 4px; }
.phone__bubble--sys { align-self: center; background: none; color: #8fa596; font-size: 0.72rem; text-align: center; }
.phone__controls { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 8px; }
.phone__ctl { border: none; border-radius: 14px; padding: 10px 4px; background: rgba(255, 255, 255, 0.09); color: #fff; cursor: pointer; font-size: 0.72rem; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.phone__ctl span:first-child { font-size: 1.15rem; }
.phone__ctl:hover { background: rgba(255, 255, 255, 0.16); }
.phone__ctl.is-on { background: var(--accent); color: #1a0c04; }
.phone__ctl--end { background: #e5484d; }
.phone__ctl--end:hover { background: #ff5a5f; }
.phone__ctl--ptt.is-talking { background: #3ddc84; color: #062112; }
.phone__ctl.is-off { background: rgba(229, 72, 77, 0.22); color: #ffd9da; }
.phone__callbtn--video { margin-top: 8px; background: rgba(61, 220, 132, 0.16); color: #c9f7dc; border: 1px solid rgba(61, 220, 132, 0.4); }
.phone__error { color: #ffb3b3; font-size: 0.8rem; text-align: center; padding: 6px 4px; }
.phone__typed { display: flex; gap: 6px; padding: 4px 2px 2px; }
.phone__typed input { flex: 1; min-width: 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; color: inherit; font: inherit; font-size: 0.8rem; padding: 6px 10px; }
.phone__typed input:focus { outline: none; border-color: rgba(120,200,255,0.6); }
.phone__send { background: rgba(120,200,255,0.18); border: 1px solid rgba(120,200,255,0.35); border-radius: 10px; color: inherit; padding: 0 10px; cursor: pointer; }

/* Objectives / Journal */
.phone__list { display: flex; flex-direction: column; gap: 8px; }
.phone__item { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); font-size: 0.85rem; line-height: 1.4; }
.phone__item--done { opacity: 0.55; text-decoration: line-through; }
.phone__item--current { border: 1px solid rgba(255, 138, 61, 0.55); background: rgba(255, 138, 61, 0.12); }
.phone__item--locked { color: #7c8f82; font-style: italic; }
.phone__item h4 { margin: 0 0 4px; font-size: 0.85rem; color: var(--accent-2); }
.phone__map { width: 100%; aspect-ratio: 1; border-radius: 14px; background: #0c1a12; display: block; }
.phone__legend { font-size: 0.72rem; color: #9db2a2; margin-top: 8px; line-height: 1.5; }

@media (max-height: 760px) { .phone { --phone-scale: 0.86; } }
@media (max-height: 640px) { .phone { --phone-scale: 0.74; } }
@media (max-width: 480px) { .phone { --phone-scale: 0.8; right: 8px; } }

/* ---- The console (engine/client/ui/phone.js with `console: true`): in the game there is no phone on screen. Base
   works at their own screen: a window over the dimmed world on a computer or an iPad, the whole screen on a phone.
   A rail of apps (a bottom bar on a phone) instead of a home screen, and everything at a size a thumb can hit. ---- */
.phone--console {
  --con-edge: rgba(255, 255, 255, 0.12);
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  width: auto; height: auto; transform: none; filter: none;
  padding: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
  background: rgba(3, 8, 5, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  transition: opacity 0.18s ease;
}
.phone--console .phone__frame {
  position: relative; inset: auto; width: min(1080px, 100%); height: min(740px, 100%);
  padding: 0; border-radius: 22px; border: 1px solid var(--con-edge);
  background: linear-gradient(170deg, #12211a, #070f0b 60%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.phone--console .phone__frame::before { display: none; }
.phone--console .phone__screen { position: relative; inset: auto; height: 100%; border-radius: 0; background: none; }
.con__bar {
  display: flex; align-items: center; gap: 12px; flex: none; height: 54px; padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--con-edge); background: rgba(255, 255, 255, 0.04);
}
.con__where { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.con__where b { font-size: 0.72rem; letter-spacing: 0.24em; color: var(--accent); white-space: nowrap; }
.con__where span { font-size: 0.86rem; color: #cfe0d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con__meta { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: #9db2a2; font-variant-numeric: tabular-nums; }
.con__sig { color: #8ff0b5; letter-spacing: 0.04em; }
.con__x {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid transparent; background: none; color: #cfe0d4; font-size: 1.05rem; cursor: pointer;
}
.con__x:hover, .con__x:focus-visible { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); color: #fff; outline: none; }
.con__main { flex: 1; min-height: 0; display: flex; }
.con__rail {
  flex: none; width: 188px; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px;
  border-right: 1px solid var(--con-edge); background: rgba(0, 0, 0, 0.22); overflow: auto; scrollbar-width: thin;
}
.con__railbtn {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 12px;
  border: 1px solid transparent; background: none; color: #dfe8e1; font: 600 0.92rem var(--font-body); text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.con__railicon { flex: none; font-size: 1.2rem; line-height: 1; }
.con__railbtn:hover, .con__railbtn:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.con__railbtn.is-active { background: linear-gradient(135deg, rgba(255, 164, 88, 0.26), rgba(255, 255, 255, 0.05)); border-color: rgba(255, 138, 61, 0.55); color: #fff; }
.con__railbtn--settings { margin-top: auto; }
.phone--console .phone__body { flex: 1; min-width: 0; }
.phone--console .phone__app { padding: 16px 20px 18px; }
.phone--console .phone__app[data-app="call"] { background: none; }
.phone--console .phone__apphead { margin-bottom: 12px; }
.phone--console .phone__back { display: none; }
.phone--console .phone__apptitle { font: 700 1.25rem/1.2 var(--font-display, var(--font-body)); letter-spacing: 0.03em; }
/* the panes have room on a console: the lists go two or three across, the map keeps its square */
.phone--console .phone__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; align-content: start; }
.phone--console .phone__item { font-size: 0.88rem; }
.phone--console .phone__map { max-width: min(600px, 100%); margin-inline: auto; }
.phone--console .phone__legend { max-width: 70ch; }
.phone--console .phone__tabs { grid-column: 1 / -1; }
.phone--console .phone__store { max-width: 620px; }
/* the Call pane: who she is and the call button when the line is quiet, the call itself when it is not */
.con__callhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.con__callhead .phone__contact { flex: 1 1 240px; margin: 0; }
.con__callhead .phone__callbtn { flex: 0 0 auto; width: auto; padding: 13px 22px; }
.con__callhead .phone__minutes { flex: 0 0 auto; width: auto; margin: 0; }
.phone--console .phone__call { max-width: 860px; width: 100%; margin-inline: auto; }
.con__hint { margin: 2px 0 10px; max-width: 70ch; color: #9db2a2; font-size: 0.84rem; line-height: 1.5; }
.con__hint kbd { font: inherit; font-weight: 700; color: #dfe8e1; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.2); }
.phone--console.is-oncall .con__hint { display: none; }
.phone--console .phone__callstate { text-align: left; font-size: 0.88rem; }
.phone--console .phone__timer { text-align: left; }
.phone--console .phone__transcript { font-size: 0.9rem; }
.phone--console .phone__bubble { max-width: 72%; padding: 9px 13px; }
.phone--console .phone__controls { max-width: 560px; margin-inline: auto; width: 100%; }
.phone--console .phone__ctl { min-height: 54px; font-size: 0.78rem; }
.phone--console .phone__typed input { font-size: 0.95rem; padding: 10px 12px; }
.phone--console:not(.is-oncall) .phone__controls, .phone--console:not(.is-oncall) .phone__micmode, .phone--console:not(.is-oncall) .phone__wave { display: none; }
.phone--console.is-oncall .con__callhead .phone__callbtn { display: none; }
.phone--console.is-oncall .con__callhead .phone__minutes { display: none; }
/* a phone, or a short screen: the console is the whole screen (an iPad keeps the window, with a margin) */
@media (max-width: 760px), (max-height: 620px) {
  .phone--console { padding: 0; background: rgba(3, 8, 5, 0.86); }
  .phone--console .phone__frame { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .con__bar { padding-left: calc(14px + env(safe-area-inset-left, 0px)); padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
}
@media (max-width: 430px) {
  .con__where b { display: none; }
}
@media (max-width: 760px) {
  .con__main { flex-direction: column-reverse; }
  .con__rail {
    width: auto; flex-direction: row; gap: 2px; padding: 6px calc(6px + env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px));
    border-right: 0; border-top: 1px solid var(--con-edge); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .con__rail::-webkit-scrollbar { display: none; }
  .con__railbtn { flex: 1 1 0; min-width: 46px; flex-direction: column; gap: 3px; min-height: 56px; padding: 6px 2px; justify-content: center; text-align: center; font-size: 0.62rem; }
  .con__raillabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .con__railbtn--settings { margin-top: 0; }
  .con__railicon { font-size: 1.25rem; }
  .phone--console .phone__app { padding: 12px 14px 14px; }
  .con__callhead { gap: 8px; }
  .con__callhead .phone__callbtn { flex: 1 1 100%; }
}

/* Items & journal playback */
.phone__find-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.phone__find-head h4 { margin: 0; }
.phone__play { border: none; border-radius: 999px; width: 30px; height: 30px; background: var(--accent); color: #1a0c04; cursor: pointer; font-size: 0.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.phone__play:hover { filter: brightness(1.12); }
.phone__play.is-playing { background: #3ddc84; }
.phone__item--find div:last-child { margin-top: 4px; color: #d3ddd5; }
/* Codex */
.phone__tabs { display: flex; gap: 6px; margin: 2px 0 10px; flex-wrap: wrap; }
.phone__tab { flex: 1; min-width: 0; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: inherit; border-radius: 999px; padding: 5px 8px; font: inherit; font-size: 0.72rem; cursor: pointer; white-space: nowrap; }
.phone__tab.is-active { background: rgba(255, 138, 61, 0.22); border-color: rgba(255, 138, 61, 0.6); }
.phone__fact { margin-top: 6px; padding-left: 10px; border-left: 2px solid rgba(255, 230, 160, 0.35); color: #d3ddd5; font-size: 0.8rem; }
.phone__fact--more { border-left-color: transparent; color: #8fa596; font-style: italic; }
.phone__item--set { border: 1px solid rgba(255, 230, 160, 0.35); background: rgba(255, 230, 160, 0.08); }
.phone__item--heard h4 { color: #ffe6a0; }

/* ---- Generated artwork (assets/images) ---- */
.phone__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone__app[data-app="home"] { background: linear-gradient(180deg, rgba(6, 10, 8, 0.3) 0%, rgba(8, 14, 11, 0.86) 30%, #0a1410 44%), url(../assets/images/web/phone-wallpaper-360.webp) center top / 100% auto no-repeat; }
.phone__app[data-app="call"] { background: linear-gradient(180deg, rgba(6, 10, 8, 0.72) 0%, rgba(6, 10, 8, 0.92) 40%, #060a08 75%), url(../assets/images/web/phone-wallpaper-360.webp) center top / cover no-repeat; }
.overlay__art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 15%; border-radius: 14px; margin: 0 0 16px; }   /* 3:2 art keeps the top: heads, not boots */
#loading { background-image: linear-gradient(rgba(6, 10, 8, 0.55), rgba(6, 10, 8, 0.85)), url(../assets/images/web/hero-jungle-1280.webp); background-size: cover; background-position: center; }

/* who takes the field leg (start overlay) */
.picker { margin: 14px 0 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.picker__label { grid-column: 1 / -1; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted, #9db2a2); }
.picker__btn { font: inherit; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.picker__btn span { font-size: 0.78rem; color: #b7c2b9; line-height: 1.35; }
.picker__btn:hover { background: rgba(255, 255, 255, 0.1); }
.picker__btn.is-active { border-color: #ff8a3d; background: rgba(255, 138, 61, 0.14); }
a.picker__btn { text-decoration: none; }
.chapters__campaign { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 6px; }
.chapters-details { margin: 12px 0 4px; }
.chapters-details summary { cursor: pointer; font-size: 0.85rem; color: #b7c2b9; }
.chapters-details[open] summary { margin-bottom: 8px; }

.phone__contact-mood { color: #8fb3a0; font-size: 0.72rem; margin-top: 2px; letter-spacing: 0.02em; }

/* Sat-Link minutes: the strip under the call buttons and the store app (display only until billing exists) */
.phone__minutes { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.06); color: #dfe8e1; font: 600 0.78rem var(--font-body); cursor: pointer; text-align: left; }
.phone__minutes:hover { background: rgba(255, 255, 255, 0.11); }
.phone__minutes-text { flex: 1; }
.phone__minutes-arrow { color: #9db2a2; }
.phone__store { display: flex; flex-direction: column; gap: 10px; }
.phone__balance { padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(255, 138, 61, 0.18), rgba(255, 255, 255, 0.06)); border: 1px solid rgba(255, 138, 61, 0.35); }
.phone__balance b { display: block; font-size: 1.35rem; font-weight: 300; letter-spacing: -0.01em; }
.phone__balance span { display: block; color: #cfe3d4; font-size: 0.76rem; line-height: 1.4; margin-top: 4px; }
.phone__pack { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); border: 1px solid transparent; }
.phone__pack--best { border-color: rgba(255, 138, 61, 0.55); background: rgba(255, 138, 61, 0.12); }
.phone__pack h4 { margin: 0; font-size: 0.9rem; }
.phone__pack-sub { color: #9db2a2; font-size: 0.72rem; line-height: 1.35; grid-column: 1; }
.phone__pack-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #1a0c04; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.phone__buy { grid-row: 1 / span 2; border: none; border-radius: 999px; padding: 8px 12px; background: linear-gradient(135deg, #3ddc84, #1fa85e); color: #062112; font: 700 0.78rem var(--font-body); cursor: pointer; white-space: nowrap; }
.phone__buy:hover { filter: brightness(1.08); }
.phone__storenote { color: #8fa596; font-size: 0.72rem; line-height: 1.45; text-align: center; padding: 0 4px; }
.phone__storenote a { color: var(--accent-2); }

/* hands-free or hold to talk: the talk button holds, the pill under the controls switches */
.phone__ctl--ptt { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.phone__micmode { margin: 8px auto 0; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: #b7c2b9; font: 600 0.68rem var(--font-body); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.phone__micmode:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
