* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #1a1f2e;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.1);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.header {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f3a 100%);
    color: #d4af37;
    padding: 40px 40px 0 40px;
    text-align: center;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    position: relative;
}

.tab-nav {
    display: flex;
    gap: 4px;
    position: relative;
    bottom: -2px;
}

.tab-button {
    background: rgba(15, 20, 25, 0.6);
    border: none;
    color: #7c8db0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
    position: relative;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.tab-button:hover {
    color: #d4af37;
    background: rgba(15, 20, 25, 0.8);
    border-top-color: rgba(212, 175, 55, 0.4);
}

.tab-button.active {
    background: #0f1419;
    color: #d4af37;
    border-top-color: rgba(212, 175, 55, 0.3);
    border-left-color: rgba(212, 175, 55, 0.3);
    border-right-color: rgba(212, 175, 55, 0.3);
    border-bottom: 2px solid #0f1419;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.github-link {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    opacity: 0.8;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.3));
}

.github-link:hover {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
}

.github-link svg {
    width: 100%;
    height: 100%;
    fill: #d4af37;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
}

.header p {
    font-size: 18px;
    opacity: 0.8;
    color: #a8b2d1;
}

.controls {
    padding: 30px 40px;
    background: #0f1419;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group label {
    color: #d4af37;
    font-weight: 600;
}

.date-inputs {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #a8b2d1;
}

input[type="date"] {
    padding: 10px 16px;
    font-size: 16px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    background: #1a1f2e;
    color: #d4af37;
    cursor: pointer;
    font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(100%) saturate(1000%) hue-rotate(360deg) brightness(1.2);
    cursor: pointer;
}

/* Multiselect Styling */
.combo-search {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    background: #1a1f2e;
    color: #d4af37;
    font-family: inherit;
    transition: all 0.3s;
}

.combo-search::placeholder {
    color: rgba(168, 178, 209, 0.5);
}

.combo-search:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.multiselect-container {
    width: 100%;
    height: 170px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 0 0 8px 8px;
    background: #1a1f2e;
    overflow-y: auto;
    padding: 8px;
}

.multiselect-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #252a3d;
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    color: #a8b2d1;
    font-size: 13px;
    user-select: none;
}

.multiselect-option:hover {
    background: #2c3349;
    border-color: rgba(212, 175, 55, 0.5);
}

.multiselect-option input {
    accent-color: #d4af37;
}

.multiselect-option:has(input:checked) {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    color: #d4af37;
    font-weight: 600;
}

.multiselect-option.hidden {
    display: none;
}

.content {
    padding: 40px;
    background: #1a1f2e;
}

.stats-grid {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #1e2a47 0%, #2a3550 100%);
    color: #e8eaf6;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 8px;
    color: #d4af37;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid rgba(212, 175, 55, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.combo-list {
    display: grid;
    gap: 16px;
}

.combo-item {
    background: #0f1419;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.2);
}

.combo-item.has-aspect-border {
    padding-left: 30px;
    border-left: none;
}

.combo-item.has-aspect-border::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.combo-item:hover {
    background: #1a1f2e;
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
    transform: translateX(4px);
}

.combo-rank {
    font-size: 24px;
    font-weight: 700;
    color: #d4af37;
    width: 30px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.combo-info {
    flex: 1;
}

.combo-name {
    font-size: 18px;
    font-weight: 600;
    color: #e8eaf6;
    margin-bottom: 4px;
}

.combo-details {
    font-size: 14px;
    color: #7c8db0;
}

.combo-stats {
    text-align: right;
}

.combo-count {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
}

.combo-percentage {
    font-size: 14px;
    color: #7c8db0;
    margin-top: 4px;
}

.trend-value {
    font-size: 16px;
    font-weight: 700;
}

.trend-positive {
    color: #2ed573;
}

.trend-negative {
    color: #ff4757;
}

.trend-neutral {
    color: #a4b0be;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #7c8db0;
    font-size: 18px;
}

.error {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.chart-container {
    background: #0f1419;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .chart-wrapper {
        height: 300px;
    }

    .header h1 {
        font-size: 28px;
    }

    .combo-item {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .combo-rank {
        width: auto;
    }

    .combo-stats {
        text-align: center;
    }

    .trend-grid {
        flex-direction: column;
    }
}

.trend-grid {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.trend-column {
    flex: 1;
    min-width: 300px;
}

.trend-title {
    font-size: 20px;
    margin-bottom: 16px;
    color: #d4af37;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toggle {
    background: #252a3d;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-toggle:hover {
    background: #2c3349;
    border-color: #d4af37;
}

.btn-toggle.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.toggle-group {
    display: flex;
    gap: 8px;
    background: #0f1419;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

/* ── Query Tab ─────────────────────────────────────── */
.query-panel {
    padding: 40px;
    background: #1a1f2e;
    display: none;
}

.query-panel.visible {
    display: block;
}

.saved-queries-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: #0f1419;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 10px 16px;
    overflow-x: auto;
}

.saved-queries-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d4af37;
    font-weight: 700;
    white-space: nowrap;
}

.saved-queries-list {
    display: flex;
    gap: 8px;
    flex: 1;
}

.saved-query-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    background: #131825;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.saved-query-item:hover {
    background: rgba(212, 175, 55, 0.07);
    border-color: rgba(212, 175, 55, 0.3);
}

.saved-query-item.active {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.4);
    color: #d4af37;
}

.saved-query-name {
    font-size: 13px;
    color: #c8d0e8;
    font-weight: 600;
}

.saved-query-item.active .saved-query-name {
    color: #d4af37;
}

.saved-query-delete {
    background: none;
    border: none;
    color: #7c8db0;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s;
}

.saved-query-delete:hover {
    color: #ff6b7a;
}

.saved-query-add {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(212, 175, 55, 0.08);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    color: #d4af37;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.saved-query-add:hover {
    background: rgba(212, 175, 55, 0.15);
}

.query-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.query-input-row input[type="text"] {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    background: #0f1419;
    color: #e8eaf6;
    font-family: inherit;
    transition: all 0.3s;
}

.query-input-row input[type="text"]:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.query-input-row input[type="text"]::placeholder {
    color: rgba(168, 178, 209, 0.4);
}

.query-submit {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
    color: #0f1419;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.query-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

.query-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 24px !important;
    background: #090c10 !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.fullscreen .query-sql-textarea {
    flex: 1;
    height: auto;
    max-height: none;
}

.fullscreen .matrix-wrapper {
    max-height: none !important;
    flex: 1;
}

.query-results-block {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #0f1419;
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 16px 20px;
    margin-top: 16px;
}

.fullscreen.query-results-block {
    border: none;
    border-radius: 0;
    padding: 24px;
    margin-top: 0;
}

.query-results-wrapper {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    flex: 1;
    max-height: 75vh;
}

.fullscreen.query-results-block .query-results-wrapper {
    border: none;
    max-height: none !important;
}

.query-sql-block {
    background: #0f1419;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.query-sql-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.query-sql-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d4af37;
    font-weight: 600;
}

.query-sql-actions {
    display: flex;
    gap: 8px;
}

.query-sql-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.08);
    color: #d4af37;
    cursor: pointer;
    transition: all 0.2s;
}

.query-sql-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.6);
}

.query-sql-btn.run-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
    color: #0f1419;
    border-color: transparent;
}

.query-sql-btn.run-btn:hover {
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
}

.query-sql-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    background: transparent;
    border: none;
    outline: none;
    color: #a8b2d1;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    padding: 0;
}

.query-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.query-results-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(135deg, #1e2a47 0%, #2a3550 100%);
    color: #d4af37;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.query-results-table th:hover {
    background: linear-gradient(135deg, #253354 0%, #324060 100%);
}

.query-results-table td {
    padding: 12px 16px;
    color: #e8eaf6;
    font-size: 14px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.query-results-table tbody tr {
    background: #0f1419;
    transition: all 0.2s;
}

.query-results-table tbody tr:nth-child(even) {
    background: #131825;
}

.query-results-table tbody tr:hover {
    background: #1a2030;
}

/* Matchup Matrix */
.matrix-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
    white-space: nowrap;
}

.matrix-table th {
    position: sticky;
    top: 0;
    background: #1e2a47;
    color: #d4af37;
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    border-right: 1px solid rgba(212, 175, 55, 0.1);
    z-index: 2;
}

.matrix-table th.row-header {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: right;
    padding-right: 12px;
    font-size: 10px;
    background: #1e2a47;
    border-right: 2px solid rgba(212, 175, 55, 0.3);
    white-space: nowrap;
}

.matrix-table td {
    border-right: 1px solid rgba(212, 175, 55, 0.07);
    border-bottom: 1px solid rgba(212, 175, 55, 0.07);
    text-align: center;
    padding: 6px 8px;
    font-weight: 700;
    font-size: 11px;
    color: #fff;
    min-width: 52px;
    transition: filter 0.15s;
}

.matrix-table td:hover {
    filter: brightness(1.2);
}

.matrix-table td.row-label {
    position: sticky;
    left: 0;
    background: #1e2a47;
    color: #d4af37;
    font-weight: 700;
    font-size: 11px;
    text-align: right;
    padding: 8px 12px 8px 10px;
    border-right: 2px solid rgba(212, 175, 55, 0.3);
    z-index: 1;
    white-space: nowrap;
}

.matrix-table .mirror-cell {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #7c8db0 !important;
}

.matrix-table .no-data-cell {
    color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    font-weight: 400;
}

.matrix-header-click {
    cursor: pointer !important;
    transition: color 0.2s, text-shadow 0.2s;
}

.matrix-header-click:hover {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.matrix-cell-click:hover {
    filter: brightness(1.3) !important;
    outline: 2px solid rgba(212, 175, 55, 0.6);
    outline-offset: -2px;
}

.wr-delta-row:hover {
    background: rgba(212, 175, 55, 0.08) !important;
}

.query-error {
    background: rgba(255, 71, 87, 0.08);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff6b7a;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
}

.query-empty {
    text-align: center;
    padding: 60px 20px;
    color: #7c8db0;
}

.query-empty .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.query-empty p {
    font-size: 16px;
    opacity: 0.7;
}

.query-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.query-example-chip {
    background: #252a3d;
    border: 1px solid rgba(212, 175, 55, 0.15);
    color: #a8b2d1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.query-example-chip:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
    color: #d4af37;
}

.query-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d4af37;
    padding: 20px 0;
}

.query-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.query-meta {
    font-size: 12px;
    color: #7c8db0;
    margin-bottom: 12px;
}

.query-auth-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.query-auth-row label {
    color: #d4af37;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.query-auth-row input[type="password"] {
    flex: 1;
    max-width: 360px;
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    background: #0f1419;
    color: #e8eaf6;
    font-family: inherit;
}

.query-auth-row input[type="password"]:focus {
    outline: none;
    border-color: #d4af37;
}

.CodeMirror {
    flex: 1;
    width: 100%;
    height: auto;
    min-height: 120px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
}

.fullscreen .CodeMirror {
    height: 100%;
    max-height: none;
}

/* ── Decklist Grid ────────────────────────────────── */
.decklist-meta {
    font-size: 14px;
    color: #a8b2d1;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.decklist-meta strong {
    color: #d4af37;
}

.decklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 75vh;
    overflow-y: auto;
    padding: 4px;
}

.fullscreen .decklist-grid {
    max-height: none;
}

.decklist-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}

.decklist-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
    z-index: 2;
}

.decklist-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 7;
    background: #131825;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.15);
    transition: border-color 0.2s;
}

.decklist-card:hover .decklist-card-img-wrap {
    border-color: rgba(212, 175, 55, 0.5);
}

.decklist-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.decklist-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #0f1419;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.decklist-card-copies {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(15, 20, 25, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #d4af37;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(4px);
}

.decklist-card-fallback {
    width: 100%;
    aspect-ratio: 5 / 7;
    background: #131825;
    border: 2px solid rgba(212, 175, 55, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c8db0;
    font-size: 11px;
    font-family: monospace;
    text-align: center;
    padding: 8px;
    word-break: break-all;
}

/* ── Archetype Rounds Chart (below decklist) ─── */
.archetype-rounds-section {
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}