/* Deck editor layout: full-width banner under the site header, icon toolbar, text-only tab bar.
   Loaded after decks.css by every deck sheet (editor, player deck, precon, group deck, Packages).
   Colours come from the theme variables, including the violet accent and the brand gradient. */

/* The banner starts at the lower edge of the fixed header or the current-table strip. */
.deck-page.deck-workspace[data-no-breadcrumb]{padding-top:var(--site-header-height,3.5rem)}
.site-current-table:not([hidden])~main.deck-workspace[data-no-breadcrumb]{padding-top:0!important}
.deck-workspace .deck-hero{width:100%;min-height:0;margin:0;border:0;border-radius:0;align-items:flex-end;background:radial-gradient(circle at 85% 15%,color-mix(in srgb,var(--mt-violet,var(--mt-violet)) 26%,transparent),transparent 45%),radial-gradient(circle at 15% 90%,color-mix(in srgb,var(--mt-primary) 18%,transparent),transparent 40%),linear-gradient(125deg,var(--mt-surface),var(--mt-bg))}
/* A thin brand line closes the banner. */
.deck-workspace .deck-hero::before{content:"";position:absolute;left:0;right:0;bottom:0;z-index:2;height:2px;background:var(--mt-gradient,linear-gradient(90deg,var(--mt-primary),var(--mt-violet)))}
.deck-workspace .deck-hero-art{inset:0;top:0;right:0;width:100%;height:100%;object-fit:cover;object-position:center 24%;opacity:1;transform:scale(1.04);filter:blur(1px) saturate(1.1)}
.deck-workspace .deck-hero::after{background:linear-gradient(0deg,var(--mt-bg) 0%,color-mix(in srgb,var(--mt-bg) 70%,transparent) 40%,color-mix(in srgb,var(--mt-bg) 35%,transparent) 100%),linear-gradient(90deg,color-mix(in srgb,var(--mt-bg) 85%,transparent) 0%,color-mix(in srgb,var(--mt-bg) 35%,transparent) 60%,color-mix(in srgb,var(--mt-violet,var(--mt-violet)) 12%,transparent) 100%)}
.deck-workspace .deck-hero-inner{
  position:relative;z-index:1;align-self:stretch;display:grid;
  grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr;
  align-items:end;gap:.65rem 1rem;min-height:16rem;padding-block:.65rem 1rem;
}
.deck-workspace .deck-hero-back{
  grid-column:1/-1;align-self:start;justify-self:start;
  display:grid;place-items:center;width:2.75rem;height:2.75rem;padding:0;
  background-color:var(--mt-bg-secondary);
}
.deck-workspace .deck-hero-content{width:100%;max-width:none;min-width:0;padding:0}
.deck-workspace .deck-hero-title{margin-bottom:.6rem}
.deck-workspace .deck-hero-title-icon{flex:none;width:clamp(1.5rem,3vw,2rem);height:auto;object-fit:contain}
.deck-workspace .deck-hero-content h1{font-size:clamp(1.7rem,2.8vw,2.25rem);line-height:1.2;letter-spacing:-.025em;font-weight:750;overflow-wrap:anywhere;margin:0;text-shadow:0 2px 18px rgb(var(--mt-shadow-channels) / .55)}
.deck-workspace .deck-hero-metrics{gap:.5rem}
.deck-workspace .deck-hero-metrics>*{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.deck-workspace .deck-hero-metrics .deck-hero-visibility{backdrop-filter:none;-webkit-backdrop-filter:none}
.deck-workspace .deck-hero-metrics .deck-hero-visibility button{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.deck-workspace .deck-suggestion-banner{max-width:640px;margin-top:.85rem}

/* Icon-only controls: icons added by the shared icon registry lose their text spacing and stay centred. */
.deck-workspace .deck-top-actions .deck-tool .site-action-icon,.deck-workspace .deck-cover-edit .site-action-icon,.deck-workspace .deck-hero-title-edit .site-action-icon{margin:0;vertical-align:middle;width:1.1rem;height:1.1rem;font-size:1.1rem;line-height:1}
.deck-workspace .deck-hero-metrics .site-action-icon{margin:0;width:.8rem;height:.8rem;font-size:.8rem;vertical-align:-.05em}
.deck-workspace .deck-hero-title-edit{display:grid;place-items:center;padding:0;line-height:1}
.deck-workspace .deck-cover-edit>i,.deck-workspace .deck-hero-title-edit>i,.deck-workspace .deck-top-actions .deck-tool>i{display:block;line-height:1}

/* The toolbar sits inside the banner. Each icon button keeps its accessible name and tooltip. */
.deck-workspace .deck-top-actions{flex-direction:column;align-items:stretch;gap:.65rem;min-width:0;margin:0}
/* Resource sheets may place their labelled actions opposite Back, above the title. */
.deck-workspace .deck-hero-actions-top .deck-hero-inner{grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr}
.deck-workspace .deck-hero-actions-top .deck-hero-back{grid-column:1;grid-row:1}
.deck-workspace .deck-hero-actions-top .deck-top-actions{grid-column:2;grid-row:1;align-self:start;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.deck-workspace .deck-hero-actions-top .deck-hero-title{grid-column:1/-1;grid-row:2}
.deck-workspace .deck-hero-actions-top .deck-hero-content{grid-column:1/-1;grid-row:3}
.deck-workspace .deck-hero-price{display:grid;justify-items:end;gap:.15rem;color:var(--mt-text-secondary);font-size:.8rem;line-height:1.25;text-shadow:0 2px 8px var(--mt-bg)}
.deck-workspace .deck-hero-price strong{color:var(--mt-text);font-size:clamp(1.6rem,2.55vw,2.25rem);font-weight:800;font-variant-numeric:tabular-nums}
.deck-workspace .deck-card-image.is-foil:has(> img)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(130deg,
    color-mix(in srgb, var(--mt-violet) 28%, transparent) 5%, transparent 26%,
    color-mix(in srgb, var(--mt-primary) 34%, transparent) 38%,
    color-mix(in srgb, var(--mt-on-action) 40%, transparent) 48%,
    color-mix(in srgb, var(--mt-warning) 22%, transparent) 55%, transparent 68%,
    color-mix(in srgb, var(--mt-violet) 34%, transparent) 91%);
  background-size: 145% 145%;
  background-position: 35% 45%;
  mix-blend-mode: screen;
  transition: background-position .45s ease;
}
.deck-workspace .deck-card-entry:is(:hover,:focus-within) .deck-card-image.is-foil::before {
  background-position: 75% 60%;
}
@media (prefers-reduced-motion: reduce) {
  .deck-workspace .deck-card-image.is-foil::before { transition: none; }
}
.deck-workspace .deck-transfer-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.4rem;overflow:visible;padding:0}
.deck-workspace .deck-top-actions .deck-tool{position:relative;display:inline-grid;place-items:center;width:2.6rem;height:2.6rem;padding:0;border:1px solid var(--mt-border);border-radius:.75rem;background:var(--mt-bg-secondary);color:var(--mt-text-secondary);font-size:1.1rem;line-height:1;transition:border-color .15s ease,color .15s ease,background .15s ease,transform .15s ease}
.deck-workspace .deck-top-actions .deck-cover-edit{inset:auto;z-index:auto;width:2.25rem;height:2.25rem;font-size:1rem}
/* Optional labelled action, shared by deck-sheet extensions and other resource sheets. */
.deck-workspace .deck-top-actions .deck-tool.deck-tool-label{width:auto;min-width:2.6rem;height:auto;min-height:2.6rem;padding:.65rem .85rem;font-size:.85rem;line-height:1.25;white-space:normal}
.deck-workspace .deck-top-actions .deck-cover-edit .site-action-icon{width:1rem;height:1rem;font-size:1rem}
/* Secondary icon buttons: light edge on hover, as the site's secondary buttons (palette.css), never the accent colour. */
.deck-workspace .deck-top-actions .deck-tool:hover,.deck-workspace .deck-top-actions .deck-tool:focus-visible{border-color:rgb(var(--mt-edge-tint-channels) / .32);color:var(--mt-text);background:var(--mt-surface-hover);transform:translateY(-1px)}
.deck-workspace .deck-top-actions .deck-tool:disabled{opacity:.45;transform:none}
/* Play stands out with the brand gradient; personal look (sleeves, playmat) and Considering use the violet accent. */
.deck-workspace .deck-top-actions .deck-tool-play{display:inline-flex;justify-content:center;gap:.45rem;width:auto;padding:0 .9rem;border:0;background-color:var(--mt-primary);color:var(--mt-on-accent,var(--mt-bg));font-size:.9rem;font-weight:700}
.deck-workspace .deck-top-actions .deck-tool-play:hover,.deck-workspace .deck-top-actions .deck-tool-play:focus-visible{background-color:var(--mt-primary);color:var(--mt-on-accent,var(--mt-bg))}
.deck-workspace .deck-appearance-buttons .deck-tool:hover,.deck-workspace .deck-appearance-buttons .deck-tool:focus-visible,.deck-workspace .deck-top-actions .deck-considering-toggle:hover,.deck-workspace .deck-top-actions .deck-considering-toggle:focus-visible{border-color:var(--mt-violet,var(--mt-violet));color:var(--mt-violet,var(--mt-violet))}
.deck-workspace .deck-top-actions .deck-delete-button:hover,.deck-workspace .deck-top-actions .deck-delete-button:focus-visible{border-color:var(--mt-danger);color:var(--mt-danger)}
.deck-workspace .deck-appearance-buttons{display:inline-flex;gap:.4rem}
.deck-workspace .deck-social-actions:not([hidden]){display:inline-flex;gap:.4rem}
.deck-workspace .deck-appearance-check{position:absolute;top:-.3rem;right:-.3rem;font-size:.75rem;color:var(--mt-success);background:var(--mt-bg);border-radius:50%}
.deck-workspace .deck-top-actions .deck-tool .deck-nav-count{position:absolute;top:-.45rem;right:-.45rem;min-width:1.15rem;padding:.08rem .3rem;border-radius:999px;background:var(--mt-violet,var(--mt-violet));color:var(--mt-on-accent,var(--mt-bg));font-size:.65rem;font-weight:700;line-height:1.2}
.deck-workspace .deck-tool-sep{width:1px;height:1.6rem;margin:0 .2rem;background:var(--mt-border)}
.deck-workspace #deck-undo-slot{display:inline-flex;gap:.4rem}.deck-workspace #deck-undo-slot>span{display:inline-flex}
.deck-workspace #deck-undo-slot form{display:inline-flex;margin:0}
.deck-workspace .deck-transfer-actions .site-tour-launch{height:2.6rem;border-radius:.75rem;border-color:var(--mt-border);color:var(--mt-text-secondary)}

.deck-workspace .deck-workspace-nav{align-items:stretch;margin:.65rem 0 1.25rem;padding:0;overflow:visible;gap:0 .25rem}
.deck-workspace .deck-workspace-nav .nav-link{padding-inline:clamp(.55rem,1vw,.9rem);white-space:normal;text-align:start;flex:0 1 auto}
.deck-workspace .deck-workspace-nav [aria-selected=true] .deck-nav-count:not(.deck-nav-suggestions){background:var(--mt-accent-soft);color:var(--mt-primary)}
.deck-workspace .deck-workspace-nav .deck-nav-suggestions{background:var(--mt-violet,var(--mt-violet));color:var(--mt-on-accent,var(--mt-bg))}
.deck-workspace .deck-workspace-nav .nav-link[hidden]{display:none}

/* Considering panel: two small round buttons float at the top right of each card (add with the gradient, remove in red). */
.deck-workspace .deck-considering-card{position:relative}
.deck-workspace .deck-considering-info{padding-right:3.6rem}
.deck-workspace .deck-considering-actions{position:absolute;top:.45rem;right:.45rem;display:flex;align-items:center;flex-wrap:nowrap;gap:.3rem}
.deck-workspace .deck-considering-btn{display:grid;place-items:center;padding:0;border:0;border-radius:50%;line-height:1;cursor:pointer;transition:transform .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease}
.deck-workspace .deck-considering-btn>i{display:block;line-height:1}
.deck-workspace .deck-considering-btn.is-add{width:1.75rem;height:1.75rem;font-size:.95rem;background:var(--mt-gradient,linear-gradient(135deg,var(--mt-primary),var(--mt-violet)));color:var(--mt-on-accent,var(--mt-bg));box-shadow:0 3px 10px color-mix(in srgb,var(--mt-violet,var(--mt-violet)) 30%,transparent)}
.deck-workspace .deck-considering-btn.is-add:hover,.deck-workspace .deck-considering-btn.is-add:focus-visible{background:var(--mt-gradient-hover,linear-gradient(135deg,var(--mt-primary-hover),var(--mt-violet-hover)));transform:scale(1.08)}
.deck-workspace .deck-considering-btn.is-remove{width:1.4rem;height:1.4rem;font-size:.62rem;background:color-mix(in srgb,var(--mt-danger) 16%,var(--mt-surface));color:var(--mt-danger);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mt-danger) 50%,transparent)}
.deck-workspace .deck-considering-btn.is-remove:hover,.deck-workspace .deck-considering-btn.is-remove:focus-visible{background:var(--mt-danger);color:var(--mt-on-status,var(--mt-bg));transform:scale(1.08)}
.deck-workspace .deck-considering-btn:focus-visible{outline:2px solid var(--mt-primary);outline-offset:2px}
.deck-workspace .deck-considering-btn:disabled{opacity:.5;transform:none}
@media(max-width:991.98px){
 .deck-workspace .deck-hero-inner{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr auto;min-height:0}
 .deck-workspace .deck-transfer-actions{justify-content:flex-start}
}
@media(max-width:650px){
 .deck-workspace .deck-hero::after{background:linear-gradient(0deg,var(--mt-bg) 0%,color-mix(in srgb,var(--mt-bg) 85%,transparent) 45%,color-mix(in srgb,var(--mt-bg) 55%,transparent) 100%)}
 .deck-workspace .deck-hero-art{object-position:center 18%}
 .deck-workspace .deck-transfer-actions{gap:.35rem}
 .deck-workspace .deck-top-actions .deck-tool{width:2.75rem;height:2.75rem;font-size:1rem;border-radius:.65rem}
 .deck-workspace .deck-top-actions .deck-tool-play{width:auto;padding-inline:.7rem;font-size:.85rem}
 .deck-workspace .deck-transfer-actions .site-tour-launch{height:2.75rem}
 .deck-workspace .deck-tool-sep{display:none}
}
@media(prefers-reduced-motion:reduce){.deck-workspace .deck-top-actions .deck-tool,.deck-workspace .deck-hero-back{transition:none}}
/* Stacked view: independent piles, with only each card's name strip exposed. */
.deck-zone-section.is-vertical{display:block;columns:var(--card-pile-width);column-gap:1rem}
.deck-zone-section.is-vertical>.deck-featured-groups{display:contents}
.deck-zone-section.is-vertical .deck-card-group{display:block;width:100%;min-width:0;max-width:none;margin:0 0 1rem;break-inside:avoid}
.deck-zone-section.is-vertical .deck-card-group[hidden]{display:none}
.deck-card-collection.is-grid.is-vertical{display:flex;flex-direction:column;gap:0}
.deck-card-collection.is-vertical>.deck-card-entry:not([hidden]){flex:none;aspect-ratio:var(--card-strip-ratio);overflow:visible}
.deck-card-collection.is-vertical>.deck-card-entry:not([hidden]):not(:has(~.deck-card-entry:not([hidden]))){aspect-ratio:var(--card-ratio)}
.deck-card-collection.is-vertical>.deck-card-entry.is-stack-open{aspect-ratio:var(--card-ratio)}
.deck-card-collection.is-vertical .deck-card-image{position:absolute;top:0;left:0}
.deck-card-collection.is-grid.is-vertical .deck-card-quantity input,.deck-card-collection.is-grid.is-vertical .deck-card-fixed-quantity{top:0;left:0;width:1.4rem;min-width:1.4rem;height:1.4rem;min-height:0;border-radius:.35rem;font-size:.75rem;transform:translateX(-20%)}
.deck-card-collection.is-vertical .deck-card-entry :is([data-deck-quantity-step],.deck-card-menu,.deck-card-tag-controls,.deck-role-badges){opacity:0;pointer-events:none}
.deck-card-collection.is-grid.is-vertical .deck-card-entry:not(.is-game-changer) .deck-card-image{box-shadow:none}
.deck-card-collection.is-vertical .deck-card-image{cursor:pointer}
.deck-card-collection.is-vertical .deck-card-entry:is(:hover,:focus-within,.is-stack-open) :is([data-deck-quantity-step],.deck-card-menu,.deck-card-tag-controls,.deck-role-badges){opacity:1;pointer-events:auto}
@media(hover:none){.deck-workspace .deck-card-collection.is-grid.is-vertical .deck-card-entry>.deck-card-menu{opacity:1;pointer-events:auto;top:0;right:0}.deck-card-collection.is-vertical .deck-card-menu-toggle{width:1.75rem;height:1.75rem}}
.deck-image-dialog{width:min(48rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;padding:1.25rem;border:1px solid var(--mt-border);border-radius:1rem;background:var(--mt-bg);color:var(--mt-text)}
.deck-image-dialog::backdrop{background:rgb(var(--mt-shadow-channels) / .7)}
.deck-image-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(8rem,1fr));gap:.75rem;margin-block:1rem}
.deck-image-choice{display:flex;flex-direction:column;align-items:center;gap:.5rem;font-size:.8rem}
.deck-image-choice img{width:100%;height:auto;max-width:10rem;border-radius:.5rem}
.deck-image-dialog>form{margin-block:1rem}


/* Piles (editor, deck sheets, Packages), driven by card-stacks.js. The open card takes its full size but keeps its place
   in the flow thanks to the negative margin; the cards after it and the piles under it slide down. Only transforms are
   animated, never the layout. */
:is(.deck-card-collection.is-vertical>.deck-card-entry,.deck-sheet-cards[data-view='vertical'] .deck-sheet-row,.package-deck-groups[data-display='vertical'] .package-card),
:is(.deck-zone-section.is-vertical .deck-card-group,.deck-sheet-cards[data-view='vertical'] .deck-sheet-group,.package-deck-groups[data-display='vertical'] .package-deck-group){transition:transform .28s cubic-bezier(.3,0,.2,1)}
:is(.deck-card-collection.is-vertical>.deck-card-entry,.deck-sheet-cards[data-view='vertical'] .deck-sheet-row,.package-deck-groups[data-display='vertical'] .package-card).is-stack-open{margin-bottom:calc(-1 * var(--card-stack-shift,0px))}
:is(.deck-card-collection.is-vertical>.deck-card-entry,.deck-sheet-cards[data-view='vertical'] .deck-sheet-row,.package-deck-groups[data-display='vertical'] .package-card).is-stack-open~:is(.deck-card-entry,.deck-sheet-row,.package-card),
[data-card-stack-shifted]{transform:translateY(var(--card-stack-shift,0px))}
/* card-stacks.js spreads the piles over every column that fits: a pile so marked starts a new column. */
[data-card-pile-break]{break-before:column}
/* Room under the last pile of the column while a card is open. */
[data-card-stack-open]{border-bottom:var(--card-stack-room,0px) solid transparent}
@media(prefers-reduced-motion:reduce){
 :is(.deck-card-collection.is-vertical>.deck-card-entry,.deck-sheet-cards[data-view='vertical'] .deck-sheet-row,.package-deck-groups[data-display='vertical'] .package-card),
 :is(.deck-zone-section.is-vertical .deck-card-group,.deck-sheet-cards[data-view='vertical'] .deck-sheet-group,.package-deck-groups[data-display='vertical'] .package-deck-group){transition:none}
}

/* Hover does not frame the artwork. Keep deliberate add/cut highlights. */
.deck-workspace .deck-card-entry:not(.is-recently-added):not(.is-cut-selected):hover .deck-card-image{outline:none}

/* Personal editor: two action rows on computers. Play sits under undo/redo and the Package entry under sleeves/playmat. */
.deck-workspace .deck-top-actions .deck-tool-group{display:inline-flex;gap:0}
.deck-workspace .deck-top-actions .deck-tool-group>.deck-tool:not(:first-child){margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}
.deck-workspace .deck-top-actions .deck-tool-group>.deck-tool:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}
.deck-workspace .deck-top-actions .deck-tool-group>.deck-tool:is(:hover,:focus-visible){z-index:1;transform:none}
.deck-workspace .deck-tool-rest{display:inline-flex;align-items:center;gap:.4rem}
.deck-workspace .deck-top-actions>.deck-cover-edit{position:absolute;top:.65rem;right:calc(var(--bs-gutter-x,1.5rem) * .5);z-index:2;display:inline-flex;align-items:center;gap:.3rem;width:auto;height:2.6rem;padding:0 .7rem;font-size:1.1rem}
.deck-workspace .deck-top-actions>.deck-cover-edit>.bi-pencil-fill{font-size:.72rem}
@media(min-width:768px){
 .deck-workspace .deck-editor-actions{display:grid;grid-template-columns:repeat(6,auto);justify-content:end;align-items:center;gap:.5rem .4rem}
 .deck-workspace .deck-editor-actions>#deck-undo-slot{grid-area:1/1}
 .deck-workspace .deck-editor-actions>.deck-tool-play{grid-area:2/1;width:100%}
 .deck-workspace .deck-editor-actions>.deck-tool-sep{grid-area:1/2}
 .deck-workspace .deck-editor-actions>.deck-appearance-buttons{grid-area:1/3}
 .deck-workspace .deck-editor-actions>.deck-appearance-buttons~.deck-tool-sep{grid-area:1/4}
 .deck-workspace .deck-editor-actions>[data-package-deck-picker]{grid-area:2/3/auto/-1;justify-self:start;white-space:nowrap}
 .deck-workspace .deck-editor-actions>.deck-tool-rest{grid-area:1/5}
 .deck-workspace .deck-editor-actions>.site-tour-launch{grid-area:1/6}
}
/* Card toolbar of the editor: Add first, the search and display fields, then the icon-only tools. */
#deck-card-tools .deck-search-toolbar{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"add fields tools"}
#deck-card-tools .deck-search-toolbar>.deck-add-anchor{grid-area:add}
#deck-card-tools .deck-search-toolbar>.deck-view-controls{grid-area:fields}
#deck-card-tools .deck-search-toolbar>.deck-card-tool-actions{grid-area:tools;justify-content:flex-end;align-items:center}
.deck-workspace .deck-toolbar-icon{position:relative;display:inline-grid;place-items:center;width:2.8rem;height:2.8rem;padding:0;font-size:1.05rem;line-height:1}
.deck-workspace .deck-card-tool-actions .btn.deck-toolbar-icon{padding:0;font-size:1.05rem}
.deck-workspace .deck-toolbar-icon>i{display:block;line-height:1}
.deck-workspace .deck-toolbar-icon .deck-nav-count{position:absolute;top:-.45rem;right:-.45rem;min-width:1.15rem;padding:.08rem .3rem;border-radius:999px;background:var(--mt-violet);color:var(--mt-on-accent,var(--mt-bg));font-size:.65rem;font-weight:700;line-height:1.2}
.deck-workspace .deck-toolbar-icon.deck-considering-toggle:is(:hover,:focus-visible){border-color:var(--mt-violet);color:var(--mt-violet)}
@media(max-width:1200px){
 #deck-card-tools .deck-search-toolbar{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"add tools" "fields fields"}
}
