@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/dm-sans-latin.woff2') format('woff2');
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

:root {
    --font-body: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-pixel: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ink: #17211b;
    --ink-soft: #4f5d54;
    --cream: #f6f4ed;
    --paper: #fffefa;
    --line: #dfe2d9;
    --green: #176b4c;
    --green-dark: #0e5139;
    --green-soft: #e4efe8;
    --yellow: #eabf48;
    --red: #dc554b;
    --on-green: #ffffff;
    --header-bg: rgba(246, 244, 237, .94);
    --header-line: rgba(77, 95, 84, .16);
    --focus-ring: rgba(23, 107, 76, .3);
    --green-wash: rgba(23, 107, 76, .06);
    --surface-page: #f8f7f2;
    --surface-sidebar: #f2f1eb;
    --surface-input: #ffffff;
    --surface-subtle: #f0f1ed;
    --surface-hover: #fafaf7;
    --surface-done: #f4f8f5;
    --line-strong: #cbd0ca;
    --line-soft: #e7e8e3;
    --progress-track: #e8e9e4;
    --pill-bg: #f2eee4;
    --pill-text: #5c635e;
    --muted: #7b857f;
    --muted-light: #89918c;
    --danger-text: #a22925;
    --danger-soft: #fbe9e7;
    --warning-text: #b18113;
    --warning-soft: #fff4d7;
    --trainer-soft: #f8e7e4;
    --pokemon-soft: #e7f1eb;
    --empty-bg: rgba(255, 254, 250, .55);
    --skeleton-start: #f2f1eb;
    --skeleton-shine: #faf9f4;
    --sprite-shadow: rgba(33, 48, 39, .13);
    --shadow: 0 18px 55px rgba(35, 54, 43, .09);
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    font-synthesis: none;
}

:root[data-theme='dark'] {
    --ink: #f0f5f1;
    --ink-soft: #aab8af;
    --cream: #0e1511;
    --paper: #17211b;
    --line: #2d3a32;
    --green: #67d19a;
    --green-dark: #82dfad;
    --green-soft: #1d3b2c;
    --yellow: #f2c85a;
    --red: #f0786f;
    --on-green: #08140d;
    --header-bg: rgba(14, 21, 17, .93);
    --header-line: rgba(202, 222, 209, .12);
    --focus-ring: rgba(103, 209, 154, .42);
    --green-wash: rgba(103, 209, 154, .11);
    --surface-page: #111914;
    --surface-sidebar: #131c17;
    --surface-input: #1c2821;
    --surface-subtle: #222e27;
    --surface-hover: #1d2922;
    --surface-done: #183026;
    --line-strong: #3b4a41;
    --line-soft: #27352d;
    --progress-track: #2b3931;
    --pill-bg: #2a2922;
    --pill-text: #d2cbb5;
    --muted: #94a199;
    --muted-light: #829087;
    --danger-text: #ff9188;
    --danger-soft: #432420;
    --warning-text: #f0c85a;
    --warning-soft: #3c3219;
    --trainer-soft: #3b2422;
    --pokemon-soft: #1d3b2c;
    --empty-bg: rgba(23, 33, 27, .68);
    --skeleton-start: #1b2821;
    --skeleton-shine: #24332a;
    --sprite-shadow: rgba(0, 0, 0, .35);
    --shadow: 0 18px 55px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

html { color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }
html, body { margin: 0; min-height: 100%; background: var(--cream); }

body { min-width: 320px; color: var(--ink); transition: color .2s ease, background-color .2s ease; }

a { color: inherit; }

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1:focus { outline: none; }
h1, h2, h3, h4, .brand, .app-nav, .button, .eyebrow, .game-pill, .theme-toggle, .culture-selector, .content-tabs, .stage-filters, .checklist-heading button, .visit-button {
    font-family: var(--font-pixel);
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-shell:has(.run-page) { position: fixed; inset: 0; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.app-shell:has(.run-page) .app-main { min-height: 0; overflow: hidden; }
.app-shell:has(.run-page) .app-footer { display: none; }

.app-header {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(22px, 5vw, 76px);
    border-bottom: 1px solid var(--header-line);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 700; text-decoration: none; letter-spacing: 0; }
.brand > span:last-child > span { color: var(--green); }

.brand-mark {
    width: 30px;
    height: 30px;
    border: 3px solid var(--green);
    border-radius: 50%;
    position: relative;
    display: inline-block;
    background: linear-gradient(to bottom, var(--green) 0 43%, transparent 43% 57%, var(--paper) 57%);
    flex: 0 0 auto;
}

.brand-mark::before { content: ''; position: absolute; left: -2px; right: -2px; top: 12px; height: 3px; background: var(--green); }
.brand-mark span { position: absolute; width: 9px; height: 9px; border: 2px solid var(--green); background: var(--paper); border-radius: 50%; left: 8px; top: 9px; z-index: 1; }

.app-nav { display: flex; align-items: center; gap: 8px; }
.app-nav a { color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 600; padding: 10px 14px; border-radius: 10px; }
.app-nav a:hover, .app-nav a.active:not(.nav-new) { color: var(--green); background: var(--green-wash); }
.app-nav .nav-new { background: var(--green); color: var(--on-green); padding-inline: 17px; box-shadow: 0 7px 18px rgba(23, 107, 76, .18); }
.app-nav .nav-new:hover { background: var(--green-dark); }

.culture-selector { min-height: 38px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--paper); font-size: 12px; font-weight: 700; }
.culture-selector:hover, .culture-selector:focus-within { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.culture-selector > span:first-child { font-family: var(--font-body); font-size: 17px; line-height: 1; }
.culture-selector select { appearance: none; border: 0; padding: 0 12px 0 0; color: inherit; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%235f6f65' d='M0 0h8L4 5z'/%3E%3C/svg%3E") no-repeat right center; cursor: pointer; font-weight: inherit; }

.theme-toggle { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--paper); cursor: pointer; font-size: 14px; font-weight: 600; }
.theme-toggle:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.theme-toggle-icon { width: 17px; height: 17px; display: grid; place-items: center; font-family: var(--font-body); font-size: 18px; line-height: 1; }
.theme-toggle-icon > span { grid-area: 1 / 1; }
.theme-sun { display: none; }
[data-theme='dark'] .theme-moon { display: none; }
[data-theme='dark'] .theme-sun { display: block; }

.app-main { flex: 1; }

.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(22px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.app-footer span:first-child { color: var(--green); font-weight: 700; }

.eyebrow { display: block; color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; margin-bottom: 14px; }

.home-hero {
    max-width: 1440px;
    min-height: 540px;
    margin: 0 auto;
    padding: clamp(64px, 8vw, 112px) clamp(22px, 6vw, 94px) 72px;
    display: grid;
    grid-template-columns: 1fr minmax(390px, .85fr);
    gap: clamp(35px, 8vw, 120px);
    align-items: center;
    overflow: hidden;
}

.hero-copy { max-width: 610px; position: relative; z-index: 2; }
.hero-copy h1, .form-intro h1 { font-family: var(--font-pixel); font-size: clamp(48px, 6.3vw, 82px); line-height: 1.02; letter-spacing: -.02em; margin-bottom: 26px; }
.hero-copy h1 em, .form-intro h1 em { font-weight: inherit; color: var(--green); }
.hero-copy p { max-width: 530px; color: var(--ink-soft); font-size: 17px; line-height: 1.65; margin-bottom: 32px; }

.button { border: 0; border-radius: 10px; min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 26px; padding: 0 20px; text-decoration: none; cursor: pointer; font-size: 15px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--on-green); background: var(--green); box-shadow: 0 9px 24px rgba(23, 107, 76, .2); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green); background: var(--green-soft); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

.hero-art { height: 350px; position: relative; transform: rotate(-3deg); }
.map-grid { position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(var(--green) 1px, transparent 1px), linear-gradient(90deg, var(--green) 1px, transparent 1px); background-size: 33px 33px; border-radius: 50%; mask-image: radial-gradient(circle, black 35%, transparent 72%); }
.route-line { position: absolute; border: 4px dashed rgba(23, 107, 76, .36); border-left: 0; border-bottom: 0; border-radius: 50%; }
.route-line-one { width: 330px; height: 190px; left: 55px; top: 67px; transform: rotate(14deg); }
.route-line-two { width: 210px; height: 145px; left: 166px; top: 141px; transform: rotate(168deg); }
.map-pin { width: 34px; height: 42px; background: var(--green); border: 5px solid var(--paper); border-radius: 50% 50% 50% 4px; position: absolute; box-shadow: 0 8px 25px rgba(23, 107, 76, .25); transform: rotate(-45deg); }
.map-pin i { width: 9px; height: 9px; border-radius: 50%; background: var(--paper); position: absolute; left: 8px; top: 8px; }
.pin-one { left: 34px; top: 83px; }.pin-two { right: 46px; top: 85px; background: var(--yellow); }.pin-three { right: 145px; bottom: 30px; background: var(--red); }
.hero-ball { width: 146px; height: 146px; border: 7px solid var(--ink); border-radius: 50%; position: absolute; left: 160px; top: 84px; background: linear-gradient(to bottom, var(--red) 0 44%, var(--ink) 44% 56%, var(--paper) 56%); box-shadow: var(--shadow); transform: rotate(8deg); }
.hero-ball span { width: 45px; height: 45px; border: 7px solid var(--ink); border-radius: 50%; background: var(--paper); position: absolute; left: 44px; top: 44px; }
.hero-ball span::after { content: ''; position: absolute; inset: 8px; border: 2px solid var(--line); border-radius: 50%; }
.compass { width: 70px; height: 70px; border: 1px solid rgba(23, 107, 76, .25); border-radius: 50%; color: var(--green); font-size: 9px; font-weight: 700; position: absolute; right: 44px; bottom: 38px; text-align: center; padding-top: 4px; }
.compass span { display: block; font-size: 40px; line-height: 45px; }

.runs-section { max-width: 1440px; margin: 0 auto; padding: 38px clamp(22px, 6vw, 94px) 110px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 28px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2 { font-family: var(--font-pixel); font-size: 37px; letter-spacing: -.01em; margin: 0; }
.run-actions { display: flex; align-items: center; gap: 14px; }
.run-count { color: var(--muted); font-size: 13px; }
.export-button { min-height: 38px; padding-inline: 14px; font-size: 12px; }
.export-status { margin: -16px 0 20px; color: var(--green); font-size: 13px; font-weight: 700; }
.storage-notice { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--surface-subtle); }
.storage-notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--danger-soft); color: var(--danger-text); font-weight: 800; }
.storage-notice strong { display: block; margin-bottom: 3px; font-size: 14px; }
.storage-notice p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.run-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.run-card { min-height: 310px; border: 1px solid var(--line); background: var(--paper); border-radius: 15px; padding: 25px; position: relative; box-shadow: 0 2px 0 rgba(32, 54, 41, .02); transition: transform .18s, box-shadow .18s, border-color .18s; }
.run-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.run-card-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 28px; }
.game-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; background: var(--pill-bg); color: var(--pill-text); padding: 6px 10px; text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.game-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.leafgreen .game-pill i, .game-pill.leafgreen i { background: #36a466; }
.run-card h3 { font-family: var(--font-pixel); font-size: 28px; letter-spacing: -.01em; margin-bottom: 7px; }
.run-meta { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.run-menu { position: relative; }
.run-menu > button { width: 32px; height: 28px; border: 0; background: transparent; color: var(--muted-light); cursor: pointer; letter-spacing: 2px; }
.delete-popover { position: absolute; width: 150px; right: 0; top: 30px; z-index: 4; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.delete-popover span { font-size: 12px; font-weight: 700; }
.delete-popover button { text-align: left; padding: 6px; border: 0; border-radius: 5px; color: var(--ink); background: var(--surface-subtle); font-size: 12px; cursor: pointer; }
.delete-popover button:first-of-type { color: var(--danger-text); background: var(--danger-soft); }
.run-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.run-progress-label strong { color: var(--green); }
.progress-track { height: 5px; background: var(--progress-track); border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.firered .progress-track span { background: var(--red); }
.run-stats { display: flex; gap: 18px; color: var(--muted); font-size: 12px; margin-top: 11px; }
.run-stats strong { color: var(--ink); }
.card-link { position: absolute; left: 25px; right: 25px; bottom: 20px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--green); padding: 15px 0 0; display: flex; justify-content: space-between; cursor: pointer; font-family: var(--font-pixel); font-size: 14px; font-weight: 700; }
.new-run-card { display: flex; flex-direction: column; justify-content: center; align-items: center; text-decoration: none; border-style: dashed; color: var(--muted-light); }
.new-run-card h3 { color: var(--ink); font-family: inherit; font-size: 17px; margin: 14px 0 4px; }
.new-run-card p { font-size: 13px; }
.new-run-plus { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 24px; }
.run-card-skeleton { animation: pulse 1.4s infinite; background: linear-gradient(100deg, var(--skeleton-start) 35%, var(--skeleton-shine) 50%, var(--skeleton-start) 65%); background-size: 300% 100%; }
@keyframes pulse { to { background-position: -150% 0; } }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 34px; display: flex; align-items: center; gap: 22px; background: var(--empty-bg); }
.empty-state .empty-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 27px; }
.empty-state div { flex: 1; }
.empty-state h3 { margin: 0 0 5px; font-size: 17px; }.empty-state p { color: var(--ink-soft); margin: 0; font-size: 14px; }

.form-page { max-width: 1260px; margin: auto; padding: 34px clamp(22px, 6vw, 78px) 95px; }
.back-link { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 66px; }
.back-link:hover { color: var(--green); }
.form-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(55px, 8vw, 120px); align-items: start; }
.form-intro { position: sticky; top: 145px; }
.form-intro h1 { font-size: clamp(44px, 5vw, 64px); }
.form-intro > p { color: var(--ink-soft); max-width: 440px; font-size: 15px; line-height: 1.65; }
.offline-note { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); margin-top: 35px; padding-top: 24px; max-width: 430px; }
.offline-note > span { width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.offline-note div { display: grid; gap: 2px; }.offline-note strong { font-size: 14px; }.offline-note small { color: var(--muted); font-size: 12px; }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(25px, 4vw, 46px); box-shadow: var(--shadow); }
.form-loading { color: var(--ink-soft); text-align: center; padding: 80px 0; }
.storage-blocked { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.field-group { border: 0; padding: 0; margin: 0 0 30px; min-width: 0; }
.field-group label.option-title, .field-group legend { display: block; color: var(--ink); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.field-group input[type='text'], .field-group select { width: 100%; height: 50px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 14px; color: var(--ink); background: var(--surface-input); transition: border .15s, box-shadow .15s; }
.field-group input[type='text']:focus, .field-group select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); outline: 0; }
.field-group input::placeholder { color: var(--muted-light); }
.field-group > small { display: block; color: var(--muted-light); font-size: 12px; margin-top: 7px; }
.validation-message { color: var(--danger-text); font-size: 12px; margin-top: 6px; }
.game-options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.game-option { min-height: 90px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; cursor: pointer; position: relative; transition: border .15s, background .15s; margin-bottom: 10px; }
.game-option input { position: absolute; opacity: 0; }
.game-option.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.game-option-copy { min-width: 0; display: grid; gap: 4px; }.game-option strong { font-size: 14px; }.game-option small { color: var(--muted); font-size: 11px; }
.game-logo { width: 118px; height: 62px; flex: 0 0 118px; display: grid; place-items: center; }
.game-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.option-check { display: none; margin-left: auto; width: 19px; height: 19px; border-radius: 50%; background: var(--green); color: var(--on-green); font-size: 11px; font-style: normal; text-align: center; line-height: 19px; }
.game-option.selected .option-check { display: block; }
.run-mode-options { display: grid; gap: 10px; }
.run-mode-field .run-mode-option {  min-height: 86px; display: flex; align-items: center; gap: 16px; margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--paper); cursor: pointer; transition: border .15s, background .15s, box-shadow .15s; margin-bottom: 10px; }
.run-mode-option input { position: absolute; opacity: 0; }
.run-mode-option.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.run-mode-copy { min-width: 0; display: grid; gap: 4px; }
.run-mode-option strong { font-size: 14px; }
.run-mode-option small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.run-mode-option .option-check { display: none; }
.run-mode-option .option-check { align-self: center; justify-self: end; }
.run-mode-option.selected .option-check { display: block; }
.select-wrap { position: relative; }.select-wrap::after { content: '⌄'; position: absolute; right: 14px; top: 13px; color: var(--muted-light); }
.field-group select { appearance: none; }.field-group select:disabled { opacity: 1; color: var(--ink); background: var(--surface-page); }
.submit-button { width: 100%; margin-top: 5px; }

/* Run workspace */
.run-page { height: 100%; min-height: 0; display: grid; grid-template-rows: 88px minmax(0, 1fr); overflow: hidden; background: var(--surface-page); }
.run-page .game-pill { width: fit-content; }
.run-header { height: 88px; padding: 11px clamp(22px, 3.5vw, 52px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 30px; position: relative; z-index: 9; }
.run-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.run-identity > div { min-width: 0; }
.run-back { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.run-identity h1 { font-family: var(--font-pixel); font-size: 27px; letter-spacing: -.01em; margin: 7px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-view-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-page); }
.run-view-tabs button { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.run-view-tabs button:hover { color: var(--green); background: var(--green-wash); }
.run-view-tabs button.active { color: var(--on-green); background: var(--green); box-shadow: 0 4px 12px rgba(23, 107, 76, .18); }
.run-view-tabs button > span { font-family: var(--font-body); font-size: 16px; line-height: 1; }
.overall-progress { width: 260px; flex: 0 0 auto; }
.overall-copy { display: flex; justify-content: space-between; margin-bottom: 7px; font-family: var(--font-pixel); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.overall-copy strong { color: var(--green); }
.overall-progress small { display: block; text-align: right; margin-top: 6px; color: var(--muted-light); font-size: 11px; }
.mobile-locations { display: none; border: 0; background: transparent; padding: 7px; }.mobile-locations span { width: 19px; height: 2px; background: var(--ink); display: block; margin: 3px; }
.run-workspace { height: 100%; min-height: 0; display: grid; grid-template-columns: 306px minmax(0, 1fr); overflow: hidden; }
.location-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-sidebar); border-right: 1px solid var(--line); }
.sidebar-tools { padding: 20px 18px 14px; flex: 0 0 auto; background: var(--surface-sidebar); z-index: 4; }
.search-box { height: 39px; display: flex; align-items: center; gap: 8px; background: var(--surface-input); border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; }
.search-box span { color: var(--muted-light); font-size: 18px; }.search-box input { border: 0; outline: 0; min-width: 0; width: 100%; color: var(--ink); font-size: 13px; background: transparent; }
.stage-filters { display: flex; gap: 5px; margin-top: 12px; overflow: auto; scrollbar-width: none; }.stage-filters button { border: 0; border-radius: 6px; padding: 6px 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }.stage-filters button.active { background: var(--green); color: var(--on-green); }
.location-list { min-height: 0; padding: 0 10px 30px; flex: 1; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.chapter-label { color: var(--muted-light); text-transform: uppercase; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .1em; font-weight: 700; padding: 18px 11px 8px; }
.location-button { width: 100%; border: 0; border-radius: 9px; background: transparent; color: var(--ink); min-height: 56px; padding: 8px 9px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.location-button:hover { background: var(--surface-hover); }.location-button.active { background: var(--paper); box-shadow: 0 3px 12px rgba(0, 0, 0, .08); }
.location-order { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; font-family: var(--font-pixel); font-size: 10px; font-weight: 700; }
.location-button.active .location-order { background: var(--green); border-color: var(--green); color: var(--on-green); }
.location-copy { flex: 1; display: grid; gap: 3px; min-width: 0; }.location-copy strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.location-copy small { color: var(--muted-light); font-size: 10px; }
.visited-check { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; }.location-chevron { color: var(--muted-light); }
.no-results { color: var(--muted); padding: 24px 12px; font-size: 13px; }
.location-content { min-width: 0; width: 100%; height: 100%; max-width: 1100px; padding: clamp(28px, 4vw, 52px) clamp(22px, 4.5vw, 70px) 80px; margin: 0 auto; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.location-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.location-kicker { color: var(--green); text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.location-hero h2 { font-family: var(--font-pixel); font-size: clamp(40px, 4vw, 58px); letter-spacing: -.015em; line-height: 1.05; margin: 7px 0 9px; }.location-hero p { color: var(--ink-soft); margin: 0; font-size: 15px; }
.visit-button { min-height: 41px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--green); padding: 0 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }.visit-button.complete { background: var(--green); color: var(--on-green); border-color: var(--green); }
.location-summary { display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 31px; }
.location-summary > div { min-height: 84px; padding: 17px; border-right: 1px solid var(--line-soft); display: grid; grid-template-columns: 27px 1fr; align-content: center; column-gap: 8px; }
.location-summary > div:last-child { border-right: 0; }.location-summary strong { font-family: var(--font-pixel); font-size: 24px; line-height: 1; }.location-summary small { grid-column: 2; color: var(--muted-light); font-size: 10px; margin-top: 5px; }.summary-icon { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; }.pokemon-icon { background: var(--pokemon-soft); color: var(--green); }.item-icon { background: var(--warning-soft); color: var(--warning-text); }.trainer-icon { background: var(--trainer-soft); color: var(--red); }
.location-summary .summary-progress { display: block; }.summary-progress strong { color: var(--green); }.location-summary .summary-progress small { display: inline; margin-left: 8px; }.summary-progress .progress-track { margin-top: 13px; }
.content-tabs { display: flex; gap: 3px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 21px; scrollbar-width: thin; }
.content-tabs button { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); padding: 0 15px 13px; position: relative; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }.content-tabs button.active { color: var(--green); }.content-tabs button.active::after { content: ''; position: absolute; left: 7px; right: 7px; bottom: -1px; height: 2px; background: var(--green); }.content-tabs button span { background: var(--progress-track); border-radius: 99px; padding: 2px 6px; font-size: 10px; margin-left: 5px; }.content-tabs button.active span { background: var(--green-soft); }
.checklist-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }

.location-map-view { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.location-map-toolbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line-soft); }
.location-map-toolbar .eyebrow { margin-bottom: 5px; font-size: 9px; }
.location-map-toolbar h3 { margin: 0 0 4px; font-family: var(--font-pixel); font-size: 18px; }
.location-map-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.location-map-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.location-map-actions button, .location-map-actions a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--surface-page); font-size: 10px; font-weight: 800; text-decoration: none; cursor: pointer; }
.location-map-actions button:hover, .location-map-actions a:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.location-map-selector { display: flex; gap: 7px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: var(--surface-page); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.location-map-selector button { flex: 0 0 auto; min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--paper); font-size: 9px; font-weight: 800; cursor: pointer; }
.location-map-selector button:hover { color: var(--green); border-color: var(--green); }
.location-map-selector button.active { color: var(--on-green); border-color: var(--green); background: var(--green); }
.location-map-canvas { min-height: 340px; max-height: min(72vh, 760px); position: relative; isolation: isolate; display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: clamp(14px, 3vw, 28px); background: var(--surface-page); overscroll-behavior: contain; }
.location-map-canvas.actual-size { justify-content: flex-start; }
.location-map-frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.location-map-canvas img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border: 1px solid rgba(20, 32, 24, .28); box-shadow: 0 12px 34px rgba(17, 28, 21, .2); }
.location-map-canvas.actual-size .location-map-frame, .location-map-canvas.actual-size img { max-width: none; }
.location-map-hotspot { --hotspot-x: 0%; --hotspot-y: 0%; --hotspot-width: 3%; --hotspot-height: 8%; position: absolute; z-index: 2; left: var(--hotspot-x); top: var(--hotspot-y); width: max(32px, var(--hotspot-width)); height: max(44px, var(--hotspot-height)); padding: 0; transform: translate(-50%, -100%); border: 0; border-radius: 8px; color: var(--paper); background: transparent; cursor: pointer; }
.location-map-hotspot::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 7px); width: max-content; max-width: 180px; padding: 6px 8px; transform: translateX(-50%) translateY(3px); border-radius: 6px; color: #fff; background: rgba(18, 28, 25, .94); font-size: 9px; font-weight: 800; line-height: 1.3; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.location-map-hotspot:hover::after, .location-map-hotspot:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.location-map-hotspot:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.location-map-canvas.leaflet-mode { min-height: 0; max-height: none; align-items: stretch; overflow: hidden; padding: 0; background: #17231e; }
.location-map-leaflet-shell { position: relative; isolation: isolate; width: 100%; min-width: 0; }
.location-map-leaflet-shell .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.location-map-leaflet { width: 100%; height: clamp(360px, 62vh, 680px); overflow: hidden; border: 0; border-radius: 0; background: #17231e; box-shadow: none; }
.location-map-leaflet .leaflet-pixel-map { image-rendering: pixelated; image-rendering: crisp-edges; }
.location-map-leaflet .leaflet-control-zoom { overflow: hidden; border: 1px solid rgba(20, 32, 24, .32); border-radius: 7px; box-shadow: 0 4px 15px rgba(17, 28, 21, .22); }
.location-map-leaflet .leaflet-control-zoom a { color: var(--ink); background: var(--paper); font-family: var(--font-pixel); }
.location-map-leaflet .leaflet-control-zoom a:hover, .location-map-leaflet .leaflet-control-zoom a:focus { color: var(--green); background: var(--green-soft); }
.leaflet-map-hotspot { position: absolute; z-index: 650; left: 0; top: 0; margin: 0; padding: 0; border: 0; color: #fff; background: transparent; cursor: pointer; line-height: 0; }
.leaflet-map-hotspot.item, .leaflet-map-hotspot.hidden-item { z-index: 640; }
.leaflet-map-hotspot.item-npc, .leaflet-map-hotspot.trade-npc { z-index: 645; }
.leaflet-map-hotspot.warp, .leaflet-map-hotspot.connection { z-index: 630; border-radius: 2px; }
.leaflet-map-hotspot.warp::before, .leaflet-map-hotspot.connection::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--green) 20%, transparent); box-shadow: inset 0 0 0 1px var(--green); opacity: 0; transition: opacity .15s ease; }
.leaflet-map-hotspot.warp:hover::before, .leaflet-map-hotspot.warp:focus-visible::before, .leaflet-map-hotspot.connection:hover::before, .leaflet-map-hotspot.connection:focus-visible::before { opacity: 1; }
.leaflet-map-hotspot img { width: 100%; height: 100%; max-width: none; border: 0; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; box-shadow: none; pointer-events: none; transition: filter .15s ease; }
.leaflet-map-hotspot.hidden-item img { opacity: .78; filter: saturate(.45) brightness(.88); }
.leaflet-map-hotspot::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 7px); width: max-content; max-width: 180px; padding: 6px 8px; transform: translateX(-50%) translateY(3px); border-radius: 6px; color: #fff; background: rgba(18, 28, 25, .94); box-shadow: 0 5px 18px rgba(10, 18, 14, .25); font-size: 9px; font-weight: 800; line-height: 1.3; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.leaflet-map-hotspot:hover img, .leaflet-map-hotspot:focus-visible img { filter: brightness(1.12) drop-shadow(0 0 2px rgba(255, 255, 255, .95)); }
.leaflet-map-hotspot.hidden-item:hover img, .leaflet-map-hotspot.hidden-item:focus-visible img { opacity: 1; }
.leaflet-map-hotspot:hover::after, .leaflet-map-hotspot:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.leaflet-map-hotspot:focus-visible { outline: none; }
.location-map-note { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line-soft); color: var(--muted); background: var(--paper); font-size: 9px; }
.location-map-note > span:first-child { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 13px; }
.map-entry-popover { width: min(700px, calc(100% - 16px)); max-height: calc(100% - 16px); position: absolute; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: visible; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--ink); background: var(--paper); box-shadow: 0 18px 55px rgba(0, 0, 0, .34); }
.map-entry-popover:not([data-positioned='true']) { visibility: hidden; }
.map-entry-popover::after { content: ""; width: 12px; height: 12px; position: absolute; z-index: 2; left: var(--popover-anchor-x, 50%); background: var(--paper); transform: translateX(-50%) rotate(45deg); }
.map-entry-popover[data-placement='above']::after { bottom: -7px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.map-entry-popover[data-placement='below']::after { top: -7px; border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); background: var(--green-soft); }
.map-entry-popover.item-entry-overlay { width: min(440px, calc(100% - 16px)); }
.map-entry-overlay-header { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 17px 13px; border-bottom: 1px solid var(--line); border-radius: 13px 13px 0 0; background: linear-gradient(135deg, var(--green-soft), var(--paper) 70%); }
.map-entry-overlay-header.trainer-popover-header { min-height: 0; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 13px; }
.map-trainer-overlay-sprite { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 11px; color: var(--red); background: var(--trainer-soft); font-size: 15px; }
.map-trainer-overlay-sprite img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.map-entry-overlay-title { min-width: 0; flex: 1; }
.map-entry-overlay-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-entry-overlay-title .trainer-variant-count { margin-top: 5px; }
.map-entry-overlay-header .eyebrow { display: block; margin-bottom: 4px; }
.map-entry-overlay-header h2 { margin: 0 0 3px; font-size: 20px; }
.map-entry-overlay-header p { margin: 0; color: var(--muted); font-size: 11px; }
.map-entry-overlay-close { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--paper); cursor: pointer; font-size: 21px; line-height: 1; }
.map-entry-overlay-close:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-hover); }
.map-entry-overlay-body { min-height: 0; padding: 15px; overflow: auto; background: var(--surface-page); scrollbar-gutter: stable; }
.map-entry-overlay-body.trainer-overlay-body { padding: 0; }
.map-entry-overlay-body .trainer-card { box-shadow: 0 6px 22px rgba(20, 42, 28, .07); }
.map-entry-overlay-body .trainer-card.without-header { border: 0; border-radius: 0; box-shadow: none; }
.trainer-card-header.without-completion-toggle { grid-template-columns: 64px minmax(0, 1fr); }
.trainer-card-header.ordered.without-completion-toggle { grid-template-columns: 52px 64px minmax(0, 1fr); }
.map-item-overview { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.map-item-overlay-sprite { width: 80px; height: 80px; display: grid; place-items: center; border-radius: 15px; color: var(--green); background: var(--green-soft); font-size: 25px; }
.map-item-overlay-sprite img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px var(--sprite-shadow)); }
.map-item-overview > div { min-width: 0; }
.map-item-overview strong { display: block; margin-bottom: 6px; font-size: 16px; }
.map-item-overview p { margin: 0 0 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.map-entry-overlay-footer { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; padding: 10px 15px; border-top: 1px solid var(--line); border-radius: 0 0 13px 13px; background: var(--paper); }
.map-entry-overlay-toggle { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 800; }
.map-entry-overlay-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.map-entry-overlay-check { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: transparent; background: var(--surface-input); font-size: 13px; transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.map-entry-overlay-toggle:hover .map-entry-overlay-check { border-color: var(--green); color: var(--green); }
.map-entry-overlay-toggle input:focus-visible + .map-entry-overlay-check { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.map-entry-overlay-toggle input:checked + .map-entry-overlay-check { border-color: var(--green); color: var(--on-green); background: var(--green); }
.checklist-heading { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }.checklist-heading h3 { font-size: 18px; margin: 0 0 5px; }.checklist-heading p { color: var(--muted-light); font-family: var(--font-body); font-size: 11px; line-height: 1.45; margin: 0; }.checklist-heading button { border: 0; background: var(--green-soft); color: var(--green); border-radius: 6px; padding: 8px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.entry-list { max-height: 590px; overflow: auto; }
.entry-row { min-height: 72px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }.entry-row:last-child { border-bottom: 0; }.entry-row:hover { background: var(--surface-hover); }.entry-row.done { background: var(--surface-done); }
.entry-row > input { position: absolute; opacity: 0; pointer-events: none; }.custom-check { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; color: transparent; display: grid; place-items: center; flex: 0 0 auto; font-size: 10px; }.entry-row.done .custom-check { color: var(--on-green); background: var(--green); border-color: var(--green); }
.entry-symbol { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: 0 0 auto; }.pokemon-symbol { color: var(--green); background: var(--green-soft); }.items-symbol { color: var(--warning-text); background: var(--warning-soft); border-radius: 9px; }.trainers-symbol { color: var(--red); background: var(--trainer-soft); border-radius: 9px; }
.entry-row.item-row { min-height: 80px; padding-block: 8px; }
.item-sprite { width: 64px; height: 64px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: var(--warning-soft); }
.item-sprite img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.entry-row.done .item-sprite { opacity: .58; filter: saturate(.65); }
.pokemon-sprites { width: 52px; height: 50px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pokemon-sprites img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.pokemon-sprites.multiple img { width: 36px; height: 36px; margin: 0 -5px; }
.entry-row.done .pokemon-sprites { opacity: .58; filter: saturate(.65); }
.entry-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }.entry-copy strong { font-size: 13px; }.entry-copy small { color: var(--muted-light); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }.entry-row.done .entry-copy strong { text-decoration: line-through; color: var(--muted); }
.item-sprite + .entry-copy small { display: -webkit-box; line-height: 1.35; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.entry-method { color: var(--ink-soft); font-size: 11px; background: var(--surface-subtle); border-radius: 99px; padding: 5px 8px; white-space: nowrap; }.hidden-badge { color: var(--warning-text); background: var(--warning-soft); border-radius: 4px; padding: 4px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Catchable Pokémon grid */
.pokemon-checklist-panel { overflow: visible; }
.pokemon-groups { display: grid; gap: 34px; padding: 26px; background: var(--surface-page); }
.pokemon-group { min-width: 0; }
.pokemon-group-heading { min-height: 55px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pokemon-group-heading > div { flex: 1; min-width: 0; }
.pokemon-group-heading h4 { margin: 0 0 5px; font-family: var(--font-pixel); font-size: 16px; line-height: 1.3; }
.pokemon-group-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.pokemon-group-icon { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); font-family: var(--font-body); font-size: 16px; }
.pokemon-group-icon.grass { color: #3b8d5d; background: #e4f2e8; }
.pokemon-group-icon.water { color: #347fa7; background: #e1f1f7; }
.pokemon-group-icon.other { color: var(--warning-text); background: var(--warning-soft); }
[data-theme='dark'] .pokemon-group-icon.grass { color: #75d49a; background: #1d3b2c; }
[data-theme='dark'] .pokemon-group-icon.water { color: #78c4e8; background: #193442; }
.pokemon-group-count { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--paper); font-family: var(--font-pixel); font-size: 11px; font-weight: 700; }

.pokemon-compact-groups { gap: 28px; padding: 22px; }
.pokemon-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.pokemon-table-scroll:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.pokemon-compact-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.pokemon-column-name { width: 29%; }
.pokemon-column-versions { width: 100px; }
.pokemon-column-method { width: auto; }
.pokemon-column-level { width: 78px; }
.pokemon-column-rate { width: 102px; }
.pokemon-column-action { width: 52px; }
.pokemon-compact-table th { height: 38px; padding: 8px 11px; border-bottom: 1px solid var(--line); color: var(--muted-light); background: var(--surface-sidebar); font-family: var(--font-pixel); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.pokemon-compact-table th:nth-last-child(-n+3) { text-align: center; }
.pokemon-compact-row { height: 80px; transition: background-color .15s ease; }
.pokemon-compact-row:hover { background: var(--surface-hover); }
.pokemon-compact-row.done { background: var(--surface-done); }
.pokemon-compact-row.other-version { color: var(--muted); background: var(--surface-page); }
.pokemon-compact-row td { min-width: 0; padding: 8px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.pokemon-compact-row:last-child td { border-bottom: 0; }
.pokemon-compact-name > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.pokemon-compact-identity { min-width: 0; display: grid; justify-items: start; gap: 5px; }
.pokemon-compact-name strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-compact-row.done .pokemon-compact-name strong { color: var(--muted); text-decoration: line-through; }
.pokemon-compact-sprites { width: 64px; height: 64px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; background: #e5eef8; }
[data-theme='dark'] .pokemon-compact-sprites { background: #1c3442; }
.pokemon-compact-sprites img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.pokemon-compact-sprites.multiple img { width: 46px; height: 46px; margin: 0 -10px; }
.pokemon-compact-row.done .pokemon-compact-sprites { opacity: .62; filter: saturate(.65); }
.pokemon-compact-versions > div { display: inline-flex; align-items: center; gap: 3px; }
.compact-version-chip { min-width: 29px; height: 24px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 4px; font-family: var(--font-pixel); font-size: 10px; font-weight: 700; line-height: 1; }
.compact-version-chip.firered.available { color: #25100a; background: #f2773e; border-color: #f2773e; }
.compact-version-chip.leafgreen.available { color: #071d0c; background: #4bcf64; border-color: #4bcf64; }
.compact-version-chip.firered.unavailable { color: #d75b31; }
.compact-version-chip.leafgreen.unavailable { color: #299846; }
[data-theme='dark'] .compact-version-chip.firered.available { color: #28100a; background: #ff8a56; border-color: #ff8a56; }
[data-theme='dark'] .compact-version-chip.leafgreen.available { color: #06190a; background: #67d879; border-color: #67d879; }
[data-theme='dark'] .compact-version-chip.firered.unavailable { color: #ff9165; }
[data-theme='dark'] .compact-version-chip.leafgreen.unavailable { color: #75d888; }
.pokemon-compact-method > div { min-width: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.pokemon-compact-method strong { flex: 0 0 auto; color: var(--ink); font-size: 12px; }
.pokemon-compact-area { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-compact-row.other-version .pokemon-compact-method strong { color: var(--muted); }
.encounter-method-icon { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; color: var(--green); background: var(--green-soft); font-family: var(--font-body); font-size: 12px; }
.pokemon-compact-level, .pokemon-compact-rate { color: var(--ink); font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
.pokemon-compact-row.other-version .pokemon-compact-level, .pokemon-compact-row.other-version .pokemon-compact-rate { color: var(--muted); }
.pokemon-compact-action { text-align: center; }
.pokemon-caught-check { width: 31px; height: 31px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: transparent; background: var(--surface-input); cursor: pointer; font-size: 13px; }
.pokemon-caught-check:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.pokemon-caught-check[aria-pressed='true'] { border-color: var(--green); color: var(--on-green); background: var(--green); }
.pokemon-caught-check:disabled { cursor: not-allowed; opacity: .28; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Run Pokédex */
.pokedex-view { min-height: 0; height: 100%; padding: 38px clamp(22px, 4vw, 58px) 70px; overflow-y: auto; background: var(--surface-page); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.pokedex-hero { max-width: 1420px; display: flex; align-items: center; justify-content: space-between; gap: 35px; margin: 0 auto 28px; }
.pokedex-hero .eyebrow { margin-bottom: 8px; }
.pokedex-hero h2 { margin: 0 0 8px; font-family: var(--font-pixel); font-size: 39px; }
.pokedex-hero p { max-width: 680px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.pokedex-summary { min-width: 260px; display: flex; align-items: center; gap: 15px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 5px 18px rgba(20, 44, 29, .05); }
.pokedex-summary > div { min-width: 0; flex: 1; }
.pokedex-summary strong { display: block; color: var(--green); font-family: var(--font-pixel); font-size: 21px; }
.pokedex-summary strong span { color: var(--muted-light); font-size: 13px; }
.pokedex-summary small { display: block; margin: 3px 0 8px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.pokedex-summary-ball { width: 48px; height: 48px; flex: 0 0 auto; position: relative; border: 3px solid var(--green); border-radius: 50%; background: linear-gradient(to bottom, var(--green) 0 43%, transparent 43% 57%, var(--paper) 57%); }
.pokedex-summary-ball::before { content: ''; position: absolute; left: -2px; right: -2px; top: 19px; height: 4px; background: var(--green); }
.pokedex-summary-ball i { width: 14px; height: 14px; position: absolute; z-index: 1; left: 14px; top: 14px; border: 3px solid var(--green); border-radius: 50%; background: var(--paper); }
.pokedex-panel { max-width: 1420px; margin: 0 auto; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); overflow: hidden; }
.pokedex-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-sidebar); }
.pokedex-scope-switch { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.pokedex-scope-switch button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.pokedex-scope-switch button:hover:not(:disabled) { color: var(--green); background: var(--green-wash); }
.pokedex-scope-switch button.active { color: var(--on-green); background: var(--green); box-shadow: 0 2px 5px rgba(25, 63, 41, .18); }
.pokedex-scope-switch button:disabled { color: var(--muted-light); cursor: not-allowed; }
.pokedex-search { width: min(360px, 100%); background: var(--paper); }
.pokedex-filters { display: flex; align-items: center; gap: 5px; }
.pokedex-filters button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.pokedex-filters button:hover { color: var(--green); background: var(--green-wash); }
.pokedex-filters button.active { color: var(--green); border-color: var(--line); background: var(--paper); }
.pokedex-filters button span { min-width: 22px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; color: var(--muted); background: var(--surface-page); font-size: 9px; }
.pokedex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 1px; padding: 1px; background: var(--line); }
.pokedex-card { min-width: 0; min-height: 185px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 20px 10px 13px; color: var(--ink); background: var(--paper); overflow: hidden; transition: background-color .15s ease, box-shadow .15s ease; }
.pokedex-card:hover { z-index: 1; background: var(--surface-hover); box-shadow: inset 0 0 0 2px var(--line-strong); }
.pokedex-card.caught { background: linear-gradient(160deg, var(--green-soft), var(--paper) 60%); }
.pokedex-card.caught:hover { box-shadow: inset 0 0 0 2px var(--green); }
.pokedex-number { position: absolute; top: 10px; left: 11px; color: var(--muted-light); font-family: var(--font-pixel); font-size: 9px; font-weight: 700; }
.pokedex-card.caught .pokedex-number { color: var(--green); }
.pokedex-caught-toggle { width: 28px; height: 28px; position: absolute; z-index: 2; top: 6px; right: 6px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; transition: transform .15s ease; }
.pokedex-caught-toggle:hover { transform: scale(1.1); }
.pokeball { width: 22px; height: 22px; display: block; box-sizing: border-box; border: 2px solid #000; border-radius: 50%; background-image: radial-gradient(#fff 10%, #fff 10%, #000 10%, #000 35%, transparent 35%, transparent), linear-gradient(#e53935 40%, #000 40%, #000 60%, #fff 60%); transition: filter .15s ease, opacity .15s ease; }
.pokedex-caught-toggle[aria-pressed='false'] .pokeball { opacity: .45; filter: grayscale(1); }
.pokedex-sprite-button { width: 104px; height: 104px; display: grid; place-items: center; padding: 4px; border: 0; border-radius: 50%; color: inherit; background: transparent; cursor: pointer; }
.pokedex-sprite-button:hover { background: var(--green-wash); }
.pokedex-sprite { width: 96px; height: 96px; display: grid; place-items: center; }
.pokedex-sprite img { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px var(--sprite-shadow)); transition: filter .18s ease, opacity .18s ease; }
.pokedex-sprite-button:hover .pokedex-sprite img { transform: translateY(-2px); }
.pokedex-card.not-caught .pokedex-sprite img { opacity: .58; filter: grayscale(1) contrast(.75) brightness(1.05); }
[data-theme='dark'] .pokedex-card.not-caught .pokedex-sprite img { opacity: .48; filter: grayscale(1) contrast(.8) brightness(.85); }
.pokedex-card-copy { min-width: 0; display: grid; justify-items: center; gap: 5px; }
.pokedex-card-copy strong { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pokedex-card.not-caught .pokedex-card-copy strong { color: var(--muted); }
.pokedex-empty { min-height: 280px; }

/* Evolution chain dialog */
.evolution-modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(8, 18, 12, .64); backdrop-filter: blur(5px); }
.evolution-modal { width: min(1180px, 100%); max-height: min(820px, 92vh); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 19px; color: var(--ink); background: var(--paper); box-shadow: 0 26px 90px rgba(0, 0, 0, .3); }
.evolution-modal-header { min-height: 112px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 27px 21px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--green-soft), var(--paper) 68%); }
.evolution-modal-header .eyebrow { display: block; margin-bottom: 5px; }
.evolution-modal-header h2 { margin: 0 0 5px; font-size: clamp(22px, 3vw, 30px); }
.evolution-modal-header p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.evolution-modal-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--paper); cursor: pointer; font-size: 25px; line-height: 1; }
.evolution-modal-close:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-hover); }
.evolution-modal-body { min-height: 0; display: grid; align-content: start; gap: 20px; padding: 34px 28px 38px; overflow: auto; scrollbar-gutter: stable; background: radial-gradient(circle at center, var(--green-wash), transparent 62%), var(--surface-page); }
.evolution-path { width: max-content; min-width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 18px 10px; }
.evolution-species { width: 190px; min-width: 190px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 5px; border: 0; border-radius: 16px; color: var(--ink); background: transparent; text-align: center; }
.evolution-caught-toggle { top: 5px; right: 5px; }
.evolution-stage { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.evolution-species-sprite { width: 156px; height: 156px; display: grid; place-items: center; margin: 3px 0 2px; border: 5px solid var(--paper); border-radius: 50%; background: var(--green-soft); box-shadow: 0 0 0 1px var(--line-strong), 0 10px 25px rgba(25, 63, 41, .11); }
.evolution-species.selected .evolution-species-sprite { box-shadow: 0 0 0 3px var(--green), 0 12px 28px rgba(25, 63, 41, .18); }
.evolution-species-sprite img { width: 128px; height: 128px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 5px 4px var(--sprite-shadow)); }
.evolution-species.not-caught .evolution-species-sprite img { opacity: .58; filter: grayscale(1) contrast(.75) brightness(1.05) drop-shadow(0 5px 4px var(--sprite-shadow)); }
[data-theme='dark'] .evolution-species.not-caught .evolution-species-sprite img { opacity: .48; filter: grayscale(1) contrast(.8) brightness(.85) drop-shadow(0 5px 4px var(--sprite-shadow)); }
.evolution-species-number { color: var(--muted-light); font-size: 9px; font-weight: 800; }
.evolution-species > strong { font-size: 18px; line-height: 1.2; }
.evolution-requirement { width: 180px; min-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; text-align: center; }
.evolution-requirement-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 1px; border: 1px solid var(--line); border-radius: 12px; color: var(--green); background: var(--paper); font-size: 15px; font-weight: 900; }
.evolution-requirement-icon.item { border: 0; background: transparent; }
.evolution-requirement-icon img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.evolution-requirement small { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.evolution-requirement > strong { max-width: 180px; font-size: 12px; line-height: 1.35; }
.evolution-arrow { margin-top: 3px; color: var(--green); font-size: 28px; line-height: 1; }
.evolution-no-transition { margin: -8px auto 0; padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--paper); font-size: 11px; }
.story-confirmation-backdrop.evolution-capture-backdrop { z-index: 110; }
.story-confirmation-dialog.evolution-capture-dialog { grid-template-columns: 88px minmax(0, 1fr); }
.evolution-capture-preview { width: 88px; height: 88px; display: grid; place-items: center; align-self: center; border: 1px solid var(--line); border-radius: 50%; background: var(--green-soft); }
.evolution-capture-preview img { width: 88px; height: 88px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px var(--sprite-shadow)); }
.evolution-capture-preview.not-caught img { opacity: .58; filter: grayscale(1) contrast(.75) brightness(1.05) drop-shadow(0 3px 3px var(--sprite-shadow)); }
[data-theme='dark'] .evolution-capture-preview.not-caught img { opacity: .48; filter: grayscale(1) contrast(.8) brightness(.85) drop-shadow(0 3px 3px var(--sprite-shadow)); }
.evolution-capture-dialog.removing .button-primary { background: var(--red); box-shadow: 0 9px 24px rgba(220, 85, 75, .2); }

/* Official Pokémon type badges */
.pokemon-type-badges { min-width: 0; height: 20px; display: inline-flex; align-items: center; gap: 3px; }
.pokemon-type-badge { --type-color: #68a090; --type-border: #41685e; width: 43px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 43px; box-sizing: border-box; border: 1px solid var(--type-border); border-radius: 4px; color: #fff; background: var(--type-color); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), inset 0 -1px 0 rgba(0,0,0,.12); font-family: var(--font-body); font-size: 8px; font-weight: 900; letter-spacing: .015em; line-height: 1; text-transform: uppercase; text-shadow: -1px -1px 0 rgba(30,30,30,.72), 1px -1px 0 rgba(30,30,30,.72), -1px 1px 0 rgba(30,30,30,.72), 1px 1px 0 rgba(30,30,30,.72); white-space: nowrap; }
.pokemon-type-badge.type-normal { --type-color: #a8a878; --type-border: #6d6d4e; }
.pokemon-type-badge.type-fighting { --type-color: #c03028; --type-border: #7d1f1a; }
.pokemon-type-badge.type-rock { --type-color: #b8a038; --type-border: #756624; }
.pokemon-type-badge.type-fire { --type-color: #f08030; --type-border: #a65321; }
.pokemon-type-badge.type-poison { --type-color: #a040a0; --type-border: #672967; }
.pokemon-type-badge.type-ghost { --type-color: #705898; --type-border: #493963; }
.pokemon-type-badge.type-water { --type-color: #6890f0; --type-border: #445e9c; }
.pokemon-type-badge.type-ground { --type-color: #e0c068; --type-border: #927d44; }
.pokemon-type-badge.type-dragon { --type-color: #7038f8; --type-border: #4924a1; }
.pokemon-type-badge.type-electric { --type-color: #f8d030; --type-border: #a1871f; }
.pokemon-type-badge.type-flying { --type-color: #a890f0; --type-border: #6d5e9c; }
.pokemon-type-badge.type-dark { --type-color: #705848; --type-border: #49392f; }
.pokemon-type-badge.type-grass { --type-color: #78c850; --type-border: #4e8234; }
.pokemon-type-badge.type-psychic { --type-color: #f85888; --type-border: #a13959; }
.pokemon-type-badge.type-steel { --type-color: #b8b8d0; --type-border: #787888; }
.pokemon-type-badge.type-ice { --type-color: #98d8d8; --type-border: #638d8d; }
.pokemon-type-badge.type-bug { --type-color: #a8b820; --type-border: #6d7815; }
.pokemon-type-badge.type-fairy { --type-color: #ee99ac; --type-border: #9b6470; }
.pokemon-type-badge.type-unknown { --type-color: #68a090; --type-border: #41685e; }

/* Trainer battles */
.trainer-grid { display: grid; gap: 14px; padding: 22px; background: var(--surface-page); }
.trainer-challenge { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--paper); box-shadow: 0 7px 22px rgba(27, 47, 35, .06); }
.trainer-challenge-header { min-height: 102px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--green-soft), var(--paper) 68%); }
.trainer-challenge-header > div { min-width: 0; }
.trainer-challenge-kicker { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.trainer-challenge-header h4 { margin: 3px 0 2px; font-size: 19px; }
.trainer-challenge-header p { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.trainer-challenge-header small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.trainer-challenge-count { align-self: start; padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--paper); font-size: 10px; font-weight: 700; white-space: nowrap; }
.trainer-challenge-emblem { width: 48px; height: 48px; display: block; flex: 0 0 auto; image-rendering: pixelated; background-image: url('../sprites/badges/kanto.png'); background-repeat: no-repeat; background-size: 384px 48px; }
.trainer-challenge-emblem.badge-0 { background-position: 0 0; }
.trainer-challenge-emblem.badge-1 { background-position: -48px 0; }
.trainer-challenge-emblem.badge-2 { background-position: -96px 0; }
.trainer-challenge-emblem.badge-3 { background-position: -144px 0; }
.trainer-challenge-emblem.badge-4 { background-position: -192px 0; }
.trainer-challenge-emblem.badge-5 { background-position: -240px 0; }
.trainer-challenge-emblem.badge-6 { background-position: -288px 0; }
.trainer-challenge-emblem.badge-7 { background-position: -336px 0; }
.trainer-challenge-emblem.league { display: grid; place-items: center; border: 2px solid #d8a72f; border-radius: 50%; color: #7b5410; background: radial-gradient(circle, #fff5bd 0 42%, #efc74c 43% 62%, #9d6c16 63%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.5); }
.trainer-challenge-emblem.league span { font-size: 19px; text-shadow: 0 1px rgba(255,255,255,.6); }
[data-theme='dark'] .trainer-challenge-emblem.league { color: #5a3906; }
.trainer-challenge-battles { display: grid; gap: 11px; padding: 14px; background: var(--surface-page); }
.trainer-standalone-heading { padding: 10px 3px 2px; }
.trainer-standalone-heading h4 { margin: 0 0 4px; font-size: 15px; }
.trainer-standalone-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.trainer-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.trainer-card.done { border-color: var(--green); }
.trainer-card-header { min-height: 88px; display: grid; grid-template-columns: 64px minmax(0, 1fr) 31px; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.trainer-card-header.ordered { grid-template-columns: 52px 64px minmax(0, 1fr) 31px; }
.trainer-card.highlight { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); box-shadow: 0 4px 14px rgba(177, 60, 53, .08); }
.trainer-card.highlight .trainer-card-header { background: linear-gradient(90deg, var(--trainer-soft), var(--paper) 62%); }
.trainer-card.done .trainer-card-header { background: var(--surface-done); }
.trainer-battle-order { width: 52px; min-height: 55px; display: grid; align-content: center; justify-items: center; gap: 4px; padding-right: 9px; border-right: 1px solid var(--line-soft); text-align: center; }
.trainer-battle-order strong { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 13px; }
.trainer-battle-order small { color: var(--muted-light); font-size: 8px; font-weight: 700; line-height: 1.15; text-transform: uppercase; }
.trainer-card.highlight .trainer-battle-order strong { color: var(--on-green); background: var(--red); }
.trainer-card-sprite { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: var(--red); background: var(--trainer-soft); font-size: 16px; }
.trainer-card-sprite img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.trainer-card-copy { min-width: 0; }
.trainer-card-copy h4 { margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.trainer-card-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.trainer-variant-count { display: inline-block; margin-top: 7px; padding: 3px 7px; border-radius: 99px; color: var(--red); background: var(--trainer-soft); font-size: 10px; font-weight: 700; }
.trainer-variants { display: grid; }
.trainer-party-variant { min-width: 0; display: grid; grid-template-columns: minmax(175px, 225px) minmax(0, 1fr); align-items: center; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.trainer-party-variant:last-child { border-bottom: 0; }
.trainer-party-label { min-width: 0; }
.trainer-party-label h5 { margin: 0 0 4px; color: var(--ink); font-size: 11px; line-height: 1.4; }
.trainer-party-label span { color: var(--muted-light); font-size: 10px; }
.trainer-party-label .trainer-variant-condition { display: flex; align-items: flex-start; gap: 5px; margin: 7px 0 0; color: var(--green); font-size: 9px; line-height: 1.4; }
.trainer-variant-condition i { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green-soft); font-size: 9px; font-style: normal; }
.trainer-party { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.trainer-pokemon { min-width: 88px; max-width: 116px; flex: 1 0 88px; display: grid; justify-items: center; gap: 2px; padding: 6px 5px 7px; border-radius: 9px; background: var(--surface-page); text-align: center; }
.trainer-pokemon img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px var(--sprite-shadow)); }
.trainer-pokemon > span { min-width: 0; width: 100%; display: grid; gap: 2px; }
.trainer-pokemon strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.trainer-pokemon small { color: var(--muted); font-size: 10px; }
.trainer-pokemon .pokemon-type-badges { justify-self: center; margin-top: 2px; }
.trainer-card.done .trainer-pokemon img { opacity: .62; filter: saturate(.65); }

.tab-empty { padding: 65px 20px; text-align: center; color: var(--muted); }.tab-empty > span { font-size: 30px; color: var(--muted-light); }.tab-empty h4 { color: var(--ink); font-size: 17px; margin: 10px 0 5px; }.tab-empty p { font-size: 12px; margin: 0; }
.run-loading, .not-found-panel, .storage-error-panel { min-height: calc(100vh - 170px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 40px; }.run-loading .brand-mark { animation: spin 1.3s linear infinite; }.run-loading p, .not-found-panel p { color: var(--ink-soft); font-size: 12px; }.not-found-panel > span { width: 55px; height: 55px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-family: var(--font-pixel); font-size: 30px; }.not-found-panel h1 { font-family: var(--font-pixel); margin: 5px 0 0; }.storage-error-panel .storage-notice { max-width: 560px; text-align: left; }
@keyframes spin { to { transform: rotate(360deg); } }
.navigation-scrim { display: none; }

/* Guided story */
.story-sidebar-heading { flex: 0 0 auto; padding: 24px 20px 18px; border-bottom: 1px solid var(--line); background: var(--surface-sidebar); }
.story-sidebar-heading h2 { margin: 3px 0 16px; font-size: 23px; }
.story-sidebar-progress { display: grid; gap: 7px; }
.story-sidebar-progress small { color: var(--muted); font-size: 11px; }
.story-segment-list { min-height: 0; flex: 1; margin: 0; padding: 12px 10px 32px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; list-style: none; }
.story-segment-list li { min-height: 62px; border-radius: 9px; color: var(--muted); position: relative; }
.story-segment-list li + li::before { content: ''; position: absolute; left: 25px; top: -10px; width: 1px; height: 12px; background: var(--line-strong); }
.story-segment-list li > button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.story-segment-list li > button:disabled { cursor: default; }
.story-segment-list li.current > button { color: var(--ink); background: var(--paper); box-shadow: 0 3px 12px rgba(0, 0, 0, .07); }
.story-segment-list li.viewed > button { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.story-segment-list li.done { color: var(--ink-soft); }
.story-segment-list li.locked { opacity: .58; }
.story-segment-marker { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--surface-sidebar); font-size: 9px; font-weight: 800; }
.story-segment-list li.complete-100 .story-segment-marker { border-color: var(--green); color: var(--on-green); background: var(--green); font-size: 11px; }
.story-segment-list li.in-progress .story-segment-marker { border-color: var(--warning-text); color: var(--warning-text); background: var(--warning-soft); }
.story-segment-list li.not-started .story-segment-marker { border-color: var(--line-strong); color: var(--muted); background: var(--surface-subtle); }
.story-segment-copy { min-width: 0; display: grid; gap: 3px; }
.story-segment-list small { overflow: hidden; color: var(--muted-light); font-size: 8px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
.story-segment-list strong { overflow: hidden; font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.story-segment-percent { min-width: 37px; padding: 4px 5px; border-radius: 99px; color: var(--muted); background: var(--surface-subtle); font-size: 9px; font-weight: 800; text-align: center; }
.story-segment-list li.complete-100 .story-segment-percent { color: var(--green); background: var(--green-soft); }
.story-segment-list li.in-progress .story-segment-percent { color: var(--warning-text); background: var(--warning-soft); }

.story-content { min-width: 0; width: 100%; height: 100%; max-width: 1220px; margin: 0 auto; padding: clamp(27px, 4vw, 48px) clamp(20px, 4.5vw, 64px) 80px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.story-complete-banner { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 24px; padding: 16px 20px; border: 1px solid var(--green); border-radius: 12px; background: var(--green-soft); }
.story-complete-banner > span { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; color: var(--on-green); background: var(--green); font-size: 22px; }
.story-complete-banner h2 { margin: 2px 0 3px; font-size: 21px; }
.story-complete-banner p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.story-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.story-hero-copy { min-width: 0; }
.story-hero h2 { margin: 7px 0 8px; font-size: clamp(34px, 4vw, 54px); line-height: 1.05; }
.story-hero p { max-width: 790px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.story-hero-status { width: 132px; flex: 0 0 132px; display: grid; justify-items: center; gap: 10px; }
.story-hero-status > div { width: 100%; display: grid; justify-items: center; gap: 3px; }
.story-hero-status > div > strong { color: var(--green); font-size: 21px; }
.story-hero-status > div > small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.story-hero-status .progress-track { width: 100%; margin-top: 4px; }
.story-unlocks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.story-unlocks span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--paper); font-size: 9px; font-weight: 700; }
.story-milestone-number { width: 74px; height: 74px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 27px; font-weight: 800; }
.story-milestone-emblem { width: 72px; height: 72px; flex: 0 0 auto; background-size: 576px 72px; }
.story-milestone-emblem.badge-0 { background-position: 0 0; }
.story-milestone-emblem.badge-1 { background-position: -72px 0; }
.story-milestone-emblem.badge-2 { background-position: -144px 0; }
.story-milestone-emblem.badge-3 { background-position: -216px 0; }
.story-milestone-emblem.badge-4 { background-position: -288px 0; }
.story-milestone-emblem.badge-5 { background-position: -360px 0; }
.story-milestone-emblem.badge-6 { background-position: -432px 0; }
.story-milestone-emblem.badge-7 { background-position: -504px 0; }
.story-milestone-emblem.league { width: 72px; height: 72px; }

.starter-panel { overflow: hidden; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.story-section-heading { padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }
.story-section-heading h3 { margin: 4px 0 5px; font-size: 22px; }
.story-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 22px; background: var(--surface-page); }
.starter-card { min-width: 0; min-height: 218px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); cursor: pointer; transition: transform .15s, border .15s, box-shadow .15s; }
.starter-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.starter-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); background: var(--green-soft); }
.starter-card:disabled { cursor: default; }
.starter-card:disabled:hover { transform: none; box-shadow: none; }
.starter-sprite { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-page); }
.starter-sprite img { grid-area: 1 / 1; width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px var(--sprite-shadow)); }
.starter-card > strong { font-size: 17px; }
.starter-select-label { margin-top: 3px; color: var(--green); font-size: 11px; font-weight: 700; }

.story-location-strip { display: flex; gap: 8px; margin-bottom: 14px; padding: 2px 2px 9px; overflow-x: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.story-location-strip button { min-width: 160px; height: 57px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); text-align: left; cursor: pointer; }
.story-location-strip button.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-soft); }
.story-location-strip button > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-subtle); font-size: 9px; font-weight: 800; }
.story-location-strip button.active > span { color: var(--on-green); background: var(--green); }
.story-location-strip strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.story-location-strip small { color: var(--muted-light); font-size: 9px; }
.story-location-panel { overflow: hidden; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.story-location-heading { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.story-location-heading h3 { margin: 4px 0 4px; font-size: 24px; }
.story-location-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.story-location-progress { width: 130px; flex: 0 0 auto; }
.story-location-progress strong { color: var(--green); font-size: 20px; }
.story-location-progress small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.story-location-progress .progress-track { margin-top: 8px; }
.story-tabs { margin: 0; padding: 15px 16px 0; }
.story-checklist-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.story-checklist-heading h4 { margin: 0 0 4px; font-size: 16px; }
.story-checklist-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.story-checklist-heading button { flex: 0 0 auto; padding: 7px 10px; border: 0; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; cursor: pointer; }
.story-location-panel .pokemon-groups, .story-location-panel .trainer-grid { padding: 20px; }
.story-location-panel > .location-map-view { border: 0; border-radius: 0; }
.story-item-list { max-height: none; }
.story-tab-empty { padding-block: 42px; }
.story-empty { margin-bottom: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.story-milestone-card { min-height: 124px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 13px; background: linear-gradient(135deg, var(--green-soft), var(--paper) 68%); }
.story-milestone-check { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--on-green); background: var(--green); font-size: 18px; }
.story-milestone-card h3 { margin: 3px 0 4px; font-size: 18px; }
.story-milestone-card p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.story-milestone-card .button { white-space: nowrap; }
.story-milestone-card .button:disabled { opacity: .45; cursor: not-allowed; }
.story-milestone-card.complete { border-color: var(--green); }
.story-finished-label { padding: 7px 10px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.story-milestone-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.story-milestone-actions .button { min-height: 35px; padding: 8px 11px; font-size: 10px; }

.story-confirmation-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: rgba(10, 18, 13, .58); backdrop-filter: blur(3px); }
.story-confirmation-dialog { width: min(510px, 100%); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 25px; border: 1px solid var(--line-strong); border-radius: 15px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(0, 0, 0, .3); }
.story-confirmation-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--warning-text); background: var(--warning-soft); font-size: 22px; font-weight: 800; }
.story-confirmation-dialog h2 { margin: 4px 0 7px; font-size: 22px; }
.story-confirmation-dialog p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.story-confirmation-progress { grid-column: 1 / -1; display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-page); }
.story-confirmation-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.story-confirmation-progress strong { color: var(--green); font-size: 16px; }
.story-confirmation-progress small { color: var(--warning-text); font-size: 10px; }
.story-confirmation-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 2px; }
.starter-confirmation-dialog { grid-template-columns: 96px minmax(0, 1fr); }
.starter-confirmation-sprite { width: 96px; height: 96px; display: grid; place-items: center; align-self: center; border: 1px solid var(--line); border-radius: 50%; background: var(--green-soft); }
.starter-confirmation-sprite img { grid-area: 1 / 1; width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 3px var(--sprite-shadow)); }
.starter-confirmation-preview { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-page); }
.starter-confirmation-preview > div:first-child { display: grid; gap: 3px; }
.starter-confirmation-preview small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.starter-confirmation-preview strong { color: var(--ink); font-size: 17px; }

#blazor-error-ui { background: var(--warning-soft); color: var(--ink); bottom: 0; box-shadow: 0 -2px 8px rgba(0,0,0,.15); display: none; left: 0; padding: .8rem 1.25rem; position: fixed; width: 100%; z-index: 1000; font-size: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; }
.blazor-error-boundary { background: #b83d36; padding: 1rem; color: white; }
.loading-progress { position: absolute; display: block; width: 7rem; height: 7rem; inset: 30vh 0 auto; margin: auto; }.loading-progress circle { fill: none; stroke: var(--line); stroke-width: .45rem; transform-origin: 50% 50%; transform: rotate(-90deg); }.loading-progress circle:last-child { stroke: var(--green); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; transition: stroke-dasharray .05s ease-in-out; }.loading-progress-text { position: absolute; text-align: center; font-family: var(--font-pixel); font-weight: 700; font-size: 11px; color: var(--green); inset: calc(30vh + 3.15rem) 0 auto; }.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

@media (max-width: 1050px) {
    .run-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .run-workspace { grid-template-columns: 270px minmax(0, 1fr); }
    .location-summary { grid-template-columns: repeat(3, 1fr); }.location-summary .summary-progress { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
    .hero-art { transform: scale(.88) rotate(-3deg); transform-origin: center; }
}

@media (max-width: 780px) {
    .app-header { height: 66px; }.brand { gap: 8px; font-size: 18px; }.app-nav a:not(.nav-new) { display: none; }.culture-selector { min-height: 36px; padding-inline: 7px; }.culture-selector > span:first-child { display: none; }.theme-toggle { width: 36px; min-height: 36px; padding: 0; justify-content: center; }.theme-label { display: none; }.app-nav .nav-new { padding: 9px 10px; font-size: 11px; line-height: 1.2; }.app-main { min-width: 0; }
    .home-hero { grid-template-columns: minmax(0, 1fr); padding-top: 60px; }.hero-copy { min-width: 0; }.hero-copy .eyebrow { font-size: 10px; line-height: 1.6; }.hero-art { height: 290px; width: min(480px, 100%); margin: -25px auto 0; }.hero-copy h1 { font-size: clamp(38px, 10vw, 46px); }
    .run-grid { grid-template-columns: 1fr; }.section-heading { align-items: flex-start; flex-direction: column; }.run-actions { width: 100%; justify-content: space-between; }.empty-state { align-items: flex-start; flex-wrap: wrap; }.empty-state .button { width: 100%; }
    .form-layout { grid-template-columns: 1fr; gap: 35px; }.form-intro { position: static; }.back-link { margin-bottom: 40px; }.form-page { padding-top: 25px; }
    .run-page { grid-template-rows: 80px minmax(0, 1fr); }.run-header { height: 80px; padding: 10px 17px; }.run-back { display: none; }.mobile-locations { display: block; }.overall-progress { width: 150px; }.overall-progress small { display: none; }
    .run-workspace { display: block; min-height: 0; }.location-sidebar { position: fixed; z-index: 21; left: 0; top: 66px; bottom: 0; width: min(330px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 40px rgba(21, 37, 27, .18); }.navigation-open .location-sidebar { transform: translateX(0); }.location-list { max-height: none; }
    .navigation-scrim { display: block; position: fixed; inset: 66px 0 0; z-index: 20; background: rgba(12, 25, 18, .35); border: 0; }
    .location-content, .story-content { height: 100%; padding: 32px 18px 65px; }.location-hero { align-items: flex-start; }.location-summary { grid-template-columns: 1fr 1fr 1fr; }.location-summary > div { padding: 12px; grid-template-columns: 1fr; text-align: center; }.location-summary .summary-icon { display: none; }.location-summary small { grid-column: 1; }
    .story-hero { align-items: flex-start; }.story-hero-status { width: 100px; flex-basis: 100px; }.story-milestone-number, .story-milestone-emblem { width: 58px; height: 58px; }.story-milestone-emblem { background-size: 464px 58px; }.story-milestone-emblem.badge-1 { background-position: -58px 0; }.story-milestone-emblem.badge-2 { background-position: -116px 0; }.story-milestone-emblem.badge-3 { background-position: -174px 0; }.story-milestone-emblem.badge-4 { background-position: -232px 0; }.story-milestone-emblem.badge-5 { background-position: -290px 0; }.story-milestone-emblem.badge-6 { background-position: -348px 0; }.story-milestone-emblem.badge-7 { background-position: -406px 0; }.story-milestone-emblem.league { width: 58px; height: 58px; }.story-milestone-card { grid-template-columns: 43px minmax(0, 1fr); }.story-milestone-check { width: 43px; height: 43px; }.story-milestone-card .button, .story-finished-label, .story-milestone-actions { grid-column: 2; justify-self: start; }
    .run-header .overall-progress { display: none; }.run-view-tabs { margin-left: auto; }.pokedex-view { padding: 30px 18px 55px; }.pokedex-hero { align-items: flex-start; }.pokedex-summary { min-width: 220px; }.pokedex-toolbar { align-items: stretch; flex-direction: column; }.pokedex-search { width: 100%; }.pokedex-filters { overflow-x: auto; }.pokedex-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
    .evolution-modal-backdrop { align-items: stretch; padding: 16px; }.evolution-modal { max-height: 100%; }.evolution-modal-header { min-height: 0; padding: 19px 18px 17px; }.evolution-modal-header p { display: none; }.evolution-modal-body { align-content: start; padding: 24px 16px 32px; }.evolution-path { width: 100%; min-width: 0; flex-direction: column; gap: 10px; padding: 5px 0 20px; }.evolution-requirement { width: 210px; min-width: 0; }.evolution-arrow { transform: rotate(90deg); }.evolution-species { width: 210px; min-width: 0; }
    .map-entry-popover { width: min(640px, calc(100% - 16px)); }.map-entry-popover.item-entry-overlay { width: min(420px, calc(100% - 16px)); }.map-entry-overlay-header { min-height: 0; }.map-entry-overlay-body { padding: 12px; }
    .entry-method { display: none; }
}

@media (max-width: 520px) {
    .app-footer { flex-direction: column; }.game-options { grid-template-columns: 1fr; }.form-card { padding: 24px 18px; }
    .hero-art { transform: scale(.72) rotate(-3deg); transform-origin: left top; width: 500px; margin-bottom: -80px; }.home-hero { overflow: hidden; }.runs-section { padding-top: 18px; }
    .run-header { gap: 12px; }.run-identity { flex: 1; gap: 10px; }.overall-progress { width: 90px; }.run-identity h1 { font-size: 20px; max-width: 145px; }.game-pill { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
    .location-hero { display: block; }.visit-button { margin-top: 18px; }.location-summary { grid-template-columns: 1fr 1fr; }.location-summary > div:nth-child(3) { border-top: 1px solid var(--line-soft); }.location-summary .summary-progress { grid-column: auto; border-top: 1px solid var(--line-soft); }.location-summary .summary-progress small { display: block; margin: 4px 0 0; }
    .content-tabs button { padding-inline: 10px; }.checklist-heading { align-items: flex-start; }.checklist-heading p { line-height: 1.45; }.entry-row { padding-inline: 12px; gap: 9px; }.entry-symbol { width: 31px; height: 31px; }.pokemon-sprites { width: 46px; }.pokemon-sprites img { width: 44px; height: 44px; }.pokemon-sprites.multiple img { width: 32px; height: 32px; }.hidden-badge { display: none; }
    .location-map-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 15px; }.location-map-actions { width: 100%; }.location-map-actions button, .location-map-actions a { flex: 1; }.location-map-canvas { min-height: 280px; max-height: 65vh; padding: 10px; }
    .map-entry-popover { border-radius: 12px; }.map-entry-overlay-header h2 { font-size: 18px; }.map-entry-overlay-header p { display: none; }.map-item-overview { grid-template-columns: 64px minmax(0, 1fr); gap: 11px; padding: 11px; }.map-item-overlay-sprite { width: 64px; height: 64px; border-radius: 12px; }.map-item-overview strong { font-size: 15px; }.map-item-overview p { font-size: 10px; }
    .pokemon-groups { gap: 25px; padding: 18px 13px; }.pokemon-group-heading { align-items: flex-start; }.pokemon-group-heading p { font-size: 11px; }.pokemon-compact-table { min-width: 760px; }.pokemon-compact-row { height: 80px; }.pokemon-compact-row td { padding-block: 8px; }
    .trainer-grid { padding: 14px 12px; }.trainer-challenge-header { grid-template-columns: 48px minmax(0, 1fr); padding: 14px 12px; }.trainer-challenge-count { grid-column: 2; justify-self: start; }.trainer-challenge-battles { padding: 10px; }.trainer-card-header { gap: 9px; padding-inline: 10px; }.trainer-card-header.ordered { grid-template-columns: 43px 64px minmax(0, 1fr) 31px; }.trainer-battle-order { width: 43px; padding-right: 6px; }.trainer-battle-order small { font-size: 7px; }.trainer-party-variant { grid-template-columns: 1fr; gap: 8px; padding-inline: 11px; }.trainer-party-label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 10px; }.trainer-party-label h5 { margin: 0; }.trainer-party-label .trainer-variant-condition { grid-column: 1 / -1; }
    .story-hero h2 { font-size: 34px; }.story-hero-status { display: none; }.starter-grid { grid-template-columns: 1fr; padding: 14px; }.starter-card { min-height: 170px; }.story-location-heading { align-items: flex-start; }.story-location-progress { width: 95px; }.story-checklist-heading { align-items: flex-start; }.story-checklist-heading p { display: none; }.story-location-panel .pokemon-groups, .story-location-panel .trainer-grid { padding: 14px 10px; }.story-milestone-card { padding: 17px 15px; }.story-confirmation-dialog { grid-template-columns: 40px minmax(0, 1fr); padding: 20px 16px; }.story-confirmation-icon { width: 40px; height: 40px; }.starter-confirmation-dialog, .story-confirmation-dialog.evolution-capture-dialog { grid-template-columns: 72px minmax(0, 1fr); }.starter-confirmation-sprite, .starter-confirmation-sprite img, .evolution-capture-preview, .evolution-capture-preview img { width: 72px; height: 72px; }.starter-confirmation-preview { align-items: flex-start; flex-direction: column; }.story-confirmation-actions { display: grid; grid-template-columns: 1fr; }.story-confirmation-actions .button { width: 100%; }
    .run-view-tabs button { width: 40px; justify-content: center; gap: 0; padding: 0; font-size: 0; }.run-view-tabs button > span { width: 20px; height: 20px; display: grid; place-items: center; font-size: 17px; line-height: 1; }.pokedex-hero { display: grid; }.pokedex-hero h2 { font-size: 34px; }.pokedex-summary { width: 100%; min-width: 0; }.pokedex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.pokedex-card { min-height: 190px; }.pokedex-sprite-button { width: 94px; height: 94px; }.pokedex-sprite, .pokedex-sprite img { width: 86px; height: 86px; }
    .evolution-modal-backdrop { padding: 8px; }.evolution-modal { border-radius: 14px; }.evolution-modal-header h2 { font-size: 20px; }.evolution-modal-close { width: 34px; height: 34px; }.evolution-species-sprite { width: 142px; height: 142px; }.evolution-species-sprite img { width: 116px; height: 116px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
