body {
  min-height: 100vh;
}

.card-thumbnail,
.card-thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 488 / 680;
  object-fit: cover;
  background: #e9ecef;
}

.card-image-viewer {
  width: 100%;
  max-width: 23rem;
  margin-inline: auto;
  text-align: center;
}

.card-image-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 23rem);
  margin-inline: auto;
}

.card-image-stage.is-landscape,
.card-image-stage.is-sideways {
  width: 100%;
  /* Keep the viewer as tall as a portrait card so horizontal faces leave
     balanced top/bottom space and the flip controls stay in place. */
  aspect-ratio: 488 / 680;
}

.card-image-stage.is-landscape .card-detail-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
}

.card-detail-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #e9ecef;
  border-radius: 4.75% / 3.5%;
  transform-origin: center;
}

.card-image-stage.is-sideways .card-detail-image {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Scryfall의 원본은 세로 JPG 안에 가로 카드를 담으므로,
     카드 자체를 90도 돌리고 회전 전 너비는 명시적인 비율로 줄인다. */
  width: 71.7647%;
  transform: translate(-50%, -50%) rotate(90deg);
}

.card-image-stage.is-aftermath-rotated {
  width: 100%;
  /* Keep the same portrait-sized stage used before rotation so the control
     row remains in the normal card position. */
  aspect-ratio: 488 / 680;
}

.card-image-stage.is-aftermath-rotated .card-detail-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 71.7647%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.card-image-placeholder {
  width: min(100%, 23rem);
  margin-inline: auto;
  aspect-ratio: 488 / 680;
  background: #e9ecef;
  border-radius: 4.75% / 3.5%;
}

@media (hover: hover) and (pointer: fine) {
  .card-detail-image {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .card-detail-image:hover {
    position: relative;
    z-index: 3;
    transform: scale(1.08);
    box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 22%);
  }

  .card-image-stage.is-landscape .card-detail-image:hover {
    transform: translate(-50%, -50%) scale(1.3);
  }

  .card-image-stage.is-sideways .card-detail-image:hover {
    position: absolute;
    transform: translate(-50%, -50%) rotate(90deg) scale(1.3);
  }

  .card-image-stage.is-aftermath-rotated .card-detail-image:hover {
    position: absolute;
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-detail-image {
    transition: none;
  }
}

.flavor-text {
  font-style: italic;
}

.flavor-text-normal {
  font-style: normal;
}

.skin-card-name {
  color: var(--site-accent-dark);
  font-weight: 700;
}

.oracle-text-line {
  margin: 0;
}

.oracle-text-line-spaced {
  margin-top: 0.25rem;
}

/* Bootstrap의 .ms-1~.ms-5 여백 유틸리티와 Mana 숫자 심볼 클래스가
   같은 이름을 사용한다. 카드 심볼 안에서는 Mana 쪽 의미만 남긴다. */
.mana-symbol > .ms,
.mana-symbol .ms-half > .ms {
  margin-right: 0 !important;
  margin-inline-end: 0 !important;
}

.mana-cost {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
  vertical-align: baseline;
  font-size: 1.25em;
}

.mana-symbol-half {
  min-width: 0.675em;
}

.mana-symbol-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.set-name-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  line-height: 1.25;
}

.set-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  color: #495057;
  background-color: currentColor;
  -webkit-mask: var(--set-icon-image) center / contain no-repeat;
  mask: var(--set-icon-image) center / contain no-repeat;
}

.set-icon-rarity-common {
  color: #20262d;
}

.set-icon-rarity-uncommon {
  color: #8d969e;
}

.set-icon-rarity-rare {
  color: #c5962f;
}

.set-icon-rarity-mythic {
  color: #d45a27;
}

.set-icon-rarity-special {
  color: #7b4ab1;
}

.set-icon-rarity-bonus {
  color: #247f88;
}

.set-name-text {
  min-width: 0;
}

.printing-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.printing-item-main,
.printing-item-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.25;
}

.printing-item-main {
  flex: 1 1 14rem;
  min-width: 0;
}

.printing-item-meta {
  flex: 0 1 auto;
  margin-inline-start: auto;
  justify-content: flex-end;
  font-size: 0.875rem;
}

.printing-number,
.printing-item-meta > span:not(.badge) {
  white-space: nowrap;
}

.printing-list-scroll {
  max-height: 19rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

details > summary {
  cursor: pointer;
}

.raw-json {
  max-height: 36rem;
  overflow: auto;
  white-space: pre-wrap;
}

.admin-source-text {
  white-space: pre-wrap;
  font: inherit;
}

@media (min-width: 992px) {
  .card-detail-text-column,
  .card-detail-meta-column {
    border-inline-start: 1px solid var(--bs-border-color);
    padding-inline-start: calc(var(--bs-gutter-x) * 0.75);
  }
}

/* Site-wide visual system ------------------------------------------------- */

:root {
  --site-bg: #f3f1eb;
  --site-surface: #fffdf9;
  --site-surface-muted: #ebe8df;
  --site-ink: #17211d;
  --site-ink-soft: #435048;
  --site-muted: #68736d;
  --site-accent: #2f7654;
  --site-accent-dark: #20563c;
  --site-accent-soft: #dceade;
  --site-border: rgb(31 54 43 / 13%);
  --site-shadow: 0 0.75rem 2rem rgb(32 45 38 / 8%);
  --site-shadow-hover: 0 1rem 2.75rem rgb(32 45 38 / 16%);
  --bs-primary: var(--site-accent);
  --bs-primary-rgb: 47, 118, 84;
  --bs-body-color: var(--site-ink);
  --bs-body-bg: var(--site-bg);
  --bs-border-color: var(--site-border);
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  color: var(--site-ink);
  background:
    radial-gradient(circle at 8% 2%, rgb(123 164 132 / 13%), transparent 25rem),
    var(--site-bg);
  /* 카드의 한국어·영어 탭을 포함해 사이트 전체에서 같은 글꼴을 사용한다.
     Pretendard가 설치된 환경에서 영문만 다른 글꼴로 대체되는 현상을 막는다. */
  font-family: "Noto Sans KR", "Noto Sans", "Segoe UI", sans-serif;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--site-accent-dark);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--site-accent);
  text-decoration: none;
}

.btn-primary {
  --bs-btn-bg: var(--site-accent);
  --bs-btn-border-color: var(--site-accent);
  --bs-btn-hover-bg: var(--site-accent-dark);
  --bs-btn-hover-border-color: var(--site-accent-dark);
  --bs-btn-active-bg: #19452f;
  --bs-btn-active-border-color: #19452f;
}

.btn-outline-primary {
  --bs-btn-color: var(--site-accent-dark);
  --bs-btn-border-color: rgb(47 118 84 / 45%);
  --bs-btn-hover-bg: var(--site-accent);
  --bs-btn-hover-border-color: var(--site-accent);
}

.form-control,
.form-select {
  border-color: rgb(31 54 43 / 20%);
  background-color: rgb(255 255 255 / 88%);
}

.form-control:focus,
.form-select:focus {
  border-color: rgb(47 118 84 / 70%);
  box-shadow: 0 0 0 0.25rem rgb(47 118 84 / 14%);
}

.site-header {
  color: white;
  background:
    radial-gradient(circle at 76% -60%, rgb(116 173 137 / 42%), transparent 25rem),
    linear-gradient(120deg, #111a16, #213229 68%, #17211d);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  box-shadow: 0 0.5rem 1.75rem rgb(14 23 18 / 16%);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover,
.site-brand:focus-visible {
  color: white;
}

.brand-mark {
  display: inline-grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 0.9rem 0.9rem 0.35rem;
  background: linear-gradient(145deg, #67a979, #2f7654);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%);
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-name,
.brand-caption,
.brand-copy {
  display: block;
}

.brand-copy {
  min-width: 0;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.brand-caption {
  color: rgb(255 255 255 / 58%);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.site-search {
  min-width: 0;
  max-width: 52rem;
  margin-inline: auto;
  padding: 0.28rem;
  border: 1px solid rgb(255 255 255 / 17%);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 10%);
}

.site-search .form-control {
  min-width: 0;
  color: white;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-search .form-control::placeholder {
  color: rgb(255 255 255 / 55%);
}

.site-search .form-control::-webkit-search-cancel-button {
  filter: invert(1);
}

.site-search .btn {
  border-radius: 0.62rem;
  font-weight: 700;
}

.site-nav-link {
  padding: 0.55rem 0.72rem;
  color: rgb(255 255 255 / 76%);
  border-radius: 0.65rem;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav-link-disabled {
  padding: 0.55rem 0.72rem;
  color: rgba(180, 180, 180, 0.76);
  border-radius: 0.65rem;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
  color: white;
  background: rgb(255 255 255 / 10%);
}

.site-footer {
  color: #c5cec8;
  background: #17211d;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.site-footer a {
  color: #a9d2b4;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.text-accent {
  color: var(--site-accent) !important;
}

.home-hero,
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: white;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 1.55rem;
  background:
    radial-gradient(circle at 88% 10%, rgb(123 181 140 / 32%), transparent 19rem),
    linear-gradient(135deg, #16241d, #2b503a 72%, #376c4b);
  box-shadow: 0 1.25rem 3.5rem rgb(25 46 34 / 18%);
}

.home-hero::after,
.page-hero::after {
  position: absolute;
  right: -5rem;
  bottom: -9rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  content: "";
}

.home-hero > *,
.page-hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy,
.page-hero .lead {
  max-width: 46rem;
  color: rgb(255 255 255 / 76%);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.page-hero-compact {
  padding-block: clamp(1.8rem, 4vw, 3rem);
}

.catalog-stat-card {
  display: flex;
  min-height: 12rem;
  padding: 1.5rem;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 1.2rem;
  background: rgb(255 255 255 / 9%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
  backdrop-filter: blur(0.45rem);
}

.catalog-stat-label,
.catalog-stat-meta {
  color: rgb(255 255 255 / 65%);
}

.catalog-stat-value {
  margin-block: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  line-height: 1;
}

.hero-search-help {
  margin-top: 2rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.search-help {
  color: var(--site-muted);
}

.search-help summary {
  width: fit-content;
  cursor: pointer;
}

.search-help-body {
  max-width: 52rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--site-border);
  border-radius: 0.8rem;
  background: rgb(255 255 255 / 48%);
}

.home-hero .search-help {
  color: rgb(255 255 255 / 72%);
}

.home-hero .search-help-body {
  border-color: rgb(255 255 255 / 12%);
  background: rgb(0 0 0 / 10%);
}

.home-hero code {
  color: #d9f0df;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.section-link {
  font-weight: 700;
  text-decoration: none;
}

.section-count {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  color: var(--site-muted);
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: rgb(255 255 255 / 58%);
  font-size: 0.78rem;
  font-weight: 700;
}

.recent-set-card {
  display: flex;
  min-height: 8.2rem;
  padding: 1rem 0.75rem;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  color: var(--site-ink);
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: var(--site-surface);
  box-shadow: 0 0.35rem 1rem rgb(32 45 38 / 5%);
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.recent-set-card:hover {
  color: var(--site-accent-dark);
  border-color: rgb(47 118 84 / 38%);
  box-shadow: var(--site-shadow);
  transform: translateY(-0.2rem);
}

.recent-set-card > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--site-muted);
  font-size: 0.7rem;
  line-height: 1.3;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recent-set-icon,
.set-browser-icon {
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--set-icon-image) center / contain no-repeat;
  mask: var(--set-icon-image) center / contain no-repeat;
}

.recent-set-icon {
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.2rem;
  color: var(--site-accent);
}

.recent-set-icon-image,
.set-browser-icon-image {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.recent-set-icon-image {
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.2rem;
}

.recent-set-fallback,
.set-browser-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--site-accent-dark);
  border-radius: 50%;
  background: var(--site-accent-soft);
  font-family: Georgia, serif;
  font-weight: 700;
}

.recent-set-fallback {
  width: 2.1rem;
  height: 2.1rem;
}

.card-surface,
.content-panel,
.card-text-panel,
.empty-state {
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: var(--site-surface);
  box-shadow: 0 0.45rem 1.5rem rgb(32 45 38 / 5%);
}

.card-surface,
.content-panel,
.empty-state {
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.set-filter {
  position: relative;
  z-index: 2;
  margin-top: -2.15rem;
  margin-inline: clamp(0.5rem, 3vw, 2.5rem);
}

.set-browser-card {
  display: flex;
  min-height: 8.8rem;
  height: 100%;
  padding: 1.1rem;
  align-items: center;
  gap: 1rem;
  color: var(--site-ink);
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: var(--site-surface);
  box-shadow: 0 0.35rem 1rem rgb(32 45 38 / 5%);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.set-browser-card:hover {
  color: var(--site-ink);
  border-color: rgb(47 118 84 / 36%);
  box-shadow: var(--site-shadow);
  transform: translateY(-0.18rem);
}

.set-browser-logo {
  display: inline-grid;
  width: 4rem;
  height: 4rem;
  flex: 0 0 4rem;
  place-items: center;
  color: var(--site-accent-dark);
  border-radius: 1rem;
  background: linear-gradient(145deg, #edf4ed, #dce9df);
}

.set-browser-icon {
  width: 2.45rem;
  height: 2.45rem;
}

.set-browser-icon-image {
  width: 2.5rem;
  height: 2.5rem;
}

.set-browser-fallback {
  width: 2.5rem;
  height: 2.5rem;
}

.set-browser-content {
  min-width: 0;
  flex: 1 1 auto;
}

.set-browser-name,
.set-browser-code {
  display: block;
}

.set-browser-name {
  margin-bottom: 0.15rem;
  font-size: 1rem;
  line-height: 1.3;
}

.set-browser-code {
  color: var(--site-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.set-browser-arrow {
  color: var(--site-accent);
  font-size: 1.2rem;
  transition: transform 160ms ease;
}

.set-browser-card:hover .set-browser-arrow {
  transform: translateX(0.2rem);
}

.set-browser-meta {
  display: flex;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem 0.65rem;
  color: var(--site-muted);
  font-size: 0.76rem;
}

.set-group-collapsible {
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: rgb(255 253 249 / 56%);
}

.set-group-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.set-group-summary .section-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.set-group-summary::-webkit-details-marker {
  display: none;
}

.set-group-summary::after {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
  content: "+";
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

.set-group-collapsible[open] .set-group-summary::after {
  content: "−";
}

.set-group-collapsible .section-heading {
  align-items: center;
}

.set-group-collapsible .set-group-content {
  padding-top: 1rem;
}

/* Set directory --------------------------------------------------------- */

.set-directory-summary {
  display: flex;
  margin: 0.25rem 0 1rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.set-directory-section {
  margin-bottom: 1.4rem;
}

.set-directory-section-heading {
  display: flex;
  margin-bottom: 0.45rem;
  padding-bottom: 0.45rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--site-border);
}

.set-promo-group {
  margin-top: 1rem;
  border: 1px solid var(--site-border);
  border-radius: 0.7rem;
  background: rgb(255 253 249 / 62%);
}

.set-promo-summary {
  display: flex;
  min-height: 2.5rem;
  padding: 0.42rem 0.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
  list-style: none;
}

.set-promo-summary::-webkit-details-marker {
  display: none;
}

.set-promo-summary::after {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--site-accent-soft);
  color: var(--site-accent-dark);
  content: "+";
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 0.72rem;
  line-height: 1;
}

.set-promo-group[open] .set-promo-summary::after {
  content: "−";
}

.set-promo-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
}

.set-promo-description {
  display: block;
  margin-top: 0.08rem;
  color: var(--site-muted);
  font-size: 0.68rem;
}

.set-promo-content {
  padding: 0 0.35rem 0.35rem;
}

.set-year-count {
  flex: 0 0 auto;
  color: var(--site-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.set-directory-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.set-directory-item + .set-directory-item {
  border-top: 1px solid rgb(213 222 214 / 70%);
}

.set-directory-link {
  display: grid;
  min-height: 2.65rem;
  padding: 0.25rem 0.45rem;
  grid-template-columns: 1.6rem minmax(10rem, 1.4fr) minmax(12rem, 2fr) auto;
  align-items: center;
  gap: 0.55rem;
  color: var(--site-ink);
  border-radius: 0.6rem;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.set-directory-link:hover {
  color: var(--site-accent-dark);
  background: var(--site-accent-soft);
}

.set-directory-link:focus-visible {
  outline: 3px solid rgb(47 118 84 / 38%);
  outline-offset: -2px;
}

.set-directory-icon {
  display: inline-grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  color: var(--site-accent-dark);
}

.set-directory-icon-image {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.set-directory-fallback {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  color: var(--site-accent-dark);
  border-radius: 50%;
  background: var(--site-accent-soft);
  font-family: Georgia, serif;
  font-size: 0.62rem;
  font-weight: 700;
}

.set-directory-main {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.6rem;
}

.set-directory-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-directory-code {
  flex: 0 0 auto;
  color: var(--site-accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.set-directory-details {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  color: var(--site-muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.set-directory-date {
  color: var(--site-ink-soft);
  font-variant-numeric: tabular-nums;
}

.set-directory-type,
.set-directory-platform {
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
}

.set-directory-platform {
  color: var(--site-accent-dark);
  border-color: rgb(47 118 84 / 22%);
  background: var(--site-accent-soft);
}

.set-directory-arrow {
  color: var(--site-accent);
  font-size: 0.9rem;
  line-height: 1;
}

.search-result-header {
  overflow: hidden;
  background:
    linear-gradient(110deg, rgb(220 234 222 / 55%), transparent 45%),
    var(--site-surface);
}

.pagination-bar {
  padding: 0.85rem 1rem;
}

.search-infinite-sentinel {
  min-height: 2.5rem;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.82rem;
}

/* Card grids ------------------------------------------------------------- */

.image-only-card {
  position: relative;
  border-radius: 4.75% / 3.5%;
  transition: transform 180ms ease, filter 180ms ease;
}

.image-only-card:hover {
  filter: drop-shadow(0 1rem 1.5rem rgb(24 37 30 / 24%));
  transform: translateY(-0.3rem);
}

.image-only-card-link {
  position: relative;
  display: block;
  border-radius: inherit;
}

.korean-translation-badge {
  position: absolute;
  /* 카드 이미지 우측 상단의 인쇄된 마나 비용을 가리지 않도록 한 칸 내린다. */
  top: 2.05rem;
  right: 0.55rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.45rem;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: 999px;
  background: rgb(35 112 72 / 92%);
  box-shadow: 0 0.2rem 0.55rem rgb(12 35 22 / 28%);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}

.korean-translation-badge-translated {
  background: rgba(25, 86, 255, 0.92);
}

.card-search-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 488 / 680;
  object-fit: contain;
  border-radius: 4.75% / 3.5%;
  background: #e9ecef;
  box-shadow: 0 0.5rem 1.4rem rgb(32 45 38 / 12%);
}

.card-catalog-card {
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: var(--site-surface);
  box-shadow: 0 0.45rem 1.4rem rgb(32 45 38 / 6%);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card-catalog-card:hover {
  box-shadow: var(--site-shadow-hover);
  transform: translateY(-0.3rem);
}

.card-image-link {
  position: relative;
  display: block;
  padding: 0.55rem 0.55rem 0;
  color: inherit;
  text-decoration: none;
}

.card-thumbnail,
.card-thumbnail-placeholder {
  border-radius: 0.82rem 0.82rem 0.45rem 0.45rem;
}

.card-set-chip {
  position: absolute;
  right: 0.9rem;
  bottom: 0.4rem;
  padding: 0.28rem 0.48rem;
  color: white;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.45rem;
  background: rgb(12 19 16 / 76%);
  box-shadow: 0 0.2rem 0.75rem rgb(0 0 0 / 20%);
  font-size: 0.65rem;
  font-weight: 700;
  backdrop-filter: blur(0.25rem);
}

.card-title-link {
  color: var(--site-ink);
  font-weight: 750;
  text-decoration: none;
}

.card-title-link:hover {
  color: var(--site-accent-dark);
}

.card-type-line {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  color: #435048;
  line-height: 1.3;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-set-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card-link previews ----------------------------------------------------- */

.card-link-popover {
  --bs-popover-max-width: min(24rem, calc(100vw - 1rem));
  z-index: 1080;
}

.card-link-popover .popover-header {
  display: none !important;
}

.card-link-popover .popover-body {
  padding: 0.55rem;
}

.card-preview-content {
  display: block;
  min-width: min(20rem, calc(100vw - 2rem));
}

.card-preview-details {
  min-width: 0;
}

.card-preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.card-preview-name {
  color: var(--site-ink);
  font-size: 0.88rem;
  line-height: 1.2;
}

.card-preview-mana {
  flex: 0 0 auto;
  white-space: nowrap;
}

.card-preview-english,
.card-preview-face-note {
  color: var(--site-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}

.card-preview-type {
  margin-top: 0.22rem;
  padding-bottom: 0.22rem;
  border-bottom: 1px solid var(--site-border);
  color: var(--site-ink-soft);
  font-size: 0.7rem;
  line-height: 1.25;
}

.card-preview-oracle {
  margin-top: 0.42rem;
  color: var(--site-ink-soft);
  font-size: 0.72rem;
  line-height: 1.35;
}

.card-preview-oracle p {
  margin: 0;
}

.card-preview-oracle p + p {
  margin-top: 0.22rem;
}

.card-preview-stats {
  margin-top: 0.38rem;
  color: var(--site-ink);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.card-preview-face-note {
  margin-top: 0.35rem;
}

.card-preview-empty {
  color: var(--site-muted);
  font-size: 0.75rem;
}

@media (max-width: 575.98px) {
  .card-link-popover {
    --bs-popover-max-width: calc(100vw - 1rem);
  }

  .card-preview-content {
    min-width: 0;
  }
}

/* Card detail ------------------------------------------------------------ */

.detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  color: var(--site-muted);
  font-size: 0.85rem;
}

.detail-breadcrumb a {
  font-weight: 650;
  text-decoration: none;
}

.card-detail-actions {
  margin-top: 1rem;
}

.admin-login-panel {
  width: min(100%, 30rem);
  margin-top: clamp(1rem, 5vw, 4rem);
}

.detail-action-button {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.card-detail-image {
  box-shadow: 0 1.1rem 2.75rem rgb(25 37 30 / 20%);
}

.card-detail-image-column {
  position: sticky;
  top: 1rem;
}

.card-text-panel {
  border-radius: 1rem;
}

.card-language-pane {
  /*
   * Keep the two language tabs on the same typographic baseline.  The
   * document has a Korean `lang` value, so browsers otherwise tend to pick
   * different fallback fonts/spacing for the English tab.  Card text uses a
   * single, script-neutral stack and explicitly resets the spacing-related
   * properties that can vary by language and browser.
   */
  font-family: "Noto Sans KR", "Noto Sans", "Segoe UI", sans-serif !important;
  /* Noto Sans KR에는 환경에 따라 기울임 글꼴이 없으므로 플레이버의
     이탤릭 표현을 유지하면서 양쪽 언어에 같은 합성 규칙을 사용한다. */
  font-synthesis: weight style;
  font-feature-settings: "kern" 1, "liga" 0;
  font-kerning: normal;
  font-variant-ligatures: none;
  /* 한글 탭도 영문 탭과 같은 라틴 기준선/구두점 조합을 사용한다. */
  font-language-override: "ENG";
  letter-spacing: 0;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  word-spacing: 0;
}

.card-language-pane .card-text-panel,
.card-language-pane .card-text-panel :where(h2, p, div, span, small, strong, a) {
  font-family: inherit !important;
  letter-spacing: inherit;
  word-spacing: inherit;
}

.card-language-pane .card-face-panel {
  line-height: inherit;
}

.card-language-pane .card-face-name {
  margin-bottom: 0;
  line-height: 1.35;
}

.card-language-pane .card-face-type-line,
.card-language-pane .card-face-oracle-text,
.card-language-pane .card-face-flavor-text {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.card-face-type-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.card-color-indicator {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 0.12rem;
  line-height: 1;
  white-space: nowrap;
}

.card-color-indicator .ms {
  margin: 0 !important;
  font-size: 0.88em;
  vertical-align: -0.08em;
}

.card-language-pane .card-face-oracle-text,
.card-language-pane .card-face-flavor-text {
  line-height: 1.5;
}

.card-language-pane .card-face-mana-cost {
  align-self: baseline;
  letter-spacing: 0;
  word-spacing: 0;
}

.card-language-pane .card-face-stat {
  line-height: 1.35;
}

.card-language-pane .card-stat-separator {
  display: inline-block;
  margin-inline: 0.18em;
  font-variant-numeric: normal;
}

.card-language-pane .card-stat-value {
  white-space: nowrap;
}

.card-text-panel h2 {
  font-weight: 750;
}

.alchemy-card-name {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.alchemy-card-logo {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  object-fit: contain;
}

.related-alchemy-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.45rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--site-border);
  border-radius: 0.7rem;
  background: rgb(243 241 235 / 62%);
}

.related-alchemy-link {
  font-weight: 750;
}

.content-panel > h2:first-child {
  margin-bottom: 0.85rem;
  font-weight: 750;
}

.deck-card-row {
  min-width: 0;
}

.deck-card-quantity {
  flex: 0 0 2rem;
  width: 2rem;
}

.deck-card-mana-cost {
  flex: 0 0 auto;
  min-width: 1.6rem;
  min-height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.04rem;
  color: var(--site-muted);
  line-height: 1;
  white-space: nowrap;
}

.deck-card-mana-cost .mana-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 1.1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.14em;
}

.deck-card-row a,
.deck-card-row > span.flex-grow-1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deck-rarity-common,
.deck-rarity-uncommon,
.deck-rarity-rare,
.deck-rarity-mythic,
.deck-rarity-unknown {
  font-size: 0.68rem;
  font-weight: 700;
}

.deck-rarity-common {
  color: #4f5961;
  background: #e8ecef;
}

.deck-rarity-uncommon {
  color: #236a91;
  background: #d9edf8;
}

.deck-rarity-rare {
  color: #856404;
  background: #fff0b8;
}

.deck-rarity-mythic {
  color: #9d3e18;
  background: #f7d1bd;
}

.deck-rarity-unknown {
  color: var(--site-muted);
  background: rgb(255 255 255 / 75%);
  border: 1px solid var(--site-border);
}

.deck-rarity-summary {
  line-height: 1.4;
}

.language-tabs {
  padding: 0.3rem;
  gap: 0.2rem;
  border: 1px solid var(--site-border);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 58%);
}

.language-tabs .nav-link {
  color: var(--site-muted);
  border: 0;
  border-radius: 0.62rem;
  font-weight: 700;
}

.language-tabs .nav-link.active {
  color: white;
  background: var(--site-accent);
  box-shadow: 0 0.3rem 0.75rem rgb(47 118 84 / 22%);
}

.printing-list-scroll {
  border-radius: 0.75rem;
}

.printing-item {
  border-color: var(--site-border);
  background-color: rgb(255 255 255 / 64%);
}

.current-printing-preview {
  border-radius: 0.75rem;
}

.current-printing-preview .printing-item {
  border-radius: 0.75rem;
}

.current-printing-item {
  color: inherit;
  border-color: rgb(47 118 84 / 45%);
  background-color: rgb(224 240 231 / 88%);
}

.current-printing-item:hover,
.current-printing-item:focus-visible {
  color: inherit;
  border-color: rgb(47 118 84 / 38%);
  background-color: rgb(255 255 255 / 88%);
}

.current-printing-preview .printing-item {
  border-color: var(--site-border);
  background-color: rgb(255 255 255 / 64%);
}

.card-color-summary {
  width: min(100%, 19rem);
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--site-border);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 62%);
}

.card-color-summary .color-w {
  background: #f0f2c0;
}

.card-color-summary .color-u {
  background: #b5cde3;
}

.card-color-summary .color-b {
  background: #aca29a;
}

.card-color-summary .color-r {
  background: #db8664;
}

.card-color-summary .color-g {
  background: #93b483;
}

.card-color-summary .color-c {
  background: #beb9b2;
}

.color-summary-label {
  width: 4.3rem;
  flex: 0 0 4.3rem;
}

.color-identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: var(--site-surface);
  font-size: 0.7rem;
  font-weight: 700;
}

.color-identity-chip .ms {
  margin: 0 !important;
  vertical-align: 0;
}

.oracle-tag-parents nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.oracle-tag-parent-groups,
.tagger-relationships {
  display: grid;
  gap: 0.75rem;
}

.oracle-tag-parent-group + .oracle-tag-parent-group {
  border-top: 1px solid var(--site-border);
  padding-top: 0.65rem;
}

.tagger-relationship-group h3 {
  color: var(--site-muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 0.375rem;
}

.tagger-relationship-names {
  line-height: 1.65;
}

.oracle-tag-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.printing-details {
  border-top: 1px solid var(--site-border);
  padding-top: 0.75rem;
}

.printing-details-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--site-accent-dark);
  font-size: 0.84rem;
  font-weight: 750;
  list-style: none;
}

.printing-details-summary::-webkit-details-marker {
  display: none;
}

.printing-count {
  margin-inline-start: auto;
  color: var(--site-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.printing-details-summary::after {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--site-accent-soft);
  content: "+";
  display: inline-grid;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

.printing-details[open] > .printing-details-summary::after {
  content: "−";
}

.printing-details-body {
  padding: 0.75rem;
  border: 1px solid var(--site-border);
  border-radius: 0.75rem;
  background: rgb(243 241 235 / 62%);
}

.printing-group-title {
  margin-bottom: 0.45rem;
  color: var(--site-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.printing-list-compact {
  max-height: 12.5rem;
  font-size: 0.76rem;
}

.printing-list-compact .printing-item {
  padding: 0.42rem 0.55rem;
  gap: 0.25rem 0.5rem;
}

.printing-list-compact .printing-item-main {
  flex-basis: 10rem;
  gap: 0.25rem;
}

.printing-list-compact .printing-item-meta {
  gap: 0.25rem;
  font-size: 0.68rem;
}

.printing-list-compact .set-name-with-icon {
  gap: 0.28rem;
}

.printing-list-compact .set-icon {
  width: 1rem;
  height: 1rem;
}

.printing-list-compact .badge {
  font-size: 0.62rem;
}

.printing-empty {
  padding: 0.65rem;
  color: var(--site-muted);
  border: 1px dashed var(--site-border);
  border-radius: 0.65rem;
  font-size: 0.75rem;
  text-align: center;
}

.format-legality-panel {
  padding: 1rem;
}

.format-legality-panel > h2:first-child {
  margin-bottom: 0.75rem;
}

.legality-group-title {
  margin-bottom: 0.4rem;
  color: var(--site-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.legality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.legality-item {
  display: flex;
  min-width: 0;
  min-height: 2rem;
  padding: 0.3rem 0.38rem 0.3rem 0.55rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  border: 1px solid var(--site-border);
  border-radius: 0.55rem;
  background: rgb(243 241 235 / 62%);
  font-size: 0.72rem;
}

.legality-format-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legality-badge {
  display: inline-flex;
  width: 4.15rem;
  min-width: 4.15rem;
  height: 1.4rem;
  padding: 0 0.25rem;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
}

.raw-details > summary {
  font-weight: 700;
}

.raw-json {
  border-color: var(--site-border) !important;
  background: #f1f1ec !important;
}

.table {
  --bs-table-bg: transparent;
}

fieldset {
  background: var(--site-surface);
  box-shadow: 0 0.35rem 1rem rgb(32 45 38 / 4%);
}

@media (max-width: 991.98px) {
  .card-detail-image-column {
    position: static;
  }

  .card-detail-text-column,
  .card-detail-meta-column {
    border-inline-start: 0;
  }
}

@media (max-width: 575.98px) {
  .site-header {
    margin-bottom: 1rem !important;
  }

  .brand-caption {
    display: none;
  }

  .home-hero,
  .page-hero {
    margin-inline: -0.35rem;
    padding: 1.5rem;
    border-radius: 1.15rem;
  }

  .home-hero .display-4 {
    font-size: 2.15rem;
  }

  .catalog-stat-card {
    min-height: auto;
  }

  .set-filter {
    margin-top: -1.4rem;
    margin-inline: 0.35rem;
  }

  .set-filter .btn-lg {
    padding-inline: 0.8rem;
    font-size: 0.95rem;
  }

  .set-directory-summary,
  .set-directory-section-heading,
  .set-promo-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .set-directory-link {
    grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    gap: 0.45rem;
  }

  .set-directory-icon {
    width: 1.55rem;
    height: 1.55rem;
  }

  .set-directory-main {
    display: block;
  }

  .set-directory-code {
    display: block;
    margin-top: 0.05rem;
  }

  .set-directory-details {
    grid-column: 2 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .set-promo-content {
    padding-inline: 0.15rem;
  }

  .set-browser-card {
    min-height: 7.5rem;
  }

  .set-browser-logo {
    width: 3.35rem;
    height: 3.35rem;
    flex-basis: 3.35rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-link {
    font-size: 0.82rem;
  }

  .card-catalog-card .card-body {
    padding: 0.75rem !important;
  }

  .card-set-chip {
    right: 0.75rem;
    font-size: 0.58rem;
  }

  .legality-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .recent-set-card,
  .set-browser-card,
  .set-browser-arrow,
  .set-directory-link,
  .image-only-card,
  .card-catalog-card {
    transition: none;
  }
}
