@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;600;700&display=swap');

body {
    font-family: 'Cabin', sans-serif;
}
.pokemon-bg {
    background-color: #7aa0b8;
    background-image: url('https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/2a860bb0-1d61-4ac2-b998-cc9196e003be/d7j7rll-6af52978-b3f1-4086-a1c6-11a05f83b97c.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzJhODYwYmIwLTFkNjEtNGFjMi1iOTk4LWNjOTE5NmUwMDNiZVwvZDdqN3JsbC02YWY1Mjk3OC1iM2YxLTQwODYtYTFjNi0xMWEwNWY4M2I5N2MuanBnIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.svuGMxeubF9Ttdafrb56Xsqju1xq4AahTH04DyfMFdk');
    background-size: cover;
    background-position: center;
}
/* Hide scrollbar for Chrome, Safari, and Edge */
.container::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Internet Explorer, Edge, and Firefox */
.container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.current-evolution {
    font-weight: bold;
    color: #f87171; /* Tailwind's red-400 or a color of your choice */
    border: 2px solid #f87171; /* Tailwind's red-400 or a color of your choice */
    padding: 5px;
    border-radius: 5px;
    margin: 5px 0;
}
.evolution-stage {
    padding: 5px;
    margin: 5px 0;
}

.pokemon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem 0.6rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.pokemon-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.pokemon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-color: #fbbf24;
}

.pokemon-number {
    position: absolute;
    top: 8px;
    right: 7px;
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.pokemon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-top: 6px;
    margin-bottom: 4px;
}

.pokemon-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
}

.pokemon-card-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.pokemon-card-type-badge {
    font-size: 0.56rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 0.05rem 0.4rem;
    white-space: nowrap;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

/* ── Encounter modal ─────────────────────────────── */
.encounter-group {
    margin-bottom: 0.75rem;
}

.encounter-group:last-child {
    margin-bottom: 0;
}

.encounter-version-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #16a34a;
    padding: 0.25rem 0.1rem 0.3rem;
    border-bottom: 1px solid #d1fae5;
    margin-bottom: 0.35rem;
}

.encounter-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.25rem;
}

.encounter-row:last-child {
    margin-bottom: 0;
}

.encounter-area {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.encounter-meta {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.encounter-games {
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

/* ── Category scroll bar ─────────────────────────── */
.category-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #93c5fd #f1f5f9;
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;
}
.category-scroll::-webkit-scrollbar {
    height: 4px;
}
.category-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}
.category-scroll::-webkit-scrollbar-thumb {
    background: #93c5fd;
    border-radius: 9999px;
}

/* ── Item cards ───────────────────────────────────── */
.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem 0.6rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-color: #93c5fd;
}

.item-card-active {
    border-color: #3b82f6 !important;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.item-number {
    position: absolute;
    top: 8px;
    right: 7px;
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.item-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-top: 6px;
    margin-bottom: 4px;
    image-rendering: pixelated;
}

.item-no-sprite {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 0.4rem;
}

.item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
}

/* ── Location cards ───────────────────────────────── */
.location-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #16a34a, #4ade80);
}

.location-card:hover {
    border-color: #6ee7b7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    background: #f0fdf4;
}

.location-card-active {
    border-color: #16a34a !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 2px #a7f3d0;
}

.location-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-pin-icon {
    width: 0.85rem;
    height: 0.85rem;
    color: #16a34a;
    flex-shrink: 0;
}

.location-card-region-pill {
    font-size: 0.65rem;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Location detail panel ────────────────────────── */
.location-detail-inline {
    grid-column: 1 / -1;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 0.25rem 0;
}

.location-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.location-generation-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280;
}

.location-detail-name {
    font-size: 1rem;
    font-weight: 700;
    color: #14532d;
}

.location-detail-region-badge {
    font-size: 0.68rem;
    font-weight: 600;
    background: #16a34a;
    color: #fff;
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
}

.location-area-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0.65rem 0 0.35rem;
}

.location-pokemon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.location-pokemon-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 0.5rem;
    padding: 0.15rem 0.45rem 0.15rem 0.15rem;
}

.location-pokemon-chip img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.location-pokemon-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.location-pokemon-level {
    font-size: 0.63rem;
    color: #6b7280;
    line-height: 1.2;
}

/* ── Inline item detail panel ─────────────────────── */
.item-detail-inline {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    margin: 0.25rem 0;
}

.item-detail-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.item-detail-body {
    flex: 1;
    min-width: 0;
}

.item-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.item-detail-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e40af;
}

.item-detail-category {
    font-size: 0.7rem;
    font-weight: 600;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
}

.item-detail-cost {
    font-size: 0.7rem;
    font-weight: 600;
    background: #fef9c3;
    color: #a16207;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
}

.item-detail-cost-free {
    font-size: 0.7rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
}

.item-detail-fling {
    font-size: 0.7rem;
    font-weight: 600;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
}

.item-detail-effect {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.item-detail-flavor {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
}

/* ── Stat bars ────────────────────────────────────── */
.stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    width: 2.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6b7280;
    text-align: right;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.stat-value {
    width: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
}

.stat-bar-track {
    flex: 1;
    height: 0.45rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transform-origin: left;
    animation: statFill 0.5s ease-out both;
}

@keyframes statFill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ── Move learnset ────────────────────────────────── */
.move-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.move-th {
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.move-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.move-row:hover { background: #fefce8; }

.move-td {
    padding: 0.35rem 0.6rem;
    vertical-align: middle;
}

.move-type-badge,
.move-cat-badge {
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
    display: inline-block;
    white-space: nowrap;
}

.move-cat-physical { background: #fed7aa; color: #92400e; }
.move-cat-special  { background: #bfdbfe; color: #1e40af; }
.move-cat-status   { background: #e5e7eb; color: #374151; }

.move-tab {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.move-tab:hover {
    background: #fef9c3;
    border-color: #fbbf24;
    color: #374151;
}

.move-tab-active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.move-tab-active:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.move-row-clickable {
    cursor: pointer;
}

.move-row-active {
    background: #faf5ff !important;
}

.move-detail-td {
    padding: 0.35rem 0;
}

/* ── Type chart ───────────────────────────────────── */
.type-chart-table {
    border-collapse: separate;
    border-spacing: 2px;
    table-layout: fixed;
}

.chart-corner {
    width: 80px;
    min-width: 80px;
    padding: 0 4px 4px 0;
    vertical-align: bottom;
}

.chart-corner-inner {
    position: relative;
    width: 100%;
    height: 3.5rem;
}

.chart-corner-def {
    position: absolute;
    top: 4px;
    right: 2px;
    font-size: 0.48rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chart-corner-atk {
    position: absolute;
    bottom: 4px;
    left: 2px;
    font-size: 0.48rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chart-corner-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.chart-col-header {
    width: 30px;
    min-width: 30px;
    padding: 6px 2px 8px;
    vertical-align: bottom;
    text-align: center;
}

.type-col-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 5px 3px;
    border-radius: 6px;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.chart-row-header {
    padding: 1px 6px 1px 0;
    text-align: right;
    white-space: nowrap;
}

.type-row-label {
    font-size: 0.63rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 9999px;
    display: inline-block;
    letter-spacing: 0.01em;
}

.chart-cell {
    width: 30px;
    height: 26px;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 4px;
    user-select: none;
    cursor: default;
    transition: filter 0.08s ease, transform 0.08s ease;
    position: relative;
}

/* Crosshair highlight */
.chart-cell.chart-cell-hl {
    filter: brightness(0.82);
}

.chart-cell.chart-cell-focus {
    filter: brightness(0.7) !important;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.4);
    transform: scale(1.18);
    z-index: 2;
}

/* ── Type legend pills ────────────────────────────── */
.type-legend-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    border: 1.5px solid;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── Matchup info bar ─────────────────────────────── */
.matchup-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 2.25rem;
    padding: 0.4rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

.matchup-bar-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.matchup-bar-arrow {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
}

.matchup-bar-result {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── Move browse page ─────────────────────────────── */
.move-filter-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0 0.65rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}

.move-filter-btn:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.move-filter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.move-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem 0.45rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    margin-bottom: 0.2rem;
}

.move-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #6366f1;
}

.move-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    background: #faf5ff;
}

.move-card-active {
    border-color: #8b5cf6 !important;
    background: #faf5ff !important;
    box-shadow: 0 0 0 2px #ddd6fe;
}

.move-card-num {
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    flex-shrink: 0;
    width: 2.8rem;
    text-align: right;
}

.move-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.move-card-stats {
    font-size: 0.68rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.move-card-chevron {
    width: 0.9rem;
    height: 0.9rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.move-detail-inline {
    background: #faf5ff;
    border: 1px solid #c4b5fd;
    border-radius: 0.65rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.2rem;
}

.move-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.move-detail-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4c1d95;
}

.move-detail-gen {
    font-size: 0.65rem;
    font-weight: 600;
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
}

.move-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.move-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: 0.4rem;
    padding: 0.25rem 0.75rem;
    min-width: 4rem;
}

.move-stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b5cf6;
}

.move-stat-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
}

.move-detail-effect {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.move-detail-flavor {
    font-size: 0.72rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
}

/* ── Ability browse page ──────────────────────────── */
.ability-filter-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0 0.65rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}

.ability-filter-btn:hover:not(:disabled) {
    background: #008080;
    border-color: #f9a8d4;
    color: #be185d;
}

.ability-filter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ability-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem 0.45rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    margin-bottom: 0.2rem;
}

.ability-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #14b8a6;
}

.ability-card:hover {
    border-color: #99f6e4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    background: #f0fdfa;
}

.ability-card-active {
    border-color: #14b8a6 !important;
    background: #f0fdfa !important;
    box-shadow: 0 0 0 2px #99f6e4;
}

.ability-card-num {
    font-size: 0.62rem;
    font-weight: 600;
    color: #9ca3af;
    flex-shrink: 0;
    width: 2.8rem;
    text-align: right;
}

.ability-gen-badge {
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.ability-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
    min-width: 8rem;
}

.ability-card-effect {
    font-size: 0.68rem;
    color: #6b7280;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ability-card-chevron {
    width: 0.9rem;
    height: 0.9rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.ability-detail-inline {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 0.65rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.2rem;
}

.ability-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.ability-detail-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #134e4a;
}

.ability-detail-effect {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.ability-detail-flavor {
    font-size: 0.72rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.ability-detail-pokemon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ccfbf1;
}

.ability-pokemon-chip {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: #fff;
    border: 1px solid #99f6e4;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem 0.1rem 0.1rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #374151;
}

.ability-pokemon-chip img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ability-pokemon-hidden {
    border-color: #fde68a;
    background: #fffbeb;
}

.ability-hidden-tag {
    font-size: 0.55rem;
    font-weight: 700;
    background: #fbbf24;
    color: #92400e;
    border-radius: 9999px;
    padding: 0.05rem 0.3rem;
    margin-left: 0.1rem;
}

.ability-more-tag {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.1rem 0.5rem;
}

/* ── Clickable Pokémon chips ──────────────────────────────────────────────── */
.pokemon-chip-clickable {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pokemon-chip-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* ── Condition badges & panels ────────────────────────────────────────────── */
.condition-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid;
    white-space: nowrap;
    line-height: 1.4;
}
.condition-panel {
    margin-top: 0.5rem;
    border: 1px solid;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
}
.condition-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.condition-panel-name {
    font-size: 0.82rem;
    font-weight: 700;
}
.condition-panel-type {
    font-size: 0.65rem;
    font-weight: 600;
    font-style: italic;
    opacity: 0.7;
}
.condition-panel-desc {
    font-size: 0.73rem;
    line-height: 1.5;
    margin: 0;
}

/* ── Pokédex entry version buttons ───────────────────────────────────────── */
.pokemon-entry-version-btn {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    line-height: 1.5;
}
.pokemon-entry-version-btn:hover {
    background: #fef9c3;
    border-color: #eab308;
    color: #854d0e;
}
.pokemon-entry-version-btn.pev-active {
    background: #eab308;
    border-color: #eab308;
    color: #fff;
}

/* ── Alternate form buttons ───────────────────────────────────────────────── */
.pokemon-form-btn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    line-height: 1.6;
}
.pokemon-form-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}
.pokemon-form-btn.pf-active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    cursor: default;
}

/* ── Held items ───────────────────────────────────────────────────────────── */
.held-item-chip {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.2rem 0.5rem 0.2rem 0.2rem;
    transition: border-color 0.1s, box-shadow 0.1s;
}
.held-item-chip:hover {
    border-color: #fbbf24;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.held-item-chip img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.held-item-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
    white-space: nowrap;
}
.held-item-rarity {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ── Responsive / mobile ─────────────────────────────────────────────────── */
@media (max-width: 639px) {

    /* Nav buttons — compact on mobile */
    .site-nav a {
        padding: 0.3rem 0.55rem;
        font-size: 0.7rem;
    }

    /* Pokédex image column — full-width and centered on mobile */
    .pokedex-img-col {
        width: 100%;
        align-items: center;
    }

    /* Pokédex search — input takes its own row, buttons share the row below */
    .search-input-wrapper {
        flex-basis: 100%;
    }

    /* Matchup bar wraps gracefully on narrow screens */
    .matchup-bar {
        min-height: auto;
        padding: 0.35rem 0.65rem;
    }

    /* Hub card subtitle — slightly smaller */
    .hub-card-sub {
        font-size: 0.65rem;
    }

    /* Hub cards — single column under 400px */
    .hub-card-label {
        font-size: 0.95rem;
    }

    /* Type chart legend pills may wrap — give them breathing room */
    .type-legend-pill {
        font-size: 0.65rem;
        padding: 0.15rem 0.55rem;
    }

    /* Move cards — stack into two rows so the name isn't crushed.
       Row 1: number · name · chevron   Row 2: type · category · stats */
    .move-card {
        flex-wrap: wrap;
        row-gap: 0.35rem;
        padding: 0.5rem 0.75rem;
    }
    .move-card-num    { order: 1; }
    .move-card-name   { order: 2; flex: 1 1 auto; min-width: 0; }
    .move-card-chevron { order: 3; }
    .move-card .move-type-badge { order: 4; }
    .move-card .move-cat-badge  { order: 5; }
    .move-card-stats  { order: 6; margin-left: auto; }

    /* Ability cards — name on the first row, full effect text on the second */
    .ability-card {
        flex-wrap: wrap;
        row-gap: 0.3rem;
        padding: 0.5rem 0.75rem;
    }
    .ability-card-num     { order: 1; }
    .ability-card .ability-gen-badge { order: 2; }
    .ability-card-name    { order: 3; flex: 1 1 auto; min-width: 0; }
    .ability-card-chevron { order: 4; }
    .ability-card-effect  {
        order: 5;
        flex-basis: 100%;
        white-space: normal;
        overflow: visible;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Stat bar label width stays fixed so bars don't jump */
    .stat-label { width: 2rem; }
    .stat-value { width: 1.75rem; }

    /* Type chart — freeze the attacking-type column while the grid scrolls
       horizontally, so you never lose track of which row you're reading */
    .chart-corner,
    .chart-row-header {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #f9fafb;
        box-shadow: 3px 0 5px -2px rgba(0, 0, 0, 0.12);
    }
    .chart-corner { z-index: 3; }

    /* Pokémon browse cards — shrink so 4 fit per row on mobile */
    .pokemon-card {
        padding: 0.5rem 0.25rem 0.45rem;
    }
    .pokemon-img {
        width: 56px;
        height: 56px;
    }
    .pokemon-name {
        font-size: 0.68rem;
    }
    .pokemon-number {
        font-size: 0.5rem;
        top: 4px;
        right: 4px;
    }
    .pokemon-card-type-badge {
        font-size: 0.5rem;
        padding: 0.03rem 0.3rem;
    }
}

/* ── Theme variables ──────────────────────────────────────────────────────────
   Used by JS-set inline styles (pokemon.js filter chips, the type-chart "normal"
   cell) so they flip automatically when the .dark class toggles — no re-render. */
:root {
    --chip-bg: #ffffff;
    --chip-fg: #6b7280;
    --chip-border: #e5e7eb;
    --chip-bg-disabled: #f9fafb;
    --chip-fg-disabled: #9ca3af;
    --cell-normal: #f8fafc;
}
.dark {
    --chip-bg: #1e293b;
    --chip-fg: #cbd5e1;
    --chip-border: #475569;
    --chip-bg-disabled: #0f172a;
    --chip-fg-disabled: #64748b;
    --cell-normal: #1e293b;
}

/* ── Theme toggle button ─────────────────────────────────────────────────────── */
.theme-toggle {
    position: fixed;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 100;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.1); }
.dark .theme-toggle {
    background: rgba(30, 41, 59, 0.92);
    border-color: #475569;
    color: #fbbf24;
}

/* ── Dark mode ─────────────────────────────────────────────────────────────────
   Scoped under .dark on <html>. !important is used on utility-class overrides so
   they reliably win over Tailwind's single-class utilities. */

/* Page background — darken the photo with a multiply blend */
.dark .pokemon-bg {
    background-color: #0b1220;
    background-blend-mode: multiply;
}

/* Main content container */
.dark .container {
    background-color: rgba(15, 23, 42, 0.95) !important;
    color: #e5e7eb;
}

/* Surface utilities */
.dark .bg-white   { background-color: #1e293b !important; }
.dark .bg-gray-50 { background-color: #0f172a !important; }
.dark .bg-gray-100{ background-color: #1e293b !important; }
.dark .bg-gray-200{ background-color: #334155 !important; }
.dark .bg-yellow-50 { background-color: #2a2410 !important; }
.dark .bg-red-50    { background-color: #2a1515 !important; }
.dark .bg-blue-50   { background-color: #152033 !important; }
.dark .bg-green-50  { background-color: #14241c !important; }

/* Neutral text utilities */
.dark .text-gray-800 { color: #f1f5f9 !important; }
.dark .text-gray-700 { color: #e2e8f0 !important; }
.dark .text-gray-600 { color: #cbd5e1 !important; }
.dark .text-gray-500 { color: #94a3b8 !important; }
.dark .text-gray-400 { color: #94a3b8 !important; }

/* Accent label text — lighten the darker -600/-700 shades for contrast */
.dark .text-blue-700   { color: #93c5fd !important; }
.dark .text-blue-600   { color: #93c5fd !important; }
.dark .text-green-700  { color: #86efac !important; }
.dark .text-teal-700   { color: #5eead4 !important; }
.dark .text-indigo-700 { color: #a5b4fc !important; }
.dark .text-red-600    { color: #fca5a5 !important; }
.dark .text-yellow-600 { color: #fcd34d !important; }
.dark .text-green-600  { color: #86efac !important; }
.dark .text-purple-600 { color: #c4b5fd !important; }

/* Borders */
.dark .border-gray-100 { border-color: #1e293b !important; }
.dark .border-gray-200 { border-color: #334155 !important; }
.dark .border-gray-300 { border-color: #475569 !important; }

/* Form inputs */
.dark input {
    background-color: #1e293b !important;
    color: #e5e7eb !important;
}
.dark input::placeholder { color: #94a3b8 !important; }

/* Search suggestions dropdown */
.dark #search-suggestions .hover\:bg-yellow-50:hover,
.dark .suggestion-item:hover { background-color: #334155 !important; }

/* Browse cards */
.dark .pokemon-card,
.dark .item-card,
.dark .move-card,
.dark .ability-card,
.dark .location-card { background: #1e293b; border-color: #334155; }

.dark .pokemon-name,
.dark .item-name,
.dark .move-card-name,
.dark .ability-card-name,
.dark .location-card-name { color: #e2e8f0; }

.dark .pokemon-number,
.dark .item-number,
.dark .move-card-num,
.dark .ability-card-num { color: #94a3b8; }

.dark .ability-card-effect,
.dark .move-card-stats { color: #94a3b8; }

.dark .item-no-sprite { background: #0f172a; }

/* Card hovers */
.dark .pokemon-card:hover,
.dark .item-card:hover { border-color: #fbbf24; }
.dark .location-card:hover { background: #14241c; border-color: #15803d; }
.dark .move-card:hover { background: #1e1b2e; border-color: #6d28d9; }
.dark .ability-card:hover { background: #0f2a26; border-color: #0f766e; }

/* Filter buttons (class-styled inactive state) */
.dark .move-filter-btn,
.dark .ability-filter-btn,
.dark .pokemon-entry-version-btn,
.dark .pokemon-form-btn,
.dark .move-tab {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}
.dark .move-filter-btn:hover:not(:disabled) { background: #312e81; border-color: #6366f1; color: #c7d2fe; }
.dark .ability-filter-btn:hover:not(:disabled) { background: #134e4a; border-color: #14b8a6; color: #99f6e4; }
.dark .pokemon-entry-version-btn:hover { background: #422006; border-color: #eab308; color: #fde68a; }
.dark .pokemon-form-btn:hover { background: #2a1515; border-color: #ef4444; color: #fca5a5; }

/* Move learnset table */
.dark .move-th { color: #94a3b8; border-color: #334155; }
.dark .move-td { color: #cbd5e1; }
.dark .move-row { border-color: #1e293b; }
.dark .move-row:hover { background: #422006; }
.dark .move-row-active { background: #2a1e3a !important; }

/* Stat bars */
.dark .stat-bar-track { background: #334155; }
.dark .stat-label { color: #94a3b8; }

/* Inline detail panels */
.dark .move-detail-inline { background: #1e1b2e; border-color: #4c1d95; }
.dark .ability-detail-inline { background: #0f2a26; border-color: #134e4a; }
.dark .item-detail-inline { background: #152033; border-color: #1e3a5f; }
.dark .location-detail-inline { background: #0f2417; border-color: #14532d; }
.dark .move-detail-effect,
.dark .item-detail-effect { color: #cbd5e1; }
.dark .move-stat-item { background: #0f172a; border-color: #4c1d95; }
.dark .move-stat-value { color: #e2e8f0; }

/* Pokémon / encounter chips */
.dark .location-pokemon-chip { background: #1e293b; border-color: #334155; }
.dark .location-pokemon-name { color: #e2e8f0; }
.dark .ability-pokemon-chip { background: #1e293b; border-color: #134e4a; color: #e2e8f0; }
.dark .encounter-row { background: #0f172a; border-color: #334155; }
.dark .encounter-area { color: #e2e8f0; }

/* Held items */
.dark .held-item-chip { background: #1e293b; border-color: #334155; }
.dark .held-item-name { color: #e2e8f0; }

/* Type chart frozen column + matchup bar */
.dark .matchup-bar { background: #1e293b; border-color: #334155; }
.dark .chart-row-header,
.dark .chart-corner { background: #1e293b; }

/* Muted icons */
.dark .move-card-chevron,
.dark .ability-card-chevron,
.dark .location-pin-icon { color: #64748b; }

/* ── Home hub cards ───────────────────────────────────────────────────────── */
.hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 1rem;
    padding: 1.75rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
    overflow: hidden;
}
.hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
    filter: brightness(1.07);
}
.hub-card svg {
    width: 2.25rem;
    height: 2.25rem;
    opacity: 0.92;
}
.hub-card-label {
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}
.hub-card-sub {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.85;
    text-align: center;
    line-height: 1.4;
}

/* ── Evolution tree ───────────────────────────────────────────────────────── */
.evo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 3px;
    min-width: 44px;
}
.evo-req {
    font-size: 0.58rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.4;
    max-width: 80px;
}
.dark .evo-req { background: #1e293b; color: #94a3b8; }

/* ── Easter egg: Pikachu mode ─────────────────────────────────────────────── */
.pokeball {
    position: fixed;
    top: 0;
    pointer-events: none;
    z-index: 997;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.45));
}

@keyframes rainbowContainer {
    0%   { background-color: rgba(255,220,220,0.93); }
    16%  { background-color: rgba(255,238,210,0.93); }
    33%  { background-color: rgba(220,255,220,0.93); }
    50%  { background-color: rgba(210,232,255,0.93); }
    66%  { background-color: rgba(238,210,255,0.93); }
    83%  { background-color: rgba(255,210,238,0.93); }
    100% { background-color: rgba(255,220,220,0.93); }
}
@keyframes cardBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

body.rainbow-mode .container {
    animation: rainbowContainer 3s linear infinite;
    transition: none;
}
@keyframes rainbowTitle {
    0%   { background-color: #ef4444; }
    16%  { background-color: #f97316; }
    33%  { background-color: #eab308; }
    50%  { background-color: #22c55e; }
    66%  { background-color: #3b82f6; }
    83%  { background-color: #a855f8; }
    100% { background-color: #ef4444; }
}
body.rainbow-mode h1,
body.rainbow-mode h1 a {
    animation: rainbowTitle 1.5s linear infinite !important;
}
body.rainbow-mode .hub-card {
    animation: rainbowTitle 1.5s linear infinite, cardBounce 0.9s ease-in-out infinite !important;
}
body.rainbow-mode .site-nav a {
    animation: rainbowTitle 1.5s linear infinite !important;
}
body.rainbow-mode .stat-bar-fill {
    animation: rainbowTitle 1.5s linear infinite !important;
}
body.rainbow-mode .move-tab {
    animation: rainbowTitle 1.5s linear infinite !important;
    color: #fff !important;
}
body.rainbow-mode .pokemon-form-btn,
body.rainbow-mode .pokemon-entry-version-btn {
    animation: rainbowTitle 1.5s linear infinite !important;
    color: #fff !important;
}
body.rainbow-mode .encounter-version-header {
    animation: rainbowTitle 1.5s linear infinite !important;
    -webkit-background-clip: unset;
    color: #fff !important;
}
.evo-branch-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 0.35rem;
}
.evo-branch-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.evo-branch-label {
    display: flex;
    align-items: center;
    gap: 3px;
}
