:root {
  color-scheme: dark;
  --page: #191918;
  --panel: #201f1c;
  --inset: #151513;
  --line: #363431;
  --text: #f0ece3;
  --muted: #ada89d;
  --primary: #6de1d1;
  --primary-ink: #142723;
  --secondary: #9fb5db;
  --radius: 4px;
  font-family: system-ui, "Malgun Gothic", sans-serif;
  font-size: 14px;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .37; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.15rem; }
.icon { width: 1em; height: 1em; vertical-align: middle; }
.wrap { position: relative; max-width: 1096px; margin: auto; padding: 0 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.button { display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: .6rem .85rem; border-radius: var(--radius); font-weight: 750; white-space: nowrap; }
.button:hover { background: #34312c; }
.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.primary:hover, .card-link:hover .primary { background: #a1f0e3; }
.hero-back { height: 595px; overflow: hidden; position: absolute; inset: 0 0 auto; background: #252a27; }
.hero-back canvas { width: 100%; height: 100%; object-fit: cover; opacity: .68; display: block; }
.hero-back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #1115179a 0%, #111516b8 42%, var(--page) 100%); }
.home-header { padding-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.series { display: inline-flex; align-items: center; background: #171b20; border: 1px solid #353a3b; border-radius: 24px; padding: 3px; }
.series a, .series button { border: 0; background: none; font-weight: 800; border-radius: 19px; padding: 7px 13px; font-size: .91rem; white-space: nowrap; }
.series a { color: #211e1a; background: var(--text); }
.series button:hover { background: #31363b; }
.edition { font-size: .83rem; color: var(--muted); letter-spacing: .09em; }
.intro { padding-top: 66px; padding-bottom: 24px; }
.intro h1 { line-height: 1.08; font-size: clamp(46px,7vw,94px); font-weight: 1000; letter-spacing: -.055em; text-shadow: 0 4px 24px #0c111675; }
.intro p { font-size: clamp(16px,2vw,20px); font-weight: 730; margin-top: 12px; }
.finder { margin-bottom: 28px; }
.search-field { min-height: 75px; display: flex; align-items: center; gap: 13px; padding: 0 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.search-field:focus-within { border-color: var(--primary); }
.search-field svg { font-size: 26px; color: var(--primary); flex: none; }
.search-field input { border: 0; outline: none; background: transparent; flex: 1; width: 0; min-height: 55px; font-size: 18px; }
input::placeholder { color: var(--muted); opacity: 1; }
.suggestions { padding: 6px 12px; background: var(--inset); border: 1px solid var(--line); border-top: 0; }
.suggestions a { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 8px; }
.suggestions a:hover { background: var(--panel); }
.suggestions span { color: var(--primary); white-space: nowrap; }
.suggestions small { display: block; margin-top: 3px; }
.suggestions small, .suggestions p { color: var(--muted); }
.suggestions button, .suggestions p { margin: 7px; }
.rank { padding: 16px 17px 18px; scroll-margin: 12px; }
.rank-head { display: flex; gap: 13px; align-items: center; margin-bottom: 10px; }
.rank-toggle { margin-left: auto; font-size: .86rem; }
.rank-peek { display: grid; width: 100%; grid-template-columns: 20px 1fr auto; gap: 6px; align-items: center; min-height: 44px; padding: 9px 14px; border: 0; border-radius: 3px; background: var(--inset); text-align: left; }
button.rank-peek:hover { background: #2b2a26; }
.rank-peek b, .rank li b { font-size: 17px; font-weight: 1000; }
.rank small { color: #cbc6b9; }
.rank-note { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.rank ol { list-style: none; padding: 0; margin: 0; }
.rank li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 4px 8px; padding: 10px; margin-bottom: 5px; background: var(--inset); }
.rank li a { font-weight: 800; }
.rank li a:hover { color: var(--primary); }
.rank progress { grid-column: 2 / -1; width: 100%; height: 6px; accent-color: var(--primary); }
.directory { padding-top: 24px; }
.directory-head, .view-group, .sorting { display: flex; align-items: center; gap: 8px; }
.directory-head { justify-content: space-between; margin-bottom: 13px; }
.view-group, .sorting { color: var(--muted); font-size: .88rem; gap: 10px; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; padding: 2px; background: #1a1916; }
.switch button { padding: 6px 13px; min-width: 45px; border: 0; background: transparent; color: var(--muted); border-radius: 2px; font-size: .86rem; font-weight: 800; white-space: nowrap; }
.switch button[aria-pressed=true] { color: #25231e; background: var(--text); }
.sorting select, .map-search { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); min-height: 38px; padding: 0 10px; min-width: 140px; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.card { position: relative; min-width: 0; overflow: hidden; }
.card:hover { border-color: #8e9f95; }
.card-link { display: block; }
.card-link:focus-visible { outline-offset: -3px; }
.card-visual { position: relative; aspect-ratio: 1.83; background: #55655b; overflow: hidden; }
.card-visual::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, #0c1516c9); pointer-events: none; }
.card-visual canvas { width: 100%; height: 100%; display: block; }
.card-logo { position: absolute; z-index: 1; left: 13px; right: 13px; bottom: 11px; font-size: clamp(23px,2.5vw,33px); font-style: italic; font-weight: 1000; line-height: 1.1; text-shadow: 2px 2px #111a; }
.card-logo i { color: #d3f7ef; font-size: .62em; }
.card-logo small { display: table; background: #171b19dd; color: #d6e7dd; letter-spacing: .08em; margin-top: 4px; padding: 3px 5px; font: 750 9px system-ui; }
.card-foot { min-height: 56px; padding: 8px 10px 8px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-foot .button { font-size: .9rem; }
.favorite, .score-tag { position: absolute; top: 8px; border: 1px solid #b6b6a951; background: #181917ed; border-radius: 3px; }
.favorite { left: 8px; height: 34px; width: 34px; font-size: 23px; color: #c2bcad; line-height: 1; }
.favorite:hover, .favorite[aria-pressed=true] { color: var(--primary); }
.score-tag { right: 8px; padding: 4px 7px; font-weight: 850; z-index: 1; }
.more { display: flex; margin: 15px auto; }
.empty { grid-column: 1 / -1; padding: 26px; color: var(--muted); }
.map-shell { background: #101928; padding: 14px; }
.map-canvas { width: min(100%, 346px); aspect-ratio: 300/440; margin: 0 auto; position: relative; }
.korea, .region-buttons { position: absolute; inset: 0; width: 100%; height: 100%; }
.region-buttons { pointer-events: none; }
.korea path { cursor: pointer; stroke: #101928; stroke-width: 2; transition: filter .12s; }
.korea path:hover, .korea path.selected { filter: brightness(1.55); }
.region-buttons button { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%); border-radius: 14px; border: 1px solid #76818451; background: #131925; font-size: .76rem; color: var(--text); white-space: nowrap; font-weight: 800; padding: 3px 7px; pointer-events: auto; }
.region-buttons button.selected { background: var(--primary); color: var(--primary-ink); }
.region-buttons b { margin-left: 3px; }
.map-caption { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 35px; color: #c3ccd2; }
.map-pins { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px; }
.map-pins a { background: #283841; border: 1px solid #4f6268; border-radius: 4px; padding: 6px 8px; }
.map-pins a:hover { color: var(--primary); }
.region-detail { min-height: 230px; max-width: 620px; position: relative; margin: 8px auto; border: 1px solid #455969; border-radius: 5px; background: #1c2b35; }
.region-detail > strong { position: absolute; top: 7px; left: 9px; pointer-events: none; }
.region-grid { position: absolute; inset: 0; background-image: linear-gradient(#52647445 1px,transparent 1px),linear-gradient(90deg,#52647445 1px,transparent 1px); background-size: 28px 28px; }
.pin { position: absolute; left: var(--x); top: var(--y); width: 13px; height: 13px; border: 2px solid #142723; background: var(--primary); border-radius: 50%; transform: translate(-50%,-50%); }
.pin span { display: none; position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%); background: #0c1923; color: var(--text); padding: 4px 6px; border-radius: 3px; font-size: .8rem; white-space: nowrap; }
.pin:hover, .pin:focus-visible { z-index: 1; }
.pin:hover span, .pin:focus-visible span { display: block; }
.map-search { display: block; width: 100%; margin: 10px 0 13px; }
.help-strip { z-index: 4; position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%); width: min(760px,calc(100% - 24px)); min-height: 62px; box-shadow: 0 3px 18px #0007; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 11px 13px; }
.help-strip p { color: var(--muted); font-size: .9rem; }
.help-strip strong { color: var(--text); }
.strip-actions { display: flex; gap: 5px; }
.strip-actions .button { min-width: 115px; }
.strip-actions .button + .button { background: var(--secondary); color: #111b29; }
.strip-actions .button + .button:hover { background: #c0d2f2; }
.close, .guide-title button { background: transparent; border: 0; font-size: 20px; color: var(--muted); padding: 3px 5px; }
.footer-guide { margin: 28px 0 15px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.footer-guide p { color: var(--muted); margin-top: 5px; }
.site-footer { font-size: .88rem; padding: 13px 0 105px; color: var(--muted); line-height: 1.65; }
.site-footer a, .credit a { text-decoration: underline; text-underline-offset: 2px; }
.guide { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; width: min(510px,calc(100% - 28px)); padding: 20px; line-height: 1.6; }
.guide::backdrop { background: #080e11bc; }
.guide-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.guide ul { padding-left: 20px; }
kbd { border: 1px solid var(--line); background: var(--inset); border-radius: 3px; padding: 1px 4px; }
.missing { padding-top: 50px; }
.missing .button { margin-top: 14px; }

.game-page { overflow: hidden; overscroll-behavior: none; }
.game { position: fixed; inset: 0; isolation: isolate; background: #dce1e2; user-select: none; color: var(--text); }
.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.game-canvas.dragging { cursor: grabbing; }
.game-header, .score-box, .rank-short, .toolbar, .settings, .compass, .game-tip, .share-sheet, .impact-toast { border: 1px solid #403f38; border-radius: 5px; background: #201f1bf5; box-shadow: 0 2px 5px #1112; }
.game-navigation { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; pointer-events: none; }
.game-header { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 9px; max-width: 100%; pointer-events: auto; }
.game-header h1 { font-size: 17px; font-weight: 1000; letter-spacing: -.035em; }
.game-header h1 span { color: var(--primary); }
.game-header .button { padding: 4px 7px; font-size: .83rem; }
.game-header .icon { margin-right: 4px; }
.camera-controls { pointer-events: auto; touch-action: manipulation; }
.camera-controls button { min-width: 52px; min-height: 34px; }
.camera-controls .camera-icon { min-width: 34px; padding-inline: 8px; font-size: 1.12rem; }
.camera-controls button[aria-pressed=true] { background: var(--primary); color: var(--primary-ink); }
.score-hud { position: absolute; top: 108px; right: 16px; text-align: right; }
.score-box { padding: 7px 10px; display: inline-flex; gap: 8px; align-items: baseline; font-size: 10px; font-weight: 950; }
.score-box output { font-size: 25px; font-weight: 1000; line-height: 1; font-variant-numeric: tabular-nums; }
.rank-short { display: block; padding: 5px 8px; line-height: 1.4; font-size: .78rem; margin-top: 5px; }
.rank-short strong, .rank-short small { display: block; }
.rank-short strong { color: var(--primary); }
.toolbar { position: absolute; left: 50%; bottom: max(28px,env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; padding: 4px; gap: 4px; }
.tools, .game-actions { display: flex; gap: 3px; }
.tool, .game-action { position: relative; display: grid; grid-template-rows: 1fr auto; place-items: center; gap: 7px; width: 63px; height: 72px; padding: 10px 3px 8px; background: #2a2925; border: 1px solid #302f2a; border-radius: 5px; color: var(--text); font-size: 11px; font-weight: 800; white-space: nowrap; }
.tool .icon, .game-action .icon { font-size: 24px; }
.tool:hover, .game-action:hover:enabled { background: #3b3932; }
.tool[aria-checked=true] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tool small { position: absolute; top: 4px; left: 5px; opacity: .7; font-size: 9px; }
.game-actions { padding-left: 4px; border-left: 1px solid var(--line); }
.game-action { background: transparent; border-color: transparent; width: 55px; }
.game-action[aria-expanded=true] { border-color: #b4ada0; }
.toolbar-help { display: grid; align-content: center; gap: 4px; padding-left: 4px; border-left: 1px solid var(--line); }
.toolbar-help .button { font-size: 10px; padding: 5px; background: var(--secondary); color: #192230; border-color: transparent; }
.toolbar-help .button + .button { background: var(--primary); }
.settings, .share-sheet { position: absolute; bottom: calc(100% + 6px); right: 53px; padding: 5px; min-width: 148px; }
.settings button { display: block; background: transparent; border: 0; border-radius: 3px; width: 100%; text-align: left; padding: 8px 10px; white-space: nowrap; }
.settings button:hover { background: #383630; }
.settings button[aria-pressed=true] { color: var(--primary); }
.share-sheet { min-width: 230px; display: grid; gap: 7px; padding: 10px; }
.share-sheet input { background: var(--inset); border: 1px solid var(--line); border-radius: 3px; padding: 5px; width: 100%; }
.compass { position: absolute; bottom: 28px; right: 16px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; color: var(--primary); }
.compass span { display: block; }
.credit { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); padding: 1px 5px; border-radius: 3px; background: #1d211ddd; color: #e4e7dc; font-size: 9px; width: max-content; max-width: calc(100% - 16px); text-align: center; }
.game-tip, .impact-toast { position: absolute; left: 50%; transform: translateX(-50%); padding: 6px 10px; text-align: center; font-size: .82rem; pointer-events: none; }
.game-tip { bottom: 114px; width: max-content; max-width: calc(100% - 24px); }
.impact-toast { top: 18px; color: var(--primary); font-weight: 800; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; background: #141a1d; color: #c4d0d2; }
@media(max-width: 900px) {
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width: 619px) {
  .hero-back { height: 500px; }
  .home-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .intro { padding-top: 26px; padding-bottom: 20px; }
  .intro h1 { font-size: clamp(34px,11.8vw,58px); }
  .intro p { margin-top: 8px; }
  .search-field { min-height: 59px; padding: 0 12px; gap: 8px; }
  .search-field input { font-size: 14px; }
  .search-field svg { font-size: 22px; }
  .rank-head { gap: 7px; flex-wrap: wrap; }
  .rank-head .switch { order: 2; }
  .rank { padding: 14px 12px; }
  .rank-peek { grid-template-columns: 17px 1fr; gap: 3px 7px; }
  .rank-peek small { grid-column: 2; }
  .rank li { grid-template-columns: 20px 1fr; }
  .rank li small { grid-column: 2; }
  .directory-head { align-items: flex-start; flex-wrap: wrap; }
  .sorting { margin-left: auto; }
  .cards { grid-template-columns: 1fr; }
  .card-logo { font-size: 30px; }
  .help-strip { grid-template-columns: 1fr auto; gap: 7px; }
  .help-strip p { grid-column: 1 / -1; }
  .strip-actions .button { flex: 1; min-width: 0; }
  .site-footer { padding-bottom: 145px; }
  .score-hud { top: 62px; right: 10px; }
  .score-box output { font-size: 20px; }
  .game-navigation { top: 12px; left: 10px; right: 10px; }
  .game-header h1 { font-size: 14px; }
  .camera-controls { position: fixed; left: 10px; bottom: calc(max(21px,env(safe-area-inset-bottom)) + 122px); }
  .camera-controls button, .camera-controls .camera-icon { min-height: 44px; min-width: 44px; padding-inline: 8px; }
  .toolbar { width: calc(100% - 16px); max-width: 430px; bottom: max(21px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto; gap: 3px; border-radius: 9px; }
  .tools { grid-column: 1/-1; }
  .tool, .game-action { width: auto; flex: 1; min-width: 0; height: 52px; padding: 5px 1px; gap: 3px; font-size: 10px; }
  .tool .icon, .game-action .icon { font-size: 20px; }
  .game-actions { padding: 0; border: 0; }
  .toolbar-help { display: flex; align-items: stretch; }
  .toolbar-help .button { padding-inline: 6px; }
  .compass { bottom: 141px; right: 10px; width: 31px; height: 31px; }
  .game-tip { bottom: calc(max(21px,env(safe-area-inset-bottom)) + 176px); max-width: calc(100% - 24px); }
  .impact-toast { top: 105px; }
  .settings, .share-sheet { right: 3px; }
  .credit { font-size: 8px; bottom: 3px; }
}
@media(max-width: 389px) {
  .directory-head .sorting { margin-left: 0; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
