/**
 * GTA 6 mega-map instance styles — companion to rb-gta6-mega-map-plugin.js.
 *
 * Everything here is scoped to the GTA mount (.pkmega[data-game-slug="gta-6"])
 * or to plugin-emitted rbgta- classes; zero effect on any other game. Enqueued
 * by map/RB-GTA6-WorldMap.php with deps [rb-mega-map-engine].
 *
 * Tracker design = the ER Option B pattern (2026-09-01 canvas
 * reports/designs/er-tracker-panel): neutral glass section headers, category
 * color carried by a glowing dot + the progress fill, labels always bright;
 * group filter = the Pokemon rail segmented control (dark inset track + glossy
 * sliding indicator, rb-mega-map.css:962-967).
 *
 * Engine-owned (nothing to restate here): row / check / locate chrome, the rail
 * search field (.pkmega-rail-search), focus rings, the rail-tab hover neutralizer,
 * and the 44px bottom-sheet floors. Colours read the engine --mm-* tokens.
 */

/* ── Brand badge: palm-sunset tile (original art) replaces the engine Pokeball ── */
.pkmega[data-game-slug="gta-6"] .pkmega-brand-badge {
    background: #1a0f1e url("gta6-map-badge.png") center / cover no-repeat;
    border: 1px solid #8a3d63;
    box-sizing: border-box;
}
.pkmega[data-game-slug="gta-6"] .pkmega-brand-badge::after { content: none; }

/* ── Organized completion tracker ──
   The plugin buildChecklistSections hook re-renders every trackable category
   as collapsible, filterable sections. The engine skips its own generic
   duplicates through the clGameOwnsSections payload flag (CACHE_VER 3); this
   scoped hide is the belt-and-braces for a still-cached pre-v3 payload and is
   gated on rbgta-cl-owned (set only after a successful decode) — if the plugin
   JS ever fails to load or decode, the class is absent and the stock sections
   stay visible. */
.pkmega.rbgta-cl-owned[data-game-slug="gta-6"] .pkmega-cl-section { display: none; }

/* Filter bar (sticky over the scrolling checklist body) */
.rbgta-cl-chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
    padding: 8px 12px;
    position: sticky; top: 0; z-index: 2;
    background: var(--mm-panel-bg, rgba(16, 19, 26, 0.96));
    backdrop-filter: var(--mm-panel-blur);
    -webkit-backdrop-filter: var(--mm-panel-blur);
    border-bottom: 1px solid var(--mm-line, rgba(255, 255, 255, 0.08));
}

/* Group filter: Pokemon rail segmented control (engine .pkmega-rail-tabs twin).
   Semantics = toggle buttons in a group (aria-pressed), like the bag chips. */
.rbgta-seg {
    display: flex; position: relative; align-items: stretch; gap: 3px; padding: 3px;
    flex: 1 1 100%; min-width: 0;
    border-radius: 11px; background: rgba(6, 8, 13, 0.55);
    border: 1px solid var(--mm-line, rgba(255, 255, 255, 0.10));
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.rbgta-seg-slider {
    position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; z-index: 0;
    border-radius: 8px; background: linear-gradient(180deg, #f3f7ff, #dde8fb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.28, 0.42, 1), width 0.4s cubic-bezier(0.34, 1.28, 0.42, 1);
}
.rbgta-seg-tab {
    all: unset; box-sizing: border-box; cursor: pointer; position: relative; z-index: 1;
    flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--mm-font, system-ui, sans-serif);
    font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
    color: var(--mm-ink-2, rgba(255, 255, 255, 0.66));
    padding: 6px; min-height: 36px; min-width: 0; border-radius: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color 0.22s ease;
}
/* Explicit hover background: the RB2 theme ships a global
   button:hover { background: #48C9B0 } (style.css:1178) whose 0,1,1
   specificity beats the class-only unset background — declare ours. */
.rbgta-seg-tab:hover { color: var(--mm-ink, #fff); background: rgba(255, 255, 255, 0.07); }
/* outline !important counters the theme global :focus { outline: 0 !important } */
.rbgta-seg-tab:focus-visible { outline: 2px solid var(--mm-accent, #6aa9ff) !important; outline-offset: 2px; }
.rbgta-seg-tab[aria-pressed="true"] { color: #16243d; font-weight: 800; }
/* Never paint over the glossy slider under the active tab */
.rbgta-seg-tab[aria-pressed="true"]:hover { background: transparent; }

/* Hide-done toggle (rides row 2, right-aligned) */
.rbgta-chip {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: inline-flex; align-items: center;
    min-height: 36px; padding: 0 12px; margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px;
    background: rgba(255, 255, 255, 0.05); color: var(--mm-ink-2, #cbd5e1);
    font: 600 11.5px/1 var(--mm-font, system-ui, sans-serif); letter-spacing: 0.03em;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rbgta-chip:hover { background: rgba(255, 255, 255, 0.1); color: var(--mm-ink, #f1f5f9); }
.rbgta-chip:focus-visible { outline: 2px solid var(--mm-accent, #6aa9ff) !important; outline-offset: 2px; }
.rbgta-chip[aria-pressed="true"] { background: #166534; border-color: #22c55e; color: #fff; }

/* Filtered-empty message (JS toggles `hidden` after every filter change) */
.rbgta-cl-none { padding: 16px 12px; text-align: center; font-size: 12.5px; color: var(--mm-ink-2, rgba(255, 255, 255, 0.66)); }
.rbgta-cl-none[hidden] { display: none; }

/* Category sections — Option B: neutral glass head, color in the dot + fill */
.rbgta-cl-sec { padding: 0 12px; }
.rbgta-cl-sec .pkmega-cl-method--toggle.rbgta-cl-head {
    gap: 8px; margin: 10px 0 2px; padding: 7px 9px;
    border-radius: 9px; min-height: 36px;
}
.rbgta-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--mc, #a1a1aa); box-shadow: 0 0 8px var(--mc, #a1a1aa);
}
.rbgta-cl-name {
    flex: 1; min-width: 0; font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--mm-ink, #e4e4e7);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rbgta-cl-head .pkmega-cl-progress-bar {
    flex: none; width: 64px; margin: 0;
    background: rgba(255, 255, 255, 0.09);
}
.rbgta-cl-head .pkmega-cl-progress-fill { background: var(--mc, #a1a1aa); }
.rbgta-cl-head .pkmega-cl-section-count {
    min-width: 38px; text-align: right;
    font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, 0.62);
    font-variant-numeric: tabular-nums;
}
.rbgta-cl-head .pkmega-cl-method-arrow { font-size: 9px; color: rgba(255, 255, 255, 0.45); margin-left: 2px; }

/* ── Database rail tab (data-mega-inv) ── */
.rbgta-inv { padding: 10px 12px; }
.rbgta-inv-bar { margin-bottom: 10px; }
/* sunset accent for the Database bar via one custom property (set inline on the wrapper) */
.rbgta-inv-bar .pkmega-cl-global-label,
.rbgta-inv-bar .pkmega-cl-global-pct { color: var(--mc, #ff9d5c); }
.rbgta-inv-bar .pkmega-cl-global-fill { background: var(--mc, #ff9d5c); }
/* Search field + row checkbox / locate button: engine-styled
   (rb-mega-map.css .pkmega-rail-search, .pkmega-cl-check[role=checkbox],
   .pkmega-cl-locate) — nothing instance-specific to add. */
/* Catalog-only rows (a category no progress bar counts, e.g. districts) keep
   the column alignment with an inert spacer where the checkbox would be. */
.rbgta-inv-check--none { visibility: hidden; pointer-events: none; }
.rbgta-inv-seg { margin-bottom: 8px; }
.rbgta-inv-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; padding: 4px 2px; }
.rbgta-inv-head .rbgta-inv-match { flex: none; font-size: 11px; font-weight: 700; color: var(--mm-ink-2, rgba(255, 255, 255, 0.66)); }
.rbgta-inv-head .pkmega-cl-section-count { min-width: 38px; text-align: right; font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, 0.62); font-variant-numeric: tabular-nums; }
/* "Show N more" — a real button (RB2 button reset + explicit hover background) */
.rbgta-inv-more {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: block; width: 100%; min-height: 36px; margin: 2px 0 6px; padding: 0 8px;
    border-radius: 8px; text-align: left;
    font: 600 12px/1 var(--mm-font, system-ui, sans-serif); color: var(--mm-accent, #6aa9ff);
}
.rbgta-inv-more:hover { background: rgba(255, 255, 255, 0.06); }
.rbgta-inv-more:focus-visible { outline: 2px solid var(--mm-accent, #6aa9ff) !important; outline-offset: 2px; }
.rbgta-inv-empty { padding: 16px 2px; font-size: 13px; color: rgba(255, 255, 255, 0.5); }

/* Group filter: a selected group tab shows only that group of sections */
.rbgta-cl[data-f="Activities"] .rbgta-cl-sec:not([data-g="Activities"]),
.rbgta-cl[data-f="Collectibles"] .rbgta-cl-sec:not([data-g="Collectibles"]),
.rbgta-cl[data-f="Shops"] .rbgta-cl-sec:not([data-g="Shops"]),
.rbgta-cl[data-f="Places"] .rbgta-cl-sec:not([data-g="Places"]) { display: none; }

/* Hide-done: completed rows vanish; fully-completed sections vanish whole —
   except rows ticked since the last filter / area change (.rbgta-keep), which
   stay visible and struck through so the tick is seen landing. */
.rbgta-cl.rbgta-hd .pkmega-cl-row--done { display: none; }
.rbgta-cl.rbgta-hd .pkmega-cl-row--done.rbgta-keep { display: flex; }
.rbgta-cl.rbgta-hd .rbgta-cl-sec[data-done="1"] { display: none; }

/* Bottom-sheet band: the rail is a touch sheet from 768px down (engine
   rb-mega-map.css @media 768), so the filter controls take the 44px floor there. */
@media (max-width: 768px) {
    .rbgta-cl-chips { gap: 8px; }
    .rbgta-seg-tab { min-height: 44px; }
    .rbgta-chip { min-height: 44px; padding: 0 14px; }
    .rbgta-inv-more { min-height: 44px; }
    /* The 36px desktop head rule above (0,3,0) outranks the engine's 480px
       floor on .pkmega-cl-method--toggle (0,1,0) — restate the floor here. */
    .rbgta-cl-sec .pkmega-cl-method--toggle.rbgta-cl-head { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .rbgta-seg-slider { transition: none; }
    .rbgta-chip { transition: none; }
}

/* CC BY 4.0 attribution strip for the community basemap (RB_GTA6_BASEMAP === 'yanis15').
   Dormant since 2026-11-19: the base is the official Rockstar map ('official'), which prints no strip.
   Sits inside .pkmega-canvas (position:relative); z-index above the engine's ::after vignette (1).
   Licence recheck 2026-09-28: the longer credit keeps 11px (label floor) and fits two lines at
   390px through the 6px phone insets below; the panel went near-opaque so the text holds 4.5:1
   over the pale land colours of the tile. */
.rbgta-basemap-credit { position: absolute; left: 10px; bottom: 8px; z-index: 5; font: 500 11px/1.4 system-ui, sans-serif; color: rgba(255,255,255,0.92); background: rgba(8,12,20,0.82); padding: 3px 8px; border-radius: 4px; pointer-events: auto; max-width: calc(100% - 20px); box-sizing: border-box; }
.rbgta-basemap-credit a { color: #fff; text-decoration: underline; }
.rbgta-basemap-credit a:focus-visible { outline: 2px solid var(--mm-accent, #6aa9ff) !important; outline-offset: 1px; }
/* Desktop: the completion-tracker rail (engine .pkmega-rail, 440px, z 40, auto-opened in
   fullscreen) covers the bottom-left corner. Slide the strip clear of it the way the engine
   slides its left cluster and legend: same host class, same token, same easing. */
@media (min-width: 769px) {
    .rbgta-basemap-credit { transition: transform 0.34s cubic-bezier(0.4,0,0.2,1); }
    .pkmega-canvas--rail-open .rbgta-basemap-credit { transform: translateX(var(--pkmega-rail-w, 384px)); max-width: calc(100% - 20px - var(--pkmega-rail-w, 384px)); }
}
@media (max-width: 480px) {
    .rbgta-basemap-credit { left: 6px; bottom: 6px; padding: 3px 6px; max-width: calc(100% - 12px); }
}
/* Phone/tablet fullscreen: the bottom of the overlay belongs to the Playwire anchor + corner
   video, so ride above the engine reserve like its layer switcher does (rb-mega-map.css). */
@media (max-width: 768px) {
    body.pkmega-fs-active .rbgta-basemap-credit { bottom: calc(8px + var(--pkmega-ad-safe, 180px)); }
}
@media (prefers-reduced-motion: reduce) {
    .rbgta-basemap-credit { transition: none; }
}

/* Pin card action row (owner 2026-11-19: more data and a tick on the pin cards; rb-gta6-mega-map-plugin.js
   buildDetailHTML). The tick button follows the Elden Ring card pattern: not done = an outline on the dark card
   glass, done = a light fill with dark ink plus the engine tick glyph, so the state reads by lightness and the
   glyph, not by hue. Contrast on the card (about rgb 14,17,24): outline 6.1:1, label 15:1, done fill 9.4:1 with
   ink 9.9:1. A 44 px target, an even border (no edge stripe). */
.rbgta-dt-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 2px 0 8px; }
.rbgta-done {
    display: flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
    width: max-content; max-width: 100%; min-width: 44px; min-height: 44px; margin: 0; padding: 0 16px;
    border: 1px solid #8b93a7; border-radius: 8px; background: transparent; color: #e2e8f0;
    font: 600 13px/1.2 system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rbgta-done:hover { background: rgba(255, 255, 255, 0.07); }
.rbgta-done[aria-pressed="true"] { background: #ffb37d; border-color: #ffb37d; color: #1a0f06; }
.rbgta-done[aria-pressed="true"]:hover { background: #ffc296; border-color: #ffc296; }
.rbgta-done:focus-visible { outline: 2px solid #f8fafc; outline-offset: 2px; }
.rbgta-done-ico { display: inline-flex; }
.rbgta-done-ico svg { width: 14px; height: 14px; }
/* The guide link is a standalone link, not inline text: its own accent, an underline, and on a finger a
   44 px tall tap box (an invisible ::before; the link keeps its look). */
.pkmega a.rbgta-dt-guide, .rbgta-dt-guide {
    position: relative; display: inline-block; margin: 0; font: 600 12.5px/1.4 system-ui, sans-serif;
    color: #ff9d5c; text-decoration: none; border-bottom: 1px solid #7c4a24; cursor: pointer;
}
.rbgta-dt-guide:hover { border-bottom-color: #ff9d5c; }
.rbgta-dt-guide:focus-visible { outline: 2px solid #f8fafc; outline-offset: 2px; }
@media (pointer: coarse) {
    .rbgta-dt-guide::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
}
/* Phone sheet peek (shared rail gate EU (d) UX-05): the peek is capped at half the map band, 151 px on this map,
   and must show the action row and the whole first fact row. The 44 px tick button makes the action row taller
   than a link-only row, so on the sheet the row sits 7 px closer to the header and the gaps under it tighten until the
   header, the action row and the first fact row fit under that cap (rail test --eu-only); the desktop dock is unchanged. */
.pkmega[data-game-slug="gta-6"] .pkmega-dt--sheet .mm-card-head { margin-bottom: 1px !important; }
.pkmega[data-game-slug="gta-6"] .pkmega-dt--sheet .rbgta-dt-act { margin: -7px 0 2px; }
.pkmega[data-game-slug="gta-6"] .pkmega-dt--sheet [data-rbgta-detail] [data-mm-peek] { margin-top: 0 !important; }
