@charset "UTF-8";

/* ==========================================================================
   01. Reset & Base Setup
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) {
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

main#main {
  flex: 1 0 auto;
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg { width: 20px; height: 20px; flex: 0 0 20px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.section { padding-block: 32px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--rose-dark); font-size: 14px; font-weight: 600; }
.section-heading .text-link { flex-shrink: 0; }
.data-skeleton { min-height: 420px; padding-block: 28px; }
.skeleton-block { position: relative; display: block; background: var(--line); border-radius: 10px; overflow: hidden; }
.skeleton-title { width: min(70%, 280px); height: 28px; }
.skeleton-text { width: min(80%, 360px); height: 14px; }
.skeleton-action { width: 130px; height: 44px; }
.skeleton-search { height: 46px; flex: 1; }
.skeleton-controls { display: flex; gap: 12px; margin-bottom: 24px; }
.skeleton-account { display: grid; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.skeleton-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.skeleton-thumbnails { display: grid; grid-template-columns: repeat(auto-fit, 78px); gap: 10px; }
.skeleton-thumb { aspect-ratio: 1; }
.skeleton-thumbnails.wide { grid-template-columns: repeat(auto-fit, 132px); }
.skeleton-thumbnails.wide .skeleton-thumb { aspect-ratio: 16 / 9; }
.skeleton-catalog { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
.skeleton-picker { display: grid; align-content: start; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-card); }
.loading-shell { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 32px 20px; background: radial-gradient(circle at 50% 38%, var(--pink) 0, var(--paper) 42%, var(--paper) 100%); color: var(--ink); text-align: center; }
.chibi-loader { position: relative; width: 144px; height: 144px; }
.chibi-aura { position: absolute; inset: 8px; border: 1px dashed var(--control-border); border-radius: 50%; opacity: .55; }
.chibi-face { position: absolute; left: 28px; top: 28px; width: 88px; height: 76px; border: 2px solid var(--rose-dark); border-radius: 48% 48% 44% 44%; background: var(--photo-paper); box-shadow: 0 8px 16px #5d3b5120; z-index: 2; }
.chibi-ear { position: absolute; top: 28px; width: 34px; height: 50px; border: 2px solid var(--rose-dark); border-radius: 70% 30% 60% 40%; background: var(--photo-paper); z-index: 1; }
.ear-left { left: 20px; transform: rotate(-28deg); }.ear-right { right: 20px; transform: rotate(28deg) scaleX(-1); }
.chibi-body { position: absolute; left: 44px; bottom: 13px; width: 56px; height: 42px; border-radius: 50% 50% 35% 35%; background: var(--rose); box-shadow: 0 7px 12px #5d3b5120; }
.eye { position: absolute; top: 32px; width: 7px; height: 10px; border-radius: 50%; background: var(--ink); }.eye-left { left: 25px; }.eye-right { right: 25px; }
.mouth { position: absolute; left: 38px; top: 49px; width: 12px; height: 7px; border-bottom: 2px solid var(--rose-dark); border-radius: 50%; }
.chibi-star { position: absolute; color: var(--rose); font-size: 25px; z-index: 3; }.star-left { left: 2px; top: 73px; }.star-right { right: 2px; top: 36px; color: var(--control-border); }
.loading-brand { display: flex; align-items: baseline; gap: 8px; font-family: 'Fraunces', Georgia, serif; font-size: 30px; letter-spacing: -.04em; }.loading-brand span { font-family: 'DM Sans', sans-serif; font-size: 12px; letter-spacing: .22em; color: var(--muted); }
.loading-shell p { color: var(--muted); font-size: 14px; }
.loading-track { width: min(240px, 70vw); height: 4px; overflow: hidden; border-radius: 99px; background: var(--pink); }.loading-track span { display: block; width: 36%; height: 100%; border-radius: inherit; background: var(--rose); }
.skeleton-results, .skeleton-detail-info { display: grid; align-content: start; gap: 20px; }
.skeleton-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.skeleton-art { height: 180px; width: 100%; }
.skeleton-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-bottom: 32px; }
.skeleton-detail-art { height: 360px; }
@media (max-width: 1023px) { .skeleton-catalog { grid-template-columns: 1fr; } .skeleton-picker { display: none; } .skeleton-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .skeleton-presets, .skeleton-detail { grid-template-columns: 1fr; } .skeleton-account-heading { flex-wrap: wrap; } .skeleton-detail-art { height: 240px; } .skeleton-controls .skeleton-action:last-child { display: none; } }
.inventory-notice { margin-block: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.inventory-notice p { margin-block: 8px 16px; }
.status-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; }


button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button, select {
  cursor: pointer;
}

button:disabled, select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==========================================================================
   02. Typography & Brand Elements
   ========================================================================== */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
@media (max-width: 639px) {
  .wordmark {
    font-size: 28px;
    gap: 4px;
  }
  .wordmark .flower {
    width: 14px;
    height: 14px;
  }
}

.brand-name { display: flex; flex-direction: column; gap: 5px; }
.wordmark .brand-suffix { font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .22em; line-height: 1; color: var(--muted); }

.wordmark .flower,
.flower {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  line-height: 1.35;
}

h4 {
  font-size: 14px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.count-pill,
.results-heading strong,
.account-stats strong,
.pagination-range,
.stat-gems {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   03. Common Layout & Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 20px;
}

.page-content {
  padding-block: 36px 64px;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h1 {
  margin-bottom: 8px;
}
.page-intro p { max-width: 65ch; line-height: 1.65; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rose);
  margin-bottom: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel);
  padding: 20px;
}

/* ==========================================================================
   04. Buttons, Badges & Controls (Min 44x44px Touch Targets)
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-control);
  background: var(--action-bg);
  color: var(--action-fg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
}

.button:hover:not(:disabled) {
  background: var(--rose-dark);
}

.button:active:not(:disabled) {
  border-color: var(--rose-dark);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.secondary:hover:not(:disabled) {
  background: var(--pink);
  color: var(--ink);
}
.button svg { width: 18px; height: 18px; flex-basis: 18px; }
.button { white-space: normal; }
.button > svg { flex-shrink: 0; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover:not(:disabled) {
  background: var(--pink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--rose);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--rose-dark);
}

/* Badges */
.region-badge,
.type-badge,
.badge-stock,
.badge-rarity,
.count-pill {
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.delivery-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.badge-rarity {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  padding: 2px 6px;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tile-rarity { position: absolute; bottom: 0; left: 0; z-index: 1; padding: 3px 7px; border-radius: 0 7px 0 0; font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: .04em; border: 0; }
.badge-rarity[data-rarity="20"], .tile-rarity[data-rarity="20"] { background: linear-gradient(135deg, #d92b7c, #8b28cf); color: #ffffff; border: 0; text-shadow: 0 1px 2px rgba(0,0,0,0.3); box-shadow: 0 1px 4px rgba(217,43,124,0.3); }
.count-pill.bd { background: linear-gradient(135deg, rgba(217,43,124,0.15), rgba(139,40,207,0.15)); border-color: #d92b7c; color: #d92b7c; font-weight: 800; }
.badge-rarity[data-rarity="4"], .tile-rarity[data-rarity="4"] { background: #9d426a; color: #fff8fb; border: 0; text-shadow: none; box-shadow: none; }
.badge-rarity[data-rarity="3"], .tile-rarity[data-rarity="3"] { background: #c28a32; color: #382200; border: 0; text-shadow: none; box-shadow: none; }
.badge-rarity[data-rarity="10"], .tile-rarity[data-rarity="10"] { background: #3e927d; color: #092d24; border: 0; text-shadow: none; box-shadow: none; }
.badge-rarity[data-rarity="2"], .tile-rarity[data-rarity="2"] { background: #687486; color: #f5f8fc; border: 0; text-shadow: none; box-shadow: none; }
.badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  border-radius: 4px;
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.account-card .badge-count {
  top: 0;
  right: 0;
  border-radius: 0 0 0 6px;
  font-size: 11px;
  padding: 2px 6px;
}
.account-stats .stat-ssr { color: var(--rose-dark); font-weight: 600; }
.account-stats .stat-sr { color: var(--ink); background: transparent; border-radius: 0; padding: 0; }
[data-theme="dark"] .account-stats .stat-sr { color: var(--muted); background: transparent; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumb a:hover {
  color: var(--rose);
}

.breadcrumb .sep {
  opacity: 0.6;
}

/* ==========================================================================
   05. Site Header & Nav
   ========================================================================== */
.announcement {
  min-height: 32px;
  background: var(--pink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.announcement-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 4px;
}

.site-header {
  min-height: 72px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 100;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--rose-dark);
  font-weight: 600;
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rose);
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: inline-flex !important;
}

.mobile-nav-footer {
  display: none;
}

/* Mobile Nav Drawer */
@media (max-width: 1023px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    font-size: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-control);
  }

  .site-nav a.active::after {
    display: none;
  }

  .site-nav a.active {
    background: var(--surface);
  }

  .mobile-nav-footer {
    display: block;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .mobile-nav-footer .contact-link {
    width: 100%;
  }
}

/* ==========================================================================
   06. Site Footer
   ========================================================================== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: 32px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--rose);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-badge);
}

.motion-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.motion-toggle[aria-pressed="true"] .motion-dot {
  background: var(--rose);
}

.motion-system-hint {
  font-size: 12px;
  font-style: italic;
}

.legal {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ==========================================================================
   07. Home Hero & Sections
   ========================================================================== */
.hero-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  padding-block: 40px 20px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.hero-title {
  margin: 12px 0 20px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.hero-title em {
  font-family: inherit;
  font-style: normal;
  font-weight: 650;
  color: var(--rose);
}

.hero-body {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 42ch;
}

.server-select-box select,
.sort-select-box select,
.page-jump select {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--control-border);
  color: var(--ink);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* Polaroid Scene */
.hero-scene {
  position: relative;
  min-height: 280px;
  background: radial-gradient(circle at 50% 50%, var(--pink) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid-frame {
  position: absolute;
  width: 43%;
  max-width: 155px;
  background: var(--photo-paper);
  border: 1px solid var(--photo-edge);
  border-radius: 13px;
  box-shadow: 0 16px 36px #5d3b5124, 0 2px 5px #5d3b510c;
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
}

.polaroid-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  background: var(--pink);
  border-radius: 8px;
}

.frame-label {
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  padding: 12px 5px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.frame-back {
  left: 8%;
  top: 44px;
  transform: rotate(-12deg);
  z-index: 1;
}

.frame-front {
  left: 46%;
  top: 16px;
  transform: rotate(10deg);
  z-index: 2;
}

.hero-spark { position: absolute; color: var(--rose); font-size: 32px; pointer-events: none; }
.spark-one { top: 6%; left: 1%; }
.spark-two { right: 1%; bottom: 10%; font-size: 40px; color: var(--control-border); }
.spark-three { left: 44%; bottom: 2%; font-size: 24px; }
.hero-spotlight { position: absolute; top: -12px; left: 35%; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-panel); }
.hero-spotlight span { color: var(--muted); font-size: 12px; }
.hero-orbit { position: absolute; width: 86%; height: 75%; left: 8%; top: 12%; border: 1px solid var(--line); border-radius: 50%; transform: rotate(-21deg); pointer-events: none; }
.hero-orbit.orbit-two { width: 68%; height: 93%; left: 20%; top: 3%; transform: rotate(28deg); border-style: dashed; opacity: .7; }
.home-game-shelf { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 24px; }
.next-game-note { display: flex; flex-direction: column; justify-content: center; gap: 12px; border: 1px dashed var(--control-border); border-radius: var(--radius-card); padding: 28px; }
.next-game-note > span { color: var(--rose); font-size: 36px; }
.next-game-note p { font-size: 14px; max-width: 30ch; }
.home-game-shelf .game-entry-banner { grid-template-columns: 1fr 1fr; }
.home-game-shelf .game-banner-artwork { min-height: 220px; max-height: 240px; }
@media (max-width: 639px) {
  .home-game-shelf { grid-template-columns: 1fr; gap: 16px; }
  .home-game-shelf .game-banner-copy { padding: 20px; }
  .home-game-shelf .game-banner-artwork { min-height: 190px; max-height: 210px; }
  .home-game-shelf .game-banner-title { font-size: 22px; }
  .next-game-note { padding: 20px; gap: 8px; }
  .next-game-note > span { display: none; }
  .next-game-note p { max-width: none; }
  .hero-spotlight { left: 25%; top: -10px; padding: 8px 10px; }
  .hero-actions { align-items: center; }
}

/* Game Entry Banner */
.game-entry-section {
  margin-block: 0;
}

.game-entry-banner {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.game-banner-copy {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.pill {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--pink);
  color: var(--rose-dark);
  border-radius: var(--radius-badge);
  font-size: 11px;
  font-weight: 700;
}

.game-banner-title {
  font-size: 24px;
  line-height: 1.15;
}

.game-banner-title b {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--rose);
}

.game-tile-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rose);
}

.game-banner-artwork {
  min-height: 180px;
  max-height: 260px;
  background: var(--paper);
  overflow: hidden;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.future-games-note {
  margin-top: 12px;
  font-size: 13px;
}

/* Steps List (How it works) */
.steps-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.step-item {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--rose-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ==========================================================================
   08. Server Buttons Bar
   ========================================================================== */
.server-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.server-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.server-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.server-btn:hover:not(.active) {
  background: var(--pink);
}

.server-btn.active {
  background: var(--action-bg);
  color: var(--action-fg);
  border-color: var(--action-bg);
  font-weight: 600;
}

.server-btn .count-pill {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 11px;
}

.server-btn.active .count-pill {
  background: rgba(255, 255, 255, 0.25);
  color: var(--action-fg);
}

/* ==========================================================================
   09. Results Toolbar & Selected Chips
   ========================================================================== */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.toolbar-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.results-heading {
  font-size: 18px;
  font-weight: 500;
  outline: none;
}

.results-heading strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--rose-dark);
}

.match-rule-hint {
  font-size: 13px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sort-select-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-select-box label {
  font-size: 13px;
  color: var(--muted);
}

.toggle-btn.active {
  background: var(--pink);
  border-color: var(--rose);
}

/* Selected Chips */
.selected-chips-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selected-chips-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: var(--paper);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 500;
}

.chip-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
}

.chip-remove:hover {
  background: var(--pink);
  color: var(--rose-dark);
}

.chip-remove svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   10. Catalog Layout & Filter Sidebar
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  position: static;
  overflow: visible;
  min-height: 0;
}
.filter-panel > :not(.picker-content) { flex-shrink: 0; }
.filter-panel .picker-content { overflow: visible; max-height: none; min-height: 0; padding-right: 0; scrollbar-width: auto; }
.picker-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.picker-footer .button { padding-inline: 12px; }
.picker-footer .text-button { padding: 4px; font-size: 12px; }
.filter-results-button { width: 100%; }

@media (max-width: 1023px) {
  .filter-panel {
    display: none;
  }

  .filter-panel.open {
    display: flex;
    position: static;
    max-height: none;
  }
}

.catalog-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; margin-bottom: 18px; }
.catalog-search { min-width: 0; }
.catalog-search .search-input-wrapper { background: var(--surface); }
.catalog-options { position: relative; }
.catalog-options summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 14px; list-style: none; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--muted); }
.catalog-options summary::-webkit-details-marker { display: none; }
.catalog-options[open] summary { color: var(--rose-dark); border-color: var(--control-border); }
.catalog-options-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 4; width: 300px; max-width: calc(100vw - 40px); display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-panel); }
.catalog-options-panel p { font-size: 13px; line-height: 1.5; }
.catalog-intro { margin-bottom: 22px; }
.catalog-intro h1 { margin: 4px 0 0; }
.catalog-game-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--rose); }
.catalog-game-link svg { width: 13px; height: 13px; flex-basis: 13px; }
.catalog-results-toolbar { padding: 0 0 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.catalog-sort select { min-height: 44px; max-width: 190px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.catalog-sr-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; }
.catalog-sr-toggle.active { color: var(--rose-dark); background: var(--pink); }
.sr-toggle-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--control-border); }
.catalog-sr-toggle.active .sr-toggle-dot { background: var(--rose); }
@media (max-width: 639px) {
  .catalog-controls { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .catalog-results-toolbar .toolbar-info { width: auto; flex: 1; }
  .catalog-results-toolbar .toolbar-actions { width: auto; display: flex; gap: 4px; }
  .catalog-options summary { padding-inline: 12px; }
  .catalog-results-toolbar .filter-toggle-btn { padding-inline: 10px; }
  .catalog-results-toolbar .toolbar-info { flex: 1 1 100%; }
  .catalog-results-toolbar .toolbar-actions { display: flex; width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .catalog-sort { flex: 1 1 100%; }
  .catalog-sort select { width: 100%; max-width: none; }
}
.clear-search-btn[hidden] { display: none; }
.card-chooser-heading, .picker-search-heading { font-size: 16px; }
.stock-context-note { font-size: 13px; line-height: 1.5; margin-bottom: 20px; max-width: 75ch; }
.availability-context { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
}

.search-input-wrapper svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-input-wrapper input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

.clear-search-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.search-helper-text {
  font-size: 12px;
  font-style: italic;
  color: var(--rose);
}

/* Rarity Tabs */
.rarity-tabs-box {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--rose-dark);
  border-bottom-color: var(--rose);
}


/* Kind Toggles */
.kind-toggle-row {
  display: flex;
  gap: 6px;
}

.kind-btn {
  flex: 1;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-control);
  background: var(--paper);
  border: 1px solid var(--control-border);
  color: var(--muted);
}

.kind-btn.active {
  background: var(--pink);
  color: var(--rose-dark);
  border-color: var(--rose);
}

/* Picker Grids */
.picker-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  overscroll-behavior: auto;
  scrollbar-width: auto;
  scrollbar-gutter: auto;
  min-height: 0;
  max-height: none;
  padding-right: 0;
  overflow-anchor: auto;
}

.picker-section h4 {
  margin-bottom: 8px;
}

.picker-grid {
  display: grid;
  gap: 8px;
}

.member-picker-grid {
  grid-template-columns: repeat(3, 1fr);
}

.snapshot-picker-grid {
  grid-template-columns: repeat(2, 1fr);
}

.card-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
}

.card-tile:hover {
  border-color: var(--rose);
}

.card-tile.selected {
  background: var(--pink);
  border-color: var(--rose-dark);
}

.tile-pic {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}

.snapshot-tile .tile-pic {
  aspect-ratio: 16 / 9;
}

.tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.check-marker {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.card-tile.selected .check-marker {
  background: var(--action-bg);
  color: var(--action-fg);
}

.check-marker svg {
  width: 12px;
  height: 12px;
}

.tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tile-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   11. Results Pane, Account Cards & Grids
   ========================================================================== */
.results-pane {
  min-width: 0;
}

.accounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.presets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Account Result Card */
.account-card,
.preset-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.account-card:hover, .preset-card:hover { border-color: var(--control-border); }
.account-card { --member-edge: 90px; --snapshot-edge: 160px; padding: 20px; gap: 16px; align-self: start; }
.account-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.account-summary { display: grid; gap: 8px; min-width: 0; flex: 1 1 260px; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 1 auto; }
.account-delivery { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); }
.account-delivery .delivery-badge { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 500; text-transform: none; color: var(--muted); }
.selected-match-note { font-size: 13px; }
.account-inventory { overflow: visible; padding: 2px; }
.account-card .preview-groups { gap: 16px; }
.account-card .preview-group { gap: 8px; }
.account-card .preview-grid { display: grid; gap: 10px; justify-content: start; align-items: start; overflow: visible; }
.account-card .members-grid { grid-template-columns: repeat(auto-fill, var(--member-edge)); }
.account-card .snapshots-grid { grid-template-columns: repeat(auto-fill, var(--snapshot-edge)); }
.account-card .art-button { width: 100%; border: 0; border-radius: 8px; overflow: visible; }
.account-card-picture { position: relative; display: block; width: var(--member-edge); aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.landscape-btn .account-card-picture { width: var(--snapshot-edge); aspect-ratio: 16 / 9; }
.account-card-picture img { width: 100%; height: 100%; object-fit: contain; }
.account-card .art-button:hover .account-card-picture { border-color: var(--rose); }
.account-card .is-match .account-card-picture { outline: 2px solid var(--rose-dark); outline-offset: 1px; }
.account-card .badge-rarity { font-size: 11px; padding: 2px 6px; top: auto; bottom: 0; left: 0; border-radius: 0 6px 0 0; }
.match-marker { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--action-bg); color: var(--action-fg); }
.match-marker svg { width: 14px; height: 14px; }
.selected-chips-bar .chips-list { max-height: none; overflow: visible; }
.filter-panel .tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.filter-panel .tile-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results-pane, .filter-panel { scroll-margin-top: 16px; }
@media (max-width: 1100px) { .account-card { --member-edge: 82px; --snapshot-edge: 146px; } }
@media (max-width: 639px) {
  .account-card { --member-edge: 86px; --snapshot-edge: 132px; padding: 16px; }
  .account-actions { width: 100%; }
  .account-actions .button { flex: 1; }
}
@media (max-width: 380px) { .account-card { --member-edge: 76px; --snapshot-edge: 118px; } }

.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.account-title {
  font-size: 18px;
  line-height: 1.35;
  margin-top: 4px;
}

.account-title a:hover {
  color: var(--rose);
}

.account-code-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: monospace;
}

.account-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.stat-ssr strong {
  color: var(--rose-dark);
  font-size: 16px;
}

/* Preview Groups */
.preview-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-group-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.preview-grid {
  display: grid;
  gap: 8px;
}

.members-grid {
  grid-template-columns: repeat(4, 1fr);
}

.snapshots-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Preview Target Size Exception for Viewports < 360px */
@media (max-width: 359px) {
  .members-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.art-button {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}

.art-button.square-btn > img { aspect-ratio: 1; }
.art-button.landscape-btn > img { aspect-ratio: 16 / 9; }
.preview-thumb, .card-crop-img { width: 100%; object-fit: cover; }
.card-caption { display: block; padding: 6px; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; color: var(--ink); }
.art-button .badge-rarity { top: 4px; bottom: auto; font-size: 10px; }
.art-button:hover { border-color: var(--rose); }


.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Preset Hero Pair */
.preset-hero-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  height: 180px;
  background: var(--paper);
  border-radius: var(--radius-control);
  overflow: hidden;
  padding: 8px;
}

.preset-hero-item {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.package-card { gap: 16px; min-height: 100%; }
.package-card .card-header { gap: 10px; }
.package-summary { max-width: 42ch; color: var(--muted); font-size: 13px; line-height: 1.5; }
.package-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 14px; color: var(--muted); }
.package-stats strong { color: var(--rose-dark); font-size: 18px; }
.package-card .card-actions .button { flex: 1 1 150px; }
.package-detail-page { display: grid; gap: 20px; }
.package-detail-page > .back-link { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; color: var(--rose-dark); font-weight: 650; }
.package-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr); gap: 28px; align-items: start; box-shadow: var(--shadow-panel); }
.package-detail-copy { display: grid; gap: 16px; min-width: 0; }
.package-detail-copy h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
.package-detail-copy > p { max-width: 54ch; color: var(--muted); }
.package-detail-stats { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.package-detail-stats span { display: grid; gap: 2px; }
.package-detail-stats strong { color: var(--rose-dark); font-size: 21px; }
.package-detail-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; padding: 12px; border-radius: var(--radius-card); background: var(--paper); }
.package-detail-cards .art-button { min-width: 0; background: var(--surface); }
.package-detail-cards > p { grid-column: 1 / -1; padding: 20px; color: var(--muted); }
@media (max-width: 639px) {
  .package-card .card-actions { flex-direction: column; }
  .package-card .card-actions .button { width: 100%; }
  .package-detail { grid-template-columns: 1fr; gap: 20px; }
  .package-detail-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   12. Pagination Bar
   ========================================================================== */
.pagination-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pagination-range {
  font-size: 14px;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.page-indicator {
  font-size: 14px;
  font-weight: 600;
  padding: 0 8px;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-jump label {
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   13. Detail Page
   ========================================================================== */
.detail-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.detail-nav .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rose);
}

.detail-nav .back-link:hover {
  color: var(--rose-dark);
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.detail-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px;
  align-items: start;
  min-width: 0;
}

.collage-item {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
}

.detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.view-art-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  min-height: 44px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 600;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.detail-title {
  font-size: 26px;
  line-height: 1.2;
}

.detail-code-sub {
  font-size: 14px;
  color: var(--muted);
}

.detail-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.snapshot-notice-text {
  font-size: 13px;
  line-height: 1.5;
}

.verification-meta {
  font-size: 13px;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 639px) {
  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .button {
    width: 100%;
  }
}

/* Detail Inventory Cards */
.detail-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-section-heading {
  font-size: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

/* Detail Grids Responsiveness */
.members-detail-grid {
  grid-template-columns: repeat(3, 1fr);
}

.snapshots-detail-grid {
  grid-template-columns: repeat(2, 1fr);
}

.detail-grid .art-button {
  padding: 6px;
}

.detail-grid .card-caption {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  white-space: normal;
}

/* R Cards Details */
.r-cards-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px 20px;
}

.r-cards-summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.r-subgroup {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.r-subgroup h4 {
  margin-bottom: 12px;
}

/* ==========================================================================
   14. Contact, Help, Error & Not Found
   ========================================================================== */
.contact-page,
.help-page {
  max-width: 680px;
}

.contact-page h1,
.help-page h1 {
  margin-bottom: 12px;
}

.contact-intro {
  margin-bottom: 24px;
}

.discord-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.discord-symbol {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--pink);
  color: var(--rose-dark);
}

.discord-info {
  display: flex;
  flex-direction: column;
}

.discord-info small {
  font-size: 12px;
  color: var(--muted);
}

.discord-info strong {
  font-size: 18px;
}

.inquiry-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inquiry-account-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: var(--radius-control);
  font-size: 14px;
}

.inquiry-section textarea {
  width: 100%;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  resize: vertical;
  line-height: 1.5;
}

.inquiry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Help FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 16px 20px;
}

.faq-item summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.faq-item p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.help-cta-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty & Error States */
.empty-state,
.error-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-block: 48px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.image-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

/* ==========================================================================
   15. Native Dialog Styles
   ========================================================================== */
dialog#image-dialog {
  border: 1px solid var(--control-border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  max-width: min(90vw, 800px);
  margin: auto;
}

dialog#image-dialog::backdrop {
  background: rgba(16, 11, 22, 0.7);
  backdrop-filter: blur(2px);
}

.dialog-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.dialog-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dialog-image-wrapper {
  max-height: 76dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-image-wrapper img {
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
  border-radius: 8px;
}

.dialog-caption {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   16. Breakpoint Rules (Strictly 640px, 1024px, 1280px)
   ========================================================================== */

/* Tablet & Desktop (>= 640px) */
@media (min-width: 640px) {
  .container {
    padding-inline: 28px;
  }

  .site-header {
    min-height: 80px;
  }
  .header-inner { min-height: 80px; }
  .game-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }

  .panel {
    padding: 24px;
  }

  .hero-section {
    padding-block: 36px;
    gap: 32px;
  }

  .hero-title {
    font-size: 44px;
  }

  .hero-scene {
    min-height: 350px;
  }

  .polaroid-frame {
    max-width: 200px;
  }

  .game-entry-banner {
    grid-template-columns: 1fr 1fr;
  }

  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .steps-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .pagination-bar {
    flex-direction: row;
    justify-content: space-between;
  }

  .members-detail-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .snapshots-detail-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop Only (>= 1024px) */
@media (min-width: 1024px) {
  .container {
    padding-inline: 40px;
  }

  .hero-section {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    padding-block: 64px 48px;
  }

  .hero-title {
    font-size: 64px;
  }

  .hero-scene {
    min-height: 400px;
  }

  .polaroid-frame {
    max-width: 240px;
  }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }

  .presets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .catalog-layout {
    grid-template-columns: 344px minmax(0, 1fr);
    gap: 24px;
  }

  .detail-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
  }

  .members-detail-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .snapshots-detail-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}



.game-hero-copy { display: flex; flex-direction: column; gap: 20px; }
.game-hero-artwork { border-radius: var(--radius-card); overflow: hidden; }
.game-cover-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.action-row, .landing-counts { display: flex; flex-wrap: wrap; gap: 12px; }
.server-select-box { display: flex; flex-direction: column; gap: 8px; }
.featured-section .empty-state { align-items: flex-start; text-align: left; padding: 28px; }
.featured-section .empty-state .button { margin-top: 4px; }
.preview-grid > *, .picker-grid > *, .detail-grid > *, .header-right { min-width: 0; }
.detail-counts .count-pill { gap: 4px; }
.dialog-image-wrapper img[hidden] { display: none; }
.dialog-image-wrapper { flex-direction: column; gap: 16px; min-width: 180px; min-height: 120px; }
@media (max-width: 639px) {
  .announcement-status { display: none; }
  .header-inner { gap: 8px; }
  .header-right { gap: 4px; }
  .wordmark .flower { display: none; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .page-content { padding-top: 24px; }
  .hero-copy { order: 0; }
  .hero-scene { max-width: 360px; width: 100%; margin-inline: auto; }
  .hero-actions { margin-top: 0; }
  .hero-actions .button { flex: 1; }
  .toolbar-info { width: 100%; }
  .match-rule-hint { width: 100%; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar-actions .button { padding: 8px 6px; font-size: 13px; }
  .sort-select-box { grid-column: 1 / -1; }
  .sort-select-box select { flex: 1; min-width: 0; }
  .catalog-page .breadcrumb { display: none; }
  .catalog-page .page-intro { margin-bottom: 20px; }
  .catalog-page .server-bar { margin-bottom: 16px; }
  .server-buttons-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-btn { justify-content: space-between; font-size: 13px; padding-inline: 10px; }
  .detail-info { order: -1; padding: 20px; }
  .detail-collage { max-height: 320px; }
  .collage-item { max-height: 280px; }
  .detail-actions { flex-direction: row; }
  .detail-actions .button { flex: 1 1 auto; width: auto; padding-inline: 12px; font-size: 13px; }
  .detail-actions .primary { flex-basis: 100%; }
  .discord-card .button { width: 100%; }
  .footer-links { gap: 12px 20px; }
  .card-actions .button { flex: 1; padding-inline: 10px; }
}
@media (max-width: 359px) {
  .wordmark { font-size: 24px; }
  .header-right .icon-button { width: 40px; min-width: 40px; }
}


/* ==========================================================================
   17. Per-Game Adaptive Explorer: Sub-Servers, Attributes, Meta Tiers & Stats
   ========================================================================== */

/* Region & Sub-Server Hierarchy Panel */
.catalog-region-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.catalog-region-section .server-bar {
  margin-bottom: 0;
}

.catalog-region-section .server-label,
.landing-subservers .server-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.catalog-region-section .server-label svg {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.subserver-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.landing-subservers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subserver-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subserver-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.subserver-pill:hover:not(.active) {
  border-color: var(--rose);
  background: var(--pink);
}

.subserver-pill.active {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  border-color: var(--inverse-bg);
  box-shadow: 0 4px 12px rgba(51, 48, 64, 0.18);
}

.subserver-pill-native {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.72;
}

.subserver-pill .count-pill {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.07);
  border: none;
  color: inherit;
}

.subserver-pill.active .count-pill {
  background: rgba(255, 255, 255, 0.22);
  color: var(--inverse-fg);
}

[data-theme="dark"] .subserver-pill.active .count-pill {
  background: rgba(0, 0, 0, 0.16);
}

/* Sub-Server Badges on Cards & Detail View */
.subserver-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(14, 116, 144, 0.11);
  color: #0e7490;
  border: 1px solid rgba(14, 116, 144, 0.35);
}

.subserver-badge[data-subserver="Asia 1-3"] {
  background: rgba(37, 99, 235, 0.11);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.32);
}

.subserver-badge[data-subserver="Asia 2-3"] {
  background: rgba(147, 51, 234, 0.11);
  color: #7e22ce;
  border-color: rgba(147, 51, 234, 0.32);
}

[data-theme="dark"] .subserver-badge {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.36);
}

[data-theme="dark"] .subserver-badge[data-subserver="Asia 1-3"] {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.38);
}

[data-theme="dark"] .subserver-badge[data-subserver="Asia 2-3"] {
  background: rgba(192, 132, 252, 0.18);
  color: #d8b4fe;
  border-color: rgba(192, 132, 252, 0.38);
}

/* Player-Centric Stats Strip (Replaces Prices) */
.player-stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.stat-pill strong {
  font-size: 13px;
  font-weight: 800;
}

.stat-pill svg {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.stat-pill.stat-ssr {
  background: rgba(164, 75, 112, 0.12);
  border-color: rgba(164, 75, 112, 0.35);
  color: var(--rose-dark);
}

.stat-pill.stat-ssr strong {
  color: var(--rose-dark);
}

.stat-pill.stat-tier-ss {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(244, 63, 94, 0.16), rgba(168, 85, 247, 0.18));
  border-color: #d97706;
  color: #9a3412;
  box-shadow: 0 1px 6px rgba(245, 158, 11, 0.18);
}

.stat-pill.stat-tier-ss strong {
  color: #b45309;
}

[data-theme="dark"] .stat-pill.stat-tier-ss {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.24), rgba(244, 63, 94, 0.2), rgba(192, 132, 252, 0.24));
  border-color: #fbbf24;
  color: #fde68a;
}

[data-theme="dark"] .stat-pill.stat-tier-ss strong {
  color: #fef08a;
}

.stat-pill.stat-tier-s {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.14), rgba(126, 34, 206, 0.14));
  border-color: rgba(162, 28, 175, 0.42);
  color: #86198f;
}

.stat-pill.stat-tier-s strong {
  color: #9d174d;
}

[data-theme="dark"] .stat-pill.stat-tier-s {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(168, 85, 247, 0.22));
  border-color: rgba(232, 121, 249, 0.45);
  color: #f5d0fe;
}

[data-theme="dark"] .stat-pill.stat-tier-s strong {
  color: #fbcfe8;
}

.stat-pill.stat-tier-none {
  color: var(--muted);
  border-style: dashed;
  font-weight: 500;
}

.stat-pill.stat-gems {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

.stat-pill.stat-gems strong {
  color: #0369a1;
}

[data-theme="dark"] .stat-pill.stat-gems {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}

[data-theme="dark"] .stat-pill.stat-gems strong {
  color: #bae6fd;
}

/* Filter Sidebar Header & Filter Groups */
.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-reset {
  min-height: 32px;
  padding: 4px 6px;
  font-size: 12px;
}

.picker-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-group-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.filter-group-label svg {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  color: var(--rose);
}

.tier-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--rose);
}

.tier-source-link:hover {
  text-decoration: underline;
}

.tier-source-link svg {
  width: 11px;
  height: 11px;
  flex-basis: 11px;
}

/* Meta Tier Filter Pills */
.meta-tier-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.meta-tier-pill:hover {
  border-color: var(--control-border);
}

.meta-tier-pill[data-meta-tier="SS"] {
  border-color: rgba(217, 119, 6, 0.55);
  color: #b45309;
}

.meta-tier-pill[data-meta-tier="S"] {
  border-color: rgba(162, 28, 175, 0.45);
  color: #86198f;
}

.meta-tier-pill[data-meta-tier="SS_S"] {
  border-color: rgba(225, 29, 72, 0.45);
  color: #be123c;
}

.meta-tier-pill[data-meta-tier="A"] {
  border-color: rgba(3, 105, 161, 0.4);
  color: #0369a1;
}

[data-theme="dark"] .meta-tier-pill[data-meta-tier="SS"] { color: #fde68a; border-color: rgba(251, 191, 36, 0.55); }
[data-theme="dark"] .meta-tier-pill[data-meta-tier="S"] { color: #f5d0fe; border-color: rgba(232, 121, 249, 0.48); }
[data-theme="dark"] .meta-tier-pill[data-meta-tier="SS_S"] { color: #fda4af; border-color: rgba(251, 113, 133, 0.5); }
[data-theme="dark"] .meta-tier-pill[data-meta-tier="A"] { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.45); }

.meta-tier-pill.active {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  border-color: transparent;
}

.meta-tier-pill[data-meta-tier="SS"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #f43f5e 52%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.meta-tier-pill[data-meta-tier="S"].active {
  background: linear-gradient(135deg, #be123c 0%, #7e22ce 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(190, 18, 60, 0.3);
}

.meta-tier-pill[data-meta-tier="SS_S"].active {
  background: linear-gradient(135deg, #d97706 0%, #be123c 55%, #7e22ce 100%);
  color: #ffffff;
}

.meta-tier-pill[data-meta-tier="A"].active {
  background: linear-gradient(135deg, #0369a1 0%, #0d9488 100%);
  color: #ffffff;
}

.meta-tier-pill[data-meta-tier="B"].active {
  background: #475569;
  color: #ffffff;
}

.pill-mini-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

/* 6 Attribute Filter Pills */
.attr-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attr-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.attr-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.attr-pill[data-attr="aggressive"] { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); background: rgba(220, 38, 38, 0.07); }
.attr-pill[data-attr="smart"]      { color: #0284c7; border-color: rgba(2, 132, 199, 0.35); background: rgba(2, 132, 199, 0.07); }
.attr-pill[data-attr="shy"]        { color: #059669; border-color: rgba(5, 150, 105, 0.35); background: rgba(5, 150, 105, 0.07); }
.attr-pill[data-attr="cute"]       { color: #b45309; border-color: rgba(217, 119, 6, 0.38); background: rgba(217, 119, 6, 0.08); }
.attr-pill[data-attr="comical"]    { color: #7c3aed; border-color: rgba(124, 58, 237, 0.42); background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(236, 72, 153, 0.1)); }
.attr-pill[data-attr="clever"]     { color: #9a3412; border-color: rgba(180, 83, 9, 0.48); background: linear-gradient(135deg, rgba(30, 27, 46, 0.12), rgba(153, 27, 27, 0.12)); }

[data-theme="dark"] .attr-pill[data-attr="aggressive"] { color: #fca5a5; border-color: rgba(248, 113, 113, 0.42); background: rgba(239, 68, 68, 0.14); }
[data-theme="dark"] .attr-pill[data-attr="smart"]      { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.42); background: rgba(14, 165, 233, 0.14); }
[data-theme="dark"] .attr-pill[data-attr="shy"]        { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.42); background: rgba(16, 185, 129, 0.14); }
[data-theme="dark"] .attr-pill[data-attr="cute"]       { color: #fde68a; border-color: rgba(251, 191, 36, 0.42); background: rgba(245, 158, 11, 0.14); }
[data-theme="dark"] .attr-pill[data-attr="comical"]    { color: #ddd6fe; border-color: rgba(196, 181, 253, 0.48); background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(236, 72, 153, 0.18)); }
[data-theme="dark"] .attr-pill[data-attr="clever"]     { color: #fcd34d; border-color: rgba(245, 158, 11, 0.55); background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(127, 29, 29, 0.45)); }

.attr-pill.active {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  border-color: transparent;
}

.attr-pill[data-attr="aggressive"].active { background: #dc2626; color: #ffffff; }
.attr-pill[data-attr="smart"].active      { background: #0284c7; color: #ffffff; }
.attr-pill[data-attr="shy"].active        { background: #059669; color: #ffffff; }
.attr-pill[data-attr="cute"].active       { background: #d97706; color: #ffffff; }
.attr-pill[data-attr="comical"].active    { background: linear-gradient(135deg, #7c3aed, #db2777); color: #ffffff; }
.attr-pill[data-attr="clever"].active     { background: linear-gradient(135deg, #1e1b2e, #991b1b); color: #fde68a; border-color: #f59e0b; }

/* Card Tier Badges (SS / S / A / B) */
.badge-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.badge-tier[data-tier="SS"] {
  background: linear-gradient(135deg, #f59e0b 0%, #f43f5e 48%, #a855f7 100%);
  color: #ffffff;
  border: 1px solid rgba(254, 240, 138, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}

.badge-tier[data-tier="S"] {
  background: linear-gradient(135deg, #be123c 0%, #7e22ce 100%);
  color: #ffffff;
  border: 1px solid rgba(245, 208, 254, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.badge-tier[data-tier="A"] {
  background: linear-gradient(135deg, #0369a1 0%, #0d9488 100%);
  color: #ffffff;
}

.badge-tier[data-tier="B"] {
  background: #475569;
  color: #f1f5f9;
}

.tile-tier-corner,
.card-tier-corner,
.hero-tier-corner {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
}

.account-card .card-tier-corner {
  top: 3px;
  left: 3px;
  font-size: 10px;
  padding: 2px 5px;
}

.badge-tier.compact {
  position: static;
  font-size: 10px;
  padding: 1px 5px;
  box-shadow: none;
}

/* Card Attribute Badges (On Tiles, Chips, Account Results, Detail View) */
.badge-attr {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid transparent;
}

.badge-attr .attr-icon {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
}

.badge-attr-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-attr.micro {
  width: 100%;
  justify-content: center;
  padding: 2px 4px;
  font-size: 10px;
  border-radius: 5px;
}

.badge-attr.compact {
  padding: 1px 6px;
  font-size: 10px;
}

.badge-attr[data-attr="aggressive"] { background: rgba(220, 38, 38, 0.13); color: #b91c1c; border-color: rgba(220, 38, 38, 0.32); }
.badge-attr[data-attr="smart"]      { background: rgba(2, 132, 199, 0.13); color: #0369a1; border-color: rgba(2, 132, 199, 0.32); }
.badge-attr[data-attr="shy"]        { background: rgba(5, 150, 105, 0.13); color: #047857; border-color: rgba(5, 150, 105, 0.32); }
.badge-attr[data-attr="cute"]       { background: rgba(217, 119, 6, 0.14); color: #b45309; border-color: rgba(217, 119, 6, 0.34); }
.badge-attr[data-attr="comical"]    { background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.14)); color: #6d28d9; border-color: rgba(139, 92, 246, 0.42); }
.badge-attr[data-attr="clever"]     { background: linear-gradient(135deg, #272038, #7f1d1d); color: #fde68a; border-color: rgba(245, 158, 11, 0.65); }

[data-theme="dark"] .badge-attr[data-attr="aggressive"] { background: rgba(239, 68, 68, 0.22); color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
[data-theme="dark"] .badge-attr[data-attr="smart"]      { background: rgba(14, 165, 233, 0.22); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); }
[data-theme="dark"] .badge-attr[data-attr="shy"]        { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.4); }
[data-theme="dark"] .badge-attr[data-attr="cute"]       { background: rgba(245, 158, 11, 0.22); color: #fde68a; border-color: rgba(251, 191, 36, 0.4); }
[data-theme="dark"] .badge-attr[data-attr="comical"]    { background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(236, 72, 153, 0.22)); color: #e9d5ff; border-color: rgba(196, 181, 253, 0.48); }
[data-theme="dark"] .badge-attr[data-attr="clever"]     { background: linear-gradient(135deg, #1b1726, #7f1d1d); color: #fde68a; border-color: rgba(251, 191, 36, 0.65); }

/* Card Tile, Chip, Account Result & Detail View Badge Integrations */
.tile-badges-row {
  display: flex;
  width: 100%;
  margin-top: 2px;
}

.card-attr-bar {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.account-card .art-button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.account-card .badge-count.with-match {
  right: 26px;
  border-radius: 0 0 6px 6px;
}

.chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chip-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.chip-rarity {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.detail-card-picture {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
}

.landscape-btn .detail-card-picture {
  aspect-ratio: 16 / 9;
}

.detail-card-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-card-picture .badge-rarity {
  top: auto;
  bottom: 4px;
  left: 4px;
}

.card-sub-caption {
  display: block;
  padding: 0 6px 4px;
  font-size: 11px;
  color: var(--muted);
}

.preset-hero-item {
  position: relative;
}

.hero-attr-corner {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.hero-attr-corner .badge-attr.micro {
  width: auto;
  backdrop-filter: blur(6px);
}

.collage-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}

.picker-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 8px;
  text-align: center;
}

.picker-empty-text {
  font-size: 13px;
  color: var(--muted);
}

.dialog-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.dialog-meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 639px) {
  .catalog-region-section {
    padding: 14px;
  }

  .subserver-pill {
    flex: 1 1 auto;
    justify-content: space-between;
  }

  .subserver-pill-native {
    display: none;
  }
}
