/*! Card Battle Lab. Copyright (c) 2026 Dave Skilton. All rights reserved. See /LICENSE. https://cardbattlelab.com/ */
#setupModal {
  z-index: 11900;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
#setupModal.open {
  display: flex;
}
body:where(.st-setup-open):is(#st.st, *) #pregameModal,
body:where(.st-setup-open):is(#st.st, *) #cardPickerModal:not(.picker-select),
body:where(.st-menu-active):is(#st.st, *) #pregameModal,
body:where(.st-menu-active):is(#st.st, *) #cardPickerModal:not(.picker-select) {
  display: none !important;
}
#setupBox {
  width: min(620px, calc(94vw / var(--ui-s, 1)));
  max-height: min(calc(90vh / var(--ui-s, 1)), calc(var(--gcg-viewport-height, calc(100dvh / var(--ui-s, 1))) - 16px));
  display: flex;
  flex-direction: column;
  color: var(--c-text);
}
#setupBox .gs-head {
  padding: 12px 20px 9px;
  flex-shrink: 0;
}
#setupBox .gs-head h3 {
  margin: 0;
  flex: 1;
}
#setupBox .gs-presence,
.rlt-dialog .gs-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 12px;
  color: var(--c-cloud);
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: calc(11px * var(--fs-mono, 1));
  line-height: 1;
}
#setupBox .gs-presence[hidden],
.rlt-dialog .gs-presence[hidden] {
  display: none;
}
#setupBox .gs-presence-ico,
#setupBox .gs-presence-ico .gcg-tbi,
.rlt-dialog .gs-presence-ico,
.rlt-dialog .gs-presence-ico .gcg-tbi {
  display: block;
  width: 16px;
  height: 16px;
}
#setupBox .gs-head button.x {
  font-size: calc(10px * var(--fs-body, 1));
  font-weight: 800;
  letter-spacing: .08em;
}
#setupBody {
  overflow-y: auto;
  padding: var(--msheet-pad);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#setupModal {
  --setup-tips-h: 64px;
  --setup-tips-gap: 12px;
  flex-direction: column;
  gap: var(--setup-tips-gap);
}
#setupModal #setupBox {
  max-height: min(calc(calc(90vh / var(--ui-s, 1)) - var(--setup-tips-h) - var(--setup-tips-gap)), calc(var(--gcg-viewport-height, calc(100dvh / var(--ui-s, 1))) - 16px - var(--setup-tips-h) - var(--setup-tips-gap)));
}
#setupTips {
  flex: none;
  width: min(620px, calc(94vw / var(--ui-s, 1)));
  height: var(--setup-tips-h);
}
@media (max-width: 600px) {
  #setupModal {
    --setup-tips-h: 0px;
    --setup-tips-gap: 0px;
  }
  #setupTips {
    display: none;
  }
  #setupModal #setupBox {
    max-height: calc(var(--gcg-viewport-height, calc(100dvh / var(--ui-s, 1))) - 16px);
  }
}
#setupBody > .controls {
  display: contents;
}
#setupBody > :not(.controls),
#setupBody > .controls > * {
  zoom: var(--match-fit, 1);
}
#setupBody.match-fit > :not(.controls),
#setupBody.match-fit > .controls > * {
  width: calc(100% * var(--match-fit, 1));
  box-sizing: border-box;
  align-self: center;
  margin-inline: auto;
}
#gsModal {
  z-index: var(--z-dialog);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
#gsModal.open {
  display: flex;
}
#gsBox {
  width: min(1120px, calc(96vw / var(--ui-s, 1)));
  height: calc(86vh / var(--ui-s, 1));
  display: flex;
  flex-direction: column;
  color: var(--c-text);
}
#gsBox .gs-head h3 {
  margin: 0;
  flex: 1;
}
#gsBox .gs-head button.x {
  font-size: calc(22px * var(--fs-body, 1));
  line-height: 1;
}
.gs-saveform {
  display: none;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel-bg);
}
.gs-saveform.open {
  display: flex;
}
.gs-saveform input.nm {
  flex: 1;
  min-width: 150px;
}
.gs-detail select {
  width: 100%;
}
.gs-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.gs-grid {
  flex: 1.7;
  overflow-y: auto;
  padding: 8px 14px 18px;
}
.gs-group-h {
  margin: 14px 2px 8px;
}
.gs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gs-tile {
  position: relative;
  border: 1px solid var(--c-border-subtle);
  border-radius: 8px;
  background: var(--panel-bg);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .1s;
}
.gs-tile:hover {
  border-color: var(--c-border-strong);
}
.gs-tile.sel {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent) inset;
}
.gs-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: calc(11px * var(--fs-body, 1));
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .02em;
  color: #fff;
  background: rgba(20, 24, 32, .82);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  pointer-events: none;
}
.gs-badge.run {
  background: rgba(20, 24, 32, .82);
  border: 1px solid var(--c-accent);
}
.gs-badge.done {
  background: var(--c-good, #2f9e57);
}
.gs-cover {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--c-app-bg);
  display: block;
}
.gs-cover.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-faint);
  font-size: calc(26px * var(--fs-body, 1));
}
.gs-tile-nm {
  padding: 6px 8px;
  font-size: calc(12px * var(--fs-body, 1));
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-detail {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--c-border);
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gs-detail .empty {
  color: var(--c-text-muted);
  font-size: calc(13px * var(--fs-body, 1));
  margin-top: 30px;
  text-align: center;
}
.gs-detail .cover {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 6px;
  background: var(--c-app-bg);
  border: 1px solid var(--c-border);
}
.gs-detail .cover.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-faint);
  font-size: calc(38px * var(--fs-body, 1));
}
.gs-detail h4 {
  margin: 0;
  font-size: calc(16px * var(--fs-body, 1));
}
.gs-detail .badge {
  align-self: flex-start;
}
.gs-detail .sub {
  font-size: calc(11px * var(--fs-body, 1));
  color: var(--c-text-muted);
}
.gs-detail .fld-l,
.challenge-score-head {
  font-size: calc(10px * var(--fs-body, 1));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-text-muted);
  margin-bottom: 3px;
}
.gs-detail textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
}
.gs-detail input.nm {
  width: 100%;
  font-size: calc(15px * var(--fs-body, 1));
  font-weight: 600;
}
.gs-cardlist {
  font-size: calc(12px * var(--fs-body, 1));
  line-height: 1.55;
  color: var(--c-text-dim);
}
.gs-cardlist .pl {
  color: var(--c-text-muted);
  font-weight: 700;
}
.gs-detail .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}
@media (max-width: 720px) {
  .gs-body {
    flex-direction: column;
  }
  .gs-detail {
    width: auto;
    max-height: 46%;
    border-left: none;
    border-top: 1px solid var(--c-border);
  }
}
.gs-badge.empty {
  background: transparent;
  border: 1px solid var(--c-border-strong);
  color: var(--c-text-muted);
  box-shadow: none;
  min-width: 1.4em;
  text-align: center;
}
#gameModesScreen {
  z-index: var(--z-dialog);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
#gameModesScreen.open {
  display: flex;
}
#gameModesScreen.gcg-scrim {
  background: transparent;
}
body:where(.st-modes-open):is(#st.st, *) #playScreen {
  visibility: hidden;
  opacity: 0;
}
body:where(.st-modes-open):is(#st.st, *) #setupModal {
  visibility: hidden;
}
body:where(.st-modes-open):is(#st.st, *) > :is(#fxLayer, #candRetLayer, #fx-trace-svg, #atk-arrow-svg, #eff-line-svg, #pb-aim-svg, .fx-ret, .fx-ret-label, .fx-area-scan, .lab-target-area) {
  visibility: hidden;
}
body:where(.st-dm-active):is(#st.st, *) #gameModesScreen.open {
  display: none;
  opacity: 0;
  transition-duration: var(--t-fade-fast);
}
#gmBox {
  width: min(860px, calc(96vw / var(--ui-s, 1)));
  height: calc(86vh / var(--ui-s, 1));
  display: flex;
  flex-direction: column;
  color: var(--c-text);
}
#gmBox.gm-solo {
  width: min(520px, calc(96vw / var(--ui-s, 1)));
  height: auto;
  max-height: calc(86vh / var(--ui-s, 1));
}
#gmBox.gm-solo #gmGrid {
  display: none;
}
#gmBox.gm-solo .gs-detail {
  max-height: none;
  border: 0;
}
#gmBox .gs-head h3 {
  margin: 0;
  flex: 1;
}
#gmBox .gs-head button.x {
  font-size: calc(22px * var(--fs-body, 1));
  line-height: 1;
}
.gm-empty-band {
  padding: 14px 12px;
  margin: 0 2px 6px;
  border: 1px dashed var(--c-border);
  border-radius: 8px;
  color: var(--c-text-faint);
  font-size: calc(12px * var(--fs-body, 1));
}
