/* ===== Mass online arena — dedicated FFA surface ===== */
:root {
  --ffa-teal: #2ee6c5;
  --ffa-cyan: #1ec8ff;
  --ffa-ink: #07151a;
  --ffa-glow: rgba(46, 230, 197, 0.35);
}

.babees-mode-cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .babees-mode-cards-3 { grid-template-columns: 1fr; }
}

.babees-mode-arena.is-active {
  border-color: color-mix(in srgb, var(--ffa-teal) 70%, white);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(30, 200, 255, 0.18), transparent 55%),
    color-mix(in srgb, var(--ffa-teal) 14%, transparent);
  box-shadow: 0 0 0 1px rgba(46, 230, 197, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2);
}

.babees-arena-setup {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 230, 197, 0.28);
  background:
    linear-gradient(145deg, rgba(46, 230, 197, 0.08), rgba(30, 200, 255, 0.05)),
    rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 12px;
  animation: ffa-in 0.35s ease both;
}
.babees-arena-setup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.babees-arena-join-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
@media (max-width: 560px) {
  .babees-arena-join-box { grid-template-columns: 1fr; }
}

.babees-cta-arena {
  background: linear-gradient(120deg, var(--ffa-teal), var(--ffa-cyan)) !important;
  color: var(--ffa-ink) !important;
  border: none !important;
  font-weight: 800;
  box-shadow: 0 10px 28px var(--ffa-glow);
}
.babees-cta-arena:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.babees-pack.is-arena-pack {
  position: relative;
  border-color: rgba(46, 230, 197, 0.45);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(46, 230, 197, 0.16), transparent 50%),
    radial-gradient(100% 120% at 100% 100%, rgba(30, 200, 255, 0.12), transparent 45%),
    rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.babees-pack.is-arena-pack::before {
  content: '';
  position: absolute;
  inset: -40% auto auto -20%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(46, 230, 197, 0.35), transparent 70%);
  animation: ffa-orb 4.5s ease-in-out infinite;
  pointer-events: none;
}
.babees-pack.is-arena-pack .babees-pack-credits small {
  letter-spacing: 0.02em;
}

/* Stage shell */
.babees-ffarena {
  min-height: min(100dvh, 920px);
  padding: 12px 12px 28px;
}
.ffa-shell {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 28px;
  border: 1px solid rgba(46, 230, 197, 0.22);
  background:
    radial-gradient(90% 70% at 10% 0%, rgba(46, 230, 197, 0.14), transparent 50%),
    radial-gradient(80% 60% at 100% 20%, rgba(30, 200, 255, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(7, 21, 26, 0.92), rgba(8, 16, 28, 0.96));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: ffa-in 0.4s ease both;
}

.ffa-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ffa-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ffa-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ffa-teal);
  box-shadow: 0 0 0 0 var(--ffa-glow);
  animation: ffa-pulse 1.6s ease-out infinite;
}
.ffa-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ffa-teal);
  font-weight: 700;
}
.ffa-title {
  margin: 2px 0 0;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
}
.ffa-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ffa-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.ffa-count {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(46, 230, 197, 0.12);
  border: 1px solid rgba(46, 230, 197, 0.28);
}
.ffa-count em {
  font-style: normal;
  color: var(--ffa-teal);
}

.ffa-lobby {
  padding: 22px 20px 28px;
  display: grid;
  gap: 16px;
}
.ffa-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ffa-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ffa-teal), var(--ffa-cyan));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 18px var(--ffa-glow);
}
.ffa-lobby-lead {
  margin: 0;
  opacity: 0.85;
  line-height: 1.55;
}
.ffa-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}
.ffa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
  animation: ffa-chip 0.35s ease both;
}
.ffa-chip i {
  font-style: normal;
  opacity: 0.5;
  font-size: 0.75rem;
}
.ffa-chip em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ffa-ink);
  background: var(--ffa-teal);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 800;
}
.ffa-chip.is-me {
  border-color: rgba(46, 230, 197, 0.55);
  background: rgba(46, 230, 197, 0.12);
}
.ffa-chip.is-host {
  box-shadow: inset 0 0 0 1px rgba(30, 200, 255, 0.35);
}
.ffa-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ffa-wait-host {
  margin: 0;
  opacity: 0.75;
}

.ffa-play {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 0;
  min-height: 420px;
}
@media (max-width: 800px) {
  .ffa-play { grid-template-columns: 1fr; }
  .ffa-board { order: 2; border-inline-end: 0; border-top: 1px solid rgba(255,255,255,0.06); }
}

.ffa-board {
  padding: 16px;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}
.ffa-board h3 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  opacity: 0.8;
}
.ffa-lb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ffa-lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.ffa-lb-row.is-me {
  background: rgba(46, 230, 197, 0.12);
  outline: 1px solid rgba(46, 230, 197, 0.35);
}
.ffa-lb-rank { font-size: 0.85rem; }
.ffa-lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.ffa-lb-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ffa-teal);
}
.ffa-lb-empty {
  opacity: 0.55;
  padding: 8px;
}

.ffa-stage {
  padding: 20px 22px 28px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.ffa-qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ffa-qmeta {
  font-size: 0.86rem;
  opacity: 0.75;
  font-weight: 700;
}
.ffa-timer {
  position: relative;
  width: 56px;
  height: 56px;
}
.ffa-timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ffa-timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}
.ffa-timer-fg {
  fill: none;
  stroke: var(--ffa-teal);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear, stroke 0.2s;
}
.ffa-timer.is-urgent .ffa-timer-fg { stroke: #ff6b6b; }
.ffa-timer strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.ffa-qtext {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 750;
  line-height: 1.45;
  animation: ffa-q 0.4s ease both;
}
.ffa-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .ffa-choices { grid-template-columns: 1fr; }
}
.ffa-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.ffa-choice:hover:not(:disabled) {
  border-color: rgba(46, 230, 197, 0.55);
  background: rgba(46, 230, 197, 0.1);
  transform: translateY(-1px);
}
.ffa-choice:disabled {
  opacity: 0.55;
  cursor: default;
}
.ffa-choice-n {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(46, 230, 197, 0.18);
  color: var(--ffa-teal);
  flex: 0 0 auto;
}
.ffa-free {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.ffa-answered {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(46, 230, 197, 0.12);
  border: 1px solid rgba(46, 230, 197, 0.28);
  animation: ffa-in 0.3s ease both;
}
.ffa-reveal {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
  animation: ffa-in 0.35s ease both;
}
.ffa-reveal-ans { margin: 0; }
.ffa-speed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.ffa-speed li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}
.ffa-speed em {
  font-style: normal;
  color: var(--ffa-teal);
  font-weight: 800;
}

.ffa-finish {
  padding: 28px 20px 36px;
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
  animation: ffa-in 0.45s ease both;
}
.ffa-finish-title {
  margin: 0;
  font-size: 1.6rem;
  background: linear-gradient(120deg, var(--ffa-teal), var(--ffa-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ffa-lb-final {
  width: min(420px, 100%);
  text-align: start;
}

/* Online tab: same size as siblings; quiet teal cue only when idle */
.babees-tab-online {
  position: relative;
}
.babees-tab-online:not(.is-active) {
  color: color-mix(in srgb, #2ee6c5 70%, #fff) !important;
}
.babees-tab-online:not(.is-active)::after {
  content: '';
  position: absolute;
  inset-inline: 28%;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ee6c5, #1ec8ff);
  opacity: 0.85;
}
.babees-tab-online.is-active {
  /* inherit shared .babees-tab.is-active look — no oversized glow */
  box-shadow: 0 4px 12px rgba(46, 230, 197, 0.22) !important;
}
.babees-tab-online.is-active::after {
  display: none;
}
.babees-hero-online .babees-hero-brand-name {
  background: linear-gradient(120deg, #2ee6c5, #1ec8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ffa-compose {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 230, 197, 0.3);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(46, 230, 197, 0.12), transparent 55%),
    rgba(0, 0, 0, 0.2);
  animation: ffa-in 0.35s ease both;
}
.ffa-compose-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}
.ffa-compose-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .ffa-compose-row { grid-template-columns: 1fr; }
}
.ffa-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ffa-end-now,
.ffa-end-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 107, 107, 0.55);
  background: rgba(255, 80, 80, 0.14);
  color: #ffb4b4;
  font: inherit;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  padding: 8px 12px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ffa-end-now:hover,
.ffa-end-btn:hover {
  background: rgba(255, 80, 80, 0.28);
  border-color: rgba(255, 120, 120, 0.85);
  color: #fff;
}
.ffa-end-btn {
  min-height: 48px;
  padding-inline: 16px;
  flex: 1 1 160px;
}
.ffa-compose-actions .babees-cta-arena {
  flex: 1 1 200px;
}
.ffa-meta {
  flex-wrap: wrap;
}
.ffa-wait-compose {
  margin: 0;
  padding: 18px 16px;
  border-radius: 16px;
  text-align: center;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  animation: ffa-pulse 1.8s ease-out infinite;
}
.ffa-reveal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#babees-arena-create:disabled {
  opacity: 0.45;
}
#babees-arena-create.is-ready {
  box-shadow: 0 12px 32px var(--ffa-glow);
}
#babees-arena-create.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
.ffa-media {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  min-height: 140px;
  animation: ffa-in 0.35s ease both;
}
.ffa-media img,
.ffa-media video {
  display: block;
  width: 100%;
  max-height: min(42vh, 360px);
  object-fit: contain;
  background: #000;
}
.ffa-media audio {
  width: min(100%, 420px);
  margin: 18px;
}
.ffa-media .ffa-img.is-blur {
  filter: blur(18px);
  transform: scale(1.04);
}
.ffa-choice.is-correct {
  border-color: rgba(46, 230, 197, 0.8) !important;
  background: rgba(46, 230, 197, 0.16) !important;
}

/* ---- Arena room chat (collapsible dock) ---- */
.ffa-chat {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(4, 18, 24, 0.55), rgba(3, 12, 18, 0.82));
}
.ffa-chat-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: start;
}
.ffa-chat-toggle:hover {
  background: rgba(46, 230, 197, 0.06);
}
.ffa-chat-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.ffa-chat-toggle-label strong {
  font-weight: 800;
}
.ffa-chat-badge {
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ffa-teal);
  color: #042018;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.ffa-chat-chevron {
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  transition: transform 0.28s ease;
  margin-inline-end: 4px;
}
.ffa-chat.is-collapsed .ffa-chat-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.ffa-chat-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.32s ease, opacity 0.22s ease;
  opacity: 1;
}
.ffa-chat.is-collapsed .ffa-chat-body {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}
.ffa-chat-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ffa-chat-log {
  height: min(36vh, 260px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.ffa-chat-empty {
  margin: auto;
  opacity: 0.5;
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 12px;
}
.ffa-chat-msg {
  display: grid;
  gap: 2px;
  max-width: min(92%, 520px);
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: ffa-chip 0.22s ease both;
}
.ffa-chat-msg.is-me {
  margin-inline-start: auto;
  background: rgba(46, 230, 197, 0.12);
  border-color: rgba(46, 230, 197, 0.28);
}
.ffa-chat-msg strong {
  font-size: 0.78rem;
  color: var(--ffa-cyan);
  font-weight: 800;
}
.ffa-chat-msg.is-me strong {
  color: var(--ffa-teal);
}
.ffa-chat-msg p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}
.ffa-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}
.ffa-chat-input {
  min-height: 44px;
}
.ffa-chat-send {
  min-width: 48px;
  min-height: 44px;
}
@media (max-width: 800px) {
  .ffa-chat-log {
    height: min(32vh, 220px);
  }
}

@keyframes ffa-pulse {
  0% { box-shadow: 0 0 0 0 var(--ffa-glow); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes ffa-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes ffa-q {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@keyframes ffa-chip {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes ffa-orb {
  0%, 100% { transform: translate(0, 0); opacity: 0.7; }
  50% { transform: translate(18px, 10px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ffa-pulse, .babees-pack.is-arena-pack::before, .ffa-shell, .ffa-qtext, .ffa-chip {
    animation: none !important;
  }
}
