@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #18181b;
    --border: rgba(255, 255, 255, 0.06);
    --text: #fafafa;
    --muted: #71717a;
    --card-w: 98px;
    --card-h: 143px;
    --radius: 12px;
    --accent: #a1a1aa;
    --header-bg: rgba(9, 9, 11, 0.85);
    --header-hover: rgba(255, 255, 255, 0.14);
    --input-focus: rgba(255, 255, 255, 0.15);
    --shadow-soft: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --surface-2: #e4e4e7;
    --border: rgba(0, 0, 0, 0.08);
    --text: #18181b;
    --muted: #71717a;
    --accent: #52525b;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-hover: rgba(0, 0, 0, 0.08);
    --input-focus: rgba(0, 0, 0, 0.12);
    --shadow-soft: rgba(0, 0, 0, 0.12);
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.app-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    white-space: nowrap;
}

.app-title span { color: var(--muted); font-weight: 400; }

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.nav-link {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    border-color: var(--header-hover);
}

.nav-link.active {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--header-hover);
}

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

.search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.12);
}

.stats {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.main { padding: 0 1.25rem 2rem; max-width: 1400px; margin: 0 auto; }

.cat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

#catPillsWrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

#catPillsWrap::-webkit-scrollbar { display: none; }

.cat-bar::-webkit-scrollbar { display: none; }

.cat-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pill-color, #6366f1);
}

.cat-pill:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.12); }

.cat-pill.active {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.cat-pill[data-id="0"].active {
    background: rgba(255, 255, 255, 0.08);
}

.cat-pill .count {
    font-size: 0.7rem;
    opacity: 0.6;
}

.cat-btn-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px dashed var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn-icon:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0 0.75rem;
    flex-wrap: wrap;
}

.drag-hint {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.drag-hint.off { opacity: 0.4; }

.tipo-filter details { color: var(--muted); font-size: 0.75rem; }

.tipo-filter summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.tipo-filter summary::-webkit-details-marker { display: none; }

.tipo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.chip {
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover, .chip.active {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-tcgplayer {
    border-color: rgba(255, 140, 0, 0.35) !important;
    color: #ffb347 !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-tcgplayer:hover {
    background: rgba(255, 140, 0, 0.12) !important;
    border-color: rgba(255, 140, 0, 0.55) !important;
    color: #ffc266 !important;
}

.btn-trollandtoad {
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #4ade80 !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-trollandtoad:hover {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.55) !important;
    color: #86efac !important;
}

.btn-comprar {
    border-color: rgba(99, 102, 241, 0.45) !important;
    color: #a5b4fc !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-comprar:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.65) !important;
    color: #c7d2fe !important;
}

.qty-stepper {
    display: flex;
    align-items: stretch;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qty-stepper:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.qty-btn {
    flex-shrink: 0;
    width: 38px;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, opacity 0.15s;
    padding: 0;
}

.qty-btn:first-child {
    border-right: 1px solid var(--border);
}

.qty-btn:last-child {
    border-left: 1px solid var(--border);
}

.qty-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.qty-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.96);
}

.qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    padding: 0 0.25rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.grid-cartas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 0.5rem 0 1rem;
    min-height: 120px;
}

.carta-item, .slot-add {
    width: var(--card-w);
    height: var(--card-h);
    border-radius: var(--radius);
    position: relative;
    flex-shrink: 0;
}

.carta-item {
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s;
}

.carta-item:active { cursor: grabbing; }

.carta-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.carta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    pointer-events: none;
}

.carta-item .grip {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.carta-item:hover .grip { opacity: 1; }

.badge-qty {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: #09090b;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.carta-nombre {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 6px 5px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.52rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.slot-add {
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}

.slot-add:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text);
    background: var(--surface);
}

.empty-msg {
    width: 100%;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.sortable-ghost {
    opacity: 0.35;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.sortable-ghost img { opacity: 0; }

.sortable-chosen { transform: scale(1.04) rotate(1deg); z-index: 10; }

.sortable-drag { opacity: 1 !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }

.dropzone {
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    background: var(--surface);
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
    transition: border-color 0.2s;
}

.dropzone:hover, .dropzone:focus { border-color: rgba(255, 255, 255, 0.2); }
.dropzone.dragover { border-color: rgba(255, 255, 255, 0.3); background: var(--surface-2); }
.dropzone.has-image { cursor: default; }
.dropzone img { max-height: 160px; border-radius: 8px; }
.dropzone p { margin: 0; font-size: 0.8rem; color: var(--muted); }

.modal-content {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
}

.modal-header, .modal-footer { border-color: var(--border) !important; }

.form-control, .form-select {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

.form-text { color: var(--muted) !important; }

.cat-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    padding: 0;
}

.cat-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    background: var(--surface);
}

.cat-check input { display: none; }

.cat-check .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--pill-color, #6366f1) 55%, var(--muted));
    opacity: 0.7;
}

.cat-check-name {
    white-space: nowrap;
}

.cat-check .cat-qty {
    margin-left: 0.15rem;
}

.cat-check:has(input:checked),
.cat-check.is-active {
    color: #fff;
    background: color-mix(in srgb, var(--pill-color, #6366f1) 28%, #18181b);
    border-color: var(--pill-color, #6366f1);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pill-color, #6366f1) 70%, transparent),
                0 0 14px color-mix(in srgb, var(--pill-color, #6366f1) 35%, transparent);
}

.cat-check:has(input:checked) .dot,
.cat-check.is-active .dot {
    background: var(--pill-color, #6366f1);
    opacity: 1;
    box-shadow: 0 0 8px var(--pill-color, #6366f1);
}

.carta-sobre-meta {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4c1d95;
    padding: 0.55rem 0.75rem;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    line-height: 1.45;
    word-break: break-word;
}

#verSobreWrap.is-empty .carta-sobre-meta {
    color: #64748b;
    font-weight: 500;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.qty-stepper-sm {
    height: 28px;
    min-width: 5.5rem;
    flex-shrink: 0;
    border-radius: 8px;
    border-color: color-mix(in srgb, var(--pill-color, #6366f1) 45%, var(--border));
    background: rgba(0, 0, 0, 0.35);
}

.qty-stepper-sm .qty-btn {
    width: 24px;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #fff;
    background: color-mix(in srgb, var(--pill-color, #6366f1) 22%, var(--surface-2));
}

.qty-stepper-sm .qty-value {
    flex: 0 0 1.75rem;
    min-width: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

.qty-stepper-sm .qty-input {
    display: none;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 9, 11, 0.72);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.app-loader.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.app-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.app-loader-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fafafa;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.app-loader-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

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

.grid-cartas.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

/* ——— Página Decks ——— */
.page-decks {
    --deck-w: min(100%, 300px);
    --deck-h: 168px;
}

.grid-decks {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0.5rem 0 1rem;
    min-height: 120px;
}

.deck-item, .deck-slot-add {
    width: var(--deck-w);
    max-width: 340px;
    height: var(--deck-h);
    border-radius: var(--radius);
    position: relative;
    flex-shrink: 0;
}

.deck-item {
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-item--pastel {
    background: var(--deck-pastel-a, #c4b5fd);
}

.deck-item-bg {
    position: absolute;
    inset: -25%;
    background:
        radial-gradient(circle at 28% 32%, var(--deck-pastel-b, #ddd6fe), transparent 58%),
        radial-gradient(circle at 72% 68%, var(--deck-pastel-a, #c4b5fd), transparent 52%),
        linear-gradient(145deg, var(--deck-pastel-a, #c4b5fd), var(--deck-pastel-b, #ddd6fe));
    filter: blur(32px);
    opacity: 0.95;
    pointer-events: none;
}

.deck-item:active { cursor: grabbing; }

.deck-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.deck-item .grip {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
}

.deck-item:hover .grip { opacity: 1; }

.badge-fmt {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    border-left: 3px solid var(--pill-color, #6366f1);
    z-index: 2;
    pointer-events: none;
}

.deck-item--pastel .deck-nombre {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0.85rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: rgba(15, 23, 42, 0.9);
    text-shadow: 0 1px 14px rgba(255, 255, 255, 0.5);
    word-break: break-word;
    pointer-events: none;
    z-index: 1;
    background: none;
    white-space: normal;
}

.dropzone-deck img { max-height: 220px; max-width: 100%; }

.deck-preview-wrap {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #0c0c0e;
    overflow: auto;
    max-height: 70vh;
}

.deck-preview-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.fmt-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.fmt-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.fmt-radio input { display: none; }

.fmt-radio .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pill-color);
}

.fmt-radio:has(input:checked) {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.14);
}

.grid-decks.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

.deck-hint { font-size: 0.72rem; }

@media (min-width: 768px) {
    :root { --card-w: 112px; --card-h: 164px; }
    .page-decks { --deck-w: 320px; --deck-h: 180px; }
}

@media (min-width: 1200px) {
    .page-decks { --deck-w: 360px; --deck-h: 200px; }
}

/* ——— Duelo ——— */
.page-duel .main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
}

.duel-board {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 340px) 1fr;
    gap: 1.25rem;
    align-items: start;
}

.player-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: border-color 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.player-card--p1 { border-top: 3px solid #6366f1; }
.player-card--p2 { border-top: 3px solid #f59e0b; }

.player-card.is-winner {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 28px rgba(99, 102, 241, 0.25);
}

.player-card--p2.is-winner {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 28px rgba(245, 158, 11, 0.3);
}

.player-card.is-defeated {
    opacity: 0.55;
}

.player-card-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.player-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.player-badge--p1 { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.player-badge--p2 { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

.player-name {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin: 0;
    color: var(--text);
}

.lp-display {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #fff;
    transition: transform 0.15s, color 0.2s;
}

.lp-display.lp-flash {
    animation: lpFlash 0.35s ease;
}

@keyframes lpFlash {
    0% { transform: scale(1); }
    40% { transform: scale(1.06); color: #fef08a; }
    100% { transform: scale(1); }
}

.lp-label {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0.35rem 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lp-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.lp-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.45rem 0.25rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.lp-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.lp-btn:active { transform: scale(0.96); }

.lp-btn--minus { color: #fca5a5; }
.lp-btn--plus { color: #86efac; }
.lp-btn--apply { color: #a5b4fc; }

.lp-custom {
    display: flex;
    gap: 0.4rem;
}

.lp-custom-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
    padding: 0.4rem 0.55rem;
    outline: none;
}

.lp-custom-input:focus {
    border-color: rgba(255, 255, 255, 0.18);
}

.duel-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dice-zone {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem 1rem;
    text-align: center;
}

.dice-zone-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.25rem;
}

.dice-zone-hint {
    font-size: 0.68rem;
    color: var(--muted);
    margin: 0 0 1rem;
    opacity: 0.85;
}

.turn-order-panel {
    width: 100%;
}

.turn-order-auto {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1rem;
    text-align: center;
}

.turn-order-auto-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.turn-order-auto-who {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.turn-order-auto-who--p1 { color: #a5b4fc; }
.turn-order-auto-who--p2 { color: #fcd34d; }

.turn-order-auto-hint {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

.dice--card {
    width: 88px;
    height: 88px;
}

.card-dice-result {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--muted);
}

.card-dice-result--hit {
    color: #86efac;
}

/* Calculadora LP */
.lp-calc {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    text-align: left;
}

.lp-calc-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.45rem;
    text-align: center;
}

.lp-calc-display {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.45rem;
    min-height: 2.4rem;
    color: #fff;
}

.lp-calc-keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.lp-calc-key {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.12s, transform 0.1s;
}

.lp-calc-key:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lp-calc-key:active { transform: scale(0.96); }

.lp-calc-key--fn {
    font-size: 0.78rem;
    color: var(--muted);
}

.lp-calc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.lp-calc-action {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.5rem 0.35rem;
    cursor: pointer;
    transition: background 0.12s;
}

.lp-calc-action--minus { color: #fca5a5; }
.lp-calc-action--plus { color: #86efac; }

.lp-calc-action:hover {
    background: rgba(255, 255, 255, 0.08);
}

.player-card--p1 .lp-calc-display {
    border-color: rgba(99, 102, 241, 0.25);
}

.player-card--p2 .lp-calc-display {
    border-color: rgba(245, 158, 11, 0.25);
}

.dice-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dice-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.dice-player-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dice-player-tag--p1 { color: #a5b4fc; }
.dice-player-tag--p2 { color: #fcd34d; }

.dice-vs {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0 0.15rem;
}

.dice {
    width: 72px;
    height: 72px;
    perspective: 400px;
    position: relative;
}

.dice-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dice-face {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    line-height: 1;
    background: linear-gradient(145deg, #27272a, #18181b);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.dice.is-rolling .dice-inner {
    animation: diceTumble 0.18s linear infinite;
}

.dice.is-rolling .dice-face {
    animation: dicePulse 0.18s ease-in-out infinite alternate;
}

@keyframes diceTumble {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    25% { transform: rotateX(90deg) rotateY(45deg) rotateZ(15deg); }
    50% { transform: rotateX(180deg) rotateY(90deg) rotateZ(0deg); }
    75% { transform: rotateX(270deg) rotateY(135deg) rotateZ(-15deg); }
    100% { transform: rotateX(360deg) rotateY(180deg) rotateZ(0deg); }
}

@keyframes dicePulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.35); }
}

.dice.dice-landed .dice-inner {
    animation: diceLand 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes diceLand {
    0% { transform: scale(1.15) rotateX(720deg); }
    60% { transform: scale(0.95) rotateX(0deg); }
    100% { transform: scale(1) rotateX(0deg); }
}

.btn-roll {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #18181b;
    background: linear-gradient(135deg, #fafafa, #d4d4d8);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.12);
}

.btn-roll:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(255, 255, 255, 0.18);
}

.btn-roll:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dice-result {
    min-height: 1.4rem;
    margin: 0.85rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.dice-result--p1 { color: #a5b4fc; }
.dice-result--p2 { color: #fcd34d; }

.duel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.duel-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.duel-action-btn:hover {
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.14);
}

.duel-action-btn--ghost {
    color: var(--muted);
}

@media (max-width: 900px) {
    .duel-board {
        grid-template-columns: 1fr;
    }

    .duel-center { order: -1; }
}

@media (max-width: 480px) {
    .lp-controls { grid-template-columns: repeat(2, 1fr); }
    .dice { width: 64px; height: 64px; }
    .dice-face { font-size: 2.4rem; border-radius: 12px; }
}

/* Setup Single / Match */
.duel-setup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 9, 11, 0.92);
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.duel-setup.d-none { display: none !important; }

.duel-setup-box {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.duel-setup-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.duel-setup-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.duel-setup-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.duel-setup-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.duel-setup-opt i {
    font-size: 1.4rem;
    color: #a5b4fc;
    margin-bottom: 0.15rem;
}

.duel-setup-opt strong {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.duel-setup-opt span:last-child {
    font-size: 0.72rem;
    color: var(--muted);
}

.duel-setup-opt:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.duel-setup-opt[data-mode="match"] i { color: #fcd34d; }

.duel-setup-opt[data-mode="match"]:hover {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.08);
}

.duel-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.duel-mode-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.duel-mode-badge--match {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.duel-mode-info {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Match panel */
.match-panel {
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}

.match-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fcd34d;
    margin: 0 0 0.75rem;
}

.match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.match-score-player {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.match-score-num {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.match-score-player--p1 .match-score-num { color: #a5b4fc; }
.match-score-player--p2 .match-score-num { color: #fcd34d; }

.match-score-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
}

.match-score-sep {
    font-size: 1rem;
    color: var(--muted);
}

.match-duels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.match-duel-slot {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem 0.25rem;
    background: var(--surface-2);
}

.match-duel-slot--active {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.match-duel-slot--p1 {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.12);
}

.match-duel-slot--p2 {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
}

.match-duel-label {
    display: block;
    font-size: 0.6rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.match-duel-winner {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.match-first-winner {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: var(--surface-2);
}

.match-first-winner--p1 { color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.match-first-winner--p2 { color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }

.match-status {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0 0 0.65rem;
}

.match-status--done {
    color: #86efac;
    font-weight: 600;
}

/* Historial LP */
.lp-history {
    margin-top: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.lp-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.lp-history-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lp-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.lp-history-empty {
    padding: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.lp-history-item {
    display: grid;
    grid-template-columns: 4.5rem 2rem 5.5rem 4rem 1fr 4.5rem;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.lp-history-item:last-child { border-bottom: none; }

.lp-history-item--p1 { border-left: 3px solid #6366f1; }
.lp-history-item--p2 { border-left: 3px solid #f59e0b; }

.lp-history-time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.lp-history-duel {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 4px;
    text-align: center;
    padding: 0.1rem 0;
}

.lp-history-player {
    font-weight: 600;
    white-space: nowrap;
}

.lp-history-item--p1 .lp-history-player { color: #a5b4fc; }
.lp-history-item--p2 .lp-history-player { color: #fcd34d; }

.lp-history-delta {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.lp-history-delta--plus { color: #86efac; }
.lp-history-delta--minus { color: #fca5a5; }

.lp-history-detail {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-history-after {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .lp-history-item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.5rem;
    }

    .lp-history-time { grid-column: 1; }
    .lp-history-delta { grid-column: 2; grid-row: 1; }
    .lp-history-player { grid-column: 1; }
    .lp-history-duel { display: none; }
    .lp-history-detail { grid-column: 1 / -1; white-space: normal; }
    .lp-history-after { grid-column: 2; grid-row: 2; }
}

/* ——— Popup victoria ——— */
body.victory-open { overflow: hidden; }

.victory-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.victory-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.victory-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 8, 0.82);
    backdrop-filter: blur(10px);
    animation: victoryBackdropIn 0.45s ease forwards;
}

.victory-overlay.is-visible .victory-backdrop {
    animation: victoryBackdropIn 0.45s ease forwards;
}

@keyframes victoryBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.victory-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.victory-particle {
    position: absolute;
    bottom: -10px;
    border-radius: 50%;
    opacity: 0;
    animation: victoryParticleUp 2s ease-out forwards;
}

@keyframes victoryParticleUp {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0);
    }
    15% {
        opacity: 1;
        transform: translateY(-8vh) rotate(90deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-105vh) rotate(720deg) scale(0.4);
    }
}

.victory-card {
    position: relative;
    z-index: 2;
    width: min(360px, 100%);
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(165deg, #1a1a1f 0%, #0f0f12 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    transform: scale(0.75) translateY(24px);
    opacity: 0;
}

.victory-card--animate {
    animation: victoryCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes victoryCardIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(40px);
    }
    60% {
        opacity: 1;
        transform: scale(1.04) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.victory-card--p1 {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.2), 0 24px 80px rgba(0, 0, 0, 0.55);
}

.victory-card--p2 {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.2), 0 24px 80px rgba(0, 0, 0, 0.55);
}

.victory-rays {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.04), transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: victoryRaysSpin 8s linear infinite;
    pointer-events: none;
}

.victory-card--p1 .victory-rays {
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.12), transparent, rgba(129, 140, 248, 0.08), transparent);
}

.victory-card--p2 .victory-rays {
    background: conic-gradient(from 0deg, transparent, rgba(245, 158, 11, 0.12), transparent, rgba(251, 191, 36, 0.08), transparent);
}

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

.victory-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.victory-ring--1 {
    width: 200px;
    height: 200px;
    animation: victoryRingPulse 2s ease-out infinite;
}

.victory-ring--2 {
    width: 280px;
    height: 280px;
    animation: victoryRingPulse 2s ease-out 0.4s infinite;
}

.victory-card--p1 .victory-ring { border-color: rgba(99, 102, 241, 0.25); }
.victory-card--p2 .victory-ring { border-color: rgba(245, 158, 11, 0.25); }

@keyframes victoryRingPulse {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.85);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.35);
    }
}

.victory-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    animation: victoryIconPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.victory-card--p1 .victory-icon {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.victory-card--p2 .victory-icon {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

@keyframes victoryIconPop {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    70% { transform: scale(1.15) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-kicker {
    position: relative;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 0.35rem;
}

.victory-name {
    position: relative;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0 0 0.35rem;
    animation: victoryNameGlow 2s ease-in-out infinite alternate;
}

.victory-card--p1 .victory-name { color: #a5b4fc; }
.victory-card--p2 .victory-name { color: #fcd34d; }

@keyframes victoryNameGlow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.1); }
    to { text-shadow: 0 0 28px rgba(255, 255, 255, 0.25); }
}

.victory-sub {
    position: relative;
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.victory-score {
    position: relative;
    font-size: 0.95rem;
    font-weight: 700;
    color: #86efac;
    margin: 0 0 1rem;
}

.victory-btn {
    position: relative;
    margin-top: 0.75rem;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #18181b;
    background: linear-gradient(135deg, #fafafa, #d4d4d8);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    animation: victoryBtnIn 0.5s ease 0.35s both;
}

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

.victory-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 255, 255, 0.22);
}

.victory-card--p1 .victory-btn {
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
}

.victory-card--p2 .victory-btn {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
}

/* ——— Auth & perfil ——— */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.12), transparent 55%), var(--bg);
}

.auth-wrap {
    width: min(440px, 100%);
}

.auth-wrap .auth-card--wide {
    max-width: 520px;
    margin: 0 auto;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.auth-brand h1 span { color: var(--muted); font-weight: 500; }

.auth-brand p {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1.25rem;
}

.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }

.auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.auth-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 0.15s;
}

.auth-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
}

.auth-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-password-wrap .auth-input {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.auth-password-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.auth-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit {
    margin-top: 0.35rem;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #18181b;
    background: linear-gradient(135deg, #fafafa, #d4d4d8);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.82rem;
}

.auth-links a {
    color: #a5b4fc;
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

.auth-alert {
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.auth-alert--error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.auth-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.auth-alert--info {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    max-width: 160px;
}

.user-menu-btn:hover {
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.user-menu-btn i { font-size: 1.1rem; color: #a5b4fc; }

.user-menu-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-menu-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s;
}

.user-menu-logout:hover {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.profile-main {
    max-width: 980px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
}

.profile-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.profile-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
}

.profile-avatar-wrap {
    position: relative;
    width: 72px;
    margin: 0 auto 0.65rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #a5b4fc;
    overflow: hidden;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-upload-form {
    position: absolute;
    right: 0;
    bottom: 0;
}

.profile-avatar-upload-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: #6366f1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.profile-avatar-upload-btn:hover {
    background: #4f46e5;
}

.profile-verified-icon {
    color: #3b82f6;
    font-size: 0.95rem;
    vertical-align: middle;
    margin-left: 0.15rem;
}

.profile-verify-box {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.profile-verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.profile-verify-badge--ok {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.profile-verify-badge--pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.profile-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
}

.profile-user-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.profile-cossy-mini {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fcd34d;
    margin: 0 0 0.5rem;
}

.profile-role {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    margin-bottom: 0.85rem;
}

.profile-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.75rem;
    text-align: left;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.profile-tab:hover {
    background: var(--surface-2);
    color: var(--text);
}

.profile-tab.active {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

.profile-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
}

.profile-form { max-width: 400px; }

.profile-hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.profile-hint a { color: #a5b4fc; }

.profile-field-hint {
    font-size: 0.7rem;
    color: var(--muted);
    margin: 0.3rem 0 0;
}

.profile-perfil-grid {
    display: grid;
    grid-template-columns: 1fr min(340px, 100%);
    gap: 1.5rem;
    align-items: start;
}

.cossy-card-wrap {
    position: sticky;
    top: 5rem;
}

.cossy-card-preview-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 0.65rem;
    text-align: center;
}

.cossy-card {
    position: relative;
    aspect-ratio: 1.586 / 1;
    background: linear-gradient(145deg, #0a0a0c 0%, #000 45%, #121218 100%);
    border-radius: 14px;
    border: 2px solid #c5a059;
    box-shadow:
        0 0 0 1px rgba(197, 160, 89, 0.35),
        0 12px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 0.85rem 1rem 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cossy-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
    pointer-events: none;
    animation: cossyShine 4s ease-in-out infinite;
}

@keyframes cossyShine {
    0%, 100% { opacity: 0.3; transform: translateX(-10%); }
    50% { opacity: 0.7; transform: translateX(10%); }
}

.cossy-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.cossy-konami-badge {
    background: linear-gradient(180deg, #d42a2a, #9b1111);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.45rem;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.cossy-dots {
    display: grid;
    grid-template-columns: repeat(6, 4px);
    gap: 3px;
    flex: 1;
    justify-content: center;
    max-width: 90px;
}

.cossy-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c5a059;
    opacity: 0.85;
}

.cossy-id-pill {
    font-size: 0.65rem;
    font-weight: 800;
    color: #c41e3a;
    border: 2px solid #c5a059;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    background: rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
}

.cossy-card-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.1rem;
    padding: 0.35rem 0;
    position: relative;
    z-index: 1;
}

.cossy-hero-line {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(0.62rem, 2.8vw, 0.78rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #c41e3a;
    text-shadow:
        1px 1px 0 #c5a059,
        -1px -1px 0 #c5a059,
        1px -1px 0 #c5a059,
        -1px 1px 0 #c5a059,
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.cossy-card-data {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(197, 160, 89, 0.35);
    padding-top: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cossy-data-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cossy-data-label {
    font-size: 0.48rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(197, 160, 89, 0.75);
}

.cossy-data-value {
    font-size: 0.72rem;
    font-weight: 700;
    color: #f5f5f5;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cossy-data-value--id {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.18em;
    color: #fcd34d;
    text-shadow: 0 0 12px rgba(252, 211, 77, 0.25);
}

.cossy-data-row--id {
    margin-top: 0.15rem;
}

@media (max-width: 700px) {
    .profile-layout { grid-template-columns: 1fr; }
    .profile-perfil-grid { grid-template-columns: 1fr; }
    .cossy-card-wrap { position: static; order: -1; }
    .user-menu-name { display: none; }
    .app-header { flex-wrap: wrap; }
}

/* ── Banlist ── */
.page-banlist {
    --banlist-view-h: calc(100vh - 220px);
}

.banlist-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: calc(100vh - 64px);
}

.banlist-pill.active {
    border-color: var(--pill-color);
    color: var(--pill-color);
    background: rgba(255, 255, 255, 0.06);
}

.banlist-pill.active .dot {
    background: var(--pill-color);
    box-shadow: 0 0 8px var(--pill-color);
}

.banlist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 0.25rem;
}

.banlist-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    color: var(--text);
}

.banlist-desc {
    font-size: 0.82rem;
    color: var(--muted);
}

.banlist-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.banlist-open-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.banlist-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.banlist-iframe-wrap {
    flex: 1;
    min-height: var(--banlist-view-h);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a0a0f;
}

.banlist-iframe {
    width: 100%;
    height: 100%;
    min-height: var(--banlist-view-h);
    border: 0;
    display: block;
}

.banlist-image-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a0a0f;
    overflow: auto;
    min-height: var(--banlist-view-h);
}

.banlist-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.banlist-iframe-hint {
    padding: 0 0.25rem;
    margin: 0;
}

@media (max-width: 700px) {
    .page-banlist { --banlist-view-h: calc(100vh - 280px); }
    .banlist-head { flex-direction: column; align-items: flex-start; }
}

/* ── Header actions / Share ── */
.btn-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-header-action:hover {
    background: var(--surface-2);
    border-color: var(--header-hover);
}

.btn-header-pending .pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #111;
    font-size: 0.62rem;
    font-weight: 700;
}

.share-url-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-url-box input { flex: 1; }

.share-guest-bar {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(34, 197, 94, 0.1));
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 1.25rem;
}

.share-guest-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-guest-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.share-guest-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.share-guest-label input {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    min-width: 140px;
}

.pending-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.pending-item:last-child { border-bottom: 0; }

.pending-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.pending-action {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f59e0b;
}

.pending-summary {
    font-size: 0.88rem;
    color: var(--text);
}

.pending-guest {
    font-size: 0.75rem;
    color: var(--muted);
}

.pending-item-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

[data-theme="light"] .modal-content {
    box-shadow: 0 16px 48px var(--shadow-soft);
}

[data-theme="light"] .deck-item--pastel .deck-nombre {
    color: rgba(15, 23, 42, 0.92);
}

[data-theme="light"] .carta-item img {
    background: #e4e4e7;
}

[data-theme="light"] .app-loader {
    background: rgba(244, 244, 245, 0.85);
}

[data-theme="light"] .btn-close {
    filter: none;
}

.share-code-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-unlocked-msg {
    margin: 0.5rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: #22c55e;
}

.share-create-form .form-label { margin-bottom: 0.25rem; }

.share-link-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.share-link-item:last-child { border-bottom: 0; }

.share-url-box-sm input { font-size: 0.72rem; }

.page-share.share-readonly .carta-item .grip { display: none !important; }

.page-share.share-readonly .sortable-chosen,
.page-share.share-readonly .sortable-ghost { display: none; }

.profile-share-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-share-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--surface);
}

.profile-share-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.profile-share-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.65rem;
}

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

.profile-share-code {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #f59e0b;
    padding: 0.35rem 0.6rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
}

.code-view-wrap {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 220px;
}

.code-view-wrap--profile {
    max-width: 100%;
}

.code-view-input {
    width: 100%;
    padding-right: 2.5rem !important;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    letter-spacing: 0.1em;
    cursor: default;
    user-select: all;
}

.code-view-input[readonly] {
    background: var(--surface);
    opacity: 1;
}

.code-view-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    line-height: 1;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.code-view-toggle:hover {
    color: var(--text);
    background: rgba(128, 128, 128, 0.12);
}

.share-link-code-row {
    margin-bottom: 0.5rem;
}

.share-link-code-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.share-link-code-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.share-link-code-field .code-view-wrap {
    flex: 1;
    max-width: none;
}

.profile-share-set-code .auth-input {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
}

.profile-share-missing {
    font-size: 0.85rem;
    color: #ef4444;
}

.profile-share-url {
    font-size: 0.78rem !important;
    padding: 0.45rem 0.65rem !important;
}

.profile-share-revoke { margin-top: 0.25rem; }

.share-link-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.share-link-code {
    font-size: 0.78rem;
    white-space: nowrap;
}

.share-link-code code {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #f59e0b;
}

.share-link-code--missing {
    color: #ef4444;
    font-size: 0.72rem;
}

.share-link-delete {
    margin-top: 0.5rem;
    width: 100%;
}

/* ── Tienda YGO (estilo TCGPlayer) ── */
.page-tienda .main {
    max-width: 1680px;
}

.tienda-cart-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: auto;
    z-index: 20000;
    max-width: min(88vw, 300px);
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 1.25rem));
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.tienda-cart-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.tienda-toast-inner {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    padding: 0.72rem 0.95rem;
    border-radius: 11px;
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    text-align: left;
}

.tienda-toast-inner .bi {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
}

.tienda-toast-inner--success .bi {
    color: #4ade80;
}

.tienda-toast-inner--warning {
    border-color: rgba(251, 191, 36, 0.24);
}

.tienda-toast-inner--warning .bi {
    color: #fbbf24;
}

.tienda-toast-inner--error {
    border-color: rgba(248, 113, 113, 0.24);
}

.tienda-toast-inner--error .bi {
    color: #f87171;
}

.tienda-toast-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.tienda-toast-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f4f4f5;
    line-height: 1.25;
}

.tienda-toast-sub {
    font-size: 0.72rem;
    color: #a1a1aa;
    line-height: 1.35;
}

.swal2-container.swal2-top-end {
    z-index: 20050 !important;
    padding: 1rem !important;
}

.tienda-toast-sw.swal2-popup {
    display: block !important;
    width: auto !important;
    max-width: min(88vw, 300px) !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.tienda-toast-sw .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.tienda-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), var(--surface));
}

.tienda-search-block {
    flex: 1;
    min-width: min(100%, 520px);
}

.tienda-search {
    width: 100%;
    position: relative;
}

.tienda-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.tienda-search-input {
    width: 100%;
    padding: 1rem 1.15rem 1rem 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.05rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tienda-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tienda-toolbar-hint {
    margin: 0.55rem 0 0 0.15rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.tienda-sync-progress {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.tienda-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.75rem;
    color: #a5b4fc;
}

.tienda-status-spinner,
.tienda-grid-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

.tienda-search.is-busy .tienda-search-input {
    padding-right: 2.5rem;
}

.tienda-search.is-busy::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.tienda-grid-wrap {
    position: relative;
    min-height: 220px;
}

.tienda-grid-wrap.is-busy .tienda-products {
    pointer-events: none;
}

.tienda-grid-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    background: rgba(9, 9, 11, 0.35);
    backdrop-filter: blur(2px);
    border-radius: 12px;
}

.tienda-grid-loader-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(24, 24, 27, 0.92);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--muted);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .tienda-grid-loader {
    background: rgba(255, 255, 255, 0.55);
}

[data-theme="light"] .tienda-grid-loader-inner {
    background: rgba(255, 255, 255, 0.95);
    color: #64748b;
}

.tienda-product--skeleton {
    pointer-events: none;
    cursor: default;
    box-shadow: none;
}

.tienda-product--skeleton:hover {
    transform: none;
    box-shadow: none;
}

.tienda-skeleton {
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: tiendaShimmer 1.2s ease-in-out infinite;
}

.tienda-skeleton-img {
    width: 100%;
    aspect-ratio: 59 / 86;
    border-radius: 6px;
}

.tienda-skeleton-title {
    height: 14px;
    width: 92%;
    margin-bottom: 0.35rem;
}

.tienda-skeleton-set {
    height: 11px;
    width: 75%;
    margin-bottom: 0.3rem;
}

.tienda-skeleton-meta {
    height: 10px;
    width: 60%;
    margin-bottom: 0.35rem;
}

.tienda-skeleton-badge {
    height: 18px;
    width: 72px;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.tienda-skeleton-price {
    height: 12px;
    width: 55%;
    margin-top: 0.5rem;
}

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

.tienda-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.tienda-banner {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.08);
}

.tienda-banner--warn {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
}

.tienda-banner-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.tienda-banner-inner > i {
    font-size: 1.4rem;
    color: #6366f1;
    flex-shrink: 0;
}

.tienda-banner--warn .tienda-banner-inner > i {
    color: #f59e0b;
}

.tienda-banner-inner > div {
    flex: 1;
    min-width: 180px;
}

.tienda-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.tienda-search-ad-wrap {
    margin-bottom: 1rem;
}

.tienda-search-ad {
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--border);
    line-height: 0;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
}

.tienda-search-ad-link,
.tienda-search-ad-inner {
    display: block;
}

.tienda-search-ad-link {
    transition: transform 0.15s, box-shadow 0.15s;
}

.tienda-search-ad-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.tienda-search-ad img,
.tienda-search-ad-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.tienda-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    min-height: 200px;
    padding: 0.25rem 0 0.5rem;
}

.tienda-products.is-loading {
    opacity: 0.92;
}

.tienda-product {
    --tienda-img-w: 88px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.75rem;
    min-height: 148px;
    padding: 0.875rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    color: #111827;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.06);
}

a.tienda-product {
    text-decoration: none;
}

.tienda-product:hover,
.tienda-product:focus-visible {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07), 0 10px 28px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.tienda-product-img {
    flex: 0 0 var(--tienda-img-w);
    width: var(--tienda-img-w);
    align-self: center;
}

.tienda-product-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.tienda-product-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    justify-content: center;
    padding: 0.1rem 0;
}

.tienda-product-title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.15rem;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tienda-product-set {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tienda-product-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.35;
    font-weight: 500;
}

.tienda-stock-badge {
    display: inline-block;
    align-self: flex-start;
    margin-top: 0.45rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tienda-market-price {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.tienda-market-label {
    color: #374151;
    font-weight: 600;
}

.tienda-market-value {
    color: #16a34a;
    font-weight: 700;
    font-size: 0.9375rem;
}

@media (max-width: 1400px) {
    .tienda-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .tienda-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .tienda-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .tienda-products {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .tienda-product {
        --tienda-img-w: 76px;
        min-height: 130px;
        padding: 0.75rem;
    }

    .tienda-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tienda-toolbar-hint {
        white-space: normal;
    }

    .tienda-status {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

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

    .tienda-detail-img {
        max-width: 180px;
        margin: 0 auto;
    }
}

.tienda-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0 1.5rem;
}

.tienda-page-label {
    font-size: 0.82rem;
    color: var(--muted);
    min-width: 4rem;
    text-align: center;
}

.tienda-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted);
}

.tienda-empty i {
    font-size: 2.5rem;
    opacity: 0.4;
    display: block;
    margin-bottom: 0.75rem;
}

.tienda-empty h2 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.tienda-detail {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.25rem;
}

.tienda-detail-img {
    position: relative;
}

.tienda-detail-img img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.tienda-passcode {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.tienda-detail-type {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.tienda-detail-stats {
    font-size: 0.78rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 0.5rem;
}

.tienda-detail-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.tienda-detail h6 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.45rem;
}

.tienda-price-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.tienda-price-grid span {
    color: var(--muted);
}

.tienda-banlist {
    margin-bottom: 1rem;
}

.tienda-sets-table {
    font-size: 0.75rem;
}

.tienda-sets-table th {
    color: var(--muted);
    font-weight: 500;
}

[data-theme="light"] .tienda-banner {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] .tienda-product {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #111827;
}

[data-theme="dark"] .tienda-product-title {
    color: #111827;
}

[data-theme="light"] .tienda-sets-table {
    --bs-table-bg: transparent;
}

/* ── Producto detalle (TCGPlayer-style) ── */
.page-producto-detalle .main {
    max-width: 1400px;
}

.producto-breadcrumb {
    margin-bottom: 1rem;
}

.producto-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
}

.producto-breadcrumb a:hover {
    color: var(--text);
}

.producto-hero {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.producto-hero-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.producto-hero-type {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.35rem;
}

.producto-hero-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.producto-hero-stats {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.producto-hero-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 1rem;
    max-height: 8rem;
    overflow-y: auto;
}

.producto-listings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.producto-listings-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.producto-listings-sub {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.producto-source-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    white-space: nowrap;
}

.producto-listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.producto-listings-grid--few {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1100px;
}

.producto-listing-item {
    cursor: pointer;
}

.producto-listing-item:hover .tienda-market-value {
    color: #15803d;
}

.producto-error {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted);
}

.producto-error i {
    font-size: 2rem;
    opacity: 0.5;
    display: block;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .producto-hero {
        grid-template-columns: 1fr;
    }

    .producto-hero-img {
        max-width: 180px;
        margin: 0 auto;
    }

    .producto-listings-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .producto-listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Theme switch (perfil) ── */
.theme-switch-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.theme-switch-label {
    font-size: 0.82rem;
    color: var(--muted);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #334155;
    border-radius: 999px;
    transition: 0.2s;
}

.theme-switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.theme-switch input:checked + .theme-switch-slider {
    background: #6366f1;
}

.theme-switch input:checked + .theme-switch-slider::before {
    transform: translateX(22px);
}

/* ── Admin: usuarios / roles ── */
.page-admin .admin-main {
    max-width: 1200px;
}

.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-table {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text);
}

.admin-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    vertical-align: middle;
    border-color: var(--border);
}

.role-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.role-menu-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    margin: 0;
}

.role-menu-check input {
    accent-color: #6366f1;
}

[data-theme="light"] .admin-table thead th {
    background: #f8fafc;
}

/* ——— Carrito + config tienda ——— */
.nav-link-cart {
    position: relative;
}

.nav-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.tienda-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.45rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: #6366f1;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.tienda-btn-cart:hover:not(:disabled) {
    background: #4f46e5;
}

.tienda-btn-cart:disabled {
    opacity: 0.7;
    cursor: wait;
}

.producto-listing-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.producto-tcg-link {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.producto-tcg-link:hover {
    color: var(--text);
}

.btn-market-prices {
    width: 100%;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.65rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-market-prices:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.55);
    color: #a5b4fc;
}

.producto-market-modal .modal-header {
    align-items: flex-start;
}

.producto-market-sub {
    margin-top: 0.15rem;
}

.producto-market-intro {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.producto-market-conditions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem;
}

.producto-market-cond-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border);
    background: var(--surface-2, rgba(255, 255, 255, 0.03));
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.producto-market-cond-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.producto-market-cond-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.producto-market-cond-avg {
    font-size: 1.15rem;
    font-weight: 700;
    color: #15803d;
}

.producto-market-cond-meta {
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.35;
}

.producto-market-detail-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.producto-market-detail-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.producto-market-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border);
    background: var(--surface-2, rgba(255, 255, 255, 0.02));
}

.producto-market-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.producto-market-detail-info strong {
    font-size: 0.82rem;
    font-weight: 600;
}

.producto-market-detail-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #15803d;
    white-space: nowrap;
}

.producto-market-footer {
    justify-content: space-between;
}

.producto-market-chart-card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-2, rgba(255, 255, 255, 0.03));
    padding: 1rem 1rem 0.85rem;
    margin-bottom: 1.25rem;
}

.producto-market-chart-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.producto-market-chart-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    flex-shrink: 0;
}

.producto-market-chart-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--text);
}

.producto-market-chart-meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.producto-market-chart-price {
    color: var(--text);
    margin: 0 0.35rem;
}

.producto-market-chart-change {
    font-weight: 600;
    font-size: 0.78rem;
}

.producto-market-chart-change--up {
    color: #15803d;
}

.producto-market-chart-change--down {
    color: #dc2626;
}

.producto-market-chart-change--flat {
    color: var(--muted);
}

.producto-market-chart-canvas-wrap {
    position: relative;
    height: 210px;
    margin-bottom: 0.75rem;
}

.producto-market-chart-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.producto-market-chart-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.35rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    color: var(--text);
}

.producto-market-chart-tab:hover {
    background: rgba(99, 102, 241, 0.08);
}

.producto-market-chart-tab.is-active {
    background: var(--text);
    color: var(--bg, #fff);
}

.producto-market-chart-tab.is-active .producto-market-chart-tab-pct {
    color: inherit;
    opacity: 0.85;
}

.producto-market-chart-tab-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.producto-market-chart-tab-pct {
    font-size: 0.65rem;
    font-weight: 600;
}

[data-theme="dark"] .producto-market-chart-icon {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .producto-market-chart-change--up {
    color: #4ade80;
}

[data-theme="dark"] .producto-market-chart-change--down {
    color: #f87171;
}

[data-theme="dark"] .producto-market-chart-tab.is-active {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .producto-market-cond-avg,
[data-theme="dark"] .producto-market-detail-price {
    color: #4ade80;
}

[data-theme="dark"] .btn-market-prices {
    color: #a5b4fc;
}

.carrito-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.25rem;
}

.carrito-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.carrito-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.carrito-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

.carrito-items {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.carrito-segment {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.carrito-segment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: #fff;
}

.carrito-segment--0 .carrito-segment-head { background: linear-gradient(90deg, #0a84ff, #0066cc); }
.carrito-segment--1 .carrito-segment-head { background: linear-gradient(90deg, #1a3d6d, #0f2744); }
.carrito-segment--2 .carrito-segment-head { background: linear-gradient(90deg, #6366f1, #4f46e5); }
.carrito-segment--3 .carrito-segment-head { background: linear-gradient(90deg, #0891b2, #0e7490); }

.carrito-segment-city {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.carrito-segment-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.carrito-segment-body {
    display: grid;
    grid-template-columns: 1fr 220px;
    align-items: stretch;
}

.carrito-segment-items {
    min-width: 0;
    border-right: 1px solid var(--border);
}

.carrito-segment-aside {
    padding: 0.85rem;
    background: var(--surface-2, rgba(148, 163, 184, 0.06));
}

.carrito-segment-summary {
    font-size: 0.82rem;
}

.carrito-segment-summary-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin: 0 0 0.65rem;
}

.carrito-segment-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
}

.carrito-segment-summary-total-row {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.carrito-segment-summary-total-row strong {
    font-size: 1rem;
    color: #0a84ff;
}

.carrito-segment-envio {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.carrito-segment-envio-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.carrito-segment-envio-value {
    font-size: 0.88rem;
    color: #0a84ff;
}

.carrito-segment-envio--undefined .carrito-segment-envio-value {
    color: #d97706;
    font-size: 0.78rem;
}

.carrito-segment-retiro-title {
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.carrito-segment-retiro-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.carrito-segment-retiro-item {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--muted);
}

.carrito-segment-retiro-item strong {
    display: block;
    color: var(--text);
    font-size: 0.76rem;
}

.carrito-items-wrap {
    position: relative;
    min-height: 120px;
}

.carrito-loader {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--muted);
}

.carrito-item {
    display: grid;
    grid-template-columns: 72px 1fr 108px;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0;
    background: var(--surface);
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    align-items: start;
}

.carrito-item--no-img {
    grid-template-columns: 1fr 108px;
}

.carrito-segment-items .carrito-item:last-child {
    border-bottom: none;
}

.carrito-item-img img {
    width: 72px;
    height: auto;
    border-radius: 6px;
    display: block;
}

.carrito-item-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.carrito-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.carrito-item-condicion-inline .producto-condicion-badge {
    font-size: 0.68rem;
    white-space: nowrap;
}

.carrito-item-title:hover {
    color: #6366f1;
}

.carrito-item-set,
.carrito-item-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
}

.carrito-item-unit-price {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
    text-align: right;
}

.carrito-item-market {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
}

.carrito-item-actions {
    text-align: right;
    min-width: 110px;
}

.carrito-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}

.carrito-qty-input {
    width: 2.5rem;
    text-align: center;
    padding: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.85rem;
}

.carrito-item-line {
    font-weight: 700;
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.carrito-summary {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: sticky;
    top: 1rem;
}

.carrito-summary-tcg {
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.carrito-summary-tcg .carrito-summary-title {
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.carrito-summary-shipping.text-warning {
    color: #d97706 !important;
    font-weight: 600;
    font-size: 0.82rem;
}

.carrito-summary-courier {
    text-align: center;
}

.carrito-summary-grand {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 2px solid var(--border);
    font-size: 1.05rem;
    font-weight: 700;
}

.carrito-summary-grand strong {
    font-size: 1.35rem;
    color: #0a84ff;
}

.carrito-summary-tax-note {
    text-align: center;
    margin: 0.35rem 0 1rem;
}

.carrito-btn-checkout {
    font-weight: 700;
    padding: 0.65rem 1rem;
    border-radius: 8px;
}

.carrito-destino-block {
    margin-top: 0.5rem;
}

.carrito-summary-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.carrito-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
}

.carrito-summary-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
}

.carrito-summary-total strong {
    font-size: 1.15rem;
    color: #22c55e;
}

.carrito-summary-discount span:last-child {
    font-weight: 600;
}

.carrito-checkout-block {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.carrito-checkout-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.carrito-item-condicion .producto-condicion-badge {
    vertical-align: middle;
}

.carrito-retiro-panel {
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 197, 94, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
}

.carrito-retiro-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.carrito-retiro-sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 0.85rem;
}

.carrito-retiro-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.carrito-retiro-card {
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.carrito-retiro-vendedor {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.carrito-retiro-lugar {
    font-size: 0.82rem;
    margin: 0 0 0.2rem;
    color: var(--text);
}

.carrito-retiro-ciudad {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
}

.carrito-retiro-empty {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.carrito-item-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin-top: 0.4rem;
}

.carrito-item-detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.76rem;
    color: var(--muted);
}

.carrito-item-retiro-chip {
    color: #6366f1;
}

.carrito-item-margen em {
    font-style: normal;
    color: var(--muted);
    font-size: 0.68rem;
}

.carrito-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.carrito-empty i {
    font-size: 2.5rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.config-main {
    max-width: 900px;
}

.config-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.config-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 992px) {
    .carrito-segment-body {
        grid-template-columns: 1fr;
    }

    .carrito-segment-items {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .carrito-layout {
        grid-template-columns: 1fr;
    }

    .carrito-item {
        grid-template-columns: 64px 1fr;
    }

    .carrito-item--no-img {
        grid-template-columns: 1fr;
    }

    .carrito-item-actions {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .carrito-item-unit-price {
        text-align: left;
        margin: 0;
    }
}

/* ——— Vender carta + publicaciones vendedor en tienda ——— */
.vender-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.25rem;
}

.vender-head {
    margin-bottom: 1.25rem;
}

.vender-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.vender-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.vender-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}

.vender-step span {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    font-weight: 700;
    font-size: 0.7rem;
}

.vender-step.is-active {
    border-color: #6366f1;
    color: var(--text);
    background: rgba(99, 102, 241, 0.12);
}

.vender-step.is-done {
    color: #22c55e;
}

.vender-tcg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 540px) {
    .vender-tcg-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.vender-tcg-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    text-align: center;
}

.vender-tcg-pick:hover {
    border-color: var(--tcg-color, #6366f1);
    transform: translateY(-2px);
}

.vender-tcg-pick.is-selected {
    border-color: var(--tcg-color, #6366f1);
    background: color-mix(in srgb, var(--tcg-color, #6366f1) 12%, transparent);
}

.vender-tcg-pick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tcg-color, #6366f1) 18%, transparent);
    color: var(--tcg-color, #6366f1);
    font-size: 1.15rem;
}

.vender-tcg-pick strong {
    font-size: 0.82rem;
    line-height: 1.2;
}

.vender-tcg-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.vender-panel {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.vender-search {
    position: relative;
}

.vender-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.vender-search input {
    padding-left: 2.25rem;
}

.vender-card-results {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.vender-card-pick,
.vender-edition-pick {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.vender-card-pick:hover,
.vender-edition-pick:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.vender-edition-pick {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 0.65rem;
}

.vender-edition-thumb {
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: cover;
    background: var(--surface-3, #eee);
}

.vender-edition-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.vender-editions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vender-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.vender-edition-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.vender-edition-summary-body {
    flex: 1;
    min-width: 0;
}

.vender-ref-price {
    font-size: 0.875rem;
    color: var(--text);
}

.vender-ref-price--na {
    color: var(--text-muted, #6c757d);
}

.vender-ref-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.15rem;
}

.vender-ref-price strong {
    color: #22c55e;
    font-size: 1.05rem;
}

.vender-edition-price {
    display: block;
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 600;
    margin-top: 0.15rem;
}

.vender-precio-hint {
    line-height: 1.35;
}

.vender-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.vender-mis-publicaciones {
    margin-top: 2rem;
}

.vender-subtitle {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.vender-mis-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.vender-mis-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.vender-estado-select {
    max-width: 120px;
}

.vender-btn-delete {
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.producto-stock-badge {
    display: inline-block;
    margin: 0.35rem 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.producto-stock-badge--out {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.producto-vendor-options {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.producto-vendor-options-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.producto-vendor-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.producto-vendor-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin: 0;
}

.producto-vendor-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}

.producto-vendor-option-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.producto-vendor-option-price {
    color: #16a34a;
    font-size: 1.05rem;
}

.producto-vendor-option-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
}

.producto-vendor-option-ciudad {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.producto-vendor-option-ciudad .bi {
    margin-right: 0.15rem;
    color: #6366f1;
}

.producto-vendor-option-qty {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.15rem;
}

.producto-vendor-option-qty-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.producto-vendor-option-qty .producto-qty-spinner {
    max-width: 8.5rem;
}

.producto-vendor-option:hover {
    border-color: rgba(99, 102, 241, 0.45);
}

.producto-vendor-option.is-selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.producto-vendor-option input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.producto-vendor-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.producto-vendor-option-body strong {
    color: #16a34a;
    font-size: 1rem;
}

.producto-vendor-option-meta {
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.35;
}

.producto-vendor-modal-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.producto-vendor-modal-details p {
    margin-bottom: 0.35rem;
}

.producto-vendor-detail-list {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.producto-vendor-detail-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.5rem;
    align-items: start;
    font-size: 0.9rem;
}

.producto-vendor-detail-row dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
}

.producto-vendor-detail-row dd {
    margin: 0;
}

.producto-condicion-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.producto-condicion-badge--mint {
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
}

.producto-condicion-badge--nm {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.producto-condicion-badge--lp {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.producto-condicion-badge--mp {
    background: rgba(249, 115, 22, 0.16);
    color: #c2410c;
}

.producto-condicion-badge--hp {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.producto-condicion-badge--dmg {
    background: rgba(127, 29, 29, 0.16);
    color: #7f1d1d;
}

.producto-vendor-option-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.producto-vendor-price {
    color: #16a34a;
    font-weight: 700;
    font-size: 1.05rem;
}

.producto-vendor-qty {
    margin-top: 0.25rem;
}

.producto-vendor-qty .producto-vendor-detail-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-secondary, #64748b);
}

.producto-qty-spinner {
    max-width: 9.5rem;
}

.producto-qty-spinner .form-control {
    font-weight: 600;
}

.producto-qty-spinner .btn {
    min-width: 2.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.vender-variant-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vender-variant-row {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.vender-variant-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.vender-variant-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.vender-variants-block .form-label {
    font-size: 0.85rem;
}

.vender-btn-edit {
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.tienda-product-hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
}

.tienda-product--vendedor {
    border-color: rgba(99, 102, 241, 0.35);
}

.tienda-seller-meta {
    margin: 0.5rem 0;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.72rem;
    line-height: 1.45;
}

.tienda-seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.tienda-seller-line {
    margin: 0.1rem 0;
    color: var(--text);
}

.tienda-seller-line strong {
    color: var(--muted);
    font-weight: 600;
}

.subastas-main,
.subasta-detalle-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem;
}

.subasta-datetime-wrap {
    position: relative;
}

.subasta-datetime-wrap .subasta-datetime-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.55;
    font-size: 1rem;
}

.subasta-datetime-wrap .flatpickr-input[readonly],
.subasta-datetime-wrap input.form-control {
    padding-right: 2.25rem;
    cursor: pointer;
}

.flatpickr-calendar {
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    background: var(--surface, #1e1e2e);
    color: var(--text, #e2e8f0);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #6366f1;
    border-color: #6366f1;
}

.subasta-estado-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.subasta-estado-badge--pendiente {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.subasta-estado-badge--finalizada,
.subasta-estado-badge--cancelada,
.subasta-estado-badge--rechazada {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.subasta-card-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.subasta-finaliza-meta {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.25rem 0 0.5rem;
}

.subasta-detalle-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.subasta-detalle-pending-msg {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 0.88rem;
    margin: 0.5rem 0;
}

[data-theme="light"] .flatpickr-calendar {
    background: #fff;
    color: #1e293b;
}

[data-theme="light"] .subasta-detalle-pending-msg {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.subastas-reglas {
    margin-bottom: 1rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    background: var(--surface, rgba(255, 255, 255, 0.03));
    overflow: hidden;
}

.subastas-reglas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.subastas-reglas-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.subastas-reglas-body {
    padding: 0.85rem 1rem 1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
}

.subastas-reglas-body ul,
.subastas-reglas-body ol {
    margin: 0.35rem 0 0.35rem 1.1rem;
    padding: 0;
}

.subasta-fotos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.subasta-foto-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}

.subasta-foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subasta-foto-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.subasta-detalle-gallery-main-wrap,
.subasta-detalle-gallery-main {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.subasta-detalle-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.subasta-detalle-gallery-thumb {
    width: 56px;
    height: 82px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
}

.subasta-detalle-gallery-thumb.is-active {
    border-color: #6366f1;
}

.subasta-detalle-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subasta-timer--pending .subasta-timer-value {
    color: #fbbf24;
}

.subasta-detalle-not-started {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.note-editor.note-frame {
    border-color: var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    overflow: hidden;
}

.subastas-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.subasta-vendedor-link {
    font-weight: 600;
    text-decoration: none;
    color: #a5b4fc;
}

.subasta-vendedor-link:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

.subasta-stars {
    display: inline-flex;
    gap: 0.1rem;
    vertical-align: middle;
}

.subasta-star-btn {
    border: none;
    background: transparent;
    padding: 0;
    color: #fbbf24;
    line-height: 1;
    font-size: 0.95rem;
}

.subasta-stars--interactive .subasta-star-btn {
    cursor: pointer;
}

.subasta-card-vendedor-stars,
.subasta-detalle-vendedor-stars {
    display: inline-flex;
    vertical-align: middle;
}

.subasta-estado-badge--ganada {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

.subasta-estado-badge--calificar {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
}

.subasta-vendedor-perfil-head {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.subasta-vendedor-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.subasta-vendedor-avatar--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.6rem;
    color: var(--text-secondary, #94a3b8);
}

.subasta-vendedor-perfil-name {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.subasta-vendedor-perfil-rating {
    margin: 0 0 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.subasta-vendedor-perfil-meta {
    margin: 0 0 0.2rem;
    font-size: 0.88rem;
}

.subasta-vendedor-resenas-title {
    font-size: 0.95rem;
    margin: 0 0 0.65rem;
}

.subasta-vendedor-resenas-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subasta-vendedor-resena {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.subasta-vendedor-resena-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.25rem;
}

.subasta-vendedor-resena-autor {
    font-weight: 600;
    font-size: 0.88rem;
}

.subasta-vendedor-resena-fecha {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
}

.subasta-vendedor-resena-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.subasta-rate-form {
    margin: 0.85rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
}

.subasta-rate-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.salon-subasta-main {
    max-width: 1100px;
    margin: 0 auto;
}

.salon-subasta-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1rem;
    min-height: 60vh;
}

.salon-subasta-sidebar,
.salon-subasta-chat,
.salon-subasta-placeholder {
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    background: var(--surface, rgba(255, 255, 255, 0.03));
}

.salon-subasta-sidebar-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.salon-subasta-sidebar-title {
    margin: 0;
    font-size: 0.95rem;
}

.salon-subasta-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    max-height: 58vh;
    overflow-y: auto;
}

.salon-subasta-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
}

.salon-subasta-item:hover,
.salon-subasta-item.is-active {
    background: rgba(99, 102, 241, 0.15);
}

.salon-subasta-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
}

.salon-subasta-item-user,
.salon-subasta-item-preview {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
}

.salon-subasta-chat {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
}

.salon-subasta-chat-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.salon-subasta-chat-title {
    margin: 0;
    font-size: 1rem;
}

.salon-subasta-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.salon-subasta-msg {
    max-width: 85%;
    align-self: flex-start;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.salon-subasta-msg.is-mine {
    align-self: flex-end;
    background: rgba(99, 102, 241, 0.22);
}

.salon-subasta-msg-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 0.2rem;
}

.salon-subasta-msg-body {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.salon-subasta-compose {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.salon-subasta-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary, #94a3b8);
    min-height: 60vh;
    grid-column: 2;
}

.salon-subasta-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.salon-subasta-empty,
.salon-subasta-sidebar-loader {
    padding: 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary, #94a3b8);
}

@media (max-width: 768px) {
    .salon-subasta-layout {
        grid-template-columns: 1fr;
    }

    .salon-subasta-sidebar {
        max-height: 35vh;
    }

    .salon-subasta-placeholder {
        grid-column: 1;
        min-height: 30vh;
    }
}

.subastas-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.subastas-toolbar .admin-list-meta {
    margin-left: auto;
}

.subasta-card-title a {
    color: inherit;
    text-decoration: none;
}

.subasta-card-title a:hover {
    color: #6366f1;
}

.subasta-card-thumb-link {
    display: block;
    line-height: 0;
}

.subasta-card-bid-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.subasta-timer--ended .subasta-timer-value {
    color: #ef4444;
    font-weight: 600;
}

.subasta-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20060;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-width: min(88vw, 300px);
    pointer-events: none;
}

.subasta-bid-toast {
    padding: 0.72rem 0.9rem;
    border-radius: 11px;
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid rgba(251, 191, 36, 0.28);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    color: #f4f4f5;
    opacity: 0;
    transform: translateX(calc(100% + 1rem));
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.subasta-bid-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.subasta-bid-toast-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 0.2rem;
}

.subasta-bid-toast-card {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
}

.subasta-bid-toast-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: #4ade80;
    margin: 0.15rem 0;
}

.subasta-bid-toast-user {
    font-size: 0.72rem;
    color: #a1a1aa;
}

[data-theme="light"] .subasta-bid-toast {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

[data-theme="light"] .subasta-bid-toast-user {
    color: #64748b;
}

.subasta-detalle-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.subasta-detalle-back:hover {
    color: var(--text);
}

.subasta-detalle-loader,
.subasta-detalle-error {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}

.subasta-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

.subasta-detalle-img-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subasta-detalle-img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 8px;
}

.subasta-detalle-img-empty {
    color: var(--muted);
    font-size: 2rem;
}

.subasta-detalle-info {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.subasta-detalle-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.subasta-detalle-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.15rem 0;
}

.subasta-detalle-desc {
    font-size: 0.85rem;
    margin: 0.65rem 0 0;
}

.subasta-detalle-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    position: sticky;
    top: 5rem;
}

.subasta-detalle-price {
    font-size: 2rem;
    font-weight: 800;
    color: #22c55e;
    margin: 0;
    line-height: 1.1;
}

.subasta-detalle-bids-meta,
.subasta-detalle-timer {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.2rem 0 0.75rem;
}

.subasta-detalle-bid-form {
    margin-bottom: 1rem;
}

.subasta-detalle-ended {
    font-size: 0.85rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.subasta-detalle-history-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
}

.subasta-detalle-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.subasta-detalle-history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
}

.subasta-detalle-history-amount {
    font-weight: 700;
    color: #22c55e;
}

.subasta-detalle-history-user {
    color: var(--text);
}

.subasta-detalle-history-time {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.7rem;
}

.subasta-detalle-history-empty {
    color: var(--muted);
    font-size: 0.8rem;
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .subasta-detalle-grid {
        grid-template-columns: 1fr;
    }

    .subasta-detalle-panel {
        position: static;
    }
}

.subastas-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.subastas-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.subastas-loader,
.subastas-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}

.subastas-list {
    display: grid;
    gap: 0.85rem;
}

.subasta-card {
    display: grid;
    grid-template-columns: auto 1fr 220px;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    align-items: start;
}

.subasta-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.subasta-card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0.1rem 0;
}

.subasta-card-desc {
    font-size: 0.8rem;
    margin: 0.5rem 0 0;
}

.subasta-card-side {
    text-align: right;
}

.subasta-price-current {
    font-size: 1.35rem;
    font-weight: 800;
    color: #22c55e;
    margin: 0;
}

.subasta-price-label,
.subasta-timer {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.15rem 0;
}

.subasta-search-pick {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.subasta-search-pick:hover {
    border-color: #6366f1;
}

.subasta-dropzone {
    min-height: 140px;
}

.subasta-entrega-checks {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.15rem;
}

.subasta-card-thumb {
    border-radius: 6px;
    object-fit: cover;
    background: rgba(99, 102, 241, 0.08);
}

.subasta-pick-summary {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

@media (max-width: 768px) {
    .subasta-card {
        grid-template-columns: 1fr;
    }

    .subasta-card-thumb {
        max-width: 88px;
    }

    .subasta-card-side {
        text-align: left;
    }
}

/* Colección: buscar carta en catálogo */
.catalogo-buscar-results {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 220px;
    overflow-y: auto;
}

.catalogo-buscar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.catalogo-buscar-item:hover,
.catalogo-buscar-item.is-selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.catalogo-buscar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.catalogo-buscar-info strong {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalogo-seleccionado {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.06);
}

.user-menu-guest {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.checkout-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkout-preview-item {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.checkout-preview-item:last-child {
    border-bottom: none;
}

.checkout-preview-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

/* Tienda portada (estilo marketplace) */
.tienda-home {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tienda-hero-inner {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 220px;
    background: linear-gradient(120deg, #1e293b 0%, #312e81 45%, #0f172a 100%);
    background-size: cover;
    background-position: center;
}

.tienda-hero-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.2) 100%);
}

.tienda-hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 2.25rem;
    max-width: 520px;
}

.tienda-hero-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #4ade80;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}

.tienda-hero-title {
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.tienda-hero-sub {
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
}

.tienda-hero-btn {
    font-weight: 700;
    padding: 0.55rem 1.25rem;
}

.portada-preview-img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.portada-preview-img--wide {
    max-height: 100px;
    object-fit: contain;
    background: #0f172a;
}

.portada-extra-fields summary {
    cursor: pointer;
    user-select: none;
}

.tienda-promo-image {
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    background: #0f172a;
}

.tienda-promo-image-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tienda-promo-image-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tienda-promo-image img,
.tienda-promo-image-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.tienda-promo-inner {
    border-radius: 12px;
    overflow: hidden;
    min-height: 140px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.tienda-promo-content {
    padding: 1.35rem 1.75rem;
    width: 100%;
}

.tienda-promo-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 0.35rem;
}

.tienda-promo-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.35rem;
}

.tienda-promo-sub {
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
}

.tienda-cat-section {
    margin-top: 0.25rem;
}

.tienda-cat-head {
    margin-bottom: 0.85rem;
}

.tienda-cat-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

.tienda-cat-sub {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
}

.tienda-set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
}

.tienda-set-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, transform 0.15s;
}

.tienda-set-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.tienda-set-card-img {
    aspect-ratio: 4/3;
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tienda-set-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tienda-set-card-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.tienda-set-card-ph.ph-sobres { background: linear-gradient(145deg, #7c3aed, #4f46e5); }
.tienda-set-card-ph.ph-estructuras { background: linear-gradient(145deg, #0ea5e9, #2563eb); }
.tienda-set-card-ph.ph-merch { background: linear-gradient(145deg, #059669, #0d9488); }

.tienda-set-card-body {
    padding: 0.85rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.2rem;
}

.tienda-set-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.tienda-set-card-cat {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tienda-set-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #22c55e;
    margin: 0.15rem 0 0.35rem;
}

.tienda-set-card-ciudad {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0.1rem 0;
}

.tienda-set-card-stock {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 0.35rem;
}

.tienda-set-card-stock--preventa {
    color: #f59e0b;
    font-weight: 600;
}

.nav-link-preventa .nav-preventa-badge {
    background: #f59e0b;
}

.preventa-item-eta {
    font-size: 0.78rem;
    color: #f59e0b;
    margin: 0.15rem 0;
}

.tienda-set-card-stock--out {
    color: #f87171;
}

.tienda-set-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}

.tienda-set-card-btn,
.tienda-set-card-cart {
    width: 100%;
    font-weight: 600;
}

.carrito-item-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.carrito-item:has(.carrito-item-thumb) {
    grid-template-columns: auto 1fr auto;
}

.admin-tabs .nav-link {
    color: var(--muted);
}

.admin-tabs .nav-link.active {
    color: var(--text);
    font-weight: 600;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.admin-search-wrap {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 360px;
}

.admin-filter-select {
    max-width: 220px;
}

.admin-list-meta {
    margin-left: auto;
    white-space: nowrap;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
}

.admin-page-btn {
    min-width: 2.1rem;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.admin-page-btn.is-active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
    font-weight: 600;
}

.admin-page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.admin-page-label {
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0 0.35rem;
}

.admin-table tr.admin-row-pending td {
    background: rgba(251, 191, 36, 0.06);
}

.admin-table tr.admin-row-pending td:first-child {
    box-shadow: inset 3px 0 0 rgba(251, 191, 36, 0.65);
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.admin-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.admin-thumb-cell {
    width: 52px;
}

.admin-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
}

.admin-thumb-placeholder {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--muted);
}

@media (max-width: 768px) {
    .tienda-hero-content {
        padding: 1.35rem 1.25rem;
    }

    .tienda-set-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ——— Editor de deck (estilo EDOPro) ——— */
.page-deck-editor {
    --deck-editor-bg: #0b1220;
    --deck-editor-bg-pattern:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.06) 0, transparent 45%),
        repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 18px);
    --deck-topbar-bg: rgba(15, 23, 42, 0.95);
    --deck-panel-bg: rgba(15, 23, 42, 0.6);
    --deck-search-panel-bg: rgba(15, 23, 42, 0.75);
    --deck-zone-bg: rgba(15, 23, 42, 0.5);
    --deck-zone-border: rgba(99, 102, 241, 0.2);
    --deck-zone-head: linear-gradient(180deg, #1e3a5f 0%, #152a45 100%);
    --deck-zone-head-text: #f8fafc;
    --deck-zone-stats: rgba(255, 255, 255, 0.75);
    --deck-card-bg: rgba(0, 0, 0, 0.25);
    --deck-card-shadow: none;
    --deck-hover-bg: rgba(99, 102, 241, 0.12);
    --deck-dragover-bg: rgba(99, 102, 241, 0.12);
    --deck-dragover-outline: rgba(99, 102, 241, 0.45);
    --deck-scrollbar-track: rgba(15, 23, 42, 0.6);
    --deck-scrollbar-thumb: rgba(99, 102, 241, 0.55);
    --deck-scrollbar-thumb-hover: rgba(99, 102, 241, 0.75);
    --deck-accordion-border: rgba(99, 102, 241, 0.25);
    --deck-accordion-btn-bg: rgba(30, 58, 95, 0.55);
    --deck-accordion-active-bg: rgba(30, 58, 95, 0.75);
    --deck-accordion-btn-color: #e2e8f0;
    --deck-accordion-active-color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--deck-editor-bg);
    background-image: var(--deck-editor-bg-pattern);
}

.deck-editor-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: var(--deck-topbar-bg);
    flex-shrink: 0;
    box-shadow: 0 1px 0 var(--border);
}

.deck-editor-back {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

.deck-editor-topbar-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.deck-editor-formato {
    max-width: 130px;
}

#btnDeckDelete {
    white-space: nowrap;
}

.deck-editor-name {
    flex: 1;
    min-width: 120px;
    font-weight: 700;
}

.deck-editor-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.deck-editor-layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.deck-editor-preview {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--deck-panel-bg);
}

.deck-editor-preview-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.65rem 0;
}

.deck-editor-preview-links .btn {
    width: 100%;
    font-size: 0.78rem;
    font-weight: 600;
}

.deck-editor-card-img {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deck-editor-card-img img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
}

.deck-editor-preview-empty {
    color: var(--muted);
    font-size: 0.85rem;
}

.deck-editor-card-info {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
}

.deck-editor-info-name {
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
}

.deck-editor-info-type,
.deck-editor-info-stats {
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.deck-editor-info-desc {
    white-space: pre-wrap;
    word-break: break-word;
}

.deck-editor-center {
    overflow-y: auto;
    padding: 0.65rem;
    min-height: 0;
}

.deck-editor-center.deck-capture-mode,
body.deck-capturing .deck-editor-center {
    overflow: visible !important;
}

.deck-zone {
    margin-bottom: 0.65rem;
    border: 1px solid var(--deck-zone-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--deck-zone-bg);
    box-shadow: 0 1px 2px var(--shadow-soft);
}

body.page-deck-editor .deck-zone {
    overflow: visible;
    margin-bottom: 0;
}

body.page-deck-editor .deck-editor-center {
    overflow: visible;
}

.deck-zone-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--deck-zone-head);
    color: var(--deck-zone-head-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.deck-zone-stats {
    color: var(--deck-zone-stats);
    font-weight: 500;
}

.deck-zone-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    min-height: 88px;
}

.deck-zone-grid--extra:not(.deck-zone-grid--empty),
.deck-zone-grid--side:not(.deck-zone-grid--empty) {
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
}

.deck-zone-grid--empty {
    min-height: 72px;
}

.deck-zone-grid--dragover {
    background: var(--deck-dragover-bg);
    outline: 2px dashed var(--deck-dragover-outline);
}

.deck-touch-device .deck-zone-grid,
.deck-touch-device .deck-card {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.deck-touch-device .deck-search-card {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.deck-drag-source {
    opacity: 0.35;
    pointer-events: none;
}

.deck-card {
    position: relative;
    aspect-ratio: 59 / 86;
    border-radius: 4px;
    overflow: hidden;
    cursor: grab;
    background: var(--deck-card-bg);
    box-shadow: var(--deck-card-shadow);
}

body.page-deck-editor .deck-card {
    aspect-ratio: unset;
    height: auto;
}

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

.deck-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.deck-card-limit {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

.deck-card-limit--1,
.deck-card-limit--2 {
    background: #f59e0b;
    color: #1a1a1a;
}

.deck-card--illegal {
    outline: 2px solid #ef4444;
    outline-offset: -2px;
    opacity: 0.72;
}

.deck-search-card--blocked {
    opacity: 0.55;
}

.deck-search-card--blocked .deck-search-card-body strong {
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.6);
}

.deck-search-card {
    position: relative;
}

.deck-editor-formato-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 130px;
    max-width: 200px;
}

.deck-editor-banlist-label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.68rem;
    line-height: 1.2;
}

.deck-editor-search {
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--deck-search-panel-bg);
}

.deck-search-form {
    padding: 0.65rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.deck-search-row--main {
    margin-bottom: 0.1rem;
}

.deck-search-advanced {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: var(--deck-accordion-border);
    --bs-accordion-btn-bg: var(--deck-accordion-btn-bg);
    --bs-accordion-active-bg: var(--deck-accordion-active-bg);
    --bs-accordion-btn-color: var(--deck-accordion-btn-color);
    --bs-accordion-active-color: var(--deck-accordion-active-color);
    --bs-accordion-btn-focus-box-shadow: none;
}

.deck-search-advanced .accordion-item {
    border: 1px solid var(--deck-accordion-border);
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
}

.deck-search-advanced .accordion-button {
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.deck-search-advanced .accordion-button::after {
    width: 0.85rem;
    height: 0.85rem;
    background-size: 0.85rem;
    filter: var(--deck-accordion-chevron-filter, brightness(1.4));
}

.deck-search-advanced .accordion-body {
    padding: 0.5rem 0.35rem 0.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 38vh;
    overflow-y: auto;
}

.deck-search-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.35rem;
    align-items: center;
}

.deck-search-row label {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0;
}

.deck-search-row--range {
    grid-template-columns: 72px 1fr auto 1fr;
}

.deck-search-row--range span {
    color: var(--muted);
    font-size: 0.75rem;
}

.deck-search-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.deck-search-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.deck-search-results-head select {
    max-width: 130px;
}

.deck-search-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 0.35rem 0.2rem 0.35rem 0.35rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: auto;
    scrollbar-color: var(--deck-scrollbar-thumb) var(--deck-scrollbar-track);
}

.deck-touch-device .deck-search-results {
    overflow-y: scroll;
    touch-action: pan-y;
}

.deck-search-results::-webkit-scrollbar {
    width: 16px;
}

.deck-search-results::-webkit-scrollbar-track {
    background: var(--deck-scrollbar-track);
    border-radius: 8px;
    margin: 4px 0;
}

.deck-search-results::-webkit-scrollbar-thumb {
    background: var(--deck-scrollbar-thumb);
    border-radius: 8px;
    border: 3px solid var(--deck-scrollbar-track);
    min-height: 48px;
}

.deck-search-results::-webkit-scrollbar-thumb:hover {
    background: var(--deck-scrollbar-thumb-hover);
}

.deck-search-card {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    cursor: grab;
    margin-bottom: 0.25rem;
}

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

.deck-search-card img {
    width: 36px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.deck-search-card-body {
    min-width: 0;
    font-size: 0.75rem;
}

.deck-search-card-body strong {
    display: block;
    line-height: 1.2;
}

.deck-search-card-meta {
    color: var(--muted);
    font-size: 0.68rem;
}

.deck-search-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1rem;
}

body.deck-dragging {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}

body.deck-dragging .deck-editor-center,
body.deck-dragging .deck-search-results {
    overflow: hidden !important;
}

.deck-drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 60px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    overflow: hidden;
    opacity: 0.92;
}

.deck-drag-ghost img {
    width: 100%;
    display: block;
}

.deck-capture-root {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1100px;
    padding: 12px;
    background: #0f172a;
    font-family: system-ui, sans-serif;
}

.deck-capture-zone {
    margin-bottom: 10px;
}

.deck-capture-head {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: linear-gradient(180deg, #1e3a5f, #152a45);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.deck-capture-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 10), 1fr);
    gap: 4px;
    padding: 6px;
    background: #111827;
    border: 1px solid #1f2937;
    border-top: none;
    border-radius: 0 0 6px 6px;
    min-height: 70px;
}

.deck-capture-grid img {
    width: 100%;
    aspect-ratio: 59 / 86;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.tienda-set-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}

[data-theme="light"] .page-deck-editor {
    --deck-editor-bg: #eef2f7;
    --deck-editor-bg-pattern:
        radial-gradient(circle at 14% 10%, rgba(59, 130, 246, 0.1) 0, transparent 40%),
        radial-gradient(circle at 88% 92%, rgba(99, 102, 241, 0.06) 0, transparent 36%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    --deck-topbar-bg: rgba(255, 255, 255, 0.98);
    --deck-panel-bg: #ffffff;
    --deck-search-panel-bg: #ffffff;
    --deck-zone-bg: #ffffff;
    --deck-zone-border: rgba(59, 130, 246, 0.2);
    --deck-zone-head: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    --deck-zone-head-text: #1e3a5f;
    --deck-zone-stats: #64748b;
    --deck-card-bg: #f8fafc;
    --deck-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    --deck-hover-bg: rgba(59, 130, 246, 0.08);
    --deck-dragover-bg: rgba(59, 130, 246, 0.1);
    --deck-dragover-outline: rgba(37, 99, 235, 0.45);
    --deck-scrollbar-track: #f1f5f9;
    --deck-scrollbar-thumb: #cbd5e1;
    --deck-scrollbar-thumb-hover: #94a3b8;
    --deck-accordion-border: rgba(59, 130, 246, 0.22);
    --deck-accordion-btn-bg: #f8fafc;
    --deck-accordion-active-bg: #f1f5f9;
    --deck-accordion-btn-color: #475569;
    --deck-accordion-active-color: #0f172a;
    --deck-accordion-chevron-filter: none;
}

[data-theme="light"] .page-deck-editor .deck-editor-topbar {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .page-deck-editor .deck-editor-back {
    color: #475569;
}

[data-theme="light"] .page-deck-editor .deck-editor-back:hover {
    color: #1e293b;
}

[data-theme="light"] .page-deck-editor .deck-editor-name,
[data-theme="light"] .page-deck-editor .deck-editor-formato,
[data-theme="light"] .page-deck-editor .deck-search-form .form-control,
[data-theme="light"] .page-deck-editor .deck-search-form .form-select,
[data-theme="light"] .page-deck-editor .deck-search-results-head select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .page-deck-editor .deck-editor-name:focus,
[data-theme="light"] .page-deck-editor .deck-editor-formato:focus,
[data-theme="light"] .page-deck-editor .deck-search-form .form-control:focus,
[data-theme="light"] .page-deck-editor .deck-search-form .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .page-deck-editor .btn-outline-light {
    --bs-btn-color: #475569;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-color: #1e293b;
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-active-color: #0f172a;
    --bs-btn-active-bg: #f1f5f9;
    --bs-btn-active-border-color: #94a3b8;
}

[data-theme="light"] .page-deck-editor .btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-color: #1e293b;
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #94a3b8;
}

[data-theme="light"] .page-deck-editor .deck-editor-preview-empty {
    color: #94a3b8;
}

[data-theme="light"] .page-deck-editor .deck-search-advanced .accordion-body {
    background: #fafbfc;
}

[data-theme="light"] .page-deck-editor .deck-editor-card-img {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

[data-theme="light"] .page-deck-editor .deck-editor-card-img img {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .page-deck-editor .deck-zone {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .page-deck-editor .deck-card {
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .page-deck-editor .deck-search-card {
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

[data-theme="light"] .page-deck-editor .deck-search-card:hover {
    border-color: #dbeafe;
}

[data-theme="light"] .page-deck-editor .deck-search-card img {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .page-deck-editor .deck-search-results-head {
    background: #f8fafc;
    color: #64748b;
}

[data-theme="light"] .page-deck-editor .deck-search-form {
    background: #fafbfc;
}

[data-theme="light"] .page-deck-editor .deck-editor-layout {
    box-shadow: inset 1px 0 0 #e2e8f0;
}

@media (max-width: 1200px) {
    .deck-editor-layout {
        grid-template-columns: 200px 1fr 260px;
    }

    .page-deck-editor #gridMain.deck-zone-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 3px;
        padding: 4px;
    }
}

@media (max-width: 900px) {
    .page-deck-editor {
        height: auto;
        min-height: 100vh;
    }

    .deck-editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .deck-editor-preview {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .deck-editor-search {
        border-left: none;
        border-top: 1px solid var(--border);
        min-height: 45vh;
        max-height: 55vh;
    }

    .deck-search-results {
        flex: 1;
        min-height: 28vh;
    }

    .deck-search-results::-webkit-scrollbar {
        width: 22px;
    }

    .deck-search-results::-webkit-scrollbar-thumb {
        min-height: 64px;
    }

    .page-deck-editor #gridMain.deck-zone-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

