/* 세누리따 캐릭터 페이지 — 게임 UI(하늘색 유리·흰 카드)를 현대적으로 옮긴 라이트 럭셔리 톤 */
:root {
  --bg: oklch(97% 0.012 240);
  --bg-2: oklch(94% 0.02 240);
  --surface: oklch(100% 0 0 / 0.78);
  --surface-strong: oklch(100% 0 0 / 0.94);
  --ink: oklch(24% 0.03 260);
  --ink-2: oklch(45% 0.03 260);
  --ink-3: oklch(62% 0.02 260);
  --line: oklch(88% 0.015 250);
  --accent: oklch(58% 0.16 255);        /* 게임 UI 블루 */
  --gold: oklch(72% 0.14 85);           /* 훈장·전투력 */
  --gold-deep: oklch(58% 0.14 80);
  --violet: oklch(60% 0.16 300);        /* 깃털 */
  --atk: oklch(62% 0.18 30);
  --def: oklch(60% 0.14 240);
  --shadow: 0 10px 30px oklch(40% 0.05 250 / 0.12), 0 1px 0 oklch(100% 0 0 / 0.6) inset;
  --radius-lg: 22px; --radius: 14px; --radius-sm: 8px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --display: "Cinzel", serif;
  --text: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --dur: 220ms; --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(18% 0.02 255); --bg-2: oklch(22% 0.025 255);
    --surface: oklch(26% 0.02 255 / 0.7); --surface-strong: oklch(28% 0.02 255 / 0.92);
    --ink: oklch(94% 0.01 250); --ink-2: oklch(76% 0.02 250); --ink-3: oklch(62% 0.02 250);
    --line: oklch(34% 0.02 255); --accent: oklch(74% 0.13 250); --gold: oklch(80% 0.13 88);
    --gold-deep: oklch(72% 0.14 84); --violet: oklch(74% 0.14 300);
    --shadow: 0 12px 34px oklch(5% 0.02 255 / 0.5), 0 1px 0 oklch(100% 0 0 / 0.06) inset;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; font-family: var(--font); font-size: var(--text); line-height: 1.55; color: var(--ink);
  background: radial-gradient(1200px 700px at 15% -10%, oklch(92% 0.06 250 / 0.9), transparent 60%),
              radial-gradient(900px 600px at 100% 10%, oklch(93% 0.05 85 / 0.7), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100dvh; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* 상단바 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px); backdrop-filter: blur(14px) saturate(1.2);
  background: oklch(100% 0 0 / 0.55); border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: oklch(18% 0.02 255 / 0.6); } }
.brand { font-weight: 800; text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { font-size: 1.2em; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--ink-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.topbar nav a:hover, .topbar nav a:focus-visible { background: oklch(100% 0 0 / 0.7); color: var(--ink); outline: none; }
.topbar nav a.active { background: var(--accent); color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 80px; }

/* 히어로 — 그리드 깨는 편집 레이아웃 */
.hero { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 6vw, 72px); }
.hero-visual { position: relative; }
.hero-visual img { border-radius: var(--radius-lg); box-shadow: var(--shadow); cursor: zoom-in; transform: rotate(-1.5deg); transition: transform var(--dur) var(--ease); }
.hero-visual img:hover { transform: rotate(0) scale(1.01); }
.hero-open { position: absolute; left: 14px; bottom: 14px; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 0.85rem;
  background: oklch(100% 0 0 / 0.9); color: var(--ink); box-shadow: 0 4px 14px oklch(0% 0 0 / 0.15); cursor: pointer; }
.hero-open:hover { background: var(--accent); color: #fff; }
.eyebrow { margin: 0 0 6px; font-family: var(--display); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); font-size: 0.8rem; }
h1 { margin: 0; font-size: clamp(2.6rem, 2rem + 3vw, 4.4rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 900; }
.lede { margin: 12px 0 22px; color: var(--ink-2); font-size: 1.05rem; max-width: 46ch; }
.headline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.headline div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.headline dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.headline dd { margin: 2px 0 0; font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.equip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px 0 0; }
.equip-list li { font-size: 0.8rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: oklch(100% 0 0 / 0.6); border: 1px solid var(--line); }
.equip-list b { color: var(--gold-deep); font-family: var(--display); }

/* 섹션 공통 */
.block { padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; margin-bottom: 20px; }
.block-head h2 { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); letter-spacing: -0.02em; }
.block-head p { margin: 0; color: var(--ink-2); flex: 1 1 320px; }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; color: #fff; vertical-align: 1px; }
.chip-atk { background: var(--atk); } .chip-def { background: var(--def); }

/* 스탯 표 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.stat-card header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(90deg, oklch(90% 0.06 250 / 0.7), transparent); border-bottom: 1px solid var(--line); }
.stat-card header h3 { margin: 0; font-size: 1.05rem; }
.stat-card header button { font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--accent); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.stat-card header button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td:last-child, .tbl th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:nth-child(even) { background: oklch(100% 0 0 / 0.35); }
.stat-card .tbl td:last-child { font-weight: 700; }
.stat-card .tbl td:first-child { color: var(--ink-2); }

/* 깃털 카드 */
.seg { display: inline-flex; background: oklch(100% 0 0 / 0.55); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: 0 0 auto; }
.seg button { font: inherit; font-size: 0.85rem; font-weight: 700; border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; color: var(--ink-2); cursor: pointer; }
.seg button b { font-weight: 600; opacity: 0.7; margin-left: 4px; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.feather-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.fcard { background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.fcard:hover { transform: translateY(-3px); }
.fcard[hidden] { display: none; }
.fcard-media { position: relative; aspect-ratio: 1000 / 840; overflow: hidden; background: oklch(96% 0.01 250); cursor: zoom-in; }
.fcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.fcard:hover .fcard-media img { transform: scale(1.03); }
.fcard-power { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 999px; background: oklch(20% 0.03 260 / 0.75); color: #fff; backdrop-filter: blur(6px); font-size: 0.7rem; font-weight: 700; }
.fcard-power b { font-family: var(--display); font-size: 1rem; color: var(--gold); }
.fcard-type { position: absolute; top: 10px; right: 10px; }
.fcard-body { padding: 12px 14px 14px; }
.fcard-body h3 { margin: 0; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fcard-grade { margin: 2px 0 8px; font-size: 0.78rem; color: var(--ink-3); }
.feather-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.feather-list li { font-size: 0.72rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: oklch(100% 0 0 / 0.6); border: 1px solid var(--line); }
.feather-list li[data-k="공"] { border-color: oklch(from var(--atk) l c h / 0.4); color: var(--atk); }
.feather-list li[data-k="방"] { border-color: oklch(from var(--def) l c h / 0.45); color: var(--def); }
.feather-list li[data-k="혼"] { border-color: oklch(from var(--violet) l c h / 0.45); color: var(--violet); }
.fcard details { margin-top: 10px; }
.fcard summary { cursor: pointer; font-size: 0.82rem; font-weight: 700; color: var(--accent); list-style: none; }
.fcard summary::before { content: "▸ "; } .fcard details[open] summary::before { content: "▾ "; }
.fcard h4 { margin: 10px 0 4px; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mini { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.mini td { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.mini td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-deep); }
.set-list { margin: 0; padding-left: 16px; font-size: 0.82rem; color: var(--ink-2); }

/* 훈장 */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.medal { background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: center; box-shadow: var(--shadow); cursor: zoom-in; }
.medal img { width: 100%; aspect-ratio: 240 / 371; object-fit: cover; }
.medal figcaption { padding: 8px 6px 10px; font-size: 0.82rem; font-weight: 700; }
.medal figcaption b { display: block; font-family: var(--display); color: var(--gold-deep); font-size: 0.95rem; }
.medal.max { outline: 2px solid oklch(from var(--gold) l c h / 0.55); outline-offset: -2px; }
.medal-table { max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.medal-table thead th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.pill-max { background: oklch(from var(--gold) l c h / 0.2); color: var(--gold-deep); }
.pill-grow { background: oklch(from var(--accent) l c h / 0.15); color: var(--accent); }

/* 카드 */
.card-group { margin-bottom: 24px; }
.card-group h3 { margin: 0 0 4px; font-size: 1.1rem; }
.card-group p { margin: 0 0 10px; color: var(--ink-2); font-size: 0.9rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.shot { margin: 0; background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in; }
.shot img { width: 100%; height: auto; }
.shot figcaption { padding: 8px 12px; font-size: 0.8rem; color: var(--ink-2); }

.foot { text-align: center; color: var(--ink-3); font-size: 0.85rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }

/* 확대 가능 표시 */
.zoom-badge { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px;
  background: oklch(20% 0.03 260 / 0.7); color: #fff; font-size: 0.95rem; backdrop-filter: blur(6px); pointer-events: none; opacity: 0.85; transition: opacity var(--dur), transform var(--dur) var(--ease); }
.medal, .shot { position: relative; }
.medal .zoom-badge { width: 28px; height: 28px; font-size: 0.8rem; right: 8px; bottom: 44px; }
.fcard-media .zoom-badge { bottom: 10px; }
.fcard:hover .zoom-badge, .medal:hover .zoom-badge, .shot:hover .zoom-badge { opacity: 1; transform: scale(1.08); }
[role="button"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 라이트박스 */
.lightbox { position: fixed; inset: 0; z-index: 50; background: oklch(10% 0.02 255 / 0.86); display: grid; place-items: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; width: min(96vw, 1400px); max-height: 94dvh; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lb-stage { display: grid; place-items: center; width: 100%; max-height: 82dvh; overflow: visible; }
.lightbox img { max-width: 100%; max-height: 82dvh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 20px 60px oklch(0% 0 0 / 0.5);
  touch-action: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; transform-origin: center; will-change: transform; cursor: zoom-in; }
.lightbox.zoomed img { cursor: grab; border-radius: 4px; }
.lightbox figcaption { color: #fff; font-size: 0.9rem; opacity: 0.9; text-align: center; }
.lb-hint { margin: 0; color: #fff; opacity: 0.55; font-size: 0.72rem; display: none; }
@media (hover: none) and (pointer: coarse) { .lb-hint { display: block; } }
.lb-zoom { position: fixed; top: 14px; right: 66px; border: 0; background: oklch(100% 0 0 / 0.14); color: #fff; font-size: 1.3rem; line-height: 1; width: 44px; height: 44px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); }
.lb-zoom:hover { background: oklch(100% 0 0 / 0.3); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-close, .lb-prev, .lb-next { position: fixed; border: 0; background: oklch(100% 0 0 / 0.14); color: #fff; font-size: 1.6rem; line-height: 1; width: 44px; height: 44px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); }
.lb-close { top: 14px; right: 14px; } .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); } .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: oklch(100% 0 0 / 0.3); }

/* 반응형 */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; gap: 22px; }
  .hero-visual { max-width: 380px; margin: 0 auto; width: 100%; }
  .hero-visual img { transform: none; }
  .hero-open { left: 12px; bottom: 12px; padding: 10px 14px; font-size: 0.9rem; min-height: 44px; }
  .headline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar nav { gap: 2px; }
  .topbar nav a { padding: 9px 10px; font-size: 0.9rem; min-height: 40px; display: inline-flex; align-items: center; }
  .block { scroll-margin-top: 62px; }
  .block-head p { flex-basis: 100%; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 10px 6px; min-height: 44px; }
  .stat-card header button { padding: 8px 12px; min-height: 40px; font-size: 0.85rem; }
  .tbl th, .tbl td { padding: 9px 12px; }
  .feather-grid { grid-template-columns: 1fr; gap: 14px; }
  .fcard-media { aspect-ratio: 1000 / 780; }
  .fcard summary { padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
  .medal-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .medal figcaption { font-size: 0.9rem; }
  .shots { grid-template-columns: 1fr; }
  .zoom-badge { opacity: 0.95; width: 40px; height: 40px; font-size: 1.05rem; }
  .medal .zoom-badge { width: 32px; height: 32px; bottom: 50px; }
  /* 라이트박스: 하단 조작 바 */
  .lightbox { padding: 8px; align-content: center; }
  .lightbox figure { width: 100%; }
  .lb-stage, .lightbox img { max-height: 76dvh; }
  .lb-close { top: 10px; right: 10px; width: 48px; height: 48px; }
  .lb-zoom { top: 10px; right: 64px; width: 48px; height: 48px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; width: 56px; height: 48px; border-radius: 14px; font-size: 1.8rem; }
  .lb-prev { left: 14px; } .lb-next { right: 14px; }
  .lightbox figcaption { padding: 0 76px; font-size: 0.85rem; }
}
@media (max-width: 420px) { .medal-grid { grid-template-columns: repeat(2, 1fr); } .fcard-media { aspect-ratio: 1000 / 720; } }
@media (max-width: 380px) { .headline { grid-template-columns: 1fr 1fr; } .brand { font-size: 0.95rem; } }
