:root {
  --bg: #f3f1ec; --paper: #fff; --ink: #16161a; --muted: #6b6b73; --line: #e2dfd8;
  --accent: #7c3aed;
  --ko: "Black Han Sans", "Apple SD Gothic Neo", sans-serif;
  --ko2: "Do Hyeon", "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif; }
a { color: inherit; }
img, svg { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header / footer */
.site-header { background: var(--paper); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 20px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { font-family: var(--ko); background: var(--ink); color: #fff; border-radius: 8px; padding: 0 8px; font-size: 18px; line-height: 30px; }
.site-header nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.dex-count { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 14px; }
.site-footer p { margin: 4px 0; }

/* hero */
.hero { padding: 40px 0 16px; max-width: 720px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 12px; }
.hero h1 [lang="ko"] { font-family: var(--ko); color: #ea580c; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 0 8px; }
.hero-small { padding-top: 16px; }
.hero-small h1 { color: var(--c); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.chip small { color: var(--muted); font-weight: 400; }
.chip.is-on { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: #fff; }
.chip.is-on small { color: rgba(255,255,255,.8); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.card-link { text-decoration: none; display: block; transition: transform .15s ease; }
.card-link:hover { transform: translateY(-4px) rotate(-.5deg); }
.card-link[hidden] { display: none; }

/* card */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.07); position: relative; }
.card-top { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; font-size: 11px; font-weight: 600; }
.type-pill { background: var(--c); color: #fff; border-radius: 999px; padding: 1px 8px; }
.num { color: var(--muted); }
.art { position: relative; aspect-ratio: 300 / 220; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--c2); display: grid; place-items: center; }
.art-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sfx-text { position: relative; font-family: var(--ko); color: #fff; font-size: 54px; line-height: 1; letter-spacing: -1px;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); }
.sfx-text.long { font-size: 34px; }
.card-name { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 8px 4px 0; }
.card-name b { font-family: var(--ko2); font-weight: 400; font-size: 20px; }
.card-name span { color: var(--muted); font-size: 12px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 2px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rarity-rare { color: #b45309; }
.rarity-uncommon { color: #0f766e; }
.rarity-common { color: var(--muted); }
.collected-badge { display: none; color: var(--c); }
.is-collected .collected-badge { display: inline; }
.is-collected { box-shadow: 0 0 0 3px var(--c), 0 8px 22px rgba(0,0,0,.07); }

/* full card on detail page */
.card-full .sfx-text { font-size: 92px; -webkit-text-stroke: 6px var(--ink); text-shadow: 6px 6px 0 var(--ink); }
.card-full .sfx-text.long { font-size: 58px; }
.card-full .card-name b { font-size: 28px; }
.card-full .card-name span { font-size: 15px; }
.card-full .card-top { font-size: 13px; }
.card-feel { padding: 0 4px 8px; color: var(--muted); font-size: 14px; }
.card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 4px; border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line); font-size: 12px; }
.card-stats div { display: flex; justify-content: space-between; gap: 4px; }
.stars { color: var(--c); letter-spacing: 1px; }
.card-full .card-foot { font-size: 12px; padding-top: 8px; }

/* detail layout */
.crumbs { font-size: 13px; color: var(--muted); padding: 20px 0 8px; }
.crumbs a { color: var(--muted); }
.detail { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 40px; align-items: start; }
.detail-card { position: sticky; top: 84px; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 700; font-size: 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-play { background: var(--ink); color: #fff; }
.volume { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.volume input { flex: 1; max-width: 220px; accent-color: var(--ink); }
.btn-collect.is-on { background: #fde68a; }

.prose { max-width: 680px; }
.prose h1 { font-size: 40px; margin: 0 0 4px; line-height: 1.2; }
.prose h1 [lang="ko"] { font-family: var(--ko); }
.prose h1 small { font-size: 22px; color: var(--muted); font-weight: 600; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose .lead { font-size: 19px; color: var(--muted); margin-top: 0; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.similar { list-style: none; padding: 0 !important; }
.similar li { margin: 6px 0; }
.similar a { text-decoration: none; display: block; background: var(--paper); border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.similar a:hover { border-color: var(--ink); }
.similar b { font-family: var(--ko2); font-weight: 400; font-size: 18px; }
.similar span { color: var(--muted); font-style: italic; }
.suggest { margin-top: 32px; font-size: 14px; color: var(--muted); }
.page { padding-top: 32px; }
.home-about { margin-top: 48px; }

.prevnext { display: flex; justify-content: space-between; margin: 48px 0 0; font-weight: 700; }
.prevnext a { text-decoration: none; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 16px; background: var(--paper); }
.prevnext [lang="ko"] { font-family: var(--ko2); font-weight: 400; font-size: 18px; }

/* play animations */
@keyframes shake { 0%,100% { transform: translate(0) } 20% { transform: translate(-8px, 4px) rotate(-2deg) } 40% { transform: translate(7px, -5px) rotate(2deg) } 60% { transform: translate(-6px, 2px) } 80% { transform: translate(4px, -2px) } }
@keyframes pulse { 0%,100% { transform: scale(1) } 15% { transform: scale(1.08) } 30% { transform: scale(1) } 45% { transform: scale(1.06) } }
@keyframes slide { 0% { transform: translateX(0) } 40% { transform: translateX(16px) skewX(-10deg) } 100% { transform: translateX(0) } }
@keyframes flash { 0%,100% { filter: none } 20% { filter: brightness(1.8) saturate(1.4) } 50% { filter: brightness(1.2) } }
@keyframes tremble { 0%,100% { transform: translate(0) } 10%,30%,50%,70%,90% { transform: translate(-2px, 1px) } 20%,40%,60%,80% { transform: translate(2px, -1px) } }
@keyframes pop { 0% { transform: scale(1) } 30% { transform: scale(1.12) rotate(-3deg) } 100% { transform: scale(1) } }
.anim-shake { animation: shake .45s ease; }
.anim-pulse { animation: pulse .9s ease; }
.anim-slide { animation: slide .5s ease; }
.anim-flash { animation: flash .6s ease; }
.anim-tremble { animation: tremble .8s linear; }
.anim-pop { animation: pop .4s ease; }
@media (prefers-reduced-motion: reduce) { [class*="anim-"] { animation: none !important; } .card-link:hover { transform: none; } }

@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-card { position: static; max-width: 420px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .sfx-text { font-size: 44px; }
  .sfx-text.long { font-size: 28px; }
  .site-header nav { gap: 10px; font-size: 13px; }
}
