html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    background: #1a1a1a;
    color: #fff;
}

/* Site Header with Logo and Breadcrumbs */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-bottom: 2px solid rgba(0, 179, 55, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-content {
    width: 100%;
    max-width: 2400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.logo-link:hover {
    transform: scale(1.05);
}

.site-logo {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.breadcrumb-item:hover {
    color: #00b337;
}

.breadcrumb-item.breadcrumb-current {
    color: #00b337;
    font-weight: 600;
    cursor: default;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    user-select: none;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #444, #333);
    border-radius: 6px;
    border: 2px solid #1a1a1a;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #00b337, #00d44a);
    border-color: #1a1a1a;
}

::-webkit-scrollbar-thumb:active {
    background: #00b337;
}

::-webkit-scrollbar-corner {
    background: #1a1a1a;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.app-container {
    width: 100%;
    height: calc(100vh - 60px);
    margin-top: 60px;
    display: flex;
    background: #1a1a1a;
}

/* Left Side: Card Search */
.left-side {
    width: 33%;
    min-width: 400px;
    border-right: 1px solid #444;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #313131, #131313);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.left-side.remove-drop-zone,
.left-side.drag-remove-zone {
    background: linear-gradient(to bottom, rgba(220, 53, 69, 0.2), rgba(220, 53, 69, 0.1));
    border-right: 2px solid #dc3545;
}

.left-side.remove-drop-zone::before,
.left-side.drag-remove-zone::before {
    content: '📌 Drop here to unpin';
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 179, 55, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Resizer */
.resizer {
    width: 8px;
    background: linear-gradient(to right, #2a2a2a, #444, #2a2a2a);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #555;
    border-right: 1px solid #555;
}

.resizer::before {
    content: '⋮';
    position: absolute;
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    letter-spacing: -2px;
}

.resizer::after {
    content: 'Drag to resize • Double-click to reset (33%)';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    background: rgba(0, 0, 0, 0.9);
    color: #00b337;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 179, 55, 0.3);
}

.resizer:hover {
    background: linear-gradient(to right, #00b337, #00d44a, #00b337);
    width: 10px;
    box-shadow: 0 0 15px rgba(0, 179, 55, 0.4);
}

.resizer:hover::before {
    color: rgba(255, 255, 255, 0.9);
}

.resizer:hover::after {
    opacity: 1;
}

.resizer.resizing {
    background: #00b337;
    cursor: col-resize;
    width: 10px;
    box-shadow: 0 0 20px rgba(0, 179, 55, 0.6);
}

.resizer.resizing::before {
    color: white;
}

/* Remove Zone for Tier Cards */
.remove-zone {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 80px;
    background: rgba(220, 53, 69, 0.2);
    border: 2px dashed #dc3545;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #dc3545;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

.remove-zone.active {
    opacity: 1;
    pointer-events: auto;
}

.remove-zone.drag-over {
    background: rgba(220, 53, 69, 0.4);
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(220, 53, 69, 0.5);
}

.remove-zone-icon {
    font-size: 32px;
    margin-right: 10px;
}

.right-side {
    flex: 1;
    padding: 15px;
    padding-bottom: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #1a1a1a;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0; /* Allow flex shrinking */
    box-sizing: border-box;
}

.header {
    padding: 15px;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
    z-index: 100;
    max-height: 33vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

#searchInput {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #1a1a1a;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

#searchInput:focus {
    outline: none;
    border-color: #00b337;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-suggestion-header {
    padding: 8px 12px;
    background: #1a1a1a;
    color: #888;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
}

.search-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    color: white;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.search-suggestion-item:hover {
    background: #3a3a3a;
    color: #00b337;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.help-button, #clearSearchButton {
    background: rgba(0, 179, 55, 0.2);
    color: #00b337;
    border: 1px solid rgba(0, 179, 55, 0.4);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.help-button:hover, #clearSearchButton:hover {
    background: rgba(0, 179, 55, 0.3);
    border-color: rgba(0, 179, 55, 0.6);
}

.search-help-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(to bottom, #2a2a2a, #1f1f1f);
    color: white;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 179, 55, 0.3);
    z-index: 1000;
    width: 380px;
    max-width: calc(100vw - 20px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: none;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 179, 55, 0.2);
}

.tooltip-header h4 {
    margin: 0;
    color: #00b337;
    font-size: 16px;
}

.tooltip-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

.tooltip-content {
    padding: 16px;
}

.search-tip {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-tip:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.search-tip strong {
    color: #00b337;
    display: block;
    margin-bottom: 6px;
}

.search-tip code {
    background: rgba(0, 179, 55, 0.15);
    color: #00ff55;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* Filter Container */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-btn-wrapper {
    position: relative;
}

.filter-btn {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #333;
    border-color: #777;
}

.filter-count-badge {
    background: #00b337;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.filter-dropdown-header {
    padding: 10px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.filter-select-all-btn, .filter-clear-btn {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.filter-options {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-option:hover {
    background: #333;
}

.filter-option input[type="checkbox"] {
    cursor: pointer;
}

.filter-clear-all-btn {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.filter-clear-all-btn:hover {
    background: #555;
}

/* Section Toggle Buttons */
.section-toggle-btn {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
}

.section-toggle-btn:hover {
    background: #333;
    border-color: #666;
}

.section-toggle-btn.hidden {
    background: #ff4444;
    color: white;
    border-color: #ff4444;
}

.section-toggle-btn.hidden:hover {
    background: #cc0000;
    border-color: #cc0000;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.filter-chip {
    background: #00b337;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip-remove {
    cursor: pointer;
    font-weight: bold;
}

/* Toggle Filters */
.toggle-filter-container {
    margin: 15px 0 10px;
    padding: 12px;
    background: rgba(0, 179, 55, 0.05);
    border: 1px solid rgba(0, 179, 55, 0.2);
    border-radius: 8px;
}

.toggle-filter-header {
    font-size: 13px;
    font-weight: 600;
    color: #00b337;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    gap: 10px;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background: #555;
    border-radius: 20px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #00b337;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch:hover .toggle-slider {
    background: #666;
}

.toggle-switch input[type="checkbox"]:checked:hover + .toggle-slider {
    background: #008c2b;
}

.toggle-label {
    font-size: 13px;
    color: #ccc;
    white-space: nowrap;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-label {
    color: #00b337;
    font-weight: 500;
}

.sort-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-select {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}



/* Card Grid */
.card-list {
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    gap: 2px;
    justify-content: start;
}

.card-item {
    position: relative;
    cursor: grab;
    transition: transform 0.2s ease;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    width: 120px;
    height: 168px;
    aspect-ratio: 5 / 7;
    border: none;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 0;
    font-size: 0;
}

.card-item[draggable="true"]:active {
    cursor: grabbing;
}

.card-item.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 179, 55, 0.3);
}

.card-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

/* Horizontal cards - rotate horizontal images to display vertically */
.card-item.horizontal-card,
.pinned-card.horizontal-card,
.tier-card.horizontal-card {
    overflow: visible;
}

.card-item.horizontal-card img,
.pinned-card.horizontal-card img,
.tier-card.horizontal-card img {
    transform: rotate(-90deg);
    transform-origin: center center;
    width: 140px; /* Swap width/height for rotated image */
    height: 100px;
    object-fit: cover;
    object-position: center;
    position: relative;
    left: 50%;
    top: 50%;
    margin-left: -70px; /* Half of rotated width */
    margin-top: -50px; /* Half of rotated height */
}

.card-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.pin-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #00b337;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

/* Right Side: Tier List */
.tier-list-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #444;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.tier-list-title {
    width: 100%;
    padding: 12px;
    font-size: 24px;
    font-weight: bold;
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 8px;
    color: #fff;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.tier-list-title:focus {
    outline: none;
    border-color: #00b337;
}

/* Export Branding (hidden by default, shown during export) */
.export-branding {
    text-align: center;
    padding: 15px 0 10px;
    background: #1a1a1a;
}

.export-logo {
    height: 50px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.export-attribution {
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #999;
    font-style: italic;
    background: #1a1a1a;
    margin-bottom: 10px;
}

.tier-list-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.tier-controls-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tier-controls-branding {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
    font-family: 'Poppins', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}

.control-btn {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #333;
    border-color: #00b337;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 16px;
}

/* Pinned Cards Section */
.pinned-cards-section {
    margin: 0;
    padding: 0;
    background: #2a2a2a;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid #444;
    transition: all 0.3s ease;
    min-height: 120px;
    max-height: 40vh;
    flex-shrink: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Expand pinned cards when selector is hidden */
.left-side.selector-hidden .pinned-cards-section {
    max-height: none !important;
    flex: 1 1 auto !important;
    flex-shrink: 1 !important;
    min-height: 0 !important;
}

.left-side.selector-hidden .pinned-cards-grid {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.pinned-cards-section.drag-over {
    background: rgba(0, 179, 55, 0.1);
    border: 2px dashed #00b337;
    box-shadow: 0 0 20px rgba(0, 179, 55, 0.3);
}

.pinned-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    flex-shrink: 0;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

.pinned-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pinned-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinned-cards-header h3 {
    margin: 0;
    color: #00b337;
    font-size: 18px;
}

.pinned-count {
    background: #00b337;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.pinned-clear-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: 500;
}

.pinned-clear-btn:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.6);
}

.pinned-collapse-btn {
    background: rgba(0, 179, 55, 0.2);
    color: #00b337;
    border: 1px solid rgba(0, 179, 55, 0.4);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    line-height: 1;
}

.pinned-collapse-btn:hover {
    background: rgba(0, 179, 55, 0.3);
    border-color: rgba(0, 179, 55, 0.6);
}

.pinned-cards-section.collapsed .pinned-cards-grid {
    display: none;
}

.pinned-cards-section.collapsed {
    min-height: auto;
    max-height: none;
    padding-bottom: 0;
}

.pinned-cards-section.collapsed .pinned-collapse-btn {
    transform: rotate(-90deg);
}

/* Card Selector Header */
.card-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #2a2a2a;
    border-bottom: 2px solid #444;
    flex-shrink: 0;
}

.card-selector-header h3 {
    margin: 0;
    color: #00b337;
    font-size: 16px;
}

.card-selector-toggle-btn {
    background: rgba(0, 179, 55, 0.2);
    color: #00b337;
    border: 1px solid rgba(0, 179, 55, 0.4);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    line-height: 1;
}

.card-selector-toggle-btn:hover {
    background: rgba(0, 179, 55, 0.3);
    border-color: rgba(0, 179, 55, 0.6);
}

.card-selector-header.collapsed + .loading,
.card-selector-header.collapsed ~ .card-list {
    display: none;
}

.card-selector-header.collapsed .card-selector-toggle-btn {
    transform: rotate(-90deg);
}

.pinned-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    gap: 2px;
    width: 100%;
    justify-content: start;
    min-height: 80px;
    padding: 8px 15px 15px 15px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}


.pinned-empty-message {
    width: 100%;
}

.pinned-card {
    position: relative;
    cursor: grab;
    transition: transform 0.2s ease;
    border-radius: 0;
    overflow: hidden;
    width: 120px;
    height: 168px;
    aspect-ratio: 5 / 7;
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 0;
    font-size: 0;
}

.pinned-card:active {
    cursor: grabbing;
}

.pinned-card.dragging {
    opacity: 0.5;
}

.pinned-card.drag-over-left {
    border-left: 3px solid #00b337;
}

.pinned-card.drag-over-right {
    border-right: 3px solid #00b337;
}

.pinned-card:hover {
    transform: scale(1.05);
}

.pinned-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.pinned-card .unpin-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.pinned-card:hover .unpin-btn {
    opacity: 1;
}

/* Tier Columns */
.tier-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    text-align: left;
    position: relative;
    z-index: 1;
    padding-bottom: 15px;
}

.tier-column {
    background: #2a2a2a;
    border-radius: 8px;
    border: 2px solid #555; /* Default border, will be overridden by inline style */
    overflow: visible;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: row;
    min-height: 0;
    height: auto;
    position: relative;
    z-index: 1;
}

.tier-column.drag-over {
    border-color: #00b337 !important; /* Override tier color during drag */
    background: rgba(0, 179, 55, 0.1);
}

.tier-column:has(.tier-settings-panel.active) {
    z-index: 9999;
}

.tier-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 6px;
    background: #333;
    border-right: 1px solid #555;
    min-width: 80px;
    max-width: 120px;
    width: auto;
    flex-shrink: 0;
    align-self: stretch;
}

.tier-name-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    font-size: 24px; /* Original size, will be scaled by JS if needed */
    font-weight: bold;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 2px #000,
        0 0 4px #000;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    resize: none;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 1.2em;
    line-height: 1.2;
    vertical-align: middle;
    font-family: 'Poppins', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}

.tier-name-input:focus {
    outline: none;
    border-color: #00b337;
    background: #2a2a2a;
}

.tier-color-picker {
    display: none;
}

/* Tier Settings Gear Icon */
.tier-settings-toggle {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: rgba(255, 255, 255, 0.15);
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tier-settings-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.8);
}

.tier-column:hover .tier-settings-toggle {
    color: rgba(255, 255, 255, 0.4);
}

/* Tier Settings Panel */
.tier-settings-panel {
    position: fixed;
    background: linear-gradient(to bottom, #2a2a2a, #1f1f1f);
    border: 2px solid rgba(0, 179, 55, 0.4);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    flex-direction: column;
    gap: 12px;
}

.tier-settings-panel.active {
    display: flex;
    animation: slideUpFade 0.2s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tier-settings-panel h4 {
    margin: 0 0 10px 0;
    color: #00b337;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 179, 55, 0.2);
    padding-bottom: 8px;
}

.tier-settings-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tier-settings-item label {
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
}

.tier-settings-panel .tier-color-picker {
    display: block;
    width: 100%;
    height: 40px;
    border: 2px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tier-settings-panel .tier-color-picker:hover {
    border-color: #00b337;
}

.tier-settings-panel .tier-delete-btn {
    display: block;
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    font-weight: 500;
}

.tier-settings-panel .tier-delete-btn:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.6);
}

.tier-content {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: flex-start;
    align-content: flex-start;
    overflow: visible;
    border-radius: 0 8px 8px 0;
    min-height: 0;
    height: auto;
}

.tier-content.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

.tier-card {
    position: relative;
    cursor: grab;
    transition: transform 0.2s ease;
    border-radius: 0;
    overflow: hidden;
    width: 100px;
    height: 140px;
    aspect-ratio: 5 / 7;
    flex-shrink: 0;
    border: none;
    background: transparent;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 0;
    font-size: 0;
}

.tier-card:active {
    cursor: grabbing;
}

.tier-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.tier-card.drag-over-left {
    border-left: 3px solid #00b337;
}

.tier-card.drag-over-right {
    border-right: 3px solid #00b337;
}

.tier-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.tier-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.tier-card .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.tier-card:hover .remove-btn {
    opacity: 1;
}

/* Loading */
.loading {
    padding: 20px;
    text-align: center;
    color: #999;
    flex-shrink: 0;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2a2a2a;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #00b337;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Card Modal */
.card-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.card-modal {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #444;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}

.card-modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    width: 100%;
}

.card-modal-header h2 {
    margin: 0 0 5px 0;
    color: #00b337;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.card-modal-set {
    color: #999;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
}

.card-modal-body {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

.card-modal-left {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.card-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #1a1a1a;
    border: 2px solid #444;
    color: #999;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.modal-close-btn:hover {
    background: #333;
    border-color: #00b337;
    color: #00b337;
}

.card-modal-image {
    max-width: 100%;
    width: 320px;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    border: 2px solid #444;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.card-modal-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Stats row with boxes (Energy, Power, Might) */
.card-modal-stats-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.card-modal-stat-box {
    flex: 1;
    background: #1a1a1a;
    border: 2px solid #00b337;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    color: #00b337;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    color: #00b337;
    font-size: 24px;
    font-weight: 700;
}

/* Info rows (Domain, Type, Tags, etc.) */
.card-modal-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #444;
}

.card-modal-info-row:last-child {
    border-bottom: none;
}

.card-modal-info-label {
    color: #999;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    min-width: 100px;
    flex-shrink: 0;
}

.card-modal-info-value {
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-modal-info-value .domain-badge + .domain-badge,
.card-modal-info-value .tag-badge + .tag-badge {
    margin-left: 0;
}

/* Badges */
.domain-badge {
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Domain color variations - EXACT from deckbuilder */
.domain-badge.domain-fury {
    background-color: #D81F1F;
    color: #ffffff;
}

.domain-badge.domain-calm {
    background-color: #4F8E33;
    color: #ffffff;
}

.domain-badge.domain-mind {
    background-color: #2D71A2;
    color: #ffffff;
}

.domain-badge.domain-body {
    background-color: #E67411;
    color: #ffffff;
}

.domain-badge.domain-chaos {
    background-color: #442E6D;
    color: #ffffff;
}

.domain-badge.domain-order {
    background-color: #D1AD0C;
    color: #1a1a1a;
}

.tag-badge {
    background-color: #69696B;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.type-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.set-badge {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rarity-badge {
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Rarity color variations - EXACT from deckbuilder */
.rarity-badge.rarity-common {
    background: #B9BFCF;
    color: #1a1a1a;
}

.rarity-badge.rarity-uncommon {
    background: #3DC6D1;
    color: #ffffff;
}

.rarity-badge.rarity-rare {
    background: #DF2385;
    color: #ffffff;
}

.rarity-badge.rarity-epic {
    background: #FC7A18;
    color: #ffffff;
}

.rarity-badge.rarity-showcase {
    background: #FC7A18;
    color: #ffffff;
}

.rarity-badge.rarity-legend {
    background: linear-gradient(135deg, #ff0000 0%, #ff6b6b 50%, #ff0000 100%);
    background-size: 200% 200%;
    animation: holographic-shimmer 3s ease-in-out infinite;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.rarity-badge.rarity-promo {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 25%, #a8a8a8 50%, #c0c0c0 75%, #e8e8e8 100%);
    background-size: 200% 200%;
    animation: holographic-shimmer 3s ease-in-out infinite;
    color: #2a2a2a;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

/* Price row */
.card-modal-price-row {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #00b337;
    margin-top: 5px;
}

.card-modal-price-row .card-modal-info-value {
    justify-content: space-between;
    width: 100%;
}

.price-value {
    color: #00b337;
    font-size: 20px;
    font-weight: 700;
}

.tcgplayer-btn {
    background: #00b337;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.tcgplayer-btn:hover {
    background: #00d44a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 55, 0.3);
}

/* Ability section */
.card-modal-text {
    color: #fff;
    font-size: 14px;
    line-height: 1.8;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #444;
    margin-bottom: 15px;
    width: 100%;
}

.ability-label {
    color: #00b337;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ability-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
}

/* Game keyword styling from deckbuilder */
.ability-text .game-keyword {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin: 0 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    line-height: 1.4;
}

.card-modal-controls {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
}

.modal-action-btn {
    flex: 1;
    background: #00b337;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.modal-action-btn:hover {
    background: #00d44a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 179, 55, 0.3);
}

/* Responsive modal */
@media (max-width: 768px) {
    /* Mobile Header */
    .site-header {
        height: 50px;
        padding: 0 12px;
    }
    
    .header-content {
        gap: 12px;
    }
    
    .site-logo {
        height: 32px;
        max-width: 150px;
    }
    
    .breadcrumbs {
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .breadcrumbs::-webkit-scrollbar {
        display: none;
    }
    
    .breadcrumb-item {
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .breadcrumb-separator {
        font-size: 14px;
        flex-shrink: 0;
    }
    
    .app-container {
        height: calc(100vh - 50px);
        margin-top: 50px;
    }
    
    /* Mobile Modal */
    .card-modal {
        max-width: 95%;
        padding: 20px;
    }
    
    .card-modal-body {
        flex-direction: column;
    }
    
    .card-modal-image {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .card-modal-header h2 {
        font-size: 22px;
    }
    
    .card-modal-stats-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-modal-info-label {
        min-width: 80px;
        font-size: 11px;
    }
    
    .card-modal-info-value {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .ability-text {
        font-size: 13px;
    }
    
    .tcgplayer-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .card-modal-price-row .card-modal-info-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .left-side {
        width: 100%;
        min-width: unset;
        max-height: 40vh;
    }
    
    .right-side {
        width: 100%;
        max-height: 60vh;
    }
    
    .tier-column {
        flex-direction: column;
        max-height: none;
        height: auto;
    }
    
    .tier-header {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #555;
        min-width: unset;
        max-width: unset;
    }
    
    .tier-content {
        flex-direction: row;
        overflow: visible;
        height: auto;
    }
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, 100px);
    }
    
    .card-item {
        width: 100px;
        height: 140px;
        aspect-ratio: 5 / 7;
    }
    
    .tier-card {
        width: 100px;
        height: 140px;
        aspect-ratio: 5 / 7;
    }
    
    .pinned-cards-grid {
        grid-template-columns: repeat(auto-fill, 100px);
    }
    
    .pinned-card {
        width: 100px;
        height: 140px;
        aspect-ratio: 5 / 7;
    }
    
    .tier-list-controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
}

