/* "Draft & hra" (DECISIONS "Draft & hra"): loaded only by the hra*.html pages, after
   css/shop.css, whose colours and type it uses. Classes start with pl- so they never touch the
   shop's own. Card images come from Scryfall and are never cropped or tinted (Scryfall's terms). */

.pl-hero { background: var(--band); color: var(--night-text); border-bottom: 3px solid transparent;
  border-image: var(--flame-line) 1; }
.pl-hero .container { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; padding-top: 44px; padding-bottom: 52px; }
.pl-hero-text { flex: 1 1 520px; }
.pl-hero h1 { font-family: var(--serif); font-weight: 600; font-size: 60px; line-height: 1.02; margin: 10px 0 14px; }
.pl-hero p { font-size: 17px; line-height: 1.6; color: var(--night-soft); margin: 0 0 24px; max-width: 580px; }
.pl-hero .btn.ghost { color: var(--night-text); border-color: var(--night-line); background: var(--night-card); }
.pl-hero .btn.ghost:hover { background: var(--night-chip); }
.pl-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pl-fan { flex: 0 1 360px; display: flex; justify-content: center; padding: 8px 0; }
.pl-fan img { width: 140px; border-radius: 4.75% / 3.5%; box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.pl-fan img:nth-child(1) { transform: rotate(-9deg) translateX(34px); }
.pl-fan img:nth-child(2) { transform: translateY(-12px); position: relative; z-index: 1; }
.pl-fan img:nth-child(3) { transform: rotate(9deg) translateX(-34px); }

.pl-section { padding-top: 40px; }
.pl-section h2 { font-family: var(--serif); font-weight: 600; font-size: 34px; margin: 0 0 18px; }
.pl-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.pl-mode { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; color: var(--ink); }
.pl-mode:hover { border-color: var(--blue); color: var(--ink); }
.pl-mode .tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.pl-mode strong { font-size: 19px; }
.pl-mode span:last-child { color: var(--body); line-height: 1.55; font-size: 14px; }
.pl-mode.dark { background: var(--ink); border-color: var(--ink); color: var(--night-text); }
.pl-mode.dark .tag { color: var(--flame-text); }
.pl-mode.dark span:last-child { color: var(--night-soft); }
.pl-mode.soon { opacity: .7; }

.pl-filters { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.pl-filters h2 { margin: 0; }
.pl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pl-field input, .pl-field select { font-size: 14px; color: var(--ink); padding: 0 12px; min-height: 44px; border: 1px solid var(--field);
  border-radius: 4px; background: #fff; }
.pl-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.pl-set { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pl-set-head { display: flex; align-items: center; gap: 12px; }
.pl-set-code { width: 46px; height: 46px; flex: none; border-radius: 6px; background: var(--blue-tint); color: var(--blue-dark);
  font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pl-set-name { font-weight: 800; }
.pl-set-meta { font-size: 13px; color: var(--muted); }
.pl-set-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pl-set-actions .btn { min-height: 40px; padding: 0 14px; }
.pl-shop-link { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--presale); }
.pl-disclaimer { font-size: 12px; line-height: 1.6; color: var(--muted); padding-top: 32px; }
.pl-disclaimer p { margin: 0 0 6px; }

/* ---------- draft ---------- */
.pl-dark { background: var(--band); color: var(--night-text); min-height: 70vh; }
.pl-bar { background: var(--night); color: var(--night-text); border-bottom: 1px solid var(--night-line); }
.pl-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 12px; padding-bottom: 12px; }
.pl-bar a { color: var(--night-soft); font-weight: 700; font-size: 14px; }
.pl-bar-title { display: flex; flex-direction: column; }
.pl-bar-title strong { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; }
.pl-bar-title span { font-size: 13px; color: var(--night-muted); }
.pl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pl-chip { background: var(--night-chip); border: 1px solid var(--night-line); border-radius: 6px; padding: 7px 12px; font-size: 14px; }
.pl-chip.hot { background: var(--flame); border-color: var(--flame); color: var(--band); font-weight: 800; }
.pl-work { display: flex; flex-wrap: wrap; gap: 22px; padding-top: 18px; padding-bottom: 40px; }
.pl-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pl-side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; align-self: flex-start; }
@media (min-width: 900px) { .pl-side { position: sticky; top: 16px; } }
.pl-seats { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-seat { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--night-card); border: 1px solid var(--night-line); color: var(--night-soft); }
.pl-seat.me { background: var(--flame); border-color: var(--flame); color: var(--band); }
.pl-seat.bot { background: transparent; color: var(--night-muted); }
.pl-pack-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.pl-pack-head h1 { margin: 0; font-size: 18px; }
.pl-pack-head span { font-size: 13px; color: var(--night-muted); }
.pl-pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pl-card { all: unset; box-sizing: border-box; display: block; position: relative; cursor: pointer; border-radius: 4.75% / 3.5%;
  aspect-ratio: 488 / 680; background: var(--night-card); outline: 3px solid transparent; outline-offset: 3px; }
.pl-card img { display: block; width: 100%; height: 100%; border-radius: 4.75% / 3.5%; }
.pl-card:focus-visible { outline-color: var(--night-soft); }
.pl-card.picked { outline-color: var(--flame); }
.pl-card .pl-foil { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; background: var(--band);
  color: #FFC53A; border-radius: 4px; padding: 2px 6px; }
/* The name shows only until (or if not) the picture loads: the picture sits above it. */
.pl-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 8px; font-size: 12px; text-align: center; color: var(--night-soft); background: var(--night-card);
  border-radius: 4.75% / 3.5%; overflow: hidden; }
.pl-card img, .pl-mini img { position: relative; z-index: 1; }
.pl-card .pl-foil { z-index: 2; }
.pl-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pl-pick-row span { font-size: 13px; color: var(--night-muted); flex: 1 1 260px; }
.pl-panel { background: var(--night-card); border: 1px solid var(--night-line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pl-panel h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.pl-panel .sub { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--night-muted); }
.pl-preview img { width: 100%; border-radius: 4.75% / 3.5%; display: block; }
.pl-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.pl-list li { display: flex; justify-content: space-between; gap: 8px; background: var(--night-chip); border-radius: 4px; padding: 6px 9px; font-size: 13px; cursor: default; }
.pl-list .cost { color: var(--night-muted); white-space: nowrap; }
.pl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.pl-curve { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.pl-curve div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--night-muted); }
.pl-curve i { display: block; width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; }
.pl-done { text-align: center; padding: 40px 0; }
.pl-done h1 { font-family: var(--serif); font-size: 40px; font-weight: 600; margin: 0 0 10px; }

/* ---------- deck builder (light) ---------- */
.pl-light-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pl-light-panel .sub { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pl-deck-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.pl-deck-head h1 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 600; }
.pl-deck-head span { font-size: 13px; color: var(--muted); }
.pl-cols-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.pl-cols { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 10px; min-width: 820px; }
.pl-col-head { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.pl-stack { display: flex; flex-direction: column; }
.pl-stack .pl-mini + .pl-mini { margin-top: -118%; }
.pl-mini { all: unset; box-sizing: border-box; display: block; position: relative; cursor: pointer; width: 100%; aspect-ratio: 488 / 680; }
.pl-mini img { width: 100%; height: 100%; display: block; border-radius: 4.75% / 3.5%; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.pl-mini:hover, .pl-mini:focus-visible { z-index: 2; }
.pl-mini:focus-visible img { outline: 3px solid var(--blue); }
.pl-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pl-pool-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-pill { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.pl-pill[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pl-count { font-size: 32px; font-weight: 800; }
.pl-count small { font-size: 15px; color: var(--muted); font-weight: 700; }
.pl-land-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.pl-land-row div { display: flex; align-items: center; gap: 6px; }
.pl-step { width: 44px; height: 36px; border: 1px solid var(--field); background: #fff; border-radius: 4px; cursor: pointer; font-size: 18px; }
.pl-land-row b { width: 26px; text-align: center; }
.pl-light-panel .pl-curve div { color: var(--muted); }
.pl-note { font-size: 12px; color: var(--muted); }
.pl-shop-band { background: var(--ink); color: var(--night-text); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.pl-shop-band div { flex: 1 1 280px; color: var(--night-soft); }
.pl-shop-band b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--flame-text); }
.pl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pl-tabs button { min-height: 40px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--night-line); background: var(--night-card); color: var(--night-soft); font-weight: 700; font-size: 14px; cursor: pointer; }
.pl-tabs button[aria-selected="true"] { background: var(--flame); border-color: var(--flame); color: var(--band); }
.pl-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 6px; font-weight: 700; z-index: 50; }

@media (max-width: 760px) {
  .pl-hero h1 { font-size: 44px; }
  .pl-fan { display: none; }
  .pl-pack { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- game table (dark, like a felt) ---------- */
.pl-tablewrap { display: flex; flex-wrap: wrap; gap: 14px; background: var(--night); color: var(--night-text);
  border-radius: 8px; padding: 12px; margin: 0 -16px; }
.pl-tablemain { flex: 999 1 720px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pl-tableside { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.pl-opps { display: grid; gap: 10px; }
.pl-board { background: var(--band); border: 1px solid var(--night-line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.pl-board.mine { border-color: var(--blue); }
.pl-board.active { box-shadow: 0 0 0 2px var(--flame) inset; }
.pl-phead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.pl-life { display: inline-flex; align-items: center; gap: 6px; }
.pl-life b { font-size: 24px; min-width: 34px; text-align: center; }
.pl-step.dark, .pl-mini-btn { background: var(--night-chip); color: var(--night-text); border: 1px solid var(--night-line); border-radius: 4px; cursor: pointer; }
.pl-step.dark { width: 40px; height: 36px; font-size: 18px; }
.pl-mini-btn { min-height: 36px; padding: 0 10px; font-size: 13px; font-weight: 700; }
.pl-mini-btn:hover, .pl-step.dark:hover { border-color: var(--night-soft); }
.btn.ghost.dark { color: var(--night-text); border-color: var(--night-line); }
.btn.ghost.dark:hover { background: var(--night-chip); }
.pl-board-body { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-field-cards { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-zones { flex: 0 1 220px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.pl-zone { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pl-zone .sub, .pl-tableside .sub { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--night-muted); }
.pl-row { display: flex; gap: 8px; min-height: 20px; overflow-x: auto; padding: 4px 2px; }
.pl-row.wrap { flex-wrap: wrap; overflow: visible; }
.pl-tcard { all: unset; box-sizing: border-box; position: relative; flex: none; width: 76px; aspect-ratio: 488 / 680; cursor: pointer;
  border-radius: 4.75% / 3.5%; background: var(--night-card); transition: transform .15s; }
.pl-tcard img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; border-radius: 4.75% / 3.5%; }
.pl-tcard.tapped { transform: rotate(90deg); margin: 0 14px; }
.pl-tcard:focus-visible { outline: 3px solid var(--flame); outline-offset: 2px; }
.pl-tcard .pl-fallback { font-size: 10px; padding: 4px; }
.pl-counter { position: absolute; z-index: 2; bottom: 4px; right: 4px; background: var(--band); color: #FFC53A; font-size: 11px; font-weight: 800; border-radius: 4px; padding: 1px 5px; }
.pl-opps .pl-tcard { width: 58px; }
.pl-handbar { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-hand { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 6px 0 4px; }
.pl-hand .pl-tcard { width: 112px; }
.pl-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-log { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.pl-log li { background: var(--night-chip); border-radius: 4px; padding: 5px 8px; }
.pl-log .pl-note, .pl-tableside .pl-note { color: var(--night-muted); }
.pl-modal { position: fixed; inset: 0; background: rgba(8,17,28,.78); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pl-modal-in { background: var(--band); color: var(--night-text); border: 1px solid var(--night-line); border-radius: 8px; padding: 16px; max-width: 980px; width: 100%; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.pl-modal .pl-tcard { width: 130px; }
@media (max-width: 760px) { .pl-tablewrap { margin: 0 -8px; } .pl-hand .pl-tcard { width: 84px; } }
.pl-tcard[draggable="true"] { cursor: grab; }
.pl-dragging [data-drop] { outline: 2px dashed var(--night-line); outline-offset: 2px; border-radius: 6px; }
[data-drop].pl-over { outline: 2px dashed var(--flame) !important; background: rgba(242,150,24,.08); }
.pl-field-cards { min-height: 120px; }
.pl-zone[data-drop] { min-width: 90px; min-height: 60px; padding: 4px; }
.pl-drophint { margin: 8px; color: var(--night-muted); }
.pl-popmenu { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 4px; min-width: 180px; padding: 8px;
  background: var(--night-card); color: var(--night-text); border: 1px solid var(--night-line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.pl-popmenu .sub { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--flame-text); padding: 2px 4px 4px; }
.pl-popmenu .pl-mini-btn { text-align: left; }
/* Battlefield rows wrap instead of scrolling sideways (a redraw used to jump back to the start). */
.pl-field-cards .pl-row { flex-wrap: wrap; overflow: visible; }
.pl-stackzone { background: var(--band); border: 1px dashed var(--night-line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-height: 64px; }
.pl-stackzone .sub { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--flame-text); }
.pl-stackzone .pl-note { color: var(--night-muted); }
.pl-stack-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pl-stack-item .pl-tcard { width: 96px; }
.pl-owner { position: absolute; z-index: 2; top: 4px; left: 4px; right: 4px; background: var(--flame); color: var(--band); font-size: 9px; font-weight: 800;
  border-radius: 3px; padding: 1px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-tcard.token .pl-fallback { background: #1C2C40; color: var(--night-text); }
.pl-pickcard { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pl-mini-btn.on { background: var(--flame); color: var(--band); border-color: var(--flame); }
[data-hit] { cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
/* Draft: the pick button stays in sight above the pack. */
.pl-pick-row.top { position: sticky; top: 0; z-index: 5; background: var(--band); padding: 10px 0; }
