/* Self-hosted (was Google Fonts CDN — see LEGAL.md, dropped for GDPR /
   Landgericht München I 2022 reasons: loading fonts from Google's CDN
   sends every visitor's IP to Google on every page load). Variable font,
   Latin subset only (covers English + German incl. äöüß) — matches what
   fonts.googleapis.com was already serving for this site's font-family
   declarations, just fetched once instead of from Google at request time. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/press-start-2p-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:        #0c0f14;
  --bg-tex:    #11151b;
  --panel:     #1f262e;
  --panel-2:   #283039;
  --slot:      #0e1318;
  --edge:      #07090c;
  --text:      #e9edf2;
  --muted:     #98a3b2;
  --bev-hi:    rgba(255,255,255,.08);
  --bev-lo:    rgba(0,0,0,.55);

  --accent:    #3ba7ff;
  --accent-d:  #2b86d6;
  --accent-2:  #5ad16a;

  --rarity-common:    #c2ccd8;
  --rarity-uncommon:  #5ad16a;
  --rarity-rare:      #3ba7ff;
  --rarity-legendary: #f0a93b;
  --rarity-mythic:    #c777ff;

  --grass:  #6cbf4b; --grass-d: #54a23a;
  --dirt:   #7c5333; --dirt-d:  #5f3f27;

  --shadow:    0 14px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 6px 16px rgba(0,0,0,.4);
  --radius:    10px;
  --radius-sm: 7px;
  --maxw:      1140px;
  --nav-h:     64px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-pixel:'Press Start 2P', 'Inter', monospace;
}

[data-theme="light"] {
  --bg:        #d7dbe1;
  --bg-tex:    #cfd3da;
  --panel:     #cbcfd6;
  --panel-2:   #d9dce1;
  --slot:      #8f949c;
  --edge:      #4f545b;
  --text:      #171c24;
  --muted:     #545d6b;
  --bev-hi:    rgba(255,255,255,.85);
  --bev-lo:    rgba(0,0,0,.28);

  --accent:    #1f7fd6;
  --accent-d:  #1668b4;
  --accent-2:  #2f9e44;

  --rarity-common:    #4a5360;
  --rarity-uncommon:  #2f9e44;
  --rarity-rare:      #1f7fd6;
  --rarity-legendary: #b9760f;
  --rarity-mythic:    #8b3fce;

  --shadow:    0 14px 30px rgba(40,60,90,.18);
  --shadow-sm: 0 6px 14px rgba(40,60,90,.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.65;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-tex) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-tex) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); }
img { max-width: 100%; display: block; }
h1,h2,h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.kicker {
  font-family: var(--font-pixel); font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); display: inline-block; margin-bottom: 14px;
}
.mc-head {
  font-family: var(--font-pixel); font-size: clamp(.9rem, 2vw, 1.15rem);
  letter-spacing: .02em; line-height: 1.5; margin: 0 0 22px;
}

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: .94rem; color: var(--text);
  padding: 12px 20px; border: 2px solid var(--edge); border-radius: var(--radius-sm);
  background: var(--panel-2);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
  cursor: pointer; transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--edge);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.28), inset -2px -2px 0 rgba(0,0,0,.32);
}
.btn-primary:hover { color: #fff; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel);
  border-bottom: 3px solid var(--edge);
  box-shadow: inset 0 2px 0 var(--bev-hi);
}
.nav { height: var(--nav-h); display: flex; align-items: center; gap: 16px; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .cube { width: 30px; height: 30px; flex: none; image-rendering: pixelated; }
.brand .name { font-family: var(--font-pixel); font-size: .68rem; letter-spacing: .01em; line-height: 1.5; }
.brand .name small { display: block; font-family: var(--font-body); font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 4px; }

.nav-links { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 700; font-size: .88rem; padding: 8px 12px; border-radius: 6px; border: 2px solid transparent; }
.nav-links a:hover { color: var(--text); background: var(--slot); }

.nav-link-disabled {
  color: var(--muted); font-weight: 700; font-size: .88rem; padding: 8px 12px;
  border-radius: 6px; border: 2px solid transparent; opacity: .4; cursor: default;
  display: inline-flex; align-items: center; gap: 11px;
}
.footer-col .nav-link-disabled { display: block; padding: 4px 0; }
a.brand.nav-link-disabled, span.brand.nav-link-disabled { cursor: default; }
.nav-links a.active {
  color: var(--accent); background: var(--slot); border-color: var(--edge);
  box-shadow: inset 1px 1px 0 var(--bev-lo);
}
.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.nav-search {
  display: flex; align-items: center; gap: 8px; color: var(--muted);
  background: var(--slot); border: 2px solid var(--edge); border-radius: 6px; padding: 7px 10px; margin-right: 6px;
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
}
.nav-search svg { width: 15px; height: 15px; flex: none; }
.nav-search input { border: 0; background: transparent; color: var(--text); outline: none; font-size: .85rem; width: 150px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; color: var(--text);
  background: var(--panel-2); border: 2px solid var(--edge); border-radius: 7px;
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
  cursor: pointer; transition: filter .15s, transform .1s;
}
.icon-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }
.hamburger { display: none; }

.hero { position: relative; padding: 70px 0 0; }
.hero-panel {
  position: relative; max-width: 760px;
  background: var(--panel); border: 3px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -3px -3px 0 var(--bev-lo), var(--shadow);
  padding: 34px 34px 38px;
}
.hero-badge { width: 56px; height: 56px; margin-bottom: 18px; image-rendering: pixelated; }
.hero-title { font-family: var(--font-pixel); font-size: clamp(1.25rem, 4.2vw, 2.3rem); line-height: 1.45; margin: 0 0 14px; }
.hero-title span { color: var(--accent); }
.hero-sub { font-family: var(--font-pixel); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 16px; }
.hero-text { font-size: 1.08rem; color: var(--muted); max-width: 560px; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.ground {
  height: 30px; margin-top: 46px;
  background-color: var(--dirt);
  background-image:
    linear-gradient(var(--grass) 0 7px, transparent 7px),
    repeating-linear-gradient(90deg, var(--dirt) 0 10px, var(--dirt-d) 10px 11px),
    repeating-linear-gradient(90deg, var(--grass) 0 10px, var(--grass-d) 10px 11px);
  background-size: 100% 100%, 100% 100%, 100% 7px;
  background-repeat: no-repeat;
  border-top: 3px solid var(--edge); border-bottom: 3px solid var(--edge);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.25);
}

.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.slot-card {
  display: flex; flex-direction: column; gap: 4px; color: var(--text);
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
  padding: 18px 18px 20px; position: relative; overflow: hidden;
  transition: transform .12s, filter .15s;
}
.slot-card::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--ac, var(--accent)); opacity: .9; }
.slot-card:hover { transform: translateY(-3px); filter: brightness(1.07); color: var(--text); }
.slot-ico {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--slot); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
  color: var(--ac, var(--accent));
}
.slot-ico svg { width: 30px; height: 30px; }
.slot-name { font-weight: 800; font-size: 1.1rem; }
.slot-desc { color: var(--muted); font-size: .9rem; }
.slot-card .arrow { margin-top: 12px; color: var(--ac, var(--accent)); font-weight: 700; font-size: .85rem; }

.board {
  background: var(--slot); border: 3px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
  padding: 10px 12px; max-width: 640px;
}
.board-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 2px solid var(--edge); }
.board-row:last-child { border-bottom: 0; }
.board-row .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 2px solid var(--edge); }
.dot.done { background: var(--rarity-uncommon); }
.dot.wip  { background: var(--rarity-legendary); }
.dot.plan { background: var(--muted); }
.board-row .label { font-weight: 700; }
.board-row .state { margin-left: auto; font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.section { padding: 60px 0; }
.section-head { margin-bottom: 30px; max-width: 660px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
  padding: 22px;
}
a.card { color: var(--text); display: block; transition: transform .12s, filter .15s; }
a.card:hover { transform: translateY(-3px); filter: brightness(1.07); }
.card-ico {
  width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 15px; color: var(--accent);
  background: var(--slot); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
}
.card-ico svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.16rem; margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; font-size: .93rem; }
.card .arrow { margin-top: 13px; color: var(--accent); font-weight: 700; font-size: .88rem; display: inline-flex; gap: 6px; }

.placeholder {
  background: var(--slot); border: 2px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
  padding: 30px 24px; color: var(--muted); text-align: center;
}
.placeholder .tag {
  font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .1em; color: var(--rarity-legendary);
  border: 2px solid var(--edge); border-radius: 6px; padding: 6px 9px; display: inline-block; margin-bottom: 12px;
  background: color-mix(in srgb, var(--rarity-legendary) 14%, transparent);
}
.placeholder h3 { color: var(--text); }
.skel { display: grid; gap: 10px; margin-top: 8px; }
.skel-row { height: 12px; border-radius: 4px; background: var(--panel); border: 1px solid var(--edge); opacity: .7; }
.skel-row.w-80 { width: 80%; } .skel-row.w-60 { width: 60%; } .skel-row.w-40 { width: 40%; }

.page-head { padding: 50px 0 8px; }
.page-head h1 { font-family: var(--font-pixel); font-size: clamp(1.2rem, 3.4vw, 1.9rem); line-height: 1.5; }
.page-head p { color: var(--muted); max-width: 640px; }

.searchbar {
  display: flex; align-items: center; gap: 10px; max-width: 560px; color: var(--muted);
  background: var(--slot); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi); padding: 12px 16px;
}
.searchbar svg { width: 18px; height: 18px; flex: none; }
.searchbar input { border: 0; background: transparent; color: var(--text); font-size: 1rem; width: 100%; outline: none; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 28px; }
.pill {
  padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: .84rem; cursor: pointer; color: var(--muted);
  background: var(--panel-2); border: 2px solid var(--edge);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
}
.pill:hover { color: var(--text); filter: brightness(1.1); }
.pill.active { color: var(--accent); box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi); }

.map-frame {
  aspect-ratio: 16 / 9; border: 3px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-lo), inset -2px -2px 0 var(--bev-hi);
  display: grid; place-items: center; text-align: center; color: var(--muted);
  background-color: var(--slot);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 39px, var(--edge) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--edge) 39px 40px);
}

.map-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 4px 0 16px; padding: 12px 16px;
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
}
.map-toolbar label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.map-toolbar input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.map-toolbar .btn { padding: 8px 14px; }
.map-toolbar .sep { flex: 1; }
.map-wrap { width: 100%; height: min(74vh, 680px); border-radius: var(--radius); overflow: hidden; position: relative; isolation: isolate; }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 20px; }

.leaflet-container { background: var(--slot); font-family: var(--font-body); }
.leaflet-div-icon { background: transparent; border: 0; }
.cc-pin {
  display: block; width: 100%; height: 100%; background: var(--c, var(--accent));
  border: 2px solid var(--edge); border-radius: 3px; transform: rotate(45deg);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.45), inset -1px -1px 0 rgba(0,0,0,.4);
}
.cc-ico-img { width: 100%; height: 100%; image-rendering: pixelated; }
.cc-pin.found { filter: grayscale(1); opacity: .4; }
.no-previews .leaflet-tooltip { display: none !important; }
.leaflet-tooltip {
  background: var(--panel) !important; color: var(--text) !important; border: 2px solid var(--edge) !important;
  box-shadow: var(--shadow-sm) !important; border-radius: 6px !important; font-weight: 700;
}
.leaflet-tooltip-top::before { border-top-color: var(--edge) !important; }
.cc-thumb {
  width: 160px; max-width: 46vw; display: block; border-radius: 4px;

  aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-2, rgba(0,0,0,.2));
}
.cc-tip.has-img { text-align: center; padding: 4px !important; }
.cc-tip .cc-tip-name { display: block; font-weight: 700; }
.cc-tip.has-img .cc-tip-name { margin-top: 5px; font-size: .8rem; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel) !important; color: var(--text) !important; box-shadow: var(--shadow) !important; }
.leaflet-popup-content-wrapper { border: 2px solid var(--edge) !important; border-radius: var(--radius-sm) !important; }
.cc-pop-h { font-family: var(--font-pixel); font-size: .62rem; line-height: 1.5; color: var(--c, var(--accent)); margin-bottom: 8px; }
.cc-pop-img { width: 190px; max-width: 100%; border-radius: 6px; margin-bottom: 6px; }
.cc-pop-coords { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.cc-found-btn {
  font-weight: 700; cursor: pointer; padding: 8px 12px; border-radius: 6px; color: var(--text);
  background: var(--panel-2); border: 2px solid var(--edge);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo);
}
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--edge) !important; }
.leaflet-bar a:hover { filter: brightness(1.15); }
.leaflet-control-layers {
  background: var(--panel) !important; color: var(--text) !important; border: 2px solid var(--edge) !important;
  border-radius: var(--radius-sm) !important; padding: 8px 10px !important;
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo) !important;
}
.leaflet-control-layers label { font-weight: 600; margin: 4px 0; display: flex; align-items: center; }
.cc-leg { display: inline-block; width: 12px; height: 12px; background: var(--c); border: 2px solid var(--edge); border-radius: 3px; transform: rotate(45deg); margin: 0 8px 0 4px; }

.cc-edge-layer { position: absolute; inset: 0; z-index: 650; pointer-events: none; }
.cc-edge { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; pointer-events: auto; cursor: pointer; }
.cc-edge-ic { display: grid; place-items: center; width: 26px; height: 26px; color: var(--c, var(--accent)); filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.cc-edge-ic svg { width: 22px; height: 22px; }
.cc-edge-lbl { display: none; font-size: .72rem; font-weight: 700; color: var(--text); background: var(--panel); border: 2px solid var(--edge); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.cc-edge:hover .cc-edge-lbl { display: block; }

.site-footer { border-top: 3px solid var(--edge); background: var(--panel); box-shadow: inset 0 3px 0 var(--bev-hi); margin-top: 40px; padding: 46px 0 28px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.footer-brand { max-width: 320px; }
.footer-brand .name { font-family: var(--font-pixel); font-size: .66rem; }
.footer-brand .name small { display: block; font-family: var(--font-body); font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-pixel); font-size: .55rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--text); padding: 4px 0; font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.credits-note { margin-top: 32px; padding-top: 20px; border-top: 2px solid var(--edge); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.credits-note .tag { font-family: var(--font-pixel); font-size: .48rem; color: var(--rarity-legendary); border: 2px solid var(--edge); padding: 5px 8px; border-radius: 6px; }

@media (max-width: 1024px) {
  .inv-grid, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--panel); border-bottom: 3px solid var(--edge); padding: 12px; margin: 0;
    transform: translateY(-140%); transition: transform .25s; box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-search { width: 100%; margin: 0 0 8px; }
  .nav-search input { width: 100%; }
  .nav-tools { margin-left: auto; }
  .hamburger { display: grid; }
}
@media (max-width: 560px) {
  .inv-grid, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .brand .name small { display: none; }
  .hero { padding-top: 44px; }
  .hero-panel { padding: 26px 22px 30px; }
}

.map-shell { display: flex; gap: 0; max-width: none; margin: 0; padding: 0; align-items: stretch; height: calc(100vh - var(--nav-h)); }
.map-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.map-wrap { flex: 1 1 auto; width: 100%; height: auto; min-height: 0; border-radius: 0; overflow: hidden; }

.map-sidebar {
  width: 290px; flex: none; background: var(--panel);
  border: 0; border-right: 1px solid var(--edge); border-radius: 0;
  box-shadow: 7px 0 18px -12px rgba(0,0,0,.5);
  padding: 18px 16px 28px; overflow-y: auto;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; }
.sb-title { font-family: var(--font-pixel); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.sb-close { display: none; width: 32px; height: 32px; font-size: 1.3rem; line-height: 1; background: var(--panel-2); border: 2px solid var(--edge); border-radius: 7px; color: var(--text); cursor: pointer; }
.sb-section { margin-top: 16px; }
.sb-section h4 { font-family: var(--font-pixel); font-size: .54rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.sb-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.select-all, .hide-found { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.hide-found { margin: 8px 0 10px; }
.map-sidebar input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.region-list { display: flex; flex-direction: column; gap: 4px; }
.region-row { text-align: left; padding: 8px 10px; border-radius: 7px; border: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; font-size: .88rem; cursor: pointer; }
.region-row:hover { background: var(--slot); color: var(--text); }
.region-row.active { background: var(--slot); color: var(--accent); border-color: var(--edge); box-shadow: inset 1px 1px 0 var(--bev-lo); }

.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 7px; }
.cat-row:hover { background: var(--slot); }
.cat-eye { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px; }
.cat-eye:hover { color: var(--text); }
.cat-eye:not(.on) { opacity: .45; }
.cat-eye svg { width: 18px; height: 18px; }
.cat-eye .eye-on, .cat-eye .eye-off { display: none; }
.cat-eye.on .eye-on { display: block; }
.cat-eye:not(.on) .eye-off { display: block; }
.cat-dot { width: 11px; height: 11px; flex: none; background: var(--c); border: 2px solid var(--edge); border-radius: 3px; transform: rotate(45deg); }
.cat-name { flex: 1; font-weight: 700; font-size: .9rem; }
.cat-count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cat-chk { flex: none; }
.cat-chk:disabled { opacity: .3; cursor: not-allowed; }

.map-titlebar { display: flex; align-items: center; gap: 12px; margin: 0; padding: 11px 18px; background: var(--panel); border-bottom: 1px solid var(--edge); flex-wrap: wrap; }
.dim-title { display: flex; align-items: center; gap: 10px; }
.dim-name { font-family: var(--font-pixel); font-size: clamp(.8rem, 2vw, 1rem); letter-spacing: .04em; color: var(--text); }
.dim-switch { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--edge); border-radius: 8px; color: var(--accent); cursor: pointer; box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo); }
.dim-switch:hover { filter: brightness(1.14); }
.dim-switch svg { width: 20px; height: 20px; }
.map-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.map-tools .mini { display: flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.map-tools .mini input { width: 16px; height: 16px; accent-color: var(--accent); }
.filter-pins-btn { display: none; }

.account-btn { font-size: .82rem; padding: 9px 13px; gap: 7px; }

.account-select { position: relative; }
.account-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 220px; max-width: calc(100vw - 28px);
  padding: 6px; background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo), var(--shadow);
}
.account-menu[hidden] { display: none; }
.account-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border: 2px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); cursor: pointer; font: inherit; font-size: .85rem;
}
.account-item:hover { background: var(--slot); }
.account-item-danger { color: #d6493b; }

.lang-select { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 5px; width: auto; min-width: 40px; padding: 0 10px; }
.lang-btn svg { width: 19px; height: 19px; }
.lang-btn .lang-code { font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .04em; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 248px; max-width: calc(100vw - 28px); max-height: min(64vh, 460px); overflow-y: auto;
  padding: 6px; background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius-sm);
  box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo), var(--shadow);
}
.lang-menu[hidden] { display: none; }
.lang-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 10px; border: 2px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); cursor: pointer; font: inherit;
}
.lang-item:hover { background: var(--slot); }
.lang-flag { font-size: 1.15rem; line-height: 1; width: 22px; height: 19px; display: grid; place-items: center; text-align: center; flex: none; color: var(--muted); }
.lang-flag svg { width: 18px; height: 18px; }
.lang-names { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.lang-native { font-weight: 700; font-size: .9rem; }
.lang-en { color: var(--muted); font-size: .72rem; }
.lang-check { color: var(--accent); flex: none; display: grid; place-items: center; }
.lang-check svg { width: 16px; height: 16px; display: block; }
.lang-div { height: 2px; background: var(--edge); margin: 6px 4px; border-radius: 2px; opacity: .8; }

@media (max-width: 1024px) {
  .map-shell { display: block; height: auto; padding: 0; }
  .map-col { display: block; }
  .map-titlebar { padding: 12px 14px; }
  .map-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw; max-height: 100vh;
    border: 0; border-right: 2px solid var(--edge); border-radius: 0; z-index: 1200;
    transform: translateX(-110%); transition: transform .25s; box-shadow: var(--shadow);
  }
  .map-sidebar.open { transform: translateX(0); }
  .sb-close { display: grid; place-items: center; }
  .filter-pins-btn { display: inline-flex; }
  .map-wrap { flex: none; height: calc(100vh - var(--nav-h) - 120px); min-height: 380px; }
}

.aug-count { font-family: var(--font-pixel); font-size: .62rem; letter-spacing: .05em; color: var(--accent); margin-top: 10px; display: inline-block; }
.filter-label { font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.pill .pill-n { opacity: .55; font-size: .82em; margin-left: 3px; }
.aug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 14px; margin-top: 6px; }
.aug-card { background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo); padding: 14px 16px; }
.aug-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.aug-name { font-weight: 800; font-size: 1.02rem; }
.aug-eff { color: var(--muted); font-size: .9rem; margin: 0 0 11px; line-height: 1.5; }
.aug-gear { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); border-top: 2px solid var(--edge); padding-top: 9px; }
.aug-flag { color: var(--rarity-legendary); }
.aug-rarity { font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; border: 2px solid var(--edge); white-space: nowrap; }

.aug-card.r-common    .aug-name { color: var(--rarity-common); }
.aug-card.r-uncommon  .aug-name { color: var(--rarity-uncommon); }
.aug-card.r-rare      .aug-name { color: var(--rarity-rare); }
.aug-card.r-legendary .aug-name { color: var(--rarity-legendary); }
.aug-card.r-mythical  .aug-name { color: var(--rarity-mythic); }
.aug-card.r-unknown   .aug-name { color: var(--text); }

.aug-rarity.r-common    { color: var(--rarity-common);    background: color-mix(in srgb, var(--rarity-common) 18%, transparent); }
.aug-rarity.r-uncommon  { color: var(--rarity-uncommon);  background: color-mix(in srgb, var(--rarity-uncommon) 16%, transparent); }
.aug-rarity.r-rare      { color: var(--rarity-rare);      background: color-mix(in srgb, var(--rarity-rare) 16%, transparent); }
.aug-rarity.r-legendary { color: var(--rarity-legendary); background: color-mix(in srgb, var(--rarity-legendary) 16%, transparent); }
.aug-rarity.r-mythical  { color: var(--rarity-mythic);  background: color-mix(in srgb, var(--rarity-mythic) 16%, transparent); }
.aug-rarity.r-unknown   { color: var(--muted); }
.aug-piece { font-weight: 700; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 5px; padding: 1px 6px; }

.cc-map-tiles { image-rendering: pixelated; }

.legal-page { max-width: 760px; padding: 20px 0 80px; }
.legal-page h2 { font-size: 1.25rem; margin-top: 2.2em; }
.legal-page h3 { font-size: 1.02rem; margin-top: 1.6em; color: var(--text); }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.65; }
.legal-page ul, .legal-page ol { padding-left: 1.3em; margin: .6em 0 1.2em; }
.legal-page li { margin-bottom: .45em; }
.legal-page strong { color: var(--text); }
.legal-page table { width: 100%; border-collapse: collapse; margin: 1em 0 1.6em; font-size: .92rem; }
.legal-page th, .legal-page td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--edge); vertical-align: top; }
.legal-page th { color: var(--text); font-weight: 700; }
.legal-page td { color: var(--muted); }
.legal-updated { color: var(--muted); font-size: .85rem; margin-top: -.6em; }
.legal-toc { background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); padding: 14px 18px; margin: 1.4em 0; box-shadow: inset 2px 2px 0 var(--bev-hi), inset -2px -2px 0 var(--bev-lo); }
.legal-toc p { margin: 0 0 6px; font-weight: 700; color: var(--text); }
.legal-toc ol { margin: 0; padding-left: 1.2em; columns: 2; }
.legal-flag { background: color-mix(in srgb, var(--rarity-legendary, #ffb020) 14%, var(--panel)); border: 2px solid var(--rarity-legendary, #ffb020); border-radius: var(--radius); padding: 14px 18px; margin: 1em 0 1.6em; }
.legal-flag p { color: var(--text); margin: 0 0 6px; }
.legal-flag p:last-child { margin-bottom: 0; }
.legal-flag .legal-flag-tag { display: inline-block; font-family: var(--font-pixel); font-size: .55rem; letter-spacing: .06em; text-transform: uppercase; color: var(--rarity-legendary, #ffb020); margin-bottom: 8px; }
