/* 탭삼국지 공개 페이지 공통 스타일 (index / faq / support)
   색은 게임의 적벽 화공 스테이지(밤하늘·불길·그을린 땅)와 앱 아이콘의 진홍에서 가져왔다 */
:root {
  --night: #17134a;      /* 적벽 밤하늘 */
  --ember: #5e1a33;      /* 불빛이 번진 하늘 아래쪽 */
  --bg: #2a150e;         /* 그을린 땅: 본문 바탕 */
  --bg2: #331a11;
  --panel: #3b2014;
  --panel2: #4a2a1a;
  --line: #5a3524;
  --text: #fff4df;       /* 한지 */
  --muted: #d4b896;
  --gold: #ffc83d;       /* 불길 · 대미지 숫자 */
  --gold2: #e89a1c;
  --red: #c4161f;        /* 아이콘 진홍 · 퇴각 버튼 */
  --green: #3fa45b;      /* 관우 두건 */
  --blue: #8fb3ff;
  --radius: 14px;
  --display: "Black Han Sans", "Apple SD Gothic Neo", sans-serif;
  --serif: var(--display);
  --sans: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h3 { font-family: var(--sans); font-weight: 700; line-height: 1.35; margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* 상단 바 */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(23, 19, 74, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 200, 61, .18);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 21px; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: #cfc8f2; padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav-links a:hover, .nav-links a.on { color: var(--gold); background: rgba(255, 200, 61, .1); text-decoration: none; }
@media (max-width: 560px) {
  .nav-links a.hide-sm { display: none; }
  .brand { font-size: 17px; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .nav-links a { padding: 6px 7px; font-size: 13px; }
}

/* 버튼: 게임 버튼처럼 아래 테두리가 두꺼워 눌리는 느낌 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px 10px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: 0; border-bottom: 4px solid rgba(0, 0, 0, .35); cursor: pointer;
  transition: transform .08s, border-bottom-width .08s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(3px); border-bottom-width: 1px; }
.btn-gold { background: var(--gold); color: #3a1c00; border-bottom-color: #b86e0a; }
.btn-gold:hover { background: #ffd35f; }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .1); border-bottom-color: rgba(0, 0, 0, .4); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-dim { color: #b7aed8; background: rgba(255, 255, 255, .05); border-bottom-color: transparent; cursor: default; }
.btn-dim:active { transform: none; border-bottom-width: 4px; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }

/* 카드 · 표 · 접이식 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 320px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel2); color: var(--gold); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 200, 61, .16); color: var(--gold); margin-left: 6px; vertical-align: middle; }
.tag.red { background: rgba(196, 22, 31, .25); color: #ff9196; }
.tag.green { background: rgba(63, 164, 91, .22); color: #8fe3a6; }
.note { border-left: 3px solid var(--gold2); background: rgba(255, 200, 61, .08); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0; color: var(--text); }
.note.warn { border-color: var(--red); background: rgba(196, 22, 31, .14); }
kbd, code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 6px; }

/* 푸터 */
footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer nav a { color: var(--muted); }
footer nav a:hover { color: var(--gold); }

/* 언어 선택 */
.lang { background: var(--night); }
.lang { margin: 0; padding: 4px max(16px, calc((100% - 1048px) / 2)); text-align: right; font-size: 12px; color: #8f87c4; }
.lang a { color: #b7aed8; }
.lang a[aria-current] { color: var(--gold); }
:lang(ja) { --display: "Dela Gothic One", "Hiragino Sans", sans-serif; --sans: "Noto Sans JP", -apple-system, "Hiragino Sans", sans-serif; }
:lang(zh-Hans) { --display: "Noto Sans SC", "PingFang SC", sans-serif; --sans: "Noto Sans SC", -apple-system, "PingFang SC", sans-serif; }
:lang(zh-Hant) { --display: "Noto Sans TC", "PingFang TC", sans-serif; --sans: "Noto Sans TC", -apple-system, "PingFang TC", sans-serif; }
:lang(en) { --sans: -apple-system, "Segoe UI", Roboto, sans-serif; }
:lang(th) { --display: "Kanit", "Noto Sans Thai", sans-serif; --sans: "Noto Sans Thai", -apple-system, "Thonburi", "Leelawadee UI", Tahoma, sans-serif; }
:lang(zh-Hans) h1, :lang(zh-Hans) h2, :lang(zh-Hant) h1, :lang(zh-Hant) h2 { font-weight: 900; }
:lang(th) h1, :lang(th) h2 { font-weight: 700; }

/* 그리드 칸의 기본 최소 폭(auto)은 안의 넓은 표만큼 칸을 늘려 모바일에서 페이지가 옆으로 넘친다.
   표는 .table-wrap 이 가로 스크롤하므로 칸은 화면 폭을 넘지 않게 한다 */
.layout > * { min-width: 0; }

/* ───────── 홈 ───────── */

/* 히어로: 적벽 밤하늘 위 제목, 아래 불타는 숲 앞을 관우가 달린다. 전장을 탭하면 게임처럼 대미지가 뜬다 */
.hero { position: relative; overflow: hidden; background: #0f0e47; isolation: isolate; }
.scene { position: absolute; inset: 0; z-index: -1; }
/* 그림 위쪽 하늘색(#0f0e47)이 히어로 바탕과 이어지고, 불길은 탭 영역 뒤에만 온다 */
.sky {
  position: absolute; left: 0; right: 0; bottom: 0; height: 500px;
  background: url(/img/home/redcliff.jpg) 0 0 / 1440px 500px repeat-x;
  animation: drift 80s linear infinite;
  -webkit-mask-image: linear-gradient(transparent, #000 120px); mask-image: linear-gradient(transparent, #000 120px);
}
.scene::before {
  content: ""; position: absolute; z-index: 1; right: 16%; top: 96px; width: 40px; height: 60px; border-radius: 50%;
  background: #fbf3d2; box-shadow: 0 0 36px 14px rgba(255, 245, 210, .22), 0 0 120px 60px rgba(150, 140, 255, .1);
}
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: url(/img/home/ground.png) 0 0 / auto 64px repeat-x, #120c1c;
  animation: run 2.2s linear infinite;
}
.rider {
  position: absolute; bottom: 44px; left: max(16px, calc(50% - 300px));
  width: 220px; height: 180px;
  background: url(/img/home/guanyu.webp) 0 0 / 2640px 180px no-repeat;
  animation: gallop .6s steps(12) infinite;
  transform-origin: 50% 100%;
}
.rider.hit { animation: gallop .6s steps(12) infinite, lunge .18s ease-out; }
@keyframes drift { to { background-position-x: -1440px; } }
@keyframes run { to { background-position-x: -1024px; } }
@keyframes gallop { to { background-position-x: -2640px; } }
@keyframes lunge { 40% { translate: 18px 0; } }

.hero .wrap { position: relative; padding: 40px 16px 0; }
.hero-copy { max-width: 560px; }
.hero h1 { font-size: clamp(40px, 7vw, 68px); color: var(--text); text-shadow: 0 3px 0 #3a0d1c, 0 0 28px rgba(0, 0, 0, .5); }
.hero h1 small { display: block; font-size: .46em; color: var(--gold); margin-top: 4px; }
.hero h1 .logo { width: min(380px, 80vw); height: auto; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .45)); }
.hero h1 .logo + span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tagline { font-size: clamp(18px, 2.6vw, 22px); font-weight: 700; color: var(--text); margin: 14px 0 6px; }
.lead { color: #d9d1f5; margin: 0 0 24px; font-size: 15px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.stores { margin-top: 12px; font-size: 13px; color: #d9d1f5; text-shadow: 0 1px 2px #1a0a20, 0 0 8px #1a0a20; }

/* 탭 영역: 히어로 아래쪽 전장 띠 전체 */
.tapzone {
  position: relative; display: block; width: 100%; height: 270px; margin-top: 0;
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tapzone:focus-visible { outline-offset: -6px; }
.hud {
  position: absolute; right: 0; top: 18px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 26px; color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}
.hud img { width: 30px; height: 30px; }
.hint {
  position: absolute; right: 0; top: 58px; font-size: 13px; color: var(--text);
  background: rgba(23, 19, 74, .55); padding: 3px 10px; border-radius: 999px;
}
.tapzone.used .hint { opacity: 0; transition: opacity .4s; }
.dmg {
  position: absolute; pointer-events: none; white-space: nowrap;
  font-family: "Black Han Sans", var(--display); font-size: 34px; color: #fff;
  --o: #5c1000;
  text-shadow: 2px 0 var(--o), -2px 0 var(--o), 0 2px var(--o), 0 -2px var(--o), 2px 2px var(--o), -2px 2px var(--o), 2px -2px var(--o), -2px -2px var(--o), 0 5px 0 rgba(0, 0, 0, .4);
  translate: -50% -50%;
  animation: rise .9s ease-out forwards;
}
.dmg.crit { font-size: 48px; color: var(--gold); --o: #3d0000; }
.slash { position: absolute; width: 150px; pointer-events: none; translate: -50% -50%; animation: slash .22s ease-out forwards; }
@keyframes rise { 0% { transform: scale(.6); opacity: 0; } 12% { transform: scale(1.2); opacity: 1; } 25% { transform: scale(1); } 65% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes slash { from { transform: scale(.5) rotate(var(--r, 0deg)); opacity: 1; } to { transform: scale(1.2) rotate(var(--r, 0deg)); opacity: 0; } }
@media (max-width: 600px) {
  .tapzone { height: 250px; }
  .sky { height: 420px; background-size: 1210px 420px; }
  @keyframes drift { to { background-position-x: -1210px; } }
  .scene::before { top: 70px; right: 10%; width: 30px; height: 46px; }
  .rider { width: 165px; height: 135px; background-size: 1980px 135px; left: 4px; bottom: 46px; }
  @keyframes gallop { to { background-position-x: -1980px; } }
}
@media (prefers-reduced-motion: reduce) {
  .sky, .ground, .rider { animation: none; }
  .dmg { animation-duration: .01s; }
}

/* 게임 화면의 DPS 줄처럼: 큰 흰 숫자 + 작은 이름, 아래 무지개 게이지 */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding: 26px 0 18px; text-align: center; position: relative;
}
.stats::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #d8283a, #f08a24, #f6d23a, #5cc14f, #2f9be0, #8a4fd6);
}
.stat b { display: block; font-family: "Black Han Sans", var(--display); font-weight: 400; font-size: clamp(26px, 4vw, 36px); line-height: 1.1; color: #fff; }
.stat span { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } }

/* 섹션 */
section.block { padding: 80px 0 0; }
.sec-head { margin-bottom: 32px; max-width: 640px; }
.sec-head h2 { font-size: clamp(28px, 4.4vw, 42px); color: var(--text); }
.sec-head p { color: var(--muted); margin: 10px 0 0; }

/* 콘텐츠: 게임 속 아이콘 + 설명. 상자 없이 두 줄로 */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 48px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; gap: 32px; } }
.feature { display: grid; grid-template-columns: 72px 1fr; column-gap: 18px; align-items: start; }
.feature .glyph {
  grid-row: span 3; width: 72px; height: 72px; object-fit: contain; padding: 6px;
  border-radius: 18px; background: radial-gradient(circle at 50% 35%, #5a2f1b, #2a150e 75%);
  box-shadow: inset 0 0 0 2px rgba(255, 200, 61, .35);
}
.feature h3 { font-size: 20px; margin: 2px 0 6px; }
.feature p { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.feature a { font-size: 14px; font-weight: 700; }

/* 스크린샷 */
.shots { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.shot { flex: 0 0 210px; margin: 0; scroll-snap-align: start; }
.shot img { width: 210px; aspect-ratio: 1080 / 1920; object-fit: cover; border-radius: 22px; border: 5px solid #120c1c; box-shadow: 0 0 0 1px var(--line), 0 14px 30px rgba(0, 0, 0, .45); }
.shot figcaption { color: var(--muted); font-size: 13px; margin-top: 10px; }
.shot figcaption b { color: var(--text); display: block; font-size: 15px; }

/* 시작 가이드: 게임 상단의 스테이지 숫자처럼 순서를 보여준다 */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; position: relative; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; gap: 22px; } }
.step { border-top: 3px solid var(--line); padding-top: 14px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: block; font-family: "Black Han Sans", var(--display); font-size: 44px; line-height: 1; color: var(--gold); margin-bottom: 10px;
}
.step:first-child { border-top-color: var(--gold); }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

/* 매뉴얼 · 계정 */
.two { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.banner {
  background: var(--red);
  border: 0; border-bottom: 5px solid #7d0b12; color: #fff;
}
.banner h3 { font-family: var(--display); font-weight: 400; font-size: 26px; margin-bottom: 8px; }
.banner p { color: #ffe1dc; margin: 0 0 16px; max-width: 30em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 30em; }
.chips a { font-size: 13px; padding: 6px 12px; border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .22); }
.chips a:hover { background: rgba(0, 0, 0, .36); text-decoration: none; }
.providers { display: flex; flex-wrap: wrap; gap: 8px; }
.providers span { padding: 6px 12px; border-radius: 10px; background: var(--panel2); font-size: 13px; }

/* 리더보드 (홈 #rank): 분야 탭 + 표. 값은 home.js 가 /api/leaderboard 로 채운다 */
.rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rank-tabs button { font: inherit; font-size: 14px; color: var(--muted); background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.rank-tabs button:hover { color: var(--text); border-color: var(--gold2); }
.rank-tabs button.on { color: #1a0d08; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.rank-card { padding: 8px 12px; }
.rank-table th, .rank-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.rank-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table .rank-no { width: 64px; text-align: center; }
.rank-table .rank-val { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table td.rank-no { font-weight: 800; font-size: 16px; }
.rank-table tr.top1 td.rank-no { color: #ffd700; }
.rank-table tr.top2 td.rank-no { color: #c0c0c0; }
.rank-table tr.top3 td.rank-no { color: #cd7f32; }
.rank-table .rank-msg { text-align: center; color: var(--muted); padding: 22px 8px; }

/* 고객센터 문의 양식 (support.html, 모든 언어) */
.inquiry { display: grid; gap: 12px; margin: 8px 0 28px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.inquiry .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .inquiry .row { grid-template-columns: 1fr; } }
.inquiry label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.inquiry input, .inquiry select, .inquiry textarea { font: inherit; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; width: 100%; }
.inquiry input:focus-visible, .inquiry select:focus-visible, .inquiry textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.inquiry textarea { resize: vertical; min-height: 140px; }
.inquiry .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.inquiry .actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.inquiry-msg { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.inquiry-msg.ok { color: #8fe3a2; }
.inquiry-msg.err { color: #ff9b8f; }

/* 고객센터: 안내·FAQ 아래에 접힌 문의 양식 */
.contact { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.inquiry-box summary { list-style: none; display: inline-flex; cursor: pointer; user-select: none; }
.inquiry-box summary::-webkit-details-marker { display: none; }
.inquiry-box summary::after { content: " ▾"; margin-left: 6px; }
.inquiry-box[open] summary::after { content: " ▴"; }
.inquiry-box[open] summary { margin-bottom: 12px; }
.inquiry-box .inquiry { margin-top: 0; }

/* 일기토: 관우 對 적장 기마 원화 + 적장 화랑 띠 */
.duel-show { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; border-radius: var(--radius); overflow: hidden; padding: 28px 12px 0;
  background: radial-gradient(circle at 50% 40%, rgba(214, 40, 30, .6), rgba(0, 0, 0, 0) 45%), linear-gradient(to bottom, var(--night), #0d0710 92%);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 61, .25); }
.duel-show img { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .6)); }
.duel-show .vs { font-family: var(--display); font-size: clamp(34px, 7vw, 72px); color: #ffe3a6; text-shadow: 0 0 22px rgba(255, 110, 50, .9); align-self: center; padding: 0 2px; }
.duel-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; margin-top: 28px; }
@media (max-width: 760px) { .duel-body { grid-template-columns: 1fr; gap: 20px; } }
.duel-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.duel-body li { padding: 10px 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.duel-body li b { color: var(--gold); margin-right: 6px; }
.duel-body p { color: var(--muted); margin: 0 0 14px; }
.duel-gal { display: flex; gap: 10px; overflow-x: auto; padding: 18px 2px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.duel-gal a { flex: 0 0 180px; scroll-snap-align: start; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, rgba(255, 200, 61, .18), rgba(0, 0, 0, 0) 70%), var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); text-align: center; font-weight: 700; font-size: 14px; padding-bottom: 6px; }
.duel-gal img { width: 100%; height: auto; display: block; }
