/* Phone controller. Mobile first; big targets; one thing to do per screen.
   The phone is all stage: dark, with a white bar on top and one bright card for the thing to do. */
body { min-height: 100dvh; }
.phone { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
body.zombie .phone::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px var(--lilac);
  z-index: 5;
}
.p-timer { position: sticky; top: 0; height: 4px; margin: 0 -16px; background: var(--stage-3); z-index: 4; }
.p-timer-fill { height: 100%; width: 0; background: var(--green); }
.p-timer-fill.low { background: var(--alert); }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-top: 8px; padding: 4px 4px 4px 12px; background: var(--paper); color: var(--ink); border-radius: var(--r-m); }
.p-logo { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.p-logo .wm-long { display: none; } /* the phone header is narrow: the full name is in the page title and the join text */
.mark { width: 20px; height: 20px; border-radius: var(--r-s); background: radial-gradient(circle, var(--ink) 0 18%, var(--green) 19% 46%, var(--ink) 47%); flex: none; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.me .avatar { font-size: 12px; }
.me .avatar.zombie { --bg: var(--paper-2); background: var(--bg); color: var(--plum); outline-color: var(--plum); }
.me .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; }
/* the black end cap, like the call-to-action at the end of a nav bar */
.me .money { background: var(--ink); color: var(--paper); padding: 11px 16px 11px 12px; font-size: 14px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%); }
.p-main { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.center { text-align: center; align-items: center; }

h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 500; }
h1 { font-size: 32px; line-height: 1.13; letter-spacing: -1px; }
h1 .accent { display: block; color: var(--violet); }
h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.5px; }
p { margin: 0; line-height: 1.5; }
.muted { color: var(--text-muted); }
.kicker { font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--violet); font-size: 12px; }
.kicker.warn { color: var(--alert); }
.tile.hero { width: 64px; height: 64px; border-radius: var(--r-m); font-size: 26px; }
.tile.hero.ok { background: var(--green); color: var(--on-green); }
.tile.hero.warn { background: var(--alert); color: var(--on-alert); }
.tile.hero.zombie { background: var(--lilac); color: var(--on-lilac); }
.line { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.line .tile { width: 36px; height: 36px; color: var(--lilac); }

label.field { display: grid; gap: 8px; font-weight: 500; }
input[type="text"] {
  font: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border-radius: var(--r-m);
  border: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  color-scheme: light;
}
input[type="text"]::placeholder { color: var(--ink-muted); }
select { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-m); background: var(--paper); color: var(--ink); border: 1px solid var(--paper-line); width: 100%; color-scheme: light; }

.btn { --cut: 12px; width: 100%; min-height: 52px; padding: 14px 20px; font-size: 15px; }
.btn.quiet { --fill: var(--stage); --edge: var(--line); color: var(--text-muted); width: auto; min-height: 44px; padding: 10px 20px 10px 16px; font-size: 13px; align-self: center; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.error { color: var(--alert); font-weight: 500; }
.error:empty { display: none; }

.card { background: var(--stage-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; }
/* the badge-in card: lilac, black button, white field */
.join { --fill: var(--lilac); --cut: 24px; --cut-tl: 24px; --focus: var(--ink); color: var(--on-lilac); padding: 28px 24px 32px; }
.join .btn.ink { --focus: var(--paper); }
.join .error { color: var(--plum); }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.who > span { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--r-m); background: rgb(255 255 255 / 0.08); font-weight: 500; }
.who .avatar { font-size: 11px; }

/* question */
.q-head { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: 500; font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; }
.q-text { font-weight: 500; font-size: 22px; line-height: 1.25; letter-spacing: -0.5px; }
.answers { display: grid; gap: 8px; }
.answer {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 10px 14px 10px 10px;
  min-height: 60px;
  background: var(--stage-3);
  color: var(--text);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--fast) var(--ease), background var(--slow) var(--ease), color var(--slow) var(--ease), opacity var(--slow) var(--ease);
}
.answer:not(:disabled):active { transform: scale(0.985); }
.answer .letter { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-s); background: rgb(255 255 255 / 0.1); font-family: var(--font-label); }
.answer.struck { color: var(--text-muted); text-decoration: line-through; opacity: 0.5; }
.answers.locked .answer:not(.picked) { opacity: 0.4; }
.answers.locked .answer.picked { background: var(--lilac); color: var(--on-lilac); border-color: var(--paper); }
.answers.locked .answer.picked .letter { background: rgb(255 255 255 / 0.55); }
.answers.lagging .answer { opacity: 0.4; }
.answers.revealed .answer.wrong { opacity: 0.4; }
.answers.revealed .answer.wrong.picked { opacity: 0.8; }
.answers.revealed .answer.right { background: var(--green); color: var(--on-green); border-color: var(--green); opacity: 1; }
.answers.revealed .answer.right .letter { background: rgb(0 0 0 / 0.14); }

.status { border-radius: var(--r-m); padding: 14px 16px; font-weight: 500; font-size: 17px; line-height: 1.3; background: var(--stage-2); border: 1px solid var(--line); }
.status.ok { background: var(--green); color: var(--on-green); border-color: var(--green); }
.status.warn { background: var(--alert); color: var(--on-alert); border-color: var(--alert); }
.status.zombie { background: var(--lilac); color: var(--on-lilac); border-color: var(--lilac); }
.status small { display: block; font-weight: 400; font-size: 14px; line-height: 1.4; margin-top: 4px; }

/* item card */
.item-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left; width: 100%; background: var(--stage-2); border: 1px solid var(--green); border-radius: var(--r-m); padding: 12px 16px 12px 12px; }
.item-card.bad { border-color: var(--alert); }
.item-card .icon { grid-row: span 2; width: 44px; height: 44px; font-size: 20px; color: var(--green); }
.item-card.bad .icon { color: var(--alert); }
.item-card .nm { font-weight: 500; }
.item-card .tx { font-size: 14px; line-height: 1.4; color: var(--text-muted); }
.item-card .fw { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.item-card .fw .btn { width: auto; min-height: 44px; font-size: 13px; padding: 10px 20px 10px 16px; --fill: var(--stage-2); --edge: var(--text-muted); }

/* tests */
.emails { display: grid; gap: 8px; }
.email { background: var(--stage-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; display: grid; gap: 8px; }
.email .from { font-family: var(--font-label); font-size: 12.5px; color: var(--lilac); word-break: break-all; }
.email .subj { font-weight: 500; font-size: 15px; line-height: 1.35; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line); background: var(--stage-3); border-radius: var(--r-m); padding: 8px; font-family: var(--font-label); font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; touch-action: manipulation; }
.toggle button[aria-pressed="true"].phish { background: var(--alert); color: var(--on-alert); border-color: var(--alert); }
.toggle button[aria-pressed="true"].legit { background: var(--green); color: var(--on-green); border-color: var(--green); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slots button {
  min-height: 84px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--stage-3);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px;
}
.slots button .ic { width: 24px; height: 24px; }
.slots button .tk { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slots button .tk:empty { display: none; }
.slots button:disabled { opacity: 0.4; }
.slots button.mine { background: var(--lilac); color: var(--on-lilac); border-color: var(--paper); opacity: 1; }
.slots button.mine .tk { color: var(--ink-2); }
.targets { display: grid; gap: 8px; }
.targets button { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px 10px 10px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--stage-3); font-weight: 500; font-size: 18px; cursor: pointer; touch-action: manipulation; }
.targets button[aria-pressed="true"] { background: var(--alert); color: var(--on-alert); border-color: var(--alert); opacity: 1; }
.targets button:disabled:not([aria-pressed="true"]) { opacity: 0.4; }
.targets button .avatar { font-size: 14px; }
.ping { min-height: 300px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--stage-2); display: grid; place-items: center; text-align: center; font-family: var(--font-display); font-weight: 500; font-size: 24px; letter-spacing: -0.5px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; padding: 20px; }
.ping.go { background: var(--green); color: var(--on-green); border-color: var(--green); font-size: 44px; letter-spacing: -1px; }
.ping.early { background: var(--alert); color: var(--on-alert); border-color: var(--alert); }
.bits { display: grid; gap: 16px; }
.bit-q { display: grid; gap: 8px; }
.bit-q .pr { font-weight: 500; font-size: 17px; line-height: 1.35; }
.bit-opts { display: grid; gap: 8px; }
.bit-opts button { min-height: 48px; border: 1px solid var(--line); background: var(--stage-3); border-radius: var(--r-m); padding: 12px 14px; text-align: left; font-weight: 500; font-size: 16px; line-height: 1.35; cursor: pointer; touch-action: manipulation; }
.bit-opts button[aria-pressed="true"] { background: var(--lilac); color: var(--on-lilac); border-color: var(--paper); }

/* final */
.f-items { display: grid; gap: 8px; }
.f-items button { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 60px; padding: 10px 14px 10px 10px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--stage-3); font-weight: 500; font-size: 18px; line-height: 1.3; cursor: pointer; touch-action: manipulation; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.f-items button .box { width: 38px; height: 38px; border-radius: var(--r-s); background: rgb(255 255 255 / 0.1); display: grid; place-items: center; flex: none; }
.f-items button[aria-pressed="true"] { background: var(--lilac); color: var(--on-lilac); border-color: var(--paper); }
.f-items button[aria-pressed="true"] .box { background: rgb(255 255 255 / 0.55); }
.f-items button:disabled { opacity: 0.75; }
/* the reveal: which ones really belonged */
.f-items button.yes, .f-items button.no { opacity: 1; }
.f-items button.no:not([aria-pressed="true"]) { color: var(--text-muted); }
.f-items button.yes .box { background: var(--green); color: var(--on-green); }
.f-items button.no .box { background: var(--alert); color: var(--on-alert); }

.p-toast, .p-offline {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  font-weight: 500;
  padding: 14px 16px;
  border-radius: var(--r-m);
  text-align: center;
  z-index: 10;
  box-shadow: var(--shadow-stage);
}
.p-offline { background: var(--alert); color: var(--on-alert); }
.p-toast { background: var(--lilac); color: var(--on-lilac); }
.pop { animation: pop var(--slow) var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* One-Time Code and Password Policy */
input.code { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.18em; text-align: center; padding: 14px 8px; }
.policy { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.policy li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--stage-2); font-weight: 500; font-size: 16px; line-height: 1.3; }
.policy .box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; }
.policy .box svg { width: 16px; height: 16px; }
.policy li.met { border-color: var(--green); }
.policy li.met .box { background: var(--green); border-color: var(--green); color: var(--on-green); }
.policy li.zombie-rule { border-style: dashed; border-color: var(--lilac); }
.policy li.zombie-rule.met { border-color: var(--green); }
.policy small { color: var(--lilac); font-weight: 400; font-size: 13px; }
.targets button .tile { flex: none; }
