/* FORSAKEN 세계관 사이트 v1 — KPL 단말 팔레트 + 세력색 */
:root {
  --bg: #0b0c10; --panel: #121419; --panel2: #171a21; --line: #2a2f3a; --line2: rgba(102,252,241,0.14);
  --txt: #c5c6c7; --dim: #7d8390; --white: #f1f2f4; --cyan: #66fcf1; --gold: #c5a059; --red: #ff4d4d;
  --crow: #d0553c; --deepecho: #e0905a; --rootweaver: #9fcf7a; --wild: #e5d9a6; --upc: #a9b8d6;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, "Segoe UI", sans-serif;
  --max: 1160px; --gutter: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font-family: var(--sans); line-height: 1.65; font-size: 15px; overflow-x: hidden; }
body.gated { overflow: hidden; }
a { color: var(--cyan); text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
h1, h2, h3 { color: var(--white); line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 입장: 방폭문 + 19세 확인 ── */
#gate { position: fixed; inset: 0; z-index: 1000; background: #050608; overflow: hidden; }
#gate .door { position: fixed; top: 0; height: 100vh; background-repeat: no-repeat; transition: transform 1.5s cubic-bezier(.7,0,.25,1); will-change: transform; }
#gate .door.l { left: 0; }
#gate .door.r { right: 0; }
#gate[hidden] { display: none; }
#gate .wheel { position: fixed; z-index: 2; visibility: hidden; transition: transform 1.15s cubic-bezier(.55,0,.35,1), opacity .3s; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.7)); pointer-events: none; }
#gate .seam { position: fixed; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; z-index: 1; background: linear-gradient(180deg, transparent, rgba(102,252,241,0.55), transparent); opacity: 0.35; transition: opacity .6s, box-shadow .6s; pointer-events: none; }
#gate .gpanel { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; width: min(560px, calc(100vw - 32px)); background: rgba(8,9,12,0.86); border: 1px solid rgba(102,252,241,0.28); border-radius: 14px; padding: 18px 20px 16px; backdrop-filter: blur(6px); text-align: center; transition: opacity .35s, transform .35s; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
#gate .gk { font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em; color: var(--cyan); }
#gate h1 { font-size: 30px; letter-spacing: 0.12em; font-weight: 900; margin: 4px 0 6px; }
#gate p { margin: 0 0 14px; font-size: 13.5px; color: #cfd3da; }
#gate .gbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#gate .btn { min-height: 44px; }
#gate .gmsg { margin: 10px 0 0; font-size: 12.5px; color: var(--gold); min-height: 0; }
#gate .gmsg:empty { display: none; }
#gate.unlock .wheel { transform: rotate(-540deg); }
#gate.unlock .seam { opacity: 1; box-shadow: 0 0 22px 6px rgba(102,252,241,0.55); }
#gate.unlock .gpanel { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
#gate.open .wheel { opacity: 0; }
#gate.open .door.l { transform: translateX(-102%); }
#gate.open .door.r { transform: translateX(102%); }
#gate.open .seam { display: none; }
#gate.open { background: transparent; }
#gate.gone { opacity: 0; transition: opacity .4s; pointer-events: none; }

/* ── 문이 열리면: 회복된 지구 그림 → 흐려지며 사이트 ── */
#reveal { position: fixed; inset: 0; z-index: 995; background: #0b0c10 center 30% / cover no-repeat; opacity: 1; transition: opacity .8s ease; pointer-events: none; }
#reveal[hidden] { display: none; }
#reveal.fade { opacity: 0; }

/* ── 문 뒤: 프롤로그 ── */
#intro { position: fixed; inset: 0; z-index: 1100; background: radial-gradient(ellipse at 50% 28%, #111926, #050608 72%); overflow-y: auto; display: flex; justify-content: center; padding: 22px 16px 40px; transition: opacity .45s; }
#intro[hidden] { display: none; }
#intro.out { opacity: 0; pointer-events: none; }
#intro .intro-in { width: 100%; max-width: 660px; margin: auto; text-align: center; }
#intro .ik { font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; color: var(--cyan); margin-bottom: 6px; }
#introBox > div { max-width: min(640px, calc(100vh - 190px)) !important; }
#intro .intro-btns { margin-top: 12px; display: flex; justify-content: center; gap: 8px; }
#intro .intro-btns .btn { min-height: 44px; min-width: 160px; }
#intro .intro-tip { font-size: 12px; color: var(--dim); margin: 8px 0 0; }

/* ── 배경 회로 ── */
#circuit { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.55; }
main, footer { position: relative; z-index: 1; }

/* ── 상단 바 · 티커 ── */
.top { position: sticky; top: 0; z-index: 50; background: rgba(11,12,16,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.brand .mark { width: 10px; height: 10px; border: 2px solid var(--cyan); transform: rotate(45deg); box-shadow: 0 0 8px rgba(102,252,241,0.6); }
.brand small { font-family: var(--mono); font-size: 11px; color: var(--cyan); letter-spacing: 0.2em; font-weight: 600; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--dim); font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--cyan); background: rgba(102,252,241,0.07); }
.ticker { border-bottom: 1px solid var(--line); background: #07080b; overflow: hidden; height: 30px; display: flex; align-items: center; }
.ticker .lane { display: flex; gap: 48px; padding-right: 48px; white-space: nowrap; width: max-content; animation: tk 110s linear infinite; font-family: var(--mono); font-size: 11.5px; color: var(--dim); letter-spacing: 0.04em; }
.ticker:hover .lane, .ticker:active .lane { animation-play-state: paused; }
.ticker .lane span i { font-style: normal; color: #4a505b; margin-right: 8px; }
.ticker .lane span b { font-weight: 700; margin-right: 8px; letter-spacing: 0.12em; }
.ticker .lane .lv-info b { color: var(--cyan); }
.ticker .lane .lv-warn b { color: var(--gold); }
.ticker .lane .lv-alert, .ticker .lane .lv-err { color: #c9cbd0; }
.ticker .lane .lv-alert b, .ticker .lane .lv-err b { color: var(--red); animation: tkblink 1.1s step-end infinite; text-shadow: 0 0 8px rgba(255,77,77,0.6); }
@keyframes tkblink { 50% { opacity: 0.25; } }
@keyframes tk { to { transform: translateX(-50%); } }

/* ── 히어로 ── */
.hero { position: relative; min-height: 86vh; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .bg { position: absolute; inset: 0; background: #0b0c10 center 30% / cover no-repeat; filter: saturate(0.92) brightness(0.62); transform: scale(1.03); }
.hero.ready .bg { background-image: url("https://gzbw.uk/cdn-cgi/image/format=auto,quality=82,width=1920/AFOR/SITE/S04.png"); }
@media (max-aspect-ratio: 4/5) { .hero.ready .bg { background-image: url("https://gzbw.uk/cdn-cgi/image/format=auto,quality=82,width=1080/AFOR/SITE/S05.png"); background-position: center 20%; } }
.hero .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,12,16,0.5) 0%, rgba(11,12,16,0.05) 35%, rgba(11,12,16,0.85) 78%, var(--bg) 100%); }
.hero .scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0, rgba(0,0,0,0.12) 1px, transparent 1px, transparent 4px); pointer-events: none; opacity: 0.5; }
.hero .wrap { position: relative; padding-top: 90px; padding-bottom: 44px; width: 100%; }
.hero h1:focus { outline: none; }
.hero .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.28em; color: var(--cyan); text-shadow: 0 0 10px rgba(102,252,241,0.5); }
.hero h1 { font-size: clamp(52px, 11vw, 120px); letter-spacing: 0.05em; line-height: 0.95; margin-top: 10px; font-weight: 900; text-shadow: 0 4px 30px rgba(0,0,0,0.6); }
.hero .sub { font-size: clamp(18px, 3vw, 28px); color: var(--white); font-weight: 600; margin-top: 10px; }
.hero .lead { max-width: 600px; color: #e4e7ec; margin-top: 16px; font-size: 15.5px; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--white); font-weight: 700; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--cyan); color: #0b0c10; border-color: var(--cyan); box-shadow: 0 0 18px rgba(102,252,241,0.35); }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.live { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 34px; }
.live .cell { background: rgba(11,12,16,0.72); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; backdrop-filter: blur(6px); }
.live .cell b { display: block; font-size: 22px; color: var(--white); font-family: var(--mono); letter-spacing: 0.02em; }
.live .cell span { font-size: 11px; color: var(--dim); letter-spacing: 0.1em; font-family: var(--mono); }
.live .cell.on b { color: var(--cyan); text-shadow: 0 0 10px rgba(102,252,241,0.5); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); margin-right: 6px; animation: blink 1.4s step-end infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0.15; } }

/* ── 섹션 공통 ── */
section.sec { padding: 76px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 56px; }
[role="button"][data-open] { cursor: pointer; }
[role="button"][data-open]:focus-visible, .filters button:focus-visible, .hubs button:focus-visible, .nav a:focus-visible, .tabs button:focus-visible, .forms button:focus-visible, .strip button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-h .num { font-family: var(--mono); color: var(--cyan); font-size: 13px; letter-spacing: 0.2em; }
.sec-h h2 { font-size: clamp(26px, 4vw, 36px); }
.sec-h p { width: 100%; margin: 4px 0 0; color: var(--dim); max-width: 760px; }
.sub-h { font-size: 19px; font-weight: 800; color: var(--white); letter-spacing: 0.01em; margin: 44px 0 14px; display: flex; align-items: center; gap: 10px; }
.sub-h::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px rgba(102,252,241,0.5); flex-shrink: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card h3 { font-size: 16px; }
.card p { margin: 6px 0 0; font-size: 14px; color: #cfd3da; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 12px; color: var(--txt); }
.chip.link { cursor: pointer; }
.chip.link:hover { border-color: var(--cyan); color: var(--cyan); }
.chip .sw { width: 7px; height: 7px; border-radius: 50%; }
.lab { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; }
.empty { color: var(--dim); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
/* 기록 손상 — 숨은 진실 힌트 */
.hint { position: relative; border: 1px solid rgba(255,77,77,0.28); background: linear-gradient(135deg, rgba(255,77,77,0.06), rgba(102,252,241,0.03)); border-radius: 10px; padding: 12px 14px 12px 14px; font-size: 13.5px; color: #d6d9df; }
.hint::before { content: "기록 손상 · DATA CORRUPTED"; display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: #ff8a8a; margin-bottom: 4px; }
.hint p { margin: 0; }
.hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 18px; }
.quote { border-left: 3px solid var(--c, var(--cyan)); padding: 2px 0 2px 12px; color: var(--white); font-style: italic; margin: 8px 0 12px; }

/* ── 연대기 ── */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--line), var(--cyan)); }
.tl .ev { position: relative; padding: 10px 0 20px; }
.tl .ev::before { content: ""; position: absolute; left: -23px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 8px rgba(102,252,241,0.5); }
.tl .ev.lost::before { border-color: var(--red); box-shadow: 0 0 8px rgba(255,77,77,0.6); }
.tl .when { font-family: var(--mono); color: var(--cyan); font-size: 12px; letter-spacing: 0.15em; }
.tl .ev.lost .when { color: #ff8a8a; }
.tl h3 { font-size: 18px; margin: 2px 0 6px; }
.tl p { margin: 0; color: #cfd3da; max-width: 680px; }
.tl .pic { margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 2; max-width: 680px; position: relative; background: var(--panel2); }
.tl .pic img { width: 100%; height: 100%; object-fit: cover; }
.tl .pic.glitch img { filter: saturate(0.6) contrast(1.05); }
.tl .pic.glitch::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px); pointer-events: none; }
.now .card b { color: var(--cyan); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; display: block; margin-bottom: 4px; }

/* 수인 인식도 */
.ranks { display: flex; flex-direction: column; gap: 8px; }
.rank { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.rank .bar { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a1f1f, var(--gold), var(--cyan)); }
.rank em { font-style: normal; color: var(--dim); font-size: 12px; white-space: nowrap; }

/* ── 염혈통 ── */
.royal { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.royal .card { padding: 0; overflow: hidden; border-top: 2px solid var(--c); }
.royal .port { position: relative; height: 220px; background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--c) 22%, transparent), transparent 62%), var(--panel2); }
.royal .port img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.royal .port::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: linear-gradient(180deg, transparent, var(--panel)); }
.royal .meta { padding: 10px 14px 14px; }
.royal .ord { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--gold); }
.royal h3 { margin: 4px 0 2px; font-size: 18px; }
.royal .pw { color: var(--cyan); font-size: 13px; font-weight: 700; }
.royal .pd { font-size: 12.5px; color: #b8bcc4; margin-top: 6px; }

/* ── 나라 ── */
.nations { display: grid; gap: 18px; }
.nation { padding: 0; overflow: hidden; display: grid; grid-template-columns: 280px 1fr; border-left: 3px solid var(--c); }
.nation .img { position: relative; background: var(--panel2); min-height: 260px; }
.nation .img img.bgp { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) brightness(0.6); }
.nation .img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 40%, var(--panel) 100%); }
.nation .emb { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; transform: translate(-50%, -50%); z-index: 2; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.75)); }
.nation .body { padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 4px 30px; align-items: start; }
.nation .col2 { border-left: 1px solid var(--line); padding-left: 24px; }
.nation .col2 .lab { display: block; margin: 0 0 4px; }
.nation .col2 .tips { margin-top: 0; }
.nation .en { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: var(--c); }
.nation h3 { font-size: 22px; margin: 2px 0 8px; }
.nation p { margin: 0 0 12px; font-size: 14.5px; color: #d6d9df; line-height: 1.75; }
.nation .tips { font-size: 13.5px; line-height: 1.65; }
.kv { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; padding-top: 2px; }
.kv dd { margin: 0; color: var(--txt); }
.tips { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: #cfd3da; }
.tips li { margin: 3px 0; }
.ppl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pp { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 2px; font-size: 12px; background: var(--bg); }
.pp img, .pp i { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--panel2); border: 1px solid var(--line); font-style: normal; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; color: var(--dim); flex-shrink: 0; }
.pp:hover { border-color: var(--c, var(--cyan)); }
.rel .card { border-left: 3px solid var(--line); }
.rel .card b { color: var(--white); }
.rel .card .pair { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--dim); margin-bottom: 4px; }
.lands { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.lands .card { padding: 0; overflow: hidden; }
.lands .card .img { background: var(--panel2); height: 130px; position: relative; }
.lands .card .img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.75); }
.lands .card .img img[src*="SITE/S10"] { object-fit: contain; padding: 14px; filter: none; }
.lands .card .txt { padding: 14px; }
.lands .card b { color: var(--white); }
.upc { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; border-top: 3px solid var(--upc); }
.upc .emb { width: 170px; margin: 0 auto; }
.planets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 12px 0; }
.planets div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.planets b { color: var(--upc); display: block; font-size: 13px; }

/* ── 지도 ── */
.maprow { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 22px; align-items: start; }
.device-wrap { font-size: 15px; }
.device-note { margin-top: 10px; font-size: 12px; color: var(--dim); font-family: var(--mono); letter-spacing: 0.04em; }
.hubs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.hubs button, .filters button, .tabs button { border: 1px solid var(--line); background: var(--bg); color: var(--txt); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.hubs button.on, .filters button.on, .tabs button.on { border-color: var(--cyan); color: var(--cyan); background: rgba(102,252,241,0.06); }
.region .rimg { height: 150px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 12px; background: var(--panel2); }
.region .rimg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); }
.region h3 { font-size: 22px; }
.region .blurb { color: #cfd3da; margin: 6px 0 10px; font-size: 14px; }
.region .travel { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.place { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.place b { color: var(--white); }
.place p { margin: 4px 0 8px; font-size: 13px; color: #b8bcc4; }
.danger-h { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; font-size: 18px; font-weight: 900; color: #ff4d4d; letter-spacing: 0.04em; animation: dgblink 1.2s ease-in-out infinite; }
.danger-h small { font-size: 12px; font-weight: 600; color: #ff9a9a; letter-spacing: 0; }
.danger-h .lamp { width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 10px 3px rgba(255,59,59,0.75); flex-shrink: 0; }
@keyframes dgblink { 0%, 100% { opacity: 1; text-shadow: 0 0 12px rgba(255,59,59,0.7); } 50% { opacity: 0.35; text-shadow: none; } }
.dchips { display: flex; flex-wrap: wrap; gap: 8px; }
.dchip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,77,77,0.55); background: rgba(255,59,59,0.08); color: #ffd0d0; border-radius: 999px; padding: 3px 12px 3px 3px; font-size: 13.5px; font-weight: 700; cursor: pointer; min-height: 40px; }
.dchip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,77,77,0.6); }
.dchip small { color: #ff8a8a; font-family: var(--mono); font-weight: 600; }
.dchip:hover, .dchip:focus-visible { background: rgba(255,59,59,0.18); border-color: #ff4d4d; outline: none; }

/* ── 인물 ── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input { margin-left: auto; min-width: 200px; flex: 1 1 200px; max-width: 320px; background: var(--bg); border: 1px solid var(--line); color: var(--white); padding: 8px 12px; border-radius: 999px; font-size: 13px; outline: none; }
.filters input:focus { border-color: var(--cyan); }
.people { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pc { padding: 0; overflow: hidden; border-top: 2px solid var(--c); transition: transform 0.15s, border-color 0.15s; position: relative; }
.pc:hover { transform: translateY(-2px); border-color: var(--c); }
.pc .port { position: relative; aspect-ratio: 4 / 5; background: radial-gradient(ellipse at 50% 15%, color-mix(in srgb, var(--c) 22%, transparent), transparent 62%), var(--panel2); }
.pc .port img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pc .port::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, transparent, var(--panel)); }
.pc .port .code { position: absolute; top: 10px; left: 10px; z-index: 1; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--c); background: rgba(11,12,16,0.75); padding: 2px 6px; border-radius: 4px; }
.pc .meta { padding: 8px 14px 14px; }
.pc .meta h3 { font-size: 17px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pc .meta h3 small { color: var(--dim); font-weight: 400; font-size: 11.5px; font-family: var(--mono); letter-spacing: 0.04em; }
.pc .role { color: var(--c); font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.pc .tag { color: #b8bcc4; font-size: 13px; margin-top: 6px; }
.pc .note { margin-top: 8px; font-size: 11px; color: var(--gold); font-family: var(--mono); letter-spacing: 0.04em; }

/* ── 도감 ── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button b { font-family: var(--mono); color: var(--dim); font-weight: 600; }
.mons { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mc { padding: 0; overflow: hidden; transition: transform 0.15s; }
.mc:hover { transform: translateY(-2px); border-color: var(--gold); }
.mc .img { position: relative; aspect-ratio: 1 / 1; background: var(--panel2); }
.mc .img img { width: 100%; height: 100%; object-fit: cover; }
.mc .img .star { position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: 12px; color: var(--gold); background: rgba(11,12,16,0.78); padding: 2px 7px; border-radius: 4px; letter-spacing: 0.05em; }
.mc .img .mk { position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--cyan); background: rgba(11,12,16,0.78); padding: 2px 7px; border-radius: 4px; }
.mc .meta { padding: 10px 14px 14px; }
.mc h3 { font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.mc h3 small { color: var(--dim); font-family: var(--mono); font-size: 11px; font-weight: 400; white-space: nowrap; }
.mc .hab { color: var(--dim); font-size: 12px; margin-top: 4px; }
.mc .ent { color: #cfd3da; font-size: 13px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── 플레이 ── */
.starts { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.start { padding: 0; overflow: hidden; border-top: 2px solid var(--cyan); }
.start .img { height: 140px; background: var(--panel2); position: relative; }
.start .img img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7); }
.start .img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--panel)); }
.start .body { padding: 14px 16px 16px; }
.start .mode { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--cyan); }
.start h3 { font-size: 20px; margin: 2px 0 8px; }
.start p { font-size: 14px; color: #cfd3da; margin: 0 0 10px; }
.start .first { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #dfe2e8; margin-bottom: 10px; }
.start .equip { font-size: 12.5px; color: var(--gold); margin-bottom: 8px; }
.recs { margin-top: 16px; border: 1px solid rgba(197,160,89,0.4); border-radius: 12px; background: linear-gradient(180deg, rgba(197,160,89,0.07), transparent); padding: 18px; }
.recs h3 { font-size: 17px; color: var(--gold); margin: 0 0 4px; }
.recs > p { margin: 0 0 14px; font-size: 13.5px; color: #cfd3da; }
.recs .g { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.rec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.rec b { color: var(--white); font-size: 15.5px; display: block; margin-bottom: 4px; }
.rec p { margin: 0 0 10px; font-size: 13.5px; color: #cfd3da; }
.rec .tpl { display: flex; gap: 8px; align-items: flex-start; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #e6e8ec; }
.rec .tpl span { flex: 1; }
.cmds { display: grid; gap: 10px; }
.cmd { display: grid; grid-template-columns: 170px 1fr auto; gap: 16px; align-items: start; padding: 18px; }
.cmd code { font-family: var(--mono); color: var(--cyan); font-size: 19px; font-weight: 800; }
.cmd p { margin: 0; font-size: 15px; line-height: 1.75; color: #dfe2e8; }
.copy { border: 1px solid var(--line); background: var(--bg); color: var(--txt); border-radius: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 38px; font-family: inherit; }
.copy.done { color: var(--cyan); border-color: var(--cyan); }
.gauge { display: flex; height: 18px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); margin: 10px 0 6px; }
.gauge i { display: block; height: 100%; position: relative; }
.gauge-l { display: flex; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.gauge-l span { position: relative; }
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 14px; }
.stage { border-left: 3px solid var(--c); background: var(--bg); border-radius: 6px; padding: 8px 12px; }
.stage b { color: var(--c); font-size: 14px; }
.stage small { font-family: var(--mono); color: var(--dim); margin-left: 6px; }
.stage p { margin: 2px 0 0; font-size: 12.5px; color: #cfd3da; }
.updown { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.updown ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.updown li { margin: 3px 0; }
.updown .up b { color: #8fe3a0; } .updown .dn b { color: #ff8a8a; }

/* ── 화면 예시 ── */
.jsxnote { border: 1px solid rgba(197,160,89,0.4); background: rgba(197,160,89,0.07); color: #e9dcc0; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 20px; }
.jsxnote b { color: var(--gold); }
.chat { max-width: 640px; margin: 0 auto; display: grid; gap: 12px; }
.chat .narr { font-size: 14.5px; color: #dfe2e8; line-height: 1.8; }
.chat .say { font-size: 15px; color: var(--white); font-weight: 600; }
.chat .mount { min-height: 120px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.demo { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.demo .cap { font-size: 13px; color: #cfd3da; margin-top: 10px; }
.demo .cap b { color: var(--white); display: block; font-size: 14px; }
.demo .lines { margin-top: 8px; font-size: 13.5px; color: var(--white); }
.demo .lines div { margin: 2px 0; }
.demo .lines small { color: var(--dim); margin-right: 6px; font-family: var(--mono); }
.prl-box { max-width: 640px; margin: 0 auto; }

/* ── 다이얼로그 ── */
dialog { border: 1px solid var(--line); background: var(--panel); color: var(--txt); border-radius: 16px; padding: 0; max-width: min(900px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
dialog::backdrop { background: rgba(5,6,8,0.78); backdrop-filter: blur(4px); }
.dlg { display: grid; grid-template-columns: 320px 1fr; min-height: 420px; }
.dlg .port { position: sticky; top: 0; align-self: start; aspect-ratio: 4 / 5; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--c, var(--cyan)) 26%, transparent), transparent 66%), var(--panel2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 16px 0 16px 0; overflow: hidden; }
.dlg .port.sq { aspect-ratio: 1 / 1; }
.dlg .port img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.dlg .port img.contain { object-fit: contain; object-position: center bottom; }
.dlg .port .pcap { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-family: var(--mono); font-size: 11px; color: var(--white); background: rgba(11,12,16,0.75); padding: 3px 8px; border-radius: 4px; letter-spacing: 0.06em; }
.dlg .body { padding: 22px 24px 24px; overflow-y: auto; max-height: calc(100vh - 34px); }
.dlg .code { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: var(--c, var(--cyan)); }
.dlg h2 { font-size: 26px; display: flex; align-items: baseline; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.dlg h2 small { color: var(--dim); font-size: 13px; font-family: var(--mono); font-weight: 400; }
.dlg .tagline { color: var(--white); font-weight: 600; margin: 4px 0 12px; }
.dlg .kv { grid-template-columns: 64px 1fr; margin-bottom: 12px; }
.dlg .para { font-size: 14px; color: #dfe2e8; margin: 0 0 10px; }
.dlg .lab { margin-top: 14px; margin-bottom: 6px; display: block; }
.dlg .close { position: absolute; top: 10px; right: 12px; z-index: 5; border: 1px solid var(--line); background: var(--bg); color: var(--txt); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 17px; }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.strip button { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; overflow: hidden; cursor: pointer; padding: 0; }
.strip button img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.strip button.on { border-color: var(--c, var(--cyan)); box-shadow: 0 0 0 1px var(--c, var(--cyan)); }
.strip button span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9.5px; color: var(--white); background: rgba(11,12,16,0.78); padding: 1px 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip.two { grid-template-columns: 1fr 1fr; }
.strip.two button { aspect-ratio: 1 / 1; }
.strip.two button span { font-size: 11.5px; padding: 3px 4px; }
.forms { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; }
.forms button { border: 1px solid var(--line); background: rgba(11,12,16,0.82); color: var(--txt); padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600; }
.forms button.on { border-color: var(--gold); color: var(--gold); }

/* ── 배경음 버튼 ── */
.bgm { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(102,252,241,0.35); background: rgba(11,12,16,0.88); border-radius: 999px; padding: 4px 12px 4px 4px; backdrop-filter: blur(6px); }
.bgm[hidden] { display: none; }
.bgm { transition: opacity .5s ease; }
.bgm.dim { opacity: 0.2; }
.bgm button { border: 0; background: transparent; color: var(--cyan); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 8px 8px; min-height: 40px; border-radius: 999px; font-family: inherit; }
.bgm button[aria-pressed="false"] { color: var(--dim); }
.bgm button:focus-visible, .bgm input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.bgm input[type=range] { width: 96px; accent-color: var(--cyan); cursor: pointer; }
.bgm input[hidden] { display: none; }

/* ── 하단 ── */
footer { padding: 36px 0 60px; color: var(--dim); font-size: 12px; font-family: var(--mono); letter-spacing: 0.04em; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* 작은 글자에 쓰는 세력색은 조금 밝게(대비) */
.nation .en, .pc .role, .dlg .code { color: color-mix(in srgb, var(--c, var(--cyan)) 82%, #fff); }

/* ── 반응형 ── */
@media (max-width: 900px) {
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 24px; }
  .maprow, .upc { grid-template-columns: 1fr; }
  .nation { grid-template-columns: 1fr; }
  .nation .img { min-height: 170px; height: 170px; }
  .nation .img::after { background: linear-gradient(180deg, transparent 40%, var(--panel) 100%); }
  .nation .emb { width: 110px; height: 110px; }
  .nation .body { grid-template-columns: 1fr; padding: 16px; }
  .nation .col2 { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
  .dlg { grid-template-columns: 1fr; }
  .dlg .port, .dlg .port.sq { position: relative; aspect-ratio: auto; height: 340px; width: 100%; border-right: 0; border-radius: 16px 16px 0 0; }
  .dlg .body { max-height: none; }
  dialog { overflow-y: auto; }
  .dlg .close { position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; }
  .cmd { grid-template-columns: 1fr auto; }
  .cmd p { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .lands { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .hero { min-height: 82vh; }
  .hero .wrap { padding-top: 60px; }
  section.sec { padding: 54px 0; }
  .rank { grid-template-columns: 110px 1fr; font-size: 13px; }
  .rank em { grid-column: 2; }
  .people, .mons, .royal { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pc .meta { padding: 8px 10px 12px; }
  .pc .meta h3 { font-size: 15px; }
  .filters input { min-width: 0; width: 100%; max-width: none; min-height: 40px; margin-left: 0; }
  .nav a, .hubs button, .filters button, .tabs button, .pp, .chip.link, .forms button, .brand { min-height: 40px; }
  .updown { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .strip button span { display: none; }
  .strip.two button span { display: block; }
  .dlg .body { padding: 18px 16px 22px; }
  #gate h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .danger-h { animation: none; }
  .ticker .lane, .dot, .ticker .lane .lv-alert b, .ticker .lane .lv-err b { animation: none; }
  #gate .door, #gate .wheel { transition: none; }
}
