/* 共通の色・文字・間隔。画面ごとに別のデザイン値を増やさない。 */
:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --text: #45484d;
  --secondary: #697079;
  --border: #cdd1d6;
  --soft-border: #e4e7eb;
  --accent: #ed8420;
  --accent-strong: #a94e05;
  --accent-soft: #fff4e8;
  --constraint: #6d5dc4;
  --effect: #189ac8;
  --focus: #087397;
  --radius: 6px;
  color-scheme: light;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg) url("background.svg") center top / 720px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}
a:hover {
  color: #783603;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
svg {
  display: inline-block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  overflow: hidden;
  border: 0;
}
.archive {
  max-width: 1040px;
  height: 100dvh;
  min-height: 600px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
}
.catalog-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex: none;
}
h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
h1 small {
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary);
  margin-left: 16px;
  letter-spacing: 0;
}
.book {
  width: 29px;
  height: 33px;
  stroke: #f7a23e;
  stroke-width: 2.5;
}
.book text {
  fill: #f7a23e;
  stroke: none;
  font-size: 20px;
  font-family: sans-serif;
  font-weight: 600;
}
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 0;
  background: none;
  padding: 4px 8px;
  color: var(--secondary);
  border-radius: var(--radius);
}
.quiet-button:hover {
  background: #edf0f2;
}
.quiet-button:active {
  background: #e1e5e8;
}
/* 選択中の画像と性能。デスクトップでは左右、狭い画面では上下に配置する。 */
.selected-card {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  height: 272px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.91);
}
.portrait-column {
  min-width: 0;
}
.detail-image-link {
  display: block;
  position: relative;
  aspect-ratio: 1;
  color: var(--secondary);
  border-radius: 8px;
}
.detail-image-link img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: #eef0f3;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.plan-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
}
.plan-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: none;
}
.level-line {
  display: flex;
  gap: 16px;
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 14px;
}
dd {
  margin: 0;
}
.level-line dd {
  font-weight: 600;
}
.detail-content {
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}
.detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid #b9bec4;
}
.detail-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.state-label {
  font-size: 12px;
  color: var(--secondary);
  margin-left: auto;
  white-space: nowrap;
}
.effects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
}
.effect-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.effect-line::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border: 2px solid var(--effect);
  flex: none;
  margin-left: 3px;
}
.effect-line.condition {
  font-size: 15px;
}
.effect-line.condition::before {
  display: none;
}
.restrictions {
  margin: 8px 0 4px;
  color: var(--constraint);
  font-size: 16px;
  font-weight: 600;
}
.detail-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--secondary);
}
.detail-meta summary {
  cursor: pointer;
  width: fit-content;
  padding: 2px 0;
}
.meta-content {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-border);
}
.meta-content dl {
  margin: 0;
}
.meta-content dl div {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.meta-content dt {
  width: 60px;
  flex: none;
}
.meta-content dd {
  color: var(--text);
}
.source-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
}
.source-links a {
  display: flex;
  align-items: center;
  gap: 4px;
}
.source-links svg {
  width: 12px;
  height: 12px;
}
.detail-loading {
  grid-column: 1 / -1;
  display: grid;
  place-content: center;
  color: var(--secondary);
  min-height: 220px;
}
/* 一覧の検索・絞り込み。固定ソートのため並べ替え操作は置かない。 */
.browse-controls {
  position: relative;
  padding-top: 16px;
  flex: none;
  z-index: 2;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-field > svg {
  margin-left: 12px;
  color: var(--secondary);
  width: 18px;
}
.search-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  height: 40px;
  padding: 8px 12px;
}
.search-field input::placeholder {
  color: #70767e;
}
.search-field:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.search-field input:focus-visible {
  outline: 0;
}
.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
#clear-search {
  border: 0;
  background: none;
  width: 36px;
  height: 36px;
  font-size: 22px;
  flex: none;
  color: var(--secondary);
  border-radius: var(--radius);
}
#clear-search:hover {
  background: #edf0f2;
}
.filter-menu {
  position: relative;
}
.filter-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
.filter-menu > summary:hover,
.filter-menu[open] > summary {
  border-color: var(--accent);
  color: var(--accent-strong);
}
#filter-count {
  min-width: 18px;
  background: var(--accent-soft);
  font-size: 12px;
  text-align: center;
  color: var(--accent-strong);
}
.filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-height: min(520px, calc(100dvh - 110px));
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.filter-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.filter-heading strong {
  font-size: 14px;
  font-weight: 600;
}
.text-button {
  border: 0;
  background: none;
  padding: 4px;
  min-height: 32px;
  color: var(--accent-strong);
  font-size: 12px;
}
.text-button:hover {
  text-decoration: underline;
}
.filter-panel > label {
  display: block;
  font-size: 12px;
  color: var(--secondary);
  margin: 12px 0 4px;
}
.filter-panel > select {
  width: 100%;
  height: 36px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.apply-button {
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.apply-button:hover {
  background: #ffe8cd;
}
.apply-button:active {
  background: #ffdbb1;
}
.filter-panel > .apply-button {
  width: 100%;
  margin-top: 16px;
}
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 50px;
}
.upgrade-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.upgrade-control input {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
}
.check-mark {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid #9aa1a9;
  background: var(--surface);
  border-radius: 4px;
}
.upgrade-control input:checked + .check-mark {
  border-color: var(--accent);
  background: var(--accent);
}
.upgrade-control input:checked + .check-mark::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 12px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(45deg);
  top: 2px;
  left: 6px;
}
.upgrade-control input:focus-visible + .check-mark {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.result-count {
  margin: 0 0 0 auto;
  color: var(--secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.result-count strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}
.upgrade-control[hidden] + .result-count {
  margin-left: 0;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 0 0 8px;
  font-size: 12px;
  color: var(--secondary);
}
.active-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 4px 0;
  min-height: 28px;
  color: var(--accent-strong);
}
.active-filters button:hover {
  text-decoration: underline;
}
/* カード一覧は独立してスクロールし、選択状態とキーボードフォーカスを区別する。 */
.collection {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #aeb6bd transparent;
  padding: 12px 8px 24px;
  margin: 0 -8px;
  border-top: 1px solid var(--soft-border);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px 20px;
}
.card-button {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  padding: 0;
  text-align: center;
}
.card-art {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.card-art img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-button:hover .card-art {
  filter: brightness(1.04);
}
.card-button:active .card-art {
  transform: scale(0.985);
}
.selection-corners {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 24px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 4px 24px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 24px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 4px 24px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 24px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 4px 24px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 24px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 4px 24px no-repeat;
  border-radius: 8px;
  opacity: 0;
}
.card-button[aria-pressed="true"] .selection-corners {
  opacity: 1;
}
.card-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  min-height: 34px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.card-button[aria-pressed="true"] .card-name {
  color: var(--accent-strong);
  font-weight: 600;
}
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--secondary);
}
.empty-state p {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.empty-state span {
  display: block;
}
.empty-state button {
  margin-top: 16px;
}
.page-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  margin: 0 -24px;
  padding: 0 24px;
}
.catalog-tabs {
  display: flex;
  align-self: stretch;
  gap: 16px;
}
.catalog-tab {
  padding: 0 4px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--secondary);
  font-size: 14px;
  white-space: nowrap;
}
.catalog-tab:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.catalog-tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}
.catalog-status {
  font-size: 11px;
  color: var(--secondary);
}
.card-navigation {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.card-navigation button {
  border: 0;
  background: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--radius);
}
.card-navigation button:not(:disabled):hover {
  background: #edf0f2;
}
.card-navigation span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-width: 52px;
  color: var(--secondary);
}
.toast {
  position: fixed;
  z-index: 4;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}
.custom-open {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  padding: 4px 6px;
  border: 1px solid #bfcbd0;
  border-radius: 18px;
  background: white;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.custom-open:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.selected-card.has-custom {
  height: 304px;
}
@media (max-width: 850px) and (min-width: 601px) {
  .selected-card.has-custom {
    height: 288px;
  }
}
/* カスタマイズの一時プレビュー。状態の破棄は app.js の close 処理で行う。 */
.custom-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #e1e3e6;
  border-radius: 24px 24px 16px 16px;
  color: var(--text);
  background: white;
}
.custom-dialog[open] {
  display: flex;
  flex-direction: column;
}
.custom-dialog::backdrop {
  background: rgba(25, 30, 40, 0.24);
  backdrop-filter: blur(4px);
}
.custom-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 14px 24px;
  background: linear-gradient(130deg, #ffac17 0%, #ffd56a 76%, #ffe29a 76%);
  color: white;
}
.custom-title h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 0;
  font-weight: 700;
}
.custom-title > span {
  font-size: 30px;
  color: #ffc657;
}
.custom-body {
  overflow-y: auto;
  padding: 18px 22px 4px;
  scrollbar-width: thin;
  min-height: 0;
}
.custom-note {
  color: #7e8287;
  font-size: 13px;
  margin: 0 0 8px;
  font-weight: 600;
}
.custom-preview {
  position: sticky;
  top: 0;
  z-index: 3;
  background: white;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  border: 2px solid #bfc1c5;
  border-radius: 10px;
  min-height: 224px;
  padding: 14px;
}
.custom-body {
  scroll-padding-top: 240px;
}
.custom-preview > img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.custom-preview h3 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.custom-preview .effects {
  font-size: 16px;
}
.custom-cost-text {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--secondary);
}
.custom-preview .restrictions {
  font-size: 15px;
}
.custom-limit {
  display: flex;
  align-items: center;
  margin: 12px 0;
  color: white;
  font-weight: 700;
  font-size: 15px;
}
.custom-limit::before,
.custom-limit::after {
  content: "";
  flex: 1;
  border-bottom: 2px solid #ace2bd;
}
.custom-limit > span {
  background: #18bd64;
  padding: 2px 10px;
  border-radius: 12px 12px 0 0;
  white-space: nowrap;
}
.custom-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.custom-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.custom-choice {
  position: relative;
  border: 5px solid #f5fcff;
  border-radius: 12px;
  padding: 0;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: white;
  background: var(--custom-color);
}
.custom-text-change {
  color: #c52633;
  font-weight: 800;
}
.custom-parameter {
  --custom-color: linear-gradient(110deg, #ff4080, #ff9b10);
}
.custom-cost {
  --custom-color: linear-gradient(110deg, #00d785, #8ee700);
}
.custom-energy {
  --custom-color: linear-gradient(110deg, #03add4, #00d5c7);
}
.custom-buff {
  --custom-color: linear-gradient(110deg, #04b4ef, #8ccfff);
}
.custom-special {
  --custom-color: linear-gradient(110deg, #ba55fb, #f56ae5);
}
.custom-choice > svg {
  position: absolute;
  width: 48px;
  height: 54px;
  top: 5px;
  left: 3px;
  opacity: 0.2;
  stroke-width: 5px;
}
.custom-choice-label {
  display: grid;
  place-content: center;
  flex: 1;
  min-height: 49px;
  padding: 5px 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  z-index: 1;
}
.custom-choice-points {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 19px;
  font-weight: 700;
  min-height: 26px;
  color: #20252a;
  background: white;
  width: 82%;
  border-radius: 14px 14px 0 0;
  align-self: center;
  z-index: 1;
}
.p-coin {
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f6e400;
  color: #282a2e;
  border: 1.5px solid #5c6318;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.custom-choice[aria-pressed="true"] {
  border-color: #ffa225;
}
.custom-choice[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  right: 2px;
  top: 0;
  width: 18px;
  height: 18px;
  font-size: 15px;
  font-weight: 700;
  color: white;
  z-index: 2;
}
.custom-choice:hover:not(:disabled) {
  filter: brightness(1.06);
}
.custom-choice:disabled {
  opacity: 0.43;
}
.custom-arrow {
  display: grid;
  place-content: center;
  height: 24px;
  line-height: 1;
  color: #a6aaae;
  font-size: 24px;
}
.custom-points {
  position: relative;
  margin-top: 20px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--border);
}
.custom-points p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  margin: 14px 0 10px;
}
.custom-points strong {
  min-width: 58px;
  text-align: right;
  font-size: 22px;
}
.custom-points p .p-coin {
  width: 30px;
  height: 30px;
  font-size: 23px;
}
.custom-reset {
  display: block;
  margin-left: auto;
  min-height: 32px;
  padding: 3px 16px;
  border: 1px solid #aab2b6;
  border-radius: 18px;
  background: #e8ecee;
  font-weight: 600;
}
.custom-footer {
  flex: none;
  display: flex;
  justify-content: center;
  padding: 10px 20px 14px;
}
.custom-footer button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 240px;
  min-height: 46px;
  border: 2px solid #d6e1e3;
  border-radius: 25px;
  background: #fcfdfd;
  font-size: 20px;
  font-weight: 600;
}
.custom-footer button > span {
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}
@media (max-width: 600px) {
  .selected-card.has-custom {
    height: 256px;
  }
  .custom-open {
    font-size: 10px;
    padding: 3px 0;
    min-height: 32px;
  }
  .custom-title {
    padding: 12px 16px;
  }
  .custom-title h2 {
    font-size: 20px;
  }
  .custom-body {
    padding: 12px 10px 0;
  }
  .custom-note {
    font-size: 10px;
  }
  .custom-preview {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    min-height: 196px;
  }
  .custom-body {
    scroll-padding-top: 208px;
  }
  .custom-preview h3 {
    font-size: 17px;
  }
  .custom-preview .effects {
    font-size: 13px;
  }
  .custom-preview .restrictions {
    font-size: 12px;
  }
  .custom-cost-text {
    font-size: 11px;
  }
  .custom-limit {
    font-size: 12px;
    margin: 10px 0;
  }
  .custom-options {
    gap: 6px;
  }
  .custom-choice {
    border-width: 3px;
    min-height: 75px;
    border-radius: 9px;
  }
  .custom-choice-label {
    font-size: 12px;
    padding: 4px 3px;
    min-height: 43px;
  }
  .custom-choice-points {
    font-size: 17px;
    gap: 10px;
    min-height: 24px;
  }
  .custom-choice > svg {
    width: 32px;
    height: 46px;
  }
  .custom-arrow {
    height: 19px;
    font-size: 20px;
  }
  .custom-points {
    margin-top: 14px;
    padding-top: 9px;
  }
  .custom-points p {
    font-size: 15px;
    margin: 8px 0;
  }
  .custom-footer {
    padding: 8px 12px 12px;
  }
  .custom-footer button {
    min-height: 42px;
    font-size: 18px;
  }
}
@media (min-width: 850px) {
  .detail-meta {
    margin-top: 12px;
  }
}
@media (max-width: 1000px) and (min-width: 851px) {
  .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 850px) {
  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }
  .selected-card {
    grid-template-columns: 152px 1fr;
    gap: 20px;
    padding: 16px;
    height: 248px;
  }
  .detail-heading h2 {
    font-size: 22px;
  }
  .effects {
    font-size: 16px;
  }
  .meta-content {
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .archive {
    padding: 16px 16px 0;
    min-height: 620px;
  }
  .page-header {
    margin-bottom: 12px;
  }
  h1 {
    font-size: 21px;
    gap: 8px;
  }
  h1 small {
    display: block;
    margin: -2px 0 0;
    font-size: 11px;
  }
  .book {
    width: 26px;
    height: 30px;
  }
  .quiet-button {
    font-size: 12px;
    padding-right: 0;
  }
  .quiet-button svg {
    width: 16px;
  }
  .selected-card {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 12px;
    height: 256px;
    padding: 12px;
  }
  .detail-heading {
    gap: 4px;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }
  .detail-heading h2 {
    font-size: 18px;
    line-height: 1.4;
  }
  .state-label {
    font-size: 11px;
    margin-left: 0;
    width: 100%;
  }
  .effects {
    font-size: 14px;
    gap: 4px;
  }
  .effect-line {
    gap: 6px;
  }
  .effect-line::before {
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-width: 1.5px;
  }
  .effect-line.condition {
    font-size: 12px;
  }
  .restrictions {
    font-size: 13px;
    margin-top: 6px;
  }
  .plan-line {
    font-size: 13px;
    gap: 4px;
  }
  .plan-icon {
    width: 22px;
    height: 22px;
  }
  .level-line {
    font-size: 12px;
    gap: 8px;
  }
  .detail-meta {
    font-size: 11px;
  }
  .detail-meta[open] .meta-content {
    gap: 4px;
  }
  .meta-content dt {
    width: 44px;
  }
  .meta-content dd {
    overflow-wrap: anywhere;
  }
  .browse-controls {
    padding-top: 12px;
  }
  .search-row {
    gap: 8px;
  }
  .search-field > svg {
    margin-left: 8px;
    width: 16px;
  }
  .search-field input {
    padding: 8px;
    font-size: 12px;
  }
  .filter-menu > summary {
    font-size: 12px;
    gap: 4px;
    padding: 8px;
  }
  .filter-menu > summary svg {
    width: 16px;
  }
  .filter-panel {
    position: fixed;
    top: 80px;
    right: 16px;
    max-width: calc(100vw - 32px);
  }
  .list-toolbar {
    gap: 8px;
    min-height: 48px;
  }
  .upgrade-control {
    font-size: 14px;
    gap: 6px;
  }
  .result-count {
    font-size: 11px;
  }
  .result-count strong {
    font-size: 14px;
  }
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .card-name {
    font-size: 11px;
    min-height: 31px;
    margin-top: 6px;
  }
  .selection-corners {
    inset: -4px;
  }
  .collection {
    padding-top: 8px;
    padding-bottom: 16px;
  }
  .page-footer {
    margin: 0 -16px;
    padding: 0 16px;
    gap: 8px;
    min-height: 46px;
  }
  .catalog-status {
    display: none;
  }
  .catalog-tabs {
    gap: 8px;
  }
  .catalog-tab {
    font-size: 12px;
    padding: 0 2px;
  }
  .card-navigation {
    gap: 0;
  }
  .card-navigation button {
    width: 32px;
    padding: 6px;
  }
  .card-navigation span {
    min-width: 44px;
    font-size: 11px;
  }
}
@media (max-width: 360px) {
  .card-navigation span {
    display: none;
  }
}
@media (max-height: 700px) and (min-width: 601px) {
  .archive {
    min-height: 560px;
    padding-top: 12px;
  }
  .page-header {
    margin-bottom: 12px;
  }
  .selected-card {
    height: 236px;
    padding: 16px;
    grid-template-columns: 144px 1fr;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card-art {
    transition:
      filter 0.1s ease,
      transform 0.1s ease;
  }
}
