/* Living Dolls terminals: a late-1970s amber monochrome screen. Glowing text on black glass, scanlines, a blinking
   block cursor and big keys. System monospace fonts only (nothing is fetched from other sites). */

:root {
  --amber: #ffb21e;
  --amber-hi: #ffd27a;
  --amber-dim: #b97a10;
  --amber-faint: rgba(255, 178, 30, 0.14);
  --glass: #0b0703;
  --black: #050302;
  --glow: 0 0 2px rgba(255, 178, 30, 0.9), 0 0 9px rgba(255, 150, 20, 0.45);
  --glow-big: 0 0 3px rgba(255, 190, 60, 0.95), 0 0 14px rgba(255, 150, 20, 0.55);
  --mono: "Courier New", Courier, ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { background: var(--black); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 40%, #1a1006 0%, var(--black) 75%);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.45;
  text-shadow: var(--glow);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scanlines and a slow flicker over the whole glass. pointer-events: none so they never get in the way of a key. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0, rgba(0, 0, 0, 0.28) 1px, transparent 1px, transparent 3px);
  animation: flicker 6s infinite steps(1);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 49;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.86; }
  42% { opacity: 1; }
  77% { opacity: 0.92; }
  78% { opacity: 1; }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes soft { 50% { opacity: 0.45; } }
@keyframes warm { from { opacity: 0; filter: brightness(2.2) blur(1px); } to { opacity: 1; filter: none; } }

a { color: var(--amber-hi); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .view:focus-visible {
  outline: 2px dashed var(--amber-hi);
  outline-offset: 3px;
}
.view:focus { outline: none; }

.crt { padding: 18px 16px 28px; }
.screen {
  max-width: 980px;
  margin: 0 auto;
  background: var(--glass);
  border-radius: 22px;
  padding: 14px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.9), 0 0 0 2px #1d1309, 0 0 40px rgba(255, 140, 0, 0.08);
}
.frame {
  border: 4px double var(--amber);
  box-shadow: var(--glow), inset 0 0 0 1px rgba(255, 178, 30, 0.15);
  padding: 18px 22px 12px;
  min-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  animation: warm 0.6s ease-out;
}

/* ---- the header, as on the cabinet's screen ---- */
.head { text-align: center; }
.banner { margin: 4px 0 6px; font-size: clamp(32px, 7.6vw, 64px); letter-spacing: 0.08em; line-height: 1.05; font-weight: 700; }
.banner a {
  display: inline-block;
  padding: 2px 0.35em;
  background: var(--amber);
  color: #1b0f02;
  text-decoration: none;
  text-shadow: none;
  box-shadow: var(--glow-big);
}
.sub, .sub2 { margin: 2px 0; letter-spacing: 0.14em; font-weight: 700; }
.sub { font-size: clamp(17px, 3vw, 24px); }
.sub2 { font-size: clamp(14px, 2.4vw, 19px); }
.heart { width: 0.8em; height: auto; vertical-align: -0.05em; image-rendering: pixelated; filter: drop-shadow(0 0 3px rgba(255, 160, 20, 0.7)); }
.rule, hr { border: 0; border-top: 2px solid var(--amber); box-shadow: var(--glow); margin: 12px 0; }
hr.dash { border-top: 2px dashed var(--amber-dim); box-shadow: none; }

/* ---- the desk's message after every action ---- */
.msg { min-height: 1.45em; margin: 2px 0 10px; font-weight: 700; color: var(--amber-hi); overflow-wrap: anywhere; }
.msg:not(:empty)::before { content: "> "; }
.msg.bad { color: #ff8a3a; }

.view { flex: 1; overflow-wrap: anywhere; }
.foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 8px; border-top: 1px dashed var(--amber-dim); font-weight: 700; letter-spacing: 0.1em; }
.cursor { display: inline-block; width: 0.6em; height: 1em; background: var(--amber); vertical-align: -0.12em; box-shadow: var(--glow); animation: blink 1.06s infinite steps(1); }
.blink-soft { animation: soft 1.6s infinite; }

/* ---- text ---- */
h2 { font-size: clamp(22px, 4vw, 32px); letter-spacing: 0.1em; margin: 14px 0 8px; text-align: center; }
h3 { font-size: 19px; letter-spacing: 0.12em; margin: 18px 0 6px; text-transform: uppercase; }
p { margin: 8px 0; }
.big { font-size: clamp(26px, 6vw, 46px); font-weight: 700; letter-spacing: 0.08em; text-align: center; margin: 12px 0; text-shadow: var(--glow-big); line-height: 1.1; }
.center { text-align: center; }
.dim { color: var(--amber-dim); text-shadow: none; }
.hi { color: var(--amber-hi); }
.inv { background: var(--amber); color: #1b0f02; text-shadow: none; padding: 0 0.3em; font-weight: 700; }
.small { font-size: 15px; }
ul.ticks { list-style: none; padding: 0; margin: 8px 0; }
ul.ticks li { padding-left: 1.6em; text-indent: -1.6em; margin: 4px 0; }
ul.ticks li::before { content: "* "; color: var(--amber-hi); }
.box { border: 2px solid var(--amber-dim); padding: 10px 14px; margin: 12px 0; }
.box.hot { border-color: var(--amber); box-shadow: var(--glow); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }

/* The trial clock: big segmented numbers. */
.clock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.clock div { text-align: center; min-width: 74px; }
.clock b { display: block; font-size: clamp(38px, 9vw, 72px); line-height: 1; border: 2px solid var(--amber); padding: 6px 8px; box-shadow: var(--glow); font-variant-numeric: tabular-nums; }
.clock span { display: block; font-size: 13px; letter-spacing: 0.16em; margin-top: 4px; }

/* ---- keys ---- */
.keys { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0; }
.key {
  font: inherit;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--amber);
  background: #120a03;
  border: 3px solid var(--amber);
  border-radius: 4px;
  min-height: 54px;
  min-width: 140px;
  padding: 8px 20px;
  cursor: pointer;
  text-shadow: var(--glow);
  box-shadow: var(--glow), inset 0 -4px 0 rgba(255, 178, 30, 0.18);
  text-transform: uppercase;
}
.key::before { content: "[ "; }
.key::after { content: " ]"; }
.key:hover:not(:disabled), .key:focus-visible { background: var(--amber); color: #1b0f02; text-shadow: none; }
.key:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--glow); }
.key:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }
.key.ghost { border-style: dashed; }
.key.small { font-size: 15px; min-height: 42px; min-width: 0; padding: 6px 12px; }
.key.wide { width: 100%; }
.key.busy::after { content: " ]"; animation: soft 0.8s infinite; }

/* The management tabs. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tab { font: inherit; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; color: var(--amber); background: transparent; border: 2px solid var(--amber-dim); padding: 7px 10px; min-height: 40px; cursor: pointer; text-shadow: var(--glow); text-transform: uppercase; }
.tab[aria-current="page"], .tab:hover, .tab:focus-visible { border-color: var(--amber); background: var(--amber); color: #1b0f02; text-shadow: none; }

/* ---- forms ---- */
label { display: block; margin: 10px 0 4px; font-weight: 700; }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  font: inherit;
  font-size: 18px;
  width: 100%;
  max-width: 100%;
  color: var(--amber-hi);
  background: #070401;
  border: 2px solid var(--amber-dim);
  border-radius: 0;
  padding: 8px 10px;
  text-shadow: var(--glow);
  caret-color: var(--amber);
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: var(--glow); outline: none; }
textarea { min-height: 110px; resize: vertical; }
select option { background: #070401; color: var(--amber); }
.help { font-size: 15px; color: var(--amber-dim); text-shadow: none; margin: 2px 0 0; }
.req { color: var(--amber-hi); }

/* A rule he must accept: a big tickbox drawn as [X]. */
.accept { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; cursor: pointer; font-weight: 400; }
.accept input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.accept .tick { flex: none; font-weight: 700; min-width: 3.2ch; }
.accept .tick::before { content: "[ ]"; }
.accept input:checked + .tick::before { content: "[X]"; color: var(--amber-hi); }
.accept input:focus-visible + .tick { outline: 2px dashed var(--amber-hi); outline-offset: 2px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice .accept { margin: 4px 14px 4px 0; }
.choice .accept .tick::before { content: "( )"; }
.choice .accept input:checked + .tick::before { content: "(*)"; }

/* ---- lists and tables ---- */
.rows { display: grid; gap: 8px; margin: 10px 0; }
.row { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 2px solid var(--amber-dim); padding: 8px 12px; cursor: pointer; text-shadow: var(--glow); }
.row:hover, .row:focus-visible { border-color: var(--amber); background: var(--amber-faint); }
.row .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.row .line { font-size: 15px; color: var(--amber-dim); text-shadow: none; }
.tag { display: inline-block; border: 1px solid currentColor; padding: 0 6px; font-size: 14px; letter-spacing: 0.08em; margin-left: 4px; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 16px; margin: 8px 0; }
.kv dt { color: var(--amber-dim); text-shadow: none; }
.kv dd { margin: 0; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 16px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px dashed var(--amber-dim); vertical-align: top; }
th { letter-spacing: 0.08em; }
td.num, th.num { text-align: right; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.stat { border: 2px solid var(--amber-dim); padding: 8px 10px; }
.stat b { display: block; font-size: 30px; line-height: 1.1; }
.stat span { font-size: 14px; letter-spacing: 0.08em; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.qrow { border: 2px dashed var(--amber-dim); padding: 8px 12px; margin: 10px 0; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline > * { flex: 1 1 140px; }

/* ---- the "are you sure" box ---- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--glass); border: 4px double var(--amber); box-shadow: var(--glow-big); padding: 16px 20px; max-width: 560px; width: 100%; text-align: center; }

/* The page that says a link has been used (served by Web.cs itself). */
.stale .frame { text-align: center; }
.stale .ready { margin-top: auto; text-align: left; font-weight: 700; }

/* ---- a phone ---- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .crt { padding: 8px 6px 14px; }
  .screen { padding: 6px; border-radius: 12px; }
  .frame { padding: 12px 10px 10px; border-width: 3px; min-height: calc(100vh - 44px); }
  .key { min-width: 0; flex: 1 1 100%; font-size: 18px; }
  .key.small { flex: 0 1 auto; }
  .clock { gap: 6px; }
  .clock div { min-width: 0; flex: 1; }
  .clock b { padding: 4px 2px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 6px; }
  table { font-size: 14px; }
  th, td { padding: 4px 4px; }
  .sub { letter-spacing: 0.06em; }
  .sub2 { letter-spacing: 0.04em; }
}

/* No flicker, no blinking, no typing for people who ask their system for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cursor { opacity: 1; }
}
