* {
    font-family: "HelveticaNeue-CondensedBold", "HelveticaNeueBoldCondensed", "HelveticaNeue-Bold-Condensed", "Helvetica Neue Bold Condensed", "HelveticaNeueBold", "HelveticaNeue-Bold", "Helvetica Neue Bold", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosCnBold', "Helvetica", "Tahoma", "Geneva", "Arial Narrow", "Arial", sans-serif; font-weight:600; font-stretch:condensed;
}

html {
    height: 100%;
    width: 100%;
    clip: auto;
    position: absolute;
    overflow: hidden;
    background-image: url("/static/swccg/Test1background.1851c208b5fb.png");
}
#deckBuild {
  width: 66vw;
}

#searchResults {
    display: flex;
    flex-wrap: wrap;
    width: 30vw;
    height: 55vh;
    overflow: auto;
    flex-direction: row;
    align-content: flex-start;
}

.floating-card-panel {
    position: fixed;
    display: none;
    flex-direction: column;
    z-index: 90;
    border: 2px solid #444;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --card-width: 90px;
    --card-height: 125.5px;
    --card-overlap: 10px;
    --card-container-height: 126px;
}

.panel-drag-handle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px 36px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid #444;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.panel-drag-title {
    pointer-events: none;
}

.panel-close-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.panel-close-btn:hover {
    background: rgba(220, 80, 80, 0.85);
}

.floating-card-content {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    min-height: 0;
    overflow: auto;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    align-items: flex-start;
    padding: 16px;
    gap: 4px;
}

#sixtyFirst {
    z-index: 95;
    max-height: calc(100vh - 32px);
    background: rgba(0, 0, 0, 0.94);
}

#sixtyFirst .floating-card-content {
    padding: 12px;
}

#cardsOutsideDeck {
    width: 75vw;
    height: 60vh;
    min-height: 320px;
    background: rgba(0, 0, 0, 0.92);
}

#randomHand {
    width: 65vw;
    height: auto;
    max-height: 80vh;
    z-index: 100;
    background-color: #000;
}

#randomHand .floating-card-content {
    flex-wrap: nowrap;
    justify-content: center;
    align-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 36px;
    gap: 8px;
}

#randomHand .cardContainer {
    margin-right: 0;
}

#deckBuilder {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-content: flex-start;
    overflow: auto;
    width: 65vw;
    height: 80vh;
    background-color: transparent;
    position: relative;
    --card-width: 90px;
    --card-height: 125.5px;
    --card-overlap: 10px;
    --card-container-height: 126px;
}

#deckStats {
    display: flex;
    width: 30vw;
    height: 20vh;
    text-align: center;
    color: white;
}
#search {
    position: relative;
    width: 30vw;
    padding-left: 0pt;
    bottom: 0;
}

.collapsible {
    align-items: center;
    justify-content: center;
    display: flex;
    /* padding: 12px; */
    cursor: pointer;
    width: 200px;
    height: 45px;
    font-size: 18px;
}

.active, .collapsible:hover {
    background-color:aliceblue;
}

.card {
    display: flex;
    flex-basis: auto;
    --search-card-width: 100px;
    --search-card-height: calc(var(--search-card-width) * 125.5 / 90);
    height: var(--search-card-height);
    width: var(--search-card-width);
    background-color: transparent;
    flex-shrink: 0;
}

.card > img {
    width: 100%;
    height: auto;
}

.site-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.site {
  display: block;
  transform-origin: 0 0;
  transform: rotate(.25turn);
  margin-left: 100%;
  max-width: none;
  width: var(--search-card-height);
  height: auto;
}

.cardContainer {
  display: flex;
  position: relative;
  height: var(--card-container-height, 126px);
  flex-shrink: 0;
  margin-right: 4px;
  margin-bottom: 4px;
}

.deckCard {
    height: var(--card-height, 125.5px);
    width: var(--card-width, 90px);
}

.deckCard > img {
    width: 100%;
    height: auto;
}

.deckCard--flippable {
    position: relative;
}

.deck-flip-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    z-index: 3;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: #1a1a1a;
    background-color: #fbbf24;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.92;
}

.deck-flip-btn:hover {
    background-color: #f59e0b;
}

#parameterDiv {
    height: 100px;
    border: 3px solid #C7C7C7;

}
.searchBar {
    background-image: url("/static/swccg/Sketch002.81e482926a4c.png");
    background-position: center;
    width: 200px;
    margin-top: 2px;
    margin-bottom: 2px;
    border-radius: 5px;
}

.searchBar--plain {
    background-image: none;
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    padding: 6px 8px;
    width: 100%;
    color: #111827;
}

.deckpub-deckbuild--mtg html,
.deckpub-deckbuild--mtg {
    background-image: none;
    background-color: #1f2937;
}

html:has(body.deckpub-deckbuild--mtg),
html:has(body.deckpub-game-home) {
    background-image: none;
    background-color: #1f2937;
}

.deckpub-nav-bar {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deckpub-nav-bar--static {
    position: static;
    padding-left: 1rem;
    padding-top: 1rem;
}

.deckpub-nav-link,
.deckpub-nav-home {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #5eead4;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.deckpub-nav-link--inline {
    background: transparent;
    border: none;
    padding: 0;
    color: #fde047;
    font-size: 16px;
}

.deckpub-nav-link--inline:hover,
.deckpub-nav-link:hover,
.deckpub-nav-home:hover {
    color: #99f6e4;
    background: rgba(0, 0, 0, 0.65);
}

.deckpub-nav-link--inline:hover {
    background: transparent;
    color: #fef08a;
}

body.deckpub-deckbuild--mtg,
body.deckpub-game-home {
    background-image: none;
    background-color: #1f2937;
}

body.deckpub-deckbuild--mtg .deckpub-deckbuild-panel {
    width: 66vw;
    padding-top: 3.5rem;
}

body.deckpub-deckbuild--mtg .deckpub-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(31, 41, 55, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.deckpub-deckbuild--mtg .deckpub-deckbuild-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-right: 1rem;
    position: relative;
    z-index: 20;
}

body.deckpub-deckbuild--mtg .deckpub-deckbuild-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

body.deckpub-deckbuild--mtg #deckBuilder.deckpub-main-deck {
    width: 65vw;
    height: 80vh;
    overflow: auto;
}

.deckpub-deckbuild--mtg .deckpub-filter {
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    padding: 4px 6px;
    color: #111827;
    width: 100%;
}

body.deckpub-deckbuild--mtg #deckStats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

body.deckpub-deckbuild--mtg #chartMode,
body.deckpub-deckbuild--mtg .deckpub-chart-mode {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.25;
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    color: #111827;
}

body.deckpub-deckbuild--mtg .deckpub-chart-canvas-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    position: relative;
}

body.deckpub-deckbuild--mtg .deckpub-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

body.deckpub-deckbuild--mtg #sideboardControls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.deckpub-deckbuild--mtg #sortButtons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-left: 0;
}

body.deckpub-deckbuild--mtg #sortButtons button {
    width: auto;
    padding: 4px 10px;
    font-size: 14px;
    line-height: 1.25;
    border-radius: 6px;
}

body.deckpub-deckbuild--mtg #clearDeck {
    width: auto;
    align-self: auto;
}

.random-hand-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.hand-size-toggle {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    overflow: hidden;
}

.hand-size-btn {
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.hand-size-btn:last-child {
    border-right: none;
}

.hand-size-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hand-size-btn.active {
    background: papayawhip;
    color: #1a1a1a;
}

#randomHandButton {
    background-color: papayawhip;
    border-radius: 5px;
    padding: 4px 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

#randomHandButton:hover {
    background-color: #ffe4b5;
}


.focusCardDiv {
    position: absolute; 
    /* right: 165px;
    bottom: 132px; */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
    cursor: move;
    border-radius: 20px;
}

.focusCardDiv--flippable {
    padding-bottom: 2.75rem;
}

/* Sideways cards (landscape image files) are turned a quarter inside an
   upright frame, so the preview box is the same shape as any other card. */
.zoom-frame--sideways {
    --zoom-card-width: 20vw;
    position: relative;
    width: var(--zoom-card-width);
    height: calc(var(--zoom-card-width) * 125.5 / 90);
}

.focusSite {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--zoom-card-width) * 125.5 / 90);
    height: var(--zoom-card-width);
    max-width: none;
    cursor: move;
    border-radius: 12px;
    transform: translate(-50%, -50%) rotate(.25turn);
}
.focusCard {
    width: 20vw;
    border-radius: 12px;

    /* height: 498px;   */
}

.zoom-flip-btn {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    background-color: #fbbf24;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
}

.zoom-flip-btn:hover {
    background-color: #f59e0b;
}

.deckCard .site-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.deckSite {
    display: block;
    transform-origin: 0 0;
    transform: rotate(.25turn);
    margin-left: 100%;
    max-width: none;
    width: var(--card-height, 125.5px);
    height: auto;
}

.cardStack {
    transform: translate(10px);
}

.child {
    position: absolute;
  }

  .import:hover {
    cursor: pointer;
  }

  #lsShields {
    /* background-image: url("/static/swccg/image.77b178ff9dc6.jpg"); */
    background-position: center;
    background-color: #42ADC7;
    border-radius: 10px;
    border: 1px solid black;
  }

  #shieldButton {
    background-color: #1DACD0;
    border-radius: 10px;
  }

  #sixtyFirstButton{
    background-color: orange;
    border-radius: 10px;
  }

  #clearSixtyFirst{
    background-color: orange;
    border-radius: 10px;
    border: 1px solid black;
    width: 200px;
  }
  
  #outsideDecks{
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-content: flex-start;
    width: 65vw;
  }

  .opaque {
    background-color: green;
  }

  #sortButtons {
    margin-left: auto;
    display:flex;
    flex-direction: column;
  }
  #sortDeckByType {
    background-color: greenyellow;
    border-radius: 10px;
    width: 150px;
    margin-bottom: 1px;
    /* align-self: flex-end; */
  }
  #sortDeckByDestiny {
    background-color: greenyellow;
    border-radius: 10px;
    width: 150px;
    margin-bottom: 1px;
    /* align-self: flex-end; */
  }
  #sortDeckByName {
    background-color: greenyellow;
    border-radius: 10px;
    width: 150px;
    margin-bottom: 1px;
    /* align-self: flex-end; */
  }

  #clearDeck{
    background-color: rgb(205,92,92);
    border-radius: 10px;
  }

  #outsideButtons {
    display: flex;
    flex-direction: column;
  }

  /* .starting {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    border: 3px solid red;
    margin: 2px;
  } */

  /* .starting {
    box-shadow:inset 0px 0px 0px 10px rgb(170, 96, 96);
    -webkit-box-shadow:inset 0px 0px 0px 10px rgb(209, 134, 134);
    -moz-box-shadow:inset 0px 0px 0px 10px rgb(170, 101, 101);
    box-sizing: border-box;
  } */
  .starting {
    outline: 3px solid red;
    outline-offset: -3px;
  }

.deckpub-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 8px 12px;
    z-index: 30;
}

.deckpub-nav-bar--toolbar {
    position: static;
    top: auto;
    left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deckpub-deckbuild-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.deckpub-deckbuild-actions .import,
.deckpub-deckbuild-actions button {
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

/* The Import control is a <label> for a hidden file input; lay it out like the
   buttons beside it so its text sits centred at every size. */
.deckpub-deckbuild-actions .import {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.deckpub-deckbuild--swu,
html:has(body.deckpub-deckbuild--swu) {
    background-image: none;
    background-color: #111827;
}

html:has(body.deckpub-deckbuild--swu) {
    position: relative;
    overflow: hidden;
    height: 100%;
}

body.deckpub-deckbuild--swu {
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.deckpub-deckbuild-shell--swu {
    --swu-slot-width: 165px;
    --swu-slot-height: 205px;
    --swu-leader-wide-width: 210px;
    --swu-leader-wide-height: 150px;
    --swu-base-slot-width: 210px;
    --swu-base-slot-height: 150px;
    display: grid;
    grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.deckpub-deckbuild-shell--swu .deckpub-top-bar {
    grid-column: 1 / -1;
    flex-shrink: 0;
    background: rgba(17, 24, 39, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.deckpub-deckbuild-shell--swu .deckpub-deck-column {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem 0.5rem;
}

.deckpub-deckbuild-shell--swu .deckpub-sidebar {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    display: grid;
    /* Search now owns the whole sidebar; the chart moved beside leader/base. */
    grid-template-rows: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0 0.75rem 0.5rem 0.25rem;
}

.deckpub-deckbuild-shell--swu .deckpub-deckbuild-panel,
.deckpub-deckbuild-shell--swu #deckBuild {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding-top: 0;
    box-sizing: border-box;
}

.deckpub-deckbuild-shell--swu .deckpub-deck-title-row {
    text-align: left;
    padding: 0.15rem 0.5rem 0;
}

.deckpub-deckbuild-shell--swu .deckpub-deck-title-row #deckTitle {
    font-size: 1.1rem;
}

.deckpub-deckbuild-shell--swu .swu-leader-base-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.25rem;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    padding: 0 0.5rem;
}

/* Chart panel now lives beside the leader/base slots, filling the space that
   used to sit empty there. It overrides the base #deckStats (20vh/30vw) sizing
   via the higher-specificity id-in-context selector below. */
.deckpub-deckbuild-shell--swu .swu-leader-base-row #deckStats {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: var(--swu-slot-height);
    align-self: flex-start;
}

.deckpub-deckbuild-shell--swu .swu-slot-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.deckpub-deckbuild-shell--swu .swu-slot-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
}

.deckpub-deckbuild-shell--swu .swu-slot-frame {
    position: relative;
    width: var(--swu-slot-width);
    height: var(--swu-slot-height);
    flex-shrink: 0;
}

.deckpub-deckbuild-shell--swu .swu-slot-zone--base .swu-slot-frame {
    width: var(--swu-base-slot-width);
    height: var(--swu-base-slot-height);
}

/* A leader's two faces are different shapes: the leader side is landscape,
   the deployed unit side portrait. card-ui.js reports which face is showing
   and the slot turns to match, so neither is cropped or shrunk to a sliver.
   The bottom margin keeps the row the same height either way. */
.deckpub-deckbuild-shell--swu .swu-slot-zone:has(.swu-slot-builder[data-image-orientation="landscape"]:not(:empty)) .swu-slot-frame {
    width: var(--swu-leader-wide-width);
    height: var(--swu-leader-wide-height);
    margin-bottom: calc(var(--swu-slot-height) - var(--swu-leader-wide-height));
}

.deckpub-deckbuild-shell--swu .swu-slot-zone--base .swu-slot-builder {
    --card-width: var(--swu-base-slot-width);
    --card-height: var(--swu-base-slot-height);
    --card-container-height: calc(var(--swu-base-slot-height) + 1px);
}

.deckpub-deckbuild-shell--swu .swu-slot-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
}

.deckpub-deckbuild-shell--swu .swu-slot-placeholder.hidden {
    display: none;
}

.deckpub-deckbuild-shell--swu .swu-slot-builder {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    --card-width: var(--swu-slot-width);
    --card-height: var(--swu-slot-height);
    --card-overlap: 10px;
    --card-container-height: calc(var(--swu-slot-height) + 1px);
}

/* Fit the card art to the slot regardless of orientation. This keeps a
   landscape base (and the landscape deployed side of a flipped leader)
   centred and as large as possible instead of pinned small to the top. */
/* The slot, not the JS card size, is the authority: the card always fills
   whatever shape the slot currently is (it shrinks on narrow screens and the
   leader slot turns with the face showing). */
.deckpub-deckbuild-shell--swu .swu-slot-builder .cardContainer {
    width: 100% !important;
    height: 100%;
    margin: 0;
}

.deckpub-deckbuild-shell--swu .swu-slot-builder .deckCard {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.deckpub-deckbuild-shell--swu .swu-slot-builder .deckCard > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.deckpub-deckbuild-shell--swu #deckBuilder.deckpub-main-deck {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    margin: 0;
}

.deckpub-deckbuild-shell--swu .deckpub-sideboard-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.5rem 0;
    font-size: 13px;
}

.deckpub-deckbuild-shell--swu .deckpub-sort-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.deckpub-deckbuild-shell--swu .deckpub-sort-buttons button {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
}

.deckpub-deckbuild-shell--swu .deckpub-deck-stats {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    text-align: left;
    color: white;
}

.deckpub-deckbuild-shell--swu .deckpub-aspect-penalty {
    margin: 0;
    font-size: 12px;
}

.deckpub-deckbuild-shell--swu #chartMode,
.deckpub-deckbuild-shell--swu .deckpub-chart-mode {
    width: 100%;
    padding: 4px 8px;
    font-size: 13px;
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    color: #111827;
}

.deckpub-deckbuild-shell--swu .deckpub-chart-canvas-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
}

.deckpub-deckbuild-shell--swu .deckpub-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.deckpub-deckbuild-shell--swu .deckpub-search-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    float: none;
}

.deckpub-deckbuild-shell--swu .search_div {
    overflow: hidden;
}

.deckpub-deckbuild-shell--swu .deckpub-filter {
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    padding: 3px 6px;
    color: #111827;
    width: 100%;
    font-size: 13px;
}

.deckpub-deckbuild-shell--swu .deckpub-result-count {
    font-size: 12px;
    padding: 0.15rem 0;
}

.deckpub-deckbuild-shell--swu .deckpub-search-results,
.deckpub-deckbuild-shell--swu #searchResults {
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: wrap;
    align-content: flex-start;
}

.deckpub-deckbuild-shell--swu .swu-aspect-filter-group {
    gap: 4px;
}

.deckpub-deckbuild-shell--swu .swu-aspect-toggle {
    flex: 1 1 calc(50% - 4px);
    padding: 4px 6px;
    font-size: 11px;
}

.swu-search-card .swu-card-meta {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 4px;
    border-radius: 4px;
}

.swu-aspect-row {
    position: absolute;
    bottom: 4px;
    left: 4px;
    display: flex;
    gap: 3px;
}

.swu-aspect-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.swu-aspect-badge .swu-aspect-icon,
.swu-aspect-toggle .swu-aspect-icon {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

img.swu-aspect-icon {
    width: 18px;
    height: 18px;
}

.swu-aspect-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.swu-aspect-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #f8fafc;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--aspect-color, #64748b);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.swu-aspect-toggle .swu-aspect-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swu-aspect-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.swu-aspect-toggle.active,
.swu-aspect-toggle[aria-pressed="true"] {
    color: var(--aspect-ink, #fff);
    background: var(--aspect-color, #64748b);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* ------------------------------------------------------------------------
   SWCCG deck builder shell (desktop). Same two-column, no-page-scroll grid as
   the SWU builder, kept on the classic starfield background. The legacy
   float/vw rules above (#deckBuild, #search, #searchResults, #deckStats,
   #sortButtons, ...) are overridden here with id-in-context selectors.
   ------------------------------------------------------------------------ */
html:has(body.deckpub-deckbuild--swccg) {
    position: relative;
    overflow: hidden;
    height: 100%;
}

body.deckpub-deckbuild--swccg {
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
    /* Bootstrap paints the body white; let the starfield on <html> show
       through now that the body fills the viewport. */
    background: transparent;
}

.deckpub-deckbuild-shell--swccg {
    display: grid;
    grid-template-columns: minmax(0, 64fr) minmax(0, 36fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.deckpub-deckbuild-shell--swccg .deckpub-top-bar {
    grid-column: 1 / -1;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deckpub-deckbuild-shell--swccg .deckpub-deck-column {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem 0.5rem;
}

.deckpub-deckbuild-shell--swccg #deckBuild {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
}

.deckpub-deckbuild-shell--swccg .deckpub-deck-title-row {
    padding: 0.15rem 0.5rem 0;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.deckpub-deckbuild-shell--swccg #deckBuilder {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    margin: 0;
    background: rgba(0, 0, 0, 0.3);
}

.deckpub-deckbuild-shell--swccg #outsideDecks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.25rem 0.5rem 0;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.deckpub-deckbuild-shell--swccg #outsideButtons,
.deckpub-deckbuild-shell--swccg #sixtyFirstButtons,
.deckpub-deckbuild-shell--swccg #sortButtons {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.deckpub-deckbuild-shell--swccg #sortButtons {
    margin-left: auto;
}

.deckpub-deckbuild-shell--swccg #outsideDecks button {
    width: auto;
    height: auto;
    margin: 0;
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.25;
    border-radius: 6px;
    white-space: nowrap;
}

.deckpub-deckbuild-shell--swccg .deckpub-sidebar {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(0, 26fr) minmax(0, 74fr);
    gap: 0.5rem;
    padding: 0 0.75rem 0.5rem 0.25rem;
}

.deckpub-deckbuild-shell--swccg #deckStats {
    display: flex;
    flex-direction: column;
    float: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0.25rem;
    color: white;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
}

.deckpub-deckbuild-shell--swccg .deckpub-chart-canvas-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
}

.deckpub-deckbuild-shell--swccg .deckpub-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.deckpub-deckbuild-shell--swccg #search {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    float: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0.5rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
}

.deckpub-deckbuild-shell--swccg .search_div {
    overflow: hidden;
}

.deckpub-deckbuild-shell--swccg .deckpub-filter {
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    padding: 3px 6px;
    color: #111827;
    width: 100%;
    font-size: 13px;
}

.swccg-text-filter-row {
    display: flex;
    gap: 0.35rem;
}

.swccg-text-filter-row .deckpub-filter {
    flex: 1 1 0;
    min-width: 0;
}

.deckpub-deckbuild-shell--swccg #resultCount {
    font-size: 12px;
    padding: 0.15rem 0;
}

.deckpub-deckbuild-shell--swccg #searchResults {
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: wrap;
    align-content: flex-start;
}

/* ------------------------------------------------------------------------
   Search head + zoom controls (all screen sizes)
   ------------------------------------------------------------------------ */

.deckpub-search-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.deckpub-search-head .searchBar--plain {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

/* The sheet grip and the Filters toggle only exist on narrow screens. */
.deckpub-sheet-handle,
.deckpub-filter-toggle {
    display: none;
}

/* Long-press opens the zoom view on touch; stop the browser from selecting
   the image or showing its own callout while the finger is held down. */
.card,
.deckCard,
.cardContainer {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.zoom-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 11;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: rgba(220, 80, 80, 0.95);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.zoom-close-btn:hover {
    background: rgba(239, 68, 68, 1);
}

/* ------------------------------------------------------------------------
   Mobile / narrow layout (phones and portrait tablets)

   One column: top bar, deck, then the search panel as a bottom sheet. The
   sheet's height is driven by `--sheet-height` from core/mobile-sheet.js and
   snaps between collapsed (search box only), half, and full. Because the
   sheet is a real grid row rather than an overlay, the deck area genuinely
   shrinks and its fit-to-container card layout re-runs via ResizeObserver.
   ------------------------------------------------------------------------ */
@media (max-width: 900px) {
    html:has(body.deckpub-deckbuild) {
        position: fixed;
        inset: 0;
        height: 100%;
        overflow: hidden;
    }

    body.deckpub-deckbuild {
        margin: 0;
        padding: 0;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-shell {
        --sheet-height: 50vh;
        --swu-slot-width: 84px;
        --swu-leader-wide-width: 108px;
        --swu-leader-wide-height: 77px;
        --swu-slot-height: 104px;
        --swu-base-slot-width: 108px;
        --swu-base-slot-height: 77px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) var(--sheet-height);
        height: 100vh;
        height: 100dvh;
        width: 100%;
        overflow: hidden;
        transition: grid-template-rows 0.22s ease;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-shell.is-dragging {
        transition: none;
    }

    /* --- Top bar: one horizontally scrollable row ------------------------ */
    body.deckpub-deckbuild .deckpub-top-bar {
        position: static;
        grid-column: 1;
        grid-row: 1;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 6px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        background: rgba(0, 0, 0, 0.35);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    body.deckpub-deckbuild .deckpub-top-bar::-webkit-scrollbar {
        display: none;
    }

    body.deckpub-deckbuild .deckpub-top-bar .deckpub-nav-bar--toolbar,
    body.deckpub-deckbuild .deckpub-top-bar .deckpub-deckbuild-actions {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    body.deckpub-deckbuild .deckpub-top-bar .deckpub-nav-link--all-games {
        display: none;
    }

    body.deckpub-deckbuild .deckpub-top-bar .deckpub-nav-link {
        padding: 6px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-actions .import,
    body.deckpub-deckbuild .deckpub-deckbuild-actions button,
    body.deckpub-deckbuild .deckpub-deckbuild-actions select {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 13px;
    }

    /* --- Deck column ----------------------------------------------------- */
    body.deckpub-deckbuild .deckpub-deckbuild-shell > .deckpub-deck-column,
    body.deckpub-deckbuild .deckpub-deckbuild-shell > #deckBuild {
        grid-column: 1;
        grid-row: 2;
        float: none;
        width: 100%;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0 0.5rem 0.25rem;
    }

    body.deckpub-deckbuild #deckBuild,
    body.deckpub-deckbuild .deckpub-deckbuild-panel {
        width: 100%;
        padding-top: 0;
    }

    body.deckpub-deckbuild .deckpub-deck-title-row {
        padding: 0.15rem 0.25rem 0;
        text-align: left;
    }

    body.deckpub-deckbuild .deckpub-deck-title-row #deckTitle {
        font-size: 1rem;
    }

    /* MTG (and any non-SWU game): stack title / commander / deck / controls. */
    body.deckpub-deckbuild--mtg .deckpub-deckbuild-shell > #deckBuild {
        display: flex;
        flex-direction: column;
    }

    body.deckpub-deckbuild--mtg #commanderZone {
        margin: 0.25rem 0;
    }

    body.deckpub-deckbuild #deckBuilder,
    body.deckpub-deckbuild #deckBuilder.deckpub-main-deck {
        width: 100%;
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
        margin: 0.25rem 0 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* Scroll instead of shrinking cards below a comfortable tap target. */
        --card-min-scale: 0.66;
    }

    /* SWU: smaller leader/base slots; the chart hides but the aspect penalty
       count stays visible beside the slots. */
    body.deckpub-deckbuild .deckpub-deckbuild-shell--swu .swu-leader-base-row {
        gap: 0.5rem;
        padding: 0 0.25rem;
        align-items: flex-start;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-shell--swu .swu-leader-base-row #deckStats {
        height: auto;
        align-self: center;
    }

    body.deckpub-deckbuild .deckpub-deck-stats .deckpub-chart-mode,
    body.deckpub-deckbuild .deckpub-deck-stats .deckpub-chart-canvas-wrap {
        display: none;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-shell--swu .swu-slot-label {
        font-size: 10px;
    }

    body.deckpub-deckbuild .deckpub-deckbuild-shell--swu .swu-slot-placeholder {
        font-size: 9px;
        padding: 4px;
    }

    /* --- Sideboard / count / sort row ------------------------------------ */
    /* One scrollable row so the controls never steal a second line from the
       deck area. (#outsideDecks is the SWCCG equivalent of #sideboardControls.) */
    body.deckpub-deckbuild #outsideDecks,
    body.deckpub-deckbuild #outsideButtons,
    body.deckpub-deckbuild #sixtyFirstButtons {
        flex-wrap: nowrap;
    }

    body.deckpub-deckbuild #outsideDecks {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.4rem;
        margin: 0;
        padding: 0.3rem 0 0.1rem;
        font-size: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    body.deckpub-deckbuild #outsideDecks::-webkit-scrollbar {
        display: none;
    }

    body.deckpub-deckbuild #outsideDecks > span {
        white-space: nowrap;
    }

    body.deckpub-deckbuild #outsideDecks button {
        padding: 4px 8px;
        font-size: 12px;
    }

    body.deckpub-deckbuild #sideboardControls {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
        margin: 0;
        padding: 0.3rem 0 0.1rem;
        font-size: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    body.deckpub-deckbuild #sideboardControls::-webkit-scrollbar {
        display: none;
    }

    body.deckpub-deckbuild #sideboardControls .collapsible {
        width: auto;
        height: auto;
        padding: 5px 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    body.deckpub-deckbuild #sideboardControls > span {
        margin-left: 0;
        margin-right: 0;
        white-space: nowrap;
    }

    body.deckpub-deckbuild #sortButtons {
        display: flex;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        margin-left: auto;
    }

    body.deckpub-deckbuild #sortButtons button {
        width: auto;
        margin: 0;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 6px;
        white-space: nowrap;
    }

    body.deckpub-deckbuild #sideboardControls .collapsible {
        flex: 0 0 auto;
    }

    /* --- Search bottom sheet -------------------------------------------- */
    body.deckpub-deckbuild .deckpub-deckbuild-shell .deckpub-sidebar {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: 0;
        overflow: hidden;
        padding: 0 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
        background: rgba(0, 0, 0, 0.38);
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
    }

    body.deckpub-deckbuild .deckpub-sheet-handle {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        padding: 10px 0 8px;
        cursor: grab;
        touch-action: none;
    }

    body.deckpub-deckbuild .deckpub-sheet-handle:active {
        cursor: grabbing;
    }

    body.deckpub-deckbuild .deckpub-sheet-grip {
        width: 44px;
        height: 5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.4);
    }

    body.deckpub-deckbuild .deckpub-filter-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        min-height: 38px;
        padding: 6px 12px;
        font-size: 14px;
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        cursor: pointer;
    }

    body.deckpub-deckbuild .deckpub-filter-toggle[aria-expanded="true"] {
        color: #111827;
        background: #5eead4;
        border-color: #5eead4;
    }

    body.deckpub-deckbuild .deckpub-sidebar #deckStats {
        display: none;
    }

    body.deckpub-deckbuild .deckpub-sidebar #search {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        float: none;
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    body.deckpub-deckbuild .deckpub-sidebar .deckpub-search-head {
        flex: 0 0 auto;
        margin-bottom: 0.4rem;
    }

    /* 16px stops iOS from zooming the page when a field gets focus. */
    body.deckpub-deckbuild .deckpub-sidebar .searchBar--plain,
    body.deckpub-deckbuild .deckpub-sidebar .deckpub-filter {
        min-height: 38px;
        font-size: 16px;
    }

    /* Filters are tucked behind the Filters button so results stay visible
       in the half-height sheet. */
    body.deckpub-deckbuild .deckpub-sidebar .search_div {
        display: none;
        flex: 0 0 auto;
        max-height: 42vh;
        overflow-y: auto;
        padding-bottom: 0.25rem;
    }

    body.deckpub-deckbuild .deckpub-sidebar.filters-open .search_div {
        display: block;
    }

    body.deckpub-deckbuild .deckpub-sidebar .swu-aspect-toggle {
        min-height: 36px;
        font-size: 12px;
    }

    body.deckpub-deckbuild .deckpub-sidebar #resultCount {
        flex: 0 0 auto;
        display: block;
        margin: 0;
        padding: 0 0 4px;
        font-size: 12px;
    }

    body.deckpub-deckbuild .deckpub-sidebar #searchResults {
        flex: 1 1 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        justify-content: center;
        gap: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Floating panels (sideboard, random hand) pinned above the sheet - */
    body.deckpub-deckbuild .floating-card-panel {
        top: auto !important;
        left: 8px !important;
        right: 8px;
        bottom: calc(var(--sheet-height, 0px) + 8px);
        width: auto !important;
        max-height: min(60vh, calc(100vh - var(--sheet-height, 0px) - 72px));
    }

    body.deckpub-deckbuild .floating-card-panel .floating-card-content {
        padding: 10px;
    }

    /* --- Zoom preview: fill most of the phone screen ---------------------- */
    body.deckpub-deckbuild .focusCardDiv {
        position: fixed;
        z-index: 120;
    }

    /* The preview box is centred with left:50%, so its shrink-to-fit width is
       only half the viewport; lift the img max-width so the card can be wider
       than that. */
    body.deckpub-deckbuild .focusCard {
        width: min(80vw, 55vh * 0.717);
        max-width: none;
    }

    body.deckpub-deckbuild .zoom-frame--sideways {
        --zoom-card-width: min(80vw, 55vh * 0.717);
    }

    body.deckpub-deckbuild .zoom-close-btn {
        top: -14px;
        right: -8px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* =========================================================================
   Presentation mode ("Show Deck")
   The deck fills the viewport and every editing control is hidden so the
   screen can be handed over to show someone the decklist. Toggled by
   core/present-mode.js via body.deckpub-present; the module also flags a
   non-empty sideboard panel with .deckpub-present-strip so it renders inline
   under the main deck instead of floating.
   ========================================================================= */
.deckpub-present-exit {
    display: none;
}

body.deckpub-present {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Everything that is not the deck. */
body.deckpub-present .deckpub-top-bar,
body.deckpub-present .deckpub-sidebar,
body.deckpub-present #deckStats,
body.deckpub-present #sideboardControls button,
body.deckpub-present #outsideDecks button,
body.deckpub-present #sortButtons,
body.deckpub-present #outsideButtons,
body.deckpub-present #sixtyFirstButtons,
body.deckpub-present .floating-card-panel:not(.deckpub-present-strip) {
    display: none !important;
}

body.deckpub-present .deckpub-deckbuild-shell {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

body.deckpub-present .deckpub-deckbuild-shell > .deckpub-deck-column,
body.deckpub-present .deckpub-deckbuild-shell > #deckBuild {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    float: none;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.deckpub-present #deckBuild,
body.deckpub-present .deckpub-deckbuild-panel {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    padding: 0 !important;
    gap: 0.35rem;
    text-align: left;
}

body.deckpub-present .deckpub-deck-title-row {
    flex: 0 0 auto;
    padding: 0 6.5rem 0 0.5rem; /* leave room for the fixed Exit button */
    text-align: left;
}

body.deckpub-present .deckpub-deck-title-row #deckTitle {
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

body.deckpub-present .swu-leader-base-row,
body.deckpub-present #commanderZone {
    flex: 0 0 auto;
}

body.deckpub-present #deckBuilder,
body.deckpub-present #deckBuilder.deckpub-main-deck {
    flex: 1 1 auto;
    width: 100% !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
    margin: 0;
}

/* The count rows stay (Main / Sideboard / Card Total / Avg Destiny); their
   buttons are hidden above. */
body.deckpub-present #sideboardControls,
body.deckpub-present #outsideDecks {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0.25rem 0.5rem 0;
    font-size: 15px;
}

body.deckpub-present #sideboardControls > span,
body.deckpub-present #outsideDecks > span {
    margin: 0;
}

/* Sideboard shown inline as a strip under the deck. */
body.deckpub-present .floating-card-panel.deckpub-present-strip {
    display: flex !important;
    position: static !important;
    flex: 0 0 auto;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    height: clamp(120px, 22vh, 260px) !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0.25rem 0 0 !important;
    transform: none !important;
    z-index: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.35);
}

body.deckpub-present .deckpub-present-strip .panel-drag-handle {
    justify-content: flex-start;
    padding: 4px 12px;
    font-size: 12px;
    cursor: default;
}

body.deckpub-present .deckpub-present-strip .panel-close-btn {
    display: none;
}

/* No padding: the stack layout sizes cards from clientWidth/clientHeight, so
   padding would make a row wrap and vanish. Scroll is the safety net. */
body.deckpub-present .deckpub-present-strip .floating-card-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    justify-content: flex-start;
    align-content: flex-start;
    padding: 0 4px !important;
}

/* The only control left on screen. */
body.deckpub-present .deckpub-present-exit {
    display: inline-flex;
    position: fixed;
    top: calc(0.5rem + env(safe-area-inset-top, 0px));
    right: 0.75rem;
    z-index: 150;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
    background: #fde68a;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

body.deckpub-present .deckpub-present-exit:hover,
body.deckpub-present .deckpub-present-exit:focus-visible {
    background: #fcd34d;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* =========================================================================
   Toasts (core/toast.js)
   ========================================================================= */
.deckpub-toasts {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-chrome-height, 0px) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 130;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(92vw, 420px);
    transform: translateX(-50%);
    pointer-events: none;
}

.deckpub-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px 8px 14px;
    font-size: 14px;
    line-height: 1.25;
    color: #f9fafb;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 4px solid #5eead4;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: deckpub-toast-in 0.18s ease-out;
}

.deckpub-toast--warning {
    border-left-color: #fbbf24;
}

.deckpub-toast--error {
    border-left-color: #f87171;
}

.deckpub-toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.deckpub-toast-message {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deckpub-toast-action {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #5eead4;
    background: transparent;
    border: 1px solid rgba(94, 234, 212, 0.5);
    border-radius: 6px;
    cursor: pointer;
}

/* Wide screens: keep clear of the deck controls along the bottom. */
@media (min-width: 901px) {
    .deckpub-toasts {
        top: 58px;
        bottom: auto;
        /* Centred over the deck column, clear of the search box on the right. */
        left: 32%;
    }
}

body.deckpub-present .deckpub-toasts {
    display: none;
}

@keyframes deckpub-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* =========================================================================
   Card thumbnails + text decklist (core/card-ui.js, core/deck-list.js)
   ========================================================================= */

/* Every thumb is the same upright card shape. Sideways cards (landscape image
   files: sites, a few starships) are turned a quarter to fill it, the same way
   the search results and the deck grid show them. */
.deckpub-card-thumb {
    position: relative;
    display: block;
    flex: 0 0 auto;
    aspect-ratio: 90 / 125.5;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.deckpub-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    /* Landscape cards that stay landscape (SWU bases) letterbox, not stretch. */
    object-fit: contain;
}

.deckpub-card-thumb.is-sideways img {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Swapped box: as wide as the thumb is tall, and vice versa. */
    width: calc(100% * 125.5 / 90);
    height: calc(100% * 90 / 125.5);
    transform: translate(-50%, -50%) rotate(0.25turn);
}

/* The list takes the place of the image grid (List / Images toggle). The grid
   stays laid out underneath, hidden, so the zone panels that size themselves
   from it keep working. */
.deckpub-deckbuild-shell[data-deck-view="list"] .deckpub-deck-stage {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.deckpub-deckbuild-shell[data-deck-view="list"] #deckBuilder,
.deckpub-deckbuild-shell[data-deck-view="list"] #deckBuilder.deckpub-main-deck {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    visibility: hidden;
}

.deckpub-deckbuild-shell[data-deck-view="list"] .deckpub-deck-list {
    position: absolute;
    inset: 0;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    text-align: left;
    color: #f3f4f6;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

.deckpub-deck-list-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #99f6e4;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deckpub-deck-list-section--zone .deckpub-deck-list-heading {
    color: #fcd34d;
}

.deckpub-deck-list-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.deckpub-deck-list-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 6px 0 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.deckpub-deck-list-card {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    padding: 0 4px;
    font-size: 14px;
    text-align: left;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

.deckpub-deck-list-thumb {
    width: 27px;
}

.deckpub-deck-list-count {
    flex: 0 0 auto;
    min-width: 1.8em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #5eead4;
}

.deckpub-deck-list-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deckpub-deck-list-star,
.deckpub-deck-list-step {
    flex: 0 0 auto;
    width: 38px;
    height: 36px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    color: #f3f4f6;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    cursor: pointer;
}

.deckpub-deck-list-star {
    width: 34px;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.45);
    background: none;
    border-color: transparent;
}

.deckpub-deck-list-star[aria-pressed="true"] {
    color: #fbbf24;
}

.deckpub-deck-list-step:hover,
.deckpub-deck-list-step:active {
    background: rgba(94, 234, 212, 0.3);
}

.deckpub-deck-list-empty {
    margin: 0;
    padding: 2rem 1rem;
    font-size: 14px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Wide screens: type sections flow into columns, and the whole list scales
   with `--deck-list-scale` (set by fitDeckList in core/deck-list.js) so it
   grows to fill the deck area the way the card grid does. Sizes are in em so
   one font-size drives rows, thumbnails, buttons and column width together. */
@media (min-width: 901px) {
    .deckpub-deckbuild-shell[data-deck-view="list"] .deckpub-deck-list {
        font-size: calc(16px * var(--deck-list-scale, 1));
    }

    .deckpub-deck-list-columns {
        column-width: 19em;
        column-gap: 0.75em;
        padding: 0.75em 0.75em 0;
    }

    .deckpub-deck-list-section {
        break-inside: avoid;
        margin-bottom: 0.75em;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .deckpub-deck-list-heading {
        position: static;
        padding: 0.4em 0.8em;
        font-size: 0.86em;
    }

    .deckpub-deck-list-row {
        gap: 0.3em;
        min-height: 2.7em;
        padding: 0 0.45em 0 0.3em;
    }

    .deckpub-deck-list-card {
        gap: 0.6em;
        min-height: 2.7em;
        padding: 0 0.3em;
        font-size: 1em;
    }

    .deckpub-deck-list-thumb {
        width: 1.75em;
    }

    .deckpub-deck-list-step,
    .deckpub-deck-list-star {
        width: 2.1em;
        height: 2em;
        font-size: 1.1em;
        border-radius: 0.45em;
    }

    .deckpub-deck-list-star {
        width: 1.7em;
        font-size: 1.15em;
    }
}

/* MTG's wide layout sizes the deck grid in viewport units rather than from a
   grid row, so the stage that stands in for it needs the same box. */
@media (min-width: 901px) {
    body.deckpub-deckbuild--mtg .deckpub-deckbuild-shell[data-deck-view="list"] .deckpub-deck-stage {
        width: 65vw;
        height: 80vh;
        margin: 0.5rem 0 0.75rem;
    }
}

/* Show Deck always presents the card images. */
body.deckpub-present .deckpub-deckbuild-shell .deckpub-deck-stage {
    display: contents;
}

body.deckpub-present .deckpub-deckbuild-shell #deckBuilder {
    position: relative !important;
    inset: auto !important;
    visibility: visible !important;
}

body.deckpub-present .deckpub-deckbuild-shell .deckpub-deck-list {
    display: none;
}

/* =========================================================================
   Tabs layout (core/mobile-layout.js): optional narrow-screen layout

   Opt-in alternative to the bottom sheet: Deck and Search each get the full
   screen and a bottom tab bar flips between them. Everything here is off
   unless `body.deckpub-tabs` is set, which only happens below 900px when the
   user has picked this layout, so the default layouts are untouched.
   ========================================================================= */
.deckpub-layout-toggle,
.deckpub-deck-strip,
.deckpub-tab-bar,
.deckpub-deck-list {
    display: none;
}

#sortButtons .deckpub-deck-view-toggle {
    color: #111827;
    background: #5eead4;
}

/* Invisible wrapper unless the text decklist is showing. */
.deckpub-deck-stage {
    display: contents;
}

@media (max-width: 900px) {
    body.deckpub-deckbuild .deckpub-layout-toggle {
        display: inline-block;
    }

    body.deckpub-deckbuild .deckpub-layout-toggle[aria-pressed="true"] {
        color: #111827;
        background: #5eead4;
    }

    body.deckpub-tabs {
        --tab-bar-height: 52px;
        --deck-strip-height: 58px;
        --mobile-chrome-height: var(--tab-bar-height);
    }

    body.deckpub-tabs:has(.deckpub-deckbuild-shell[data-mobile-view="search"]) {
        --mobile-chrome-height: calc(var(--tab-bar-height) + var(--deck-strip-height));
    }

    /* top bar | active view | strip | tab bar. `--sheet-height` is reused so
       the floating zone panels keep sitting just above the bottom chrome. */
    body.deckpub-tabs .deckpub-deckbuild-shell {
        --sheet-height: calc(var(--mobile-chrome-height) + env(safe-area-inset-bottom, 0px));
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        transition: none;
    }

    /* Both views share one grid cell; the inactive one is hidden with
       `visibility` rather than `display` so the deck keeps its size (no
       re-layout on every switch) and its fixed-position zone panels, which
       opt back in below, can stay open over the Search view. */
    /* (The deck column is `.deckpub-deck-column`, or a bare `#deckBuild` in MTG.) */
    body.deckpub-tabs .deckpub-deckbuild-shell > .deckpub-deck-column,
    body.deckpub-tabs .deckpub-deckbuild-shell > #deckBuild,
    body.deckpub-tabs .deckpub-deckbuild-shell .deckpub-sidebar {
        grid-column: 1;
        grid-row: 2;
    }

    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="search"] > .deckpub-deck-column,
    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="search"] > #deckBuild,
    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="deck"] .deckpub-sidebar {
        visibility: hidden;
        pointer-events: none;
    }

    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="deck"] > .deckpub-deck-column,
    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="deck"] > #deckBuild,
    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="search"] .deckpub-sidebar {
        animation: deckpub-view-in 0.18s ease-out;
    }

    body.deckpub-tabs #deckBuild .floating-card-panel {
        visibility: visible;
        pointer-events: auto;
    }

    /* --- Search view ------------------------------------------------------ */
    body.deckpub-tabs .deckpub-deckbuild-shell .deckpub-sidebar {
        padding: 0.5rem 0.5rem 0;
        border-top: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.deckpub-tabs .deckpub-sheet-handle {
        display: none;
    }

    body.deckpub-tabs .deckpub-sidebar .search_div {
        max-height: 50vh;
    }

    /* --- Recently added strip (Search view only) --------------------------- */
    body.deckpub-tabs .deckpub-deckbuild-shell[data-mobile-view="search"] .deckpub-deck-strip {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        align-items: center;
        gap: 8px;
        height: var(--deck-strip-height);
        padding: 0 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        background: rgba(0, 0, 0, 0.45);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .deckpub-deck-strip::-webkit-scrollbar {
        display: none;
    }

    .deckpub-deck-strip-empty {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.6);
    }

    .deckpub-deck-strip-card {
        position: relative;
        flex: 0 0 auto;
        width: 33px;
        height: 46px;
        padding: 0;
        background: rgba(255, 255, 255, 0.08);
        border: 0;
        border-radius: 3px;
        cursor: pointer;
    }

    .deckpub-deck-strip-card .deckpub-card-thumb {
        width: 100%;
    }

    .deckpub-deck-strip-count {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 17px;
        padding: 0 4px;
        font-size: 11px;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
        color: #111827;
        background: #5eead4;
        border-radius: 999px;
    }

    .deckpub-deck-strip-card.is-new {
        animation: deckpub-strip-in 0.28s ease-out;
    }

    .deckpub-deck-strip-card.is-bumped .deckpub-deck-strip-count {
        animation: deckpub-bump 0.3s ease-out;
    }

    .deckpub-deck-strip-jump {
        flex: 0 0 auto;
        margin-left: auto;
        min-height: 36px;
        padding: 4px 10px;
        font-size: 13px;
        white-space: nowrap;
        color: #5eead4;
        background: none;
        border: 1px solid rgba(94, 234, 212, 0.4);
        border-radius: 999px;
        cursor: pointer;
    }

    /* --- Tab bar ------------------------------------------------------------ */
    body.deckpub-tabs .deckpub-tab-bar {
        grid-column: 1;
        grid-row: 4;
        display: flex;
        height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #0b1120;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .deckpub-tab-bar [role="tab"] {
        display: flex;
        flex: 1 1 0;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        background: none;
        border: 0;
        border-top: 3px solid transparent;
        cursor: pointer;
    }

    .deckpub-tab-bar [role="tab"].is-active {
        color: #5eead4;
        border-top-color: #5eead4;
        background: rgba(94, 234, 212, 0.08);
    }

    .deckpub-tab-count {
        display: inline-block;
        min-width: 24px;
        padding: 1px 7px;
        font-size: 12px;
        font-variant-numeric: tabular-nums;
        color: #111827;
        background: #5eead4;
        border-radius: 999px;
    }

    .deckpub-tab-count.is-bumped {
        animation: deckpub-bump 0.3s ease-out;
    }

    body.deckpub-present .deckpub-tab-bar,
    body.deckpub-present .deckpub-deck-strip {
        display: none !important;
    }

    /* Show Deck always presents the card images, whatever view was active. */
    body.deckpub-present.deckpub-tabs .deckpub-deckbuild-shell > .deckpub-deck-column,
    body.deckpub-present.deckpub-tabs .deckpub-deckbuild-shell > #deckBuild {
        visibility: visible;
        pointer-events: auto;
    }

}

@keyframes deckpub-view-in {
    from {
        opacity: 0;
    }
}

@keyframes deckpub-strip-in {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
}

@keyframes deckpub-bump {
    40% {
        transform: scale(1.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .deckpub-toast,
    .deckpub-deck-strip-card.is-new,
    .deckpub-deck-strip-card.is-bumped .deckpub-deck-strip-count,
    .deckpub-tab-count.is-bumped,
    body.deckpub-tabs .deckpub-deckbuild-shell > .deckpub-deck-column,
    body.deckpub-tabs .deckpub-deckbuild-shell .deckpub-sidebar {
        animation: none !important;
    }
}

/* =========================================================================
   Main | Sideboard toggle (core/zone-toggle.js)

   A segmented control: the lit half is what the deck area is showing and
   where cards added from search go. There is no sideboard popout.
   ========================================================================= */
.deckpub-zone-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.deckpub-zone-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 4px 14px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.deckpub-zone-toggle button + button {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.deckpub-zone-toggle button.hidden {
    display: none;
}

.deckpub-zone-toggle button[aria-pressed="true"] {
    color: #111827;
    background: #5eead4;
}

/* The second half (sideboard / 61st cards) lights amber, matching the frame
   the deck area gets while it shows that zone. */
.deckpub-zone-toggle button + button[aria-pressed="true"] {
    background: #fcd34d;
}

.deckpub-zone-count {
    min-width: 22px;
    padding: 0 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: inherit;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}

.deckpub-zone-toggle button[aria-pressed="true"] .deckpub-zone-count {
    background: rgba(0, 0, 0, 0.15);
}

/* While the deck area shows the other zone (sideboard / 61st cards), say so:
   amber frame, and a hint in place of the cards while that zone is empty.
   zone-toggle.js words the hint and sets data-edit-zone. */
.deckpub-deckbuild-shell[data-edit-zone="alt"] #deckBuilder,
.deckpub-deckbuild-shell[data-edit-zone="alt"] .deckpub-deck-list {
    border-color: #fcd34d;
    box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.5);
}

.deckpub-deckbuild-shell[data-edit-zone="alt"] #deckBuilder:empty::before {
    content: attr(data-empty-hint);
    width: 100%;
    padding: 2rem 1rem;
    font-size: 14px;
    text-align: center;
    color: rgba(252, 211, 77, 0.85);
}

.deckpub-deckbuild-shell[data-edit-zone="alt"] .deckpub-deck-list-section--zone .deckpub-deck-list-heading::after {
    content: ' · adding here';
    text-transform: none;
    letter-spacing: 0;
}

/* Show Deck hides the deck controls, but these two double as the card
   counts, so they stay on as plain read-only labels. */
body.deckpub-present #sideboardControls .deckpub-zone-toggle {
    border: 0;
    pointer-events: none;
}

body.deckpub-present #sideboardControls .deckpub-zone-toggle button:not(.hidden) {
    display: inline-flex !important;
    color: #fff;
    background: none;
    border: 0;
}

/* Tabs layout: the Search tab says so while adds are going to the other zone. */
.deckpub-deckbuild-shell[data-edit-zone="alt"] .deckpub-tab-bar [data-view="search"]::after {
    content: attr(data-target-label);
    font-size: 12px;
    color: #fcd34d;
}

/* SWCCG hides every deck control while presenting; its toggle carries no
   count worth keeping (Card Total is a separate label). */
body.deckpub-present #outsideDecks .deckpub-zone-toggle {
    display: none;
}

/* Swap one copy between the main deck and the sideboard / 61st cards. In the
   image grid the button sits on the top copy of a stack: shown on hover with
   a mouse, always on touch screens where there is no hover. */
.deck-swap-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    color: #111827;
    background: #fcd34d;
    border: 1px solid rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.deckCard:hover > .deck-swap-btn,
.deck-swap-btn:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .deck-swap-btn {
        opacity: 0.9;
    }
}

body.deckpub-present .deck-swap-btn,
.floating-card-panel .deck-swap-btn {
    display: none;
}

.deckpub-deck-list-swap {
    color: #fcd34d;
}

/* Narrow screens: the deck controls are one sideways-scrolling row, so the
   zone toggle goes first where it is always in reach. */
@media (max-width: 900px) {
    body.deckpub-deckbuild .deckpub-zone-toggle {
        order: -1;
    }
}
