/* pokemonresonance.org — 포켓몬 레조넌스 공략. 색은 원작 배틀 화면에서 가져왔다:
   상단 띠 #1d222c(배틀 HUD의 어두운 판), 강조 #f5c84a(「맞대결!」 글자), 타입 색은 게임 내 타입 칩. */
:root {
  --ink: #1b1f27;
  --ink2: #4a5260;
  --mute: #5a6170;
  --line: #e2e5ea;
  --bg: #f4f5f7;
  --card: #fff;
  --hud: #1d222c;
  --hud2: #2a313e;
  --accent: #f5c84a;
  --accent-ink: #2b2206;
  --ok: #23753c;
  --warn: #9a4f08;
  --bad: #c0392b;
  --link: #1f5fb8;
  --r: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.65 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0 0 0.8rem; }
small, .mute { color: var(--mute); }

/* 상단 */
.top { background: var(--hud); color: #e9ecf1; }
.top .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand span small { display: block; color: #9aa4b4; font-weight: 500; font-size: 0.72rem; line-height: 1.1; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #c9d0db; padding: 15px 11px; font-size: 0.95rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; text-decoration: none; background: var(--hud2); }
.nav a[aria-current] { color: #fff; border-bottom-color: var(--accent); }
.ver { font-size: 0.8rem; color: #9aa4b4; white-space: nowrap; }
.ver b { color: var(--accent); font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
.crumb { font-size: 0.85rem; color: var(--mute); margin-bottom: 8px; }
.lead { font-size: 1.05rem; color: var(--ink2); max-width: 760px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.prose { max-width: 760px; }
.prose li { margin: 0.25rem 0; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; color: var(--accent-ink); background: var(--accent);
  border: 0; border-bottom: 3px solid #c99a1c; border-radius: 4px; padding: 10px 18px; cursor: pointer;
  transition: transform 0.06s, border-bottom-width 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.04); text-decoration: none; }
.btn:active { transform: translateY(2px); border-bottom-width: 1px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom: 3px solid #cfd4db; }

/* 히어로 = 진단 도구 */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hero h1 { font-size: 1.9rem; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.drop {
  display: block; border: 2px dashed #c3c9d2; border-radius: var(--r); padding: 22px 16px; text-align: center;
  background: #fafbfc; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: #c99a1c; background: #fffbea; }
.drop b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.drop input { display: none; }
.tool .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tool select { font: inherit; padding: 8px; border: 1px solid #7a8390; border-radius: 4px; max-width: 100%; }
.howto { font-size: 0.92rem; color: var(--ink2); margin-top: 12px; }
.howto ol { padding-left: 1.2rem; margin: 0.3rem 0; }
.shot { border-radius: var(--r); border: 1px solid var(--line); display: block; }
.shot-cap { font-size: 0.8rem; color: var(--mute); margin-top: 4px; }

/* 결과 */
.result { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--hud); border-radius: 4px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { font-size: 0.85rem; color: var(--mute); }
.bar { height: 6px; background: #e8ebef; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--ok); transition: width 0.4s ease; }

table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 0.95rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef0f3; font-size: 0.85rem; color: var(--ink2); font-weight: 600; white-space: nowrap; }
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafbfc; }
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.tw table { border: 0; }

.mon { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ico { width: 40px; height: 40px; overflow: hidden; display: inline-block; flex: none; }
.ico img { width: 40px; height: 40px; image-rendering: pixelated; }

.st { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.st-caught { background: #e3f3e8; color: var(--ok); }
.st-ready { background: #fff4d0; color: #8a6200; }
.st-away { background: #fdebd8; color: var(--warn); }
.st-locked { background: #eef0f3; color: var(--ink2); }
.lockline { color: var(--mute); filter: blur(3.5px); user-select: none; }

.t { display: inline-block; color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0 7px; border-radius: 3px; line-height: 1.7; white-space: nowrap; }
.t-NORMAL { background: #727160; } .t-FIGHTING { background: #c8402a; } .t-FLYING { background: #4c769e; }
.t-POISON { background: #a83a8c; } .t-GROUND { background: #8f6a2d; } .t-ROCK { background: #877342; }
.t-BUG { background: #667812; } .t-GHOST { background: #4a5462; } .t-STEEL { background: #6a7684; }
.t-FIRE { background: #cb4818; } .t-WATER { background: #2772d4; } .t-GRASS { background: #318327; }
.t-ELECTRIC { background: #d9a800; color: #2b2206; } .t-PSYCHIC { background: #c4326e; } .t-ICE { background: #2c7f91; }
.t-DRAGON { background: #2b6c8c; } .t-DARK { background: #4a3a38; } .t-FAIRY { background: #ae527d; } .t-QMARKS { background: #6b7381; }

/* 페이월 */
.wall { margin-top: 16px; border: 2px solid var(--accent); border-radius: var(--r); background: #fffdf3; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }
.wall h3 { margin-top: 0; }
.wall ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.buy { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.price { font-size: 1.9rem; font-weight: 800; }
.buy small { font-size: 0.8rem; }
.wall details { grid-column: 1 / -1; font-size: 0.9rem; }
.wall details input { font: inherit; padding: 7px; border: 1px solid var(--line); border-radius: 4px; margin: 4px 6px 4px 0; }
.wall details button { font: inherit; padding: 7px 12px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; }
.err { color: var(--bad); font-weight: 600; }
.passline { font-size: 0.9rem; color: var(--ok); font-weight: 600; }

/* 전설 카드 목록 */
.lg { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.lg:first-of-type { border-top: 0; }
.lg .pic { background: #eef0f3; border-radius: var(--r); width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.lg .pic img { width: 96px; height: 96px; image-rendering: pixelated; }
.lg h3 { margin: 0 0 4px; }
.lg .meta { font-size: 0.9rem; color: var(--ink2); margin-bottom: 6px; }
.lg ol { margin: 0.3rem 0; padding-left: 1.3rem; }
.lg .tip { font-size: 0.9rem; color: var(--ink2); background: #f6f7f9; border-left: 3px solid var(--accent); padding: 6px 10px; margin-top: 6px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.toc a { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px 2px 2px; font-size: 0.9rem; color: var(--ink); }
.toc a:hover { border-color: #c99a1c; text-decoration: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; color: var(--ink); transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: #c99a1c; text-decoration: none; transform: translateY(-1px); }
.card b { display: block; margin-bottom: 4px; }
.card span { font-size: 0.9rem; color: var(--ink2); }

.cta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--hud); color: #e9ecf1; border-radius: var(--r); padding: 14px 18px; margin: 20px 0; }
.cta p { margin: 0; }
.cta b { color: #fff; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.filters input, .filters select { font: inherit; padding: 7px 10px; border: 1px solid #7a8390; border-radius: 4px; background: #fff; }
.filters input { min-width: 220px; flex: 1; }

footer { background: var(--hud); color: #aab3c1; font-size: 0.85rem; }
footer .in { max-width: 1120px; margin: 0 auto; padding: 22px 16px; }
footer a { color: #e2e7ee; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr; }
  .ver { display: none; }
}
@media (max-width: 560px) {
  h1, .hero h1 { font-size: 1.45rem; }
  .top .in { gap: 10px; }
  .brand span small { display: none; }
  .lg { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .lg .pic { width: 72px; height: 72px; }
  .lg .pic img { width: 64px; height: 64px; }
  th, td { padding: 7px 8px; }
  .panel, .tool { padding: 14px; }
}

/* 보스 공략 파티 */
.ctrbox { margin-top: 28px; padding-top: 18px; border-top: 2px solid var(--hud); }
.ctrbox h3 { margin-top: 0; }
.ctrbox .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.ctrbox select { font: inherit; padding: 8px; border: 1px solid #7a8390; border-radius: 4px; max-width: 100%; background: #fff; }
.ctr h4 { margin: 14px 0 6px; font-size: 1rem; }
.ctr-head { margin: 0; }
.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.team li { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px 6px 6px; }
.team .mon { white-space: normal; align-items: flex-start; }
.ctr-note { font-size: 0.85rem; margin-top: 8px; }

/* 홈: 게임 정보, 바로가기, 자주 묻는 것 */
.howto summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.facts { margin-top: 12px; font-size: 0.9rem; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; border-collapse: separate; border-spacing: 0; }
.facts th { width: 84px; background: #f6f7f9; white-space: nowrap; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts tr:hover td { background: transparent; }
details.more { margin-top: 18px; }
details.more > summary { cursor: pointer; font-weight: 700; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
details.more[open] > summary { margin-bottom: 12px; }
.card.pic .sprites { display: flex; gap: 2px; margin: -4px 0 6px -4px; }
.card.pic .sprites img { width: 40px; height: 40px; image-rendering: pixelated; }
.faq h3 { font-size: 1.02rem; margin: 1.2rem 0 0.3rem; }
.faq code { background: #eef0f3; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
kbd { background: #eef0f3; border: 1px solid #d5d9e0; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font: inherit; font-size: 0.85em; }
.teamhead { margin: 12px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.teamhead .solve { font-size: 0.85rem; font-weight: 600; }
.hero > div { min-width: 0; }
.tool select, .ctrbox select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.team .lockrest { grid-column: 1 / -1; color: var(--mute); background: #f6f7f9; border-style: dashed; }
@media (max-width: 560px) {
  .ctr .tw { overflow: visible; border: 0; }
  .ctr table, .ctr tbody { display: block; background: transparent; }
  .ctr thead { display: none; }
  .ctr tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; margin-bottom: 8px; }
  .ctr td { display: block; border: 0; padding: 0; }
  .ctr td:last-child { grid-column: 1 / -1; }
  .ctr td[colspan] { grid-column: 2; }
  .ctr .mon { white-space: normal; }
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus-visible { outline: 3px solid #1f5fb8; outline-offset: 2px; }
.top :focus-visible, footer :focus-visible, .cta :focus-visible { outline-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.drop .trust { display: block; font-weight: 700; color: var(--ok); font-size: 0.9rem; margin-top: 4px; }
.wall .big { font-size: 1.05rem; font-weight: 600; }
.team .lockrest { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.team .lockrest .btn { padding: 6px 14px; }
.ctr .lbl { display: none; }
.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (hover: none) { .only-wide { display: none !important; } }
@media (max-width: 560px) {
  .top .in { flex-wrap: wrap; padding-top: 8px; }
  .nav { flex: 1 1 100%; flex-wrap: wrap; overflow: visible; }
  .nav a { padding: 6px 8px; font-size: 0.88rem; border-bottom-width: 2px; }
  .tool .row .btn { width: 100%; }
  .ctr .lbl { display: inline; color: var(--mute); }
  .ctr td[colspan] { grid-column: 2; }
}
