/* Standing Room palette (srtheatrical.com). Font is inherited from the theme (Europa). */
.bfo {
  --bfo-bg: #f1f7f9;
  --bfo-surface: #ffffff;
  --bfo-ink: #343434;
  --bfo-muted: #6d7b81;
  --bfo-line: #d4e4e9;
  --bfo-teal: #33657c;
  --bfo-teal-deep: #0d2f39;
  --bfo-teal-mid: #4f949f;
  --bfo-teal-light: #60a9b9;
  --bfo-gold: #e9be45;
  background: var(--bfo-bg);
  color: var(--bfo-ink);
  border-radius: 6px;
  padding: clamp(16px, 4vw, 36px);
  font-family: inherit;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}
.bfo *, .bfo *::before, .bfo *::after { box-sizing: border-box; }
.bfo h2, .bfo h3 { color: inherit; margin: 0; font-family: inherit; }

.bfo-loading, .bfo-empty { text-align: center; color: var(--bfo-muted); margin: 2em 0; }
.bfo-q {
  text-align: center;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.05;
  color: #090909;
  margin-bottom: .9em !important;
  text-wrap: balance;
}

.bfo-duel, .bfo-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(8px, 2vw, 20px);
}
/* The gold slash from the Standing Room logo stands in for "vs". */
.bfo-vs {
  display: block;
  width: 4px;
  height: clamp(48px, 10vw, 84px);
  background: var(--bfo-gold);
  transform: skewX(-18deg);
  font-size: 0;
  align-self: center;
}

.bfo-choice {
  all: unset;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-radius: 4px;
  min-width: 0;
}
/* Hover and selection rings are drawn inside the card, so nothing outside it moves or grows. */
.bfo-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0 solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-width .12s ease, border-color .12s ease;
}
.bfo-choice:hover:not(.is-picked) .bfo-poster::after,
.bfo-choice:focus-visible:not(.is-picked) .bfo-poster::after { border-width: 3px; border-color: currentColor; opacity: .55; }
/* Solid gold ring flush against the card color; the gold card takes a deep-teal ring instead. */
.bfo-choice.is-picked .bfo-poster::after { border-width: 5px; border-color: var(--bfo-gold); }
.bfo-choice.is-picked .bfo-poster.bfo-c5::after { border-color: var(--bfo-teal-deep); }
.bfo-choice[disabled] { cursor: default; }

/* Title cards. Backgrounds cycle through the Standing Room brand colors;
   light colors take deep-teal text, dark ones white. */
.bfo-poster {
  flex: 1;
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  container-type: inline-size;
  padding: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6em;
  text-align: center;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bfo-card-bg);
  color: var(--bfo-card-ink);
  box-shadow: 0 1px 3px rgba(13, 47, 57, .12);
}
.bfo-c0 { --bfo-card-bg: #c6d8c6; --bfo-card-ink: var(--bfo-teal-deep); } /* sage */
.bfo-c1 { --bfo-card-bg: #60a9b9; --bfo-card-ink: var(--bfo-teal-deep); } /* aqua */
.bfo-c2 { --bfo-card-bg: #33657c; --bfo-card-ink: #fff; }                 /* teal */
.bfo-c3 { --bfo-card-bg: #dc7240; --bfo-card-ink: #fff; }                 /* orange */
.bfo-c4 { --bfo-card-bg: #993219; --bfo-card-ink: #fff; }                 /* rust */
.bfo-c5 { --bfo-card-bg: #e9be45; --bfo-card-ink: var(--bfo-teal-deep); } /* gold */
.bfo-c6 { --bfo-card-bg: #f7f2de; --bfo-card-ink: var(--bfo-teal-deep); } /* cream */
.bfo-c7 { --bfo-card-bg: #9099a0; --bfo-card-ink: var(--bfo-teal-deep); } /* gray */
.bfo-c8 { --bfo-card-bg: #5c5668; --bfo-card-ink: #fff; }                 /* plum */
.bfo-title {
  font-weight: 800;
  font-size: clamp(1.1rem, 12cqi, 3.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.bfo-poster.is-long .bfo-title { font-size: clamp(.95rem, 8.5cqi, 2.4rem); }
.bfo-year { font-size: .85rem; font-weight: 600; opacity: .75; letter-spacing: .08em; }
.bfo-seed {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 1;
  background: var(--bfo-gold);
  color: var(--bfo-teal-deep);
  font-weight: 800;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 99px;
}

.bfo-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 1.4em;
  font-size: .9rem;
}
.bfo-count { color: var(--bfo-teal); font-weight: 700; }
.bfo-link {
  all: unset;
  cursor: pointer;
  color: var(--bfo-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bfo-link:hover, .bfo-link:focus-visible { color: var(--bfo-teal); }

/* Tournament */
.bfo-marquee {
  text-align: center;
  background: var(--bfo-teal);
  color: #fff;
  border-radius: 4px;
  padding: 18px 16px;
  margin-bottom: 1.6em;
  position: relative;
  overflow: hidden;
}
.bfo-marquee small { text-transform: uppercase; letter-spacing: .2em; color: var(--bfo-gold); font-size: .7rem; font-weight: 700; }
.bfo-marquee h2 { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 800; text-transform: uppercase; margin: 4px 0 !important; color: #fff; }
.bfo-marquee p { margin: 0; color: rgba(255, 255, 255, .8); }

.bfo-matches { display: grid; gap: 16px; }
.bfo-match { background: var(--bfo-surface); padding: 12px; border-radius: 4px; border: 1px solid var(--bfo-line); }
.bfo-match .bfo-poster { box-shadow: none; aspect-ratio: 16 / 10; }
.bfo-match .bfo-vs { height: 56px; }
.bfo-match.is-voted .bfo-choice:not(.is-picked) { opacity: .7; }
.bfo-match.is-voted .bfo-choice:not(.is-picked):hover { opacity: 1; }

/* Result bar: a strip near the bottom of the card, tinted from the card's own text color.
   Inset by the selection ring's width on every card, so the ring never covers it and the
   two cards' bars stay level with each other. */
.bfo-bar { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 28px; background: rgba(0, 0, 0, .14); border-radius: 2px; overflow: hidden; text-align: left; }
.bfo-bar span { position: absolute; inset: 0 auto 0 0; background: currentColor; opacity: .3; transition: width .5s ease; }
.bfo-bar em { position: relative; font-style: normal; font-size: .8rem; font-weight: 800; padding-left: 10px; line-height: 28px; font-variant-numeric: tabular-nums; }

.bfo-choice.was-picked:not(:hover) .bfo-poster::after { border-width: 3px; border-style: dashed; border-color: currentColor; }
.bfo-foot-group { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.bfo-undo { color: var(--bfo-teal); font-weight: 700; }

/* One matchup at a time */
.bfo-step { flex: 1; text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bfo-muted); font-variant-numeric: tabular-nums; }
.bfo-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.bfo-hint { text-align: center; font-size: .85rem; color: var(--bfo-muted); margin: 8px 0 0; }
.bfo .bfo-btn-ghost { background: transparent; color: var(--bfo-teal); border: 1px solid var(--bfo-teal); padding: 7px 14px; }
.bfo .bfo-btn-ghost:hover, .bfo .bfo-btn-ghost:focus-visible { background: var(--bfo-teal); color: #fff; }
.bfo-btn[disabled] { opacity: .35; pointer-events: none; }

.bfo-divider { text-align: center; color: var(--bfo-muted); margin: 2.4em 0 1.2em; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }

.bfo-toast {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  background: var(--bfo-teal-deep);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: .9rem;
  max-width: calc(100% - 32px);
  z-index: 2;
}

.bfo-modal { position: fixed; inset: 0; background: rgba(13, 47, 57, .55); display: grid; place-items: center; z-index: 99999; padding: 16px; }
.bfo-modal-card { background: #fff; color: var(--bfo-ink); border-radius: 6px; padding: 22px; width: min(420px, 100%); max-height: 85vh; overflow: auto; border-top: 6px solid var(--bfo-teal); }
.bfo-modal-card h3 { text-transform: uppercase; font-weight: 800; }
.bfo-modal-card ol { padding-left: 1.4em; margin: 1em 0; }
.bfo-modal-card li { padding: 4px 0; }
.bfo-modal-card li span { margin-right: 8px; }
.bfo-modal-card small { color: var(--bfo-muted); }
.bfo-btn { all: unset; cursor: pointer; background: var(--bfo-teal); color: #fff; font-weight: 700; padding: 8px 18px; border-radius: 4px; }
.bfo-btn:hover, .bfo-btn:focus-visible { background: var(--bfo-teal-deep); }

@media (max-width: 520px) {
  .bfo-duel, .bfo-match { grid-template-columns: minmax(0, 1fr); }
  .bfo-vs { width: 64px; height: 4px; transform: skewY(-8deg); justify-self: center; }
  .bfo-match .bfo-vs { height: 4px; }
  .bfo-duel .bfo-poster { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) { .bfo * { transition: none !important; } }
