/* WarriorToxic Pokefind Companion — global styles */

:root {
    --brand: #3eb045;
    --brand-dark: #2c8a32;
    --brand-glow: rgba(62, 176, 69, 0.18);
    --bg: #0f1418;
    --surface: #181f25;
    --surface-elev: #232b32;
    --border: #2a333a;
    --text: #e6edef;
    --text-dim: #97a4ac;
    --text-muted: #6b7882;
    --accent-rare: #d4af37;
    --accent-shiny: #ff8fbf;
    --link: #6dd47a;
    --max-width: 1100px;
    --sidebar-width: 240px;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

code, pre {
    font-family: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
    background: var(--surface-elev);
    border-radius: 4px;
}
code { padding: 0.1em 0.4em; font-size: 0.92em; }
pre { padding: 1rem; overflow-x: auto; border: 1px solid var(--border); }
pre code { background: transparent; padding: 0; }

/* ----- Header ----- */
.site-header {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}
.brand-mark {
    background: var(--brand);
    color: #0a0f12;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-weight: 900;
    letter-spacing: 0.5px;
}
.brand-name { font-size: 1.05rem; }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
}
.site-nav a {
    color: var(--text-dim);
    font-weight: 500;
    transition: color 120ms ease;
}
.site-nav a:hover { color: var(--brand); text-decoration: none; }

/* ----- Layout ----- */
.layout {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem;
}
@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { order: 2; }
}

.sidebar {
    align-self: start;
    position: sticky;
    top: 70px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.section-nav h4 {
    margin: 0 0 0.6rem;
    color: var(--brand);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}
.section-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.section-nav li { margin: 0.2rem 0; }
.section-nav a {
    color: var(--text-dim);
    display: block;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}
.section-nav a:hover { background: var(--surface-elev); color: var(--text); text-decoration: none; }
.section-nav a.active { background: var(--brand-glow); color: var(--brand); font-weight: 600; }

/* ----- Section nav: hint when long-section browse is moved to overlay ----- */
.section-nav-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0.4rem 0 0;
    line-height: 1.4;
}

/* ----- Floating browse button (long sections only) ----- */
.section-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand);
    color: #0a0f12;
    border: 0;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, background 120ms ease;
}
.section-fab:hover { background: var(--brand-dark); transform: translateY(-2px); }
.section-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ----- Browse overlay (centered modal with backdrop) ----- */
.section-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in 100ms ease;
}
/* The hidden HTML attribute's default display:none has low specificity and gets
   overridden by the .section-overlay class above. Force-hide with the attribute
   selector so the overlay actually disappears when JS adds `hidden`. */
.section-overlay[hidden] { display: none !important; }
.section-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}
.section-overlay-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    max-height: 80vh;
    background: var(--surface);
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.section-overlay-header {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}
.section-overlay-search {
    flex: 1 1 auto;
    background: var(--surface-elev);
    border: 0;
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}
.section-overlay-close {
    background: var(--surface-elev);
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 1rem;
    font-size: 1.5rem;
    line-height: 1;
}
.section-overlay-close:hover { color: var(--text); background: var(--bg); }
.section-overlay-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0;
    overflow-y: auto;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: var(--brand) var(--surface);
}
.section-overlay-list::-webkit-scrollbar { width: 8px; }
.section-overlay-list::-webkit-scrollbar-track { background: var(--surface); }
.section-overlay-list::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 4px; }
.section-overlay-list li { margin: 0; }
.section-overlay-list a {
    display: block;
    padding: 0.45rem 1rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.section-overlay-list a:hover {
    background: var(--surface-elev);
    color: var(--text);
    text-decoration: none;
}
.section-overlay-list a.active {
    background: var(--brand-glow);
    color: var(--brand);
    font-weight: 600;
}
.section-overlay-list li[hidden] { display: none; }
.section-overlay-empty {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ----- Page ----- */
.page-header h1 {
    margin: 0 0 0.25rem;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.15;
}
.page-header .subtitle {
    color: var(--text-dim);
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}
.page-header .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 1.5rem;
}
.prose h2 {
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-top: 2rem;
}
.prose h3 { color: var(--text); margin-top: 1.5rem; }
.prose p, .prose ul, .prose ol { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-dim);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}
.prose th, .prose td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose th { background: var(--surface); color: var(--brand); }

.page-index {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.page-index li a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    color: var(--text);
}
.page-index li a:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
    text-decoration: none;
}
.page-index li span { color: var(--text-dim); font-weight: 400; }

/* ----- Home / hero ----- */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background:
        radial-gradient(ellipse at center top, var(--brand-glow), transparent 60%),
        var(--bg);
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.5rem; margin: 0 0 0.5rem; }
.hero-tagline { color: var(--text-dim); max-width: 600px; margin: 0 auto 1.5rem; }
.hero-cta { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.btn {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    background: var(--brand);
    color: #0a0f12;
    border-radius: var(--radius);
    font-weight: 700;
    transition: transform 100ms ease, background 120ms ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; transform: translateY(-1px); }

.cards {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--text);
    text-align: center;
    font-weight: 600;
}
.card:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}
.card h3 { margin: 0; font-size: 1rem; }

/* ----- Footer ----- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: 3rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ----- Pokemon profile ----- */
.dex-num { color: var(--text-muted); font-weight: 400; }
.dex-flavor { font-style: italic; color: var(--text-dim); }
.dex-profile {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 2fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
@media (max-width: 700px) { .dex-profile { grid-template-columns: 1fr; } }
.dex-visuals {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.model-viewer {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: grab;
}
.model-viewer:active { cursor: grabbing; }
.model-viewer canvas { display: block; width: 100% !important; height: 100% !important; }
.model-loading,
.viewer-error {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.viewer-error { color: var(--accent-rare); }
.dex-profile .sprite {
    background: var(--surface-elev);
    border-radius: var(--radius);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--border);
    overflow: hidden;
}
.dex-profile .sprite img {
    image-rendering: pixelated;
    width: 80%;
    height: 80%;
    object-fit: contain;
}
.dex-profile .stats dt {
    color: var(--brand);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dex-profile .stats dd {
    margin: 0.1rem 0 0.6rem;
    color: var(--text);
}
.dex-profile .types span {
    display: inline-block;
    background: var(--brand);
    color: #0a0f12;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-right: 0.3rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
/* Type colors override the default brand pill */
.type-normal   { background: #a8a878 !important; color: #1a1a1a !important; }
.type-fire     { background: #f08030 !important; color: #fff !important; }
.type-water    { background: #6890f0 !important; color: #fff !important; }
.type-electric { background: #f8d030 !important; color: #1a1a1a !important; }
.type-grass    { background: #78c850 !important; color: #1a1a1a !important; }
.type-ice      { background: #98d8d8 !important; color: #1a1a1a !important; }
.type-fighting { background: #c03028 !important; color: #fff !important; }
.type-poison   { background: #a040a0 !important; color: #fff !important; }
.type-ground   { background: #e0c068 !important; color: #1a1a1a !important; }
.type-flying   { background: #a890f0 !important; color: #fff !important; }
.type-psychic  { background: #f85888 !important; color: #fff !important; }
.type-bug      { background: #a8b820 !important; color: #fff !important; }
.type-rock     { background: #b8a038 !important; color: #fff !important; }
.type-ghost    { background: #705898 !important; color: #fff !important; }
.type-dragon   { background: #7038f8 !important; color: #fff !important; }
.type-dark     { background: #705848 !important; color: #fff !important; }
.type-steel    { background: #b8b8d0 !important; color: #1a1a1a !important; }
.type-fairy    { background: #ee99ac !important; color: #1a1a1a !important; }

.dex-profile .anniversary { color: var(--accent-rare); font-weight: 700; }

/* ----- Form tabs ----- */
.form-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--brand) var(--surface);
}
.form-tabs::-webkit-scrollbar { height: 6px; }
.form-tabs::-webkit-scrollbar-track { background: var(--surface); }
.form-tabs::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 3px; }
.form-tab { white-space: nowrap; }
.form-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    font-size: 0.92rem;
}
.form-tab:hover { color: var(--text); border-color: var(--brand); }
.form-tab.active {
    background: var(--brand);
    color: #0a0f12;
    border-color: var(--brand);
}
.form-panel { animation: fade-in 140ms ease; }
.form-panel[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ----- Pokedex meta block ----- */
.dex-meta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}
.dex-meta dl { margin: 0; }
.dex-meta dt {
    color: var(--brand);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dex-meta dd { margin: 0.1rem 0 0.6rem; }

/* ----- Pokedex list controls ----- */
.dex-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    flex-wrap: wrap;
}
.dex-search input {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    width: 240px;
}
.dex-search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-glow);
}
.dex-sort {
    display: flex;
    gap: 0.25rem;
}
.dex-sort button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
}
.dex-sort button:hover { color: var(--text); border-color: var(--brand); }
.dex-sort button.active {
    background: var(--brand);
    color: #0a0f12;
    border-color: var(--brand);
}
.dex-count { color: var(--text-muted); font-size: 0.9rem; margin-left: auto; }

/* ----- Pokedex grid ----- */
.dex-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}
.dex-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 120ms ease, transform 100ms ease;
}
.dex-card:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}
.dex-card a {
    display: block;
    padding: 0.75rem;
    color: var(--text);
}
.dex-card a:hover { text-decoration: none; }
.dex-card-sprite {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elev);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.dex-card-sprite img {
    image-rendering: pixelated;
    width: 80%;
    height: 80%;
    object-fit: contain;
}
.dex-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}
.dex-card-num {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}
.dex-card-name { font-weight: 700; font-size: 1rem; }
.dex-card-types {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}
.dex-card-types span {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.dex-card-forms {
    color: var(--accent-rare);
    font-size: 0.72rem;
    font-weight: 600;
}

/* ----- Base-stats table with bar visualization ----- */
.stat-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1.5rem;
    font-size: 0.95rem;
}
.stat-table th,
.stat-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}
.stat-table th {
    width: 90px;
    color: var(--text-dim);
    font-weight: 600;
    background: transparent;
}
.stat-table .stat-value {
    width: 64px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text);
    text-align: right;
}
.stat-table .stat-bar {
    background: transparent;
    border: 0;
    padding: 0.4rem 0.6rem;
}
.stat-bar-fill {
    display: block;
    height: 10px;
    border-radius: 5px;
    background: var(--brand);
    min-width: 6px;
    transition: width 200ms ease;
}
.stat-row.stat-hp  .stat-bar-fill { background: #5dd17a; }
.stat-row.stat-atk .stat-bar-fill { background: #f0735c; }
.stat-row.stat-def .stat-bar-fill { background: #f7c14b; }
.stat-row.stat-spa .stat-bar-fill { background: #74a8ee; }
.stat-row.stat-spd .stat-bar-fill { background: #9c84e3; }
.stat-row.stat-spe .stat-bar-fill { background: #e57aa6; }
.stat-row.stat-bst .stat-bar-fill { background: var(--brand); }
.stat-row.stat-bst th,
.stat-row.stat-bst td {
    border-top: 2px solid var(--border);
    border-bottom: 0;
    padding-top: 0.6rem;
}
.stat-row.stat-bst th { color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; }

/* ----- Level-up learnset table ----- */
.learnset-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1.5rem;
    font-size: 0.95rem;
}
.learnset-table thead th {
    background: var(--surface);
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.learnset-table tbody td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.learnset-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.015); }
.learnset-table tbody tr:hover { background: var(--brand-glow); }
.learnset-table .learnset-level {
    width: 56px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--brand);
    font-weight: 700;
}
.learnset-table .learnset-move { font-weight: 600; }
.learnset-table .learnset-note { color: var(--text-dim); font-size: 0.88rem; }
.learnset-table .num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-dim);
}
/* Compact type pill for table cells */
.type-pill-sm {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Damage-class badges */
.cat-physical, .cat-special, .cat-status {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cat-physical { background: #c0524a; color: #fff; }
.cat-special  { background: #6e7ec4; color: #fff; }
.cat-status   { background: #8c8c8c; color: #fff; }

/* ----- Move/ability link styling ----- */
.movelink {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
}
.movelink:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
    text-decoration: none;
}
.move-chips a.movelink {
    color: var(--text);
    border-bottom: 0;
}

/* ----- Move/ability page meta ----- */
.move-page .move-meta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.move-page .move-meta dl {
    margin: 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    row-gap: 0.4rem;
    column-gap: 1rem;
}
.move-page .move-meta dt {
    color: var(--brand);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.move-page .move-meta dd { margin: 0; color: var(--text); }
.move-page .move-effect {
    margin: 1rem 0 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-dim);
}
.learners {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.learners h2 {
    margin: 0 0 0.6rem;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    font-size: 1.1rem;
}
.learners-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}
.learners-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.3rem 0.6rem;
}
.learners-list li {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.88rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.learners-list li a {
    color: var(--text);
    text-decoration: none;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.learners-list li a:hover { color: var(--brand); }
.learners-list .learners-level-num {
    color: var(--brand);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
}

/* ----- Locations + Competitive Builds ----- */
.dex-locations {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.dex-locations h2 {
    margin: 0 0 0.6rem;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    font-size: 1.1rem;
}
.competitive-sets { margin: 1.5rem 0; }
.competitive-sets > h2 {
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
}
.comp-set {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.comp-set-auto {
    border-style: dashed;
    border-color: var(--text-muted);
}
.comp-set-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.comp-set-tier {
    background: var(--brand);
    color: #0a0f12;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.comp-set-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.comp-set-meta {
    display: grid;
    grid-template-columns: 80px 1fr;
    row-gap: 0.3rem;
    column-gap: 0.6rem;
    margin: 0 0 0.8rem;
    font-size: 0.92rem;
}
.comp-set-meta dt {
    color: var(--brand);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.comp-set-meta dd { margin: 0; color: var(--text); }
.comp-set-moves {
    list-style: decimal inside;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.3rem 0.6rem;
}
.comp-set-moves li {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}
.comp-set-note {
    margin: 0.6rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

/* ----- Movepool sections (TMs / Tutor / Egg) ----- */
.movepool { margin: 1.5rem 0; }
.movepool > summary {
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.6rem;
}
.movepool > summary::-webkit-details-marker { display: none; }
.movepool > summary::before {
    content: '▾';
    color: var(--brand);
    margin-right: 0.5rem;
    display: inline-block;
    transition: transform 120ms ease;
}
.movepool:not([open]) > summary::before { transform: rotate(-90deg); }
.movepool > summary h2 {
    display: inline;
    margin: 0;
    color: var(--brand);
    border: 0;
    padding: 0;
    font-size: 1.3rem;
}
.movepool-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.95rem;
}
.move-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.move-chips li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    color: var(--text);
}

/* ----- Inline skins (in the dex-profile stats panel) ----- */
.skins-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.skin-chip {
    background: var(--surface-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.3;
    white-space: nowrap;
}

/* ----- Move table ----- */
.move-table th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ----- Video embed ----- */
.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    background: var(--surface-elev);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ----- Callouts ----- */
.callout {
    border-left: 4px solid var(--brand);
    background: var(--surface);
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.callout.warn { border-left-color: #d97706; }
.callout.danger { border-left-color: #dc2626; }

/* ----- Gym Teams ----- */
.gym-teams-page h2 { margin-top: 2rem; }
.gym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}
.gym-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
}
.gym-card-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}
.gym-badge {
    background: var(--brand);
    color: #0a0f12;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}
.e4-badge { background: var(--accent-rare); color: #1a1208; }
.gym-leader {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text);
}
.gym-team {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.gym-team th, .gym-team td {
    text-align: left;
    padding: 0.32rem 0.4rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.gym-team th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gym-team tr:last-child td { border-bottom: none; }
.gym-moves { color: var(--text-dim); font-size: 0.85rem; line-height: 1.4; }

.gym-trainers {
    margin: 0 0 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.gym-trainers > summary {
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.85rem;
    list-style-position: inside;
}
.gym-trainers[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
.trainer-block { padding: 0.5rem 0.75rem 0.7rem; border-bottom: 1px solid var(--border); }
.trainer-block:last-child { border-bottom: none; }
.trainer-name {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text);
}
.leader-label {
    margin: 0.4rem 0 0.4rem;
    font-size: 0.78rem;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ----- Quest log ----- */
.quest-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 0.8rem;
}
.quest-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem 1rem;
}
.quest-name {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--text);
}
.quest-desc {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.92rem;
    line-height: 1.45;
}

/* ----- Quest entries (clickable) ----- */
.quest-entry .quest-name a {
    color: var(--text);
    text-decoration: none;
}
.quest-entry .quest-name a:hover {
    color: var(--brand);
    text-decoration: underline;
}
.quest-entry { transition: border-color 120ms ease; }
.quest-entry:hover { border-color: var(--brand); }

/* ----- Quest guide (per-quest walkthrough) ----- */
.quest-guide .quest-desc {
    color: var(--text-dim);
    font-style: italic;
    border-left: 3px solid var(--brand);
    padding: 0.4rem 0.9rem;
    margin: 0.6rem 0 0.4rem;
    background: var(--surface);
}
.walkthrough {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 1rem 0 2rem;
}
.walkthrough-step {
    counter-increment: step;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem 0.95rem 3rem;
    margin: 0 0 0.75rem;
    position: relative;
}
.walkthrough-step::before {
    content: counter(step);
    position: absolute;
    left: 0.7rem;
    top: 0.85rem;
    width: 1.8rem;
    height: 1.8rem;
    background: var(--brand);
    color: #0a0f12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.step-text {
    margin: 0 0 0.5rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}
.step-location {
    margin: 0.25rem 0;
    font-size: 0.88rem;
    color: var(--text-dim);
}
.step-location code {
    background: var(--surface-elev);
    color: var(--brand);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}
.loc-pin { margin-right: 0.25rem; }
.loc-label { margin-left: 0.4rem; color: var(--text-muted); }
.step-battles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
}
.battle-card {
    flex: 1 1 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.7rem;
}
.battle-trainer {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
    color: var(--text);
}
.battle-team {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.86rem;
}
.battle-team li {
    padding: 0.15rem 0;
    color: var(--text-dim);
}
.battle-team .lv {
    color: var(--text-muted);
    margin-left: 0.4rem;
    font-size: 0.8rem;
}
.step-rewards {
    margin: 0.5rem 0 0 1.1rem;
    padding: 0;
    color: var(--text-dim);
    font-size: 0.88rem;
}
.step-rewards li { margin: 0.1rem 0; }
.rewards-label {
    list-style: none;
    margin-left: -1.1rem;
    color: var(--brand);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}
.final-rewards {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-rare);
    border-radius: var(--radius);
    padding: 0.7rem 1rem 0.7rem 2rem;
}

.quest-start {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius);
    padding: 0.75rem 1rem 0.85rem;
    margin: 1rem 0 1.4rem;
}
.quest-start h2 {
    margin: 0 0 0.4rem;
    color: var(--brand);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.start-desc {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    color: var(--text);
}
.start-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.start-meta li { margin: 0.1rem 0; }
.start-meta code {
    background: var(--surface-elev);
    color: var(--brand);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
}
.loc-town {
    margin-left: 0.5rem;
    color: var(--brand);
    font-weight: 600;
}

.quest-video { margin: 1rem 0 1.5rem; }
.quest-video h2 {
    margin: 0 0 0.5rem;
    color: var(--brand);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.yt-embed {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.yt-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.battle-loc {
    margin: 0 0 0.4rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.battle-loc code {
    background: var(--surface-elev);
    color: var(--brand);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-size: 0.78rem;
}

.step-region code {
    background: var(--surface-elev);
    color: var(--accent-rare);
}
.step-region .loc-pin { color: var(--accent-rare); }

/* ----- Skins ----- */
.skin-grid {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem 0.8rem;
}
.skin-grid li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.45rem 0.7rem;
    transition: border-color 120ms ease;
}
.skin-grid li:hover { border-color: var(--brand); }
.skin-grid li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
}
.skin-grid li a:hover { color: var(--brand); }
.tab-count {
    background: var(--surface-elev);
    color: var(--text-dim);
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.72rem;
    margin-left: 0.4rem;
    font-weight: 500;
}
.form-tab.active .tab-count { background: rgba(0,0,0,0.2); color: #0a0f12; }

.act-divider {
    list-style: none;
    margin: 1.5rem 0 1rem;
    padding: 0;
    counter-increment: none;
}
.act-divider::before { content: none; }
.act-divider h3 {
    margin: 0 0 0.6rem;
    color: var(--brand);
    font-size: 1.4rem;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.35rem;
}
.act-divider .yt-embed {
    max-width: 720px;
    margin: 0.5rem 0;
}

/* ----- Moves & Abilities list ----- */
.moves-grid {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.4rem 0.6rem;
}
.moves-grid li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.7rem;
    transition: border-color 120ms ease;
}
.moves-grid li:hover { border-color: var(--brand); }
.moves-grid li a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.moves-grid li a:hover { color: var(--brand); }
