.ysw-game,
.ysw-game * {
  box-sizing: border-box;
}

/* Ending credits: let the movie own the viewport and reveal controls on demand. */
.ysw-shell-ending-credits,
.ysw-shell-ending-credits:fullscreen,
.ysw-game:fullscreen .ysw-shell-ending-credits {
  background: #000;
  border: 0;
  border-radius: 0;
  height: 100svh;
  margin: 0;
  max-width: none;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
  position: fixed;
  inset: 0;
  width: 100svw;
  z-index: 2147483000;
}

.ysw-shell-ending-credits .ysw-topbar,
.ysw-shell-ending-credits .ysw-backdrop,
.ysw-shell-ending-credits .ysw-orientation-hint,
.ysw-shell-ending-credits .ysw-voice-caption {
  display: none;
}

.ysw-shell-ending-credits .ysw-end-roll {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
  width: 100svw;
}

.ysw-shell-ending-credits .ysw-end-roll-stage {
  border: 0;
  border-radius: 0;
  height: 100svh;
  min-height: 100svh;
  width: 100svw;
}

.ysw-shell-ending-credits .ysw-end-roll-video {
  object-fit: contain;
  pointer-events: none;
}

.ysw-shell-ending-credits .ysw-end-roll-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  left: auto;
  opacity: 0;
  pointer-events: none;
  right: 28px;
  top: 28px;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  width: auto;
  z-index: 6;
}

.ysw-shell-ending-credits .ysw-end-roll-stage.is-controls-visible .ysw-end-roll-actions,
.ysw-shell-ending-credits .ysw-end-roll-stage.is-ended .ysw-end-roll-actions,
.ysw-shell-ending-credits .ysw-end-roll-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ysw-shell-ending-credits .ysw-end-roll-actions .ysw-audio-controls {
  background: rgba(6, 12, 20, .78);
  border: 1px solid rgba(160, 209, 225, .28);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
  display: flex;
  gap: 10px;
  padding: 6px 8px;
}

.ysw-shell-ending-credits .ysw-end-roll-action-buttons {
  display: flex;
  gap: 10px;
}

.ysw-shell-ending-credits .ysw-end-roll-actions .ysw-secondary,
.ysw-shell-ending-credits .ysw-end-roll-actions .ysw-primary {
  border-radius: 7px;
  min-height: 38px;
  min-width: 0;
  padding: 8px 16px;
  white-space: nowrap;
  width: auto;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell-ending-credits .ysw-end-roll-actions {
    gap: 8px;
    right: 8px;
    top: 8px;
  }

  .ysw-shell-ending-credits .ysw-end-roll-actions .ysw-audio-controls {
    padding: 4px 5px;
  }

  .ysw-shell-ending-credits .ysw-end-roll-actions .ysw-audio-controls label {
    display: none;
  }

  .ysw-shell-ending-credits .ysw-end-roll-action-buttons {
    gap: 8px;
  }

  .ysw-shell-ending-credits .ysw-end-roll-actions .ysw-secondary,
  .ysw-shell-ending-credits .ysw-end-roll-actions .ysw-primary {
    font-size: 12px;
    min-height: 34px;
    padding: 7px 12px;
  }
}

/* Opening movie mode: keep the sequence intact and reveal controls on tap. */
.ysw-shell-opening,
.ysw-shell-opening:fullscreen,
.ysw-game:fullscreen .ysw-shell-opening {
  background: #000;
  border: 0;
  border-radius: 0;
  height: 100svh;
  margin: 0;
  max-width: none;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
  position: fixed;
  inset: 0;
  width: 100svw;
  z-index: 2147483000;
}

.ysw-shell-opening .ysw-topbar,
.ysw-shell-opening .ysw-backdrop,
.ysw-shell-opening .ysw-orientation-hint,
.ysw-shell-opening .ysw-voice-caption {
  display: none;
}

.ysw-shell-opening .ysw-opening {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
  width: 100svw;
}

.ysw-shell-opening .ysw-opening-stage {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  width: 100svw;
}

.ysw-shell-opening .ysw-opening-city {
  background: #000;
  border: 0;
  border-radius: 0;
  height: 100svh;
  min-height: 100svh;
  width: 100svw;
}

.ysw-shell-opening .ysw-opening-city::before,
.ysw-shell-opening .ysw-opening-images::after,
.ysw-shell-opening .ysw-opening-scan,
.ysw-shell-opening .ysw-opening-noise,
.ysw-shell-opening .ysw-opening-lines,
.ysw-shell-opening .ysw-opening-progress {
  display: none;
}

.ysw-shell-opening .ysw-opening-images {
  background: #000;
}

.ysw-shell-opening .ysw-opening-sequence-video,
.ysw-shell-opening .ysw-opening-video-fallback {
  background: #000;
  display: block;
  object-fit: contain;
}

.ysw-shell-opening .ysw-opening-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  left: auto;
  opacity: 0;
  pointer-events: none;
  right: 28px;
  top: 28px;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  width: auto;
  z-index: 8;
}

.ysw-shell-opening .ysw-opening-stage.is-controls-visible + .ysw-opening-actions,
.ysw-shell-opening .ysw-opening-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ysw-shell-opening .ysw-opening-actions .ysw-audio-controls {
  background: rgba(6, 12, 20, .78);
  border: 1px solid rgba(160, 209, 225, .28);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
  display: flex;
  gap: 10px;
  padding: 6px 8px;
}

.ysw-shell-opening .ysw-opening-action-buttons {
  display: flex;
  gap: 10px;
}

.ysw-shell-opening .ysw-opening-actions .ysw-secondary,
.ysw-shell-opening .ysw-opening-actions .ysw-primary {
  border-radius: 7px;
  min-height: 38px;
  min-width: 0;
  padding: 8px 16px;
  white-space: nowrap;
  width: auto;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell-opening .ysw-opening-actions {
    gap: 8px;
    right: 8px;
    top: 8px;
  }

  .ysw-shell-opening .ysw-opening-actions .ysw-audio-controls {
    padding: 4px 5px;
  }

  .ysw-shell-opening .ysw-opening-actions .ysw-audio-controls label {
    display: none;
  }

  .ysw-shell-opening .ysw-opening-action-buttons {
    gap: 8px;
  }

  .ysw-shell-opening .ysw-opening-actions .ysw-secondary,
  .ysw-shell-opening .ysw-opening-actions .ysw-primary {
    font-size: 12px;
    min-height: 34px;
    padding: 7px 12px;
  }
}

.ysw-game img.is-ysw-image-missing {
  opacity: 0;
}

/* v2 card-table battle and deck builder */
.ysw-voice-caption {
  background: rgba(6, 12, 20, .82);
  border: 1px solid rgba(216, 246, 87, .28);
  border-radius: 999px;
  box-shadow: 0 0 26px rgba(36, 210, 255, .12);
  color: #f3fbff;
  font-size: 14px;
  font-weight: 900;
  left: 50%;
  max-width: min(760px, calc(100% - 32px));
  padding: 9px 16px;
  position: fixed;
  top: 86px;
  transform: translateX(-50%);
  z-index: 20;
}

.ysw-leader-select {
  display: grid;
  gap: 16px;
}

.ysw-leader-brief,
.ysw-leader-actions {
  background: rgba(8, 16, 28, .78);
  border: 1px solid rgba(160, 209, 225, .2);
  border-radius: 8px;
  padding: 18px;
}

.ysw-leader-brief h3 {
  color: #fff;
  font-size: 30px;
  margin: 0 0 10px;
}

.ysw-leader-brief p {
  color: #cde2ea;
  margin: 0;
}

.ysw-leader-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ysw-leader-card {
  background: rgba(8, 16, 28, .9);
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  color: #eaf7ff;
  display: grid;
  gap: 8px;
  min-height: 330px;
  padding: 10px;
  text-align: left;
}

.ysw-leader-card.is-selected {
  border-color: rgba(216, 246, 87, .8);
  box-shadow: 0 0 0 2px rgba(216, 246, 87, .18), 0 0 28px rgba(216, 246, 87, .16);
}

.ysw-leader-card:disabled {
  filter: grayscale(.7);
  opacity: .48;
}

.ysw-leader-card.is-locked {
  background:
    linear-gradient(145deg, rgba(7, 13, 24, .94), rgba(15, 23, 36, .9)),
    repeating-linear-gradient(135deg, rgba(124, 151, 165, .12) 0 1px, transparent 1px 9px);
  color: rgba(232, 247, 255, .72);
  filter: none;
  opacity: .78;
}

.ysw-leader-card .ysw-card-visual {
  height: 150px;
  margin: 0;
}

.ysw-leader-card .ysw-leader-locked-visual {
  align-items: center;
  background:
    radial-gradient(circle at center, rgba(216, 246, 87, .12), transparent 46%),
    linear-gradient(135deg, rgba(80, 100, 112, .18), rgba(8, 14, 25, .88));
  border: 1px solid rgba(160, 209, 225, .16);
  display: flex;
  justify-content: center;
}

.ysw-leader-card .ysw-leader-locked-visual i {
  border: 1px solid rgba(216, 246, 87, .32);
  border-radius: 999px;
  color: rgba(216, 246, 87, .82);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 12px;
}

.ysw-leader-card small,
.ysw-leader-card em {
  color: #d8f657;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.ysw-leader-card strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
}

.ysw-leader-card p {
  color: #cde2ea;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.ysw-leader-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ysw-card-table {
  gap: 8px;
  height: clamp(590px, calc(100svh - 104px), 860px);
  padding: 8px 12px 10px;
}

.ysw-table-leaders {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ysw-table-leaders .ysw-leader {
  min-height: 106px;
  padding: 8px 10px;
}

.ysw-table-leaders .ysw-boss-leader {
  min-height: 106px;
  padding-left: 92px;
}

.ysw-table-leaders .ysw-leader-portrait {
  width: 82px;
}

.ysw-table-leaders .ysw-leader strong {
  font-size: 25px;
}

.ysw-table-main {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 290px);
  min-height: 0;
}

.ysw-table-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.ysw-card-table .ysw-enemy-board-wrap,
.ysw-card-table .ysw-board-wrap {
  background: linear-gradient(90deg, rgba(255, 92, 138, .1), rgba(36, 210, 255, .05));
  border: 1px solid rgba(255, 92, 138, .24);
  border-radius: 8px;
  flex: 0 0 auto;
  min-height: 118px;
  padding: 8px 10px;
}

.ysw-card-table .ysw-board-wrap {
  background: linear-gradient(90deg, rgba(36, 210, 255, .12), rgba(216, 246, 87, .06), rgba(255, 92, 138, .08));
  border-color: rgba(36, 210, 255, .28);
  flex: 1 1 auto;
  min-height: 205px;
  overflow: hidden;
}

.ysw-card-table .ysw-enemy-board-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ysw-card-table .ysw-enemy-board-head span,
.ysw-card-table .ysw-gears span {
  color: #d8f657;
  font-size: 12px;
  font-weight: 950;
}

.ysw-card-table .ysw-enemy-board-head small {
  color: #aee7ff;
  font-size: 12px;
  font-weight: 800;
}

.ysw-card-table .ysw-enemy-board,
.ysw-card-table .ysw-board {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  min-height: 0;
}

.ysw-card-table .ysw-enemy-board {
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  min-height: 74px;
}

.ysw-card-table .ysw-board > p,
.ysw-card-table .ysw-enemy-board > p {
  align-self: center;
  color: #b8d4de;
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.ysw-card-table .ysw-unit,
.ysw-card-table .ysw-hand-card {
  background: #07111d;
  border: 1px solid rgba(160, 209, 225, .25);
  border-radius: 8px;
  display: block;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
}

.ysw-card-table .ysw-unit {
  aspect-ratio: 7 / 9;
  min-height: 158px;
}

.ysw-card-table .ysw-unit .ysw-card-visual,
.ysw-card-table .ysw-hand-card .ysw-card-visual {
  height: 100%;
  inset: 0;
  margin: 0;
  position: absolute;
  width: 100%;
}

.ysw-card-table .ysw-unit .ysw-card-visual img,
.ysw-card-table .ysw-hand-card .ysw-card-visual img {
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  width: 100%;
}

.ysw-card-name,
.ysw-card-table .ysw-hand-card strong {
  background: linear-gradient(0deg, rgba(5, 10, 18, .96), rgba(5, 10, 18, .72));
  bottom: 0;
  color: #fff;
  display: block;
  font-size: 13px;
  font-weight: 950;
  left: 0;
  line-height: 1.2;
  min-height: 34px;
  padding: 8px 48px 8px 9px;
  position: absolute;
  right: 0;
  z-index: 2;
}

.ysw-state-badge {
  background: rgba(216, 246, 87, .94);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  color: #08131b;
  font-size: 11px;
  font-weight: 950;
  padding: 5px 7px;
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 3;
}

.ysw-stat-badge {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  bottom: 7px;
  color: #06111b;
  display: flex;
  flex-direction: column;
  font-size: 18px;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  line-height: .95;
  position: absolute;
  width: 42px;
  z-index: 4;
}

.ysw-stat-badge small {
  color: inherit;
  font-size: 8px;
  font-weight: 950;
}

.ysw-atk-badge {
  background: #ffcf5c;
  left: 7px;
}

.ysw-hp-badge {
  background: #24d2ff;
  right: 7px;
}

.ysw-card-table .ysw-enemy-unit {
  background: rgba(10, 15, 26, .92);
  border: 1px solid rgba(255, 92, 138, .3);
  border-radius: 8px;
  color: #eef7ff;
  min-height: 76px;
  overflow: hidden;
  padding: 8px 58px 8px 46px;
  position: relative;
  text-align: left;
}

.ysw-card-table .ysw-enemy-unit strong {
  color: #fff;
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.ysw-card-table .ysw-enemy-unit small,
.ysw-card-table .ysw-enemy-unit p {
  color: #c7d8df;
  font-size: 11px;
  margin: 0;
}

.ysw-card-table .ysw-enemy-unit-icon {
  align-items: center;
  background: rgba(255, 92, 138, .18);
  border: 1px solid rgba(255, 92, 138, .34);
  border-radius: 50%;
  display: flex;
  font-size: 16px;
  font-weight: 950;
  height: 30px;
  justify-content: center;
  left: 8px;
  position: absolute;
  top: 11px;
  width: 30px;
}

.ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
  bottom: 6px;
  height: 34px;
  width: 34px;
}

.ysw-card-table .ysw-enemy-unit .ysw-state-badge {
  left: auto;
  right: 8px;
  top: 8px;
}

.ysw-card-table .ysw-hand {
  flex: 0 0 148px;
  gap: 8px;
  margin: 0;
  min-height: 148px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 5px;
}

.ysw-card-table .ysw-hand-card {
  flex: 0 0 126px;
  height: 142px;
}

.ysw-card-table .ysw-hand-card .ysw-cost {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 4;
}

.ysw-card-table .ysw-card-type {
  background: rgba(5, 10, 18, .82);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: #d8f657;
  font-size: 10px;
  font-weight: 950;
  left: 7px;
  padding: 4px 6px;
  position: absolute;
  top: 7px;
  z-index: 3;
}

.ysw-card-table .ysw-hand-card p {
  display: none;
}

.ysw-role-tags {
  bottom: 38px;
  display: flex;
  gap: 4px;
  left: 7px;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.ysw-role-tags i {
  background: rgba(216, 246, 87, .92);
  border-radius: 999px;
  color: #08131b;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  padding: 3px 5px;
}

.ysw-battle-detail {
  display: grid;
  gap: 8px;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.ysw-detail-card {
  background: rgba(6, 12, 20, .78);
  border: 1px solid rgba(160, 209, 225, .2);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 11px;
}

.ysw-detail-card span {
  color: #d8f657;
  font-size: 12px;
  font-weight: 950;
}

.ysw-detail-card strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
}

.ysw-detail-card p {
  color: #cde2ea;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.ysw-recent-events {
  min-height: 0;
  overflow: auto;
}

.ysw-card-table .ysw-battle-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 0;
}

.ysw-player-burst {
  align-items: center;
  display: flex;
  inset: 50% auto auto 50%;
  justify-content: center;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -50%);
  z-index: 16;
}

.ysw-tutorial-modal {
  align-items: center;
  background: rgba(2, 6, 12, .45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: absolute;
  z-index: 18;
}

.ysw-tutorial-modal > div {
  background: rgba(6, 12, 20, .96);
  border: 1px solid rgba(216, 246, 87, .5);
  border-radius: 8px;
  box-shadow: 0 26px 72px rgba(0, 0, 0, .55), 0 0 34px rgba(36, 210, 255, .14);
  display: grid;
  gap: 12px;
  max-width: 720px;
  padding: 22px;
  width: min(100%, 720px);
}

.ysw-tutorial-modal span {
  color: #d8f657;
  font-size: 14px;
  font-weight: 950;
}

.ysw-tutorial-modal strong {
  color: #fff;
  font-size: 26px;
  line-height: 1.25;
}

.ysw-tutorial-modal p {
  color: #dcecf2;
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}

.ysw-tutorial-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ysw-deck-builder {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.ysw-deck-library,
.ysw-deck-side,
.ysw-deck-detail,
.ysw-deck-current {
  background: rgba(8, 16, 28, .76);
  border: 1px solid rgba(160, 209, 225, .2);
  border-radius: 8px;
}

.ysw-deck-library,
.ysw-deck-side,
.ysw-deck-detail,
.ysw-deck-current {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ysw-deck-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ysw-deck-filters label {
  color: #d8f657;
  display: grid;
  flex: 1 1 160px;
  font-size: 12px;
  font-weight: 950;
  gap: 5px;
}

.ysw-deck-filters select {
  background: rgba(6, 12, 20, .92);
  border: 1px solid rgba(160, 209, 225, .22);
  border-radius: 7px;
  color: #fff;
  font: inherit;
  min-height: 40px;
  padding: 8px;
}

.ysw-deck-builder .ysw-card-pool {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 640px;
  overflow: auto;
}

.ysw-library-card {
  position: relative;
}

.ysw-library-card.is-selected {
  border-color: rgba(216, 246, 87, .74);
  box-shadow: 0 0 0 2px rgba(216, 246, 87, .14);
}

.ysw-card-select {
  background: transparent;
  border: 0;
  cursor: pointer;
  inset: 0;
  position: absolute;
  z-index: 1;
}

.ysw-library-card .ysw-deck-controls,
.ysw-library-card .ysw-library-top,
.ysw-library-card p,
.ysw-library-card .ysw-stats {
  position: relative;
  z-index: 2;
}

.ysw-library-card .ysw-deck-controls button {
  position: relative;
  z-index: 3;
}

.ysw-deck-detail .ysw-card-visual {
  height: 164px;
  margin: 0;
}

.ysw-deck-detail h3,
.ysw-deck-current h3 {
  color: #fff;
  font-size: 22px;
  margin: 0;
}

.ysw-deck-detail > span,
.ysw-deck-current p {
  color: #bdd1da;
  margin: 0;
}

.ysw-current-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.ysw-current-list button {
  align-items: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  color: #eef7ff;
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 9px;
}

.ysw-deck-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ysw-deck-warning-list span {
  background: rgba(216, 246, 87, .12);
  border: 1px solid rgba(216, 246, 87, .28);
  border-radius: 999px;
  color: #eaffb4;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 8px;
}

.ysw-story-panel {
  max-width: min(940px, calc(100% - 44px));
  padding: 28px;
}

.ysw-story-body p {
  font-size: 17px;
  line-height: 1.95;
}

.ysw-story-visual img {
  object-position: center 18%;
}

@media (max-width: 1320px) {
  .ysw-table-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .ysw-battle-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-rows: auto;
  }

  .ysw-recent-events {
    max-height: 118px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 132px;
    min-height: 132px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 118px;
    height: 126px;
  }
}

/* v2 polish pass: compact badges and deck ergonomics */
.ysw-card-table .ysw-stat-badge {
  border-width: 1px;
  bottom: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .34);
  font-size: 13px;
  height: 29px;
  letter-spacing: 0;
  width: 29px;
}

.ysw-card-table .ysw-stat-badge small {
  font-size: 6px;
  line-height: 1;
  margin-bottom: 1px;
}

.ysw-card-table .ysw-atk-badge {
  left: 6px;
}

.ysw-card-table .ysw-hp-badge {
  right: 6px;
}

.ysw-card-table .ysw-hand-card .ysw-atk-badge {
  left: 6px;
}

.ysw-card-table .ysw-hand-card .ysw-hp-badge {
  right: 6px;
}

.ysw-card-table .ysw-card-name,
.ysw-card-table .ysw-hand-card strong {
  font-size: 12px;
  min-height: 31px;
  padding: 7px 38px 7px 8px;
}

.ysw-card-table .ysw-state-badge {
  font-size: 10px;
  padding: 4px 6px;
  right: 6px;
  top: 6px;
}

.ysw-card-table .ysw-cost {
  height: 27px;
  width: 27px;
}

.ysw-card-table .ysw-hand-card .ysw-cost {
  right: 6px;
  top: 6px;
}

.ysw-card-table .ysw-card-type {
  font-size: 9px;
  left: 6px;
  padding: 3px 5px;
  top: 6px;
}

.ysw-card-table .ysw-role-tags {
  bottom: 33px;
  gap: 3px;
  left: 6px;
}

.ysw-card-table .ysw-role-tags i {
  font-size: 8px;
  padding: 2px 4px;
}

.ysw-card-table .ysw-hand-card {
  flex-basis: 118px;
  height: 134px;
}

.ysw-deck .ysw-deck-summary {
  align-items: center;
  gap: 10px;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) auto auto;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.ysw-deck .ysw-deck-summary .ysw-primary,
.ysw-deck .ysw-deck-summary .ysw-secondary {
  justify-self: end;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
  width: auto;
}

.ysw-deck .ysw-deck-summary strong {
  font-size: 22px;
}

.ysw-deck-builder {
  align-items: start;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 346px);
}

.ysw-deck-library,
.ysw-deck-side {
  align-content: start;
}

.ysw-deck-library {
  grid-template-rows: auto minmax(0, 1fr);
}

.ysw-deck-library,
.ysw-deck-side,
.ysw-deck-detail,
.ysw-deck-current {
  gap: 10px;
  padding: 12px;
}

.ysw-deck-filters {
  align-items: flex-start;
  gap: 8px;
}

.ysw-deck-filters label {
  display: flex;
  flex: 0 0 178px;
  flex-direction: column;
  font-size: 11px;
  gap: 4px;
  min-height: 0;
}

.ysw-deck-filters select {
  appearance: auto;
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
}

.ysw-deck-builder .ysw-card-pool {
  align-content: start;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(176px, 1fr));
  max-height: min(620px, calc(100svh - 370px));
}

.ysw-deck-builder .ysw-library-card {
  gap: 8px;
  min-height: 178px;
  padding: 10px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  height: 82px;
  margin: -2px -2px 4px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top {
  gap: 8px;
}

.ysw-deck-builder .ysw-library-card strong {
  font-size: 15px;
}

.ysw-deck-builder .ysw-library-card small,
.ysw-deck-builder .ysw-library-card p {
  font-size: 11px;
  line-height: 1.45;
}

.ysw-deck-builder .ysw-library-card p {
  max-height: 42px;
  overflow: hidden;
}

.ysw-deck-builder .ysw-role-tags,
.ysw-deck-detail .ysw-role-tags {
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  left: auto;
  position: relative;
  z-index: 2;
}

.ysw-deck-builder .ysw-role-tags i,
.ysw-deck-detail .ysw-role-tags i {
  font-size: 10px;
  padding: 3px 6px;
}

.ysw-deck-builder .ysw-stats,
.ysw-deck-detail .ysw-stats {
  gap: 5px;
  margin-top: 0;
}

.ysw-deck-builder .ysw-stats span,
.ysw-deck-detail .ysw-stats span {
  font-size: 11px;
  padding: 4px 7px;
}

.ysw-deck-builder .ysw-deck-controls {
  gap: 8px;
  justify-content: space-between;
  margin-top: auto;
}

.ysw-deck-builder .ysw-deck-controls button,
.ysw-deck-detail .ysw-deck-controls button {
  font-size: 18px;
  height: 32px;
  width: 38px;
}

.ysw-deck-builder .ysw-deck-controls strong,
.ysw-deck-detail .ysw-deck-controls strong {
  color: #fff;
  font-size: 17px;
  min-width: 24px;
  text-align: center;
}

.ysw-deck-detail .ysw-card-visual {
  height: 150px;
}

.ysw-deck-detail h3,
.ysw-deck-current h3 {
  font-size: 20px;
}

.ysw-current-list {
  max-height: 220px;
}

@media (max-width: 1320px) {
  .ysw-card-table .ysw-hand-card {
    flex-basis: 110px;
    height: 124px;
  }

  .ysw-card-table .ysw-stat-badge {
    height: 27px;
    width: 27px;
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 980px) {
  .ysw-deck .ysw-deck-summary {
    grid-template-columns: 1fr 1fr;
  }

  .ysw-deck .ysw-deck-summary .ysw-primary,
  .ysw-deck .ysw-deck-summary .ysw-secondary {
    justify-self: stretch;
  }
}

/* v2 deck polish hard override */
.ysw-deck-builder .ysw-library-card {
  min-height: 248px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  display: block;
  flex: 0 0 76px;
  height: 76px !important;
  margin: -2px -2px 6px;
  min-height: 76px;
  overflow: hidden;
  position: relative;
  width: auto;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual img {
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  width: 100%;
}

.ysw-deck-builder .ysw-library-card .ysw-cost {
  height: 30px;
  width: 30px;
}

.ysw-deck-builder .ysw-library-card p {
  display: none;
}

@media (max-width: 980px) {
  .ysw-leader-grid,
  .ysw-deck-builder {
    grid-template-columns: 1fr;
  }

  .ysw-leader-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ysw-table-leaders,
  .ysw-battle-detail {
    grid-template-columns: 1fr;
  }

  .ysw-card-table {
    height: auto;
    min-height: calc(100svh - 90px);
    overflow: visible;
  }

  .ysw-leader-grid {
    grid-template-columns: 1fr;
  }

  .ysw-tutorial-modal strong {
    font-size: 22px;
  }

  .ysw-tutorial-modal p,
  .ysw-story-body p {
    font-size: 15px;
  }
}

@font-face {
  font-family: "Makinas 4 Square";
  src: url("fonts/Makinas-4-Square.otf") format("opentype");
  font-display: swap;
}

.ysw-game {
  color: #eef7ff;
  font-family: "Makinas 4 Square", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ysw-game:fullscreen {
  background: #0b111a;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
}

.ysw-game:fullscreen:has(.ysw-battle) {
  overflow: hidden;
}

.ysw-game button,
.ysw-game input,
.ysw-game select,
.ysw-game textarea {
  font: inherit;
}

.ysw-shell {
  background:
    linear-gradient(160deg, rgba(10, 18, 31, .97), rgba(14, 24, 36, .98) 48%, rgba(18, 18, 24, .98)),
    #111923;
  border: 1px solid rgba(148, 189, 205, .25);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .24);
  margin: 12px auto;
  max-width: 1180px;
  min-height: min(696px, calc(100svh - 72px));
  overflow: hidden;
  position: relative;
}

.ysw-shell:fullscreen,
.ysw-game:fullscreen .ysw-shell {
  border: 0;
  border-radius: 0;
  margin: 0;
  max-width: none;
  min-height: 100svh;
  width: 100vw;
}

.ysw-backdrop {
  inset: 0 0 auto 0;
  height: 220px;
  opacity: .9;
  pointer-events: none;
  position: absolute;
}

.ysw-backdrop svg {
  display: block;
  height: 100%;
  width: 100%;
}

.ysw-topbar {
  align-items: center;
  border-bottom: 1px solid rgba(160, 209, 225, .18);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 18px;
  position: relative;
  z-index: 1;
}

.ysw-kicker {
  color: #90d7e6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.ysw-topbar h2 {
  color: #ffffff;
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

.ysw-tabs {
  align-items: center;
  background: rgba(6, 12, 20, .62);
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.ysw-audio-controls {
  align-items: center;
  background: rgba(6, 12, 20, .62);
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 6px;
}

.ysw-audio-controls label,
.ysw-audio-row label {
  align-items: center;
  color: #b7cad4;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
}

.ysw-audio-controls input,
.ysw-audio-row input {
  accent-color: #d8f657;
  width: 108px;
}

.ysw-game input[type="range"][data-action="volume-change"] {
  -webkit-appearance: none;
  appearance: none;
  background:
    linear-gradient(
      90deg,
      #d8f657 0 var(--ysw-range-progress, 55%),
      rgba(255, 255, 255, .28) var(--ysw-range-progress, 55%) 100%
    ) center / 100% 6px no-repeat;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  height: 18px;
  margin: 0;
  min-height: 0;
  padding: 0;
  vertical-align: middle;
}

.ysw-game input[type="range"][data-action="volume-change"]:focus-visible {
  outline: 2px solid rgba(216, 246, 87, .7);
  outline-offset: 3px;
}

.ysw-game input[type="range"][data-action="volume-change"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  height: 6px;
}

.ysw-game input[type="range"][data-action="volume-change"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #d8f657;
  border: 2px solid #172112;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(216, 246, 87, .35), 0 0 12px rgba(216, 246, 87, .34);
  height: 16px;
  margin-top: -5px;
  width: 16px;
}

.ysw-game input[type="range"][data-action="volume-change"]::-moz-range-track {
  background: transparent;
  border: 0;
  box-shadow: none;
  height: 6px;
}

.ysw-game input[type="range"][data-action="volume-change"]::-moz-range-progress {
  background: transparent;
  height: 6px;
}

.ysw-game input[type="range"][data-action="volume-change"]::-moz-range-thumb {
  background: #d8f657;
  border: 2px solid #172112;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(216, 246, 87, .35), 0 0 12px rgba(216, 246, 87, .34);
  height: 16px;
  width: 16px;
}

.ysw-audio-toggle {
  background: rgba(216, 246, 87, .14);
  border: 1px solid rgba(216, 246, 87, .34);
  border-radius: 6px;
  color: #eef7ff;
  cursor: pointer;
  font-weight: 900;
  min-height: 36px;
  padding: 8px 10px;
  white-space: nowrap;
}

.ysw-tabs button,
.ysw-primary,
.ysw-secondary,
.ysw-deck-controls button,
.ysw-unit,
.ysw-hand-card {
  border: 0;
  cursor: pointer;
  min-height: 40px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}

.ysw-tabs button {
  background: transparent;
  border-radius: 6px;
  color: #b7cad4;
  font-weight: 700;
  padding: 9px 14px;
}

.ysw-tabs button.is-active {
  background: #d8f657;
  color: #142015;
}

.ysw-tabs button:hover,
.ysw-primary:hover,
.ysw-secondary:hover,
.ysw-deck-controls button:hover,
.ysw-unit.can-attack:hover,
.ysw-hand-card:not(:disabled):hover {
  transform: translateY(-1px);
}

.ysw-view {
  padding: 18px;
  position: relative;
  z-index: 1;
}

.ysw-orientation-hint {
  display: none;
}

.ysw-layout-debug {
  background: rgba(3, 8, 14, .9);
  border: 1px solid rgba(216, 246, 87, .46);
  border-radius: 6px;
  bottom: 10px;
  color: #dffbff;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  left: 10px;
  max-width: min(360px, calc(100vw - 20px));
  padding: 8px 10px;
  pointer-events: none;
  position: fixed;
  white-space: pre-wrap;
  z-index: 9999;
}

.ysw-shell-cinematic {
  min-height: 760px;
}

.ysw-game:fullscreen .ysw-shell-cinematic {
  height: 100svh;
  min-height: 100svh;
}

.ysw-game:fullscreen .ysw-shell-cinematic .ysw-view {
  height: calc(100svh - 76px);
}

.ysw-shell-cinematic .ysw-topbar h2,
.ysw-title-copy h1,
.ysw-story-panel h1,
.ysw-opening-lines h3 {
  font-family: "Makinas 4 Square", "Yu Mincho", serif;
  font-weight: 800;
  letter-spacing: 0;
}

.ysw-title-screen,
.ysw-opening,
.ysw-story-screen {
  min-height: 640px;
}

.ysw-title-screen {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 28px;
}

.ysw-title-city,
.ysw-opening-city {
  background:
    radial-gradient(circle at 35% 28%, rgba(36, 210, 255, .3), transparent 28%),
    radial-gradient(circle at 72% 42%, rgba(255, 92, 138, .24), transparent 26%),
    linear-gradient(180deg, rgba(9, 19, 34, .1), rgba(3, 8, 14, .95));
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  min-height: 430px;
  overflow: hidden;
  position: relative;
}

.ysw-title-city,
.ysw-title-city * {
  pointer-events: none;
}

.ysw-title-city {
  background: #06101c;
}

.ysw-title-frame,
.ysw-title-frame img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.ysw-title-frame {
  animation: yswTitleRotate 25s ease-in-out infinite;
  animation-delay: calc(var(--title-index, 0) * 5s);
  opacity: 0;
  z-index: 1;
}

.ysw-title-frame img {
  animation: yswTitleCamera 10s ease-in-out infinite alternate;
  transform: scale(1.02);
}

.ysw-title-city::before,
.ysw-opening-city::before {
  background:
    linear-gradient(90deg, transparent 48%, rgba(216, 246, 87, .18) 49%, transparent 51%),
    linear-gradient(0deg, transparent 48%, rgba(36, 210, 255, .14) 49%, transparent 51%);
  background-size: 40px 40px;
  content: "";
  inset: 0;
  opacity: .48;
  position: absolute;
}

.ysw-title-city::after {
  background:
    linear-gradient(90deg, rgba(3, 8, 14, .18), rgba(3, 8, 14, .06) 38%, rgba(3, 8, 14, .58)),
    linear-gradient(180deg, rgba(3, 8, 14, .02), rgba(3, 8, 14, .68));
  content: "";
  inset: 0;
  position: absolute;
  z-index: 2;
}

.ysw-title-grid {
  background:
    linear-gradient(90deg, rgba(36, 210, 255, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 210, 255, .08) 1px, transparent 1px);
  background-size: 52px 52px;
  inset: 0;
  opacity: .28;
  position: absolute;
  z-index: 3;
}

.ysw-title-sweep {
  animation: yswTitleSweep 5.8s ease-in-out infinite;
  background: linear-gradient(105deg, transparent 0 44%, rgba(216, 246, 87, .2) 48%, rgba(36, 210, 255, .28) 52%, transparent 58% 100%);
  inset: -20% -35%;
  position: absolute;
  transform: translateX(-26%);
  z-index: 4;
}

.ysw-city-light {
  animation: yswPulseNode 3.2s ease-in-out infinite;
  background: #d8f657;
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(216, 246, 87, .78);
  height: 14px;
  position: absolute;
  width: 14px;
  z-index: 2;
}

.ysw-city-light.one {
  left: 18%;
  top: 42%;
}

.ysw-city-light.two {
  animation-delay: .8s;
  left: 58%;
  top: 32%;
}

.ysw-city-light.three {
  animation-delay: 1.5s;
  left: 78%;
  top: 54%;
}

.ysw-scanline {
  animation: yswScanline 5s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(36, 210, 255, .8), transparent);
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 20%;
  z-index: 3;
}

.ysw-title-copy,
.ysw-story-panel {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.ysw-cinematic-label {
  color: #d8f657;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.ysw-title-copy h1,
.ysw-story-panel h1 {
  color: #ffffff;
  font-size: clamp(40px, 7vw, 86px);
  line-height: 1.02;
  margin: 0;
}

.ysw-story-panel h1 {
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.ysw-title-copy h1 {
  overflow-wrap: normal;
  word-break: keep-all;
}

.ysw-title-line {
  display: block;
  white-space: nowrap;
}

.ysw-game:fullscreen .ysw-title-copy h1 {
  font-size: clamp(58px, 4.9vw, 92px);
}

.ysw-title-copy p,
.ysw-story-body p,
.ysw-opening-lines span {
  color: #d5e4eb;
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}

.ysw-opening-lines span {
  color: #edf8ff;
  font-size: clamp(17px, 1.08vw, 20px);
  font-weight: 800;
  line-height: 1.55;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .62);
}

.ysw-title-copy small {
  color: #9fb7c4;
  font-weight: 800;
}

.ysw-title-actions,
.ysw-cinematic-actions,
.ysw-story-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ysw-story-tools {
  margin: -4px 0 16px;
}

.ysw-opening {
  display: grid;
  gap: 12px;
  grid-template-rows: minmax(0, 1fr);
}

.ysw-end-roll {
  display: grid;
  min-height: 640px;
  overflow: hidden;
  padding: 0;
}

.ysw-end-roll-stage {
  background: #000;
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

.ysw-end-roll-video {
  background: #000;
  display: block;
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
}

.ysw-end-roll-video[hidden],
.ysw-end-roll-fallback[hidden] {
  display: none;
}

.ysw-end-roll-actions {
  display: flex;
  gap: 10px;
  position: absolute;
  right: 28px;
  top: 28px;
  z-index: 4;
}

.ysw-end-roll-actions .ysw-secondary,
.ysw-end-roll-actions .ysw-primary {
  box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
}

.ysw-end-roll-stage.is-ended .ysw-end-roll-actions .ysw-primary {
  border-color: rgba(216, 246, 87, .72);
  box-shadow: 0 0 0 2px rgba(216, 246, 87, .18), 0 14px 38px rgba(0, 0, 0, .36);
}

.ysw-end-roll-fallback {
  align-content: center;
  background:
    linear-gradient(180deg, rgba(5, 10, 18, .72), rgba(5, 10, 18, .92)),
    radial-gradient(circle at 50% 32%, rgba(216, 246, 87, .1), transparent 34%);
  display: grid;
  gap: 18px;
  inset: 0;
  justify-items: center;
  padding: 88px 32px 40px;
  position: absolute;
  z-index: 2;
}

.ysw-end-roll-fallback h1 {
  color: #ffffff;
  font-family: "Makinas 4 Square", "Yu Mincho", serif;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.08;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: center;
}

.ysw-end-roll-fallback .ysw-staff-roll {
  max-width: min(880px, calc(100% - 24px));
  width: 100%;
}

.ysw-opening > .ysw-cinematic-actions {
  position: absolute;
  right: 34px;
  top: 34px;
  z-index: 8;
}

.ysw-opening > .ysw-cinematic-actions .ysw-secondary {
  background: rgba(5, 10, 18, .72);
  border-color: rgba(160, 209, 225, .34);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}

.ysw-opening-stage {
  display: grid;
  min-height: 560px;
  position: relative;
}

.ysw-opening-city {
  inset: 0;
  min-height: 560px;
  position: absolute;
}

.ysw-opening-images,
.ysw-opening-image {
  inset: 0;
  position: absolute;
}

.ysw-opening-images {
  background: rgba(3, 8, 14, .94);
  overflow: hidden;
  z-index: 1;
}

.ysw-opening-images::after {
  background:
    linear-gradient(180deg, rgba(3, 8, 14, .02), rgba(3, 8, 14, .22) 62%, rgba(3, 8, 14, .74)),
    radial-gradient(circle at 22% 16%, rgba(36, 210, 255, .12), transparent 38%),
    linear-gradient(90deg, rgba(3, 8, 14, .34), transparent 30%, rgba(3, 8, 14, .18));
  content: "";
  inset: 0;
  position: absolute;
  z-index: 3;
}

.ysw-opening-sequence-video,
.ysw-opening-video-fallback {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.ysw-opening-sequence-video {
  z-index: 2;
}

.ysw-opening-video-fallback {
  z-index: 1;
}

.ysw-opening-scan,
.ysw-opening-noise {
  position: absolute;
  z-index: 4;
}

.ysw-opening-scan {
  animation: yswOpeningScan 6.8s ease-in-out infinite;
  background: linear-gradient(180deg, transparent, rgba(36, 210, 255, .46), transparent);
  height: 24%;
  inset: -24% 0 auto;
  mix-blend-mode: screen;
  opacity: .32;
}

.ysw-opening-noise {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, transparent, rgba(255, 92, 138, .07), transparent);
  inset: 0;
  opacity: .08;
}

.ysw-opening-lines {
  align-self: end;
  min-height: 260px;
  padding: 18px 28px 34px;
  position: relative;
  z-index: 5;
}

.ysw-opening-lines article {
  background: rgba(5, 10, 18, .34);
  border: 1px solid rgba(160, 209, 225, .12);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .18);
  display: grid;
  gap: 8px;
  inset: 18px 28px 38px;
  opacity: 1;
  padding: 18px 22px;
  position: absolute;
}

.ysw-opening-lines p {
  color: #d8f657;
  font-size: clamp(14px, .9vw, 16px);
  font-weight: 900;
  margin: 0;
}

.ysw-opening-lines h3 {
  color: #ffffff;
  font-size: clamp(28px, 4.4vw, 50px);
  line-height: 1.08;
  margin: 0;
}

.ysw-opening-progress {
  background: rgba(255, 255, 255, .1);
  bottom: 16px;
  height: 4px;
  left: 28px;
  overflow: hidden;
  position: absolute;
  right: 28px;
  z-index: 6;
}

.ysw-opening-progress i {
  animation: yswOpeningProgress 90s linear both;
  background: linear-gradient(90deg, #24d2ff, #d8f657, #ff5c8a);
  display: block;
  height: 100%;
  transform-origin: left center;
}

.ysw-story-screen {
  align-items: end;
  display: grid;
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.ysw-story-panel {
  background: rgba(5, 10, 18, .34);
  border: 1px solid rgba(160, 209, 225, .26);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .36);
  margin: 0 0 18px;
  max-width: min(940px, calc(100% - 48px));
  padding: 24px 28px;
  position: relative;
  z-index: 3;
}

.ysw-story-visual {
  background:
    radial-gradient(circle at 20% 20%, rgba(36, 210, 255, .2), transparent 32%),
    linear-gradient(135deg, rgba(5, 10, 18, .65), rgba(5, 10, 18, .2));
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  inset: 0;
  overflow: hidden;
  position: absolute;
  z-index: 0;
}

.ysw-story-visual img,
.ysw-story-visual video,
.ysw-story-scan,
.ysw-story-vignette {
  inset: 0;
  position: absolute;
}

.ysw-story-visual img {
  animation: yswStoryDrift 18s ease-in-out infinite alternate;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  width: 100%;
}

.ysw-story-visual video {
  height: 100%;
  mix-blend-mode: screen;
  object-fit: cover;
  opacity: .42;
  width: 100%;
}

.ysw-story-scan {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0, rgba(255, 255, 255, .06) 1px, transparent 1px, transparent 60px),
    linear-gradient(90deg, transparent, rgba(36, 210, 255, .18), transparent);
  mix-blend-mode: screen;
  opacity: .48;
}

.ysw-story-vignette {
  background:
    linear-gradient(90deg, rgba(5, 10, 18, .18), transparent 42%, rgba(5, 10, 18, .5)),
    linear-gradient(180deg, rgba(5, 10, 18, .1), rgba(5, 10, 18, .22) 52%, rgba(5, 10, 18, .86));
}

.ysw-story-mood-victory .ysw-story-vignette {
  background:
    linear-gradient(90deg, rgba(5, 10, 18, .12), transparent 44%, rgba(5, 10, 18, .42)),
    linear-gradient(180deg, rgba(5, 10, 18, .08), rgba(5, 10, 18, .2) 56%, rgba(5, 10, 18, .78));
}

.ysw-story-mood-final .ysw-story-visual video {
  opacity: .52;
}

.ysw-story-mood-final .ysw-story-vignette {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 92, 138, .18), transparent 28%),
    linear-gradient(90deg, rgba(5, 10, 18, .22), transparent 40%, rgba(5, 10, 18, .56)),
    linear-gradient(180deg, rgba(5, 10, 18, .08), rgba(5, 10, 18, .2) 52%, rgba(5, 10, 18, .86));
}

.ysw-story-body {
  display: grid;
  gap: 12px;
}

.ysw-true-ending-screen .ysw-story-panel {
  border-color: rgba(216, 246, 87, .42);
  box-shadow: 0 0 42px rgba(216, 246, 87, .1);
}

.ysw-staff-roll {
  border-top: 1px solid rgba(216, 246, 87, .28);
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 210px;
  overflow: hidden;
  padding-top: 12px;
  position: relative;
}

.ysw-staff-roll span {
  color: #e8f7ff;
  display: block;
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 14px rgba(36, 210, 255, .32);
}

.ysw-staff-roll span:first-child {
  color: #d8f657;
  font-size: clamp(18px, 1.45vw, 26px);
}

.ysw-story-progress {
  align-items: center;
  color: #9fb7c4;
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  margin: 4px 0 12px;
}

@keyframes yswStoryDrift {
  from {
    transform: scale(1.04) translate3d(-1.2%, -.8%, 0);
  }

  to {
    transform: scale(1.1) translate3d(1.2%, .8%, 0);
  }
}

.ysw-story-progress span {
  justify-self: end;
}

.ysw-story-progress i {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  display: block;
  height: 5px;
  overflow: hidden;
  position: relative;
}

.ysw-story-progress i::before {
  background: linear-gradient(90deg, #24d2ff, #d8f657);
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(var(--story-progress, 0));
  transform-origin: left center;
  transition: transform .24s ease;
}

.ysw-tutorial-panel {
  background:
    linear-gradient(90deg, rgba(216, 246, 87, .14), rgba(36, 210, 255, .1)),
    rgba(5, 10, 18, .84);
  border: 1px solid rgba(216, 246, 87, .38);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(36, 210, 255, .12);
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.ysw-tutorial-panel span {
  color: #d8f657;
  font-size: 12px;
  font-weight: 950;
}

.ysw-tutorial-panel strong {
  color: #ffffff;
  font-size: 20px;
}

.ysw-tutorial-panel p {
  color: #d8e8ee;
  margin: 0;
}

.ysw-battle {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: clamp(560px, calc(100svh - 148px), 780px);
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px;
}

.ysw-battle .ysw-tutorial-panel {
  gap: 4px;
  margin-bottom: 6px;
  padding: 8px 10px;
}

.ysw-battle .ysw-tutorial-panel strong {
  font-size: 16px;
}

.ysw-battle .ysw-tutorial-panel p {
  font-size: 12px;
  line-height: 1.45;
}

.ysw-battle > .ysw-tutorial-panel,
.ysw-combatants,
.ysw-enemy-board-wrap,
.ysw-battle-footer {
  flex: 0 0 auto;
}

.ysw-board-wrap {
  flex: 1 1 auto;
}

.ysw-status-band,
.ysw-deck-summary,
.ysw-combatants,
.ysw-battle-footer,
.ysw-save,
.ysw-gallery,
.ysw-characters,
.ysw-glossary,
.ysw-settings,
.ysw-info {
  display: grid;
  gap: 12px;
}

.ysw-status-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.ysw-status-band > div,
.ysw-deck-summary,
.ysw-leader,
.ysw-gallery-intro,
.ysw-gallery-card,
.ysw-character-intro,
.ysw-character-card,
.ysw-glossary-intro,
.ysw-glossary-card,
.ysw-info-intro,
.ysw-info-panel,
.ysw-save-panel {
  background: rgba(8, 16, 28, .76);
  border: 1px solid rgba(160, 209, 225, .2);
  border-radius: 8px;
}

.ysw-status-band > div {
  padding: 16px;
}

.ysw-status-band span,
.ysw-deck-summary span,
.ysw-leader span {
  color: #9fb7c4;
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.ysw-status-band small {
  color: #9fb7c4;
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.ysw-status-band strong,
.ysw-deck-summary strong,
.ysw-leader strong {
  color: #ffffff;
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.ysw-boss-list {
  display: grid;
  gap: 16px;
}

.ysw-boss {
  background: rgba(10, 19, 31, .84);
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(180px, 28%) 1fr;
  min-height: 238px;
  overflow: hidden;
}

.ysw-boss.is-cleared {
  border-color: rgba(216, 246, 87, .55);
}

.ysw-boss.is-locked {
  opacity: .58;
}

.ysw-boss-art {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(24, 210, 255, .24), rgba(255, 92, 138, .18)),
    #07111e;
  display: flex;
  justify-content: center;
  min-height: 238px;
  overflow: hidden;
  position: relative;
}

.ysw-boss-art img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center 24%;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.ysw-boss-art::before,
.ysw-boss-art::after {
  content: "";
  position: absolute;
}

.ysw-boss-art::before {
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, .12) 49%, transparent 51%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, .12) 49%, transparent 51%);
  background-size: 28px 28px;
  inset: 0;
  opacity: .42;
  z-index: 2;
}

.ysw-boss-art::after {
  border: 2px solid rgba(255, 255, 255, .34);
  border-radius: 50%;
  height: 118px;
  width: 118px;
  z-index: 2;
}

.ysw-boss-art:has(img)::after,
.ysw-boss-art img + span {
  display: none;
}

.ysw-boss-art span {
  background: linear-gradient(160deg, #24d2ff, #d8f657 52%, #ff5c8a);
  border-radius: 28% 72% 58% 42%;
  box-shadow: 0 0 52px rgba(36, 210, 255, .45);
  display: block;
  height: 94px;
  position: relative;
  width: 94px;
  z-index: 1;
}

.ysw-boss-art-2 span {
  border-radius: 12px;
  transform: rotate(45deg);
}

.ysw-boss-art-3 span {
  clip-path: polygon(50% 0, 100% 36%, 82% 100%, 18% 100%, 0 36%);
}

.ysw-boss-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.ysw-boss-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.ysw-boss-heading p {
  color: #d8f657;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 4px;
}

.ysw-boss-heading h3,
.ysw-gallery-intro h3,
.ysw-gallery-card h3,
.ysw-character-intro h3,
.ysw-character-card h3,
.ysw-glossary-intro h3,
.ysw-save-panel h3,
.ysw-result h3 {
  color: #ffffff;
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
}

.ysw-boss-heading strong {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  color: #ffffff;
  flex: 0 0 auto;
  padding: 8px 10px;
}

.ysw-boss-subtitle,
.ysw-boss-intro,
.ysw-gallery-card p,
.ysw-character-card p,
.ysw-glossary-intro p,
.ysw-glossary-card p,
.ysw-save-panel p,
.ysw-log p {
  color: #c7d8df;
  margin: 0;
}

.ysw-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.ysw-rewards span,
.ysw-gears span {
  background: rgba(36, 210, 255, .12);
  border: 1px solid rgba(36, 210, 255, .28);
  border-radius: 999px;
  color: #dffbff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
}

.ysw-primary,
.ysw-secondary {
  border-radius: 7px;
  font-weight: 800;
  padding: 11px 16px;
}

.ysw-primary {
  background: #d8f657;
  color: #142015;
}

.ysw-secondary {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eef7ff;
}

.ysw-danger {
  background: rgba(255, 92, 138, .14);
  border: 1px solid rgba(255, 92, 138, .48);
  border-radius: 7px;
  color: #ffd8e2;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  min-height: 42px;
  padding: 11px 16px;
}

.ysw-primary:disabled,
.ysw-secondary:disabled,
.ysw-hand-card:disabled,
.ysw-unit:disabled,
.ysw-deck-controls button:disabled {
  cursor: not-allowed;
  opacity: .46;
  transform: none;
}

.is-tutorial-target {
  animation: yswTutorialTarget 1300ms ease-in-out infinite;
  border-color: rgba(216, 246, 87, .82) !important;
  box-shadow: 0 0 0 2px rgba(216, 246, 87, .22), 0 0 28px rgba(216, 246, 87, .22) !important;
}

.ysw-deck-summary {
  align-items: center;
  grid-template-columns: 1fr auto auto;
  margin-bottom: 18px;
  padding: 14px;
}

.ysw-deck-summary .is-warning {
  color: #ffb65c;
}

.ysw-card-pool {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ysw-library-card,
.ysw-hand-card {
  background: rgba(11, 20, 32, .94);
  border: 1px solid rgba(160, 209, 225, .18);
  border-radius: 8px;
  color: #eef7ff;
}

.ysw-library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 214px;
  padding: 12px;
}

.ysw-card-visual {
  background:
    linear-gradient(135deg, rgba(36, 210, 255, .3), rgba(216, 246, 87, .12)),
    #07111e;
  border-radius: 6px;
  display: block;
  height: 132px;
  margin: -4px -4px 10px;
  overflow: hidden;
  position: relative;
}

.ysw-card-visual::after {
  background: linear-gradient(180deg, transparent 48%, rgba(6, 12, 20, .78));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.ysw-card-visual img {
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  width: 100%;
}

.ysw-library-top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.ysw-cost {
  align-items: center;
  background: #24d2ff;
  border-radius: 50%;
  color: #06111b;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.ysw-type-tactic .ysw-cost {
  background: #ffcf5c;
}

.ysw-type-gear .ysw-cost {
  background: #ff83a7;
}

.ysw-library-card strong,
.ysw-hand-card strong {
  color: #ffffff;
  display: block;
  line-height: 1.25;
}

.ysw-library-card small,
.ysw-hand-card small {
  color: #9fb7c4;
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.ysw-library-card p,
.ysw-hand-card p {
  color: #c7d8df;
  font-size: 13px;
  margin: 0;
}

.ysw-stats,
.ysw-deck-controls {
  align-items: center;
  display: flex;
  gap: 8px;
}

.ysw-stats {
  margin-top: auto;
}

.ysw-stats span {
  background: rgba(255, 255, 255, .08);
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.ysw-deck-controls {
  justify-content: space-between;
  margin-top: auto;
}

.ysw-deck-controls button {
  align-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-size: 22px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 44px;
}

.ysw-combatants {
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
}

.ysw-leader {
  padding: 10px 12px;
}

.ysw-boss-leader {
  min-height: 112px;
  overflow: hidden;
  padding-left: 104px;
  position: relative;
}

.ysw-leader-portrait {
  background: rgba(255, 255, 255, .08);
  border-right: 1px solid rgba(255, 255, 255, .16);
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  width: 92px;
}

.ysw-leader-portrait img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  width: 100%;
}

.ysw-leader small {
  color: #b7cad4;
  display: block;
  margin-top: 5px;
  min-height: 20px;
}

.ysw-boss-status-chip {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 92, 138, .16), rgba(36, 210, 255, .07)),
    rgba(7, 12, 20, .78);
  border: 1px solid rgba(255, 92, 138, .42);
  border-radius: 999px;
  box-shadow: inset 0 0 12px rgba(255, 92, 138, .08);
  color: #ffd5df;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  gap: 5px;
  line-height: 1;
  min-height: 22px;
  padding: 4px 9px;
}

.ysw-boss-status-chip b {
  color: #ffffff;
  font-size: 1.05em;
}

.ysw-boss-status-chip:hover,
.ysw-boss-status-chip.is-selected {
  background:
    linear-gradient(135deg, rgba(255, 92, 138, .24), rgba(36, 210, 255, .12)),
    rgba(14, 18, 28, .9);
  border-color: rgba(255, 142, 172, .72);
  box-shadow:
    0 0 16px rgba(255, 92, 138, .22),
    inset 0 0 14px rgba(255, 92, 138, .1);
}

.ysw-pp-display {
  align-items: center;
  background:
    radial-gradient(circle at 22% 18%, rgba(216, 246, 87, .24), transparent 36%),
    rgba(216, 246, 87, .12);
  border: 1px solid rgba(216, 246, 87, .42);
  border-radius: 8px;
  display: inline-grid;
  gap: 6px;
  grid-template-columns: auto auto auto;
  margin-top: 6px;
  padding: 6px 10px;
}

.ysw-pp-display span {
  color: #d8f657;
  font-size: 14px;
  font-weight: 950;
}

.ysw-pp-display strong {
  color: #ffffff;
  font-size: 30px;
  line-height: .9;
}

.ysw-pp-display em {
  color: #b7cad4;
  font-style: normal;
  font-weight: 900;
}

.ysw-player-resource-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.ysw-player-resource-row .ysw-pp-display,
.ysw-player-resource-row .ysw-burst-count,
.ysw-player-resource-row .ysw-deck-count {
  margin-top: 0;
}

.ysw-deck-count {
  align-items: center;
  background:
    radial-gradient(circle at 20% 18%, rgba(36, 210, 255, .26), transparent 38%),
    rgba(36, 210, 255, .1);
  border: 1px solid rgba(36, 210, 255, .36);
  border-radius: 999px;
  color: #dffbff;
  display: inline-flex;
  gap: 4px;
  padding: 4px 10px;
  width: fit-content;
}

.ysw-deck-count span,
.ysw-deck-count em {
  color: inherit;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.ysw-deck-count strong {
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
}

.ysw-meter {
  background: rgba(255, 255, 255, .1);
  border-radius: 999px;
  height: 10px;
  margin-top: 7px;
  overflow: hidden;
}

.ysw-meter i {
  background: linear-gradient(90deg, #24d2ff, #d8f657);
  display: block;
  height: 100%;
}

.ysw-boss-leader .ysw-meter i {
  background: linear-gradient(90deg, #ff5c8a, #ffcf5c);
}

.ysw-special-gauge {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-top: 6px;
  overflow: hidden;
  padding: 5px 8px 7px;
  position: relative;
}

.ysw-special-gauge span,
.ysw-special-gauge strong {
  position: relative;
  z-index: 1;
}

.ysw-special-gauge span {
  color: #b7cad4;
  font-size: 11px;
  font-weight: 900;
}

.ysw-special-gauge strong {
  color: #ffffff;
  font-size: 13px;
}

.ysw-special-gauge i {
  background: linear-gradient(90deg, rgba(36, 210, 255, .42), rgba(216, 246, 87, .62));
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  transition: width .25s ease;
  z-index: 0;
}

.ysw-special-threat i {
  background: linear-gradient(90deg, rgba(255, 92, 138, .42), rgba(255, 207, 92, .62));
}

.ysw-counter-tag,
.ysw-threat-tag {
  align-self: start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  justify-self: start;
  line-height: 1.1;
  padding: 5px 8px;
}

.ysw-counter-tag {
  background: rgba(216, 246, 87, .12);
  border: 1px solid rgba(216, 246, 87, .32);
  color: #eaff8c;
}

.ysw-threat-tag {
  background: rgba(255, 92, 138, .14);
  border: 1px solid rgba(255, 92, 138, .36);
  color: #ffd8e2;
}

.ysw-enemy-board-wrap {
  background:
    linear-gradient(90deg, rgba(255, 92, 138, .12), rgba(6, 12, 20, .68)),
    rgba(6, 12, 20, .7);
  border: 1px solid rgba(255, 92, 138, .22);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.ysw-enemy-board-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ysw-enemy-board-head span {
  color: #ff9db8;
  font-size: 13px;
  font-weight: 950;
}

.ysw-enemy-board-head small {
  color: #9fb7c4;
  font-weight: 800;
}

.ysw-boss-target {
  background: rgba(255, 207, 92, .14);
  border: 1px solid rgba(255, 207, 92, .42);
  border-radius: 7px;
  color: #ffe7a6;
  font: inherit;
  font-weight: 950;
  min-height: 38px;
  padding: 8px 12px;
}

.ysw-boss-target:disabled {
  background: rgba(255, 92, 138, .12);
  border-color: rgba(255, 92, 138, .28);
  color: #ffb3c8;
}

.ysw-enemy-board {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 84px;
}

.ysw-enemy-board > p {
  align-self: center;
  color: #9fb7c4;
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.ysw-enemy-unit {
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, .16), transparent 30%),
    rgba(20, 13, 24, .92);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #eef7ff;
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 8px;
  position: relative;
  text-align: left;
}

.ysw-enemy-unit-icon {
  align-items: center;
  background: rgba(255, 92, 138, .18);
  border: 1px solid rgba(255, 92, 138, .34);
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
}

.ysw-enemy-unit.is-targetable {
  border-color: rgba(255, 207, 92, .66);
  box-shadow: 0 0 0 1px rgba(255, 207, 92, .2), 0 0 24px rgba(255, 207, 92, .12);
}

.ysw-unit.is-targetable {
  border-color: rgba(216, 246, 87, .72);
  box-shadow:
    0 0 0 1px rgba(216, 246, 87, .26),
    0 0 22px rgba(216, 246, 87, .16);
  cursor: pointer;
}

.ysw-unit.is-targetable .ysw-state-badge {
  background: rgba(216, 246, 87, .18);
  border-color: rgba(216, 246, 87, .46);
  color: #f0ff8a;
}

.ysw-enemy-unit small {
  color: #cfe8f0;
  font-size: 11px;
  font-weight: 900;
}

.ysw-enemy-unit strong {
  color: #ffffff;
  line-height: 1.2;
}

.ysw-enemy-unit p {
  color: #d4e3ea;
  font-size: 12px;
  max-height: 34px;
  overflow: auto;
  margin: 0;
}

.ysw-enemy-unit em {
  background: rgba(255, 207, 92, .16);
  border: 1px solid rgba(255, 207, 92, .34);
  border-radius: 999px;
  color: #ffe7a6;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  padding: 5px 8px;
  position: absolute;
  right: 8px;
  top: 8px;
}

.ysw-enemy-unit.has-image {
  background: #07111e;
}

.ysw-enemy-unit.has-image .ysw-card-visual {
  border-radius: inherit;
  height: 100%;
  inset: 0;
  margin: 0;
  min-height: 0;
  position: absolute;
  z-index: 0;
}

.ysw-enemy-unit.has-image .ysw-card-visual::after {
  background:
    linear-gradient(180deg, rgba(5, 10, 18, .1) 0%, rgba(5, 10, 18, .38) 50%, rgba(5, 10, 18, .86) 100%),
    linear-gradient(90deg, rgba(5, 10, 18, .42), transparent 42%, rgba(5, 10, 18, .18));
}

.ysw-enemy-unit.has-image > :not(.ysw-card-visual):not(.ysw-card-feedbacks) {
  position: relative;
  z-index: 1;
}

.ysw-board-wrap {
  background:
    linear-gradient(90deg, rgba(36, 210, 255, .1), transparent 46%, rgba(255, 92, 138, .1)),
    rgba(6, 12, 20, .62);
  border: 1px solid rgba(160, 209, 225, .17);
  border-radius: 8px;
  min-height: 142px;
  padding: 9px 10px;
}

.ysw-enemy-card-stage,
.ysw-player-burst {
  align-items: center;
  display: flex;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.ysw-enemy-card-stage {
  inset: 24px 24px auto;
}

.ysw-enemy-card {
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, .28), transparent 30%),
    linear-gradient(150deg, rgba(12, 20, 32, .98), rgba(30, 17, 42, .96));
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 34px rgba(255, 92, 138, .24);
  color: #ffffff;
  display: grid;
  gap: 8px;
  max-width: 340px;
  min-height: 178px;
  overflow: hidden;
  padding: 18px;
  position: relative;
  width: min(100%, 340px);
  animation: yswEnemyCard 3000ms cubic-bezier(.2, .8, .2, 1) both;
}

.ysw-enemy-card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  content: "";
  height: 100%;
  left: -90%;
  position: absolute;
  top: 0;
  transform: skewX(-18deg);
  width: 52%;
  animation: yswCardSheen 980ms ease-out both;
  z-index: 3;
}

.ysw-enemy-card > .ysw-enemy-card-art {
  height: 100%;
  inset: 0 0 0 auto;
  object-fit: cover;
  opacity: .22;
  position: absolute;
  width: 48%;
  z-index: 0;
}

.ysw-enemy-card > *:not(.ysw-enemy-card-art) {
  position: relative;
  z-index: 1;
}

.ysw-enemy-card--action-art {
  background:
    linear-gradient(115deg, rgba(5, 9, 16, .96) 0%, rgba(7, 13, 22, .88) 44%, rgba(12, 8, 19, .72) 100%),
    linear-gradient(150deg, rgba(12, 20, 32, .98), rgba(30, 17, 42, .96));
}

.ysw-enemy-card--action-art::after {
  background:
    radial-gradient(circle at 14% 20%, rgba(36, 210, 255, .2), transparent 36%),
    linear-gradient(90deg, rgba(4, 8, 14, .92) 0%, rgba(4, 8, 14, .76) 48%, rgba(4, 8, 14, .34) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.ysw-enemy-card--action-art > .ysw-enemy-card-art {
  filter: contrast(1.08) saturate(1.08);
  inset: 0;
  opacity: .66;
  width: 100%;
}

.ysw-enemy-card--action-art > *:not(.ysw-enemy-card-art) {
  z-index: 2;
}

.ysw-enemy-card small {
  color: #cfe8f0;
  font-size: 12px;
  font-weight: 800;
}

.ysw-enemy-card strong {
  font-size: 22px;
  line-height: 1.2;
}

.ysw-enemy-card p {
  color: #dbe8ee;
  margin: 0;
}

.ysw-enemy-chip {
  align-self: start;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  justify-self: start;
  padding: 5px 8px;
}

.ysw-enemy-tone-pink {
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 38px rgba(255, 92, 138, .38);
}

.ysw-enemy-tone-gold,
.ysw-enemy-tone-orange {
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 38px rgba(255, 207, 92, .36);
}

.ysw-enemy-tone-blue,
.ysw-enemy-tone-cyan,
.ysw-enemy-tone-steel {
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 38px rgba(36, 210, 255, .36);
}

.ysw-enemy-tone-green {
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 38px rgba(69, 255, 166, .36);
}

.ysw-enemy-tone-violet {
  box-shadow: 0 22px 58px rgba(0, 0, 0, .42), 0 0 38px rgba(183, 112, 255, .38);
}

.ysw-player-burst {
  inset: auto 24px 242px;
}

.ysw-player-burst span {
  background: linear-gradient(90deg, #24d2ff, #d8f657);
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(216, 246, 87, .38);
  color: #08131b;
  font-weight: 950;
  padding: 10px 18px;
  animation: yswPlayerBurst 620ms ease-out both;
}

.ysw-gears {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.ysw-board {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 8px;
  min-height: 88px;
}

.ysw-board > p {
  align-self: center;
  color: #9fb7c4;
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.ysw-unit {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #eef7ff;
  display: grid;
  gap: 4px;
  grid-template-rows: auto auto 1fr auto;
  min-height: 138px;
  padding: 7px;
  position: relative;
  text-align: left;
}

.ysw-unit .ysw-card-visual {
  height: 54px;
  margin: -2px -2px 2px;
}

.ysw-unit.can-attack {
  border-color: rgba(216, 246, 87, .62);
  box-shadow: 0 0 0 1px rgba(216, 246, 87, .18);
}

.ysw-unit.is-selected {
  border-color: rgba(255, 207, 92, .76);
  box-shadow: 0 0 0 2px rgba(255, 207, 92, .22), 0 0 26px rgba(255, 207, 92, .18);
}

.ysw-unit > small {
  color: #d8f657;
  font-weight: 800;
}

.ysw-unit-stats {
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.ysw-unit-stats b {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  color: #ffffff;
  display: grid;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  padding: 5px 4px;
  text-align: center;
}

.ysw-unit-stats b:first-child {
  border-color: rgba(255, 207, 92, .32);
}

.ysw-unit-stats b:last-child {
  border-color: rgba(36, 210, 255, .32);
}

.ysw-unit-stats small {
  color: #9fb7c4;
  font-size: 10px;
  font-weight: 950;
  margin-bottom: 3px;
}

.ysw-hand {
  display: flex;
  flex: 0 0 178px;
  gap: 8px;
  margin-top: 8px;
  min-height: 178px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.ysw-hand-card {
  flex: 0 0 150px;
  display: grid;
  gap: 4px;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 170px;
  padding: 7px;
  position: relative;
  text-align: left;
}

.ysw-hand-card .ysw-card-visual {
  height: 52px;
  margin: -2px -2px 4px;
}

.ysw-hand-card .ysw-cost {
  position: absolute;
  right: 8px;
  top: 8px;
}

.ysw-hand-card strong {
  font-size: 13px;
  line-height: 1.2;
  padding-right: 34px;
}

.ysw-hand-card p {
  font-size: 11px;
  line-height: 1.35;
  max-height: 34px;
  overflow: auto;
}

.ysw-hand-stats {
  align-self: end;
}

.ysw-hand-card em {
  align-self: end;
  background: rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: #ffffff;
  font-style: normal;
  font-weight: 900;
  justify-self: start;
  padding: 4px 8px;
}

.ysw-battle-footer {
  align-items: stretch;
  grid-template-columns: 1fr auto;
  margin-top: 8px;
}

.ysw-log {
  background: rgba(6, 12, 20, .7);
  border: 1px solid rgba(160, 209, 225, .17);
  border-radius: 8px;
  max-height: 78px;
  min-height: 70px;
  overflow: auto;
  padding: 8px 10px;
}

.ysw-log p + p {
  margin-top: 3px;
}

.ysw-battle-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 150px;
}

.ysw-burst-button {
  background: linear-gradient(90deg, #24d2ff, #d8f657);
  border: 0;
  border-radius: 8px;
  color: #07111b;
  cursor: pointer;
  font-weight: 950;
  padding: 10px 12px;
}

.ysw-burst-button:disabled {
  cursor: not-allowed;
  filter: grayscale(.75);
  opacity: .45;
}

.ysw-burst-button.is-unavailable {
  filter: grayscale(.35);
  opacity: .78;
}

.ysw-burst-button.is-selected {
  box-shadow:
    0 0 0 2px rgba(216, 246, 87, .55),
    0 0 18px rgba(216, 246, 87, .24);
  filter: saturate(1.12);
}

.ysw-result {
  align-items: center;
  background: rgba(4, 8, 14, .74);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: absolute;
  z-index: 80;
}

.ysw-result > div {
  background: #0b1420;
  border: 1px solid rgba(216, 246, 87, .42);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .38);
  display: grid;
  gap: 14px;
  max-height: min(86vh, 760px);
  max-width: 680px;
  overflow: auto;
  padding: 24px;
  position: relative;
  z-index: 81;
  width: min(100%, 680px);
}

.ysw-result p {
  color: #d8f657;
  font-weight: 900;
  margin: 0;
}

.ysw-rewards.big span {
  border-radius: 8px;
  font-size: 14px;
}

.ysw-unlock-section {
  display: grid;
  gap: 8px;
}

.ysw-unlock-section > small {
  color: #d8f657;
  font-size: 12px;
  font-weight: 950;
}

.ysw-unlock-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.ysw-unlock-card {
  background: rgba(9, 18, 30, .86);
  border: 1px solid rgba(160, 209, 225, .2);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
}

.ysw-unlock-image {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(36, 210, 255, .22), rgba(216, 246, 87, .12)),
    #07111e;
  border-radius: 6px;
  display: block;
  overflow: hidden;
  position: relative;
}

.ysw-unlock-image::after {
  background: linear-gradient(180deg, transparent 52%, rgba(6, 12, 20, .55));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.ysw-unlock-image img {
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  width: 100%;
}

.ysw-unlock-card-leader .ysw-unlock-image img {
  object-position: center 20%;
}

.ysw-unlock-card-unit .ysw-unlock-image img {
  object-position: center 16%;
}

.ysw-unlock-card b {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ysw-unlock-card em {
  color: #a9c1cd;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.ysw-save,
.ysw-settings,
.ysw-info {
  grid-template-columns: 1fr 1fr;
}

.ysw-audio-panel,
.ysw-fullscreen-panel {
  grid-column: 1 / -1;
}

.ysw-reset-panel {
  grid-column: 1 / -1;
}

.ysw-audio-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.ysw-audio-row label {
  flex: 1 1 260px;
}

.ysw-audio-row input {
  flex: 1;
  min-width: 160px;
  width: auto;
}

.ysw-credits {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ysw-credits span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #d9e7ee;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
}

.ysw-credits a {
  color: #d8f657;
  text-decoration: none;
}

.ysw-credits a:hover {
  text-decoration: underline;
}

.ysw-save-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.ysw-info-intro {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 20px;
}

.ysw-info-intro h1 {
  font-size: 32px;
  line-height: 1.2;
}

.ysw-info-grid {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ysw-info-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.ysw-info-panel h3 {
  color: var(--ysw-lime);
  font-family: var(--ysw-font-display);
  font-size: 22px;
  line-height: 1.2;
}

.ysw-info-panel dl {
  display: grid;
  gap: 10px;
}

.ysw-info-credit-row {
  display: grid;
  gap: 4px;
}

.ysw-info-credit-row dt {
  color: #8ddcf3;
  font-size: 12px;
  font-weight: 950;
}

.ysw-info-credit-row dd {
  color: #eef8ff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.ysw-info-credit-row a {
  color: #d8f657;
  text-decoration: none;
}

.ysw-info-credit-row a:hover {
  text-decoration: underline;
}

@media (max-width: 780px) {
  .ysw-info-grid {
    grid-template-columns: 1fr;
  }
}

.ysw-gallery-intro {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.ysw-gallery-intro h3 {
  margin-top: 4px;
}

.ysw-gallery-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.ysw-gallery-stats span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #9fb7c4;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 3px;
  padding: 9px 10px;
}

.ysw-gallery-stats strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
}

.ysw-gallery-section {
  display: grid;
  gap: 10px;
}

.ysw-gallery-section h4 {
  color: #d8f657;
  font-size: 15px;
  margin: 4px 0 0;
}

.ysw-gallery-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ysw-gallery-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 390px;
  overflow: hidden;
  padding: 12px;
}

.ysw-gallery-thumb {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(36, 210, 255, .24), rgba(255, 92, 138, .14)),
    #07111e;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.ysw-gallery-thumb::after {
  background:
    linear-gradient(180deg, rgba(3, 8, 14, .02), rgba(3, 8, 14, .7)),
    linear-gradient(90deg, rgba(216, 246, 87, .14), transparent 38%, rgba(36, 210, 255, .12));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.ysw-gallery-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  width: 100%;
}

.ysw-gallery-status {
  background: rgba(5, 10, 18, .74);
  border: 1px solid rgba(216, 246, 87, .36);
  border-radius: 999px;
  color: #d8f657;
  font-size: 11px;
  font-weight: 950;
  left: 10px;
  padding: 5px 8px;
  position: absolute;
  top: 10px;
  z-index: 2;
}

.ysw-gallery-card-body {
  display: grid;
  gap: 8px;
}

.ysw-gallery-card small {
  color: #87dfff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.ysw-gallery-card h3 {
  font-size: 20px;
}

.ysw-gallery-card p {
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.65;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ysw-gallery-card .ysw-secondary {
  margin-top: auto;
  width: 100%;
}

.ysw-character-intro {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px;
}

.ysw-character-intro h3 {
  margin-top: 4px;
}

.ysw-character-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.ysw-character-stats span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #9fb7c4;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 3px;
  padding: 9px 10px;
}

.ysw-character-stats strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
}

.ysw-character-section {
  display: grid;
  gap: 10px;
}

.ysw-character-section h4 {
  color: #d8f657;
  font-size: 15px;
  margin: 4px 0 0;
}

.ysw-character-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ysw-character-card {
  display: grid;
  grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
  min-height: 300px;
  overflow: hidden;
}

.ysw-character-portrait {
  background:
    linear-gradient(135deg, rgba(36, 210, 255, .28), rgba(255, 92, 138, .16)),
    #07111e;
  min-height: 300px;
  overflow: hidden;
  position: relative;
}

.ysw-character-portrait::after {
  background:
    linear-gradient(180deg, rgba(3, 8, 14, .02), rgba(3, 8, 14, .28)),
    linear-gradient(90deg, rgba(3, 8, 14, .08), transparent 54%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.ysw-character-portrait img {
  display: block;
  filter: none;
  height: 100%;
  opacity: 1;
  object-fit: cover;
  object-position: center 18%;
  position: absolute;
  width: 100%;
}

.ysw-character-portrait span {
  background: rgba(5, 10, 18, .78);
  border: 1px solid rgba(216, 246, 87, .38);
  border-radius: 999px;
  color: #d8f657;
  font-size: 11px;
  font-weight: 950;
  left: 10px;
  padding: 5px 8px;
  position: absolute;
  top: 10px;
  z-index: 2;
}

.ysw-character-true-boss {
  border-color: rgba(255, 92, 138, .46);
}

.ysw-character-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}

.ysw-character-body small {
  color: #87dfff;
  display: block;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.ysw-character-card h3 {
  font-size: 20px;
}

.ysw-character-body > strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.45;
}

.ysw-character-card p {
  font-size: 13px;
  line-height: 1.7;
}

.ysw-character-meta,
.ysw-character-voices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ysw-character-meta span {
  background: rgba(36, 210, 255, .11);
  border: 1px solid rgba(36, 210, 255, .24);
  border-radius: 999px;
  color: #dffbff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.ysw-character-voices {
  margin-top: auto;
}

.ysw-character-voice {
  flex: 1 1 76px;
  min-height: 36px;
  padding: 8px 10px;
}

.ysw-glossary-intro {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.ysw-glossary-section {
  display: grid;
  gap: 10px;
}

.ysw-glossary-section h4 {
  color: #d8f657;
  font-size: 15px;
  margin: 4px 0 0;
}

.ysw-glossary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ysw-glossary-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.ysw-glossary-card div {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ysw-glossary-card strong {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
}

.ysw-glossary-card span {
  color: #87dfff;
  font-size: 12px;
  font-weight: 900;
}

.ysw-glossary-card p {
  line-height: 1.7;
}

.ysw-save-panel textarea {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #eef7ff;
  min-height: 150px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.ysw-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ysw-message {
  background: rgba(216, 246, 87, .12);
  border: 1px solid rgba(216, 246, 87, .24);
  border-radius: 8px;
  padding: 10px;
}

.ysw-shell:fullscreen .ysw-battle,
.ysw-game:fullscreen .ysw-battle {
  height: calc(100svh - 76px);
}

.ysw-game:fullscreen .ysw-title-screen,
.ysw-game:fullscreen .ysw-opening,
.ysw-game:fullscreen .ysw-story-screen,
.ysw-game:fullscreen .ysw-end-roll {
  min-height: auto;
}

.ysw-game:fullscreen .ysw-title-screen {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .72fr);
}

.ysw-game:fullscreen .ysw-title-city,
.ysw-game:fullscreen .ysw-opening-stage,
.ysw-game:fullscreen .ysw-opening-city {
  min-height: 0;
}

.ysw-game:fullscreen .ysw-title-city {
  height: clamp(440px, 62vh, 680px);
}

.ysw-game:fullscreen .ysw-opening-stage {
  height: 100%;
}

.ysw-game:fullscreen .ysw-end-roll-stage {
  height: 100%;
  min-height: 0;
}

.ysw-game:fullscreen .ysw-opening > .ysw-cinematic-actions {
  right: 28px;
  top: 28px;
}

@keyframes yswTitleCamera {
  from {
    transform: scale(1.012) translate3d(-4px, 0, 0);
  }
  to {
    transform: scale(1.055) translate3d(8px, -4px, 0);
  }
}

@keyframes yswTitleRotate {
  0%,
  17% {
    opacity: 1;
  }
  23%,
  94% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes yswTitleSweep {
  0%,
  18% {
    opacity: 0;
    transform: translateX(-34%);
  }
  42% {
    opacity: .7;
  }
  72%,
  100% {
    opacity: 0;
    transform: translateX(34%);
  }
}

@keyframes yswOpeningAccent {
  0%,
  100% {
    opacity: .09;
    transform: scale(1.04);
  }
  45% {
    opacity: .2;
    transform: scale(1.075) translate3d(-6px, -4px, 0);
  }
}

@keyframes yswOpeningScan {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  18%,
  76% {
    opacity: .72;
  }
  100% {
    opacity: 0;
    transform: translateY(620px);
  }
}

@keyframes yswOpeningShot {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  16%,
  74% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes yswOpeningFirstShot {
  0%,
  74% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes yswOpeningLastShot {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  16%,
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes yswOpeningStillMotion {
  from {
    transform: scale(1.018) translate3d(0, 0, 0);
  }
  to {
    transform: scale(var(--opening-end-scale, 1.042)) translate3d(var(--opening-end-x, 5px), var(--opening-end-y, -3px), 0);
  }
}

@keyframes yswOpeningNoise {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(8px);
  }
}

@keyframes yswOpeningData {
  0%,
  100% {
    opacity: .18;
    transform: translateY(8px);
  }
  30%,
  68% {
    opacity: .88;
    transform: translateY(0);
  }
}

@media (min-width: 1500px) and (min-height: 900px) {
  .ysw-shell {
    max-width: 1320px;
    min-height: 820px;
  }

  .ysw-battle {
    height: 744px;
    padding: 14px 18px;
  }

  .ysw-boss-leader {
    min-height: 136px;
    padding-left: 124px;
  }

  .ysw-leader-portrait {
    width: 112px;
  }

  .ysw-unit .ysw-card-visual,
  .ysw-hand-card .ysw-card-visual {
    height: 78px;
  }

  .ysw-unit {
    min-height: 168px;
  }

  .ysw-hand-card {
    flex-basis: 176px;
    min-height: 206px;
  }

  .ysw-log {
    max-height: 98px;
    min-height: 88px;
  }
}

@media (max-height: 960px) and (min-width: 821px) {
  .ysw-battle {
    padding: 6px 12px;
  }

  .ysw-battle .ysw-tutorial-panel {
    gap: 3px;
    margin-bottom: 4px;
    padding: 6px 8px;
  }

  .ysw-battle .ysw-tutorial-panel strong {
    font-size: 14px;
  }

  .ysw-battle .ysw-tutorial-panel p {
    font-size: 11px;
    line-height: 1.32;
  }

  .ysw-combatants {
    flex-basis: 112px;
    gap: 6px;
    margin-bottom: 6px;
    overflow: hidden;
  }

  .ysw-leader {
    min-height: 0;
    overflow: hidden;
    padding: 7px 9px;
  }

  .ysw-boss-leader {
    min-height: 86px;
    padding-left: 78px;
  }

  .ysw-leader-portrait {
    width: 70px;
  }

  .ysw-leader small {
    font-size: 11px;
    margin-top: 3px;
    min-height: 0;
  }

  .ysw-pp-display {
    margin-top: 4px;
    padding: 4px 8px;
  }

  .ysw-pp-display strong {
    font-size: 24px;
  }

  .ysw-special-gauge {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-top: 5px;
    padding: 3px 6px;
  }

  .ysw-enemy-board-wrap {
    flex-basis: 112px;
    margin-bottom: 6px;
    overflow: hidden;
    padding: 6px 8px;
  }

  .ysw-enemy-board-head {
    margin-bottom: 4px;
  }

  .ysw-enemy-board {
    gap: 6px;
    height: 64px;
    min-height: 62px;
    overflow: hidden;
  }

  .ysw-enemy-unit {
    height: 64px;
    min-height: 0;
    overflow: hidden;
    padding: 5px;
  }

  .ysw-enemy-unit p {
    display: none;
  }

  .ysw-board-wrap {
    flex: 0 0 116px;
    min-height: 108px;
    overflow: hidden;
    padding: 6px 8px;
  }

  .ysw-gears {
    max-height: 18px;
    min-height: 18px;
    overflow: hidden;
  }

  .ysw-board {
    gap: 6px;
    height: 70px;
    margin-top: 5px;
    min-height: 70px;
    overflow: hidden;
  }

  .ysw-unit {
    gap: 3px;
    grid-template-rows: auto auto auto;
    height: 70px;
    min-height: 0;
    overflow: hidden;
    padding: 5px;
  }

  .ysw-unit .ysw-card-visual {
    height: 30px;
  }

  .ysw-unit p {
    display: none;
  }

  .ysw-hand {
    flex-basis: 116px;
    margin-top: 6px;
    min-height: 116px;
  }

  .ysw-hand-card {
    flex-basis: 132px;
    grid-template-rows: auto auto 1fr auto;
    min-height: 116px;
  }

  .ysw-hand-card .ysw-card-visual {
    height: 34px;
  }

  .ysw-hand-card p {
    display: none;
  }

  .ysw-battle-footer {
    flex-basis: 50px;
    grid-template-columns: 1fr minmax(300px, 360px);
    margin-top: 6px;
    overflow: hidden;
  }

  .ysw-log {
    max-height: 44px;
    min-height: 42px;
    padding: 6px 8px;
  }

  .ysw-battle-actions {
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .ysw-battle-actions button {
    font-size: 11px;
    min-height: 30px;
    padding: 6px 8px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .ysw-orientation-hint {
    align-items: center;
    background: rgba(216, 246, 87, .12);
    border: 1px solid rgba(216, 246, 87, .28);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    margin: 10px 16px 0;
    padding: 12px;
    position: relative;
    z-index: 2;
  }

  .ysw-orientation-hint strong {
    color: #ffffff;
    font-size: 18px;
  }

  .ysw-orientation-hint span {
    color: #d9e7ee;
    font-size: 13px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell {
    border: 0;
    border-radius: 0;
    margin: 0;
    max-width: none;
    min-height: 100svh;
  }

  .ysw-topbar {
    min-height: 54px;
    padding: 6px 8px;
  }

  .ysw-kicker {
    display: none;
  }

  .ysw-topbar h2 {
    font-size: 17px;
  }

  .ysw-tabs {
    gap: 2px;
    padding: 3px;
  }

  .ysw-tabs button {
    min-height: 34px;
    padding: 6px 8px;
  }

  .ysw-battle {
    height: calc(100svh - 54px);
    padding: 6px 8px;
  }

  .ysw-combatants {
    grid-template-columns: .78fr 1fr;
    margin-bottom: 5px;
  }

  .ysw-leader {
    padding: 7px 8px;
  }

  .ysw-boss-leader {
    min-height: 78px;
    padding-left: 72px;
  }

  .ysw-leader-portrait {
    width: 64px;
  }

  .ysw-leader small {
    display: none;
  }

  .ysw-pp-display {
    margin-top: 4px;
    padding: 4px 7px;
  }

  .ysw-pp-display strong {
    font-size: 24px;
  }

  .ysw-enemy-board-wrap,
  .ysw-board-wrap {
    padding: 6px;
  }

  .ysw-enemy-board-head small,
  .ysw-enemy-unit p {
    display: none;
  }

  .ysw-enemy-unit {
    min-height: 74px;
  }

  .ysw-board-wrap {
    min-height: 104px;
  }

  .ysw-unit {
    min-height: 102px;
    padding: 5px;
  }

  .ysw-unit .ysw-card-visual,
  .ysw-hand-card .ysw-card-visual {
    height: 34px;
  }

  .ysw-hand-card {
    flex-basis: 128px;
    min-height: 132px;
  }

  .ysw-hand-card p {
    display: none;
  }

  .ysw-battle-footer {
    grid-template-columns: 1fr 116px;
  }

  .ysw-log {
    max-height: 54px;
    min-height: 50px;
  }

  .ysw-log p {
    font-size: 11px;
  }
}

/* Battle balance effects: short cut-ins, hit/vanish feedback, and full-gauge emphasis. */
.ysw-card-table .ysw-special-gauge.is-full {
  border-color: rgba(216, 246, 87, .92);
  box-shadow:
    0 0 0 1px rgba(216, 246, 87, .42),
    0 0 18px rgba(216, 246, 87, .36),
    inset 0 0 18px rgba(255, 255, 255, .12);
  animation: yswGaugeFullPulse 960ms ease-in-out infinite alternate;
}

.ysw-card-table .ysw-special-threat.is-full {
  border-color: rgba(255, 116, 145, .9);
  box-shadow:
    0 0 0 1px rgba(255, 116, 145, .38),
    0 0 20px rgba(255, 92, 138, .38),
    inset 0 0 18px rgba(255, 255, 255, .12);
}

.ysw-battle-cutin {
  align-items: center;
  background: linear-gradient(90deg, rgba(2, 6, 12, .04), rgba(2, 6, 12, .46), rgba(2, 6, 12, .04));
  display: flex;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: fixed;
  z-index: 30;
}

.ysw-battle-cutin > div {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(8, 15, 27, .92), rgba(18, 28, 42, .72)),
    radial-gradient(circle at 20% 50%, rgba(36, 210, 255, .24), transparent 44%);
  border: 1px solid rgba(216, 246, 87, .48);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .46), 0 0 36px rgba(36, 210, 255, .28);
  display: grid;
  gap: 2px 16px;
  grid-template-columns: 86px minmax(220px, 420px);
  max-width: min(92%, 620px);
  min-height: 96px;
  overflow: hidden;
  padding: 10px 20px 10px 10px;
  transform-origin: center;
  animation: yswBattleCutinPlayer 2200ms cubic-bezier(.16, .84, .18, 1) both;
}

.ysw-battle-cutin img {
  border-radius: 6px;
  grid-row: 1 / span 2;
  height: 82px;
  object-fit: cover;
  object-position: center 28%;
  width: 82px;
}

.ysw-battle-cutin span {
  color: #d8f657;
  font-size: 12px;
  font-weight: 950;
}

.ysw-battle-cutin strong {
  color: #ffffff;
  font-size: clamp(22px, 2.7vw, 38px);
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(36, 210, 255, .24);
}

.ysw-cutin-boss > div {
  background:
    linear-gradient(120deg, rgba(24, 7, 18, .94), rgba(32, 18, 42, .74)),
    radial-gradient(circle at 20% 50%, rgba(255, 92, 138, .22), transparent 44%);
  border-color: rgba(255, 116, 145, .54);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 42px rgba(255, 92, 138, .26);
  animation-name: yswBattleCutinBoss;
}

.ysw-battle-effect {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.ysw-battle-effect::before {
  background:
    radial-gradient(circle, rgba(255, 255, 255, .55), transparent 9%),
    radial-gradient(circle, rgba(36, 210, 255, .26), transparent 38%);
  content: "";
  height: 240px;
  max-height: 46%;
  max-width: 46%;
  width: 240px;
  animation: yswHitFlash 1400ms ease-out both;
  animation-delay: var(--ysw-feedback-delay, 0ms);
}

.ysw-battle-effect span {
  color: #ffffff;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0;
  position: absolute;
  text-shadow: 0 0 18px rgba(36, 210, 255, .72), 0 2px 10px rgba(0, 0, 0, .8);
  animation: yswEffectText 1400ms ease-out both;
  animation-delay: var(--ysw-feedback-delay, 0ms);
}

.ysw-battle-effect:not(.ysw-effect-hit) {
  left: clamp(160px, 42%, 720px);
  right: clamp(120px, 20%, 360px);
}

.ysw-effect-hit span {
  font-size: clamp(34px, 4.4vw, 58px);
}

.ysw-effect-vanish::before {
  background:
    repeating-linear-gradient(90deg, rgba(216, 246, 87, .22) 0 3px, transparent 3px 11px),
    radial-gradient(circle, rgba(36, 210, 255, .2), transparent 44%);
  filter: blur(.2px);
}

.ysw-card-table .ysw-leader {
  overflow: visible;
  position: relative;
}

.ysw-card-table .ysw-boss-leader {
  overflow: visible;
}

.ysw-burst-count {
  align-items: center;
  background: rgba(12, 24, 33, .8);
  border: 1px solid rgba(216, 246, 87, .34);
  border-radius: 999px;
  box-shadow: inset 0 0 12px rgba(216, 246, 87, .08);
  color: #d8f657;
  display: inline-flex;
  gap: 3px;
  margin-top: 5px;
  padding: 3px 9px;
  width: fit-content;
}

.ysw-burst-count span,
.ysw-burst-count em {
  color: inherit;
  display: inline;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.ysw-burst-count strong {
  color: #ffffff;
  display: inline;
  font-size: 16px;
  line-height: 1;
}

.ysw-card-table .ysw-hp-meter {
  overflow: visible;
  position: relative;
}

.ysw-hp-feedbacks {
  inset: auto auto calc(100% + 3px) 50%;
  min-width: 360px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  z-index: 18;
}

.ysw-hp-feedback {
  animation: yswHpFeedback 1700ms ease-out both;
  color: #fff5f7;
  display: block;
  font-size: clamp(116px, 12vw, 210px);
  font-weight: 950;
  line-height: .76;
  margin-top: calc(var(--ysw-feedback-index, 0) * 12px);
  paint-order: stroke fill;
  -webkit-text-fill-color: #fff5f7;
  -webkit-text-stroke: 3px rgba(255, 48, 96, .96);
  text-shadow:
    0 0 16px rgba(255, 72, 112, .98),
    0 0 42px rgba(255, 72, 112, .72),
    0 5px 16px rgba(5, 12, 24, .82);
}

.ysw-hp-feedback-damage {
  color: #fff5f7;
  -webkit-text-fill-color: #fff5f7;
  -webkit-text-stroke-color: rgba(255, 48, 96, .96);
}

.ysw-hp-feedback-heal {
  color: #f0fff8;
  -webkit-text-fill-color: #f0fff8;
  -webkit-text-stroke-color: rgba(48, 232, 158, .96);
  text-shadow:
    0 0 16px rgba(105, 240, 196, .96),
    0 0 42px rgba(105, 240, 196, .68),
    0 5px 16px rgba(5, 12, 24, .82);
}

.ysw-hp-feedback-static {
  animation: none;
  opacity: .94;
  transform: translateY(-24px) scale(1.04);
}

.ysw-card-feedbacks {
  align-items: center;
  display: grid;
  inset: 0;
  justify-content: center;
  place-items: center;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

.ysw-card-feedback {
  animation: yswCardFeedback 1800ms ease-out both;
  color: #fff5f7;
  display: block;
  font-size: clamp(48px, 5vw, 88px);
  font-style: normal;
  font-weight: 950;
  grid-area: 1 / 1;
  line-height: .8;
  margin-top: calc(var(--ysw-card-feedback-index, 0) * 20px);
  paint-order: stroke fill;
  -webkit-text-fill-color: #fff5f7;
  -webkit-text-stroke: 2px rgba(255, 48, 96, .98);
  text-shadow:
    0 0 14px rgba(255, 72, 112, .9),
    0 0 30px rgba(255, 72, 112, .56),
    0 4px 12px rgba(3, 8, 16, .85);
}

.ysw-card-feedback-delayed {
  animation-delay: 720ms;
}

.ysw-card-feedback-static {
  animation: none;
  opacity: .92;
  transform: translateY(-12px) scale(1.03);
}

.ysw-card-feedback-heal {
  color: #f0fff8;
  -webkit-text-fill-color: #f0fff8;
  -webkit-text-stroke-color: rgba(48, 232, 158, .96);
  text-shadow:
    0 0 14px rgba(105, 240, 196, .92),
    0 0 30px rgba(105, 240, 196, .58),
    0 4px 12px rgba(3, 8, 16, .85);
}

.ysw-card-feedback-action {
  background: linear-gradient(90deg, rgba(36, 210, 255, .86), rgba(216, 246, 87, .92));
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(36, 210, 255, .46), 0 0 28px rgba(216, 246, 87, .24);
  color: #07101c;
  font-size: clamp(19px, 2vw, 30px);
  letter-spacing: 0;
  min-width: 116px;
  padding: 10px 16px;
  text-align: center;
  -webkit-text-fill-color: #07101c;
  -webkit-text-stroke: 0 transparent;
  text-shadow: none;
}

@keyframes yswCardFeedback {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(.86);
  }
  16%,
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-52px) scale(1.14);
  }
}

@keyframes yswHpFeedback {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(.86);
  }
  18%,
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-48px) scale(1.12);
  }
}

@keyframes yswGaugeFullPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.22); }
}

@keyframes yswBattleCutinPlayer {
  0% {
    opacity: 0;
    transform: translateX(-110vw) skewX(-8deg) scale(.98);
  }
  10% {
    opacity: 1;
    transform: translateX(0) skewX(0) scale(1);
  }
  62% {
    opacity: 1;
    transform: translateX(0) skewX(0) scale(1);
  }
  84% {
    opacity: 1;
    transform: translateX(110vw) skewX(7deg) scale(.99);
  }
  100% {
    opacity: 0;
    transform: translateX(110vw) skewX(7deg) scale(.99);
  }
}

@keyframes yswBattleCutinBoss {
  0% {
    opacity: 0;
    transform: translateX(110vw) skewX(8deg) scale(.98);
  }
  10% {
    opacity: 1;
    transform: translateX(0) skewX(0) scale(1);
  }
  62% {
    opacity: 1;
    transform: translateX(0) skewX(0) scale(1);
  }
  84% {
    opacity: 1;
    transform: translateX(-110vw) skewX(-7deg) scale(.99);
  }
  100% {
    opacity: 0;
    transform: translateX(-110vw) skewX(-7deg) scale(.99);
  }
}

@keyframes yswHitFlash {
  0% {
    opacity: 0;
    transform: scale(.35);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}

@keyframes yswEffectText {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(.92);
  }
  25%,
  65% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(1.04);
  }
}

/* Final PC battle/deck trim. This must stay after legacy responsive blocks. */
@media (min-width: 941px) {
  .ysw-card-table {
    gap: 6px;
    padding: 8px 12px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 6px;
  }

  .ysw-card-table .ysw-board-wrap {
    min-height: 166px;
  }

  .ysw-card-table .ysw-enemy-board-wrap {
    min-height: 108px;
  }

  .ysw-card-table .ysw-hand {
    flex: 0 0 124px;
    min-height: 124px;
  }

  .ysw-card-table .ysw-hand-card {
    flex: 0 0 112px;
    height: 118px;
    min-height: 0;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    bottom: 5px;
    font-size: 10px;
    height: 22px;
    width: 22px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    font-size: 4.5px;
  }

  .ysw-card-table .ysw-hand-card .ysw-atk-badge {
    left: 6px;
  }

  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    right: 6px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 29px;
    gap: 2px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags i {
    font-size: 7px;
    padding: 1px 3px;
  }

  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 13px;
    height: 24px;
    right: 6px;
    top: 6px;
    width: 24px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 11px;
    line-height: 1.15;
    min-height: 28px;
    padding: 6px 25px 6px 7px;
  }

  .ysw-deck-builder .ysw-deck-filters {
    align-items: end;
    gap: 8px;
  }

  .ysw-deck-builder .ysw-deck-filters label {
    flex: 0 1 170px;
    font-size: 11px;
    gap: 4px;
  }

  .ysw-deck-builder .ysw-deck-filters select {
    font-size: 12px;
    height: 32px;
    min-height: 32px;
    padding: 5px 8px;
  }
}

/* v2 final polish: keep card art visible and deck controls compact */
.ysw-card-table .ysw-stat-badge {
  border-width: 1px;
  bottom: 7px;
  font-size: 12px;
  height: 27px;
  line-height: 1;
  width: 27px;
}

.ysw-card-table .ysw-stat-badge small {
  font-size: 5px;
  line-height: 1;
  margin-bottom: 0;
}

.ysw-card-table .ysw-hand-card .ysw-stat-badge {
  bottom: 6px;
  font-size: 11px;
  height: 24px;
  width: 24px;
}

.ysw-card-table .ysw-hand-card .ysw-stat-badge small {
  font-size: 5px;
}

.ysw-card-table .ysw-hand-card .ysw-atk-badge {
  left: 7px;
}

.ysw-card-table .ysw-hand-card .ysw-hp-badge {
  right: 7px;
}

.ysw-card-table .ysw-hand-card .ysw-role-tags {
  bottom: 33px;
  gap: 2px;
}

.ysw-card-table .ysw-hand-card .ysw-role-tags i {
  border-radius: 7px;
  font-size: 7px;
  padding: 2px 4px;
}

.ysw-card-table .ysw-hand-card strong {
  font-size: 12px;
  line-height: 1.18;
  padding-right: 26px;
}

.ysw-card-table .ysw-hand-card small {
  font-size: 9px;
}

.ysw-card-table .ysw-hand-card .ysw-cost {
  height: 26px;
  width: 26px;
}

.ysw-card-table .ysw-unit,
.ysw-card-table .ysw-enemy-unit {
  overflow: hidden;
}

.ysw-card-table .ysw-unit .ysw-card-visual,
.ysw-card-table .ysw-enemy-unit .ysw-card-visual {
  min-height: 58px;
}

.ysw-deck-builder {
  align-items: start;
}

.ysw-deck-builder .ysw-deck-library,
.ysw-deck-builder .ysw-deck-side {
  align-content: start;
}

.ysw-deck-builder .ysw-deck-filters {
  align-items: end;
  gap: 8px;
}

.ysw-deck-builder .ysw-deck-filters label {
  flex: 0 1 170px;
  font-size: 11px;
  gap: 4px;
}

.ysw-deck-builder .ysw-deck-filters select {
  font-size: 12px;
  height: 32px;
  min-height: 32px;
  padding: 5px 8px;
}

.ysw-deck-builder .ysw-card-pool {
  align-content: start;
}

.ysw-deck-builder .ysw-library-card {
  gap: 7px;
  min-height: 238px;
  padding: 9px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  flex: 0 0 72px;
  height: 72px !important;
  margin: -1px -1px 5px;
  min-height: 72px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top {
  gap: 7px;
}

.ysw-deck-builder .ysw-library-card .ysw-cost {
  font-size: 13px;
  height: 28px;
  width: 28px;
}

.ysw-deck-builder .ysw-library-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.ysw-deck-builder .ysw-library-card small {
  font-size: 10px;
}

.ysw-deck-builder .ysw-library-card p {
  display: none;
}

.ysw-deck-builder .ysw-role-tags {
  gap: 3px;
  min-height: 18px;
}

.ysw-deck-builder .ysw-role-tags i {
  font-size: 8px;
  padding: 2px 4px;
}

.ysw-deck-builder .ysw-stats span {
  font-size: 10px;
  padding: 3px 6px;
}

.ysw-deck-builder .ysw-deck-controls {
  gap: 6px;
}

.ysw-deck-builder .ysw-deck-controls button,
.ysw-deck-detail .ysw-deck-controls button {
  border-radius: 6px;
  font-size: 16px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  width: 34px;
}

.ysw-deck-builder .ysw-deck-controls strong,
.ysw-deck-detail .ysw-deck-controls strong {
  font-size: 16px;
  min-width: 22px;
}

.ysw-deck-builder .ysw-card-select {
  z-index: 3;
}

.ysw-deck-builder .ysw-library-top,
.ysw-deck-builder .ysw-library-card .ysw-card-visual,
.ysw-deck-builder .ysw-library-card .ysw-stats {
  pointer-events: none;
}

.ysw-deck-builder .ysw-deck-controls,
.ysw-deck-builder .ysw-deck-controls button {
  pointer-events: auto;
  position: relative;
  z-index: 5;
}

@media (max-width: 1320px) {
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    height: 23px;
    width: 23px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 31px;
  }
}

/* v2 final override layer */
.ysw-card-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: clamp(520px, calc(100svh - 150px), 820px);
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 10px;
}

.ysw-table-leaders {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ysw-table-main {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 290px);
  min-height: 0;
}

.ysw-table-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.ysw-card-table .ysw-board-wrap {
  flex: 1 1 auto;
  min-height: 176px;
  overflow: hidden;
}

.ysw-card-table .ysw-enemy-board-wrap {
  flex: 0 0 auto;
  min-height: 118px;
}

.ysw-card-table .ysw-enemy-board,
.ysw-card-table .ysw-board {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  min-height: 0;
}

.ysw-card-table .ysw-enemy-board {
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  min-height: 74px;
}

.ysw-card-table .ysw-unit {
  aspect-ratio: 7 / 9;
  min-height: 138px;
  padding: 0;
}

.ysw-card-table .ysw-hand {
  display: flex;
  flex: 0 0 148px;
  gap: 8px;
  margin: 0;
  min-height: 148px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 5px;
}

.ysw-card-table .ysw-hand-card {
  flex: 0 0 126px;
  height: 142px;
  min-height: 0;
  padding: 0;
}

.ysw-card-table .ysw-unit .ysw-card-visual,
.ysw-card-table .ysw-hand-card .ysw-card-visual {
  height: 100%;
  inset: 0;
  margin: 0;
  position: absolute;
  width: 100%;
}

.ysw-card-table .ysw-hand-card p,
.ysw-card-table .ysw-enemy-unit p {
  display: none;
}

.ysw-card-table .ysw-battle-footer,
.ysw-card-table .ysw-log {
  display: none;
}

@media (max-width: 1320px) {
  .ysw-table-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .ysw-battle-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-rows: auto;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 132px;
    min-height: 132px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 118px;
    height: 126px;
  }
}

@keyframes yswEnemyCard {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(.82) rotate(-4deg);
  }
  38% {
    opacity: 1;
    transform: translateY(0) scale(1.04) rotate(1deg);
  }
  84% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
  100% {
    opacity: .08;
    transform: translateY(18px) scale(.92);
  }
}

@keyframes yswPulseNode {
  0%,
  100% {
    opacity: .55;
    transform: scale(.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes yswScanline {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(330px);
  }
}

@keyframes yswThreatDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-26px, 18px, 0) rotate(22deg);
  }
}

@keyframes yswTeamRise {
  0% {
    opacity: 0;
    transform: translateY(28px) scaleX(.2);
  }
  44% {
    opacity: .2;
    transform: translateY(28px) scaleX(.3);
  }
  62%,
  100% {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
}

@keyframes yswAlertCut {
  0%,
  100% {
    opacity: .24;
    transform: translateY(8px);
  }
  18%,
  58% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes yswMapScan {
  0% {
    opacity: .24;
    transform: skew(-8deg) translateX(12px);
  }
  48% {
    opacity: .75;
    transform: skew(-8deg) translateX(-6px);
  }
  100% {
    opacity: .24;
    transform: skew(-8deg) translateX(12px);
  }
}

@keyframes yswBossShadow {
  0%,
  55% {
    opacity: 0;
    transform: translateX(28px) scale(.92);
  }
  68%,
  88% {
    opacity: .74;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: .18;
    transform: translateX(10px) scale(.96);
  }
}

@keyframes yswOpeningCaption {
  0%,
  5% {
    opacity: 0;
    transform: translateY(16px);
  }
  10%,
  86% {
    opacity: 1;
    transform: translateY(0);
  }
  94%,
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes yswOpeningImage {
  0%,
  5% {
    opacity: 0;
    transform: scale(1.02);
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.1) translate3d(-10px, -6px, 0);
  }
}

@keyframes yswOpeningProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes yswTutorialTarget {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.16);
  }
}

@keyframes yswCardSheen {
  from {
    left: -90%;
  }
  to {
    left: 140%;
  }
}

@keyframes yswPlayerBurst {
  0% {
    opacity: 0;
    transform: scale(.75);
  }
  12%,
  78% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(.98);
  }
}

@keyframes yswVictoryPulse {
  0% {
    box-shadow: 0 0 0 rgba(216, 246, 87, 0);
  }
  50% {
    box-shadow: 0 0 58px rgba(216, 246, 87, .28);
  }
  100% {
    box-shadow: 0 0 0 rgba(216, 246, 87, 0);
  }
}

.ysw-result > div {
  animation: yswVictoryPulse 1200ms ease-out both;
}

@media (max-width: 940px) {
  .ysw-topbar,
  .ysw-boss {
    grid-template-columns: 1fr;
  }

  .ysw-topbar {
    align-items: stretch;
    display: grid;
  }

  .ysw-audio-controls {
    justify-content: space-between;
  }

  .ysw-status-band,
  .ysw-card-pool {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-title-screen {
    grid-template-columns: 1fr;
  }

  .ysw-title-city {
    min-height: 280px;
  }

  .ysw-boss {
    display: grid;
  }

  .ysw-boss-art {
    min-height: 168px;
  }

  .ysw-hand {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ysw-enemy-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ysw-enemy-card-stage {
    inset: 192px 16px auto;
  }
}

@media (max-width: 720px) {
  .ysw-shell {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin: 0 -16px;
    min-height: 100svh;
  }

  .ysw-topbar,
  .ysw-view {
    padding: 16px;
  }

  .ysw-topbar h2 {
    font-size: 24px;
  }

  .ysw-title-screen,
  .ysw-opening,
  .ysw-story-screen,
  .ysw-end-roll {
    min-height: 560px;
  }

  .ysw-title-copy h1,
  .ysw-story-panel h1 {
    font-size: 42px;
  }

  .ysw-title-copy p,
  .ysw-story-body p,
  .ysw-opening-lines span {
    font-size: 14px;
    line-height: 1.7;
  }

  .ysw-opening-lines span {
    font-size: 15px;
    line-height: 1.62;
  }

  .ysw-title-actions,
  .ysw-cinematic-actions,
  .ysw-story-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ysw-opening-stage,
  .ysw-opening-city,
  .ysw-end-roll-stage {
    min-height: 500px;
  }

  .ysw-end-roll-actions {
    display: grid;
    grid-template-columns: 1fr;
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .ysw-opening-lines {
    min-height: 250px;
    padding: 16px;
  }

  .ysw-opening-lines article {
    inset: 16px;
    padding: 16px;
  }

  .ysw-opening-lines h3 {
    font-size: 28px;
  }

  .ysw-glossary-grid {
    grid-template-columns: 1fr;
  }

  .ysw-gallery-intro {
    align-items: stretch;
    display: grid;
  }

  .ysw-character-intro {
    align-items: stretch;
    display: grid;
  }

  .ysw-gallery-stats,
  .ysw-character-stats,
  .ysw-gallery-grid {
    grid-template-columns: 1fr;
  }

  .ysw-character-card {
    grid-template-columns: 1fr;
  }

  .ysw-character-portrait {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .ysw-story-panel {
    margin: 0;
    max-width: 100%;
    padding: 18px;
  }

  .ysw-story-panel h1 {
    font-size: 34px;
  }

  .ysw-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }

  .ysw-audio-controls {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .ysw-audio-controls input {
    width: 100%;
  }

  .ysw-tabs button {
    padding: 10px 8px;
  }

  .ysw-status-band,
  .ysw-deck-summary,
  .ysw-combatants,
  .ysw-battle-footer,
  .ysw-save,
  .ysw-settings {
    grid-template-columns: 1fr;
  }

  .ysw-deck-summary {
    align-items: stretch;
  }

  .ysw-card-pool,
  .ysw-enemy-board,
  .ysw-board,
  .ysw-hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-enemy-board-head {
    align-items: stretch;
    display: grid;
  }

  .ysw-boss-heading {
    display: grid;
  }

  .ysw-battle-actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .ysw-boss-leader {
    min-height: 132px;
    padding-left: 116px;
  }

  .ysw-leader-portrait {
    width: 104px;
  }

  .ysw-enemy-card-stage {
    inset: 300px 16px auto;
  }

  .ysw-enemy-card {
    min-height: 150px;
    padding: 14px;
  }

  .ysw-enemy-card strong {
    font-size: 19px;
  }

  .ysw-player-burst {
    inset: auto 16px 300px;
  }
}

@media (max-width: 430px) {
  .ysw-card-pool,
  .ysw-enemy-board,
  .ysw-board,
  .ysw-hand {
    grid-template-columns: 1fr;
  }

  .ysw-unit,
  .ysw-enemy-unit,
  .ysw-hand-card {
    min-height: 246px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell {
    border: 0;
    border-radius: 0;
    margin: 0;
    max-width: none;
    min-height: 100svh;
  }

  .ysw-topbar {
    align-items: center;
    display: flex;
    min-height: 54px;
    padding: 6px 8px;
  }

  .ysw-kicker {
    display: none;
  }

  .ysw-topbar h2 {
    font-size: 17px;
  }

  .ysw-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
  }

  .ysw-tabs button {
    min-height: 34px;
    padding: 6px 8px;
  }

  .ysw-battle {
    height: calc(100svh - 54px);
    padding: 6px 8px;
  }

  .ysw-combatants {
    grid-template-columns: .78fr 1fr;
    margin-bottom: 5px;
  }

  .ysw-leader {
    padding: 7px 8px;
  }

  .ysw-boss-leader {
    min-height: 78px;
    padding-left: 72px;
  }

  .ysw-leader-portrait {
    width: 64px;
  }

  .ysw-leader small {
    display: none;
  }

  .ysw-pp-display {
    margin-top: 4px;
    padding: 4px 7px;
  }

  .ysw-pp-display strong {
    font-size: 24px;
  }

  .ysw-enemy-board-wrap,
  .ysw-board-wrap {
    padding: 6px;
  }

  .ysw-enemy-board-head small,
  .ysw-enemy-unit p,
  .ysw-hand-card p {
    display: none;
  }

  .ysw-enemy-unit {
    min-height: 74px;
  }

  .ysw-board-wrap {
    min-height: 104px;
  }

  .ysw-unit {
    min-height: 102px;
    padding: 5px;
  }

  .ysw-unit .ysw-card-visual,
  .ysw-hand-card .ysw-card-visual {
    height: 34px;
  }

  .ysw-hand {
    display: flex;
    grid-template-columns: none;
  }

  .ysw-hand-card {
    flex-basis: 128px;
    min-height: 132px;
  }

  .ysw-battle-footer {
    grid-template-columns: 1fr 116px;
  }

  .ysw-log {
    max-height: 54px;
    min-height: 50px;
  }

  .ysw-log p {
    font-size: 11px;
  }
}

/* Absolute final PC battle/deck trim. Keep this at EOF. */
@media (min-width: 941px) {
  .ysw-card-table .ysw-hand {
    flex: 0 0 124px;
    min-height: 124px;
  }

  .ysw-card-table .ysw-hand-card {
    flex: 0 0 112px;
    height: 118px;
    min-height: 0;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    bottom: 5px;
    font-size: 10px;
    height: 22px;
    width: 22px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    font-size: 4.5px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 29px;
  }

  .ysw-card-table .ysw-hand-card .ysw-cost {
    height: 24px;
    width: 24px;
  }

  .ysw-deck-builder .ysw-deck-filters {
    align-items: end;
    gap: 8px;
  }

  .ysw-deck-builder .ysw-deck-filters label {
    flex: 0 1 170px;
  }

  .ysw-deck-builder .ysw-deck-filters select {
    height: 32px;
    min-height: 32px;
  }
}

/* Absolute final PC height fit for 1366x768. Keep this at EOF. */
@media (min-width: 941px) {
  .ysw-card-table .ysw-enemy-board-wrap {
    flex: 0 0 104px;
    min-height: 104px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex: 0 0 140px;
    min-height: 140px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 112px;
    min-height: 112px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 106px;
    height: 106px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type {
    font-size: 8px;
    padding: 2px 4px;
  }

  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 12px;
    height: 22px;
    width: 22px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 10px;
    min-height: 25px;
    padding: 5px 23px 5px 6px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    height: 20px;
    width: 20px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 26px;
  }
}

/* UX polish: art-first cards and searchable deck builder. Keep this at EOF. */
.ysw-card-table .ysw-card-name,
.ysw-card-table .ysw-hand-card strong {
  background: linear-gradient(90deg, rgba(5, 12, 22, .88), rgba(5, 12, 22, .56));
  min-height: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-unit .ysw-card-name {
  bottom: 0;
  font-size: 10px;
  left: 0;
  padding: 5px 28px 5px 7px;
  position: absolute;
  right: 0;
}

.ysw-card-table .ysw-state-badge {
  border-radius: 999px;
  font-size: 0;
  height: 15px;
  min-width: 15px;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 15px;
}

.ysw-card-table .ysw-state-badge::after {
  content: "";
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  display: block;
  height: 6px;
  margin: 4px auto 0;
  width: 6px;
}

.ysw-card-table .ysw-unit.can-attack,
.ysw-card-table .ysw-enemy-unit.is-targetable,
.ysw-card-table .ysw-unit.is-selected {
  box-shadow: 0 0 0 1px rgba(216, 246, 87, .86), 0 0 18px rgba(50, 207, 255, .18);
}

.ysw-card-table .ysw-unit.is-selected {
  outline: 2px solid rgba(216, 246, 87, .76);
  outline-offset: -3px;
}

.ysw-card-table .ysw-role-tags i {
  border: 0;
  font-size: 7px;
  line-height: 1;
  max-width: 48px;
  overflow: hidden;
  padding: 2px 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-stat-badge {
  background: rgba(8, 15, 27, .78);
  box-shadow: 0 0 10px rgba(0, 0, 0, .22);
}

.ysw-card-table .ysw-hand-card .ysw-role-tags {
  bottom: 23px;
}

.ysw-card-table .ysw-hand-card strong {
  font-size: 9px;
  padding: 4px 22px 4px 6px;
}

.ysw-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.ysw-detail-tags i {
  background: rgba(216, 246, 87, .12);
  border: 1px solid rgba(216, 246, 87, .26);
  border-radius: 999px;
  color: var(--ysw-lime);
  font-size: 10px;
  font-style: normal;
  padding: 3px 6px;
}

.ysw-battle-detail .ysw-detail-card {
  min-height: 0;
  padding: 10px;
}

.ysw-battle-detail .ysw-detail-card p {
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
}

.ysw-recent-events {
  gap: 4px;
}

.ysw-recent-events p {
  white-space: normal;
}

.ysw-deck-builder .ysw-deck-filters {
  grid-template-columns: minmax(220px, 1fr) 150px 150px;
}

.ysw-deck-summary {
  grid-template-columns: minmax(160px, 1fr) minmax(130px, .7fr) auto auto auto;
}

.ysw-deck-summary .ysw-filter-reset {
  min-width: 104px;
}

.ysw-deck-builder .ysw-deck-filters label {
  min-width: 0;
}

.ysw-deck-builder .ysw-deck-filters input[type="search"],
.ysw-deck-builder .ysw-deck-filters select {
  background: rgba(5, 12, 22, .86);
  border: 1px solid rgba(178, 241, 255, .24);
  border-radius: 6px;
  color: var(--ysw-white);
  font: inherit;
  height: 32px;
  min-height: 32px;
  outline: 0;
  padding: 5px 9px;
  width: 100%;
}

.ysw-deck-builder .ysw-deck-filters input[type="search"]:focus,
.ysw-deck-builder .ysw-deck-filters select:focus {
  border-color: rgba(216, 246, 87, .7);
  box-shadow: 0 0 0 2px rgba(216, 246, 87, .12);
}

.ysw-empty-result {
  align-items: center;
  border: 1px dashed rgba(178, 241, 255, .22);
  border-radius: 8px;
  color: var(--ysw-muted);
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 120px;
}

.ysw-current-list {
  gap: 6px;
}

.ysw-current-card,
.ysw-recommend-card {
  align-items: center;
  background: rgba(5, 12, 22, .72);
  border: 1px solid rgba(178, 241, 255, .16);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px;
}

.ysw-current-card.is-selected,
.ysw-recommend-card.is-selected {
  border-color: rgba(216, 246, 87, .82);
  box-shadow: 0 0 0 1px rgba(216, 246, 87, .18);
}

.ysw-current-select {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.ysw-current-select span,
.ysw-current-select strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-current-select small,
.ysw-current-select span + span {
  color: var(--ysw-muted);
  display: block;
  font-size: 9px;
  line-height: 1.3;
  margin-top: 2px;
}

.ysw-current-card .ysw-deck-controls {
  gap: 4px;
}

.ysw-current-card .ysw-deck-controls button,
.ysw-recommend-card > button[data-action="deck-plus"] {
  border-radius: 5px;
  font-size: 14px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  width: 28px;
}

.ysw-current-card .ysw-deck-controls strong {
  font-size: 13px;
  min-width: 16px;
}

.ysw-recommend-list {
  display: grid;
  gap: 6px;
}

.ysw-recommend-card .ysw-current-select strong {
  color: var(--ysw-white);
}

.ysw-recommend-card .ysw-current-select span {
  color: var(--ysw-lime);
}

@media (min-width: 941px) {
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 100px;
    min-height: 100px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex-basis: 136px;
    min-height: 136px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 108px;
    min-height: 108px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 104px;
    height: 102px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    bottom: 4px;
    height: 19px;
    width: 19px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: none;
  }

  .ysw-table-main {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 286px);
  }
}

@media (max-width: 1320px) {
  .ysw-deck-summary {
    grid-template-columns: minmax(140px, 1fr) minmax(112px, .65fr) auto auto;
  }

  .ysw-deck-summary .ysw-filter-reset {
    grid-column: 3 / 4;
  }

  .ysw-deck-builder .ysw-deck-filters {
    grid-template-columns: minmax(180px, 1fr) 135px 135px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell {
    height: calc(100svh - 40px);
    min-height: 0;
  }

  .ysw-card-table {
    gap: 4px;
    height: calc(100svh - 97px);
    padding: 4px 6px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 4px;
  }

  .ysw-card-table .ysw-leader {
    min-height: 72px;
    padding: 5px 7px;
  }

  .ysw-card-table .ysw-leader strong {
    font-size: 22px;
    line-height: .95;
  }

  .ysw-card-table .ysw-boss-leader {
    min-height: 72px;
    padding-left: 62px;
  }

  .ysw-card-table .ysw-leader-portrait {
    width: 56px;
  }

  .ysw-card-table .ysw-meter {
    height: 6px;
    margin-top: 4px;
  }

  .ysw-card-table .ysw-pp-display {
    border-radius: 6px;
    gap: 3px;
    margin-top: 3px;
    padding: 3px 6px;
  }

  .ysw-card-table .ysw-pp-display span {
    font-size: 10px;
  }

  .ysw-card-table .ysw-pp-display strong {
    font-size: 18px;
  }

  .ysw-card-table .ysw-special-gauge {
    border-radius: 5px;
    gap: 0;
    margin-top: 3px;
    padding: 3px 6px;
  }

  .ysw-card-table .ysw-special-gauge span {
    display: none;
  }

  .ysw-card-table .ysw-special-gauge strong {
    font-size: 10px;
  }

  .ysw-card-table .ysw-table-main {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  }

  .ysw-card-table .ysw-table-field {
    gap: 4px;
    position: relative;
  }

  .ysw-card-table .ysw-enemy-board-wrap {
    flex: 0 0 66px;
    min-height: 66px;
    padding: 4px 6px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex: 1 1 86px;
    min-height: 76px;
    padding: 4px 6px;
  }

  .ysw-card-table .ysw-hand {
    flex: 0 0 66px;
    min-height: 66px;
    padding-bottom: 2px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 82px;
    height: 64px;
    min-height: 64px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type,
  .ysw-card-table .ysw-hand-card .ysw-role-tags,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    display: none;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 8px;
    padding: 3px 18px 3px 4px;
  }

  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 10px;
    height: 18px;
    right: 4px;
    top: 4px;
    width: 18px;
  }

  .ysw-card-table .ysw-battle-detail {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 126px;
    grid-template-rows: 1fr;
  }

  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-detail-tags {
    display: none;
  }

  .ysw-card-table .ysw-recent-events {
    display: none;
  }

  .ysw-card-table .ysw-detail-card strong {
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .ysw-card-table .ysw-battle-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
  }

  .ysw-card-table .ysw-battle-actions button {
    min-height: 0;
    padding: 7px 6px;
  }

  .ysw-deck-builder .ysw-deck-filters {
    grid-template-columns: 1fr 116px 116px;
  }

  .ysw-deck-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-deck-summary .ysw-filter-reset {
    grid-column: auto;
  }
}

/* Final battle readability repair: prevent field cards from stretching/cropping. */
.ysw-card-table .ysw-enemy-board,
.ysw-card-table .ysw-board {
  align-items: stretch;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.ysw-card-table .ysw-enemy-board {
  min-height: 56px;
}

.ysw-card-table .ysw-board {
  min-height: 0;
}

.ysw-card-table .ysw-board-wrap {
  position: relative;
}

.ysw-card-table .ysw-gears {
  left: 10px;
  min-height: 0;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 4;
}

.ysw-card-table .ysw-gears span {
  background: rgba(6, 33, 42, .86);
  border: 1px solid rgba(36, 210, 255, .36);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 5px 8px;
}

.ysw-card-table .ysw-board {
  height: 100%;
  margin-top: 0;
}

.ysw-card-table .ysw-unit,
.ysw-card-table .ysw-enemy-unit {
  aspect-ratio: auto;
  flex: 0 0 clamp(132px, 10vw, 178px);
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.ysw-card-table .ysw-enemy-unit {
  flex-basis: clamp(150px, 12vw, 210px);
}

.ysw-card-table .ysw-unit .ysw-card-visual,
.ysw-card-table .ysw-enemy-unit .ysw-card-visual {
  height: 100%;
  min-height: 0;
}

.ysw-card-table .ysw-unit .ysw-card-visual img,
.ysw-card-table .ysw-enemy-unit .ysw-card-visual img,
.ysw-card-table .ysw-hand-card .ysw-card-visual img {
  object-fit: cover;
  object-position: center 20%;
}

.ysw-card-table .ysw-enemy-unit strong {
  background: linear-gradient(90deg, rgba(5, 12, 22, .9), rgba(5, 12, 22, .56));
  bottom: 0;
  font-size: 11px;
  left: 0;
  overflow: hidden;
  padding: 5px 28px 5px 7px;
  position: absolute;
  right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-enemy-unit small,
.ysw-card-table .ysw-enemy-unit p {
  display: none;
}

@media (min-width: 941px) {
  .ysw-card-table {
    gap: 7px;
  }

  .ysw-card-table .ysw-enemy-board-wrap {
    flex: 0 0 102px;
    min-height: 102px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex: 0 0 148px;
    min-height: 148px;
  }

  .ysw-card-table .ysw-hand {
    flex: 0 0 132px;
    min-height: 132px;
    padding-bottom: 4px;
  }

  .ysw-card-table .ysw-hand-card {
    flex: 0 0 122px;
    height: 126px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 10px;
    padding: 5px 24px 5px 6px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type {
    font-size: 8px;
    padding: 2px 4px;
  }

  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 12px;
    height: 23px;
    width: 23px;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    bottom: 5px;
    display: grid;
    font-size: 10px;
    height: 21px;
    width: 21px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 27px;
  }
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 138px;
    min-height: 138px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex-basis: 204px;
    min-height: 204px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 166px;
    min-height: 166px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 150px;
    height: 158px;
  }

  .ysw-card-table .ysw-unit {
    flex-basis: clamp(176px, 10vw, 230px);
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table {
    font-size: 12px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 24px;
  }

  .ysw-card-table .ysw-pp-display strong {
    font-size: 20px;
  }

  .ysw-card-table .ysw-cost,
  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 10px;
    height: 18px;
    width: 18px;
  }

  .ysw-card-table .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    border-radius: 5px;
    display: grid;
    font-size: 11px;
    height: 18px;
    min-width: 24px;
    width: 24px;
  }

  .ysw-card-table .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: none;
  }

  .ysw-card-table .ysw-atk-badge,
  .ysw-card-table .ysw-hp-badge {
    bottom: 24px;
  }

  .ysw-card-table .ysw-hand-card .ysw-atk-badge,
  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    bottom: 3px;
  }

  .ysw-card-table .ysw-unit .ysw-card-name,
  .ysw-card-table .ysw-enemy-unit strong {
    font-size: 9px;
    min-height: 22px;
    padding: 5px 34px 5px 6px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 8px;
    min-height: 18px;
    padding: 3px 18px 3px 4px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 60px;
    min-height: 60px;
  }

  .ysw-card-table .ysw-hand-card {
    height: 58px;
    min-height: 58px;
  }

  .ysw-card-table .ysw-detail-card strong {
    font-size: 15px;
    overflow-wrap: anywhere;
  }
}

.ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
.ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap {
  flex-basis: 150px;
  min-height: 150px;
}

.ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
.ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap {
  flex-basis: 244px;
  min-height: 244px;
}

.ysw-game:fullscreen .ysw-card-table .ysw-hand,
.ysw-shell:fullscreen .ysw-card-table .ysw-hand {
  flex-basis: 188px;
  min-height: 188px;
}

.ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
.ysw-shell:fullscreen .ysw-card-table .ysw-hand-card {
  flex-basis: 172px;
  height: 180px;
}

.ysw-game:fullscreen .ysw-card-table .ysw-unit,
.ysw-shell:fullscreen .ysw-card-table .ysw-unit {
  flex-basis: clamp(220px, 13vw, 280px);
}

/* Final battle legibility pass: readable PP/ATK/HP and tighter side panel. */
.ysw-card-table {
  font-size: 14px;
}

.ysw-card-table .ysw-table-leaders .ysw-leader span,
.ysw-card-table .ysw-table-leaders .ysw-leader small,
.ysw-card-table .ysw-enemy-board-head small {
  font-size: 13px;
}

.ysw-card-table .ysw-table-leaders .ysw-leader strong {
  font-size: 29px;
}

.ysw-card-table .ysw-pp-display {
  border-width: 1px;
  gap: 5px;
  padding: 5px 9px;
}

.ysw-card-table .ysw-pp-display span,
.ysw-card-table .ysw-pp-display em {
  font-size: 13px;
}

.ysw-card-table .ysw-pp-display strong {
  font-size: 28px;
}

.ysw-card-table .ysw-card-type,
.ysw-card-table .ysw-gears span,
.ysw-card-table .ysw-role-tags i {
  font-size: 9px;
}

.ysw-card-table .ysw-cost {
  background: #24d2ff;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .34);
  color: #06111b;
  font-size: 15px;
  height: 30px;
  width: 30px;
  z-index: 7;
}

.ysw-card-table .ysw-stat-badge,
.ysw-card-table .ysw-hand-card .ysw-stat-badge {
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 7px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .38);
  color: #06111b;
  display: grid;
  font-size: 15px;
  font-weight: 950;
  height: 26px;
  line-height: .95;
  min-width: 42px;
  place-items: center;
  width: 42px;
  z-index: 8;
}

.ysw-card-table .ysw-stat-badge small,
.ysw-card-table .ysw-hand-card .ysw-stat-badge small {
  color: inherit;
  display: block;
  font-size: 7px;
  line-height: .85;
  margin: 0;
}

.ysw-card-table .ysw-atk-badge {
  background: #ffcf5c;
  bottom: 33px;
  left: 7px;
}

.ysw-card-table .ysw-hp-badge {
  background: #24d2ff;
  bottom: 33px;
  right: 7px;
}

.ysw-card-table .ysw-hand-card .ysw-atk-badge {
  bottom: 36px;
  left: 7px;
}

.ysw-card-table .ysw-hand-card .ysw-hp-badge {
  bottom: 36px;
  right: 7px;
}

.ysw-card-table .ysw-unit .ysw-card-name,
.ysw-card-table .ysw-enemy-unit strong {
  font-size: 12px;
  min-height: 29px;
  padding: 7px 54px 7px 9px;
}

.ysw-card-table .ysw-hand-card strong {
  font-size: 11px;
  min-height: 27px;
  padding: 6px 8px 6px 7px;
}

.ysw-card-table .ysw-state-badge {
  background: rgba(216, 246, 87, .92);
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 999px;
  color: #07111d;
  font-size: 10px;
  font-weight: 950;
  height: auto;
  line-height: 1;
  min-width: 0;
  padding: 5px 7px;
  right: 7px;
  top: 7px;
  width: auto;
}

.ysw-card-table .ysw-state-badge::after {
  content: none;
}

.ysw-card-table .ysw-battle-detail {
  grid-template-rows: minmax(176px, auto) minmax(92px, 1fr) auto;
}

.ysw-card-table .ysw-detail-card {
  padding: 12px;
}

.ysw-card-table .ysw-detail-card span {
  font-size: 12px;
}

.ysw-card-table .ysw-detail-card strong {
  font-size: 20px;
  line-height: 1.18;
}

.ysw-card-table .ysw-detail-card p,
.ysw-card-table .ysw-recent-events p {
  font-size: 13px;
  line-height: 1.5;
}

.ysw-card-table .ysw-recent-events {
  max-height: 240px;
  overflow-y: auto;
}

.ysw-card-table .ysw-recent-events p.is-enemy-event {
  color: #ff8c93;
  text-shadow: 0 0 10px rgba(255, 85, 100, 0.22);
}

.ysw-card-table .ysw-hand-card.is-selected {
  border-color: rgba(216, 246, 87, 0.95);
  box-shadow:
    0 0 0 2px rgba(216, 246, 87, 0.55),
    0 0 18px rgba(216, 246, 87, 0.24);
  transform: translateY(-3px);
}

.ysw-card-table .ysw-hand-card.is-unplayable {
  opacity: 0.74;
}

.ysw-card-table .ysw-hand-card.is-selected.is-unplayable {
  opacity: 0.92;
}

.ysw-card-table .ysw-play-hint {
  margin-top: 8px;
  color: #d8f657;
  font-size: 12px;
  line-height: 1.45;
}

.ysw-card-table .ysw-detail-discard {
  font-size: 13px;
  margin-top: 10px;
  min-height: 38px;
  position: relative;
  width: 100%;
  z-index: 2;
}

.ysw-card-table .ysw-battle-actions button {
  font-size: 15px;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table {
    font-size: 15px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 32px;
  }

  .ysw-card-table .ysw-unit .ysw-card-name,
  .ysw-card-table .ysw-enemy-unit strong {
    font-size: 13px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 12px;
  }

  .ysw-card-table .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    font-size: 16px;
    height: 30px;
    min-width: 48px;
    width: 48px;
  }

  .ysw-card-table .ysw-hand-card .ysw-atk-badge,
  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    bottom: 40px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 62px;
    min-height: 62px;
  }

  .ysw-card-table .ysw-board-wrap {
    flex: 1 1 82px;
    min-height: 74px;
  }

  .ysw-card-table .ysw-hand {
    flex-basis: 70px;
    min-height: 70px;
  }

  .ysw-card-table .ysw-hand-card {
    flex-basis: 88px;
    height: 68px;
    min-height: 68px;
  }

  .ysw-card-table .ysw-state-badge {
    font-size: 8px;
    padding: 3px 5px;
  }

  .ysw-card-table .ysw-hand-card .ysw-atk-badge,
  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    bottom: 22px;
  }
}

/* Latest battle tuning: enemy minions must be readable, HP meters are primary, burst gauges are secondary. */
.ysw-card-table .ysw-meter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)),
    rgba(5, 10, 18, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, .46), 0 0 14px rgba(36, 210, 255, .12);
  height: 22px;
  margin: 0;
}

.ysw-card-table .ysw-hp-gauge-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 124px;
  margin-top: 8px;
}

.ysw-card-table .ysw-meter i {
  background: linear-gradient(90deg, #24d2ff 0%, #69f0c4 56%, #d8f657 100%);
  box-shadow: 0 0 16px rgba(36, 210, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .42);
}

.ysw-card-table .ysw-boss-leader .ysw-meter i {
  background: linear-gradient(90deg, #ff5c8a 0%, #ff8f7a 52%, #ffcf5c 100%);
  box-shadow: 0 0 18px rgba(255, 92, 138, .36), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.ysw-card-table .ysw-special-gauge {
  align-items: center;
  border-radius: 999px;
  display: flex;
  gap: 0;
  height: 22px;
  justify-content: center;
  margin: 0;
  min-height: 22px;
  padding: 0 8px;
  width: 124px;
}

.ysw-card-table .ysw-special-gauge span {
  display: none;
}

.ysw-card-table .ysw-special-gauge strong {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.ysw-card-table .ysw-special-gauge i {
  opacity: .68;
}

.ysw-card-table .ysw-enemy-board-wrap {
  display: flex;
  flex-direction: column;
  flex: 0 0 148px;
  min-height: 148px;
  overflow: hidden;
}

.ysw-card-table .ysw-enemy-board-head {
  flex: 0 0 auto;
  margin-bottom: 6px;
}

.ysw-card-table .ysw-enemy-board {
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.ysw-card-table .ysw-enemy-unit {
  display: block;
  flex: 0 0 clamp(170px, 13vw, 220px);
  height: 100%;
  min-height: 94px;
  max-height: none;
  overflow: hidden;
  padding: 8px 9px 35px;
}

.ysw-card-table .ysw-enemy-unit small {
  color: #ffb9c9;
  display: block;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  padding-right: 34px;
}

.ysw-card-table .ysw-enemy-unit strong {
  background: none;
  bottom: auto;
  display: block;
  font-size: 13px;
  left: auto;
  line-height: 1.15;
  margin-top: 3px;
  min-height: 0;
  overflow: hidden;
  padding: 0 34px 0 0;
  position: static;
  right: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-enemy-unit p {
  color: #d9edf5;
  display: block;
  font-size: 10.5px;
  line-height: 1.25;
  margin: 5px 0 0;
  max-height: 28px;
  overflow: hidden;
}

.ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
  bottom: 7px;
  left: 8px;
}

.ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
  bottom: 7px;
  right: 8px;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 174px;
    min-height: 174px;
  }

  .ysw-card-table .ysw-enemy-unit {
    min-height: 116px;
  }

  .ysw-card-table .ysw-enemy-unit p {
    max-height: 42px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-meter {
    height: 16px;
  }

  .ysw-card-table .ysw-hp-gauge-row {
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) 78px;
    margin-top: 4px;
  }

  .ysw-card-table .ysw-special-gauge {
    height: 16px;
    min-height: 16px;
    padding: 1px 5px;
    width: 78px;
  }

  .ysw-card-table .ysw-special-gauge strong {
    font-size: 10px;
  }

  .ysw-card-table .ysw-special-gauge span {
    display: none;
  }

  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 96px;
    min-height: 96px;
  }

  .ysw-card-table .ysw-enemy-unit {
    min-height: 66px;
    padding: 5px 6px 22px;
  }

  .ysw-card-table .ysw-enemy-unit p {
    display: none;
  }
}

/* Final interaction clarity: playable cards, attack-ready units, and readable compact gauges. */
.ysw-card-table .ysw-table-leaders .ysw-special-gauge strong {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.ysw-card-table .ysw-hand-card.is-playable:not(.is-selected) {
  border-color: rgba(216, 246, 87, .78);
  box-shadow:
    0 0 0 1px rgba(216, 246, 87, .42),
    0 0 16px rgba(216, 246, 87, .22),
    inset 0 0 14px rgba(36, 210, 255, .08);
}

.ysw-card-table .ysw-unit.can-attack:not(.is-selected) {
  border-color: rgba(216, 246, 87, .9);
  box-shadow:
    0 0 0 2px rgba(216, 246, 87, .52),
    0 0 22px rgba(216, 246, 87, .26),
    inset 0 0 18px rgba(36, 210, 255, .1);
}

.ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
.ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
.ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
.ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap {
  flex-basis: 218px;
  min-height: 218px;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 174px;
    min-height: 174px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-table-leaders .ysw-special-gauge strong {
    font-size: 10px;
  }
}

/* Deck card silhouette repair: library cards should read as cards, not flat rows. */
.ysw-deck-builder .ysw-card-pool {
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.ysw-deck-builder .ysw-library-card {
  gap: 7px;
  height: 286px;
  min-height: 286px;
  overflow: hidden;
  padding: 8px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  height: auto !important;
  margin: 0 0 5px;
  min-height: 0;
  width: 100%;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual img {
  object-position: center 50%;
}

.ysw-deck-builder .ysw-library-card.ysw-type-unit .ysw-card-visual img,
.ysw-deck-detail > .ysw-card-visual-unit img {
  object-position: center 16%;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top {
  align-items: start;
  min-height: 42px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top strong {
  display: -webkit-box;
  line-height: 1.18;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ysw-deck-builder .ysw-library-card .ysw-role-tags {
  min-height: 34px;
}

.ysw-deck-builder .ysw-library-card .ysw-stats {
  min-height: 22px;
}

.ysw-deck-builder .ysw-library-card .ysw-deck-controls {
  margin-top: auto;
}

@media (min-width: 1500px) {
  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }

  .ysw-deck-builder .ysw-library-card {
    height: 302px;
    min-height: 302px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  .ysw-deck-builder .ysw-library-card {
    height: 234px;
    min-height: 234px;
    padding: 6px;
  }

  .ysw-deck-builder .ysw-library-card .ysw-library-top {
    min-height: 36px;
  }

  .ysw-deck-builder .ysw-library-card .ysw-role-tags {
    min-height: 28px;
  }
}

/* Deck builder v2: left card selection, right current deck overview. */
.ysw-deck .ysw-deck-summary {
  align-items: center;
  grid-template-columns: minmax(120px, .7fr) minmax(260px, 1.15fr) minmax(120px, .55fr) minmax(0, 2.2fr);
}

.ysw-deck .ysw-deck-summary .ysw-deck-summary-breakdown strong {
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}

.ysw-deck-summary-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ysw-deck-summary-actions label {
  color: var(--ysw-lime);
  display: grid;
  font-size: 11px;
  font-weight: 950;
  gap: 4px;
  min-width: 118px;
}

.ysw-deck-summary-actions select {
  background: rgba(5, 12, 22, .86);
  border: 1px solid rgba(178, 241, 255, .24);
  border-radius: 6px;
  color: var(--ysw-white);
  font: inherit;
  height: 34px;
  padding: 5px 8px;
}

.ysw-deck-summary-actions button {
  min-height: 34px;
  padding: 8px 12px;
}

.ysw-deck-builder {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.ysw-deck-builder .ysw-deck-library,
.ysw-deck-builder .ysw-deck-side-current,
.ysw-deck-builder .ysw-deck-current {
  min-height: 0;
}

.ysw-deck-builder .ysw-deck-side-current {
  display: block;
  padding: 0;
}

.ysw-deck-builder .ysw-deck-side-current .ysw-deck-current {
  height: 100%;
}

.ysw-deck-current-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ysw-deck-current-head strong {
  color: var(--ysw-lime);
  font-size: 18px;
}

.ysw-deck-mini-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ysw-deck-mini-stats span {
  background: rgba(178, 241, 255, .08);
  border: 1px solid rgba(178, 241, 255, .14);
  border-radius: 6px;
  color: var(--ysw-muted);
  font-size: 10px;
  padding: 5px 6px;
}

.ysw-deck-mini-stats strong {
  color: var(--ysw-white);
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.ysw-deck-builder .ysw-card-pool {
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}

.ysw-deck-builder .ysw-library-card {
  gap: 8px;
  height: 364px;
  min-height: 364px;
  padding: 9px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  aspect-ratio: 4 / 3;
  margin-bottom: 6px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top {
  min-height: 42px;
}

.ysw-deck-builder .ysw-library-card p {
  color: #d8e8ef;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  min-height: 44px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ysw-deck-builder .ysw-role-tags {
  align-items: flex-start;
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  left: auto;
  min-height: 24px;
  pointer-events: none;
  position: static;
}

.ysw-deck-builder .ysw-role-tags i {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  min-width: max-content;
  padding: 4px 6px;
  white-space: nowrap;
}

.ysw-deck-builder .ysw-stats {
  display: flex;
  gap: 5px;
  min-height: 22px;
}

.ysw-deck-builder .ysw-deck-controls {
  margin-top: auto;
}

.ysw-deck-side-current .ysw-current-list {
  max-height: calc(100vh - 420px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (min-width: 1500px) {
  .ysw-deck-builder {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .ysw-deck-builder .ysw-library-card {
    height: 386px;
    min-height: 386px;
  }
}

@media (max-width: 1320px) {
  .ysw-deck .ysw-deck-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ysw-deck-summary-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-deck-builder {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }

  .ysw-deck-builder .ysw-library-card {
    height: 292px;
    min-height: 292px;
  }

  .ysw-deck-builder .ysw-library-card p {
    font-size: 9px;
    min-height: 34px;
    -webkit-line-clamp: 2;
  }

  .ysw-deck-mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Deck builder final legibility: larger text without returning to a cramped layout. */
.ysw-deck .ysw-deck-summary span,
.ysw-deck-summary-actions label,
.ysw-deck-builder .ysw-deck-filters label {
  font-size: 12px;
}

.ysw-deck .ysw-deck-summary strong {
  font-size: 26px;
}

.ysw-deck .ysw-deck-summary .ysw-deck-summary-breakdown strong {
  font-size: 16px;
}

.ysw-deck-summary-actions button,
.ysw-deck-summary-actions select,
.ysw-deck-builder .ysw-deck-filters input[type="search"],
.ysw-deck-builder .ysw-deck-filters select {
  font-size: 13px;
}

.ysw-deck-builder .ysw-library-card {
  height: 382px;
  min-height: 382px;
}

.ysw-deck-builder .ysw-library-card .ysw-card-visual {
  aspect-ratio: 3 / 2;
  margin-bottom: 4px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top {
  min-height: 44px;
}

.ysw-deck-builder .ysw-library-card .ysw-library-top strong,
.ysw-deck-builder .ysw-library-card strong {
  font-size: 16px;
}

.ysw-deck-builder .ysw-library-card small {
  font-size: 11px;
}

.ysw-deck-builder .ysw-library-card p {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  max-height: none;
  min-height: 46px;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.ysw-deck-builder .ysw-role-tags {
  gap: 5px;
  min-height: 26px;
}

.ysw-deck-builder .ysw-role-tags i {
  font-size: 10px;
  min-height: 21px;
  padding: 5px 7px;
}

.ysw-deck-builder .ysw-stats span {
  font-size: 11px;
  padding: 4px 7px;
}

.ysw-deck-builder .ysw-deck-controls strong,
.ysw-deck-detail .ysw-deck-controls strong {
  font-size: 18px;
}

.ysw-deck-current h3 {
  font-size: 24px;
}

.ysw-deck-current-head strong {
  font-size: 20px;
}

.ysw-deck-mini-stats span {
  font-size: 11px;
}

.ysw-deck-mini-stats strong {
  font-size: 17px;
}

.ysw-deck-warning-list span {
  font-size: 11px;
  line-height: 1.2;
  padding: 6px 9px;
}

.ysw-current-select span,
.ysw-current-select strong {
  font-size: 13px;
  line-height: 1.25;
}

.ysw-current-select small,
.ysw-current-select span + span {
  font-size: 10px;
  line-height: 1.35;
}

.ysw-current-card .ysw-deck-controls strong {
  font-size: 15px;
}

.ysw-deck-message {
  background: rgba(216, 246, 87, .11);
  border: 1px solid rgba(216, 246, 87, .34);
  border-radius: 7px;
  color: var(--ysw-lime);
  flex-basis: 100%;
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
  margin: 2px 0 0;
  padding: 8px 10px;
  text-align: right;
}

@media (min-width: 1500px) {
  .ysw-deck-builder .ysw-library-card {
    height: 404px;
    min-height: 404px;
  }

  .ysw-deck-builder .ysw-library-card .ysw-library-top strong,
  .ysw-deck-builder .ysw-library-card strong {
    font-size: 17px;
  }

  .ysw-deck-builder .ysw-library-card p {
    font-size: 13px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-deck .ysw-deck-summary strong {
    font-size: 22px;
  }

  .ysw-deck .ysw-deck-summary .ysw-deck-summary-breakdown strong {
    font-size: 13px;
  }

  .ysw-deck-builder .ysw-library-card {
    height: 304px;
    min-height: 304px;
  }

  .ysw-deck-builder .ysw-library-card .ysw-library-top strong,
  .ysw-deck-builder .ysw-library-card strong {
    font-size: 13px;
  }

  .ysw-deck-builder .ysw-library-card p {
    display: block;
    font-size: 10px;
    line-height: 1.35;
    max-height: none;
    min-height: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
  }

  .ysw-current-select span,
  .ysw-current-select strong {
    font-size: 11px;
  }
}

/* Story/voice pass: keep the battle side panel readable on PC window widths. */
@media (min-width: 941px) {
  .ysw-card-table .ysw-battle-detail {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(150px, 1fr) auto !important;
  }

  .ysw-card-table .ysw-detail-card p {
    display: block !important;
  }

  .ysw-card-table .ysw-detail-tags {
    display: flex !important;
  }

  .ysw-card-table .ysw-recent-events {
    display: block !important;
  }

  .ysw-card-table .ysw-recent-events p {
    overflow: visible !important;
    overflow-wrap: anywhere;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal;
  }

  .ysw-card-table .ysw-player-burst {
    inset: 50% auto auto 50% !important;
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
    z-index: 7;
  }

  .ysw-card-table .ysw-table-field {
    position: relative;
  }

  .ysw-card-table .ysw-player-burst span {
    background:
      linear-gradient(145deg, rgba(14, 18, 30, .95), rgba(34, 38, 50, .9)),
      radial-gradient(circle at 12% 50%, rgba(36, 210, 255, .28), transparent 38%);
    border: 1px solid rgba(216, 246, 87, .38);
    border-radius: 10px;
    box-shadow:
      0 16px 44px rgba(0, 0, 0, .36),
      0 0 34px rgba(216, 246, 87, .26);
    color: #ffffff;
    font-size: 17px;
    min-width: 220px;
    padding: 14px 22px;
    text-align: center;
    text-shadow: 0 0 12px rgba(36, 210, 255, .5), 0 2px 8px rgba(0, 0, 0, .8);
    animation-duration: 1600ms;
    white-space: nowrap;
  }

  .ysw-card-table .ysw-enemy-card-stage {
    inset: 12px 24px auto !important;
    z-index: 8;
  }

  .ysw-card-table .ysw-enemy-card {
    gap: 4px;
    max-width: 360px;
    min-height: 118px;
    padding: 12px 16px;
  }

  .ysw-card-table .ysw-enemy-card small {
    font-size: 11px;
  }

  .ysw-card-table .ysw-enemy-card strong {
    font-size: 20px;
    line-height: 1.1;
  }

  .ysw-card-table .ysw-enemy-card p {
    font-size: 12px;
    line-height: 1.35;
  }
}

@media (max-width: 940px) {
  .ysw-card-table .ysw-player-burst {
    inset: 50% auto auto 50% !important;
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
  }

  .ysw-card-table .ysw-table-field {
    position: relative;
  }

  .ysw-card-table .ysw-enemy-card-stage {
    inset: 8px 12px auto !important;
    z-index: 8;
  }

  .ysw-card-table .ysw-enemy-card {
    gap: 3px;
    min-height: 82px;
    padding: 8px 10px;
  }

  .ysw-card-table .ysw-enemy-card p {
    display: none;
  }

  .ysw-card-table .ysw-player-burst span {
    background:
      linear-gradient(145deg, rgba(14, 18, 30, .95), rgba(34, 38, 50, .9)),
      radial-gradient(circle at 12% 50%, rgba(36, 210, 255, .28), transparent 38%);
    border: 1px solid rgba(216, 246, 87, .38);
    border-radius: 9px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .36), 0 0 24px rgba(216, 246, 87, .22);
    color: #ffffff;
    font-size: 13px;
    max-width: calc(100svw - 32px);
    min-width: 0;
    padding: 10px 14px;
    text-align: center;
    text-shadow: 0 0 10px rgba(36, 210, 255, .5), 0 2px 8px rgba(0, 0, 0, .8);
    animation-duration: 1600ms;
    white-space: normal;
  }

  .ysw-battle-effect:not(.ysw-effect-hit) {
    left: 0;
    right: 0;
  }

  .ysw-effect-hit span {
    font-size: clamp(28px, 7vw, 42px);
  }

  .ysw-hp-feedbacks {
    bottom: calc(100% + 1px);
    min-width: 210px;
  }

  .ysw-hp-feedback {
    font-size: clamp(76px, 18vw, 116px);
    -webkit-text-stroke-width: 2px;
  }

  .ysw-card-feedback {
    font-size: clamp(34px, 9vw, 58px);
  }

  .ysw-card-feedback-action {
    font-size: clamp(15px, 4vw, 22px);
    min-width: 86px;
    padding: 7px 11px;
  }
}

/* Opening video pass: keep captions visible on short landscape phones. */
@media (max-width: 940px) and (orientation: landscape) {
  .ysw-opening {
    min-height: calc(100svh - 54px);
    padding: 8px 18px;
  }

  .ysw-opening-stage,
  .ysw-opening-city {
    height: calc(100svh - 118px);
    min-height: 240px;
  }

  .ysw-opening-lines {
    inset: auto 14px 14px;
    min-height: 112px;
    padding: 0;
  }

  .ysw-opening-lines article {
    inset: auto 0 0;
    min-width: 0;
    padding: 12px 14px;
  }

  .ysw-opening-lines h3 {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .ysw-opening-lines span {
    display: block;
    font-size: 11.5px;
    line-height: 1.36;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal !important;
    word-break: break-all;
  }

  .ysw-opening-progress {
    bottom: 8px;
    left: 14px;
    right: 14px;
  }
}

/* Battle readability pass: keep action feedback bright and make combat text legible. */
.ysw-card-table .ysw-unit:disabled {
  opacity: 1;
}

.ysw-card-table .ysw-unit:disabled .ysw-card-visual,
.ysw-card-table .ysw-unit:disabled .ysw-card-name,
.ysw-card-table .ysw-unit:disabled .ysw-state-badge,
.ysw-card-table .ysw-unit:disabled .ysw-stat-badge,
.ysw-card-table .ysw-unit:disabled .ysw-role-tags {
  opacity: .5;
}

.ysw-card-table .ysw-unit:disabled .ysw-card-feedbacks {
  opacity: 1;
}

.ysw-card-table .ysw-table-leaders .ysw-leader span,
.ysw-card-table .ysw-table-leaders .ysw-leader small,
.ysw-card-table .ysw-enemy-board-head small {
  font-size: 14px;
  line-height: 1.35;
}

.ysw-card-table .ysw-table-leaders .ysw-leader > strong {
  font-size: clamp(31px, 2.7vw, 40px);
}

.ysw-card-table .ysw-leader.is-low-hp > strong {
  color: #ff5c75;
  text-shadow:
    0 0 12px rgba(255, 92, 117, .72),
    0 0 30px rgba(255, 48, 96, .42),
    0 2px 8px rgba(0, 0, 0, .86);
}

.ysw-card-table .ysw-leader.is-low-hp .ysw-hp-meter {
  box-shadow:
    0 0 0 1px rgba(255, 92, 117, .36),
    0 0 18px rgba(255, 48, 96, .32),
    inset 0 0 12px rgba(255, 48, 96, .12);
}

.ysw-card-table .ysw-special-gauge strong {
  font-size: 14px !important;
}

.ysw-card-table .ysw-detail-card {
  gap: 9px;
  padding: 13px;
}

.ysw-card-table .ysw-detail-card span {
  font-size: 13px;
}

.ysw-card-table .ysw-detail-card strong {
  font-size: clamp(21px, 1.7vw, 27px);
  line-height: 1.18;
}

.ysw-card-table .ysw-detail-card p,
.ysw-card-table .ysw-recent-events p,
.ysw-card-table .ysw-play-hint {
  font-size: 14.5px;
  line-height: 1.52;
}

.ysw-card-table .ysw-detail-tags i {
  font-size: 12px;
  padding: 5px 8px;
}

.ysw-card-table .ysw-recent-events {
  max-height: 252px;
}

.ysw-card-table .ysw-gears {
  gap: 6px;
}

.ysw-card-table .ysw-gears span {
  font-size: 11px;
  line-height: 1.1;
  padding: 5px 8px;
}

.ysw-card-table .ysw-battle-actions {
  gap: 10px;
}

.ysw-card-table .ysw-battle-actions button,
.ysw-card-table .ysw-burst-button {
  border-radius: 8px;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.25;
  min-height: 48px;
  padding: 12px 14px;
}

.ysw-card-table .ysw-battle-actions .ysw-primary {
  background: linear-gradient(90deg, #d8f657, #b8ff5c);
  box-shadow: 0 0 18px rgba(216, 246, 87, .2);
  color: #07120d;
}

.ysw-card-table .ysw-battle-actions .ysw-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .07));
  border-color: rgba(255, 255, 255, .26);
  color: #ffffff;
}

.ysw-card-table .ysw-burst-button {
  background: linear-gradient(90deg, #24d2ff, #d8f657);
  box-shadow: 0 0 18px rgba(36, 210, 255, .16);
  color: #06111a;
}

.ysw-card-table .ysw-burst-button.is-unavailable {
  background: linear-gradient(90deg, rgba(36, 210, 255, .62), rgba(216, 246, 87, .72));
  color: #07111b;
  filter: saturate(.75);
  opacity: .9;
}

.ysw-card-table .ysw-burst-button:disabled,
.ysw-card-table .ysw-battle-actions button:disabled {
  opacity: .56;
}

.ysw-card-table .ysw-enemy-card {
  gap: 7px;
  max-width: 460px;
  min-height: 148px;
  padding: 16px 18px;
  width: min(100%, 460px);
}

.ysw-card-table .ysw-enemy-card small {
  font-size: 13px;
}

.ysw-card-table .ysw-enemy-card strong {
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.12;
}

.ysw-card-table .ysw-enemy-card p {
  font-size: 15px;
  line-height: 1.45;
}

.ysw-hp-feedbacks {
  bottom: calc(100% + 8px);
  min-width: 420px;
}

.ysw-hp-feedback {
  font-size: clamp(168px, 13.5vw, 260px);
  line-height: .76;
  -webkit-text-stroke-width: 3px;
}

.ysw-card-feedback-action {
  background:
    linear-gradient(145deg, rgba(14, 18, 30, .96), rgba(34, 38, 50, .9)),
    radial-gradient(circle at 14% 50%, rgba(36, 210, 255, .3), transparent 42%);
  border: 1px solid rgba(216, 246, 87, .42);
  border-radius: 10px;
  box-shadow:
    0 16px 42px rgba(0, 0, 0, .34),
    0 0 30px rgba(216, 246, 87, .24);
  color: #ffffff;
  font-size: clamp(20px, 2.2vw, 32px);
  min-width: 152px;
  padding: 12px 18px;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 0 12px rgba(36, 210, 255, .52), 0 2px 8px rgba(0, 0, 0, .82);
}

.ysw-card-feedback-lost {
  background:
    linear-gradient(145deg, rgba(20, 22, 30, .98), rgba(44, 24, 36, .93)),
    radial-gradient(circle at 15% 50%, rgba(255, 92, 138, .28), transparent 42%);
  border: 1px solid rgba(255, 116, 145, .5);
  border-radius: 10px;
  box-shadow:
    0 16px 42px rgba(0, 0, 0, .42),
    0 0 32px rgba(255, 92, 138, .28);
  color: #ffffff;
  font-size: clamp(22px, 2.6vw, 38px);
  min-width: 142px;
  padding: 12px 18px;
  -webkit-text-fill-color: #ffffff;
  -webkit-text-stroke: 0 transparent;
  text-shadow: 0 0 14px rgba(255, 92, 138, .54), 0 2px 9px rgba(0, 0, 0, .86);
}

.ysw-card-table .ysw-unit.is-defeated,
.ysw-card-table .ysw-enemy-unit.is-defeated {
  pointer-events: none;
}

.ysw-card-table .ysw-unit.is-defeated .ysw-card-visual,
.ysw-card-table .ysw-unit.is-defeated .ysw-card-name,
.ysw-card-table .ysw-enemy-unit.is-defeated > :not(.ysw-card-feedbacks) {
  filter: grayscale(.35) brightness(.58);
  opacity: .48;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-recent-events p,
  .ysw-card-table .ysw-play-hint {
    font-size: 15px;
  }

  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    font-size: 18px;
    min-height: 50px;
  }
}

@media (max-width: 940px) {
  .ysw-card-table .ysw-table-leaders .ysw-leader span,
  .ysw-card-table .ysw-table-leaders .ysw-leader small,
  .ysw-card-table .ysw-enemy-board-head small {
    font-size: 11px;
  }

  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-recent-events p,
  .ysw-card-table .ysw-play-hint {
    font-size: 12px;
  }

  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    font-size: 13px;
    min-height: 38px;
    padding: 9px 10px;
  }

  .ysw-card-table .ysw-special-gauge strong {
    font-size: 10px !important;
  }

  .ysw-card-table .ysw-enemy-card {
    max-width: min(100%, 340px);
    min-height: 90px;
    padding: 9px 12px;
  }

  .ysw-card-table .ysw-enemy-card small {
    font-size: 10px;
  }

  .ysw-card-table .ysw-enemy-card strong {
    font-size: 18px;
  }

  .ysw-card-table .ysw-enemy-card p {
    display: block;
    font-size: 11px;
    line-height: 1.32;
  }

  .ysw-hp-feedbacks {
    bottom: calc(100% + 5px);
    min-width: 240px;
  }

  .ysw-hp-feedback {
    font-size: clamp(96px, 24vw, 156px);
    -webkit-text-stroke-width: 2.2px;
  }

  .ysw-card-feedback-action {
    font-size: clamp(15px, 4vw, 22px);
    min-width: 112px;
    padding: 9px 12px;
  }
}

/* Campaign/settings width pass: avoid over-wide reading and action buttons on fullscreen. */
@media (min-width: 941px) {
  .ysw-campaign {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1240px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-settings {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1040px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-gallery {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1180px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-characters {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1240px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-glossary {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1040px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-leader-select {
    margin-left: auto;
    margin-right: auto;
    max-width: min(1120px, calc(100% - 48px));
    width: 100%;
  }

  .ysw-campaign .ysw-status-band,
  .ysw-campaign .ysw-story-tools,
  .ysw-campaign .ysw-boss-list,
  .ysw-settings .ysw-save-panel,
  .ysw-gallery .ysw-gallery-intro,
  .ysw-gallery .ysw-gallery-section,
  .ysw-characters .ysw-character-intro,
  .ysw-characters .ysw-character-section,
  .ysw-glossary .ysw-glossary-intro,
  .ysw-glossary .ysw-glossary-section,
  .ysw-info .ysw-info-intro,
  .ysw-info .ysw-info-grid,
  .ysw-leader-select .ysw-leader-brief,
  .ysw-leader-select .ysw-leader-grid,
  .ysw-leader-select .ysw-leader-actions {
    width: 100%;
  }

  .ysw-campaign .ysw-status-band span,
  .ysw-deck .ysw-deck-summary span {
    font-size: 16px;
    line-height: 1.25;
  }

  .ysw-campaign .ysw-status-band small {
    font-size: 14px;
    line-height: 1.35;
  }

  .ysw-campaign .ysw-status-band strong {
    font-size: 32px;
    line-height: 1.15;
  }

  .ysw-deck .ysw-deck-summary strong {
    font-size: 30px;
    line-height: 1.15;
  }

  .ysw-deck .ysw-deck-summary .ysw-deck-summary-breakdown strong {
    font-size: 20px;
    line-height: 1.25;
  }

  .ysw-deck-summary-actions label {
    font-size: 15px;
  }

  .ysw-campaign .ysw-boss-heading p {
    font-size: 15px;
    line-height: 1.2;
  }

  .ysw-campaign .ysw-boss-subtitle,
  .ysw-campaign .ysw-boss-intro {
    font-size: 15px;
    line-height: 1.55;
  }

  .ysw-campaign .ysw-threat-tag,
  .ysw-campaign .ysw-rewards span {
    font-size: 13px;
  }

  .ysw-leader-select .ysw-leader-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ysw-leader-select .ysw-leader-card {
    min-height: 430px;
  }

  .ysw-leader-select .ysw-leader-card .ysw-card-visual {
    height: 205px;
    min-height: 205px;
  }

  .ysw-leader-select .ysw-leader-card .ysw-card-visual img {
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    width: 100%;
  }

  .ysw-leader-select .ysw-leader-actions {
    justify-content: center;
  }

  .ysw-leader-select .ysw-leader-actions .ysw-primary,
  .ysw-leader-select .ysw-leader-actions .ysw-secondary {
    min-width: 220px;
    width: min(100%, 320px);
  }

  .ysw-campaign .ysw-boss {
    grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
    min-height: 224px;
  }

  .ysw-campaign .ysw-boss-art {
    min-height: 224px;
  }

  .ysw-campaign .ysw-boss-body > .ysw-primary {
    align-self: flex-start;
    min-width: 260px;
    width: min(100%, 420px);
  }

  .ysw-deck {
    display: flex;
    flex-direction: column;
    height: min(960px, calc(100svh - 112px));
    min-height: 560px;
    overflow: hidden;
  }

  .ysw-deck .ysw-deck-summary {
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .ysw-deck .ysw-deck-builder {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .ysw-deck-builder .ysw-deck-library,
  .ysw-deck-builder .ysw-deck-side-current {
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .ysw-deck-builder .ysw-deck-library {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .ysw-deck-builder .ysw-card-pool {
    align-content: start;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .ysw-deck-builder .ysw-deck-current {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .ysw-deck-side-current .ysw-current-list {
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 940px) {
  .ysw-campaign,
  .ysw-settings,
  .ysw-gallery,
  .ysw-characters,
  .ysw-glossary,
  .ysw-leader-select {
    max-width: none;
    width: 100%;
  }

  .ysw-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-character-grid {
    grid-template-columns: 1fr;
  }

  .ysw-campaign .ysw-boss-body > .ysw-primary {
    width: 100%;
  }

  .ysw-campaign .ysw-status-band span,
  .ysw-deck .ysw-deck-summary span {
    font-size: 14px;
  }

  .ysw-campaign .ysw-status-band strong,
  .ysw-deck .ysw-deck-summary strong {
    font-size: 24px;
  }
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-leader-select .ysw-leader-card {
    min-height: 470px;
  }

  .ysw-leader-select .ysw-leader-card .ysw-card-visual {
    height: 235px;
    min-height: 235px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-deck {
    min-height: auto;
  }

  .ysw-leader-select .ysw-leader-card {
    min-height: 360px;
  }

  .ysw-leader-select .ysw-leader-card .ysw-card-visual {
    height: 160px;
    min-height: 160px;
  }
}

/* Playtest readability pass: larger combat deltas, clearer hand badges, selectable enemy info. */
.ysw-card-table .ysw-table-leaders .ysw-leader,
.ysw-card-table .ysw-boss-leader {
  overflow: visible;
  position: relative;
}

.ysw-card-table .ysw-boss-leader {
  min-height: 128px;
  padding-left: 150px;
}

.ysw-card-table .ysw-boss-leader .ysw-leader-portrait {
  border-right-color: rgba(255, 92, 138, .32);
  box-shadow: inset -18px 0 30px rgba(5, 11, 22, .48);
  overflow: hidden;
  width: 138px;
}

.ysw-card-table .ysw-boss-leader .ysw-leader-portrait img {
  object-position: center 12%;
  transform: scale(1.16);
  transform-origin: center 18%;
}

.ysw-card-table .ysw-hp-feedbacks {
  bottom: auto;
  left: 50%;
  min-width: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 48;
}

.ysw-card-table .ysw-hp-feedback {
  font-size: clamp(58px, 5.8vw, 96px);
  line-height: .82;
  -webkit-text-stroke-width: 2px;
  text-shadow:
    0 0 16px rgba(255, 72, 112, .96),
    0 0 34px rgba(255, 72, 112, .62),
    0 6px 14px rgba(2, 6, 12, .9);
}

.ysw-card-table .ysw-hp-feedback-heal {
  text-shadow:
    0 0 16px rgba(105, 240, 196, .96),
    0 0 34px rgba(105, 240, 196, .62),
    0 6px 14px rgba(2, 6, 12, .9);
}

.ysw-card-table .ysw-cost,
.ysw-card-table .ysw-hand-card .ysw-cost {
  background:
    radial-gradient(circle at 34% 24%, rgba(216, 246, 87, .42), transparent 38%),
    linear-gradient(145deg, #101827, #050a12);
  border: 2px solid rgba(216, 246, 87, .96);
  box-shadow:
    0 0 0 1px rgba(5, 10, 18, .92),
    0 0 14px rgba(216, 246, 87, .42),
    0 5px 12px rgba(0, 0, 0, .56);
  color: #ffffff;
  font-weight: 950;
  text-shadow: 0 0 8px rgba(216, 246, 87, .72), 0 2px 5px rgba(0, 0, 0, .88);
}

.ysw-card-table .ysw-hand-card .ysw-card-type {
  background: rgba(5, 12, 22, .88);
  border: 1px solid rgba(135, 223, 255, .54);
  border-radius: 999px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0;
  padding: 3px 7px;
  text-shadow: 0 0 9px rgba(36, 210, 255, .56);
}

.ysw-card-table .ysw-hand-card .ysw-role-tags {
  flex-wrap: wrap;
  gap: 3px;
  max-width: calc(100% - 14px);
}

.ysw-card-table .ysw-hand-card .ysw-role-tags i {
  background: linear-gradient(180deg, rgba(17, 28, 42, .96), rgba(6, 12, 22, .92));
  border: 1px solid rgba(216, 246, 87, .5);
  border-radius: 999px;
  color: #f5fbff;
  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: 0;
  padding: 3px 6px;
  text-shadow: 0 0 8px rgba(36, 210, 255, .42), 0 1px 4px rgba(0, 0, 0, .86);
  white-space: nowrap;
}

.ysw-card-table .ysw-stat-badge,
.ysw-card-table .ysw-hand-card .ysw-stat-badge {
  background: linear-gradient(180deg, rgba(13, 20, 32, .98), rgba(4, 9, 17, .96));
  color: #ffffff;
  column-gap: 4px;
  display: grid;
  font-size: 18px;
  grid-auto-flow: column;
  height: 34px;
  justify-content: center;
  line-height: 1;
  min-width: 54px;
  padding: 0 7px;
  place-items: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .92);
  width: auto;
}

.ysw-card-table .ysw-hand-card .ysw-stat-badge {
  font-size: 16px;
  height: 30px;
  min-width: 46px;
  padding: 0 6px;
}

.ysw-card-table .ysw-stat-badge small,
.ysw-card-table .ysw-hand-card .ysw-stat-badge small {
  display: inline-grid;
  font-size: 0;
  line-height: 1;
  margin: 0;
  place-items: center;
}

.ysw-card-table .ysw-stat-badge b,
.ysw-card-table .ysw-hand-card .ysw-stat-badge b {
  display: inline-block;
  font: inherit;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  min-width: .58em;
  padding: 0;
  text-align: center;
}

.ysw-card-table .ysw-atk-badge {
  border-color: rgba(255, 207, 92, .96);
  box-shadow:
    0 0 0 1px rgba(5, 10, 18, .92),
    0 0 14px rgba(255, 207, 92, .38),
    0 5px 12px rgba(0, 0, 0, .54);
}

.ysw-card-table .ysw-hp-badge {
  border-color: rgba(105, 240, 196, .96);
  box-shadow:
    0 0 0 1px rgba(5, 10, 18, .92),
    0 0 14px rgba(105, 240, 196, .36),
    0 5px 12px rgba(0, 0, 0, .54);
}

.ysw-card-table .ysw-atk-badge small::before {
  color: #ffcf5c;
  content: "◆";
  font-size: 13px;
  text-shadow: 0 0 9px rgba(255, 207, 92, .7);
}

.ysw-card-table .ysw-hp-badge small::before {
  color: #69f0c4;
  content: "♥";
  font-size: 14px;
  text-shadow: 0 0 9px rgba(105, 240, 196, .7);
}

.ysw-card-table .ysw-hand-card .ysw-atk-badge small::before,
.ysw-card-table .ysw-hand-card .ysw-hp-badge small::before {
  font-size: 12px;
}

.ysw-card-table .ysw-enemy-unit.is-inspectable {
  border-color: rgba(135, 223, 255, .46);
  cursor: pointer;
}

.ysw-card-table .ysw-enemy-unit.is-selected {
  border-color: rgba(216, 246, 87, .92);
  box-shadow:
    0 0 0 2px rgba(216, 246, 87, .48),
    0 0 20px rgba(216, 246, 87, .22),
    inset 0 0 18px rgba(36, 210, 255, .1);
}

.ysw-card-table .ysw-enemy-unit.is-targetable {
  cursor: crosshair;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-boss-leader {
    min-height: 142px;
    padding-left: 166px;
  }

  .ysw-card-table .ysw-boss-leader .ysw-leader-portrait {
    width: 152px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type {
    font-size: 11.5px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags i {
    font-size: 9.5px;
  }
}

@media (max-width: 940px) {
  .ysw-card-table .ysw-boss-leader {
    min-height: 92px;
    padding-left: 98px;
  }

  .ysw-card-table .ysw-boss-leader .ysw-leader-portrait {
    width: 88px;
  }

  .ysw-card-table .ysw-hp-feedback {
    font-size: clamp(46px, 13vw, 74px);
    -webkit-text-stroke-width: 1.6px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type {
    font-size: 8px;
    padding: 2px 5px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags i {
    font-size: 7px;
    padding: 2px 4px;
  }

  .ysw-card-table .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    font-size: 12px;
    height: 23px;
    min-width: 35px;
    padding: 0 4px;
  }

  .ysw-card-table .ysw-atk-badge small::before,
  .ysw-card-table .ysw-hp-badge small::before {
    font-size: 10px;
  }
}

/* Keep field-card ATK/HP values inside the icon badges. */
.ysw-card-table .ysw-unit .ysw-stat-badge,
.ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
  box-sizing: border-box;
  column-gap: 4px;
  font-size: 18px;
  grid-template-columns: 16px minmax(18px, auto);
  height: 36px;
  min-width: 64px;
  overflow: hidden;
  padding: 0 8px;
  width: 64px;
}

.ysw-card-table .ysw-unit .ysw-stat-badge small,
.ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
  min-width: 16px;
}

.ysw-card-table .ysw-unit .ysw-stat-badge small::before,
.ysw-card-table .ysw-enemy-unit .ysw-stat-badge small::before {
  display: block;
  line-height: 1;
}

.ysw-card-table .ysw-unit .ysw-atk-badge {
  left: 8px;
}

.ysw-card-table .ysw-unit .ysw-hp-badge {
  right: 8px;
}

.ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
  left: 8px;
}

.ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
  right: 8px;
}

/* Enemy minion field cards follow the same readable overlay layout as player units. */
.ysw-card-table .ysw-enemy-unit {
  padding: 0;
}

.ysw-card-table .ysw-enemy-unit .ysw-card-visual {
  border-radius: inherit;
  height: 100%;
  inset: 0;
  margin: 0;
  min-height: 0;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.ysw-card-table .ysw-enemy-unit .ysw-card-visual img {
  object-fit: cover;
  object-position: center 24%;
}

.ysw-card-table .ysw-enemy-unit .ysw-card-visual::after {
  background:
    linear-gradient(180deg, rgba(5, 10, 18, .08) 0%, rgba(5, 10, 18, .34) 54%, rgba(5, 10, 18, .9) 100%),
    linear-gradient(90deg, rgba(5, 10, 18, .4), transparent 48%, rgba(5, 10, 18, .2));
}

.ysw-card-table .ysw-enemy-unit > :not(.ysw-card-visual):not(.ysw-card-feedbacks) {
  position: absolute;
  z-index: 2;
}

.ysw-card-table .ysw-enemy-unit .ysw-enemy-kind {
  background: linear-gradient(90deg, rgba(5, 12, 22, .92), rgba(5, 12, 22, .62));
  border: 1px solid rgba(255, 185, 201, .44);
  border-radius: 999px;
  color: #ffceda;
  display: block;
  font-size: 11px;
  font-weight: 950;
  left: 7px;
  line-height: 1;
  max-width: calc(100% - 38px);
  overflow: hidden;
  padding: 5px 7px;
  right: auto;
  text-overflow: ellipsis;
  top: 7px;
  white-space: nowrap;
}

.ysw-card-table .ysw-enemy-unit .ysw-enemy-unit-icon {
  align-items: center;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  left: auto;
  right: 7px;
  top: 7px;
  width: 28px;
  z-index: 4;
}

.ysw-card-table .ysw-enemy-unit .ysw-enemy-name {
  background: linear-gradient(90deg, rgba(5, 12, 22, .92), rgba(5, 12, 22, .58));
  bottom: 0;
  color: #ffffff;
  display: block;
  font-size: 12px;
  font-weight: 950;
  left: 0;
  line-height: 1.15;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  padding: 6px 8px;
  right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-enemy-unit p,
.ysw-card-table .ysw-enemy-unit .ysw-state-badge {
  display: none;
}

.ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
  bottom: 28px;
  z-index: 3;
}

.ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
  left: 8px;
}

.ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
  right: 8px;
}

@media (max-width: 940px) {
  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    column-gap: 2px;
    font-size: 13px;
    grid-template-columns: 12px minmax(13px, auto);
    height: 25px;
    min-width: 46px;
    padding: 0 4px;
    width: 46px;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
    min-width: 12px;
  }
}

/* Hand cards: keep role chips readable instead of truncating labels. */
.ysw-card-table .ysw-hand-card .ysw-role-tags {
  align-content: flex-start;
  bottom: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  left: 7px;
  max-height: 34px;
  max-width: calc(100% - 14px);
  overflow: visible;
  right: 7px;
}

.ysw-card-table .ysw-hand-card .ysw-role-tags i {
  flex: 0 0 auto;
  font-size: 8px;
  line-height: 1;
  max-width: none;
  overflow: visible;
  padding: 3px 5px;
  text-overflow: clip;
  white-space: nowrap;
}

.ysw-card-table .ysw-hand-card.ysw-type-unit .ysw-role-tags {
  bottom: 41px;
}

/* Leader HP deltas should read as big impact text, not tiny meter text. */
.ysw-card-table .ysw-table-leaders {
  overflow: visible;
}

.ysw-card-table .ysw-hp-meter {
  overflow: visible;
  position: relative;
}

.ysw-card-table .ysw-hp-feedbacks {
  bottom: auto;
  left: 50%;
  min-width: min(220px, 52vw);
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 90;
}

.ysw-card-table .ysw-hp-feedback {
  animation: yswHpFeedbackImpact 1300ms cubic-bezier(.14, .82, .22, 1) both;
  display: block;
  font-size: clamp(32px, 2.4vw, 48px);
  line-height: .72;
  paint-order: stroke fill;
  -webkit-text-fill-color: #fff5f7;
  -webkit-text-stroke: 1.6px rgba(255, 48, 96, .98);
  text-shadow:
    0 0 10px rgba(255, 72, 112, .96),
    0 0 24px rgba(255, 72, 112, .62),
    0 5px 12px rgba(2, 6, 12, .95);
}

.ysw-card-table .ysw-table-leaders .ysw-leader .ysw-hp-feedbacks .ysw-hp-feedback {
  font-size: clamp(32px, 2.4vw, 48px) !important;
  line-height: .72 !important;
}

.ysw-card-table .ysw-hp-feedback-static {
  animation: none;
  opacity: .96;
  transform: translateY(-4px) scale(1);
}

.ysw-card-table .ysw-hp-feedback-heal {
  -webkit-text-fill-color: #f0fff8;
  -webkit-text-stroke-color: rgba(48, 232, 158, .98);
  text-shadow:
    0 0 10px rgba(105, 240, 196, .98),
    0 0 24px rgba(105, 240, 196, .62),
    0 5px 12px rgba(2, 6, 12, .95);
}

@keyframes yswHpFeedbackImpact {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.52);
  }

  14% {
    opacity: 1;
    transform: translateY(-2px) scale(1.18);
  }

  36%,
  68% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-36px) scale(1.04);
  }
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-hand-card .ysw-role-tags i {
    font-size: 8.8px;
  }
}

@media (max-width: 940px) {
  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    bottom: 29px;
    gap: 2px;
    left: 5px;
    max-height: 28px;
    max-width: calc(100% - 10px);
    right: 5px;
  }

  .ysw-card-table .ysw-hand-card.ysw-type-unit .ysw-role-tags {
    bottom: 31px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags i {
    font-size: 6.8px;
    padding: 2px 3px;
  }

  .ysw-card-table .ysw-hp-feedbacks {
    min-width: min(150px, 70vw);
  }

  .ysw-card-table .ysw-hp-feedback {
    font-size: clamp(22px, 5.2vw, 34px);
    -webkit-text-stroke-width: 1.3px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-hp-feedbacks .ysw-hp-feedback {
    font-size: clamp(22px, 5.2vw, 34px) !important;
  }
}

/* Equipped gear sits on the player field and can be inspected from the detail panel. */
.ysw-card-table .ysw-board-wrap {
  position: relative;
}

.ysw-card-table .ysw-gears {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 5px;
  left: auto;
  max-width: min(250px, 36%);
  pointer-events: auto;
  right: 10px;
  top: 10px;
  z-index: 12;
}

.ysw-card-table .ysw-board-wrap.has-gears .ysw-board {
  box-sizing: border-box;
  padding-right: min(270px, 38%);
}

.ysw-card-table .ysw-gear-empty {
  align-self: flex-end;
  opacity: .9;
}

.ysw-card-table .ysw-gear-chip {
  align-items: center;
  background:
    linear-gradient(145deg, rgba(9, 22, 32, .95), rgba(7, 12, 22, .92)),
    radial-gradient(circle at 16% 48%, rgba(36, 210, 255, .22), transparent 42%);
  border: 1px solid rgba(105, 240, 196, .42);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .32), inset 0 0 14px rgba(36, 210, 255, .08);
  color: #ecfbff;
  cursor: pointer;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
  padding: 5px 8px 5px 10px;
  text-align: left;
  width: 100%;
}

.ysw-card-table .ysw-gear-chip b {
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ysw-card-table .ysw-gear-chip em {
  background: rgba(216, 246, 87, .14);
  border: 1px solid rgba(216, 246, 87, .28);
  border-radius: 999px;
  color: #d8f657;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  padding: 3px 5px;
  white-space: nowrap;
}

.ysw-card-table .ysw-gear-chip:hover,
.ysw-card-table .ysw-gear-chip.is-selected {
  border-color: rgba(216, 246, 87, .82);
  box-shadow:
    0 0 0 1px rgba(216, 246, 87, .34),
    0 0 22px rgba(216, 246, 87, .22),
    inset 0 0 18px rgba(36, 210, 255, .12);
}

/* Combat reveal polish: show enemy action art and make leader cut-ins hit harder. */
.ysw-card-table .ysw-enemy-card--action-art {
  background:
    linear-gradient(115deg, rgba(5, 9, 16, .56) 0%, rgba(7, 13, 22, .28) 48%, rgba(12, 8, 19, .06) 100%),
    rgba(6, 11, 19, .46);
}

.ysw-card-table .ysw-enemy-card--action-art::after {
  background:
    radial-gradient(circle at 16% 22%, rgba(36, 210, 255, .14), transparent 34%),
    linear-gradient(90deg, rgba(3, 7, 13, .52) 0%, rgba(3, 7, 13, .22) 43%, rgba(3, 7, 13, .02) 100%);
}

.ysw-card-table .ysw-enemy-card--action-art > .ysw-enemy-card-art {
  filter: brightness(1.34) contrast(1.16) saturate(1.18);
  opacity: 1;
}

.ysw-card-table .ysw-enemy-card--action-art .ysw-enemy-chip,
.ysw-card-table .ysw-enemy-card--action-art small,
.ysw-card-table .ysw-enemy-card--action-art strong,
.ysw-card-table .ysw-enemy-card--action-art p {
  text-shadow:
    0 0 14px rgba(4, 10, 18, .95),
    0 2px 9px rgba(0, 0, 0, .96);
}

.ysw-battle-cutin {
  background:
    radial-gradient(circle at 50% 50%, rgba(36, 210, 255, .13), transparent 44%),
    linear-gradient(90deg, rgba(2, 6, 12, .1), rgba(2, 6, 12, .58), rgba(2, 6, 12, .1));
}

.ysw-battle-cutin > div {
  gap: 8px 28px;
  grid-template-columns: clamp(210px, 18vw, 260px) minmax(0, 1fr);
  max-width: min(92vw, 1180px);
  min-height: clamp(250px, 28vh, 320px);
  padding: clamp(18px, 2vw, 28px) clamp(28px, 3vw, 46px) clamp(18px, 2vw, 28px) clamp(18px, 2vw, 28px);
  width: min(92vw, 1180px);
}

.ysw-battle-cutin img {
  border-radius: 8px;
  height: clamp(210px, 18vw, 260px);
  width: clamp(210px, 18vw, 260px);
}

.ysw-battle-cutin span {
  font-size: clamp(18px, 1.6vw, 26px);
}

.ysw-battle-cutin strong {
  font-size: clamp(40px, 4.15vw, 70px);
  letter-spacing: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

@media (max-width: 940px) {
  .ysw-battle-cutin > div {
    gap: 4px 14px;
    grid-template-columns: 132px minmax(0, 1fr);
    max-width: min(92vw, 720px);
    min-height: 152px;
    padding: 10px 14px 10px 10px;
    width: min(92vw, 720px);
  }

  .ysw-battle-cutin img {
    height: 132px;
    width: 132px;
  }

  .ysw-battle-cutin span {
    font-size: 14px;
  }

  .ysw-battle-cutin strong {
    font-size: clamp(24px, 5.1vw, 36px);
    white-space: nowrap;
  }

  .ysw-card-table .ysw-gears {
    gap: 3px;
    max-width: 42%;
    right: 6px;
    top: 6px;
  }

  .ysw-card-table .ysw-board-wrap.has-gears .ysw-board {
    padding-right: min(150px, 44%);
  }

  .ysw-card-table .ysw-gear-chip {
    min-height: 24px;
    padding: 4px 6px 4px 7px;
  }

  .ysw-card-table .ysw-gear-chip b {
    font-size: 9px;
  }

  .ysw-card-table .ysw-gear-chip em {
    display: none;
  }
}

.ysw-card-table .ysw-unit.is-targetable:not(.is-defeated) {
  border-color: rgba(216, 246, 87, .82);
  box-shadow:
    0 0 0 1px rgba(216, 246, 87, .3),
    0 0 24px rgba(216, 246, 87, .18);
  cursor: pointer;
}

.ysw-card-table .ysw-unit.is-targetable:not(.is-defeated) .ysw-state-badge {
  background: rgba(216, 246, 87, .2);
  border-color: rgba(216, 246, 87, .5);
  color: #f2ff94;
}

/* Release responsive pass: keep the whole game usable on laptop and phone screens. */
.ysw-shell:fullscreen,
.ysw-game:fullscreen .ysw-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  position: fixed;
}

.ysw-shell:fullscreen .ysw-topbar,
.ysw-game:fullscreen .ysw-shell .ysw-topbar {
  flex: 0 0 auto;
}

.ysw-shell:fullscreen .ysw-view,
.ysw-game:fullscreen .ysw-shell .ysw-view {
  flex: 1 1 auto;
  min-height: 0;
}

.ysw-shell:fullscreen .ysw-battle,
.ysw-game:fullscreen .ysw-battle,
.ysw-shell:fullscreen .ysw-card-table,
.ysw-game:fullscreen .ysw-card-table {
  height: auto;
}

@media (min-width: 941px) and (max-height: 900px) {
  .ysw-shell:fullscreen .ysw-topbar,
  .ysw-game:fullscreen .ysw-shell .ysw-topbar {
    min-height: 66px;
    padding: 8px 14px;
  }

  .ysw-shell:fullscreen .ysw-kicker,
  .ysw-game:fullscreen .ysw-kicker {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .ysw-shell:fullscreen .ysw-topbar h2,
  .ysw-game:fullscreen .ysw-topbar h2 {
    font-size: 20px;
  }

  .ysw-shell:fullscreen .ysw-tabs button,
  .ysw-game:fullscreen .ysw-tabs button {
    min-height: 40px;
    padding: 8px 12px;
  }

  .ysw-card-table {
    gap: 6px;
    padding: 6px 10px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 6px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader {
    min-height: 128px;
    padding: 7px 9px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 128px;
    padding-left: 86px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 78px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader span,
  .ysw-card-table .ysw-table-leaders .ysw-leader small,
  .ysw-card-table .ysw-enemy-board-head small {
    font-size: 11px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 24px;
  }

  .ysw-card-table .ysw-hp-gauge-row {
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) 112px;
    margin-top: 6px;
  }

  .ysw-card-table .ysw-meter,
  .ysw-card-table .ysw-special-gauge {
    height: 18px;
    min-height: 18px;
  }

  .ysw-card-table .ysw-special-gauge {
    width: 112px;
  }

  .ysw-card-table .ysw-pp-display {
    padding: 4px 8px;
  }

  .ysw-card-table .ysw-pp-display span,
  .ysw-card-table .ysw-pp-display em {
    font-size: 11px;
  }

  .ysw-card-table .ysw-pp-display strong {
    font-size: 24px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 158px;
    min-height: 158px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 132px;
    min-height: 132px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 128px;
    height: 124px;
    min-height: 124px;
  }

  .ysw-card-table .ysw-battle-detail {
    grid-template-rows: minmax(132px, auto) minmax(80px, 1fr) auto;
  }

  .ysw-card-table .ysw-detail-card {
    padding: 10px;
  }

  .ysw-card-table .ysw-detail-card strong {
    font-size: 18px;
  }

  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-recent-events p {
    font-size: 12px;
    line-height: 1.4;
  }

  .ysw-card-table .ysw-recent-events {
    max-height: 150px;
  }

  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    min-height: 44px;
    padding: 8px 10px;
  }
}

@media (min-width: 941px) and (max-height: 800px) {
  .ysw-shell:fullscreen .ysw-topbar,
  .ysw-game:fullscreen .ysw-shell .ysw-topbar {
    min-height: 58px;
    padding: 6px 12px;
  }

  .ysw-shell:fullscreen .ysw-topbar h2,
  .ysw-game:fullscreen .ysw-topbar h2 {
    font-size: 18px;
  }

  .ysw-shell:fullscreen .ysw-tabs button,
  .ysw-game:fullscreen .ysw-tabs button {
    min-height: 34px;
    padding: 6px 10px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader {
    min-height: 104px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 104px;
    padding-left: 72px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 64px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 21px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 128px;
    min-height: 128px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 106px;
    min-height: 106px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 112px;
    height: 100px;
    min-height: 100px;
  }

  .ysw-card-table .ysw-hand-card strong {
    font-size: 10px;
    min-height: 22px;
  }

  .ysw-card-table .ysw-hand-card .ysw-role-tags {
    display: none;
  }

  .ysw-card-table .ysw-recent-events {
    display: none;
  }
}

@media (max-width: 940px) {
  .ysw-shell {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin: 0;
    max-width: none;
    width: 100%;
  }

  .ysw-topbar {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 10px;
  }

  .ysw-kicker {
    font-size: 10px;
  }

  .ysw-topbar h2 {
    font-size: clamp(18px, 5vw, 24px);
  }

  .ysw-tabs {
    display: flex;
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
  }

  .ysw-tabs button {
    flex: 0 0 auto;
    font-size: 13px;
    min-height: 36px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .ysw-audio-controls {
    justify-content: space-between;
    max-width: 100%;
  }

  .ysw-view {
    padding: 12px;
  }

  .ysw-title-screen {
    align-items: start;
    gap: 14px;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ysw-title-city {
    aspect-ratio: 16 / 9;
    min-height: 0;
    width: 100%;
  }

  .ysw-title-copy h1 {
    font-size: clamp(32px, 9vw, 54px);
  }

  .ysw-title-copy p {
    font-size: 14px;
    line-height: 1.6;
  }

  .ysw-title-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-title-actions button,
  .ysw-cinematic-actions button,
  .ysw-story-tools button {
    width: 100%;
  }

  .ysw-opening,
  .ysw-story-screen,
  .ysw-end-roll {
    min-height: min(640px, calc(100svh - 72px));
  }

  .ysw-opening-stage,
  .ysw-opening-city,
  .ysw-end-roll-stage {
    min-height: min(560px, calc(100svh - 96px));
  }

  .ysw-opening > .ysw-cinematic-actions,
  .ysw-end-roll-actions {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .ysw-opening-lines {
    min-height: 190px;
    padding: 12px;
  }

  .ysw-opening-lines article {
    inset: 12px;
    padding: 13px;
  }

  .ysw-opening-lines h3 {
    font-size: clamp(24px, 7vw, 36px);
  }

  .ysw-opening-lines span {
    font-size: 14px;
  }

  .ysw-campaign,
  .ysw-gallery,
  .ysw-characters,
  .ysw-glossary,
  .ysw-save,
  .ysw-settings,
  .ysw-info {
    gap: 10px;
  }

  .ysw-status-band,
  .ysw-deck .ysw-deck-summary,
  .ysw-info-grid,
  .ysw-gallery-grid,
  .ysw-character-grid,
  .ysw-glossary-grid,
  .ysw-save,
  .ysw-settings,
  .ysw-info {
    grid-template-columns: 1fr;
  }

  .ysw-deck-summary-actions,
  .ysw-deck .ysw-deck-summary .ysw-primary,
  .ysw-deck .ysw-deck-summary .ysw-secondary {
    justify-self: stretch;
  }

  .ysw-deck-summary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ysw-deck-builder {
    grid-template-columns: 1fr;
  }

  .ysw-deck-filters,
  .ysw-deck-builder .ysw-deck-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ysw-deck-filters label,
  .ysw-deck-builder .ysw-deck-filters label {
    flex-basis: auto;
    min-width: 0;
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    max-height: none;
  }

  .ysw-deck-builder .ysw-library-card {
    height: auto;
    min-height: 260px;
  }

  .ysw-deck-side-current .ysw-current-list,
  .ysw-current-list {
    max-height: none;
  }

  .ysw-gallery-intro,
  .ysw-character-intro {
    align-items: stretch;
    display: grid;
  }

  .ysw-character-card {
    grid-template-columns: 1fr;
  }

  .ysw-character-portrait {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-shell,
  .ysw-shell:fullscreen,
  .ysw-game:fullscreen .ysw-shell {
    display: flex;
    flex-direction: column;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .ysw-topbar {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(min(290px, 42vw), .42fr) minmax(0, 1fr);
    padding: 5px 7px;
  }

  .ysw-topbar > div {
    min-width: 0;
  }

  .ysw-topbar .ysw-kicker {
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .ysw-topbar h2 {
    font-size: clamp(10px, 1.45vw, 14px);
    line-height: 1.05;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .ysw-audio-controls {
    display: none;
  }

  .ysw-view {
    overflow: auto;
  }

  .ysw-battle,
  .ysw-card-table {
    flex: 1 1 auto;
    gap: 4px;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 4px 6px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 4px;
    grid-template-columns: .9fr 1fr;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader {
    min-height: 56px;
    padding: 4px 6px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 56px;
    padding-left: 52px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 46px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader span,
  .ysw-card-table .ysw-table-leaders .ysw-leader small {
    display: none;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 17px;
  }

  .ysw-card-table .ysw-player-resource-row {
    gap: 4px;
    margin-top: 4px;
  }

  .ysw-card-table .ysw-pp-display,
  .ysw-card-table .ysw-burst-count,
  .ysw-card-table .ysw-deck-count {
    padding: 3px 6px;
  }

  .ysw-card-table .ysw-pp-display strong,
  .ysw-card-table .ysw-burst-count strong,
  .ysw-card-table .ysw-deck-count strong {
    font-size: 16px;
  }

  .ysw-card-table .ysw-hp-gauge-row {
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) 70px;
    margin-top: 3px;
  }

  .ysw-card-table .ysw-meter,
  .ysw-card-table .ysw-special-gauge {
    height: 14px;
    min-height: 14px;
  }

  .ysw-card-table .ysw-special-gauge {
    width: 70px;
  }

  .ysw-card-table .ysw-special-gauge strong {
    font-size: 9px;
  }

  .ysw-card-table .ysw-table-main {
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 156px);
  }

  .ysw-card-table .ysw-table-field {
    gap: 4px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 92px;
    min-height: 92px;
    padding: 4px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 82px;
    min-height: 82px;
    padding: 4px;
  }

  .ysw-card-table .ysw-enemy-board-head {
    margin-bottom: 3px;
  }

  .ysw-card-table .ysw-enemy-board-head span {
    font-size: 10px;
  }

  .ysw-card-table .ysw-gears {
    display: none;
  }

  .ysw-card-table .ysw-enemy-unit,
  .ysw-card-table .ysw-unit {
    flex-basis: 86px;
    min-height: 0;
    padding: 0;
  }

  .ysw-card-table .ysw-enemy-unit {
    flex-basis: 102px;
    min-height: 62px;
  }

  .ysw-card-table .ysw-enemy-unit small,
  .ysw-card-table .ysw-enemy-unit p,
  .ysw-card-table .ysw-role-tags,
  .ysw-card-table .ysw-card-type {
    display: none;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 58px;
    min-height: 58px;
    padding-bottom: 2px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 82px;
    height: 54px;
    min-height: 54px;
  }

  .ysw-card-table .ysw-unit .ysw-card-name,
  .ysw-card-table .ysw-enemy-unit strong,
  .ysw-card-table .ysw-hand-card strong {
    font-size: 8px;
    min-height: 18px;
    padding: 3px 20px 3px 4px;
  }

  .ysw-card-table .ysw-cost,
  .ysw-card-table .ysw-hand-card .ysw-cost {
    font-size: 9px;
    height: 17px;
    width: 17px;
  }

  .ysw-card-table .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    border-radius: 5px;
    font-size: 10px;
    height: 18px;
    min-width: 22px;
    width: 22px;
  }

  .ysw-card-table .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: none;
  }

  .ysw-card-table .ysw-atk-badge,
  .ysw-card-table .ysw-hp-badge,
  .ysw-card-table .ysw-hand-card .ysw-atk-badge,
  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    bottom: 3px;
  }

  .ysw-card-table .ysw-battle-detail {
    gap: 5px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .ysw-card-table .ysw-detail-card {
    padding: 7px;
  }

  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-detail-tags,
  .ysw-card-table .ysw-recent-events {
    display: none;
  }

  .ysw-card-table .ysw-detail-card strong {
    font-size: 14px;
  }

  .ysw-card-table .ysw-battle-actions {
    gap: 5px;
  }

  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    font-size: 10px;
    min-height: 30px;
    padding: 5px 6px;
  }

  .ysw-deck-builder {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .ysw-shell,
  .ysw-shell:fullscreen,
  .ysw-game:fullscreen .ysw-shell {
    height: 100svh;
    min-height: 0;
    overflow: auto;
  }

  .ysw-topbar {
    padding: 9px 10px;
  }

  .ysw-tabs button {
    font-size: 12px;
    min-height: 34px;
    padding: 7px 9px;
  }

  .ysw-audio-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ysw-audio-controls label {
    min-width: 0;
  }

  .ysw-audio-controls input {
    width: 100%;
  }

  .ysw-title-actions {
    grid-template-columns: 1fr;
  }

  .ysw-title-city {
    min-height: 210px;
  }

  .ysw-battle,
  .ysw-card-table {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 10px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 7px;
    grid-template-columns: 1fr;
    margin-bottom: 8px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader {
    min-height: 108px;
    padding: 7px 8px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 108px;
    padding-left: 78px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 70px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader span,
  .ysw-card-table .ysw-table-leaders .ysw-leader small {
    font-size: 10px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 21px;
  }

  .ysw-card-table .ysw-hp-gauge-row {
    margin-top: 5px;
  }

  .ysw-card-table .ysw-table-main {
    display: block;
    height: auto;
    min-width: 0;
    overflow: visible;
  }

  .ysw-card-table .ysw-table-field {
    display: grid;
    gap: 7px;
    margin-bottom: 8px;
    min-width: 0;
    overflow: visible;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: auto;
    min-height: 122px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: auto;
    min-height: 108px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
  }

  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-battle-detail {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-enemy-unit {
    flex-basis: 126px;
    height: 112px;
    min-height: 112px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 112px;
    height: 104px;
    min-height: 104px;
  }

  .ysw-card-table .ysw-battle-detail {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    margin-top: 10px;
  }

  .ysw-card-table .ysw-detail-card p,
  .ysw-card-table .ysw-detail-tags {
    display: block;
  }

  .ysw-card-table .ysw-recent-events {
    display: block;
    max-height: 116px;
  }

  .ysw-card-table .ysw-battle-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-orientation-hint {
    display: grid;
  }

  .ysw-deck-builder .ysw-card-pool {
    grid-template-columns: 1fr;
  }

  .ysw-deck-builder .ysw-library-card {
    min-height: 286px;
  }

  .ysw-deck .ysw-deck-summary strong {
    font-size: 22px;
  }
}

/* Responsive audit correction pass: scroll document-like views, keep game scenes fixed. */
.ysw-shell:fullscreen .ysw-view,
.ysw-game:fullscreen .ysw-shell .ysw-view {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ysw-shell:fullscreen .ysw-title-screen,
.ysw-game:fullscreen .ysw-title-screen,
.ysw-shell:fullscreen .ysw-opening,
.ysw-game:fullscreen .ysw-opening,
.ysw-shell:fullscreen .ysw-story-screen,
.ysw-game:fullscreen .ysw-story-screen,
.ysw-shell:fullscreen .ysw-end-roll,
.ysw-game:fullscreen .ysw-end-roll,
.ysw-shell:fullscreen .ysw-battle,
.ysw-game:fullscreen .ysw-battle,
.ysw-shell:fullscreen .ysw-card-table,
.ysw-game:fullscreen .ysw-card-table {
  overflow: hidden;
}

.ysw-save,
.ysw-settings {
  align-items: start;
}

.ysw-save-panel {
  align-content: start;
  align-self: start;
}

.ysw-save-actions {
  align-items: flex-start;
}

.ysw-save-actions button {
  align-self: flex-start;
  max-height: 64px;
  min-height: 46px;
}

@media (min-width: 941px) and (max-height: 900px) {
  .ysw-game:fullscreen .ysw-card-table .ysw-table-field,
  .ysw-shell:fullscreen .ysw-card-table .ysw-table-field {
    min-height: 0;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap {
    flex: .72 1 140px;
    min-height: 118px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex: 1 1 152px;
    min-height: 136px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex: 0 0 132px;
    min-height: 132px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 128px;
    height: 124px;
    min-height: 124px;
  }
}

@media (min-width: 941px) and (max-height: 800px) {
  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 118px;
    min-height: 104px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 130px;
    min-height: 116px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 122px;
    min-height: 122px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 120px;
    height: 116px;
    min-height: 116px;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table,
  .ysw-card-table .ysw-table-main,
  .ysw-card-table .ysw-battle-detail,
  .ysw-card-table .ysw-battle-actions,
  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    max-width: 100%;
    min-width: 0;
  }

  .ysw-shell-cinematic .ysw-title-screen {
    align-items: stretch;
    gap: 8px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .88fr);
    padding: 8px 12px;
  }

  .ysw-game:fullscreen .ysw-title-city,
  .ysw-title-city {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }

  .ysw-title-copy {
    align-content: center;
    gap: 8px;
    min-height: 0;
  }

  .ysw-game:fullscreen .ysw-title-copy h1,
  .ysw-title-copy h1 {
    font-size: clamp(34px, 6.3vw, 52px);
    line-height: .98;
  }

  .ysw-title-copy p {
    font-size: 11px;
    line-height: 1.45;
    max-height: 66px;
    overflow: hidden;
  }

  .ysw-title-actions {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ysw-title-actions button {
    font-size: 12px;
    min-height: 42px;
    padding: 8px 10px;
  }
}

@media (orientation: landscape) {
  .ysw-game:fullscreen .ysw-orientation-hint,
  .ysw-shell:fullscreen .ysw-orientation-hint {
    display: none;
  }
}

/* Release polish: keep scrollable screens usable without the browser-default white bars. */
.ysw-game,
.ysw-game * {
  scrollbar-color: rgba(125, 218, 255, .62) rgba(4, 10, 18, .72);
  scrollbar-width: thin;
}

.ysw-game ::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.ysw-game ::-webkit-scrollbar-track {
  background: rgba(4, 10, 18, .78);
  border-radius: 999px;
}

.ysw-game ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(36, 210, 255, .68), rgba(210, 255, 64, .52));
  border: 2px solid rgba(4, 10, 18, .82);
  border-radius: 999px;
}

.ysw-game ::-webkit-scrollbar-corner {
  background: rgba(4, 10, 18, .78);
}

.ysw-mobile-nav,
.ysw-mobile-battle-tools,
.ysw-mobile-detail-sheet,
.ysw-mobile-effects-sheet {
  display: none;
}

.ysw-mobile-use-card {
  display: none;
}

.ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
  min-height: 30px;
  overflow: visible;
  padding: 3px 7px;
}

.ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
  line-height: 1;
  margin-bottom: 1px;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-topbar {
    grid-template-columns: minmax(144px, 1fr) auto;
    padding: 3px 6px;
    position: relative;
    z-index: 90;
  }

  .ysw-mobile-nav {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
  }

  .ysw-mobile-nav > span {
    color: #c6e8f7;
    font-size: 11px;
    max-width: 22vw;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ysw-mobile-menu-toggle,
  .ysw-mobile-status-toggle {
    background: rgba(9, 18, 30, .92);
    border: 1px solid rgba(140, 207, 225, .34);
    border-radius: 7px;
    color: #eefcff;
    font-size: 12px;
    font-weight: 800;
    min-height: 32px;
    padding: 5px 10px;
  }

  .ysw-card-table {
    gap: 3px;
    padding: 3px 5px;
  }

  .ysw-card-table .ysw-table-leaders {
    gap: 3px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader {
    min-height: 50px;
    padding: 3px 5px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 50px;
    padding-left: 47px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 42px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader strong {
    font-size: 16px;
  }

  .ysw-card-table .ysw-hp-gauge-row {
    margin-top: 2px;
  }

  .ysw-card-table .ysw-meter,
  .ysw-card-table .ysw-special-gauge {
    height: 12px;
    min-height: 12px;
  }

  .ysw-card-table .ysw-player-resource-row {
    margin-top: 2px;
  }

  .ysw-card-table .ysw-table-field {
    gap: 3px;
    position: relative;
  }

  .ysw-mobile-status-toggle {
    background: linear-gradient(135deg, rgba(36, 210, 255, .82), rgba(210, 255, 64, .7));
    color: #06111d;
  }

  .ysw-tabs {
    display: none;
  }

  .ysw-tabs.is-open {
    background: rgba(4, 10, 18, .96);
    border: 1px solid rgba(140, 207, 225, .32);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .46);
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(100svh - 58px);
    overflow: auto;
    padding: 7px;
    position: absolute;
    right: 7px;
    top: calc(100% + 4px);
    width: min(390px, 82vw);
    z-index: 120;
  }

  .ysw-tabs.is-open button {
    justify-content: center;
    min-height: 36px;
    width: 100%;
  }

  .ysw-opening-sequence-video {
    display: none;
  }

  .ysw-shell-opening .ysw-opening-sequence-video {
    display: block;
    z-index: 2;
  }

  .ysw-opening-video-fallback {
    z-index: 2;
  }

  .ysw-shell-opening .ysw-opening-video-fallback {
    z-index: 1;
  }

  .ysw-mobile-battle-tools {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 22;
  }

  .ysw-mobile-battle-tools button {
    background: rgba(4, 10, 18, .86);
    border: 1px solid rgba(210, 255, 64, .58);
    border-radius: 999px;
    color: #dfff42;
    font-size: 11px;
    font-weight: 900;
    min-height: 32px;
    padding: 5px 12px;
    pointer-events: auto;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap {
    flex-basis: 88px;
    min-height: 88px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 64px;
    min-height: 64px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 56px;
    min-height: 56px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    height: 54px;
    min-height: 54px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type,
  .ysw-card-table .ysw-hand-card .ysw-role-tags,
  .ysw-card-table .ysw-hand-card strong,
  .ysw-card-table .ysw-hand-card > small,
  .ysw-card-table .ysw-hand-card p {
    display: none;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-visual::after {
    background:
      linear-gradient(180deg, rgba(5, 10, 18, .06), rgba(5, 10, 18, .16) 52%, rgba(5, 10, 18, .42)),
      linear-gradient(90deg, rgba(5, 10, 18, .42), transparent 38%, rgba(5, 10, 18, .42));
  }

  .ysw-mobile-detail-sheet,
  .ysw-mobile-effects-sheet {
    background: rgba(3, 8, 14, .97);
    border: 1px solid rgba(125, 218, 255, .42);
    border-radius: 10px 10px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .52);
    color: #eefdff;
    display: grid;
    gap: 8px;
    left: 8px;
    max-height: min(48svh, 230px);
    overflow: auto;
    padding: 9px 10px 10px;
    position: fixed;
    right: 8px;
    z-index: 160;
  }

  .ysw-mobile-effects-sheet {
    max-height: min(70svh, 330px);
  }

  .ysw-mobile-sheet-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
  }

  .ysw-mobile-sheet-head span {
    color: #dfff42;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .ysw-mobile-sheet-head button {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(190, 220, 230, .34);
    border-radius: 7px;
    color: #eefcff;
    font-size: 12px;
    min-height: 32px;
    padding: 5px 10px;
  }

  .ysw-mobile-detail-sheet .ysw-detail-card,
  .ysw-mobile-effects-sheet .ysw-detail-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .ysw-card-table .ysw-mobile-detail-sheet .ysw-detail-card p,
  .ysw-card-table .ysw-mobile-detail-sheet .ysw-detail-tags,
  .ysw-card-table .ysw-mobile-effects-sheet .ysw-detail-card p,
  .ysw-card-table .ysw-mobile-effects-sheet .ysw-detail-tags {
    display: block;
  }

  .ysw-mobile-detail-sheet .ysw-detail-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 5px;
  }

  .ysw-mobile-detail-sheet .ysw-detail-card p {
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 6px;
  }

  .ysw-mobile-detail-sheet .ysw-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .ysw-mobile-detail-sheet .ysw-detail-tags i {
    font-size: 10px;
    min-height: 22px;
    padding: 4px 7px;
  }

  .ysw-mobile-detail-sheet .ysw-mobile-use-card {
    display: inline-flex;
    margin: 4px 8px 0 0;
    min-height: 36px;
    padding: 7px 14px;
  }

  .ysw-mobile-detail-sheet .ysw-detail-discard {
    min-height: 36px;
    padding: 7px 12px;
  }

  .ysw-mobile-effects-list {
    display: grid;
    gap: 9px;
  }

  .ysw-mobile-effects-list section {
    border-top: 1px solid rgba(125, 218, 255, .16);
    display: grid;
    gap: 6px;
    padding-top: 8px;
  }

  .ysw-mobile-effects-list h4 {
    color: #dfff42;
    font-size: 12px;
    margin: 0;
  }

  .ysw-mobile-effects-list article {
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(140, 207, 225, .14);
    border-radius: 7px;
    padding: 7px 8px;
  }

  .ysw-mobile-effects-list strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
  }

  .ysw-mobile-effects-list p {
    color: #cfe3ed;
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
  }

  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    bottom: 4px;
    height: 20px;
    min-height: 20px;
    min-width: 26px;
    padding: 1px 3px;
    width: 26px;
  }

  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
    display: none;
  }

  .ysw-leader-select {
    gap: 7px;
    padding: 6px 8px;
  }

  .ysw-leader-brief {
    padding: 8px 10px;
  }

  .ysw-leader-grid {
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  }

  .ysw-leader-select .ysw-leader-card {
    min-height: 248px;
    padding: 6px;
  }

  .ysw-leader-select .ysw-leader-card .ysw-card-visual {
    height: 104px;
    min-height: 104px;
  }

  .ysw-leader-card small,
  .ysw-leader-card em,
  .ysw-leader-card p {
    font-size: 10px;
    line-height: 1.35;
  }

  .ysw-leader-card p {
    max-height: 54px;
    overflow: auto;
  }

  .ysw-leader-actions {
    background: rgba(4, 10, 18, .92);
    border-top: 1px solid rgba(140, 207, 225, .18);
    bottom: 0;
    padding-top: 6px;
    position: sticky;
    z-index: 12;
  }

  .ysw-character-grid {
    grid-template-columns: 1fr;
  }

  .ysw-character-card {
    gap: 8px;
    grid-template-columns: minmax(116px, .42fr) minmax(0, 1fr);
  }

  .ysw-character-portrait {
    aspect-ratio: 4 / 3;
    max-height: 150px;
    min-height: 0;
  }

  .ysw-character-card p {
    max-height: 64px;
    overflow: auto;
  }

  .ysw-character-voices {
    max-height: 68px;
    overflow: auto;
  }
}

/* Smartphone landscape gameplay polish: keep details in the side panel and reduce board clutter. */
@media (max-width: 940px) and (orientation: landscape) {
  .ysw-story-screen {
    align-items: start;
    padding-top: 4px;
  }

  .ysw-story-panel {
    gap: 8px;
    margin: 4px auto 0;
    max-height: calc(100svh - 56px);
    max-width: calc(100% - 28px);
    padding: 12px 14px;
  }

  .ysw-story-panel h1 {
    font-size: clamp(21px, 5.4svh, 30px);
    line-height: 1.08;
  }

  .ysw-story-body {
    gap: 7px;
    max-height: min(34svh, 138px);
    overflow: auto;
    padding-right: 2px;
  }

  .ysw-story-body p {
    font-size: 12px;
    line-height: 1.48;
  }

  .ysw-story-panel .ysw-story-progress {
    margin-top: 0;
  }

  .ysw-story-panel .ysw-cinematic-actions {
    gap: 6px;
  }

  .ysw-story-panel .ysw-cinematic-actions button {
    min-height: 34px;
    padding: 6px 10px;
  }

  .ysw-opening > .ysw-cinematic-actions {
    bottom: auto;
    justify-content: flex-end;
    left: auto;
    right: 8px;
    top: 8px;
    width: auto;
    z-index: 42;
  }

  .ysw-opening > .ysw-cinematic-actions .ysw-secondary {
    background: rgba(3, 8, 14, .68);
    border-color: rgba(190, 220, 230, .34);
    font-size: 11px;
    min-height: 30px;
    min-width: 0;
    padding: 5px 10px;
    width: auto;
  }

  .ysw-campaign .ysw-boss-art img {
    object-position: center 10%;
  }

  .ysw-card-table .ysw-enemy-board-head {
    height: 0;
    margin: 0;
    min-height: 0;
    overflow: hidden;
  }

  .ysw-card-table .ysw-enemy-board-head span {
    display: none;
    font-size: 10px;
  }

  .ysw-card-table .ysw-enemy-board-head small {
    display: none;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex-basis: 80px;
    min-height: 80px;
  }

  .ysw-card-table .ysw-enemy-board,
  .ysw-card-table .ysw-board {
    align-content: center;
    gap: 4px;
    height: 100%;
  }

  .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-enemy-unit {
    flex: 0 0 76px;
    height: 68px;
    min-height: 68px;
    width: 76px;
  }

  .ysw-card-table .ysw-unit .ysw-card-visual,
  .ysw-card-table .ysw-enemy-unit .ysw-card-visual {
    border-radius: 6px;
    inset: 0;
  }

  .ysw-card-table .ysw-unit .ysw-card-name,
  .ysw-card-table .ysw-enemy-unit .ysw-enemy-unit-icon,
  .ysw-card-table .ysw-enemy-unit .ysw-enemy-kind,
  .ysw-card-table .ysw-enemy-unit .ysw-enemy-name,
  .ysw-card-table .ysw-enemy-unit p,
  .ysw-card-table .ysw-enemy-unit .ysw-state-badge {
    display: none !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    height: 20px;
    min-height: 20px;
    min-width: 24px;
    padding: 1px 3px;
    width: 24px;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
    display: none;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 64px;
    min-height: 64px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex: 0 0 88px;
    height: 62px;
    min-height: 62px;
    width: 88px;
  }

  .ysw-card-table .ysw-hand-card .ysw-card-type,
  .ysw-card-table .ysw-hand-card .ysw-role-tags,
  .ysw-card-table .ysw-hand-card strong,
  .ysw-card-table .ysw-hand-card > small,
  .ysw-card-table .ysw-hand-card p {
    display: none !important;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    display: flex;
  }

  .ysw-card-table .ysw-battle-detail {
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 150px;
  }

  .ysw-card-table .ysw-battle-detail .ysw-recent-events {
    display: none;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-card {
    align-content: start;
    gap: 5px;
    min-height: 0;
    overflow: auto;
    padding: 7px;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-card span {
    font-size: 10px;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-card strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-card p {
    display: block;
    font-size: 10px;
    line-height: 1.36;
    margin: 0;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }

  .ysw-card-table .ysw-battle-detail .ysw-detail-tags i {
    font-size: 8px;
    min-height: 18px;
    padding: 3px 5px;
  }

  .ysw-card-table .ysw-battle-detail .ysw-mobile-use-card,
  .ysw-card-table .ysw-battle-detail .ysw-detail-discard {
    display: inline-flex;
    font-size: 10px;
    min-height: 28px;
    padding: 5px 8px;
  }

  .ysw-card-table .ysw-battle-actions {
    gap: 5px;
  }

  .ysw-card-table .ysw-battle-actions button,
  .ysw-card-table .ysw-burst-button {
    min-height: 32px;
    padding: 6px 8px;
  }

  .ysw-mobile-detail-sheet {
    display: none !important;
  }

  .ysw-character-card {
    grid-template-columns: minmax(118px, 32%) minmax(0, 1fr);
    min-height: 0;
  }

  .ysw-character-portrait {
    aspect-ratio: auto;
    max-height: none;
    min-height: 152px;
  }

  .ysw-character-portrait::after {
    background:
      linear-gradient(180deg, rgba(3, 8, 14, .02), rgba(3, 8, 14, .18)),
      linear-gradient(90deg, rgba(3, 8, 14, .08), transparent 58%);
  }

  .ysw-character-portrait img {
    filter: none;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    opacity: 1;
    width: 100%;
  }

  .ysw-gallery-grid {
    gap: 8px;
  }

  .ysw-gallery-card {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(116px, 32%) minmax(0, 1fr);
    min-height: 0;
    padding: 8px;
  }

  .ysw-gallery-thumb {
    align-self: start;
  }

  .ysw-gallery-card-body {
    gap: 4px;
  }

  .ysw-gallery-card h3 {
    font-size: 15px;
  }

  .ysw-gallery-card p {
    font-size: 11px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }

  .ysw-gallery-card .ysw-secondary {
    grid-column: 1 / -1;
    min-height: 32px;
  }
}

/* 2026-07-07 playtest polish: compact phone campaign/story/battle and tame wide PC controls. */
@media (max-width: 940px) and (orientation: landscape) {
  .ysw-campaign {
    gap: 8px;
    padding: 6px 8px;
  }

  .ysw-campaign .ysw-status-band {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
  }

  .ysw-campaign .ysw-status-band > div {
    min-height: 46px;
    padding: 7px 8px;
  }

  .ysw-campaign .ysw-status-band span,
  .ysw-campaign .ysw-status-band small {
    font-size: 10px;
  }

  .ysw-campaign .ysw-status-band strong {
    font-size: 18px;
  }

  .ysw-campaign .ysw-story-tools {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ysw-campaign .ysw-story-tools button {
    flex: 0 0 auto;
    font-size: 11px;
    min-height: 30px;
    padding: 5px 10px;
    width: auto;
  }

  .ysw-campaign .ysw-boss-list {
    gap: 8px;
  }

  .ysw-campaign .ysw-boss {
    grid-template-columns: minmax(116px, 31%) minmax(0, 1fr);
    min-height: 128px;
  }

  .ysw-campaign .ysw-boss-art {
    background:
      radial-gradient(circle at 50% 22%, rgba(36, 210, 255, .18), transparent 44%),
      linear-gradient(145deg, rgba(8, 18, 31, .98), rgba(4, 9, 18, .94));
    min-height: 128px;
  }

  .ysw-campaign .ysw-boss-art img {
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: scale(.98);
    width: 100%;
  }

  .ysw-campaign .ysw-boss-body {
    gap: 5px;
    padding: 7px 8px;
  }

  .ysw-campaign .ysw-boss-heading {
    gap: 6px;
  }

  .ysw-campaign .ysw-boss-heading p {
    font-size: 10px;
    margin-bottom: 1px;
  }

  .ysw-campaign .ysw-boss-heading h3 {
    font-size: 15px;
    line-height: 1.18;
  }

  .ysw-campaign .ysw-boss-heading strong {
    font-size: 10px;
    padding: 4px 6px;
  }

  .ysw-campaign .ysw-boss-subtitle {
    font-size: 11px;
    line-height: 1.35;
  }

  .ysw-campaign .ysw-boss-intro,
  .ysw-campaign .ysw-rewards {
    display: none;
  }

  .ysw-campaign .ysw-threat-tag {
    align-self: flex-start;
    font-size: 10px;
    padding: 4px 7px;
  }

  .ysw-campaign .ysw-boss-body > .ysw-primary {
    align-self: flex-start;
    font-size: 11px;
    min-height: 30px;
    min-width: 0;
    padding: 5px 12px;
    width: auto;
  }

  .ysw-story-screen {
    align-items: end;
    padding: 0 0 5px;
  }

  .ysw-story-panel {
    background: rgba(5, 10, 18, .26);
    border-color: rgba(160, 209, 225, .2);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .24);
    gap: 6px;
    margin: 0 auto;
    max-height: calc(100svh - 50px);
    max-width: calc(100% - 34px);
    padding: 9px 12px;
  }

  .ysw-story-vignette {
    background:
      linear-gradient(90deg, rgba(5, 10, 18, .06), transparent 48%, rgba(5, 10, 18, .26)),
      linear-gradient(180deg, rgba(5, 10, 18, .02), rgba(5, 10, 18, .1) 56%, rgba(5, 10, 18, .54));
  }

  .ysw-story-panel h1 {
    font-size: clamp(18px, 4.8svh, 25px);
  }

  .ysw-story-body {
    max-height: min(28svh, 104px);
  }

  .ysw-story-panel .ysw-story-progress {
    gap: 4px;
    margin: 0 0 4px;
  }

  .ysw-story-panel .ysw-cinematic-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
  }

  .ysw-story-panel .ysw-cinematic-actions button {
    flex: 0 0 auto;
    font-size: 11px;
    min-height: 30px;
    min-width: 96px;
    padding: 5px 8px;
    white-space: nowrap;
    width: auto;
  }

  .ysw-gallery-card .ysw-secondary {
    align-self: end;
    grid-column: 2;
    justify-self: start;
    min-height: 30px;
    min-width: 88px;
    padding: 5px 14px;
    width: auto;
  }

  .ysw-card-table .ysw-table-leaders {
    grid-template-columns: .92fr 1fr;
  }

  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 60px;
    padding-left: 62px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait {
    width: 56px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader-portrait img {
    object-position: center 10%;
    transform: scale(1.08);
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-card-table .ysw-enemy-board-wrap,
  .ysw-game:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-shell:fullscreen .ysw-card-table .ysw-board-wrap,
  .ysw-card-table .ysw-board-wrap {
    flex: 0 0 82px;
    min-height: 82px;
    padding: 4px;
  }

  .ysw-card-table .ysw-enemy-board,
  .ysw-card-table .ysw-board {
    align-items: center;
    display: flex;
    gap: 5px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .ysw-card-table .ysw-board > p,
  .ysw-card-table .ysw-enemy-board > p {
    flex: 1 0 auto;
    text-align: left;
  }

  .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-enemy-unit {
    flex: 0 0 92px;
    height: 74px;
    min-height: 74px;
    padding: 0;
    width: 92px;
  }

  .ysw-card-table .ysw-unit .ysw-card-visual,
  .ysw-card-table .ysw-enemy-unit .ysw-card-visual {
    border-radius: 6px;
    inset: 0;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    border-radius: 6px;
    bottom: 3px;
    flex-direction: row;
    font-size: 12px;
    height: 22px;
    line-height: 1;
    min-height: 22px;
    min-width: 28px;
    padding: 2px 4px;
    width: 28px;
  }

  .ysw-card-table .ysw-unit .ysw-atk-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
    left: 3px;
  }

  .ysw-card-table .ysw-unit .ysw-hp-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
    right: 3px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex: 0 0 62px;
    min-height: 62px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex: 0 0 90px;
    height: 60px;
    min-height: 60px;
    width: 90px;
  }

  .ysw-hp-feedbacks {
    bottom: calc(100% + 2px);
    min-width: 0;
    width: min(150px, 38vw);
  }

  .ysw-hp-feedback {
    font-size: clamp(42px, 11vw, 76px);
    -webkit-text-stroke-width: 1.4px;
  }

  .ysw-card-feedback {
    font-size: clamp(20px, 6vw, 30px);
    line-height: .9;
    margin-top: calc(var(--ysw-card-feedback-index, 0) * 10px);
    max-width: 94%;
    -webkit-text-stroke-width: 1px;
  }

  .ysw-card-feedback-action,
  .ysw-card-feedback-lost {
    border-radius: 7px;
    font-size: clamp(11px, 3.3vw, 15px);
    min-width: 0;
    padding: 4px 7px;
    white-space: nowrap;
  }

  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-board-wrap,
  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-board-wrap {
    flex: 0 0 82px !important;
    min-height: 82px !important;
  }

  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-unit,
  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-unit {
    flex: 0 0 90px !important;
    height: 72px !important;
    min-height: 72px !important;
    width: 90px !important;
  }

  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-hand {
    flex: 0 0 60px !important;
    min-height: 60px !important;
  }

  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-hand-card {
    height: 58px !important;
    min-height: 58px !important;
  }
}

@media (min-width: 941px) {
  .ysw-leader-select .ysw-leader-actions {
    align-items: center;
    justify-content: center;
  }

  .ysw-leader-select .ysw-leader-actions .ysw-primary,
  .ysw-leader-select .ysw-leader-actions .ysw-secondary {
    align-self: center;
    flex: 0 1 300px;
    max-height: 50px;
    max-width: 320px;
    min-height: 44px;
    padding: 9px 18px;
    width: clamp(220px, 18vw, 300px);
  }
}

@media (min-width: 941px) and (min-height: 901px) {
  .ysw-game:fullscreen .ysw-card-table .ysw-hand,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand,
  .ysw-card-table .ysw-hand {
    flex-basis: 220px;
    min-height: 220px;
  }

  .ysw-game:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-shell:fullscreen .ysw-card-table .ysw-hand-card,
  .ysw-card-table .ysw-hand-card {
    flex-basis: 164px;
    height: 214px;
    min-height: 214px;
  }
}

/* 2026-07-07 final readability polish for empty character pages and phone battle labels. */
.ysw-characters.is-empty {
  align-content: start;
  grid-auto-rows: max-content;
}

.ysw-characters.is-empty .ysw-character-intro {
  align-items: flex-start;
  min-height: 0;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-player-resource-row {
    align-items: center;
    gap: 5px;
  }

  .ysw-card-table .ysw-pp-display,
  .ysw-card-table .ysw-burst-count,
  .ysw-card-table .ysw-deck-count {
    align-items: baseline;
    display: inline-flex;
    gap: 2px;
    min-height: 28px;
    padding: 4px 8px;
    white-space: nowrap;
  }

  .ysw-card-table .ysw-pp-display span,
  .ysw-card-table .ysw-pp-display em,
  .ysw-card-table .ysw-burst-count span,
  .ysw-card-table .ysw-burst-count em,
  .ysw-card-table .ysw-deck-count span,
  .ysw-card-table .ysw-deck-count em {
    display: inline;
    font-size: 11px;
    line-height: 1;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-pp-display span,
  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-pp-display em,
  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-burst-count span,
  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-burst-count em,
  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-deck-count span,
  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-deck-count em {
    display: inline !important;
  }

  .ysw-card-table .ysw-pp-display strong,
  .ysw-card-table .ysw-burst-count strong,
  .ysw-card-table .ysw-deck-count strong {
    font-size: 18px;
    line-height: 1;
  }

  .ysw-card-table .ysw-deck-count {
    min-width: 72px;
  }

  .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-enemy-unit {
    flex: 0 0 138px;
    width: 138px;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    align-items: center;
    display: inline-flex;
    flex-direction: row !important;
    gap: 3px;
    justify-content: center;
    min-width: 42px;
    padding-left: 5px;
    padding-right: 5px;
    width: auto;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    font-size: 13px;
    height: 24px;
    min-height: 24px;
    min-width: 40px;
    width: 40px;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: inline-grid !important;
    font-size: 0;
    line-height: 1;
    margin: 0;
    place-items: center;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small::before,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small::before,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small::before {
    font-size: 10px;
    line-height: 1;
  }

  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-unit,
  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-unit {
    flex-basis: 132px !important;
    width: 132px !important;
  }
}

/* 2026-07-07 battle card readability pass. Card roles are available in the selected detail panel. */
.ysw-card-table .ysw-hand-card .ysw-role-tags,
.ysw-card-table .ysw-hand-card .ysw-role-tags i {
  display: none !important;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-game:fullscreen .ysw-card-table .ysw-unit,
  .ysw-shell:fullscreen .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-unit,
  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-unit,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-unit,
  .ysw-card-table .ysw-enemy-unit {
    aspect-ratio: auto !important;
    flex: 0 0 138px !important;
    height: 84px !important;
    max-width: 138px !important;
    min-height: 84px !important;
    padding: 0 !important;
    width: 138px !important;
  }

  .ysw-game:fullscreen .ysw-card-table:has(.ysw-tutorial-panel) .ysw-unit,
  .ysw-shell:fullscreen .ysw-card-table:has(.ysw-tutorial-panel) .ysw-unit,
  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-unit,
  .ysw-game:fullscreen .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-unit,
  .ysw-shell:fullscreen .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-unit,
  .ysw-card-table:has(.ysw-tutorial-panel) .ysw-enemy-unit {
    flex-basis: 132px !important;
    width: 132px !important;
  }

  .ysw-card-table .ysw-unit .ysw-card-visual,
  .ysw-card-table .ysw-enemy-unit .ysw-card-visual {
    inset: 0 !important;
  }

  .ysw-card-table .ysw-unit .ysw-card-visual img,
  .ysw-card-table .ysw-enemy-unit .ysw-card-visual img {
    object-fit: cover;
    object-position: center 20%;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    border-radius: 7px !important;
    bottom: 5px !important;
    box-sizing: border-box;
    flex-direction: row !important;
    font-size: 13px !important;
    gap: 1px !important;
    height: 26px !important;
    max-width: 42px !important;
    min-height: 26px !important;
    min-width: 42px !important;
    padding: 1px 4px !important;
    width: 42px !important;
  }

  .ysw-card-table .ysw-unit .ysw-atk-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
    left: 5px !important;
    right: auto !important;
  }

  .ysw-card-table .ysw-unit .ysw-hp-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
    left: auto !important;
    right: 5px !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: inline-grid !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small::before,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small::before {
    font-size: 10px !important;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    border-radius: 6px !important;
    bottom: 4px !important;
    box-sizing: border-box;
    flex-direction: row !important;
    font-size: 12px !important;
    gap: 1px !important;
    height: 23px !important;
    max-width: 35px !important;
    min-height: 23px !important;
    min-width: 35px !important;
    padding: 1px 4px !important;
    width: 35px !important;
  }

  .ysw-card-table .ysw-hand-card .ysw-atk-badge {
    left: 5px !important;
    right: auto !important;
  }

  .ysw-card-table .ysw-hand-card .ysw-hp-badge {
    left: auto !important;
    right: 5px !important;
  }

  .ysw-card-table .ysw-hand-card .ysw-stat-badge small::before {
    font-size: 9px !important;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader,
  .ysw-card-table .ysw-hp-gauge-row,
  .ysw-card-table .ysw-hp-meter,
  .ysw-card-table .ysw-meter {
    overflow: visible !important;
  }

  .ysw-card-table .ysw-hp-feedbacks {
    bottom: auto !important;
    display: block !important;
    left: 50% !important;
    min-width: 0 !important;
    opacity: 1 !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: max-content !important;
    z-index: 95 !important;
  }

  .ysw-card-table .ysw-hp-feedback {
    display: block !important;
    font-size: clamp(28px, 8svh, 52px) !important;
    line-height: .82 !important;
    -webkit-text-stroke-width: 1.3px !important;
  }

  .ysw-card-table .ysw-table-leaders .ysw-leader .ysw-hp-feedbacks .ysw-hp-feedback {
    display: block !important;
    font-size: clamp(28px, 8svh, 52px) !important;
    line-height: .82 !important;
  }
}

/* 2026-07-08 scene backgrounds and final presentation polish. */
.ysw-recommended-environment {
  background:
    linear-gradient(135deg, rgba(6, 12, 20, .92), rgba(10, 20, 34, .86)),
    #07111d;
  border: 1px solid rgba(36, 210, 255, .34);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .20);
  color: #eaf7ff;
  display: grid;
  font-family: "Makinas 4 Square", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 4px;
  line-height: 1.7;
  margin: 0 auto 16px;
  max-width: 1320px;
  padding: 12px 16px;
}

.ysw-recommended-environment strong {
  color: #d8f657;
  font-size: 17px;
  letter-spacing: 0;
}

.ysw-recommended-environment span {
  color: rgba(234, 247, 255, .9);
  font-size: 14px;
}

.ysw-shell[data-bg]:not(.ysw-shell-ending-credits) {
  --ysw-screen-bg: none;
  --ysw-screen-base: #07111d;
  --ysw-screen-overlay:
    linear-gradient(160deg, rgba(4, 8, 14, .26), rgba(5, 11, 20, .34) 48%, rgba(8, 10, 16, .42));
  background:
    var(--ysw-screen-overlay),
    var(--ysw-screen-bg),
    var(--ysw-screen-base) !important;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.ysw-shell[data-bg]:not(.ysw-shell-ending-credits)::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(36, 210, 255, .08), transparent 32%),
    linear-gradient(180deg, rgba(3, 8, 14, .01), rgba(3, 8, 14, .08));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.ysw-shell[data-bg]:not(.ysw-shell-ending-credits) > * {
  position: relative;
  z-index: 1;
}

.ysw-shell[data-bg]:not(.ysw-shell-ending-credits) .ysw-topbar {
  z-index: 5;
}

.ysw-shell[data-bg]:not(.ysw-shell-ending-credits):not([data-bg="default"]) .ysw-backdrop {
  display: none;
}

.ysw-shell[data-bg].ysw-bg-story-simple:not(.ysw-shell-ending-credits) {
  --ysw-screen-bg: none;
  --ysw-screen-overlay:
    radial-gradient(circle at 18% 14%, rgba(36, 210, 255, .12), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(255, 92, 138, .09), transparent 28%),
    linear-gradient(160deg, rgba(6, 13, 24, .98), rgba(10, 18, 30, .98) 55%, rgba(12, 12, 18, .98));
}

.ysw-shell[data-bg].ysw-bg-title:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-title.webp"); }
.ysw-shell[data-bg].ysw-bg-campaign:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-campaign.webp"); }
.ysw-shell[data-bg].ysw-bg-deck:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-deck.webp"); }
.ysw-shell[data-bg].ysw-bg-characters:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-characters.webp"); }
.ysw-shell[data-bg].ysw-bg-gallery:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-gallery.webp"); }
.ysw-shell[data-bg].ysw-bg-glossary:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-glossary.webp"); }
.ysw-shell[data-bg].ysw-bg-save:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-save.webp"); }
.ysw-shell[data-bg].ysw-bg-settings:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-settings.webp"); }
.ysw-shell[data-bg].ysw-bg-info:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-info.webp"); }

.ysw-shell[data-bg].ysw-bg-battle-phishing-baron:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-phishing-baron.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-breach-hacker:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-breach-hacker.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-malware-architect:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-malware-architect.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-ransomware-duke:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-ransomware-duke.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-botnet-marshal:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-botnet-marshal.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-deepfake-diva:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-deepfake-diva.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-insider-ghost:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-insider-ghost.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-social-ai-overlord:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-social-ai-overlord.webp"); }
.ysw-shell[data-bg].ysw-bg-battle-code-n:not(.ysw-shell-ending-credits) { --ysw-screen-bg: url("images/backgrounds/bg-battle-code-n.webp"); }

.ysw-shell[data-bg^="battle-"]:not(.ysw-shell-ending-credits) {
  --ysw-screen-overlay:
    linear-gradient(160deg, rgba(4, 8, 14, .38), rgba(5, 11, 20, .48) 48%, rgba(8, 10, 16, .58));
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    column-gap: 0 !important;
    gap: 0 !important;
    padding: 1px 3px !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small {
    display: inline-flex !important;
    justify-content: center !important;
    margin: 0 -1px 0 0 !important;
    min-width: 0 !important;
    width: .82em !important;
  }

  .ysw-card-table .ysw-card-visual-unit[data-card-id="soc-analyst"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="incident-responder"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="threat-hunter"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="firewall-guardian"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="fraud-tracer"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="automation-engineer"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="red-team"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="incident-commander"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="trace-beacon-analyst"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="restore-negotiator"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="barrier-operator"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="sinkhole-operator"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="rate-limit-engineer"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="voiceprint-specialist"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="field-medic"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="access-auditor"] img,
  .ysw-card-table .ysw-card-visual-unit[data-card-id="human-review-board"] img {
    object-position: center 12% !important;
  }
}

/* 2026-07-08 final layout lock: keep card faces readable and move role details to the detail pane. */
.ysw-shell[data-bg]:not(.ysw-shell-ending-credits):not([data-bg="default"]) > .ysw-backdrop {
  display: none !important;
  opacity: 0 !important;
}

.ysw-characters.is-empty {
  align-content: start !important;
  align-items: start !important;
  grid-auto-rows: max-content !important;
  justify-content: stretch !important;
}

.ysw-characters.is-empty .ysw-character-intro {
  align-items: flex-start !important;
  align-self: start !important;
  height: auto !important;
  justify-content: space-between !important;
  min-height: 0 !important;
}

.ysw-card-table .ysw-hand-card .ysw-role-tags,
.ysw-card-table .ysw-hand-card .ysw-role-tags i {
  display: none !important;
}

.ysw-card-table .ysw-stat-badge,
.ysw-card-table .ysw-hand-card .ysw-stat-badge {
  align-items: center;
  display: inline-flex;
  gap: 0;
  justify-content: center;
}

.ysw-card-table .ysw-stat-badge small,
.ysw-card-table .ysw-hand-card .ysw-stat-badge small {
  display: inline-grid;
  flex: 0 0 auto;
  margin: 0 -1px 0 0;
  min-width: 0;
  padding: 0;
  width: 13px;
}

.ysw-card-table .ysw-stat-badge b,
.ysw-card-table .ysw-hand-card .ysw-stat-badge b {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-game:fullscreen .ysw-card-table .ysw-unit,
  .ysw-shell:fullscreen .ysw-card-table .ysw-unit,
  .ysw-card-table .ysw-unit,
  .ysw-game:fullscreen .ysw-card-table .ysw-enemy-unit,
  .ysw-shell:fullscreen .ysw-card-table .ysw-enemy-unit,
  .ysw-card-table .ysw-enemy-unit {
    flex: 0 0 clamp(102px, 15svw, 132px) !important;
    height: clamp(72px, 14svh, 88px) !important;
    max-width: clamp(102px, 15svw, 132px) !important;
    min-height: clamp(72px, 14svh, 88px) !important;
    width: clamp(102px, 15svw, 132px) !important;
  }

  .ysw-card-table .ysw-unit .ysw-card-visual img,
  .ysw-card-table .ysw-enemy-unit .ysw-card-visual img {
    object-fit: cover !important;
    object-position: center 14% !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge {
    bottom: 4px !important;
    font-size: clamp(12px, 3.2svh, 15px) !important;
    height: clamp(22px, 5svh, 27px) !important;
    max-width: none !important;
    min-height: clamp(22px, 5svh, 27px) !important;
    min-width: clamp(31px, 4.9svw, 40px) !important;
    padding: 1px 3px !important;
    width: clamp(31px, 4.9svw, 40px) !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    display: inline-grid !important;
    margin: 0 -1px 0 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    width: 11px !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge b,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge b,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge b {
    min-width: .5em !important;
  }

  .ysw-card-table .ysw-enemy-unit .ysw-atk-badge {
    left: 4px !important;
    right: auto !important;
  }

  .ysw-card-table .ysw-enemy-unit .ysw-hp-badge {
    left: auto !important;
    right: 4px !important;
  }

  .ysw-card-table .ysw-hp-meter,
  .ysw-card-table .ysw-hp-gauge-row,
  .ysw-card-table .ysw-table-leaders .ysw-leader {
    overflow: visible !important;
  }

  .ysw-card-table .ysw-hp-feedbacks {
    display: block !important;
    opacity: 1 !important;
    pointer-events: none !important;
    visibility: visible !important;
    z-index: 999 !important;
  }
}

/* 2026-07-08 final polish: player leader portrait and tight mobile stat icons. */
.ysw-card-table .ysw-player-leader {
  min-height: 128px;
  overflow: visible;
  padding-left: 150px;
  position: relative;
}

.ysw-card-table .ysw-player-leader .ysw-leader-portrait {
  border-left: 0;
  border-right: 1px solid rgba(36, 210, 255, .32);
  box-shadow: inset -18px 0 30px rgba(5, 11, 22, .48);
  overflow: hidden;
  width: 138px;
}

.ysw-card-table .ysw-player-leader .ysw-leader-portrait img {
  object-position: center 12%;
  transform: scale(1.12);
  transform-origin: center 18%;
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-table-leaders .ysw-player-leader {
    min-height: 60px;
    padding-left: 62px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait {
    width: 56px;
  }

  .ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait img {
    object-position: center 10%;
    transform: scale(1.06);
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge {
    column-gap: 0 !important;
    gap: 0 !important;
  }

  .ysw-card-table .ysw-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-enemy-unit .ysw-stat-badge small,
  .ysw-card-table .ysw-hand-card .ysw-stat-badge small {
    margin-right: -2px !important;
    width: 10px !important;
  }
}

/* Final combat header portrait sizing. Keep leader and boss portraits symmetrical. */
.ysw-card-table .ysw-table-leaders .ysw-player-leader,
.ysw-card-table .ysw-table-leaders .ysw-boss-leader {
  min-height: 118px !important;
  padding-left: 106px !important;
  position: relative;
}

.ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait,
.ysw-card-table .ysw-table-leaders .ysw-boss-leader .ysw-leader-portrait {
  overflow: hidden;
  width: 94px !important;
}

.ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait img,
.ysw-card-table .ysw-table-leaders .ysw-boss-leader .ysw-leader-portrait img {
  object-position: center 12% !important;
  transform: scale(1.08) !important;
  transform-origin: center 18%;
}

@media (min-width: 1500px) and (min-height: 850px) {
  .ysw-card-table .ysw-table-leaders .ysw-player-leader,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 128px !important;
    padding-left: 126px !important;
  }

  .ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader .ysw-leader-portrait {
    width: 114px !important;
  }
}

@media (min-width: 941px) and (max-height: 900px) {
  .ysw-card-table .ysw-table-leaders .ysw-player-leader,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 104px !important;
    padding-left: 72px !important;
  }

  .ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader .ysw-leader-portrait {
    width: 64px !important;
  }
}

@media (max-width: 940px) and (orientation: landscape) {
  .ysw-card-table .ysw-table-leaders .ysw-player-leader,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader {
    min-height: 60px !important;
    padding-left: 62px !important;
  }

  .ysw-card-table .ysw-table-leaders .ysw-player-leader .ysw-leader-portrait,
  .ysw-card-table .ysw-table-leaders .ysw-boss-leader .ysw-leader-portrait {
    width: 56px !important;
  }
}
