:root {
  color-scheme: dark;
  --bg-outer: #0e0e1a;
  --bg: #1a1a2e;
  --bg-alt: #22223d;
  --bg-hover: #2d2d52;
  --bg-input: #141428;
  --bg-code: #0d1117;
  --bg-form: #1e1e38;
  --bg-guide: #1c1c34;
  --bg-navbar: #0a0a14;
  --bg-navbar-grad: #1a1a30;
  --th-top: #2e3d65;
  --th-bottom: #1a2540;
  --text: #e0e0e0;
  --text-muted: #9a9a9a;
  --text-secondary: #ccc;
  --text-label: #b0b0b0;
  --accent: #ffde00;
  --accent-hover: #fff06a;
  --link: #4fc3f7;
  --border: #2a2a3e;
  --border-light: #4a4a5e;
  --line-num: #505060;
  --ok: #4caf50;
  --err: #f44336;
  --delta-up: #6fbf73;
  --delta-down: #f55a4e;
  --disabled: #707070;
  --text-pink: #f9a8d4;
  --tree-folder: #4fc3f7;
  --tree-file: #8bc34a;
  --inset-light: rgba(255,255,255,0.07);
  --inset-dark: rgba(0,0,0,0.25);
  --shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --flash-mid: rgba(255,255,255,0.25);
  --flash-edge: rgba(255,255,255,0.15);
  --badge-dp-bg: #3a2a10;
  --badge-dp-text: #f0c040;
  --badge-pg-bg: #1a2a3a;
  --badge-pg-text: #6cb4ee;
  --badge-api-bg: #2a2a2a;
  --badge-api-text: #aaa;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
}

img { image-rendering: pixelated; }
.si { display: inline-block; width: 16px; height: 16px; vertical-align: text-bottom; margin-right: 3px; }
.si-hover { display: none; }
a:hover .si-default { display: none; }
a:hover .si-hover { display: inline-block; }
@keyframes si-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
a:hover .si-blink { animation: si-blink 1s step-end infinite; }
.bun-wink { vertical-align: middle; margin-right: 3px; }
.bun-wink .right-eye-wink { opacity: 0; transition: opacity 0.15s; }
.bun-wink .right-eye-open, .bun-wink .right-glare { transition: opacity 0.15s; }
a:hover .bun-wink .right-eye-open, a:hover .bun-wink .right-glare { opacity: 0; }
a:hover .bun-wink .right-eye-wink { opacity: 1; }
body { font-family: var(--font-body); background: var(--bg-outer); background-image: radial-gradient(ellipse 120% 60% at 50% 30%, var(--bg-hover) 0%, var(--bg-outer) 100%); color: var(--text); margin: 0; padding: 0; min-height: 100vh; }
.content { max-width: 1200px; margin: 0 auto; padding: 20px 40px; background: var(--bg); }
h1 { color: var(--accent); border-bottom: none; padding-bottom: 8px; font-size: 18px; background-image: linear-gradient(to right, var(--accent), transparent); background-size: 100% 2px; background-position: bottom; background-repeat: no-repeat; }
h2 { color: var(--accent); margin-top: 24px; font-size: 15px; border-bottom: 1px solid var(--border); padding-bottom: 4px; scroll-margin-top: 101px; }
h2 a:hover::after { content: " #"; color: var(--line-num); font-size: 12px; position: static; inset: auto; background: none; }
table { border-collapse: separate; border-spacing: 0; border-radius: 8px; overflow: hidden; width: 100%; max-width: 900px; margin: 8px 0; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
th, td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 4px 10px; text-align: left; font-size: 13px; box-shadow: inset 1px 1px 0 var(--inset-light), inset -1px -1px 0 var(--inset-dark); }
th:last-child, td:last-child { border-right: none; }
tr:last-child td { border-bottom: none; }
th { background: linear-gradient(to bottom, var(--th-top), var(--th-bottom)); color: var(--accent); }
tr:nth-child(odd) { background: var(--bg); }
tr:nth-child(even) { background: var(--bg-alt); }
tr:hover { background: var(--bg-hover); }
.country-flag, .game-icon { vertical-align: text-bottom; position: relative; top: -1px; }
.country-flag { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.game-icon { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
a { color: var(--link); text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; position: relative; }
td a, .footer a, .guide a { text-decoration: underline; text-underline-offset: 2px; }
td a:hover, .footer a:hover, .guide a:hover { text-decoration: none; }
a:hover { color: var(--accent); }
a:hover::after { content: ''; position: absolute; inset: -1px -4px; background: linear-gradient(var(--accent),var(--accent)) 0 0/6px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 0/2px 6px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 0/6px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 0/2px 6px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 100%/6px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 100%/2px 6px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 100%/6px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 100%/2px 6px no-repeat; pointer-events: none; }
.navbar { margin-bottom: 12px; box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border); padding: 8px; font-size: 12px; color: var(--text-muted); position: sticky; top: 0; z-index: 10; background: var(--bg-navbar); background-image: radial-gradient(ellipse 120% 80% at 50% 40%, var(--bg-navbar-grad) 0%, var(--bg-navbar) 100%); animation: navbar-stuck linear both; animation-timeline: scroll(); animation-range: 100px 101px; }
@keyframes navbar-stuck { to { box-shadow: inset -1px -1px 0 var(--border-light), inset 1px 1px 0 var(--border); } }
.navbar a { display: inline-block; min-height: 32px; line-height: 32px; padding: 0 4px; }
.nav-end { font-weight: bold; float: right; margin-left: 8px; }
.mobile-nav-float { display: none; position: fixed; right: 8px; bottom: 8px; z-index: 20; flex-direction: column; gap: 4px; background: var(--bg-navbar); background-image: radial-gradient(ellipse 120% 80% at 50% 40%, var(--bg-navbar-grad) 0%, var(--bg-navbar) 100%); border: 1px solid var(--border-light); border-radius: 6px; box-shadow: var(--shadow); padding: 2px; }
.mobile-nav-float a { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; text-decoration: none; }
.mobile-nav-float a:hover::after { display: none; }
.mobile-nav-float .si { margin: 0; }
.footer { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 12px; color: var(--text-muted); }
.section-link { color: inherit; text-decoration: none; }
.add-form { display: inline-block; margin: 8px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-form); box-shadow: var(--shadow-sm); }
.add-form label { display: block; margin: 6px 0 2px; font-size: 13px; color: var(--text-label); }
.add-form input { background: var(--bg-input); color: var(--text); border: 1px solid var(--border-light); padding: 4px 8px; font-size: 13px; width: 100%; box-sizing: border-box; border-radius: 4px; }
.add-form button { background: var(--accent); color: var(--bg); border: none; padding: 6px 0; font-size: 13px; font-weight: bold; cursor: pointer; margin: 8px 0 2px; border-radius: 4px; width: 100%; display: block; transition: box-shadow 0.15s ease; }
.add-form button:hover { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45), inset 0 0 12px 2px rgba(255,255,255,0.12); }
.add-form button:disabled { background: var(--disabled); cursor: not-allowed; }
.result-ok { color: var(--ok); font-size: 13px; }
.result-err { color: var(--err); font-size: 13px; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; }
summary:hover { color: var(--accent-hover); }
summary::marker { color: var(--accent); }
details[open] > .guide {
  animation: unfurl 0.075s linear;
  transform-origin: top left;
}
@keyframes unfurl {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
.guide { background: var(--bg-guide); border: 1px solid var(--border); padding: 12px 16px; margin: 8px 0; max-width: 900px; font-size: 13px; line-height: 1.6; border-radius: 8px; box-shadow: var(--shadow-sm); }
.guide pre { background: var(--bg-code); border: 1px outset var(--border); padding: 8px 12px; margin: 6px 0; border-radius: 4px; font-family: var(--font-mono); position: relative; overflow: clip; }
.guide pre code { display: block; overflow-x: auto; }
.guide pre::before { content: ''; position: absolute; top: 0; right: 0; width: 16px; height: 16px; background: linear-gradient(225deg, var(--bg-guide) 50%, var(--border) 50%, var(--border) calc(50% + 1px), color-mix(in srgb, var(--bg-code) 70%, white) calc(50% + 1px)); border-radius: 0 3px 0 2px; z-index: 1; }
.guide pre:has(.ln) { padding: 8px 12px 8px 0; margin: 12px 0; }
.guide code { color: var(--accent); font-size: 12px; font-family: var(--font-mono); overflow-wrap: break-word; }
.guide pre code { overflow-wrap: normal; }
.guide p { margin: 6px 0; }
.guide h3 { color: var(--text); font-size: 13px; margin: 12px 0 4px; }
.guide ol, .guide ul { margin: 4px 0; padding-left: 20px; }
.tree-folder { color: var(--tree-folder); }
.tree-file { color: var(--tree-file); }
.delta-up { color: var(--delta-up); }
.delta-down { color: var(--delta-down); }
.rating-label { color: var(--text-secondary); font-size: 13px; }
.rating-count { color: var(--text-muted); font-size: 9px; vertical-align: super; }
.rating-stats { color: var(--text-muted); font-size: 11px; }
.arrow-blink { display: inline-block; animation: arrow-shift 1.2s step-start infinite; }
@keyframes arrow-shift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-1ch); } }
.marker-replace { display: inline-grid; }
.marker-replace > span { grid-area: 1/1; animation: marker-blink 1.2s step-start infinite; }
.marker-replace > span:first-child { color: var(--accent); }
.marker-replace > span:last-child { color: var(--ok); animation-delay: -0.6s; }
@keyframes marker-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.marker-new { display: inline-grid; }
.marker-new > span { grid-area: 1/1; animation: marker-blink 1.2s step-start infinite; }
.marker-new > span:first-child { color: var(--accent); }
.marker-new > span:last-child { color: var(--err); animation-delay: -0.6s; }
.ln { color: var(--line-num); -webkit-user-select: none; -moz-user-select: none; user-select: none; display: inline-block; width: 2em; text-align: right; font-family: var(--font-mono); position: sticky; left: 0; padding: 0 6px; margin-right: 4px; z-index: 1; background: var(--bg-code); box-shadow: 0 -0.35em 0 var(--bg-code), 0 0.35em 0 var(--bg-code), 2px 0 4px rgba(0,0,0,0.3); }
.ln:first-child { box-shadow: 0 -8px 0 var(--bg-code), 0 0.35em 0 var(--bg-code), 2px 0 4px rgba(0,0,0,0.3); }
.guide pre:has(.ln) code .ln:last-of-type { box-shadow: 0 -0.35em 0 var(--bg-code), 0 8px 0 var(--bg-code), 2px 0 4px rgba(0,0,0,0.3); }
img.banner { border-radius: 8px; box-shadow: var(--shadow); }
.banner-lg { text-align: center; }
.banner-flash { position: relative; overflow: hidden; display: inline-block; border-radius: 8px; }
.banner-flash::after { content: ''; position: absolute; top: 0; left: 0; width: 60%; height: 100%; background: linear-gradient(105deg, transparent 30%, var(--flash-edge) 45%, var(--flash-mid) 50%, var(--flash-edge) 55%, transparent 70%); animation: metalflash 3s ease-in-out infinite; pointer-events: none; will-change: transform; }
@keyframes metalflash { 0% { transform: translateX(-167%); } 100% { transform: translateX(250%); } }
.mod-text { }
.src-badge { font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-left: 4px; white-space: nowrap; vertical-align: middle; opacity: 0.85; }
.src-badge .si { width: 12px; height: 12px; vertical-align: text-bottom; margin-right: 1px; }
.src-dp { background: var(--badge-dp-bg); color: var(--badge-dp-text); }
.src-pg { background: var(--badge-pg-bg); color: var(--badge-pg-text); }
.src-api { background: var(--badge-api-bg); color: var(--badge-api-text); }
.source-filters { font-size: 13px; margin: 4px 0 8px; color: var(--text-muted); }
.source-filters a { color: var(--link); }
.source-filters strong { color: var(--text); }
.screenshot-gallery { display: grid; gap: 12px; margin: 8px 0 12px; align-items: start; }
.screenshot-item { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-muted); cursor: pointer; }
.ss-toggle { display: none; }
.ss-thumb { width: 160px; height: 100px; -o-object-fit: cover; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.ss-thumb:hover { opacity: 0.85; }
.ss-label { margin: 4px 0; }
.ss-close { grid-row: 1; place-self: stretch; pointer-events: none; cursor: pointer; z-index: 1; }
.ss-toggle:checked + .screenshot-item + .ss-close { pointer-events: auto; }
.ss-toggle:checked + .screenshot-item .ss-thumb { opacity: 0.85; border-color: var(--accent); }
.ss-full-wrap { display: none; overflow: hidden; }
.ss-full { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.ss-toggle:checked + .screenshot-item + .ss-close + .ss-full-wrap { display: block; animation: unfurl 0.1s linear; }
.pagination { margin: 12px 0; }
.pagination a, .pagination strong { display: inline-block; padding: 4px 8px; margin: 0 2px; }
.pagination a { color: var(--link); text-decoration: none; }
.pagination a:hover { text-decoration: underline; }
.pagination strong { color: var(--text); }
.map-wrap { position: relative; margin: 12px 0; border-radius: 6px; }
.map-img { width: 100%; display: block; border-radius: 6px; border: 1px solid var(--border); }
.map-label { position: absolute; transform: translate(-50%, -50%); font-size: 9px; color: #e0e0e0; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 2px; padding: 1px 3px; white-space: nowrap; line-height: 11px; pointer-events: auto; cursor: default; z-index: 1; transition: opacity 0.15s; }
.map-label img { vertical-align: middle; margin-right: 2px; }
.map-wrap:has(.map-label:hover) .map-label { opacity: 0.3; }
.map-wrap:has(.map-label:hover) .map-label:hover { opacity: 1; }
.map-glossary { position: absolute; bottom: 4px; left: 4px; max-height: 55%; overflow-y: auto; z-index: 3; display: none; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; font-size: 11px; min-width: 180px; max-width: 280px; box-shadow: var(--shadow); }
.map-gl-panel { display: none; }
.map-gl-hdr { display: flex; align-items: center; gap: 4px; padding: 2px 0; border-bottom: 1px solid var(--border); margin-bottom: 2px; font-weight: bold; color: var(--accent); font-size: 11px; }
.map-gl-hdr img { flex-shrink: 0; }
.map-gl-item { display: flex; align-items: center; gap: 4px; padding: 1px 2px; cursor: default; transition: opacity 0.15s; }
.map-gl-item:hover { background: var(--bg-hover); }
.map-gl-item .game-icon { flex-shrink: 0; }
.gl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gl-addr { display: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-family: var(--font-mono); font-size: 10px; }
.map-gl-item:hover .gl-name { display: none; }
.map-gl-item:hover .gl-addr { display: inline; }
.gl-players { color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.ml-toggle { display: none; }
.map-label { cursor: pointer; }
.map-dismiss { display: none; position: absolute; inset: 0; z-index: 1; cursor: default; }
.map-wrap:has(.ml-toggle:checked:not(#ml-none)) .map-label { pointer-events: none; }
.map-wrap:has(.ml-toggle:checked:not(#ml-none)) .map-dismiss { display: block; }
.visitor-dot { position: absolute; width: 8px; height: 8px; background: var(--ok); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 1; box-shadow: 0 0 4px var(--ok); }
.visitor-dot::after { content: ''; position: absolute; inset: -4px; border: 2px solid var(--ok); border-radius: 50%; animation: dot-ripple 2s ease-out infinite; }
@keyframes dot-ripple { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3); opacity: 0; } }
@media (max-width: 1100px) { .hide-1100 { display: none; } }
@media (max-width: 900px) { .hide-900 { display: none; } .mod-text { display: none; } .content { padding: 20px 20px; } }
@media (max-width: 600px) {
  .content { padding: 8px; }
  th, td { padding: 2px 4px; font-size: 11px; text-align: center; }
  h1 { font-size: 14px; }
  h2 { font-size: 13px; scroll-margin-top: 0; }
  .hide-mobile { display: none; }
  .banner-lg { display: none; }
  .navbar { position: static; }
  .nav-end { display: none; }
  .mobile-nav-float { display: flex; }
  .screenshot-gallery { grid-template-columns: repeat(auto-fill, 100px) !important; gap: 8px; }
  .ss-thumb { width: 100px; height: 62px; }
  .ss-full-wrap { grid-column: 1 / -1 !important; }
  .navbar a { display: inline-block; min-height: 48px; min-width: 48px; line-height: 48px; text-align: center; }
  .map-gl-item { display: none; }
}
@media (max-width: 420px) { th.col-country { font-size: 0; } th.col-country::after { content: 'CC'; font-size: 13px; } }
@media (max-width: 400px) { .screenshot-gallery { display: none; } }
@media (max-width: 360px) { th.col-protocol { font-size: 0; } th.col-protocol::after { content: 'Prot'; font-size: 11px; } .hide-370 { display: none; } .navbar { position: static; } }
@media (max-width: 310px) { .content { padding: 0; } .col-country { display: none; } }
@media (max-width: 290px) { .col-protocol { display: none; } }
@media (max-width: 280px) { .col-build { display: none; } }
.shoutbox { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-alt); padding: 12px; margin-bottom: 16px; }
.sb-messages { max-height: 280px; overflow-y: auto; margin-bottom: 10px; font-size: 13px; line-height: 1.6; }
.sb-msg { padding: 2px 0; border-bottom: 1px solid var(--border); }
.sb-msg:last-child { border-bottom: none; }
.sb-time { color: var(--text-muted); font-family: monospace; font-size: 12px; }
.sb-nick { cursor: pointer; color: inherit; text-decoration: none; }
.sb-nick:hover { text-decoration: underline; }
.sb-ago { color: var(--text-muted); font-size: 11px; float: right; }
.sb-empty { color: var(--text-muted); font-style: italic; padding: 8px 0; }
.sb-form { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-form input[type="text"] { background: var(--bg-input); color: var(--text); border: 1px solid var(--border-light); padding: 6px 8px; font-size: 13px; border-radius: 4px; }
.sb-form input[name="nickname"] { width: 140px; flex-shrink: 0; }
.sb-form input[name="message"] { flex: 1; min-width: 150px; }
.sb-form button { background: var(--accent); color: var(--bg); border: none; padding: 6px 16px; font-size: 13px; font-weight: bold; cursor: pointer; border-radius: 4px; transition: box-shadow 0.15s ease; }
.sb-form button:hover { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45), inset 0 0 12px 2px rgba(255,255,255,0.12); }
/* ── Admin ── */
.admin-msg { padding: 8px 12px; margin: 8px 0; background: var(--bg-alt); border: 1px solid var(--accent); border-radius: 4px; font-size: 13px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.admin-actions .add-form { margin: 0; padding: 0; border: none; background: none; box-shadow: none; }
.admin-actions .add-form button { width: auto; display: inline; padding: 4px 10px; margin: 0; }
td .add-form { display: inline; margin: 0; padding: 0; border: none; background: none; box-shadow: none; }
td .add-form button { width: auto; display: inline; padding: 2px 8px; margin: 0; }
td .add-form + .add-form { margin-left: 4px; }
.navbar .add-form { margin: 0; padding: 0; border: none; background: none; box-shadow: none; display: inline; }
.navbar .add-form button { width: auto; display: inline; padding: 4px 10px; margin: 0; }
.login-form { max-width: 400px; margin: 100px auto; }
.login-form h1 { text-align: center; }
.login-error { color: var(--err); margin-bottom: 8px; text-align: center; font-size: 13px; }
