/* =========================================================================
   Arab Arena — UI polish layer (Nov 2026)
   Loaded after app.css / arena.css. Mobile layout fixes + compact sections.
   ========================================================================= */

/* ---------- global: no sideways scrolling on phones ---------- */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }
/* honeypot field: the old left:-9999px pushed RTL pages 10 000px wide */
.hp { position: absolute !important; left: auto !important; right: auto !important; top: 0 !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%); overflow: hidden; }

/* empty states: the icon inside a button must not inherit the big circle */
.empty .btn .ms, .empty a .ms { width: auto; height: auto; background: none; margin: 0; font-size: 20px; color: inherit; display: inline-block; }

/* section header with a side link */
.sec-head.row .textlink { white-space: nowrap; flex-shrink: 0; }

/* partner FAB: lighter, never over the footer text */
.fab-partner { box-shadow: 0 8px 24px #19192d1f; }

/* steps used with 4 columns (vanguard journey) */
@media (max-width: 1100px) {
  .steps[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* =========================  PHONES  ========================= */
@media (max-width: 720px) {
  .section, .section.tight { padding: 52px 0; }
  .sec-head { margin-bottom: 26px; }
  .sec-head h2, .split h2, .pre h2, .vg h2 { font-size: 28px; }
  .sec-head p, .split p.big, .pre p, .vg p { font-size: 15.5px; }
  .page-hero { padding: 44px 0 20px; }
  .page-hero h1 { font-size: 34px; }
  .page-hero p { font-size: 16px; }

  /* header row with link → stacked, link under title */
  .sec-head.row { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: start; }

  /* card rows become swipeable carousels instead of very long stacks */
  .arenas, .bench-cards, .offer-grid, .steps, .steps[style] {
    display: flex !important; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    gap: 12px; margin-inline: -18px; padding: 4px 18px 16px; scroll-padding-inline: 18px; scrollbar-width: none;
  }
  .arenas::-webkit-scrollbar, .bench-cards::-webkit-scrollbar, .offer-grid::-webkit-scrollbar, .steps::-webkit-scrollbar { display: none; }
  .arenas > *, .bench-cards > *, .offer-grid > *, .steps > * { flex: 0 0 80%; scroll-snap-align: start; min-width: 0; }
  .steps > * { flex-basis: 72%; }
  .bench-cards { margin-top: 30px; }
  .arena-card { min-height: 0; padding: 22px; }
  .offer, .step { padding: 22px; }
  /* swipe hint dots (added by ui.js) */
  .swipe-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
  .swipe-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); transition: .25s; }
  .swipe-dots i.on { width: 18px; border-radius: 4px; background: var(--blue); }

  /* hero */
  .hero h1 { font-size: 36px; }
  .hero-art { min-height: 300px; }
  .hero-foot { gap: 8px 16px; }

  /* models: two compact columns */
  .models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mcard { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .mcard h4 { font-size: 14.5px; }
  .labs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .labs-grid .lab-pill { font-size: 13px; padding: 8px 10px; white-space: normal; }

  /* leaderboard: tabs scroll sideways instead of 3 wrapped lines */
  .lb-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-inline: -18px; padding: 2px 18px 6px; scrollbar-width: none; }
  .lb-tabs::-webkit-scrollbar { display: none; }
  .lb-tabs .tab { flex-shrink: 0; }
  .lb-table th, .lb-table td { padding: 12px 10px; }
  .lb-wrap { overflow-x: auto; }

  /* vanguard spec chips & cta band */
  .spec-row { justify-content: center; }
  .cta-band { text-align: center; justify-content: center; }
  .cta-band .btn { width: 100%; }

  /* footer: 2 columns of links instead of one long list */
  .foot { padding-top: 40px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
  .foot-brand { grid-column: 1 / -1; }
  .foot-grid > div:last-child { grid-column: 1 / -1; }

  /* FAB: small round button, above the iPhone home bar */
  .fab-partner { left: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); width: 48px; height: 48px; padding: 0; justify-content: center; }
  .fab-partner .ms { font-size: 22px; }

  /* forms */
  .auth-card { margin: 28px auto; padding: 26px 22px; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom on focus */
}

/* =========================  ARENA ON PHONES  ========================= */
.pane-switch { display: none; }
@media (max-width: 900px) {
  .arena-shell { padding-top: 12px; gap: 10px; }
  .arena-bar { padding: 10px; gap: 10px; border-radius: 20px; }
  .seg { order: 1; }
  .modalities { order: 2; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; margin-inline: -2px; padding-bottom: 2px; }
  .modalities::-webkit-scrollbar { display: none; }
  .mod { flex-shrink: 0; }
  .cat-pick { order: 3; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* one answer at a time, switch with tabs or a swipe */
  .board.paged { grid-template-columns: 1fr; min-height: 0; }
  .board.paged .pane { min-height: 52vh; max-height: none; }
  .board.paged.show-a #pane-b, .board.paged.show-b #pane-a { display: none; }
  .pane-switch { display: flex; gap: 6px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; position: sticky; top: 92px; z-index: 6; box-shadow: var(--shadow); }
  .pane-switch[hidden] { display: none; }
  .pane-switch button { flex: 1; border: 0; background: none; border-radius: 99px; padding: 9px 10px; font-weight: 600; font-size: 14px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
  .pane-switch button span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pane-switch button.on { background: var(--ink); color: #fff; }
  .pane-switch button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); display: none; flex-shrink: 0; }
  .pane-switch button.new .dot { display: inline-block; animation: ping 1.6s infinite; }
  .pane-switch button.done::after { content: '✓'; font-family: Arial; font-size: 12px; opacity: .8; }
  .pane-switch button.win { background: var(--green-t); color: var(--green); }
  .pane-switch button.win.on { background: var(--green); color: #fff; }

  /* vote: big A / B on top, tie & both-bad below; stays visible above the composer */
  .votebar { position: sticky; bottom: 84px; z-index: 6; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-radius: 22px; }
  .votebar .vb-q { grid-column: 1 / -1; margin: 0; font-size: 14px; }
  .votebar button { justify-content: center; padding: 11px 8px; font-size: 14px; }
  .votebar button[data-vote=b] { order: 2; } .votebar button[data-vote=a] { order: 1; }
  .votebar button[data-vote=tie] { order: 3; } .votebar button[data-vote=bad] { order: 4; }
  .votebar button[data-vote=a], .votebar button[data-vote=b] { padding: 14px 8px; font-size: 15px; }

  .composer { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); border-radius: 26px; }
  .composer .btn.sm { min-height: 46px; padding: 8px 12px; }
  .composer .send { width: 46px; height: 46px; }
  .board-empty { padding: 26px 18px; }
  .suggest { margin-top: 18px; }
  .suggest button { font-size: 13.5px; padding: 8px 14px; }
  .gate-card { padding: 28px 22px; margin: 0 12px; }
}
@media (max-width: 720px) {
  .pane-switch { top: 80px; }
}
@media (max-width: 420px) {
  .seg button .ms { display: none; }
  .seg button { padding: 8px 6px; font-size: 12.5px; }
}
