/* ==========================================================================
   Afterglow Wiki — tema "crepúsculo no ermo"
   ========================================================================== */
:root {
  --bg: #0d0b0a;
  --bg-2: #120f0d;
  --panel: #18130f;
  --panel-2: #1f1914;
  --panel-3: #2a221b;
  --line: #33291f;
  --line-2: #47392c;
  --text: #efe5d6;
  --text-2: #cdbfae;
  --muted: #9a8a78;
  --faint: #6e6154;
  --accent: #ffb347;
  --accent-2: #ff7a3d;
  --accent-3: #e8466f;
  --accent-ink: #1a1107;
  --scar: #b58cff;
  --rad: #a6d96a;
  --info: #62c6d9;
  --danger: #ff6159;
  --link: #ffc978;
  --link-hover: #ffe3b3;
  --glow: 0 0 0 1px rgba(255, 179, 71, .35), 0 6px 24px -8px rgba(255, 122, 61, .45);
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t0: #8f8378; --t1: #e3d4c0; --t2: #5fc9d9; --t3: #b58cff;
  --r-common: #bdb0a2; --r-uncommon: #8ed16f; --r-rare: #58b8ff; --r-epic: #b58cff; --r-legendary: #ffb347;
  --d-blunt: #d4ad84; --d-slash: #ff6f6f; --d-pierce: #ffc56e; --d-explosive: #ff8446; --d-chemical: #a6d96a; --d-energy: #62d9f0;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .85 0 0 0 0 .7 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4ede2;
  --bg-2: #efe6d8;
  --panel: #fbf6ee;
  --panel-2: #f5ecdf;
  --panel-3: #ecdfcc;
  --line: #e0d1bb;
  --line-2: #cdb999;
  --text: #2a2019;
  --text-2: #4a3c30;
  --muted: #7a6958;
  --faint: #a4927e;
  --accent: #c7660a;
  --accent-2: #d2491c;
  --accent-3: #b3264f;
  --accent-ink: #fff8ee;
  --scar: #6c46d9;
  --rad: #4c8a1d;
  --info: #1f7f93;
  --danger: #c0322a;
  --link: #a8520a;
  --link-hover: #7a3a04;
  --glow: 0 0 0 1px rgba(199, 102, 10, .35), 0 6px 20px -10px rgba(199, 102, 10, .45);
  --shadow: 0 10px 26px -18px rgba(80, 50, 20, .45);
  --t0: #8f8378; --t1: #8a6d4b; --t2: #1f8ea0; --t3: #6c46d9;
  --r-common: #8f8378; --r-uncommon: #4c8a1d; --r-rare: #1f6fb8; --r-epic: #6c46d9; --r-legendary: #c7660a;
  --d-blunt: #8a6440; --d-slash: #c0322a; --d-pierce: #a8680a; --d-explosive: #c24a14; --d-chemical: #4c8a1d; --d-energy: #1f7f93;
  --noise: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -140px, rgba(255, 122, 61, .16), transparent 70%),
    radial-gradient(900px 600px at 110% 110%, rgba(181, 140, 255, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: var(--noise);
  pointer-events: none;
  z-index: 0;
  opacity: .9;
}
:root[data-theme="light"] body {
  background: radial-gradient(1200px 520px at 50% -160px, rgba(255, 170, 90, .28), transparent 70%), var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--font-mono); font-size: .86em; font-variant-ligatures: none; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; color: var(--text-2); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: .01em; line-height: 1.15; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 6px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.ic.big { width: 40px; height: 40px; }
.ic.huge { width: 64px; height: 64px; color: var(--accent); }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.horizon {
  position: sticky; top: 62px; z-index: 29; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent-2) 50%, var(--accent-3) 78%, transparent);
  box-shadow: 0 0 18px 1px rgba(255, 122, 61, .55);
}
:root[data-theme="light"] .horizon { box-shadow: none; opacity: .8; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; color: var(--text); }
.logo-sun { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(255, 138, 61, .45)); }
.logo-sun .sun-cuts rect { fill: var(--bg); }
.brand-txt { display: flex; align-items: baseline; gap: 6px; }
.brand-txt b { font: 700 1.45rem/1 var(--font-head); letter-spacing: .14em; }
.brand-txt i { font: 400 .78rem/1 var(--font-mono); color: var(--accent); font-style: normal; letter-spacing: .08em; }
.search { position: relative; flex: 1; max-width: 620px; margin: 0 auto; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input, .big-search input, .hero-search input {
  width: 100%; height: 40px; padding: 0 44px 0 38px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 999px;
  font: inherit; font-size: .96rem;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus, .big-search input:focus, .hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.search kbd { position: absolute; right: 12px; font-size: .72rem; color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.ver { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 500 .78rem/1 var(--font-mono); padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.ver:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.theme-btn, .menu-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; }
.theme-btn:hover, .menu-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn { display: none; }
.lang { position: relative; }
.lang summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text-2); font: 600 .78rem/1 var(--font-mono); }
.lang summary::-webkit-details-marker { display: none; }
.lang[open] summary, .lang summary:hover { border-color: var(--accent); color: var(--accent); }
.lang-menu { position: absolute; right: 0; top: 46px; min-width: 230px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); z-index: 40; }
.lang-menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.lang-menu a b { font: 600 .74rem var(--font-mono); color: var(--muted); width: 22px; }
.lang-menu a:hover, .lang-menu a.active { background: var(--panel-2); text-decoration: none; }
.lang-menu a.active b { color: var(--accent); }
.lang-menu a.auto { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--muted); font-size: .88rem; }

/* suggestions */
.suggest { position: absolute; top: 46px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50; max-height: 70vh; overflow: auto; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.suggest a:hover, .suggest a.sel { background: var(--panel-2); text-decoration: none; }
.suggest a .s-kind { margin-left: auto; font: 500 .72rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.suggest a.all { color: var(--accent); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 4px; }
.suggest .s-empty { padding: 10px; color: var(--muted); font-size: .9rem; }
.suggest .thumb { width: 30px; height: 30px; }

/* ---------------------------------------------------------------- shell */
.shell { position: relative; z-index: 1; display: flex; width: 100%; max-width: 1480px; margin: 0 auto; flex: 1; }
.side { position: sticky; top: 64px; align-self: flex-start; width: 238px; flex: none; height: calc(100vh - 64px); overflow-y: auto; padding: 18px 10px 30px 16px; scrollbar-width: thin; }
.nav-group { margin-bottom: 16px; }
.nav-group h4 { font: 600 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin: 0 0 6px 10px; }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: .93rem; }
.nav-group a .ic { color: var(--muted); }
.nav-group a small { margin-left: auto; font: .7rem var(--font-mono); color: var(--faint); }
.nav-group a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-group a:hover .ic { color: var(--accent); }
.nav-group a.active { background: linear-gradient(90deg, rgba(255, 179, 71, .16), transparent); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-group a.active .ic { color: var(--accent); }
.main { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.main.full { padding-top: 0; }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); }
.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 22px 28px 30px; display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; font-size: .86rem; color: var(--text-2); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.foot-brand { display: flex; gap: 10px; align-items: center; max-width: 760px; }
.foot .logo-sun { width: 28px; height: 28px; flex: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; margin: 0 -28px 26px; padding: 64px 28px 44px; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero-sky { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #120c14 0%, #2a1320 38%, #5a2426 62%, #120d0b 100%); }
:root[data-theme="light"] .hero-sky { background: linear-gradient(180deg, #f7e2c4 0%, #f5c48d 45%, #ec9a64 70%, #f4ede2 100%); }
.hero-sky .sun {
  position: absolute; left: 50%; bottom: 26%; width: min(520px, 90vw); aspect-ratio: 1; transform: translate(-50%, 50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe08a 0%, #ffb347 30%, #ff7a3d 58%, #e8466f 82%, #a02a6a 100%);
  -webkit-mask: linear-gradient(#000 0 0) top/100% 50% no-repeat, repeating-linear-gradient(180deg, #000 0 16px, transparent 16px 22px) bottom/100% 50% no-repeat;
          mask: linear-gradient(#000 0 0) top/100% 50% no-repeat, repeating-linear-gradient(180deg, #000 0 16px, transparent 16px 22px) bottom/100% 50% no-repeat;
  filter: drop-shadow(0 0 60px rgba(255, 122, 61, .55));
  opacity: .5;
}
.hero-sky .grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 36%;
  background:
    linear-gradient(transparent 0 94%, rgba(255, 122, 61, .35) 94% 100%) 0 0/100% 34px,
    linear-gradient(90deg, transparent 0 97%, rgba(255, 122, 61, .3) 97% 100%) 0 0/60px 100%;
  transform: perspective(300px) rotateX(58deg); transform-origin: bottom;
  -webkit-mask: linear-gradient(transparent, #000 70%); mask: linear-gradient(transparent, #000 70%);
}
.hero-sky::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, var(--bg)); }
.hero-body { position: relative; max-width: 860px; margin: 0 auto; text-align: center; }
.hero-kicker { font: 600 .78rem var(--font-mono); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.hero-title { font: 700 clamp(3.2rem, 9vw, 6.6rem)/.9 var(--font-head); letter-spacing: .12em; margin: 0; display: inline-flex; align-items: baseline; gap: .12em; }
.hero-title span { background: linear-gradient(180deg, #fff6e4 0%, #ffd9a0 45%, #ff9a52 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(20, 8, 6, .55)) drop-shadow(0 6px 26px rgba(255, 122, 61, .35)); }
:root[data-theme="light"] .hero-title span { background: linear-gradient(180deg, #5a2a10, #a8400f); -webkit-background-clip: text; background-clip: text; filter: none; }
.hero-title em { font: 500 clamp(1rem, 2.6vw, 1.5rem) var(--font-mono); font-style: normal; color: var(--accent); letter-spacing: .1em; }
.hero-lede { font-size: 1.12rem; color: var(--text); max-width: 640px; margin: 14px auto 22px; text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 18px rgba(0, 0, 0, .75); }
:root[data-theme="light"] .hero-lede { text-shadow: 0 0 14px rgba(255, 245, 230, .9); }
.hero-kicker { text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hero-stats b, .hero-stats span { text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
:root[data-theme="light"] .hero-stats b, :root[data-theme="light"] .hero-stats span, :root[data-theme="light"] .hero-kicker { text-shadow: none; }
.hero-search { position: relative; display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.hero-search > .ic { position: absolute; left: 16px; top: 16px; color: var(--muted); }
.hero-search input { height: 52px; font-size: 1.05rem; padding-left: 44px; background: color-mix(in srgb, var(--panel) 92%, transparent); }
.hero-search .suggest { top: 58px; text-align: left; }
.hero-search button, .big-search button, .btn {
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font: 700 1rem var(--font-head); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 8px 24px -10px rgba(255, 122, 61, .8);
}
.btn { height: 38px; padding: 0 16px; font-size: .9rem; }
.btn:hover { filter: brightness(1.08); text-decoration: none; color: var(--accent-ink); }
.hero-status { margin: 18px auto 0; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font: .8rem var(--font-mono); color: var(--text-2); background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.hero-status .sep { color: var(--faint); }
.hero-status.warn { color: var(--accent); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--rad); box-shadow: 0 0 0 0 rgba(166, 217, 106, .7); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(166, 217, 106, .6); } 70% { box-shadow: 0 0 0 10px rgba(166, 217, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(166, 217, 106, 0); } }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin-top: 26px; }
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats b { font: 600 1.7rem/1 var(--font-mono); color: var(--text); }
.hero-stats span { font: 600 .72rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cat-group { margin-bottom: 26px; }
.cat-group h2, .side-box h2 { font-size: .84rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .2em; color: var(--muted); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.cat-group h2::after, .side-box h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 132px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.cat-tile::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; background: radial-gradient(circle, rgba(255, 138, 61, .12), transparent 70%); }
.cat-tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; color: var(--text); }
.ct-name { font: 600 1.18rem/1.1 var(--font-head); letter-spacing: .03em; }
.ct-count { position: absolute; top: 14px; right: 14px; font: .78rem var(--font-mono); color: var(--muted); }
.side-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.spot { display: flex; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); }
.spot:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.spot b { display: block; font: 600 1.05rem var(--font-head); }
.spot p { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.spot-kind { font: 600 .66rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.recent li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recent li > a:not(.diff-link) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { margin: 10px 0 0; font-size: .9rem; }

/* ---------------------------------------------------------------- thumbs */
.thumb { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, var(--panel-3), var(--bg-2) 75%); }
.thumb img { width: 88%; height: 88%; object-fit: contain; }
.thumb.ph { color: var(--faint); }
.thumb.ph .ic { width: 52%; height: 52%; }
.thumb.xs { width: 22px; height: 22px; border-radius: 6px; }
.thumb.sm { width: 36px; height: 36px; border-radius: 8px; }
.thumb.md { width: 48px; height: 48px; }
.thumb.lg { width: 72px; height: 72px; border-radius: 12px; }
.thumb.xl { width: 100%; aspect-ratio: 1; max-width: 240px; border-radius: 16px; }
.thumb.xl img { width: 80%; height: 80%; }
.thumb.tier-1 { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--t1) 55%, transparent); }
.thumb.tier-2 { box-shadow: inset 0 -2px 0 var(--t2); background: radial-gradient(circle at 50% 40%, rgba(95, 201, 217, .14), var(--bg-2) 75%); }
.thumb.tier-3 { box-shadow: inset 0 -2px 0 var(--t3); background: radial-gradient(circle at 50% 40%, rgba(181, 140, 255, .17), var(--bg-2) 75%); }
.thumb.rar-rare { box-shadow: inset 0 -2px 0 var(--r-rare); }
.thumb.rar-legendary { box-shadow: inset 0 -2px 0 var(--r-legendary); background: radial-gradient(circle at 50% 40%, rgba(255, 179, 71, .18), var(--bg-2) 75%); }
.thumb.xl.tier-2, .thumb.xl.tier-3, .thumb.xl.rar-legendary { box-shadow: inset 0 -3px 0 currentColor, 0 0 40px -14px currentColor; }
.thumb.xl.tier-2 { color: var(--t2); } .thumb.xl.tier-3 { color: var(--t3); } .thumb.xl.rar-legendary { color: var(--r-legendary); }
.thumb.xl.ph .ic { width: 40%; height: 40%; color: var(--line-2); }
.thumb.alt-img img { opacity: .92; }
.thumb.alt-img::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 7px; height: 7px; border-radius: 2px; background: var(--info); box-shadow: 0 0 6px var(--info); }
.thumb.xs.alt-img::after, .thumb.sm.alt-img::after { display: none; }
.thumb.ph[data-kind="enemy"] { color: color-mix(in srgb, var(--fc, var(--accent-2)) 70%, var(--muted)); }
.thumb.ph.fam-fauna { --fc: #d9a066; } .thumb.ph.fam-mimic { --fc: #a6d96a; } .thumb.ph.fam-machine { --fc: #62c6d9; }
.thumb.ph.fam-swarm { --fc: #f0d060; } .thumb.ph.fam-storm { --fc: #8fb0ff; } .thumb.ph.fam-temporal { --fc: #b58cff; }
.thumb.ph.fam-human { --fc: #ff8a5c; } .thumb.ph.fam-other { --fc: #9a8a78; }
.thumb.ph[data-kind="enemy"] { background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--fc) 16%, transparent), var(--bg-2) 72%); }
.thumb.ph.elite { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-3) 70%, transparent), 0 0 22px -8px var(--accent-3); }
.faction-mark { color: var(--fc) !important; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fc) 22%, transparent), var(--bg-2) 72%) !important; }
.faction-mark .ic { color: var(--fc) !important; }

/* ---------------------------------------------------------------- refs, chips, badges */
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.refs.tight { gap: 4px; }
.ref { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .88rem; line-height: 1.2; }
.ref .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref:hover { border-color: var(--accent); color: var(--text); text-decoration: none; box-shadow: var(--glow); }
.ref .thumb.xs { border-radius: 50%; }
.ref > .ic { margin-left: 4px; color: var(--muted); }
.ref.missing { color: var(--muted); border-style: dashed; }
.amt { font: 600 .78rem var(--font-mono); color: var(--accent); }
.note { font: .72rem var(--font-mono); color: var(--muted); }
.refs.tight .ref { font-size: .8rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 .72rem/1.4 var(--font-mono); letter-spacing: .04em; color: var(--text-2); background: var(--panel-2); white-space: nowrap; }
.badge.tier-0 { color: var(--t0); } .badge.tier-1 { color: var(--t1); } .badge.tier-2 { color: var(--t2); border-color: color-mix(in srgb, var(--t2) 45%, transparent); } .badge.tier-3 { color: var(--t3); border-color: color-mix(in srgb, var(--t3) 45%, transparent); }
.badge.rar-common { color: var(--r-common); } .badge.rar-uncommon { color: var(--r-uncommon); } .badge.rar-rare { color: var(--r-rare); border-color: color-mix(in srgb, var(--r-rare) 45%, transparent); } .badge.rar-epic { color: var(--r-epic); } .badge.rar-legendary { color: var(--r-legendary); border-color: color-mix(in srgb, var(--r-legendary) 45%, transparent); }
.badge.elite { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 55%, transparent); text-transform: uppercase; }
.badge.fac { font-family: var(--font-body); font-weight: 500; font-size: .78rem; }
.dmg { display: inline-flex; align-items: center; gap: 6px; font: 600 .78rem var(--font-mono); padding: 1px 8px 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--dc) 12%, transparent); color: var(--dc); border: 1px solid color-mix(in srgb, var(--dc) 35%, transparent); white-space: nowrap; }
.dmg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 8px var(--dc); }
.dmg-blunt { --dc: var(--d-blunt); } .dmg-slash { --dc: var(--d-slash); } .dmg-pierce { --dc: var(--d-pierce); } .dmg-explosive { --dc: var(--d-explosive); } .dmg-chemical { --dc: var(--d-chemical); } .dmg-energy { --dc: var(--d-energy); } .dmg-x { --dc: var(--muted); }
.kind-badge { display: inline-flex; align-items: center; gap: 4px; font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: .88rem; background: var(--panel); }
.chip small { font: .72rem var(--font-mono); color: var(--faint); }
.chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.chip.active { background: linear-gradient(180deg, rgba(255, 179, 71, .2), rgba(255, 122, 61, .12)); border-color: var(--accent); color: var(--text); }
.chip.active small { color: var(--accent); }
.uuid { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; }
.uuid code { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; }
.uuid:hover { color: var(--accent); }
.uuid.copied code { border-color: var(--rad); color: var(--rad); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: var(--sw); vertical-align: -3px; border: 1px solid var(--line-2); }

/* ---------------------------------------------------------------- article */
.art-head { margin-bottom: 8px; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 8px; }
.eyebrow .dot { color: var(--faint); font-style: normal; }
.art-head h1, .list-head h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 700; letter-spacing: .02em; }
.lede { color: var(--text-2); font-size: 1.05rem; margin: 8px 0 0; max-width: 820px; }
.list-head { margin-bottom: 18px; }
.list-head h1 { display: flex; align-items: center; gap: 12px; }
.h1-ic { width: 34px; height: 34px; color: var(--accent); }
.count { font: 500 .8rem var(--font-mono); color: var(--muted); vertical-align: middle; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 22px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .92rem; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.active .ic { color: var(--accent); }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.art-main { min-width: 0; }
.desc { font-size: 1.06rem; color: var(--text); max-width: 780px; }
.desc p { margin: 0 0 12px; }
.desc em { color: var(--text-2); }
.desc.story { font-size: 1.1rem; line-height: 1.7; border-left: 3px solid var(--accent-2); padding-left: 18px; margin: 10px 0 24px; }
.desc.quote, blockquote.quote { border-left: 3px solid var(--scar); padding: 4px 0 4px 16px; margin: 0 0 16px; color: var(--text-2); font-style: italic; }
.term { color: var(--link); border-bottom: 1px dotted color-mix(in srgb, var(--link) 60%, transparent); }
span.term { color: var(--text); border-bottom-color: var(--faint); }
.sec { margin: 26px 0; }
.sec > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.28rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 14px; }
.sec > h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px rgba(255, 122, 61, .6); }
.sec > h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.sec h3 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 600; letter-spacing: .04em; color: var(--text-2); margin: 18px 0 10px; }
.sec h3 .ic { color: var(--accent); }
.sec h4 { font-size: .9rem; color: var(--text-2); margin: 0 0 8px; letter-spacing: .04em; }
.note-box { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--scar) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--scar) 35%, var(--line)); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 18px; font-size: .92rem; }
.note-box.old-rev { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.note-box .ic { color: var(--accent); margin-top: 2px; }
.glance { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 18px; }
.glance-l { font: 600 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-right: 4px; }
.glance-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; border: 1px solid var(--line-2); color: var(--text-2); background: var(--panel); }
.glance-chip small { font: .7rem var(--font-mono); color: var(--accent); }
.glance-chip:hover { border-color: var(--accent); text-decoration: none; }

/* infobox */
.infobox { position: sticky; top: 84px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.ib-media { display: grid; place-items: center; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; font-size: .9rem; }
.kv dt { font: 600 .68rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 8px 0; border-top: 1px solid var(--line); }
.kv dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv.wide { max-width: 760px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; margin-bottom: 20px; }
.big { font: 700 1.3rem var(--font-mono); color: var(--danger); }

/* range bar */
.range { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.tbl .range { min-width: 120px; }
.rg-track { position: relative; height: 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.rg { position: absolute; top: 0; bottom: 0; }
.rg.ok { background: linear-gradient(90deg, #5fbf6a, var(--rad)); }
.rg.far { background: repeating-linear-gradient(45deg, var(--accent) 0 4px, color-mix(in srgb, var(--accent) 55%, transparent) 4px 8px); }
.rg.close { background: repeating-linear-gradient(45deg, var(--danger) 0 4px, color-mix(in srgb, var(--danger) 45%, transparent) 4px 8px); }
.rg-ticks { position: relative; height: 16px; font: .64rem var(--font-mono); color: var(--muted); }
.rg-ticks i { position: absolute; transform: translateX(-50%); font-style: normal; top: 2px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: transform .12s, border-color .12s, box-shadow .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; color: var(--text); }
.c-name { font: 600 .95rem/1.15 var(--font-head); letter-spacing: .02em; }
.c-sub { font-size: .74rem; color: var(--muted); line-height: 1.2; }
.card .amt { position: absolute; top: 8px; right: 10px; }
.group-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.group-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.group-tile:hover { border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; color: var(--text); }
.gt-pics { display: flex; gap: 6px; min-height: 38px; margin-bottom: 4px; }
.gt-name { font: 600 1.15rem var(--font-head); letter-spacing: .03em; }
.gt-count { font: .76rem var(--font-mono); color: var(--muted); }
.skill-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.skill-card { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto 1fr auto; column-gap: 12px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.skill-card .thumb { grid-row: 1 / 4; }
.skill-card:hover { border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; color: var(--text); }
.sk-name { font: 600 1.02rem var(--font-head); }
.sk-desc { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.sk-lv { font: .7rem var(--font-mono); color: var(--accent); margin-top: 4px; }
.faction-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.faction-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px 76px; min-height: 100px; background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 12%, var(--panel)), var(--panel) 60%); border: 1px solid color-mix(in srgb, var(--fc) 30%, var(--line)); border-radius: var(--radius); color: var(--text); overflow: hidden; }
.faction-card:hover { border-color: var(--fc); box-shadow: 0 0 0 1px var(--fc), 0 10px 30px -14px var(--fc); text-decoration: none; color: var(--text); }
.fc-mark { position: absolute; left: 16px; top: 18px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--fc) 18%, transparent); color: var(--fc); }
.fc-mark .ic { width: 26px; height: 26px; }
.fc-name { font: 700 1.2rem var(--font-head); letter-spacing: .03em; }
.fc-sub { font-size: .82rem; color: var(--muted); }
.fc-cur { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-2); margin-top: 4px; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { position: sticky; top: 0; background: var(--panel-2); text-align: left; font: 600 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl.sortable th { cursor: pointer; user-select: none; }
.tbl.sortable th:hover { color: var(--text); }
.tbl th.sorted-asc::after { content: " ▲"; color: var(--accent); }
.tbl th.sorted-desc::after { content: " ▼"; color: var(--accent); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tbl .num { text-align: right; font-family: var(--font-mono); font-size: .84rem; white-space: nowrap; }
.row-name { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 180px; }
.row-name b { font-weight: 600; display: block; }
.row-name small { display: block; font-size: .76rem; }
.row-name:hover { text-decoration: none; }
.row-name:hover b { color: var(--accent); }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .84rem; color: var(--text-2); max-width: 480px; }
.recipes-tbl td { vertical-align: top; }

/* filter */
.filter { position: relative; display: flex; align-items: center; max-width: 420px; margin: 0 0 16px; }
.filter .ic { position: absolute; left: 12px; color: var(--muted); }
.filter input { width: 100%; height: 38px; padding: 0 90px 0 36px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); font: inherit; font-size: .92rem; }
.filter input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.filter-count { position: absolute; right: 12px; font: .74rem var(--font-mono); color: var(--muted); }
[data-hidden] { display: none !important; }

/* recipes */
.recipes { display: grid; gap: 10px; }
.recipe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.rc-title { display: inline-flex; align-items: center; gap: 6px; font: 600 1rem var(--font-head); letter-spacing: .03em; margin-bottom: 8px; color: var(--text); }
.rc-title .ic { color: var(--accent); }
.rc-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-in, .rc-out { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-arrow { color: var(--accent); }
.rc-arrow .ic { width: 22px; height: 22px; }
.rc-out .ref { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.rc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.rc-meta .meta { display: inline-flex; align-items: center; gap: 4px; }
.recipe-big .recipe { padding: 18px; border-color: var(--line-2); background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.recipe-big .rc-flow { gap: 16px; }

/* crafting tree */
.tree-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 18px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 13px; padding-left: 16px; border-left: 1px dashed var(--line-2); }
.tree li { position: relative; padding: 4px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -16px; top: 17px; width: 12px; border-top: 1px dashed var(--line-2); }
.t-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: 8px; font-size: .78rem; color: var(--muted); }
.t-rec { display: inline-flex; align-items: center; gap: 4px; }
.t-rec .ic { color: var(--accent); }
.t-alt { font-size: .74rem; }
.hint { margin-left: 8px; font-size: .8rem; color: var(--muted); }
.hint-k { font: 600 .66rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.leaf > .ref { border-style: dashed; }
.raw-total { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; align-self: start; }
.raw-total h4 { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.raw-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.raw-list li { display: flex; flex-wrap: wrap; align-items: center; }
.hint-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hint-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* matchups */
.matchup { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.mu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.mu h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 600; font-size: .88rem; color: var(--text); }
.mu.good { border-top: 3px solid var(--rad); }
.mu.bad { border-top: 3px solid var(--danger); }
.ok-mark { color: var(--rad); font-weight: 600; }

/* quests */
.chain { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.chain > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.chain .chain-now { display: flex; align-items: center; gap: 8px; border-color: var(--accent); box-shadow: var(--glow); font-family: var(--font-head); font-size: 1.05rem; }
.chain .chain-now .ic { color: var(--accent); }
.reward.xp { display: inline-flex; align-items: center; gap: 6px; }
.reward.xp b { font: 600 .8rem var(--font-mono); color: var(--rad); }
.lore { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lore li { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--scar); border-radius: 10px; padding: 12px 16px; }
.lore p { margin: 4px 0 0; }
.lore-n { font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--scar); }
.abilities { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.abilities li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.msgs { margin: 0; padding-left: 20px; color: var(--text-2); font-style: italic; }
.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.option { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.opt-head { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.opt-head p { margin: 0; }
.opt-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font: 700 .95rem var(--font-head); }
.opt-req { margin: 10px 0 0 40px; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0 40px; }
.outcome { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .92rem; color: var(--text-2); }
.outcome b { display: block; font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 4px; }
.outcome p { margin: 0; }
.outcome.ok b { color: var(--rad); } .outcome.bad b { color: var(--danger); }
.story-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.story-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.story-item a { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.story-item a:hover { text-decoration: none; }
.story-item a:hover b { color: var(--accent); }
.story-item b { font: 600 1.08rem var(--font-head); letter-spacing: .02em; }
.story-item span { font-size: .86rem; color: var(--muted); }
.story-item:hover { border-color: var(--line-2); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.link-list a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.link-list a .ic { color: var(--accent); }
.link-list a .muted { margin-left: auto; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list a:hover { border-color: var(--accent); text-decoration: none; }
.title-rows { display: grid; gap: 8px; }
.title-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.title-row:hover { border-color: var(--tc); text-decoration: none; color: var(--text); }
.tr-name { font: 700 1.15rem var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--tc); text-shadow: 0 0 14px color-mix(in srgb, var(--tc) 50%, transparent); min-width: 200px; }
.tr-desc { flex: 1; font-size: .88rem; color: var(--muted); }
.title-preview { display: grid; place-items: center; padding: 34px 20px; margin-bottom: 16px; border-radius: var(--radius); background: radial-gradient(circle, color-mix(in srgb, var(--tc) 14%, var(--panel)), var(--bg-2)); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--line)); }
.title-preview span { font: 700 2.2rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--tc); text-shadow: 0 0 24px var(--tc); }

/* guide */
.guide { max-width: 800px; font-size: 1.04rem; }
.guide h2 { font-size: 1.3rem; margin: 26px 0 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.guide p { margin: 0 0 10px; }
.guide-list { margin: 0 0 12px; padding-left: 20px; }
.guide-list li { margin: 4px 0; }
.guide-list li::marker { color: var(--accent); }

/* dialogue */
.dlg-meta { display: flex; flex-wrap: wrap; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.dlg-meta h4 { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.dialogue { display: grid; gap: 18px; max-width: 900px; }
.dlabel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.dlabel h3 { font: 600 .82rem var(--font-mono); color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.dlabel h3 code { color: var(--accent); background: none; border: 0; padding: 0; font-size: .9rem; }
.tilde { color: var(--accent-3); }
.lab-who { margin-left: 6px; font-family: var(--font-body); }
.dline { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 6px 0; }
.dline .spk { font: 700 .92rem var(--font-head); letter-spacing: .04em; color: hsl(var(--h) 75% 70%); text-align: right; padding-top: 1px; }
:root[data-theme="light"] .dline .spk { color: hsl(var(--h) 55% 38%); }
.dline .spk a { color: inherit; }
.dline.narr, .dline.sys { grid-template-columns: 1fr; padding-left: 132px; }
.dline.narr .dtxt { color: var(--text-2); font-style: italic; }
.dline.sys { font-size: .82rem; }
.dtxt p { margin: 0 0 4px; }
.dtxt .act, .dline.narr em { color: var(--muted); font-style: italic; }
.dline.player .spk { color: var(--accent); }
.dchoice { margin: 6px 0 6px 132px; }
.dchoice > .opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--panel)); color: var(--text); font-weight: 500; }
.dchoice > .opt > .ic { color: var(--accent); }
.branch { margin: 6px 0 6px 10px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.dchoice .branch .dline { grid-template-columns: 108px 1fr; }
.dchoice .branch .dline.narr, .dchoice .branch .dline.sys { padding-left: 120px; }
.dchoice .branch .dchoice { margin-left: 120px; }
.dcond { margin: 8px 0; border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 10px; }
.dcond > .chead { font-size: .82rem; color: var(--text-2); margin-bottom: 4px; }
.dcond > .chead b { font: 700 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--scar); margin-right: 4px; }
.dcond .cw { color: var(--info); }
.dcond .branch { margin-left: 0; }
.dtag { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 999px; font: 600 .7rem var(--font-mono); border: 1px solid var(--line-2); color: var(--muted); }
.dtag.ok { color: var(--rad); border-color: color-mix(in srgb, var(--rad) 45%, transparent); }
.dtag.quest { color: var(--scar); border-color: color-mix(in srgb, var(--scar) 45%, transparent); }
.dtag.item { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dtag.end { color: var(--faint); }
.djump { display: inline-block; margin-top: 4px; font: .74rem var(--font-mono); color: var(--info); }
.djump.end { color: var(--faint); }
.uuid-inline { font-size: .7rem; }
.dlg-embed summary, .raw-src summary, .img-folder summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 8px 0; }
.dlg-embed[open] summary { margin-bottom: 12px; }
pre.raw { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: auto; max-height: 540px; white-space: pre-wrap; color: var(--text-2); }

/* JSON */
pre.json { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow: auto; font-size: .8rem; line-height: 1.5; color: var(--text-2); }
.jk { color: var(--info); } .js { color: var(--rad); } .jn { color: var(--accent); } .jb { color: var(--scar); }

/* search results */
.big-search { position: relative; display: flex; gap: 8px; max-width: 720px; margin: 0 0 16px; }
.big-search > .ic { position: absolute; left: 14px; top: 16px; color: var(--muted); }
.big-search input { height: 50px; padding-left: 42px; font-size: 1.02rem; }
.big-search button { height: 50px; }
.big-search .suggest { top: 56px; }
.results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; max-width: 900px; }
.result a { display: flex; gap: 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.result a:hover { border-color: var(--accent); box-shadow: var(--glow); text-decoration: none; }
.r-body { min-width: 0; }
.r-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.r-title b { font: 600 1.1rem var(--font-head); letter-spacing: .02em; }
.r-snip { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.pg { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--text-2); font: .86rem var(--font-mono); }
.pg:hover { border-color: var(--accent); text-decoration: none; }
.pg.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pg.gap { border: 0; }

/* changes & history */
.snap { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 18px; }
.snap-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.snap-id { font: 700 1.3rem var(--font-mono); color: var(--accent); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; }
.snap-meta h2 { font-size: 1.4rem; }
.snap-meta h2 small { font: .8rem var(--font-mono); color: var(--muted); margin-left: 8px; }
.snap-sub { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.snap-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cnt { font: 600 .74rem var(--font-mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); }
.cnt-c { color: var(--rad); } .cnt-ed { color: var(--accent); } .cnt-d { color: var(--danger); } .cnt-rs { color: var(--scar); }
.chg-kind { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.chg-kind h4 { display: flex; align-items: center; gap: 6px; font-size: .95rem; color: var(--text-2); margin-bottom: 6px; }
.chg-kind h4 .ic { color: var(--accent); }
.chg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .9rem; }
.chg-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chg-list .sum { color: var(--muted); font-size: .8rem; }
.created-bulk span { color: var(--text-2); }
.chg { display: inline-flex; align-items: center; gap: 4px; font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.chg .ic { width: .95em; height: .95em; }
.chg-create { color: var(--rad); } .chg-edit { color: var(--accent); } .chg-delete { color: var(--danger); } .chg-restore { color: var(--scar); }
.diff-link { font: .74rem var(--font-mono); color: var(--info); }
.hist td.radios { white-space: nowrap; }
.hist .sum { font-size: .82rem; color: var(--muted); }
.hist .acts { white-space: nowrap; }
.hist-form .btn { margin-top: 12px; }
.dhead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.dside { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.dside h4 { font-size: 1rem; margin-bottom: 4px; }
.dside p { margin: 0; font-size: .86rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.darrow { color: var(--accent); }
.difftbl th { width: 26%; }
.difftbl tbody th { text-transform: none; letter-spacing: 0; color: var(--text-2); vertical-align: top; }
.linediff, pre.json, pre.raw { font-variant-ligatures: none; }
.difftbl td.old { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.difftbl td.new { background: color-mix(in srgb, var(--rad) 6%, transparent); }
.difftbl tr.d-added td.old, .difftbl tr.d-removed td.new { background: none; }
del { background: color-mix(in srgb, var(--danger) 26%, transparent); color: var(--text); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); border-radius: 3px; }
ins { background: color-mix(in srgb, var(--rad) 24%, transparent); color: var(--text); text-decoration: none; border-radius: 3px; }
.hunks { display: grid; gap: 12px; }
.linediff { width: 100%; border-collapse: collapse; font: .78rem/1.5 var(--font-mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.linediff td { padding: 1px 8px; vertical-align: top; }
.linediff td.ln { width: 1%; color: var(--faint); text-align: right; user-select: none; border-right: 1px solid var(--line); }
.linediff td.code { white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.linediff tr.l-del td.code { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.linediff tr.l-add td.code { background: color-mix(in srgb, var(--rad) 12%, transparent); }
.img-diff { display: flex; gap: 20px; flex-wrap: wrap; }
.img-diff figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.img-diff img { width: 160px; height: 160px; object-fit: contain; }
.img-diff figcaption { font: 600 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.file-hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.file-hist li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.fh-pic { width: 48px; height: 48px; object-fit: contain; }
.img-folder { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; margin-bottom: 8px; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; padding: 8px 0 12px; }
.pic-grid a { display: grid; place-items: center; aspect-ratio: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.pic-grid a:hover { border-color: var(--accent); }
.pic-grid img { width: 80%; height: 80%; object-fit: contain; }
.lost { text-align: center; padding: 60px 20px; max-width: 640px; margin: 0 auto; }
.lost h1 { font-size: 2.4rem; margin: 12px 0; }
.lost p { color: var(--text-2); }
.lost .big-search { margin: 20px auto; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1180px) {
  .home-cols { grid-template-columns: 1fr; }
  .art-grid { grid-template-columns: minmax(0, 1fr) 260px; }
  .tree-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .ver { display: none; }
  .search kbd { display: none; }
  .side { position: fixed; top: 64px; left: 0; height: calc(100vh - 64px); height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; z-index: 25; width: 280px; background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  /* a camada escura fica no mesmo contexto de empilhamento do menu (.shell),
     logo abaixo dele; no nível do body ela cobria o menu e engolia os toques */
  body.nav-open .shell::after { content: ""; position: fixed; inset: 64px 0 0 0; background: rgba(0, 0, 0, .45); z-index: 20; }
  .main { padding: 16px 16px 50px; }
  .hero { margin: 0 -16px 22px; padding: 44px 16px 30px; }
  .art-grid { grid-template-columns: 1fr; }
  .infobox { position: static; order: -1; }
  .art-main { order: 2; }
  .thumb.xl { max-width: 160px; }
  .outcomes { grid-template-columns: 1fr; margin-left: 0; }
  .opt-req { margin-left: 0; }
  .chain, .dhead { grid-template-columns: 1fr; }
  .darrow { transform: rotate(90deg); justify-self: center; }
}
@media (max-width: 640px) {
  .top { gap: 8px; padding: 0 10px; }
  .brand-txt { display: none; }
  .lang summary span { display: none; }
  .dline { grid-template-columns: 1fr; gap: 2px; }
  .dline .spk { text-align: left; }
  .dline.narr, .dline.sys, .dchoice, .dchoice .branch .dline.narr, .dchoice .branch .dline.sys, .dchoice .branch .dchoice { padding-left: 0; margin-left: 0; }
  .dchoice .branch .dline { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  .hero-search button { display: none; }
  .foot { padding: 18px 16px 26px; }
  .story-list, .link-list { grid-template-columns: 1fr; }
  .tr-name { min-width: 0; }
  .title-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* mini-mapa de coordenadas */
.nowrap { white-space: nowrap; }
.cm-wrap { width: 100%; }
.coord-map { width: 100%; height: auto; display: block; }
.cm-bg { fill: var(--bg-2); stroke: var(--line); }
.cm-dot { fill: var(--line-2); }
.cm-known { fill: var(--faint); opacity: .8; }
.cm-line { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 4 3; opacity: .8; }
.cm-mark circle { fill: var(--accent); }
.cm-mark .cm-halo { fill: color-mix(in srgb, var(--accent) 25%, transparent); }
.cm-finish circle { fill: var(--scar); }
.cm-finish .cm-halo { fill: color-mix(in srgb, var(--scar) 25%, transparent); }
.cm-npc circle { fill: var(--rad); }
.cm-npc .cm-halo { fill: color-mix(in srgb, var(--rad) 22%, transparent); }
.cm-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: .78rem; color: var(--text-2); }
.cm-leg { display: inline-flex; align-items: center; gap: 5px; }
.cm-leg i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.cm-leg.cm-finish i { background: var(--scar); } .cm-leg.cm-npc i { background: var(--rad); }
.cm-leg code { font-size: .7rem; }
.cm-note { margin: 6px 0 0; font-size: .7rem; color: var(--faint); }
.infobox .ref { white-space: normal; }
.infobox .ref .nm { white-space: normal; overflow: visible; }

/* ---------------------------------------------------------------- mapa interativo */
.main.map-main { padding: 14px 18px 18px; }
.map-head { margin-bottom: 10px; }
.map-head h1 { font-size: 1.9rem; }
.map-wrap { position: relative; z-index: 0; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px;
  height: calc(100vh - 64px - 118px); height: calc(100dvh - 64px - 118px); min-height: 460px; }
.map-canvas { border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: #0b0908; box-shadow: var(--shadow); }
.map-canvas.leaflet-container { background: #0b0908; font-family: var(--font-body); outline: none; }
:root[data-theme="light"] .map-canvas.leaflet-container { background: #e8dcc9; }
.map-far .map-marker-quest .mk-label, .map-far .map-marker-mention .mk-label, .map-far .map-marker-npc .mk-label { display: none; }
.map-very-far .mk-label { font-size: .74rem; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--text); border-bottom-color: var(--line); }
.leaflet-bar { border: 1px solid var(--line-2) !important; box-shadow: var(--shadow) !important; }
.map-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.map-search { position: relative; display: flex; align-items: center; }
.map-search .ic { position: absolute; left: 11px; color: var(--muted); }
.map-search input { width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: .9rem; }
.map-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.map-toggles { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--text-2); }
.map-toggles input { accent-color: var(--accent); }
.map-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .84rem; color: var(--text-2); }
.map-legend li { display: flex; align-items: center; gap: 8px; }
.map-info { border-top: 1px solid var(--line); padding-top: 12px; }
.map-info h4 { font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 12px 0 6px; }
.map-info ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.map-info li { margin: 3px 0; }
.hex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hex-head b { font: 700 1.25rem var(--font-head); letter-spacing: .03em; }
.hex-coords { font-size: .8rem; color: var(--muted); width: 100%; }
.hex-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hex-actions .chip { cursor: pointer; font: inherit; font-size: .82rem; }
.map-source { margin: auto 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
.mk { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(20, 12, 6, .9); box-shadow: 0 0 0 2px rgba(255, 240, 210, .35), 0 2px 6px rgba(0, 0, 0, .6); }
.mk-city { background: var(--accent); width: 16px; height: 16px; border-radius: 4px; transform: rotate(45deg); }
.mk-npc { background: var(--rad); }
.mk-quest { background: var(--scar); }
.mk-mention { background: var(--info); width: 10px; height: 10px; }
.map-marker { position: relative; }
.map-marker .mk { position: absolute; left: 1px; top: 1px; }
.map-marker-mention .mk { left: 3px; top: 3px; }
.mk-label { position: absolute; left: 22px; top: -2px; white-space: nowrap; font: 700 .86rem var(--font-head); letter-spacing: .04em;
  color: #fff3dc; text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 10px rgba(0, 0, 0, .8); pointer-events: none; }
.map-marker-quest .mk-label, .map-marker-mention .mk-label { font-size: .76rem; font-weight: 600; opacity: .92; }
.map-link { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; margin-top: 4px; }
.map-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }

.map-panel-title { display: flex; align-items: center; gap: 8px; font: 600 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0; }
.map-panel-title .ic { color: var(--accent); width: 18px; height: 18px; }
.thumb.xl.portrait { aspect-ratio: 4 / 5; max-width: 260px; margin-bottom: 12px; }
.thumb.xl.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ==========================================================================
   Eventos ao vivo (coletor do servidor do jogo)
   ========================================================================== */
.nav-group a small.live-count { color: var(--accent-ink); background: var(--rad); border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.live-actions .chip { cursor: pointer; font: inherit; font-size: .88rem; }
.live-actions .chip .ic { width: 16px; height: 16px; color: var(--accent); }
.live-actions .chip.on { border-color: var(--rad); color: var(--text); background: color-mix(in srgb, var(--rad) 12%, var(--panel)); }
.live-actions .chip.on .ic { color: var(--rad); }
.live-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: .8rem var(--font-mono); color: var(--text-2); margin: 0 0 18px; }
.live-status .dot, .ev-where .dot, .ev-time .dot { color: var(--faint); font-style: normal; }
.note-box.warn { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.note-box .ic { flex: none; }
.empty-state { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--panel); }
.ev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ev-card { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ev-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--info); }
.ev-card.ev-elite::before { background: var(--accent-3); }
.ev-card .thumb { flex: none; }
.ev-body { min-width: 0; display: grid; gap: 4px; }
.ev-kind { font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--info); }
.ev-elite .ev-kind { color: var(--accent-3); }
.ev-body h3 { margin: 0; font: 700 1.25rem/1.15 var(--font-head); letter-spacing: .02em; }
.ev-where, .ev-time, .ev-extra { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .88rem; color: var(--text-2); }
.ev-where .map-link { margin: 0; }
.ev-where code { font-size: .8rem; }
.ev-time .ic { width: 15px; height: 15px; color: var(--accent); }
.ev-time time { font-weight: 600; color: var(--text); }
time.cd.soon { color: var(--danger) !important; }
time.cd.over { color: var(--muted) !important; text-decoration: line-through; }
.ev-extra { font-size: .82rem; }
.badge.warn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.zone { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font: 600 .74rem/1.5 var(--font-mono); border: 1px solid; white-space: nowrap; }
.zone b { font-weight: 700; }
.zone-green { color: #6fd07a; border-color: rgba(111, 208, 122, .45); background: rgba(111, 208, 122, .1); }
.zone-yellow { color: #e9c44a; border-color: rgba(233, 196, 74, .5); background: rgba(233, 196, 74, .1); }
.zone-red { color: #ff6f5e; border-color: rgba(255, 111, 94, .5); background: rgba(255, 111, 94, .1); }
:root[data-theme="light"] .zone-green { color: #2f7d38; } :root[data-theme="light"] .zone-yellow { color: #8a6a00; } :root[data-theme="light"] .zone-red { color: #b8321f; }
.ev-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ev-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ev-row:last-child { border-bottom: 0; }
.ev-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ev-row-main .map-link { margin: 0; }
.ev-row-end { display: grid; justify-items: end; gap: 2px; font-size: .84rem; white-space: nowrap; }
.live-about p { max-width: 820px; color: var(--text-2); }
.live-box h2 .pulse { flex: none; }
.home-live { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.home-live li { display: flex; gap: 10px; align-items: flex-start; }
.home-live li > span { display: grid; gap: 2px; min-width: 0; font-size: .9rem; }
.home-live small { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.home-live .ic { width: 14px; height: 14px; color: var(--accent); }
.live-alert { margin: 0 0 20px; padding: 14px; border: 1px solid color-mix(in srgb, var(--rad) 40%, var(--line)); border-radius: var(--radius);
  background: color-mix(in srgb, var(--rad) 7%, var(--panel)); display: grid; gap: 10px; }
.live-alert h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 600 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .16em; color: var(--rad); }
.live-alert .ev-card { background: var(--panel); }
.live-src { display: flex; align-items: center; gap: 6px; }
.live-src .ic { width: 15px; height: 15px; color: var(--rad); }

/* mapa: marcadores de evento, legenda e painel ao vivo */
.mk-ev { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--info); border: 2px solid #fff3dc; box-shadow: 0 0 0 3px rgba(98, 198, 217, .35); }
.mk-ev-elite { background: var(--accent-3); box-shadow: 0 0 0 3px rgba(232, 70, 111, .35); }
.lg-zone .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid; flex: none; }
.map-ev .ev-dot { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--info); border: 2px solid #fff3dc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .7); animation: ev-ping 2s infinite; }
.map-ev-elite .ev-dot { background: var(--accent-3); animation-name: ev-ping-elite; }
.map-ev .ev-dot img { width: 100%; height: 100%; object-fit: cover; }
.map-ev .mk-label { left: 30px; top: 2px; color: #d9f6ff; }
.map-ev-elite .mk-label { color: #ffd0dc; }
@keyframes ev-ping { 0% { box-shadow: 0 0 0 0 rgba(98, 198, 217, .75), 0 2px 8px rgba(0, 0, 0, .7); } 80%, 100% { box-shadow: 0 0 0 14px rgba(98, 198, 217, 0), 0 2px 8px rgba(0, 0, 0, .7); } }
@keyframes ev-ping-elite { 0% { box-shadow: 0 0 0 0 rgba(232, 70, 111, .8), 0 2px 8px rgba(0, 0, 0, .7); } 80%, 100% { box-shadow: 0 0 0 14px rgba(232, 70, 111, 0), 0 2px 8px rgba(0, 0, 0, .7); } }
@media (prefers-reduced-motion: reduce) { .map-ev .ev-dot, .pulse { animation: none; } }
.hex-live { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.map-info .hl-title { color: var(--rad); }
.hl-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: .88rem; }
.hl-dl dt { color: var(--muted); }
.hl-dl dd { margin: 0; display: grid; gap: 2px; }
.hl-dl dd small { color: var(--text-2); font-size: .78rem; }
.hl-dl dd > .zone { justify-self: start; }
.map-info ul.ev-ul { list-style: none; padding: 0; }
.ev-li { display: flex; gap: 8px; align-items: flex-start; }
.ev-li .mk-ev { margin-top: 4px; }
.note-box.small { font-size: .82rem; margin: 0 0 10px; }
@media (max-width: 700px) {
  .ev-cards { grid-template-columns: 1fr; }
  .ev-card { padding: 12px; gap: 10px; }
  .ev-card .thumb.lg { width: 64px; height: 64px; }
  .ev-row { flex-wrap: wrap; }
  .ev-row-end { justify-items: start; }
}
.where { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.where .dot { color: var(--faint); font-style: normal; }
.where .map-link { margin: 0; }
.lg-zone .sw.zone-green { background: rgba(84, 190, 96, .55); }
.lg-zone .sw.zone-yellow { background: rgba(236, 196, 60, .6); }
.lg-zone .sw.zone-red { background: rgba(226, 72, 58, .6); }
.live-box h2 { flex-wrap: wrap; }
.live-box h2::after { display: none; }
.live-box h2 .count { margin-left: auto; letter-spacing: .04em; text-transform: none; white-space: nowrap; color: var(--rad); }
/* batedor e área não liberada */
.mk-scout { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 4px; background: var(--rad);
  border: 2px solid #10200a; box-shadow: 0 0 0 2px rgba(166, 217, 106, .45), 0 2px 6px rgba(0, 0, 0, .6); }
.map-scout .mk-scout { position: absolute; left: 1px; top: 1px; }
.map-scout .mk-label { left: 24px; color: #e4f7cf; font-size: .78rem; }
.map-legend .sw.locked { width: 14px; height: 14px; border-radius: 3px; flex: none; background: rgba(10, 6, 4, .8); border: 1px solid var(--line-2); }
.hl-seen { color: var(--rad); }
.live-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -8px 0 18px; font-size: .92rem; color: var(--text-2); }
.live-reset .ic { width: 16px; height: 16px; color: var(--accent); }
.live-reset b { color: var(--text); }

/* painel do mapa: cabeçalho e legenda recolhível (computador) */
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-grab, .sheet-toggle { display: none; }
.map-legend-box > summary { cursor: pointer; font: 600 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.map-legend-box > summary::marker { color: var(--accent); }

/* celular: mapa em tela cheia + gaveta inferior */
@media (max-width: 900px) {
  body.map-page { overflow: hidden; overscroll-behavior: none; }
  body.map-page .foot, body.map-page .crumbs { display: none; }
  body.map-page .map-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .main.map-main { padding: 0; }
  .map-wrap { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; height: auto; min-height: 0; display: block; overflow: hidden; }
  .map-canvas { position: absolute; inset: 0; border: 0; border-radius: 0; box-shadow: none; }
  .map-panel {
    --peek: 112px;
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; max-height: 64%; gap: 12px;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; border-bottom: 0;
    overflow: hidden; overscroll-behavior: contain; box-shadow: 0 -14px 34px -14px rgba(0, 0, 0, .8);
    transform: translateY(calc(100% - var(--peek) - env(safe-area-inset-bottom))); transition: transform .22s ease;
  }
  body.map-panel-open .map-panel { transform: none; overflow-y: auto; }
  .sheet-head { position: sticky; top: 0; z-index: 2; margin: 0 -14px; padding: 16px 14px 4px; background: var(--panel);
    touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .sheet-grab { display: block; position: absolute; top: 6px; left: 50%; width: 44px; height: 5px; margin-left: -22px;
    border-radius: 3px; background: var(--line-2); }
  .sheet-toggle { display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -6px -6px 0; border-radius: 12px;
    border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); cursor: pointer; }
  .sheet-toggle .ic { width: 20px; height: 20px; transition: transform .2s; }
  body.map-panel-open .sheet-toggle .ic { transform: rotate(180deg); }
  .map-search input { height: 44px; font-size: 16px; } /* 16px: o iOS não dá zoom ao focar */
  /* o que foi tocado vem logo depois da busca; camadas e legenda depois */
  .map-panel > .sheet-head { order: 0; }
  .map-panel > .map-search { order: 1; }
  .map-panel > [data-live-stale] { order: 2; margin: 0; }
  .map-panel > .map-info { order: 3; }
  .map-panel > .map-toggles { order: 4; }
  .map-panel > .map-legend-box { order: 5; }
  .map-panel > .map-source { order: 6; }
  .map-info { border-top: 0; padding-top: 0; }
  .map-toggles { gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
  .map-toggles label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); }
  .map-toggles input { width: 18px; height: 18px; margin: 0; }
  .map-legend-box { border-top: 1px solid var(--line); padding-top: 10px; }
  .map-legend-box > summary { padding: 6px 0; margin: 0; }
  .map-legend { margin-top: 8px; }
  .hex-actions .chip { min-height: 40px; }
  .map-source { margin: 0; }
}
@media (max-width: 900px) and (pointer: coarse) {
  .map-canvas .leaflet-control-zoom { display: none; } /* zoom com dois dedos */
}
/* nomes dos eventos só com o mapa aproximado (muitos pontos de interesse se sobrepõem) */
.map-mid .map-ev .mk-label, .map-mid .map-scout .mk-label { display: none; }
