@import url("https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --bg: #040404;
  --panel: #0e0e0f;
  --panel-soft: #131314;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f2;
  --muted: #a4a4a2;
  --gold: #f2cb71;
  --gold-strong: #ffd978;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  --fw-thin: 100;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv11" 1, "ss01" 1;
  background: radial-gradient(circle at 50% -20%, rgba(255, 212, 126, 0.16), transparent 45%), var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 160ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  ::view-transition-old(root) {
    animation-name: chicon-fade-out;
  }

  ::view-transition-new(root) {
    animation-name: chicon-fade-in;
  }
}

@keyframes chicon-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes chicon-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent 100px),
    linear-gradient(to top, rgba(255, 255, 255, 0.03), transparent 200px);
}

.app-shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) 30px;
}

.content.menu-content-fade-out {
  opacity: 0;
  transition: opacity 110ms ease-out;
}

.content.menu-content-fade-in {
  opacity: 0;
}

.content.menu-content-fade-in.menu-content-fade-in-active {
  opacity: 1;
  transition: opacity 170ms ease-out;
}

.site-header {
  position: relative;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #090909;
}

.site-admin-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 9;
}

.header-banner {
  position: absolute;
  inset: 0;
  background-image: url("/public/chicon-header-banner.webp");
  background-size: cover;
  background-position: center 38%;
  opacity: 0.95;
  pointer-events: none;
}

.header-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.05) 35%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 2;
}

.header-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.15) 45%, transparent 80%);
  z-index: 2;
}

.header-layer {
  position: relative;
  z-index: 4;
}

.header-topbar {
  min-height: 250px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.top-nav-spacer {
  min-height: 1px;
}

.top-nav-right {
  display: flex;
  justify-content: flex-end;
}

.admin-entry {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 14, 14, 0.75);
  color: #cfcfce;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  transition: border-color 120ms ease, color 120ms ease;
}

.admin-entry:hover {
  border-color: rgba(242, 203, 113, 0.72);
  color: var(--gold);
}

.logo-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: -2px;
}

.logo-medallion {
  width: clamp(92px, 8.6vw, 132px);
  height: clamp(92px, 8.6vw, 132px);
  border-radius: 999px;
  border: 3px solid rgba(247, 224, 170, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(35, 35, 35, 0.45);
  background-image: url("/public/chicon-mark-from-card.png");
  background-repeat: no-repeat;
  background-size: 100%;
  background-position: center;
  background-color: transparent;
}

.logo-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f0e0b4;
  letter-spacing: 0.12em;
  font-size: clamp(16px, 1.6vw, 25px);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
}

.logo-title::before,
.logo-title::after {
  content: "•";
  color: #f0cd80;
  font-size: 0.75em;
}

.baseline {
  margin: 0;
  font-size: 11px;
  color: #d9d4c8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  opacity: 0.86;
}

.header-subbar {
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(4, 4, 4, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.header-communitybar {
  position: fixed;
  right: 16px;
  top: 30%;
  transform: translateY(-50%);
  z-index: 45;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  animation: community-toast-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.community-link {
  display: grid;
  justify-self: end;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 50px;
  min-height: 50px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(24, 24, 25, 0.95) 0%, rgba(16, 16, 17, 0.96) 100%);
  color: #e2e2e1;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  letter-spacing: 0.01em;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-origin: right center;
  will-change: width, transform;
  transition: width 270ms cubic-bezier(0.22, 1, 0.36, 1), transform 270ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.community-link::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.92;
}

.community-link:hover,
.community-link:focus-visible {
  width: min(320px, calc(100vw - 28px));
  transform: translateX(-6px);
  color: #f5f4ef;
  border-color: rgba(255, 255, 255, 0.34);
}

.community-link-twitch:hover {
  border-color: rgba(145, 70, 255, 0.6);
}

.community-link-discord:hover {
  border-color: rgba(88, 101, 242, 0.62);
}

.community-icon {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 2;
}

.community-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 1px solid currentColor;
  opacity: 0.24;
  animation: community-icon-pulse 2.2s ease-in-out infinite;
}

.community-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  filter: drop-shadow(0 0 10px currentColor);
  animation: community-icon-bob 2.2s ease-in-out infinite;
}

.community-link-twitch .community-icon {
  color: #bb9cff;
  background: rgba(145, 70, 255, 0.16);
  border-color: rgba(145, 70, 255, 0.5);
}

.community-link-discord .community-icon {
  color: #98a7ff;
  background: rgba(88, 101, 242, 0.16);
  border-color: rgba(88, 101, 242, 0.5);
}

.community-link-discord .community-icon::after,
.community-link-discord .community-icon svg {
  animation-delay: 0.25s;
}

.community-link > * {
  position: relative;
  z-index: 2;
}

.community-link > span:last-child {
  display: block;
  font-weight: var(--fw-bold);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(11px);
  transition: opacity 160ms ease 40ms, transform 260ms cubic-bezier(0.22, 1, 0.36, 1) 20ms;
  pointer-events: none;
  padding-right: 14px;
}

.community-link-twitch::before {
  background: radial-gradient(120% 100% at 0% 50%, rgba(145, 70, 255, 0.18), transparent 52%);
}

.community-link-discord::before {
  background: radial-gradient(120% 100% at 0% 50%, rgba(88, 101, 242, 0.18), transparent 52%);
}

.community-link:hover > span:last-child,
.community-link:focus-visible > span:last-child {
  opacity: 1;
  transform: translateX(0);
}

.community-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

@keyframes community-icon-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.26;
  }
  50% {
    transform: scale(1.16);
    opacity: 0.08;
  }
}

@keyframes community-icon-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes community-toast-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-icon::after,
  .community-icon svg {
    animation: none;
  }

  .community-link,
  .community-link > span:last-child {
    transition: none;
  }
}

.main-menu {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0 6px;
}

.menu-link {
  position: relative;
  padding: 9px 2px 10px;
  color: #8d8d8f;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  font-size: 13px;
  letter-spacing: 0.05em;
  transition: color 120ms ease;
}

.menu-link:hover {
  color: #d4d4d5;
}

.menu-link.active {
  color: var(--gold);
}

.menu-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--gold);
}

.content {
  display: grid;
  gap: var(--space-md);
}

.site-footer {
  margin-top: 20px;
  padding: 8px 0 2px;
  display: grid;
  gap: 9px;
  justify-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 16px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: #dedede;
  padding: 4px 2px;
  transition: color 140ms ease, transform 140ms ease;
}

.footer-link:hover {
  transform: translateY(-1px);
}

.footer-link-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-link-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.footer-link-twitch {
  color: #c8a9ff;
}

.footer-link-discord {
  color: #a7b6ff;
}

.footer-link-twitch:hover {
  color: #e2d1ff;
}

.footer-link-discord:hover {
  color: #c8d2ff;
}

.footer-link-label {
  color: #d7d7d6;
}

.footer-legal {
  margin: 0;
  color: #9d9d9c;
  font-size: 12px;
  line-height: 1.45;
  max-width: 960px;
}

.hero-card,
.panel,
.stat-tile,
.progress-card,
.podium-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #111111 0%, #0c0c0d 100%);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: var(--fw-extrabold);
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(26px, 2.7vw, 38px);
}

.hero-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.btn {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms ease;
}

.btn.primary {
  color: #0d0d0c;
  background: linear-gradient(180deg, #ffe7a9 0%, #f2cb71 100%);
  border-color: #f4d690;
}

.btn.primary:hover {
  filter: brightness(1.04);
}

.btn.ghost {
  color: #e8e8e7;
  background: #141415;
}

.btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.status-text {
  min-height: 18px;
  color: var(--muted);
}

.stats-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-tile {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-tile span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-bold);
}

.stat-tile strong {
  font-size: 24px;
}

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

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 var(--space-sm);
  font-size: 21px;
  font-weight: var(--fw-extrabold);
}

.panel > :first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.progress-list {
  display: grid;
  gap: 10px;
}

.progress-card {
  padding: 11px;
  background: linear-gradient(180deg, #151515 0%, #111 100%);
}

.progress-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-card small {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #212121;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f8dea0, #d29e3f);
}

.collection-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-sm);
}

.collection-toolbar h2 {
  margin: 0;
}

.search-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.collection-controls {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.set-filter-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.set-filter-wrap label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

.set-filter-wrap select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #111;
  color: var(--text);
  padding: 12px 42px 12px 12px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.set-filter-wrap::after {
  content: "";
  position: absolute;
  right: 18px;
  top: calc(100% - 22px);
  width: 8px;
  height: 8px;
  border-right: 2px solid #d8d8d8;
  border-bottom: 2px solid #d8d8d8;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
  opacity: 0.9;
}

.search-wrap input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #111;
  color: var(--text);
  padding: 12px;
}

.search-wrap input,
.set-filter-wrap select {
  min-height: 44px;
}

.search-wrap input::placeholder {
  color: #868687;
}

.search-wrap span {
  color: var(--muted);
  font-size: 12px;
}

.collection-statbar {
  margin: 0 0 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.compact-stat-chip {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #141415 0%, #101011 100%);
  padding: 7px 9px;
  display: grid;
  gap: 2px;
}

.compact-stat-chip span {
  font-size: 10px;
  color: #a8a8a8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

.compact-stat-chip strong {
  font-size: 14px;
  color: #f3e6c6;
  font-weight: var(--fw-extrabold);
  line-height: 1.2;
}

.collection-deep-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.rarity-stat-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.rarity-stat-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(20, 20, 21, 0.82);
  padding: 7px 8px;
  display: grid;
  gap: 2px;
}

.rarity-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #c9c9c8;
  letter-spacing: 0.04em;
  font-weight: var(--fw-semibold);
}

.rarity-stat-value {
  font-size: 12px;
  color: #f4e3ba;
  font-weight: var(--fw-bold);
}

.theme-stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-stat-title {
  font-size: 10px;
  text-transform: uppercase;
  color: #9c9c9a;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

.theme-stat-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 15, 16, 0.86);
  color: #d8d8d6;
  font-size: 11px;
  font-weight: var(--fw-medium);
  padding: 4px 9px;
}

.cards-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
}

.card-entry {
  border-radius: 13px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(180deg, #151515 0%, #0e0e0e 100%);
  transition: transform 120ms ease, border-color 120ms ease;
  cursor: pointer;
}

.card-entry:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 203, 113, 0.55);
}

.card-entry.hidden {
  display: none;
}

.card-entry.missing {
  opacity: 0.92;
  cursor: default;
}

.card-entry.missing .cover img {
  filter: blur(22px) saturate(0.25) brightness(0.55);
  transform: scale(1.18);
}

.card-entry.missing .cover::before {
  content: "?";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: var(--fw-black);
  color: rgba(255, 244, 216, 0.9);
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.1em;
  z-index: 2;
}

.card-entry.missing .meta {
  opacity: 0.72;
}

.cover {
  position: relative;
  aspect-ratio: 5 / 7;
  background: radial-gradient(circle at 50% 20%, #252525, #121212);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover.img-missing::after {
  content: "VISUEL EN ATTENTE";
  position: absolute;
  inset: auto 10px 10px 10px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #d8d8d8;
  font-weight: 700;
}

.badge {
  position: absolute;
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.88);
  border: 1px solid var(--line-strong);
  font-size: 11px;
  font-weight: 700;
}

.badge {
  top: 44px;
  right: 8px;
  padding: 3px 8px;
  border-color: rgba(242, 203, 113, 0.65);
  color: #f2cb71;
  z-index: 3;
}

.meta {
  padding: 10px;
}

.code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: #9f9f9f;
  margin-bottom: 4px;
}

.name {
  font-weight: var(--fw-bold);
  min-height: 34px;
  margin-bottom: 6px;
}

.rarity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(17, 17, 18, 0.86);
  color: var(--rarity-color, #fff);
  font-size: 12px;
  font-weight: var(--fw-bold);
  padding: 4px 10px;
  line-height: 1;
}

.owned-count {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 192, 127, 0.8);
  background: linear-gradient(180deg, rgba(108, 49, 19, 0.95), rgba(73, 30, 12, 0.96));
  color: #ffd7a6;
  font-size: 12px;
  font-weight: var(--fw-extrabold);
  padding: 4px 9px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.tags {
  font-size: 12px;
  color: #9f9f9f;
  margin-bottom: 0;
}

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.card-modal.hidden {
  display: none;
}

.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
}

.card-modal-dialog {
  position: relative;
  width: min(92vw, 720px);
  max-height: 92vh;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #090909;
  padding: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.56);
  z-index: 1;
  display: grid;
  gap: 12px;
}

.card-modal-title {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: #ece9dd;
  font-weight: var(--fw-bold);
}

.card-modal-image {
  display: block;
  width: 100%;
  max-height: calc(92vh - 120px);
  object-fit: contain;
  border-radius: 10px;
  background: #0f0f0f;
}

.card-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(28, 28, 28, 0.9);
  color: #fff4d8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.card-modal-close:hover {
  border-color: rgba(242, 203, 113, 0.7);
  color: var(--gold);
}

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

.podium-card {
  padding: 14px;
}

.podium-rank {
  margin: 0;
  font-weight: var(--fw-extrabold);
}

.podium-card h3 {
  margin: 4px 0;
}

.rank-1 {
  border-color: rgba(242, 203, 113, 0.42);
}

.rank-2 {
  border-color: rgba(196, 196, 196, 0.35);
}

.rank-3 {
  border-color: rgba(207, 149, 87, 0.35);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px var(--space-sm);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  color: #d3d3d3;
  font-weight: var(--fw-bold);
}

.wiki-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #d6d6d6;
}

.wiki-section-panel {
  display: grid;
  gap: 12px;
}

.wiki-set-controls {
  display: grid;
  grid-template-columns: minmax(220px, 340px);
  gap: var(--space-sm);
}

.wiki-set-filter {
  max-width: 340px;
}

.wiki-lore-panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 16px;
}

.wiki-lore-copy h2 {
  margin: 0;
}

.wiki-lore-copy p {
  margin: 0;
  color: #dbdbdb;
  line-height: 1.65;
}

.wiki-lore-visual {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f0f10;
}

.wiki-lore-visual img {
  width: 100%;
  height: 220px;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.02);
}

.wiki-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  color: #d6d6d6;
}

.wiki-steps li {
  line-height: 1.55;
}

.wiki-command-list code {
  font-weight: var(--fw-bold);
}

.wiki-drop-panel {
  gap: 14px;
}

.wiki-drop-legend {
  grid-template-columns: 1fr;
}

.wiki-drop-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.wiki-drop-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121213;
  padding: var(--space-sm);
}

.wiki-drop-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: var(--fw-bold);
}

.muted {
  color: var(--muted);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.rank-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-sm);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #121213;
}

@media (max-width: 1100px) {
  .header-topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 12px 14px;
  }

  .header-subbar {
    justify-content: center;
    padding: 5px var(--space-sm) 7px;
  }

  .main-menu {
    width: 100%;
    justify-content: center;
  }

  .header-communitybar {
    right: 12px;
    top: 32%;
    transform: translateY(-50%);
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .panel-grid,
  .podium-grid {
    grid-template-columns: 1fr;
  }

  .wiki-lore-panel,
  .wiki-drop-grid,
  .wiki-drop-legend {
    grid-template-columns: 1fr;
  }

  .wiki-set-controls {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 12px 12px 22px;
  }

  .site-footer {
    padding: 6px 0 0;
  }

  .footer-links {
    justify-content: center;
    gap: 8px 12px;
  }

  .footer-link {
    font-size: 13px;
  }

  .footer-link-icon {
    width: 20px;
    height: 20px;
  }

  .logo-title {
    font-size: clamp(15px, 5.2vw, 24px);
    letter-spacing: 0.08em;
    gap: 8px;
  }

  .baseline {
    font-size: 13px;
  }

  .main-menu {
    gap: 10px;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 2px;
  }

  .header-communitybar {
    left: auto;
    right: 10px;
    top: 36%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .community-link {
    grid-template-columns: 46px minmax(0, 1fr);
    width: 46px;
    min-height: 46px;
    gap: 8px;
  }

  .community-icon {
    width: 46px;
    height: 46px;
  }

  .community-icon svg {
    width: 21px;
    height: 21px;
  }

  .menu-link {
    font-size: 12px;
    white-space: nowrap;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .collection-controls {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

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

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