/* ================================================================
   Face Rank — Live 1v1 face battle styles
   Built on top of site.css; only adds .fo-* utility classes.
   ================================================================ */

:root {
  --fo-accent: #171717;
  --fo-win: #16a34a;
  --fo-loss: #dc2626;
  --fo-warn: #f59e0b;
  --fo-blue: #2563eb;
  --fo-purple: #7c3aed;
  --fo-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  --fo-serif: 'Times New Roman', 'Iowan Old Style', Georgia, serif;
}

/* ================================================================
   OMOGGLE-INSPIRED COMPONENTS (light theme port)
   ================================================================ */

/* === Small pill tag above titles (e.g. "● THE LAB · SOLO CALIBRATION") === */
.fo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fo-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.fo-eyebrow.neutral::before { background: var(--text-dim); }
.fo-eyebrow.ok::before { background: var(--fo-win); animation: fo-pulse 1.6s infinite; }
.fo-eyebrow.live::before { background: var(--fo-loss); animation: fo-pulse 1.4s infinite; }

@keyframes fo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* === Italic serif accent title (used selectively) === */
.fo-serif {
  font-family: var(--fo-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* === L-corner camera frame === */
.fo-cam-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 480px;
  margin: 0 auto;
}
.fo-cam-frame video,
.fo-cam-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fo-cam-frame canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Selfie-flip both video and overlay so they stay aligned */
.fo-cam-frame.selfie video,
.fo-cam-frame.selfie canvas { transform: scaleX(-1); }
.fo-cam-frame .corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  z-index: 4;
  pointer-events: none;
  mix-blend-mode: difference;
}
.fo-cam-frame .corner.tl { top: 8px;    left: 8px;    border-right: 0; border-bottom: 0; }
.fo-cam-frame .corner.tr { top: 8px;    right: 8px;   border-left: 0;  border-bottom: 0; }
.fo-cam-frame .corner.bl { bottom: 8px; left: 8px;    border-right: 0; border-top: 0; }
.fo-cam-frame .corner.br { bottom: 8px; right: 8px;   border-left: 0;  border-top: 0; }

.fo-cam-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.fo-cam-empty .dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.5;
}

/* === Status pill that floats on top of the camera === */
.fo-cam-status {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  z-index: 5;
  white-space: nowrap;
}
.fo-cam-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.fo-cam-status.live::before     { background: var(--fo-loss); animation: fo-pulse 1.4s infinite; }
.fo-cam-status.detected::before { background: var(--fo-win);  animation: fo-pulse 1.4s infinite; }
.fo-cam-status.warn::before     { background: var(--fo-warn); }
.fo-cam-status.error::before    { background: var(--fo-loss); }

/* === Progress strip along bottom of camera frame === */
.fo-cam-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--border);
  z-index: 5;
}
.fo-cam-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 0.15s linear;
}

/* === Big subscore rows (replaces the thin progress bars) === */
.fo-scorelist {
  display: flex;
  flex-direction: column;
}
.fo-scorelist-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.fo-scorelist-row:last-child { border-bottom: none; }
.fo-scorelist-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.fo-scorelist-val {
  font-family: var(--fo-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  min-width: 70px;
  text-align: right;
  transition: color 0.25s;
  font-variant-numeric: tabular-nums;
}
.fo-scorelist-val.placeholder { color: var(--text-dim); font-size: 1.3rem; font-weight: 600; }
.fo-scorelist-val.high { color: var(--fo-win); }
.fo-scorelist-val.mid  { color: var(--fo-warn); }
.fo-scorelist-val.low  { color: var(--fo-loss); }

/* Tiny `// analyzing 36%` line above the scorelist */
.fo-scorelist-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--fo-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* === Overall big number === */
.fo-overall {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.fo-overall-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.fo-overall-num {
  font-family: var(--fo-mono);
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
  transition: color 0.3s;
  font-variant-numeric: tabular-nums;
}
.fo-overall-num.placeholder { color: var(--text-dim); }
.fo-overall-num.high { color: var(--fo-win); }
.fo-overall-num.mid  { color: var(--fo-warn); }
.fo-overall-num.low  { color: var(--fo-loss); }

/* Face Score tier pill — square-rounded mono badge next to the overall score
   (distinct from .fo-tier-pill which is the rounded ELO-rank pill in
   arena / rank). */
.fo-face-tier {
  font-family: var(--fo-mono);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--text);
  color: var(--text);
  background: var(--bg);
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
}
.fo-face-tier.tier-s { border-color: #7c3aed; color: #7c3aed; background: rgba(124,58,237,0.08); }
.fo-face-tier.tier-a { border-color: var(--fo-win); color: var(--fo-win); background: rgba(22,163,74,0.08); }
.fo-face-tier.tier-b { border-color: var(--fo-blue); color: var(--fo-blue); background: rgba(37,99,235,0.08); }
.fo-face-tier.tier-c { border-color: var(--text-secondary); color: var(--text-secondary); }
.fo-face-tier.tier-d { border-color: var(--fo-warn); color: var(--fo-warn); background: rgba(245,158,11,0.08); }
.fo-face-tier.tier-f { border-color: var(--fo-loss); color: var(--fo-loss); background: rgba(220,38,38,0.06); }

/* === LOBBY: 4 cards in a row (replaces lone hero CTA) === */
.fo-lobby {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 32px 56px;
}
.fo-lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}
.fo-lobby-header-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.fo-lobby-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1024px) {
  .fo-lobby-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.fo-lobby-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.fo-lobby-card:hover {
  background: var(--surface);
  border-color: var(--text);
  transform: translateY(-2px);
}
.fo-lobby-card.primary {
  border-width: 1.5px;
  box-shadow: 0 1px 0 var(--text);
}
.fo-lobby-card.primary:hover {
  box-shadow: 0 4px 0 var(--text);
  transform: translateY(-3px);
}

/* === Lobby card color themes (subtle pastel gradient that fades to white) === */
.fo-lobby-card.color-arena {
  background: linear-gradient(170deg, #fff1f2 0%, #ffffff 65%);
  border-color: #fda4af;
}
.fo-lobby-card.color-arena .icon,
.fo-lobby-card.color-arena .cta { color: #e11d48; }
.fo-lobby-card.color-arena:hover { border-color: #e11d48; box-shadow: 0 6px 22px rgba(225,29,72,0.12); }
.fo-lobby-card.color-arena.primary { border-color: #e11d48; box-shadow: 0 1px 0 #e11d48; }
.fo-lobby-card.color-arena.primary:hover { box-shadow: 0 4px 0 #e11d48; }

.fo-lobby-card.color-lab {
  background: linear-gradient(170deg, #eff6ff 0%, #ffffff 65%);
  border-color: #93c5fd;
}
.fo-lobby-card.color-lab .icon,
.fo-lobby-card.color-lab .cta { color: #2563eb; }
.fo-lobby-card.color-lab:hover { border-color: #2563eb; box-shadow: 0 6px 22px rgba(37,99,235,0.12); }

.fo-lobby-card.color-rank {
  background: linear-gradient(170deg, #fffbeb 0%, #ffffff 65%);
  border-color: #fcd34d;
}
.fo-lobby-card.color-rank .icon,
.fo-lobby-card.color-rank .cta { color: #b45309; }
.fo-lobby-card.color-rank:hover { border-color: #b45309; box-shadow: 0 6px 22px rgba(180,83,9,0.12); }

.fo-lobby-card.color-room {
  background: linear-gradient(170deg, #f5f3ff 0%, #ffffff 65%);
  border-color: #c4b5fd;
}
.fo-lobby-card.color-room .icon,
.fo-lobby-card.color-room .cta { color: #7c3aed; }
.fo-lobby-card.color-room:hover { border-color: #7c3aed; box-shadow: 0 6px 22px rgba(124,58,237,0.12); }

/* `<button>` lobby card variant (used by Private Room modal trigger) */
button.fo-lobby-card {
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

/* === Modal infra === */
.fo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 23, 23, 0.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fo-modal-fade 0.18s ease-out;
}
.fo-modal-backdrop.open { display: flex; }
@keyframes fo-modal-fade { from { opacity: 0; } to { opacity: 1; } }

.fo-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 26px 24px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: fo-modal-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fo-modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fo-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fo-modal-close:hover { background: var(--surface); color: var(--text); }
.fo-modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  padding-right: 28px;
}
.fo-modal-sub {
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* === Large mono room-code display === */
.fo-roomcode {
  font-family: var(--fo-mono);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 18px 12px;
  margin: 14px 0 10px;
  color: var(--text);
}

/* === Input for room code === */
.fo-code-input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--fo-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.fo-code-input:focus { border-color: var(--text); }

.fo-lobby-card .icon {
  font-size: 1.55rem;
  margin-bottom: 14px;
  line-height: 1;
}
.fo-lobby-card .title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.fo-lobby-card .sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.fo-lobby-card .body {
  flex: 1;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.fo-lobby-card .cta {
  margin-top: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fo-lobby-card .cta::after { content: '→'; transition: transform 0.18s; }
.fo-lobby-card:hover .cta::after { transform: translateX(3px); }

/* Account snapshot block (lives inside the 1V1 Arena card) */
.fo-snapshot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
  font-size: 0.78rem;
}
.fo-snapshot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.fo-snapshot-name { font-weight: 700; font-size: 0.85rem; }
.fo-snapshot-elo {
  font-family: var(--fo-mono);
  font-weight: 700;
  font-size: 0.88rem;
}
.fo-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fo-snapshot-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.fo-snapshot-cell-label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fo-snapshot-cell-val {
  font-family: var(--fo-mono);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 1px;
}

/* === Big hero (refresh) === */
.fo-hero2 {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 32px 24px;
  text-align: center;
}
.fo-hero2 h1 {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 14px auto 14px;
}
.fo-hero2 p.sub {
  max-width: 540px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
}

/* === PLAY page: fixed shell so header / stage / actions stay anchored
   ================================================================
   The /face-rank/play/ page swaps content through 4 phases (lobby →
   queue → arena → result). To keep the flow visually stable we lock
   the header height, the stage min-height, and the action-bar
   position. Only the inner content swaps. */
.fo-play-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 32px 56px;
  display: flex;
  flex-direction: column;
}
.fo-play-header {
  text-align: center;
  margin-bottom: 22px;
  min-height: 110px;
}
.fo-play-header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 12px 0 10px;
}
.fo-play-header p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.55;
  margin: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.fo-play-stage-fixed {
  position: relative;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}
.fo-play-stage-fixed > [data-screen] {
  display: none;
  flex-direction: column;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.fo-play-stage-fixed > [data-screen].active {
  display: flex;
}
.fo-play-status {
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
  min-height: 22px;
  margin: 18px 0 0;
}
.fo-play-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 56px;
}
.fo-play-actions [data-actions] {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.fo-play-actions [data-actions].active {
  display: flex;
}
@media (max-width: 768px) {
  .fo-play-shell { padding: 10px 20px 40px; }
  .fo-play-header h1 { font-size: 1.8rem; }
  .fo-play-header { min-height: 90px; margin-bottom: 16px; }
  .fo-play-stage-fixed { min-height: 380px; }
}

/* === Generic two-column layout for Lab / Result / Check === */
.fo-twocol {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8px 32px 56px;
}

@media (max-width: 768px) {
  .fo-lobby-grid { grid-template-columns: 1fr; }
  .fo-lobby { padding: 0 20px 36px; }
  .fo-twocol { grid-template-columns: 1fr; gap: 20px; padding: 8px 20px 36px; }
  .fo-hero2 { padding: 28px 20px 14px; }
  .fo-hero2 h1 { font-size: 2.8rem; }
  .fo-overall-num { font-size: 3rem; }
  .fo-scorelist-val { font-size: 1.4rem; }
}

/* === HERO === */
.fo-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 32px 24px;
  text-align: center;
}

.fo-hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-bottom: 18px;
}

.fo-hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 32px;
  line-height: 1.55;
}

.fo-hero-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin: 24px 0 28px;
  flex-wrap: wrap;
}

.fo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.fo-stat-num {
  font-family: var(--fo-mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.fo-stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.fo-hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 16px;
  flex-wrap: wrap;
}

.fo-hero-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 12px;
}

/* === BUTTONS === */
.fo-btn {
  display: inline-block;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  font-family: inherit;
}

.fo-btn-primary {
  background: var(--text);
  color: #fff;
}
.fo-btn-primary:hover { background: #333; color: #fff; transform: translateY(-1px); }
.fo-btn-primary:disabled { background: var(--surface); color: var(--text-dim); cursor: not-allowed; transform: none; }

.fo-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.fo-btn-ghost:hover { border-color: var(--text); background: var(--surface); }

.fo-btn-danger {
  background: var(--fo-loss);
  color: #fff;
}
.fo-btn-danger:hover { background: #b91c1c; color: #fff; }

.fo-btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* === CAMERA / VIDEO TILES === */
.fo-stage {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.fo-stage-grid {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
}

.fo-tile {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.fo-tile video, .fo-tile canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fo-tile-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  height: 100%;
}

.fo-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.32) 0%, transparent 22%, transparent 80%, rgba(0,0,0,0.4) 100%);
}

.fo-tile-name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.fo-tile-elo {
  color: #fff;
  font-family: var(--fo-mono);
  font-size: 0.72rem;
  opacity: 0.85;
}

.fo-tile-live {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--fo-loss);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
  pointer-events: none;
}

.fo-tile-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 3px;
  pointer-events: none;
}
/* Tile badge accents — match the vote-bar colors so YOU/OPP feel like teams */
#tile-self .fo-tile-badge { background: var(--fo-blue); }
#tile-opp  .fo-tile-badge { background: var(--fo-purple); }

.fo-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin: 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-family: var(--fo-mono);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  position: relative;
  z-index: 2;
}
.fo-vs::before, .fo-vs::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.fo-vs::before { left: -22px; }
.fo-vs::after  { right: -22px; }

/* === COUNTDOWN === */
.fo-countdown {
  font-family: var(--fo-mono);
  font-size: 3.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 12px 0;
  line-height: 1;
}

.fo-countdown-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.fo-countdown.urgent { color: var(--fo-loss); }

/* === VOTE BAR === */
.fo-vote-bar {
  width: 100%;
  height: 12px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin: 14px 0;
  border: 1px solid var(--border);
}

.fo-vote-left, .fo-vote-right {
  height: 100%;
  transition: width 0.4s ease;
}
.fo-vote-left { background: var(--fo-blue); }
.fo-vote-right { background: var(--fo-purple); }

.fo-vote-pct {
  display: flex;
  justify-content: space-between;
  font-family: var(--fo-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.fo-vote-pct .lhs { color: var(--fo-blue); }
.fo-vote-pct .rhs { color: var(--fo-purple); }

/* === VOTE BUTTONS (audience) === */
.fo-vote-actions {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}

.fo-vote-btn {
  flex: 1;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}

.fo-vote-btn:hover { background: var(--surface-hover); border-color: var(--border-light); }
.fo-vote-btn.fo-vote-btn-a:hover { border-color: var(--fo-blue); color: var(--fo-blue); }
.fo-vote-btn.fo-vote-btn-b:hover { border-color: var(--fo-purple); color: var(--fo-purple); }
.fo-vote-btn.voted-a { border-color: var(--fo-blue); color: var(--fo-blue); background: rgba(37,99,235,0.08); cursor: default; }
.fo-vote-btn.voted-b { border-color: var(--fo-purple); color: var(--fo-purple); background: rgba(124,58,237,0.08); cursor: default; }

/* === BOTTOM BAR / ABUSE CONTROLS === */
.fo-bottom-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* === LAB === */
.fo-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 32px 0;
}

.fo-lab-cam {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.fo-lab-cam video, .fo-lab-cam canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fo-lab-cam canvas { position: absolute; inset: 0; pointer-events: none; }

.fo-lab-scan-ring {
  position: absolute;
  inset: 8%;
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  animation: fo-scan-rotate 4s linear infinite;
}

@keyframes fo-scan-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fo-lab-overall {
  text-align: center;
  margin-bottom: 24px;
}

.fo-lab-overall-num {
  font-family: var(--fo-mono);
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.fo-lab-overall-suffix {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.fo-lab-overall-tier {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

.fo-lab-subscores {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fo-lab-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.fo-lab-sub-label {
  flex: 0 0 100px;
  color: var(--text-secondary);
  font-weight: 500;
}

.fo-lab-sub-bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.fo-lab-sub-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fo-blue), var(--fo-purple));
  width: 0%;
  transition: width 0.6s ease;
}

.fo-lab-sub-val {
  font-family: var(--fo-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  width: 36px;
  text-align: right;
}

/* === CHECK PAGE === */
.fo-check-list {
  max-width: 460px;
  margin: 28px auto;
}

.fo-check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--bg-elevated);
}

.fo-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.fo-check-row.passed .fo-check-icon { background: var(--fo-win); color: #fff; border-color: var(--fo-win); }
.fo-check-row.warn .fo-check-icon { background: var(--fo-warn); color: #fff; border-color: var(--fo-warn); }
.fo-check-row.failed .fo-check-icon { background: var(--fo-loss); color: #fff; border-color: var(--fo-loss); }

.fo-check-label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.fo-check-value {
  font-family: var(--fo-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* === ARENA STATUS / TOAST === */
.fo-status {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 10px 0;
  min-height: 22px;
}

.fo-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.fo-toast.show { opacity: 1; }

/* === RESULT PAGE / SHARE CARD === */
.fo-result-banner {
  text-align: center;
  padding: 32px 16px;
  border-radius: var(--radius);
  margin: 24px 0;
}
.fo-result-banner.won { background: rgba(22,163,74,0.07); border: 1px solid rgba(22,163,74,0.25); }
.fo-result-banner.lost { background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.22); }

.fo-result-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.fo-result-banner.won .fo-result-title { color: var(--fo-win); }
.fo-result-banner.lost .fo-result-title { color: var(--fo-loss); }

.fo-result-sub { font-size: 0.95rem; color: var(--text-secondary); }

.fo-result-elo {
  font-family: var(--fo-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 12px 0;
}

.fo-share-card {
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg-elevated);
}

.fo-share-card canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

/* === RANK PAGE === */
.fo-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 24px 0;
}

.fo-rank-table th, .fo-rank-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.fo-rank-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}

.fo-rank-table td.fo-rank-num,
.fo-rank-table td.fo-rank-elo,
.fo-rank-table td.fo-rank-wl {
  font-family: var(--fo-mono);
}

.fo-rank-table tr:hover td { color: var(--text); }

.fo-rank-table tr.fo-self td { background: var(--surface); }

.fo-tier-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.fo-tier-rookie    { background: #f1f5f9; color: #475569; }
.fo-tier-star      { background: #ecfdf5; color: #047857; }
.fo-tier-pro       { background: #eff6ff; color: #1d4ed8; }
.fo-tier-elite     { background: #f5f3ff; color: #6d28d9; }
.fo-tier-champion  { background: #fffbeb; color: #b45309; }
.fo-tier-fame      { background: #1f2937; color: #fbbf24; border-color: #1f2937; }

/* === PRIVATE ROOM === */
.fo-room-code {
  font-family: var(--fo-mono);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-align: center;
  margin: 24px 0;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

/* === PRACTICE / PROFILE BANNER === */
.fo-banner {
  max-width: 580px;
  margin: 16px auto;
  padding: 12px 18px 12px 22px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fffbeb 0%, var(--surface) 38%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fo-warn);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}
.fo-banner strong { color: var(--text); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .fo-hero-title { font-size: 3rem; }
  .fo-stage-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 32px auto;
    max-width: 360px;
    margin: 24px auto;
  }
  .fo-vs { padding: 4px 0; }
  .fo-lab-grid { grid-template-columns: 1fr; }
  .fo-lab-cam { max-width: 320px; margin: 0 auto; }
  .fo-countdown { font-size: 2.5rem; }
  .fo-hero { padding: 20px 20px 18px; }
  .fo-rank-table th, .fo-rank-table td { padding: 9px 8px; font-size: 0.82rem; }
}
