


.decks {
  --decks-inline: max(var(--page-gutter), calc((100% - var(--page-max)) / 2));
  min-height: calc(100vh - var(--shell-h) - var(--footer-h));
  min-height: calc(100dvh - var(--shell-h) - var(--footer-h));
  box-sizing: border-box;
  padding: var(--page-top) var(--decks-inline) var(--step-8);
  background: var(--surface-ground);
  color: var(--ink-1);
}
.decks > .notice.calm:empty { display: none; }
.decks-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--step-3) var(--step-5); margin-bottom: var(--step-6); }
.decks-title:focus { outline: none; }
.decks-toolbar { display: flex; flex-wrap: wrap; gap: var(--step-3); }

.decks-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-3) var(--step-5); margin-bottom: var(--step-6); }
.decks-domains { display: flex; gap: var(--step-2); }
.decks-domain {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-1);
  cursor: pointer;
}
.decks-domain::after { content: ""; position: absolute; inset: -2px; }
.decks-domain .ur-dom-icon { opacity: 0.45; }
.decks-domain[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink-1); }
.decks-domain[aria-pressed="true"] .ur-dom-icon { opacity: 1; }
@media (hover: hover) { .decks-domain:hover .ur-dom-icon { opacity: 0.8; } }
.decks-domain:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.decks-legend-wrap { position: relative; }
.decks-legend-toggle {
  min-height: var(--touch);
  padding: 0 var(--step-3);
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-2);
  color: var(--ink-1);
  font: inherit;
  font-size: var(--type-body);
  cursor: pointer;
}
.decks-legend-toggle[aria-expanded="true"] { border-color: var(--ink-1); }
.decks-legend-panel {
  position: absolute;
  z-index: 4;
  top: calc(100% + var(--step-2));
  left: 0;
  display: grid;
  gap: var(--step-2);
  width: 320px;
  max-width: calc(100vw - 2 * var(--step-4));
  padding: var(--step-3);
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
}
.decks-legend-list { display: grid; gap: var(--step-1); max-height: 320px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.decks-legend-item label { display: flex; align-items: center; gap: var(--step-3); min-height: 36px; padding: 0 var(--step-2); border-radius: var(--round-1); cursor: pointer; }
@media (hover: hover) { .decks-legend-item label:hover { background: var(--surface-2); } }
.decks-legend-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decks-legend-none, .decks-filter-none { margin: 0; color: var(--ink-2); font-size: var(--type-body); }
.decks-filter-count { color: var(--ink-3); font-size: var(--type-body); font-variant-numeric: tabular-nums; }

.decks-filter-row { display: none; }
:root[data-compact] .decks-filters { display: none; }

:root[data-compact] .decks-filters.in-sheet { display: flex; }
.decks-filters.in-sheet .decks-legend-panel { position: static; width: auto; margin-top: var(--step-2); }
.decks-filter-row-search { display: flex; }
.decks-filter-row-search .lobby-choose-search { flex: 1 1 auto; }
:root[data-compact] .decks-filter-row { display: grid; gap: var(--step-2); margin-bottom: var(--step-5); }
.decks-filter-row-top { display: flex; align-items: center; gap: var(--step-3); }
.decks-filter-row-top .decks-filter-count { flex: 1; }
.decks-chips { display: flex; flex-wrap: wrap; gap: var(--step-2); }
.decks-chips:empty { display: none; }
.decks-chip {
  display: inline-flex; align-items: center; gap: var(--step-2); min-height: var(--touch); padding: 0 var(--step-3);
  border: 1px solid var(--line-2); border-radius: var(--round-2); background: var(--surface-2); color: var(--ink-1);
  font: inherit; font-size: var(--type-body);
}
.decks-chip:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.decks-chip-x { color: var(--ink-3); font-size: var(--type-read); }

.decks-sheet-domains { display: grid; grid-template-columns: repeat(6, minmax(44px, 1fr)); gap: var(--step-2); margin-bottom: var(--step-4); }
.decks-sheet-domain {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 44px; min-height: var(--touch); padding: var(--step-2) 0;
  border: 1px solid var(--line-1); border-radius: var(--round-2); background: transparent; color: var(--ink-2); font: inherit;
}
.decks-sheet-domain .ur-dom-icon { opacity: 0.55; }
.decks-sheet-domain[aria-pressed="true"] { border-color: var(--ink-1); color: var(--ink-1); box-shadow: 0 0 0 1px var(--ink-1); }
.decks-sheet-domain[aria-pressed="true"] .ur-dom-icon { opacity: 1; }
.decks-sheet-domain:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.decks-sheet-domain-name { font-size: 12px; line-height: 1.1; }
.decks-sheet-legends { max-height: none; overflow: visible; margin-top: var(--step-3); }
.decks-sheet-legends .decks-legend-item label { min-height: var(--touch); }
.decks-sheet-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: var(--step-3); padding-top: var(--step-3); background: var(--surface-1); }
.decks-sheet-foot .decks-show { flex: 1; }
.decks-section { margin-bottom: var(--step-7); }
.decks-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--step-1) var(--step-3); margin-bottom: var(--step-3); }
.decks-sechead .ur-section-head:focus { outline: none; }
.decks-count { font-size: var(--type-body); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.decks-hint { font-size: var(--type-body); color: var(--ink-3); }

.decks-list > .ur-deckrow { padding: var(--step-2) var(--step-4); }
.decks-list > .ur-deckrow:has(> .decks-row-actions) { padding-right: var(--step-2); }
.decks-starters .ur-deckrow-status { min-width: 0; }

.decks-set { margin-bottom: var(--step-5); }
.decks-set-top { display: flex; align-items: baseline; gap: var(--step-3); margin-bottom: var(--step-2); }
.decks-set-head { margin: 0; font: 500 var(--type-read) / 1.2 var(--font-display); letter-spacing: var(--track-display); text-transform: none; color: var(--ink-2); }

.decks-starters .ur-deck-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }

.ur-deckrow-note { line-height: 1.35; white-space: normal; }
.ur-deckrow-note.ur-pill-neutral { color: var(--ink-2); }
.decks-formats { display: inline-flex; flex: none; gap: var(--step-2); min-width: 8.5rem; justify-content: flex-end; }
.decks-format { font-size: var(--type-note); letter-spacing: var(--track-caps); text-transform: uppercase; }
.decks-format.is-ok { color: var(--ink-1); }

.decks-format.is-off { color: var(--ink-3); text-decoration: line-through; }
.decks-list .ur-deckrow-status { min-width: 0; font-size: var(--type-body); }


.ur-deckrow { --decks-act: var(--touch); }
.ur-deckrow > .decks-row-actions { position: relative; z-index: 1; flex: none; margin-left: auto; align-self: center; display: flex; align-items: center; }
.decks-menu-wrap { position: relative; }
.ur-deckrow:has(.decks-menu-btn[aria-expanded="true"]) { z-index: 3; }

@media (min-width: 1100px) {
  .decks-starters { display: block; columns: 2; column-gap: var(--step-3); }
  .decks-starters > .ur-row { break-inside: avoid; margin-bottom: var(--step-1); }
}
.decks-act, .decks-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--decks-act);
  height: var(--decks-act);
  border: 0;
  border-radius: var(--round-2);
  background: none;
  color: var(--ink-2);
  font: 700 var(--type-head) / 1 inherit;
  cursor: pointer;
}
.decks-act:focus-visible, .decks-menu-btn:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
@media (hover: hover) { .decks-act:hover, .decks-menu-btn:hover { background: var(--surface-2); color: var(--ink-1); } }
.decks-act[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }
.decks-menu {
  position: absolute;
  z-index: var(--z-anchored);
  
  --win-ox: 100%;
  --win-oy: 0;
  top: calc(100% + 2px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: var(--step-1) 0;
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
  box-shadow: var(--win-shadow);
}
.decks-menu-item {
  min-height: var(--touch);
  padding: 0 var(--step-4);
  border: 0;
  background: none;
  color: var(--ink-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.decks-menu-item:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
@media (hover: hover) { .decks-menu-item:hover { background: var(--surface-2); } }
.decks-menu-item[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }

.decks-menu-scrim { display: none; }
@media (max-width: 600px) {
  .decks .decks-menu-scrim:not([hidden]) { display: block; position: fixed; inset: 0 0 calc(var(--rail-h) + env(safe-area-inset-bottom, 0px)); z-index: calc(var(--z-sheet) - 1); }
  .decks .decks-menu {
    position: fixed; top: auto; left: 0; right: 0; bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px));
    min-width: 0; padding: var(--step-2) var(--page-gutter) var(--step-3);
    border-width: 1px 0 0; border-radius: var(--round-2) var(--round-2) 0 0;
    z-index: var(--z-sheet);
  }
  .decks .decks-menu-item { min-height: var(--touch); padding: 0 var(--step-2); font-size: var(--type-read); }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .decks .decks-menu { animation: none; }
}
:root[data-motion="reduce"] .decks .decks-menu { animation: none; }
.decks-trouble { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-3) var(--step-4); }
.decks-trouble .ur-line { flex: 1 1 18rem; }
.decks-empty { justify-content: space-between; }
.decks-empty-text { display: grid; gap: var(--step-1); }
.decks-field-label { font-size: var(--type-label); color: var(--ink-2); }
.decks-field {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--touch);
  padding: 0 var(--step-3);
  border: 1px solid var(--line-2);
  border-radius: var(--round-1);
  background: var(--surface-1);
  color: var(--ink-1);
  font: var(--type-read) / 1.3 var(--mono);
}
.decks-field[aria-invalid="true"] { border-color: var(--bad); }
.decks-decoded { display: grid; gap: var(--step-2); justify-items: start; }
.decks-counts { margin: 0; font-size: var(--type-body); color: var(--ink-2); }
.decks-plate { width: 150px; }
.decks-plate-none { margin: 0; color: var(--ink-3); }
.decks-dialog-actions { display: flex; flex-wrap: wrap; gap: var(--step-3); }

.decks-starter-actions { position: sticky; bottom: 0; padding-block: var(--step-3); background: var(--surface-1); }
.decks-starter-why { margin: 0; color: var(--ink-2); font-size: var(--type-note); line-height: 1.4; }
.decks-piles { display: grid; gap: var(--step-3); }
.decks-pile-head { margin: 0 0 var(--step-1); font-size: var(--type-label); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.decks-lines { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.decks-line { display: flex; align-items: center; gap: var(--step-2); min-width: 0; }
.decks-line-count { min-width: 2ch; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.decks-line-name { font-family: var(--mono); color: var(--ink-3); }
.decks-line > .card { flex: 1; min-width: 0; }
.decks-tabs { display: flex; gap: var(--step-2); }
.decks-tab {
  min-height: var(--touch);
  padding: 0 var(--step-4);
  border: 1px solid var(--line-1);
  border-radius: var(--round-2);
  background: none;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
}
.decks-tab.on { border-color: var(--line-2); background: var(--line-2); color: var(--ink-1); box-shadow: inset 0 -2px 0 var(--ink-1); }
@media (max-width: 899px) {
  .decks-formats { display: none; }
}
@media (max-width: 720px) {
  .decks { --decks-inline: var(--page-gutter); }
  
  .decks-list > .ur-deckrow:has(> .decks-row-actions) { padding-right: var(--step-4); padding-bottom: calc(var(--decks-act) + var(--step-2)); }
  :is(.decks-list, .lobby-choose-list) .ur-deckrow-main { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  :is(.decks-list, .lobby-choose-list) .ur-deckrow-main > .ur-deckrow-status { grid-column: 2; min-height: 44px; display: flex; align-items: center; justify-self: start; }
  .decks-list > .ur-deckrow > .decks-row-actions { position: absolute; bottom: var(--step-1); right: var(--step-2); }
  
  .decks-list > .ur-deckrow:has(> .decks-row-actions) .ur-deckrow-main > .ur-deckrow-status { margin-bottom: calc(-1 * (var(--decks-act) + var(--step-1))); }
  
  .lobby-choose-list > .ur-deckrow:has(> .decks-row-actions) { padding-right: var(--step-2); }
  .lobby-choose-list > .ur-deckrow > .decks-row-actions { align-self: center; margin-left: auto; }
  .lobby-choose-list .ur-deckrow-text > :not(.ur-deckrow-name, .ur-deckrow-note) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :is(.decks-list, .lobby-choose-list) .ur-deckrow-meta, :is(.decks-list, .lobby-choose-list) .ur-deckrow-note { padding-right: 0; }
}


.decks-tabs { display: flex; gap: var(--step-2); margin-bottom: var(--step-3); }

:root[data-input="touch"] .decks-domain { width: var(--touch); height: var(--touch); }
