/* Deck builder (decks.html). Tokens come from landing.css. Two columns on a
   desk: the card browser, and the deck being built (sticky). On a phone the
   deck panel drops under the browser. */
.page-decks{ caret-color:auto; }
.builder{ width:min(1380px, calc(100vw - 32px)); margin:0 auto; padding-block:22px 40px; display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:22px; align-items:start; }
.builder h1{ font-size:26px; margin:0; }
.browse__head{ display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; margin-bottom:12px; }
.browse__note{ margin:0; color:var(--text-lo); font-size:13px; }

/* Filters */
.filters{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.filters__q{ flex:1 1 220px; min-width:160px; }
.filters input[type="search"], .filters select, .deck__name, .slot__select, .deck__opp select, .deck__tools select{
  appearance:none; font:inherit; font-size:14px; color:var(--text-hi); background:rgba(12,26,46,.85); border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
.filters select, .deck__opp select, .deck__tools select, .slot__select{ padding-right:26px; background-image:linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position:calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size:5px 5px; background-repeat:no-repeat; }
.filters input:focus-visible, .filters select:focus-visible, .deck__name:focus-visible, .btn:focus-visible, .tile:focus-visible{ outline:2px solid var(--brass-glow); outline-offset:2px; }
.filters__check{ font-size:13px; color:var(--text); display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.filters__check input{ accent-color:var(--brass); }
.filters__count{ margin-left:auto; font-size:12.5px; color:var(--text-lo); font-variant-numeric:tabular-nums; }

/* Card grid */
.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:12px; }
.tile{ position:relative; border-radius:10px; overflow:hidden; background:var(--panel); border:1px solid var(--line-soft); cursor:pointer; transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.tile:hover{ transform:translateY(-2px); border-color:var(--line); box-shadow:0 10px 24px rgba(0,0,0,.45); }
.tile__img{ display:block; width:100%; height:auto; aspect-ratio:744/1039; object-fit:cover; background:#0b1a2e; }
.tile.in-deck{ border-color:var(--brass); box-shadow:0 0 0 1px rgba(201,167,92,.35); }
.tile.off-identity .tile__img{ filter:saturate(.35) brightness(.7); }
.tile.is-banned .tile__img{ filter:grayscale(.85) brightness(.55); }
.tile__ban{ position:absolute; top:14px; right:-34px; transform:rotate(35deg); background:#b3261e; color:#fff; font-family:var(--font-display); font-weight:700; font-size:11px; letter-spacing:.14em; padding:3px 40px; box-shadow:0 2px 8px rgba(0,0,0,.5); pointer-events:none; }
.tile__count{ position:absolute; top:8px; left:8px; min-width:30px; text-align:center; padding:3px 7px; border-radius:999px; background:var(--brass); color:#1a1408; font-weight:800; font-size:13px; font-variant-numeric:tabular-nums; box-shadow:0 2px 8px rgba(0,0,0,.5); }
.tile__bar{ display:flex; align-items:center; gap:4px; padding:6px; background:rgba(7,16,28,.92); }
.tile__name{ flex:1; min-width:0; font-size:12px; line-height:1.2; color:var(--text-hi); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tile__btn{ appearance:none; cursor:pointer; width:26px; height:26px; border-radius:6px; border:1px solid var(--line); background:rgba(201,167,92,.1); color:var(--brass-glow); font:inherit; font-size:15px; font-weight:800; line-height:1; flex:none; }
.tile__btn:hover:not(:disabled){ background:rgba(201,167,92,.28); }
.tile__btn:disabled{ opacity:.35; cursor:default; }
.tile__btn--add{ background:rgba(201,167,92,.22); }

/* Card detail */
.detail[hidden], .saved[hidden]{ display:none; }
.detail{ position:relative; display:grid; grid-template-columns:150px minmax(0,1fr); gap:14px; padding:12px; margin-bottom:12px; border-radius:12px; background:rgba(15,31,54,.9); border:1px solid var(--line); }
.detail__img{ width:150px; height:auto; border-radius:8px; aspect-ratio:744/1039; object-fit:cover; }
.detail__side{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.detail__name{ font-family:var(--font-display); font-size:19px; color:var(--brass-glow); padding-right:28px; }
.detail__meta{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-lo); flex-wrap:wrap; }
.detail__tags{ font-size:12px; color:var(--text-lo); letter-spacing:.04em; text-transform:uppercase; }
.detail__text{ margin:0; font-size:14px; line-height:1.5; white-space:pre-line; color:var(--text); }
.detail__banned{ font-size:13px; color:#ff9a8f; }
.detail__warn{ font-size:13px; color:#f0c674; }
.detail__actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:4px; }
.detail__count{ font-size:13px; color:var(--text-lo); }
.detail__close{ position:absolute; top:6px; right:8px; appearance:none; background:none; border:0; color:var(--text-lo); font-size:22px; cursor:pointer; line-height:1; }
.detail__close:hover{ color:var(--text-hi); }

/* Domain dots */
.dots{ display:inline-flex; gap:3px; align-items:center; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; box-shadow:inset 0 0 0 1px rgba(0,0,0,.35); }
.dot--fury{ background:var(--fury); } .dot--calm{ background:var(--calm); } .dot--mind{ background:var(--mind); }
.dot--body{ background:var(--body); } .dot--chaos{ background:var(--chaos); } .dot--order{ background:var(--order); }

/* Buttons */
.btn{ appearance:none; cursor:pointer; font:inherit; font-size:13.5px; font-weight:700; letter-spacing:.02em; padding:8px 14px; border-radius:8px; border:1px solid var(--line); color:var(--brass-glow); background:rgba(201,167,92,.1); white-space:nowrap; }
.btn:hover:not(:disabled){ background:rgba(201,167,92,.24); border-color:var(--brass); }
.btn:disabled{ opacity:.45; cursor:default; }
.btn--brass{ color:#1a1408; background:linear-gradient(180deg, #f2ddac, var(--brass)); border-color:var(--brass-glow); }
.btn--brass:hover:not(:disabled){ background:linear-gradient(180deg, #f7e6bc, #d3b26a); }
.btn--quiet{ background:transparent; }
.btn--tiny{ padding:3px 8px; font-size:11.5px; margin-left:6px; }
.btn--big{ font-family:var(--font-display); font-size:14px; letter-spacing:.06em; text-transform:uppercase; padding:12px 16px; }

/* Deck panel */
.builder__deck{ position:sticky; top:72px; max-height:calc(100vh - 88px); overflow:auto; display:flex; flex-direction:column; gap:14px; padding:14px; border-radius:var(--radius); background:rgba(15,31,54,.88); border:1px solid var(--line); backdrop-filter:blur(8px); }
.deck__close{ display:none; }
.deck__top{ display:flex; flex-direction:column; gap:8px; }
.deck__name{ width:100%; font-family:var(--font-display); font-size:18px; box-sizing:border-box; }
.deck__tools{ display:flex; gap:6px; flex-wrap:wrap; }
.deck__tools select{ font-size:12.5px; padding:5px 26px 5px 8px; }
.deck__tools .btn{ padding:5px 10px; font-size:12.5px; }
.deck__section{ display:flex; flex-direction:column; gap:6px; }
.deck__label{ display:flex; align-items:center; gap:8px; font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-lo); }
.count{ margin-left:auto; font-variant-numeric:tabular-nums; color:#f0c674; }
.count.is-ok{ color:#8ff0b0; }
.slot{ display:flex; align-items:center; gap:10px; min-height:52px; padding:8px; border-radius:10px; border:1px dashed var(--line); background:rgba(7,16,28,.4); position:relative; }
.slot.is-set{ border-style:solid; }
.slot__img{ width:60px; height:auto; border-radius:5px; flex:none; aspect-ratio:744/1039; object-fit:cover; }
.slot__text{ min-width:0; }
.slot__name{ font-weight:700; color:var(--text-hi); font-size:14px; }
.slot__meta{ font-size:12px; color:var(--text-lo); display:flex; align-items:center; gap:6px; }
.slot__empty{ font-size:12.5px; color:var(--text-lo); line-height:1.4; }
.slot__select{ width:100%; font-size:13px; }
.slot__x{ position:absolute; top:4px; right:6px; appearance:none; background:none; border:0; color:var(--text-lo); cursor:pointer; font-size:16px; }
.slot__x:hover{ color:var(--text-hi); }
.list{ display:flex; flex-direction:column; gap:2px; }
.list__head{ font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--brass-dim); margin-top:6px; }
.list__empty{ font-size:12.5px; color:var(--text-lo); line-height:1.4; padding:4px 0; }
.row{ display:flex; align-items:center; gap:6px; padding:4px 6px; border-radius:6px; font-size:13.5px; cursor:pointer; }
.row:hover{ background:rgba(201,167,92,.08); }
.row--champion .row__name::after{ content:" \2605"; color:var(--brass); }
.row--bad .row__name{ color:#ff9a8f; }
.row--rune, .row--saved{ cursor:default; }
.row__n{ width:26px; text-align:right; font-variant-numeric:tabular-nums; color:var(--text-lo); flex:none; }
.row__cost{ width:16px; text-align:center; font-size:12px; font-weight:800; color:var(--brass-glow); flex:none; }
.row__name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-hi); }
.row__btn{ appearance:none; cursor:pointer; width:22px; height:22px; border-radius:5px; border:1px solid var(--line-soft); background:transparent; color:var(--brass-glow); font:inherit; font-size:14px; font-weight:800; line-height:1; flex:none; }
.row__btn:hover:not(:disabled){ background:rgba(201,167,92,.22); }
.row__btn:disabled{ opacity:.3; cursor:default; }
.row__link{ appearance:none; background:none; border:0; color:var(--text-hi); font:inherit; font-size:13.5px; cursor:pointer; text-align:left; flex:1; padding:2px 0; }
.row__link:hover{ color:var(--brass-glow); text-decoration:underline; }
.row.is-current .row__link{ color:var(--brass-glow); font-weight:700; }

/* Check + play */
.check{ display:flex; flex-direction:column; gap:4px; padding:10px 12px; border-radius:10px; background:rgba(7,16,28,.55); border:1px solid var(--line-soft); }
.check__head{ font-weight:700; color:#f0c674; font-size:13.5px; }
.check__head.is-ok{ color:#8ff0b0; }
.check__item{ font-size:12.5px; line-height:1.4; padding-left:14px; position:relative; }
.check__item::before{ content:""; position:absolute; left:2px; top:7px; width:6px; height:6px; border-radius:50%; background:#ff9a8f; }
.check__item--warning::before{ background:#f0c674; }
.deck__play{ display:flex; flex-direction:column; gap:8px; }
.deck__opp{ display:flex; align-items:center; gap:10px; font-size:13px; color:var(--text-lo); }
.deck__opp select{ flex:1; font-size:13px; padding:7px 26px 7px 10px; }
.deck__note{ font-size:12px; color:var(--text-lo); line-height:1.4; }
.saved{ display:flex; flex-direction:column; gap:2px; border-top:1px solid var(--line-soft); padding-top:10px; }
.saved__head{ font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-lo); margin-bottom:4px; }

/* Flash message */
.flash{ position:fixed; left:50%; bottom:22px; transform:translate(-50%, 20px); z-index:80; padding:10px 16px; border-radius:10px; background:rgba(15,31,54,.96); border:1px solid var(--brass); color:var(--brass-glow); font-size:14px; opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; max-width:calc(100vw - 32px); }
.flash.is-on{ opacity:1; transform:translate(-50%, 0); }

/* Phone: a bottom bar with the counts; tapping it opens the deck panel as an overlay. */
.deckbar{ display:none; }
@media (max-width: 960px){
  .builder{ grid-template-columns:1fr; padding-bottom:84px; }
  .builder__deck{ display:none; }
  body.deck-open .builder__deck{ display:flex; position:fixed; inset:0; z-index:70; max-height:none; border-radius:0; padding-top:56px; overflow:auto; }
  body.deck-open{ overflow:hidden; }
  body.deck-open .deckbar{ display:none; }
  body.deck-open .builder__deck{ padding-bottom:40px; }
  .deckbar{ display:flex; position:fixed; left:0; right:0; bottom:0; z-index:75; align-items:center; gap:10px; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:rgba(7,16,28,.96); border-top:1px solid var(--line); backdrop-filter:blur(8px); }
  .deckbar__counts{ display:flex; gap:12px; font-size:12.5px; color:var(--text-lo); font-variant-numeric:tabular-nums; flex:1; flex-wrap:wrap; }
  .deckbar__counts b{ color:var(--text-hi); font-weight:700; }
  .deckbar__counts b.is-ok{ color:#8ff0b0; }
  .deckbar__btn{ flex:none; }
  .deck__close{ display:block; position:fixed; top:10px; right:12px; z-index:76; }
  body:not(.deck-open) .deck__close{ display:none; }
  .grid{ grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); }
  .detail{ grid-template-columns:110px minmax(0,1fr); }
  .detail__img{ width:110px; }
}
@media (prefers-reduced-motion: reduce){ .tile, .flash{ transition:none; } }
