/* Face-off overlay (ui/faceoff.js). Tokens from app.css only; three font sizes via --fs-* / .title / .body / .mega.
   No rounded corners (app.css zeroes them). Motion is driven from JS. */

.fo-host { display: contents; }

/* Above the tab bar (20) and sheets (100/101), below toasts (200). */
.fo-root {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow: clip;
  touch-action: none;
  overscroll-behavior: contain;
}
.fo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 31, 59, .85);
}
.fo-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding:
    calc(var(--sat) + var(--gap))
    calc(var(--sar) + var(--gap))
    calc(var(--sab) + var(--gap) + 20px)
    calc(var(--sal) + var(--gap));
}

/* The stack: the focused card, with up to two cards peeking out behind it. */
.fo-stack {
  --fo-av: min(96px, 26vw);
  position: relative;
  width: 100%;
  max-width: 420px;
}
.fo-ghost {
  position: absolute;
  inset: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  transform-origin: 50% 100%;
}
.fo-ghost-1 { transform: translate3d(0, 12px, 0) scale(.95); opacity: .75; }
.fo-ghost-2 { transform: translate3d(0, 24px, 0) scale(.90); opacity: .4; }

.fo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--gap);
  background: var(--ink-2);
  border: 3px solid var(--accent);
  color: var(--butter);
  overflow-x: clip;
  outline: none;
  will-change: transform, opacity;
}
.fo-card.fo-out { cursor: pointer; }
.fo-top { display: flex; justify-content: flex-end; min-height: 1.35em; margin-bottom: -8px; }
.fo-count { font-weight: 700; }
.fo-count[hidden] { display: none; }

/* The fight: two avatars, VS between them. */
.fo-faces {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 4px 0 0;
}
.fo-side { flex: none; display: block; will-change: transform; }
.fo-faces .avatar {
  width: var(--fo-av) !important;
  height: var(--fo-av) !important;
}
.fo-vs {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  margin: 0 -6px;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--ink);
  will-change: transform;
}
.fo-knocked { opacity: .4; filter: grayscale(1); transform: translate3d(6px, 4px, 0) rotate(16deg); }
.fo-left.fo-knocked { transform: translate3d(-6px, 4px, 0) rotate(-16deg); }

.fo-title { text-align: center; overflow-wrap: anywhere; }
.fo-guess { text-align: center; overflow-wrap: anywhere; }
.fo-pts { text-align: center; }

/* Under each face on a result card: who it is and what it means for them. */
.fo-caps { display: flex; justify-content: space-between; align-items: flex-start; margin-top: -4px; }
.fo-cap { width: var(--fo-av); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fo-cap-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-chip { display: block; width: 100%; padding: 6px 4px; font-weight: 800; color: var(--ink); background: var(--butter); }
.fo-chip.good { background: var(--mint); }
.fo-chip.bad { background: var(--pink); }
.fo-chip.butter { background: var(--butter); }

.fo-step { display: flex; flex-direction: column; gap: inherit; will-change: transform, opacity; }
.fo-actions { display: flex; flex-direction: column; gap: 8px; }
.fo-pick { flex-direction: column; gap: 2px; min-height: 64px; width: 100%; }
.fo-sub { font-weight: 500; opacity: .8; overflow-wrap: anywhere; }
.fo-later, .fo-nice { width: 100%; }

/* "Accused!": a compact card that flies up and off the top. Never takes input. */
.fo-sendlayer {
  position: fixed;
  inset: 0;
  z-index: 151;
  overflow: clip;
  pointer-events: none;
  display: grid;
  place-items: center;
  padding: var(--sat) var(--gap) var(--sab);
}
.fo-sendlayer:empty { display: none; }
.fo-sendcard {
  --fo-av: min(72px, 20vw);
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 300px);
  padding: var(--gap);
  background: var(--ink-2);
  border: 3px solid var(--accent);
  color: var(--butter);
  will-change: transform, opacity;
}
.fo-sendcard .fo-vs { font-size: var(--fs-title); font-weight: 800; text-shadow: none; line-height: 1; margin: 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .fo-card, .fo-side, .fo-vs { will-change: auto; }
}

/* Short phones (iPhone SE and friends): keep the whole card on screen. */
@media (max-height: 640px) {
  .fo-card { gap: 8px; }
  .fo-pick { min-height: 56px; }
  .fo-stage { padding-bottom: calc(var(--sab) + var(--gap) + 12px); }
}
