/* ============================================
   POKEMON TCG CARD CHECKER — DESIGN SYSTEM
   Premium Dark Mode Theme
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Colors */
    --bg-primary: #08080d;
    --bg-secondary: #0f0f17;
    --bg-card: #14141f;
    --bg-card-hover: #1a1a2a;
    --bg-surface: #1c1c2e;
    --bg-input: #12121c;

    --text-primary: #f0f0f5;
    --text-secondary: #9999b8;
    --text-muted: #666680;
    --text-accent: #b8b8d0;

    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-cyan: #06b6d4;

    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-hot: linear-gradient(135deg, #ec4899, #f59e0b);
    --gradient-surface: linear-gradient(145deg, #14141f, #1a1a2f);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --nav-height: 64px;

    /* Energy type colors */
    --energy-fire: #f08030;
    --energy-water: #6890f0;
    --energy-grass: #78c850;
    --energy-lightning: #f8d030;
    --energy-psychic: #f85888;
    --energy-fighting: #c03028;
    --energy-darkness: #705848;
    --energy-metal: #b8b8d0;
    --energy-fairy: #ee99ac;
    --energy-dragon: #7038f8;
    --energy-colorless: #a8a878;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Container ---- */
.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(8, 8, 13, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link-collection {
    position: relative;
}

#collection-count {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--accent-pink);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 360px;
    margin-left: auto;
}

.nav-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    transition: all var(--transition);
}

.nav-search-inner:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.nav-search-inner svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-search-inner input {
    width: 100%;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.nav-search-inner input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   SEARCH DROPDOWN
   ============================================ */
.search-dropdown-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 200;
}

#search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 200;
}

.search-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
    cursor: pointer;
}

.search-dropdown-item:hover {
    background: var(--bg-card-hover);
}

.search-dropdown-img {
    width: 36px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-dropdown-info {
    flex: 1;
    min-width: 0;
}

.search-dropdown-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-set {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-dropdown-price {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent-green);
    flex-shrink: 0;
}

.search-dropdown-viewall {
    display: block;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-blue);
    transition: background var(--transition);
}

.search-dropdown-viewall:hover {
    background: var(--bg-card-hover);
}

.search-dropdown-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    padding: 80px 24px 60px;
    text-align: center;
    overflow: hidden;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 40%, transparent 70%);
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.06), transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.hero-title-line {
    display: block;
    color: var(--text-primary);
}

.hero-title-accent {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 540px;
    margin: 0 auto 40px;
    padding: 14px 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xl);
    transition: all var(--transition);
}

.hero-search:focus-within {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.hero-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero-search input {
    width: 100%;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
}

.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 48px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-header {
    padding: 32px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   CARD GRID
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 20px;
}

.card-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

.card-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-item-image {
    position: relative;
    aspect-ratio: 3/4.2;
    background: var(--bg-surface);
    overflow: hidden;
}

.card-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.35s ease;
    opacity: 0;
}

.card-item-image img.loaded,
.card-item-image img[src] {
    opacity: 1;
}

.card-item:hover .card-item-image img {
    transform: scale(1.05);
}

.card-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition);
}

.card-item:hover .card-item-actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: white;
    border: none;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon:hover {
    background: var(--accent-pink);
    transform: scale(1.1);
}

.btn-icon.btn-collection.active {
    background: var(--accent-pink);
    color: white;
}

.card-item-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.card-item-number {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-item-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.price-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.price-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-green);
}

.price-value.muted {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

/* ============================================
   SET GRID
   ============================================ */
.set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.set-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
}

.set-item:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
}

.set-item-logo {
    width: 100px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-item-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s;
}

.set-item-logo img.loaded,
.set-item-logo img[src]:not([data-src]) {
    opacity: 1;
}

.set-item-info {
    flex: 1;
    min-width: 0;
}

.set-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.set-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dot {
    opacity: 0.4;
}

/* ============================================
   SETS LAYOUT (Sidebar + Grid)
   ============================================ */
.sets-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: flex-start;
}

.sets-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    border: none;
    background: none;
    width: 100%;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.sidebar-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   SET DETAIL HEADER
   ============================================ */
.set-header {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 32px;
    background: var(--gradient-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.set-header-logo {
    width: 180px;
    flex-shrink: 0;
}

.set-header-logo img {
    max-width: 100%;
}

.set-header-info {
    flex: 1;
}

.set-header-info h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.set-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--accent-blue);
    transition: opacity var(--transition);
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb svg {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-search input {
    width: 100%;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.filter-search input::placeholder {
    color: var(--text-muted);
}

.filter-controls {
    display: flex;
    gap: 8px;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    border-color: var(--accent-blue);
}

/* ============================================
   CARD DETAIL
   ============================================ */
.card-detail {
    padding: 16px 0 48px;
}

.card-detail-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 48px;
    align-items: flex-start;
}

.card-detail-image {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
}

.card-detail-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease;
}

.card-detail-image img:hover {
    transform: scale(1.02);
}

.card-detail-info {
    min-width: 0;
}

.card-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.card-detail-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.card-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.tag-rarity {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.tag-hp {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ---- Detail Sections ---- */
.detail-section {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Attacks ---- */
.attacks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attack-item {
    padding: 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.attack-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.attack-cost {
    display: flex;
    gap: 3px;
}

.energy-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.energy-fire {
    background: var(--energy-fire);
}

.energy-water {
    background: var(--energy-water);
}

.energy-grass {
    background: var(--energy-grass);
}

.energy-lightning {
    background: var(--energy-lightning);
    color: #333;
}

.energy-psychic {
    background: var(--energy-psychic);
}

.energy-fighting {
    background: var(--energy-fighting);
}

.energy-darkness {
    background: var(--energy-darkness);
}

.energy-metal {
    background: var(--energy-metal);
    color: #333;
}

.energy-fairy {
    background: var(--energy-fairy);
}

.energy-dragon {
    background: var(--energy-dragon);
}

.energy-colorless {
    background: var(--energy-colorless);
    color: #333;
}

.attack-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.attack-damage {
    margin-left: auto;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-red);
}

.attack-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Combat Info ---- */
.combat-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.combat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.combat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 100px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    gap: 4px;
}

/* ---- Price Table ---- */
.price-section {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.price-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.price-source {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 8px;
}

.price-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.price-table td {
    padding: 12px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.price-type-cell {
    font-weight: 600;
}

.price-highlight {
    color: var(--accent-green);
    font-weight: 700;
}

/* ============================================
   COLLECTION PAGE
   ============================================ */
.collection-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.collection-stat-card {
    flex: 1;
    min-width: 200px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-stat-card.accent {
    background: var(--gradient-surface);
    border-color: rgba(59, 130, 246, 0.2);
}

.collection-stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.collection-stat-card.accent .collection-stat-value {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.collection-stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.collection-actions {
    margin-bottom: 20px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    padding: 16px 0;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--text-muted);
    padding: 0 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-text {
    background: transparent;
    color: var(--accent-blue);
    padding: 8px 12px;
}

.btn-text:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ============================================
   EMPTY / ERROR STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton .card-item-image,
.skeleton .set-item-logo,
.skeleton-image {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
    background-size: 300% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
    background-size: 300% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text-lg {
    width: 75%;
    height: 14px;
}

.skeleton-text-md {
    width: 50%;
    height: 12px;
}

.skeleton-text-sm {
    width: 35%;
    height: 10px;
    margin-top: 6px;
}

.skeleton .card-item-image {
    aspect-ratio: 3/4.2;
}

.skeleton .set-item-logo {
    width: 100px;
    height: 60px;
    border-radius: var(--radius-sm);
}

.skeleton .card-item-info,
.skeleton .set-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.show {
    bottom: 24px;
}

.toast-success .toast-icon {
    color: var(--accent-green);
}

.toast-error .toast-icon {
    color: var(--accent-red);
}

.toast-info .toast-icon {
    color: var(--accent-blue);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 64px;
    padding: 32px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--accent-blue);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sets-layout {
        grid-template-columns: 200px 1fr;
        gap: 24px;
    }

    .card-detail-layout {
        grid-template-columns: 300px 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .navbar-inner {
        gap: 12px;
    }

    .nav-links {
        display: none;
    }

    .nav-search {
        max-width: none;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat-value {
        font-size: 1.35rem;
    }

    .sets-layout {
        grid-template-columns: 1fr;
    }

    .sets-sidebar {
        position: static;
        max-height: none;
        display: flex;
        overflow-x: auto;
        padding: 4px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 4px;
        min-width: max-content;
    }

    .sidebar-item {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .card-detail-layout {
        grid-template-columns: 1fr;
    }

    .card-detail-image {
        position: static;
        max-width: 320px;
        margin: 0 auto;
    }

    .set-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .set-header-logo {
        width: 140px;
    }

    .set-header-meta {
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .set-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-search {
        width: 100%;
    }

    .collection-stats {
        flex-direction: column;
    }

    /* Mobile bottom nav */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: rgba(8, 8, 13, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 8px 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 0;
        color: var(--text-muted);
        font-size: 0.65rem;
        font-weight: 500;
        transition: color var(--transition);
        text-decoration: none;
    }

    .mobile-nav-item.active {
        color: var(--accent-blue);
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
    }

    body {
        padding-bottom: 72px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 48px 16px 40px;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-search {
        padding: 10px 16px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-item-info {
        padding: 8px;
    }

    .card-item-name {
        font-size: 0.75rem;
    }

    .container {
        padding: 0 16px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }
}

/* Mobile nav hidden on desktop */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
}

/* ============================================
   DECKS MENU & BUILDER
   ============================================ */
.decks-page {
    padding: 32px;
}

.decks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.deck-card,
.suggestion-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: all var(--transition);
}

.deck-card:hover,
.suggestion-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.deck-cover {
    width: 80px;
    height: 112px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--bg-surface);
}

.deck-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.deck-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.deck-meta {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.suggestion-card {
    flex-direction: column;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 8px 0;
}

.suggestion-core {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.core-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.deck-builder {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px;
    height: calc(100vh - var(--nav-height));
    align-items: flex-start;
}

.builder-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.builder-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.deck-name-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 4px 8px;
    margin-left: -8px;
}

.deck-name-input:hover,
.deck-name-input:focus {
    background: var(--bg-input);
    border-color: var(--border-color);
}

.deck-score-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.score-circle {
    position: relative;
    width: 48px;
    height: 48px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.score-good {
    color: var(--accent-green);
}

.score-avg {
    color: #f59e0b;
}

.score-bad {
    color: var(--accent-pink);
}

.score-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.deck-stats-mini {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.deck-card-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deck-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.deck-list-item:hover {
    background: var(--bg-input);
}

.item-count {
    font-weight: 700;
    color: var(--accent-blue);
    width: 20px;
}

.item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.builder-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.builder-search {
    margin-bottom: 24px;
}

.builder-results {
    flex: 1;
    overflow-y: auto;
}

.deck-dropdown-container {
    position: relative;
}

.deck-dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    margin-bottom: 8px;
}

.deck-dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 8px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.add-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.builder-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.builder-search-bar input {
    flex: 1;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.builder-search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.builder-empty-search {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.builder-empty-search .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* Score Donut */
.score-donut {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.score-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-donut .score-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.score-cards {
    font-size: 0.9rem;
    font-weight: 600;
}

.score-playstyle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-breakdown {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Deck Score Badge on decks list */
.deck-score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.deck-score-badge.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.deck-score-badge.avg {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.deck-score-badge.bad {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-pink);
}

/* Deck stat row */
.deck-stat-row {
    display: flex;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0;
}

/* deck-cover empty */
.deck-cover-empty {
    width: 80px;
    height: 112px;
    background: var(--bg-surface);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

/* Suggestions section */
.suggestions-section {
    margin-top: 40px;
}

.page-sub {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 0.9rem;
}

/* Deck feedback success */
.deck-feedback.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.82rem;
    color: var(--accent-green);
    margin-bottom: 12px;
}

.deck-feedback {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.feedback-item {
    font-size: 0.78rem;
    color: #f59e0b;
    margin-bottom: 2px;
}

/* card-img-wrapper fix for builder */
.card-img-wrapper {
    position: relative;
    aspect-ratio: 3/4.2;
    background: var(--bg-surface);
    overflow: hidden;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* item-remove hint */
.item-remove {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.deck-list-item:hover .item-remove {
    opacity: 1;
    color: var(--accent-pink);
}

/* item-cat badge */
.item-cat {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
}

.cat-pok\00e9mon {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.cat-trainer {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.cat-energy {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ============================================
   LOADER SPINNER
   ============================================ */
.loader-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* card-item hover add-overlay (was removed, re-add) */
.card-item:hover .add-overlay {
    opacity: 1;
}

/* builder-card-item extra padding */
.builder-card-item {
    cursor: pointer;
}

.builder-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* add-to-deck button in card detail */
.deck-btn-group {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.deck-dropdown-container {
    position: relative;
    display: inline-block;
}

.deck-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 180px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
}

.deck-dropdown-menu.show {
    display: block;
}

.deck-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s;
}

.deck-dropdown-item:hover {
    background: var(--bg-surface);
}

/* ============================================
   SET PICKER SECTION
   ============================================ */
.set-picker-section {
    margin-top: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.set-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.set-picker-header h2 {
    margin-bottom: 4px;
}

.set-picker-badge {
    padding: 6px 14px;
    background: var(--gradient-primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.set-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.set-picker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.set-picker-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.set-picker-card:hover .btn {
    opacity: 1;
    transform: scale(1.03);
}

.set-picker-logo {
    width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.set-picker-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.set-picker-icon {
    font-size: 1.8rem;
}

.set-picker-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-picker-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.set-picker-action {
    margin-top: 4px;
}

.set-picker-action .btn {
    opacity: 0.7;
    pointer-events: none;
    font-size: 0.7rem;
}

/* ============================================
   AUTO-BUILD LOADING OVERLAY
   ============================================ */
.build-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 13, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.build-loading-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.build-loading-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.build-loading-card p {
    color: var(--text-secondary);
    font-size: 0.87rem;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   DECK BUILDER — ANALYSIS PANEL & RICH UI
   ============================================ */

/* Playstyle badge in score panel */
.score-playstyle-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.score-ex-note {
    font-size: 0.72rem;
    color: var(--accent-amber);
    margin-top: 2px;
}

/* Composition bars */
.composition-bars {
    padding: 14px 0 8px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 10px 0;
}

.comp-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    margin-top: 10px;
}

.comp-label:first-child {
    margin-top: 0;
}

.comp-count {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.comp-bar-track {
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.comp-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.pokemon-bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.trainer-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.energy-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Warnings & Feedback boxes */
.warnings-box,
.feedback-box {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 6px 0;
}

.warnings-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.feedback-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.analysis-warning {
    color: #f87171;
    margin: 2px 0;
}

.analysis-feedback {
    color: #93c5fd;
    margin: 2px 0;
}

/* Deck list groups */
.deck-list-group {
    margin-bottom: 6px;
}

.deck-list-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
}

.grp-pokemon {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.grp-trainer {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.grp-energy {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

/* Analysis Panel (in builder-main) */
.analysis-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.analysis-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.analysis-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.analysis-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.analysis-section-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.playstyle-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Strengths & Weaknesses Columns */
.sw-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

.sw-col {
    padding: 14px;
    border-radius: var(--radius-sm);
}

.strengths-col {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.weaknesses-col {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sw-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strengths-title {
    color: #34d399;
}

.weaknesses-title {
    color: #f87171;
}

.sw-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.strength-item,
.weakness-item,
.sw-empty {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.sw-icon {
    flex-shrink: 0;
    font-size: 0.75rem;
    margin-top: 1px;
}

.sw-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Tips (How To Play) */
.tips-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.tips-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tip-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    margin-top: 1px;
}

/* ============================================
   DECK VISUAL CARD GRID
   ============================================ */
.deck-card-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 8px;
    padding: 6px 0 8px;
}

.deck-visual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.deck-visual-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: default;
    transition: transform 0.15s, border-color 0.15s;
}

.deck-visual-img-wrap:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.deck-visual-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.6rem;
    color: var(--text-muted);
}

/* Count badge top-right */
.dvc-count-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    line-height: 1.5;
    pointer-events: none;
}

/* +/- controls - appear on hover */
.deck-visual-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 4px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.deck-visual-img-wrap:hover .deck-visual-controls {
    opacity: 1;
}

.dvc-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

.dvc-minus {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.dvc-minus:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.dvc-plus {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.dvc-plus:hover:not(.dvc-disabled) {
    background: #3b82f6;
    transform: scale(1.1);
}

.dvc-disabled,
.dvc-btn:disabled {
    background: rgba(100, 100, 120, 0.5) !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

/* Footer: pip dots + name */
.deck-visual-footer {
    width: 100%;
    text-align: center;
}

.deck-pip-row {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 3px;
}

.card-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: inline-block;
    opacity: 0.9;
}

.card-pip.pip-first {
    background: var(--accent-purple);
}

.deck-visual-name {
    font-size: 0.63rem;
    color: var(--text-secondary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Group label total count */
.grp-total {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

/* ============================================
   DECK BUILDER V2 — HERO LAYOUT
   ============================================ */
.deck-builder-v2 {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - var(--nav-height));
    min-height: 0;
}

/* --- Left Sidebar (compact) --- */
.db-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.db-sidebar .builder-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.db-sidebar .deck-name-input {
    font-size: 1rem;
}

/* Score compact panel */
.db-score-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.score-donut-sm {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.db-score-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.db-card-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Composition bars small variant */
.composition-bars-sm {
    padding: 8px 0 4px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}

.composition-bars-sm .comp-label {
    margin-top: 6px;
    font-size: 0.7rem;
}

.composition-bars-sm .comp-label:first-child {
    margin-top: 0;
}

/* Search section in sidebar */
.db-search-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    flex: 1;
    min-height: 0;
}

.db-search-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.db-search-bar {
    display: flex;
    gap: 4px;
}

.db-search-bar input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 0.78rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.db-search-bar input:focus {
    border-color: var(--accent-blue);
}

.db-search-bar .btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Search results in sidebar — compact scrollable list */
.db-search-results {
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}

.db-search-results .card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.db-search-results .card-item {
    padding: 0;
}

.db-search-results .card-img-wrapper {
    aspect-ratio: 2/3;
    border-radius: 4px;
}

.db-search-results .card-item-info {
    padding: 3px 4px;
}

.db-search-results .card-item-name {
    font-size: 0.6rem;
    line-height: 1.2;
}

.db-search-results .tag {
    font-size: 0.55rem;
}

.db-search-results .builder-empty-search {
    padding: 12px 6px;
    font-size: 0.75rem;
}

.db-search-results .builder-empty-search .empty-icon {
    font-size: 1.5rem;
}

/* --- Center Deck Area (hero) --- */
.db-deck-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.db-deck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.db-deck-header h2 {
    font-size: 1.1rem;
    margin: 0;
}

.db-deck-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.db-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.db-badge-pokemon {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.db-badge-trainer {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.db-badge-energy {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.db-badge-total {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

/* Scrollable deck card area — HERO */
.db-deck-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Make visual card grid bigger in the hero area */
.db-deck-scroll .deck-card-visual-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 8px 0 12px;
}

/* Collapsible analysis details */
.db-analysis-details {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.db-analysis-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    user-select: none;
    list-style: none;
}

.db-analysis-toggle::-webkit-details-marker {
    display: none;
}

.db-analysis-toggle .toggle-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.db-analysis-details[open] .toggle-hint {
    transform: rotate(180deg);
}

.db-analysis-body {
    padding: 0 4px 12px;
    animation: slideUp 0.2s ease;
}

.db-analysis-body .playstyle-desc {
    margin-bottom: 12px;
}

.db-analysis-body .sw-columns {
    margin-bottom: 0;
}

/* ============================================
   RESPONSIVE — DECK BUILDER V2
   ============================================ */
@media (max-width: 768px) {
    .deck-builder-v2 {
        grid-template-columns: 1fr;
        height: auto;
    }

    .db-sidebar {
        height: auto;
        max-height: 300px;
    }

    .db-deck-area {
        height: auto;
        min-height: 60vh;
    }

    .db-deck-scroll .deck-card-visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (min-width: 1200px) {
    .deck-builder-v2 {
        grid-template-columns: 260px 1fr;
    }

    .db-deck-scroll .deck-card-visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 1600px) {
    .db-deck-scroll .deck-card-visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* Build Deck button on set header */
.btn-build-deck {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-build-deck:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
}

/* Price single fallback */
.price-single {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.price-single .price-type {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.price-single .price-value {
    font-size: 1.2rem;
    font-weight: 800;
}

/* Price loading placeholder */
.price-loading {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
    animation: pricePulse 1.2s ease-in-out infinite;
}

@keyframes pricePulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}