/* ═══════════════════════════════════════════════════════
   ARENA ENHANCEMENTS — post-handoff design iteration
   New component styles + a proper desktop layout, added per user feedback
   AFTER the initial verbatim integration. Kept separate from the untouched
   design (public/css/arena.css) and the pure scaffolding (arena-mount.css).

   Every rule is prefixed with `.arena-scope` so it (a) only affects Arena
   and (b) outspecifies the @scope-wrapped arena.css it refines — arena.css
   rules inside @scope keep their base specificity, so a `.arena-scope .x`
   selector here (one class higher) always wins. Loaded LAST.
═══════════════════════════════════════════════════════ */

/* ── Constraint poster readability ──
   The title/description sit over a busy duotone + huge monogram. A scrim
   between the art and the text makes copy legible; the title had a bug where
   an injected <br> was HTML-escaped and shown literally (fixed in JS). */
.arena-scope .poster-scrim {
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(130% 100% at 50% 38%, rgba(8,7,11,.28), rgba(8,7,11,.74));
}
.arena-scope .poster .pin { gap: 8px; }
.arena-scope .poster .pt { line-height: .92; }
.arena-scope .poster .pr2 {
  font-size: 14px; font-weight: 500; color: #fff;
  line-height: 1.5; max-width: 90%; margin: 2px auto 0;
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
}
.arena-scope .poster.sm .pr2 { font-size: 12.5px; }
.arena-scope .poster .cv-mono { opacity: .55; }

/* ── "order matters" info toggle + panel ── */
.arena-scope .order-info-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--acc); background: none; padding: 0;
}
.arena-scope .order-info-btn .i { width: 13px; height: 13px; }
.arena-scope .order-info-panel {
  display: none; margin: 0 16px 8px;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: 12px;
  padding: 12px 14px; font-size: 12px; color: var(--ink2); line-height: 1.6;
}
.arena-scope .order-info-panel.open { display: block; animation: aFadeIn .2s var(--ease); }
.arena-scope .order-info-panel .oi-rows { display: flex; flex-direction: column; gap: 3px; margin: 9px 0; }
.arena-scope .order-info-panel .oi-rows b { color: var(--acc); font-weight: 600; }
.arena-scope .order-info-panel .i { color: var(--mid); vertical-align: -2px; }
@keyframes aFadeIn { from { opacity: 0; transform: translateY(-4px); } }

/* ── Lineup slot: drag handle + drag states ── */
.arena-scope #draft-slots { position: relative; }
.arena-scope .slot .drag-h {
  display: flex; align-items: center; color: var(--mid2);
  cursor: grab; touch-action: none; padding: 2px; margin: 0 -2px 0 -2px; flex: none;
}
.arena-scope .slot .drag-h:active { cursor: grabbing; color: var(--ink2); }
.arena-scope .slot.dragging {
  opacity: .96; border-color: var(--acc); background: var(--bg3);
  box-shadow: 0 12px 34px rgba(0,0,0,.55); position: relative;
}
.arena-scope .slot.drop-target { border-color: var(--acc); box-shadow: inset 0 0 0 1.5px rgba(184,163,252,.5); }

/* ── Eligible-pool search + clickable rows ── */
.arena-scope .pool-search {
  display: flex; align-items: center; gap: 9px; margin: 0 16px 10px;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: 12px;
  padding: 10px 13px;
}
.arena-scope .pool-search:focus-within { border-color: var(--acc); }
.arena-scope .pool-search .ps-ico { color: var(--mid2); display: flex; flex: none; }
.arena-scope .pool-search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--ink); font-family: var(--sans); font-size: 14px;
}
.arena-scope .pool-search input::placeholder { color: var(--mid2); }
.arena-scope .pr { cursor: pointer; }

/* ═══════════════════ DESKTOP LAYOUT ═══════════════════
   The delivered design is phone-only (no desktop breakpoints), so at desktop
   widths it was a narrow column stranded in a wide void, and the full-screen
   takeovers/sheets stretched edge to edge. This gives Arena a real desktop
   layout: a wider home column, multi-column card grids, centred modal sheets,
   and centred takeover content. Phone layout below 900px is untouched. */
@media (min-width: 900px) {
  /* Home content uses the available width instead of a 460px sliver. */
  #arena-home { max-width: 1080px; }

  /* Slate + duel cards become responsive grids; marketplace rows stay full. */
  .arena-scope .a-slate {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px; padding: 0 16px;
  }
  .arena-scope .a-slate .scard,
  .arena-scope .a-slate .lkd { margin: 0; }
  .arena-scope .a-duels {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px; padding: 0 16px; align-items: start;
  }
  .arena-scope .a-duels .dc { margin: 0; }

  /* Takeover screens (draft/ceremony/reveal/resolved): centre the content
     column so it isn't stretched across a wide monitor. */
  .arena-screens-shell .screen .scroll { max-width: 760px; margin: 0 auto; width: 100%; }

  /* Sheets (bet/peek/create) become centred modals, not bottom sheets. */
  .arena-sheet-shell .overlay { justify-content: center; align-items: center; padding: 20px; }
  .arena-sheet-shell .sheet {
    max-width: 440px; width: 100%; max-height: 88vh;
    border-radius: var(--r-xl); border: 1px solid var(--line2);
    animation: aSheetPop .26s var(--ease);
  }
  .arena-sheet-shell .sheet .grab { display: none; }
}
@keyframes aSheetPop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Very wide: cap slate at 3 comfortable columns. */
@media (min-width: 1320px) {
  .arena-scope .a-slate { grid-template-columns: repeat(3, 1fr); }
}

/* ── Duel pool split (Mode 2) ──────────────────────────────────
   The eligible pool is split 50/50; each player drafts only their own half.
   Without a visible note, players read the missing artists as a bug — so the
   line is unmissable. A one-time reveal animation shows the deck dividing. */
.arena-scope .split-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 12px 16px 0; padding: 10px 12px;
  background: var(--acc-d); border: 1px solid var(--line2);
  border-radius: 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink2);
}
.arena-scope .split-note svg { flex: none; margin-top: 2px; color: var(--acc); }
.arena-scope .split-note b { color: var(--acc); font-weight: 700; }

/* One-time reveal overlay — covers the draft screen briefly, then removes itself. */
.arena-scope .split-anim {
  position: absolute; inset: 0; z-index: 130;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,11,18,.86); backdrop-filter: blur(6px);
  animation: saFade .3s var(--ease);
}
.arena-scope .split-anim.run { animation: saOut .45s var(--ease) 1.25s forwards; }
.arena-scope .sa-stage { position: relative; width: 260px; text-align: center; }
.arena-scope .sa-cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px;
  color: var(--acc); margin-bottom: 22px; opacity: 0;
  animation: saCap .5s var(--ease) .1s forwards;
}
.arena-scope .sa-deck {
  position: relative; height: 60px; display: flex;
  align-items: center; justify-content: center;
}
.arena-scope .sa-chip {
  position: absolute; width: 40px; height: 52px; border-radius: 9px;
  background: linear-gradient(150deg, var(--cf), var(--ct));
  border: 1px solid rgba(255,255,255,.18); box-shadow: 0 6px 16px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(0) rotate(0);
}
.arena-scope .sa-chip b {
  font-family: var(--disp); font-size: 15px; letter-spacing: .5px;
  color: rgba(255,255,255,.92);
}
.arena-scope .split-anim.run .sa-chip.go-l {
  animation: saDeal .6s var(--ease) calc(.15s + var(--i) * .05s) forwards, saLeft .5s var(--ease) .75s forwards;
}
.arena-scope .split-anim.run .sa-chip.go-r {
  animation: saDeal .6s var(--ease) calc(.15s + var(--i) * .05s) forwards, saRight .5s var(--ease) .75s forwards;
}
.arena-scope .sa-buckets {
  display: flex; justify-content: space-between; margin-top: 26px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
}
.arena-scope .sa-b { opacity: 0; animation: saCap .4s var(--ease) .85s forwards; }
.arena-scope .sa-b.you { color: var(--pos); }
.arena-scope .sa-b.opp { color: var(--mid); }
@keyframes saFade { from { opacity: 0; } }
@keyframes saOut  { to { opacity: 0; visibility: hidden; } }
@keyframes saCap  { to { opacity: 1; } }
@keyframes saDeal { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes saLeft  { to { transform: translateX(-78px) rotate(-9deg); } }
@keyframes saRight { to { transform: translateX(78px)  rotate(9deg); } }
@media (prefers-reduced-motion: reduce) {
  .arena-scope .split-anim { display: none; }
}
