*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 120px,
            rgba(255, 255, 255, 0.015) 120px,
            rgba(255, 255, 255, 0.015) 121px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 120px,
            rgba(255, 255, 255, 0.015) 120px,
            rgba(255, 255, 255, 0.015) 121px
        ),
        radial-gradient(
            1px 1px at 8% 12%,
            rgba(255, 255, 255, 0.12) 0%,
            transparent 100%
        ),
        radial-gradient(
            1.2px 1.2px at 22% 45%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 38% 8%,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 100%
        ),
        radial-gradient(
            1.5px 1.5px at 50% 60%,
            rgba(255, 255, 255, 0.07) 0%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 65% 25%,
            rgba(255, 255, 255, 0.09) 0%,
            transparent 100%
        ),
        radial-gradient(
            1.2px 1.2px at 78% 72%,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 90% 35%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 45% 88%,
            rgba(255, 255, 255, 0.07) 0%,
            transparent 100%
        ),
        radial-gradient(
            1.2px 1.2px at 15% 75%,
            rgba(255, 255, 255, 0.09) 0%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 60% 15%,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 100%
        ),
        linear-gradient(
            135deg,
            #1a1a2e 0%,
            #15132e 30%,
            #0f0d24 70%,
            #08071a 100%
        );
    background-attachment: fixed;
    min-height: 100vh;
}

@supports (min-height: 100svh) {
    body {
        min-height: 100svh;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

header {
    background: #4b4b86;
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

header h1 {
    font-size: 1.25rem;
    padding: 1.25rem 1.5rem 1rem;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem 1rem;
}

.header-top h1 {
    padding: 0;
}

.header-util {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

header h1 a {
    color: #fff;
    text-decoration: none;
}

header > nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 6rem;
    width: 100%;
    padding: 0.7rem 2rem;
    background: rgba(0, 0, 0, 0.16);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

nav a.active {
    color: #fff;
    background: #e94560;
}

/* Compact header on login/register/auth pages */
body.auth-page header .header-top {
    padding: 0.75rem 1.5rem 0.6rem;
}

body.auth-page header h1 {
    font-size: 1.05rem;
    padding: 0;
}

body.auth-page .header-util {
    gap: 0.4rem;
}

body.auth-page .header-util a {
    font-size: 0.95rem;
    padding: 0.3rem 0.5rem;
}

body.auth-page header > nav {
    padding: 0.35rem 2rem;
}

body.auth-page header > nav a {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

.nav-arr {
    font-size: 1.1rem;
    font-weight: 700;
    margin-left: 0.4rem;
}
.nav-arr + .nav-arr {
    margin-left: 0.2rem;
}

main {
    --main-pad: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #f5f6fa;
    border-radius: 0;
    box-shadow: none;
}

main.home {
    max-width: none;
}

main.inv {
    max-width: 1600px;
    margin: 0 auto;
}

h2 {
    margin-bottom: 1rem;
}

/* Card grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding-top: 3rem;
}

.card {
    display: block;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    overflow: visible;
    position: relative;
    z-index: 5;
}

.card .img-wrap {
    display: block;
    line-height: 0;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.card .img-wrap:hover {
    overflow: visible;
}

.card .img-wrap img {
    width: 100%;
    display: block;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.35s ease;
    position: relative;
}

.card .img-wrap:hover img {
    transform: scale(1.2);
    z-index: 10;
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card .info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem 0.3rem;
}

.card h3 {
    font-size: 0.88rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.card .price {
    font-weight: 700;
    color: #0f7b4a;
    font-size: 0.88rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.card .meta {
    display: block;
    margin: 0 0.75rem;
    padding: 0.4rem 0.6rem;
    background: #eef4ff;
    border-radius: 6px;
    color: #2c5282;
    font-size: 0.73rem;
    line-height: 1.4;
}

.card.selected {
    box-shadow:
        0 0 0 3px #1a1a2e,
        0 8px 24px rgba(26, 26, 46, 0.25);
}

.card.selected .meta {
    background: #dbe8ff;
}

/* Table thumb */
td .thumb {
    width: 48px;
    height: 67px;
    object-fit: cover;
    border-radius: 4px;
}

/* Forms */
form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 480px;
}

form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

form input,
form textarea,
form select {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
}

form textarea {
    min-height: 80px;
    resize: vertical;
}

form fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem 1rem 0.25rem;
    margin-bottom: 1rem;
}

form fieldset legend {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4b4b86;
    padding: 0 0.4rem;
}

form fieldset[hidden] {
    display: none;
}

button {
    background: #1a1a2e;
    color: #fff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
}

button:hover {
    background: #16213e;
}

button.danger {
    background: #c0392b;
}

button.danger:hover {
    background: #a93226;
}

/* Messages */
.msg-error {
    color: #c0392b;
    background: #fce4e4;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.msg-ok {
    color: #0f7b4a;
    background: #e4fce8;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.msg-info {
    color: #2980b9;
    background: #e4f0fc;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.empty {
    color: #888;
    font-style: italic;
}

/* Table */
table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f0f0f5;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: #f9f9fb;
}

/* Bar */
.bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 0;
    position: relative;
    min-height: 1.5rem;
}

.bar-bot {
    margin-top: 0.6rem;
    margin-bottom: 0;
}

.bar .ctrl {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
    position: absolute;
    right: 0;
}

.bar .ctrl select {
    font: inherit;
    font-size: 0.7rem;
    padding: 0.1rem 0.2rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
    width: auto;
    margin: 0;
    color: #333;
    cursor: pointer;
}

.bar .ctrl select:hover {
    border-color: #888;
}

/* Search area */
.search-area {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: absolute;
    left: 0;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

.search-form input[type="search"] {
    width: 10rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    font: inherit;
    font-size: 0.7rem;
    margin: 0;
    color: #333;
}

.search-form input[type="search"]::placeholder {
    color: #aaa;
}

.search-form button {
    font: inherit;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #1a1a2e;
    color: #fff;
    cursor: pointer;
    line-height: 1.3;
}

.search-form button:hover {
    background: #16213e;
}

.mode-toggle {
    font: inherit;
    font-size: 0.7rem;
    padding: 0.1rem 0.2rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
    width: auto;
    margin: 0;
    color: #333;
    cursor: pointer;
}

.mode-toggle:hover {
    border-color: #888;
}

.clr {
    font-size: 0.8rem;
    text-decoration: none;
    color: #999;
    padding: 0 0.15rem;
    line-height: 1;
}

.clr:hover {
    color: #c0392b;
}

/* Pager top */
.pager-top {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.pager-top .arr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.15s;
}

.pager-top .arr:hover {
    background: #eef4ff;
    border-color: #999;
}

.pager-top .arr.off {
    color: #ccc;
    border-color: #e8e8e8;
}

.page-form {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

.page-form input {
    width: 3rem;
    text-align: center;
    padding: 0.1rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font: inherit;
    font-size: 0.7rem;
    margin: 0;
    color: #333;
}

.page-form span {
    font-size: 0.7rem;
    color: #777;
}

.page-form .lp {
    font-weight: 600;
    color: #333;
}

/* Scroll-to-top */
#top-btn {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    line-height: 2.25rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2c3e50, #1a1a2e);
    border: none;
    border-radius: 50%;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-decoration: none;
    z-index: 999;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}

#top-btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

/* Card detail */
.detail {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.img-col {
    flex: 0 0 auto;
    width: 400px;
}

.zoom-wrap {
    position: relative;
    cursor: crosshair;
    border-radius: 8px;
    overflow: hidden;
}

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

#lens {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    border: 2px solid #1a1a2e;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 20;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Tap-to-zoom fullscreen viewer (touch screens) */
#zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}

#zoom-overlay.open {
    display: flex;
}

#zoom-overlay img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

@media (pointer: coarse) {
    .zoom-wrap {
        cursor: zoom-in;
    }
}

/* Double-faced card flip */
.flip-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 7;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

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

.face.back {
    transform: rotateY(180deg);
}

.zoom-wrap.flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 30;
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s,
        transform 0.2s;
}

.flip-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

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

.card-name {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.card-type {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    font-style: italic;
}

.attrs {
    width: 100%;
    background: none;
    box-shadow: none;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.attrs td {
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}

.attrs td:first-child {
    font-weight: 600;
    color: #555;
    width: 100px;
}

.attrs tr:hover {
    background: none;
}

.oracle {
    background: #faf9f5;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e6e0cc;
    font-size: 0.9rem;
    line-height: 1.6;
}

.oracle .sym {
    display: inline;
    width: 1.1em;
    height: 1.1em;
    vertical-align: text-bottom;
}

/* Cart add on grid cards */
.cart-add {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.cart-add .cq {
    width: 2.5rem;
    text-align: center;
    padding: 0.15rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    font: inherit;
    font-size: 0.7rem;
    color: #333;
}

.add-btn {
    flex: 1;
    font: inherit;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border: none;
    border-radius: 3px;
    background: #0f7b4a;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.add-btn:hover {
    background: #0d6a3e;
}

/* Detail page add to cart */
.detail-cart-add {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.detail-cq {
    width: 4rem;
    text-align: center;
    padding: 0.6rem 0.5rem;
    border: 1px solid #bbb;
    border-radius: 6px;
    font: inherit;
    font-size: 1rem;
    color: #333;
}

.detail-add-btn {
    flex: 1;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    background: #0f7b4a;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.detail-add-btn:hover {
    background: #0d6a3e;
}

/* Cart icon in header */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.cart-link:hover {
    color: #fff;
}

.cart-badge {
    position: absolute;
    bottom: -6px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: #c0392b;
    color: #fff;
    border-radius: 10px;
    padding: 0 5px;
    border: 2px solid #4b4b86;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Cart toast */
#cart-toast {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

#cart-toast.show {
    opacity: 1;
}

#cart-toast.fade {
    opacity: 0;
}

/* Cart page */
.cart-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.cart-items {
    flex: 1;
    min-width: 0;
}

.cart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.cart-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.5rem;
}

.cart-info strong {
    font-size: 0.9rem;
    width: 100%;
}

.cart-edition,
.cart-finish,
.cart-cond,
.cart-price {
    font-size: 0.75rem;
    color: #666;
}

.cart-edition::after {
    content: " · ";
    color: #ccc;
}
.cart-finish::after {
    content: " · ";
    color: #ccc;
}
.cart-cond::after {
    content: " · ";
    color: #ccc;
}

.cart-qty {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.cart-qty .cq {
    width: 2.5rem;
    text-align: center;
    padding: 0.2rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    font: inherit;
    font-size: 0.8rem;
    color: #333;
}

.qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
    color: #333;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.qty-btn:hover {
    background: #eef4ff;
    border-color: #888;
}

.cart-line-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f7b4a;
    min-width: 4rem;
    text-align: right;
    flex-shrink: 0;
}

.remove-btn {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    background: none;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.remove-btn:hover {
    color: #c0392b;
    border-color: #c0392b;
    background: #fce4e4;
}

/* Cart summary */
.cart-summary {
    flex: 0 0 280px;
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    color: #555;
}

.summary-row.total {
    border-top: 2px solid #1a1a2e;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.btn {
    display: inline-block;
    font: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #1a1a2e;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #16213e;
}

.btn-checkout {
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem;
    font-size: 0.95rem;
}

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

/* Cart sidebar login */
.cart-summary form {
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
    margin-top: 0.75rem;
}

.cart-summary form label {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.cart-summary form input {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

.cart-summary form button {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.4rem;
    font-size: 0.8rem;
}

.cart-summary .g-recaptcha {
    margin-bottom: 0.25rem;
}

.cart-summary h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.logged-in-msg {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.75rem;
}

.register-link {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.register-link a {
    color: #2980b9;
}

/* Account page */
.account-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.account-sidebar {
    flex: 0 0 200px;
    position: sticky;
    top: 1rem;
}

.account-sidebar ul {
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.account-sidebar li {
    border-bottom: 1px solid #eee;
}

.account-sidebar li:last-child {
    border-bottom: none;
}

.account-sidebar a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

.account-sidebar a:hover {
    background: #eef4ff;
    color: #1a1a2e;
}

.account-sidebar a.active {
    background: #eef4ff;
    color: #1a1a2e;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #1a1a2e;
}

.account-content {
    flex: 1;
    min-width: 0;
}

.account-content section {
    scroll-margin-top: 1rem;
    margin-bottom: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.account-content section h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.account-content section h3 {
    font-size: 0.95rem;
    margin: 1.25rem 0 0.75rem;
    color: #555;
}

.account-content section form {
    max-width: 400px;
}

button.small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.pm-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.pm-row:last-child {
    border-bottom: none;
}

.pm-icon {
    font-size: 1.1rem;
}

.pm-detail {
    flex: 1;
    color: #555;
}

.pm-del-form {
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
    margin: 0;
}

/* Home page hero */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a1a3e 40%, #e94560 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(255, 255, 255, 0.02) 80px,
            rgba(255, 255, 255, 0.02) 81px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(255, 255, 255, 0.02) 80px,
            rgba(255, 255, 255, 0.02) 81px
        ),
        radial-gradient(
            circle at 80% 30%,
            rgba(255, 255, 255, 0.04) 0%,
            transparent 50%
        );
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5l25 45H5z' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    pointer-events: none;
    opacity: 0.5;
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: #fff;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero .hero-search {
    display: flex;
    gap: 0.5rem;
    max-width: 480px;
    margin: 0 auto 1rem;
    position: relative;
    z-index: 1;
}

.hero .hero-search input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.hero .hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hero .hero-search input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.3);
}

.hero .hero-search button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 1;
}

.hero .hero-search button:hover {
    background: #d63851;
}

.hero .hero-stat {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.hero-btn {
    font-size: 1rem !important;
    padding: 0.75rem 2rem !important;
}

/* Featured scrolling rows */
.featured-row {
    margin-bottom: 2.5rem;
}

.featured-row h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.row-head h2 {
    margin-bottom: 0;
}

.see-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e94560;
    text-decoration: none;
    white-space: nowrap;
}

.see-all:hover {
    text-decoration: underline;
}

.scroll-wrap {
    overflow: hidden;
    position: relative;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.7);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition:
        opacity 0.2s,
        background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.scroll-wrap:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn:hover {
    background: rgba(26, 26, 46, 0.95);
}

.scroll-btn.left {
    left: 0.5rem;
}

.scroll-btn.right {
    right: 0.5rem;
}

.scroll-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-top: 32px;
    padding-bottom: 0.75rem;
    cursor: grab;
    scroll-behavior: smooth;
}

.scroll-track::-webkit-scrollbar {
    height: 6px;
}

.scroll-track::-webkit-scrollbar-track {
    background: #e8e8f0;
    border-radius: 3px;
}

.scroll-track::-webkit-scrollbar-thumb {
    background: #b0b0c8;
    border-radius: 3px;
}

.scroll-track::-webkit-scrollbar-thumb:hover {
    background: #9090a8;
}

.scroll-track {
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

.scroll-card {
    flex: 0 0 auto;
    width: clamp(180px, 18vw, 340px);
}

.scroll-card a {
    display: block;
    line-height: 0;
}

.scroll-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.scroll-card img:hover {
    position: relative;
    z-index: 5;
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.scroll-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.scroll-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    font-weight: 600;
}

.scroll-price {
    color: #0f7b4a;
    font-weight: 700;
}

.scroll-meta {
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Admin Page ────────────────────────────────────────── */
.admin-page main {
    width: auto;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
}

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

.admin-filters {
    flex: 1;
    min-width: 0;
}

.admin-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: none;
}

.admin-search .aq {
    width: 16rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
    font-size: 0.85rem;
    margin: 0;
}

.admin-search select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
    font-size: 0.8rem;
    background: #fff;
    margin: 0;
    width: auto;
    min-width: 9rem;
    color: #333;
}

.admin-search button {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-actions .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.admin-panel {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.admin-panel form {
    max-width: none;
    background: none;
    box-shadow: none;
    padding: 0;
}

.admin-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.hint {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.75rem;
}

.remove-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.remove-grid label {
    font-size: 0.85rem;
    margin: 0;
    font-weight: 600;
}

.remove-grid select,
.remove-grid input {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
    width: 100%;
    margin-top: 0.25rem;
}

.card-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-top: 0.6rem;
}

.card-search-tile {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.card-search-tile img {
    width: 100%;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    display: block;
}

.card-search-tile .tile-info {
    padding: 0.45rem 0.55rem 0.2rem;
}

.card-search-tile .tile-name {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
}

.card-search-tile .tile-have {
    color: #27ae60;
    font-weight: 700;
}

.card-search-tile .tile-set {
    font-size: 0.7rem;
    color: #777;
    margin-top: 0.15rem;
    line-height: 1.2;
}

.card-search-tile.have {
    outline: 2px solid #27ae60;
}

.card-search-tile .tile-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.35rem 0.55rem 0.55rem;
}

.card-search-tile .tile-form label {
    font-size: 0.7rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.card-search-tile .tile-form input[type="number"],
.card-search-tile .tile-form select {
    width: 4.2rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.35rem;
    margin: 0;
}

.card-search-tile .tile-form select {
    width: 3.6rem;
}

.card-search-tile .tile-form button {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    margin-top: 0.1rem;
}

#card-search-status {
    margin-left: 0.6rem;
}

#bulk-form {
    max-width: none;
    background: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.9rem;
    background: #f0f0f5;
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
}

.bulk-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

.bulk-count {
    color: #888;
    margin-left: auto;
}

.page-info {
    color: #888;
    font-size: 0.75rem;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.admin-table th {
    background: #f0f0f5;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 0.9rem;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.admin-table td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tr:hover {
    background: #f9f9fb;
}

.col-cb {
    width: 2.5rem;
}
.col-img {
    width: 56px;
}
.col-price {
    white-space: nowrap;
    text-align: right;
    font-weight: 700;
}
.col-name a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
.col-name a:hover {
    color: #2980b9;
}
.col-edition {
    font-size: 0.78rem;
    color: #666;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-tags {
    max-width: 240px;
}
.col-tags .tag {
    display: inline-block;
    background: #eef4ff;
    color: #2c5282;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin: 0.05rem;
    white-space: nowrap;
}

.admin-table .thumb {
    width: 36px;
    height: 50px;
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-pager .arr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-pager .arr:hover {
    background: #eef4ff;
    border-color: #999;
}

.admin-pager .arr.off {
    color: #ccc;
    border-color: #e8e8e8;
}

.admin-pager .page-label {
    font-size: 0.8rem;
    color: #555;
}

/* ── Admin Order Pages ──────────────────────────────────── */
.order-link {
    position: relative;
}

.order-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    background: #c0392b;
    color: #fff;
    border-radius: 9px;
    padding: 0 5px;
}

.orders-table .clickable td {
    cursor: pointer;
}

.col-order-num {
    font-weight: 700;
    font-size: 0.85rem;
}

.col-date {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.col-email {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-cards {
    text-align: center;
}

.order-summary-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.order-summary-bar h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}

.order-meta {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

.order-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-new {
    background: #f8d7da;
    color: #721c24;
}

.status-pending,
.status-processing {
    background: #fef3cd;
    color: #856404;
}

.status-shipped,
.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-refunded {
    background: #e2e3e5;
    color: #383d41;
}

.order-info-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.order-info-box {
    flex: 1;
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-info-box h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin: 0 0 0.5rem;
}

.order-info-box p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.order-info-box .addr {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
}

.order-items-table td {
    padding: 0.5rem 0.9rem;
}

.order-items-table .col-qty {
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.order-items-table tfoot td {
    border-top: 2px solid #ddd;
    font-size: 0.85rem;
}

.order-items-table tfoot .col-price {
    font-size: 0.9rem;
}

/* ── Checkout Page ──────────────────────────────────────── */
.checkout-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.checkout-form {
    flex: 1;
    min-width: 0;
    max-width: 600px;
}

.checkout-form fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
}

.checkout-form legend {
    font-weight: 700;
    font-size: 1rem;
    padding: 0 0.5rem;
    color: #1a1a2e;
}

.checkout-form .inline-group {
    display: flex;
    gap: 0.75rem;
}

.checkout-form .inline-group label {
    flex: 1;
}

.checkout-form .checkbox-label,
.checkout-form .radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.checkout-form .checkbox-label input,
.checkout-form .radio-label input {
    width: auto;
    margin: 0;
    margin-top: 0;
}

.saved-cards {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.checkout-summary {
    flex: 0 0 300px;
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 1rem;
}

.checkout-summary h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8rem;
    color: #555;
}

.summary-divider {
    border-top: 1px solid #eee;
    margin: 0.5rem 0;
}

.checkout-summary .summary-row {
    font-size: 0.85rem;
}

.checkout-summary .summary-total {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.btn-large {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .checkout-layout {
        flex-direction: column;
    }
    .checkout-summary {
        flex: none;
        width: 100%;
    }
    .checkout-form .inline-group {
        flex-direction: column;
        gap: 0;
    }
}

/* ── Address rows on account page ──────────────────────── */
.addr-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.addr-row:last-child {
    border-bottom: none;
}

.addr-label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
}

.addr-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.addr-card:last-of-type {
    border-bottom: none;
}

.addr-block {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.addr-del-form {
    flex-shrink: 0;
    margin: 0;
}

/* ── Order confirmation ─────────────────────────────────── */
.confirm-page {
    display: flex;
    justify-content: center;
}

.confirm-box {
    max-width: 600px;
    width: 100%;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.confirm-msg {
    font-size: 1.1rem;
    color: #0f7b4a;
    margin-bottom: 1.5rem;
}

.confirm-details {
    text-align: left;
    margin-bottom: 1.5rem;
}

.confirm-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.confirm-section h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.confirm-section p {
    font-size: 0.9rem;
    color: #333;
}

.confirm-section .addr {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    color: #555;
}

.confirm-total {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9fb;
    border-radius: 6px;
}

.confirm-total .summary-row {
    font-size: 0.85rem;
    color: #555;
    padding: 0.15rem 0;
}

.confirm-total .summary-total {
    font-size: 1rem;
    color: #1a1a2e;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 1rem 2rem;
    }
    .hero h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 1100px) {
    main {
        padding: 1.5rem;
    }
    .hero {
        padding: 3rem 1.5rem;
    }
    .set-grid {
        gap: 1rem;
    }
}

/* Edition landing banner (multi-edition filters) */
.edition-landing {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a1a3e 55%, #e94560 160%);
    border-radius: 10px;
    color: #fff;
}

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

.el-head h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.el-sub {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.el-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.el-card {
    flex: 1 1 200px;
    display: block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: #fff;
    transition:
        background 0.2s,
        transform 0.2s;
}

.el-card:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.el-card .el-name {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.el-card .el-date {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.el-card .el-count {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #ffd9df;
}

/* Set selector grid (home page) */
.set-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.set-card {
    --set-w: 480px;
    flex: 1 1 220px;
    max-width: var(--set-w);
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.set-card .art {
    position: relative;
    width: 100%;
    aspect-ratio: 972 / 677;
    overflow: hidden;
    background: #0f0d24;
}

.set-card .art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.set-card.flip .art img {
    transform: rotate(180deg);
}

.set-card .set-name {
    display: block;
    padding: 0.75rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: #1a1a2e;
}

@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
    }
    .account-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }
    .account-sidebar ul {
        display: flex;
        overflow-x: auto;
    }
    .account-sidebar li {
        border-bottom: none;
        border-right: 1px solid #eee;
        flex-shrink: 0;
    }
    .account-sidebar li:last-child {
        border-right: none;
    }
}
@media (max-width: 768px) {
    .detail {
        flex-direction: column;
    }
    .img-col {
        width: 100%;
        max-width: 350px;
    }
    .cart-layout {
        flex-direction: column;
    }
    .cart-summary {
        flex: none;
        width: 100%;
    }
    .cart-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .cart-info {
        width: 100%;
    }
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
    background: #4b4b86;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.8rem;
    margin-top: 3rem;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

footer a:hover {
    color: #fff;
}

/* ── Inventory filters ──────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.filter-bar select {
    font: inherit;
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    width: auto;
}

.filter-bar select:hover {
    border-color: #999;
}

.filter-bar .filter-label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Active filter chips */
.filters-active {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.filters-active .fa-label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    background: #fff;
    border: 1px solid #d8dee9;
    border-radius: 999px;
    padding: 0.3rem 0.4rem 0.3rem 0.9rem;
    color: #2a2f3a;
    box-shadow: 0 1px 3px rgba(20, 24, 40, 0.06);
    max-width: 260px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.chip:hover {
    border-color: #b9c2d4;
    box-shadow: 0 2px 6px rgba(20, 24, 40, 0.1);
}

.chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #e7ebf2;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    flex: none;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.chip-x:hover {
    background: #dc2626;
    color: #fff;
    transform: scale(1.1);
}

.chip-search {
    border-color: #c3d8f7;
    background: #f2f7fe;
}
.chip-search .chip-label {
    color: #1d4ed8;
}
.chip-search .chip-x {
    background: #c3d8f7;
    color: #1d4ed8;
}
.chip-search .chip-x:hover {
    background: #1d4ed8;
    color: #fff;
}

.chip-set {
    border-color: #bfe6d0;
    background: #f2fcf7;
}
.chip-set .chip-label {
    color: #0f7b4a;
}
.chip-set .chip-x {
    background: #bfe6d0;
    color: #0f7b4a;
}
.chip-set .chip-x:hover {
    background: #0f7b4a;
    color: #fff;
}

.chip-finish {
    border-color: #e0d2f5;
    background: #faf6ff;
}
.chip-finish .chip-label {
    color: #6d28d9;
}
.chip-finish .chip-x {
    background: #e0d2f5;
    color: #6d28d9;
}
.chip-finish .chip-x:hover {
    background: #6d28d9;
    color: #fff;
}

.fa-clear {
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: none;
    margin-left: 0.2rem;
    padding: 0.35rem 0.8rem;
    border: 1px dashed #c7cedb;
    border-radius: 999px;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.fa-clear:hover {
    color: #dc2626;
    border-color: #f0a9a9;
    background: #fdf3f3;
}

/* ── Card grid entrance ─────────────────────────────────── */
.grid .card {
    animation: cardFadeIn 0.4s ease both;
}

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

.grid .card:nth-child(1) {
    animation-delay: 0s;
}
.grid .card:nth-child(2) {
    animation-delay: 0.03s;
}
.grid .card:nth-child(3) {
    animation-delay: 0.06s;
}
.grid .card:nth-child(4) {
    animation-delay: 0.09s;
}
.grid .card:nth-child(5) {
    animation-delay: 0.12s;
}
.grid .card:nth-child(6) {
    animation-delay: 0.15s;
}
.grid .card:nth-child(7) {
    animation-delay: 0.18s;
}
.grid .card:nth-child(8) {
    animation-delay: 0.21s;
}
.grid .card:nth-child(9) {
    animation-delay: 0.24s;
}
.grid .card:nth-child(10) {
    animation-delay: 0.27s;
}
.grid .card:nth-child(11) {
    animation-delay: 0.3s;
}
.grid .card:nth-child(12) {
    animation-delay: 0.33s;
}
.grid .card:nth-child(13) {
    animation-delay: 0.36s;
}
.grid .card:nth-child(14) {
    animation-delay: 0.39s;
}
.grid .card:nth-child(15) {
    animation-delay: 0.42s;
}
.grid .card:nth-child(16) {
    animation-delay: 0.45s;
}
.grid .card:nth-child(17) {
    animation-delay: 0.48s;
}
.grid .card:nth-child(18) {
    animation-delay: 0.51s;
}
.grid .card:nth-child(19) {
    animation-delay: 0.54s;
}
.grid .card:nth-child(20) {
    animation-delay: 0.57s;
}

/* ── Focus styles ───────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .header-top {
        padding: 0.75rem 1rem 0.6rem;
    }
    header h1 {
        font-size: 1rem;
        padding: 1rem 1rem 0.6rem;
    }
    .header-util {
        justify-content: flex-start;
    }
    header > nav {
        justify-content: center;
        gap: 0.25rem 0.6rem;
        padding: 0.45rem 0.75rem;
        margin-top: 0;
    }
    nav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.25rem 0.6rem;
        margin-top: 0.35rem;
        min-width: 0;
    }
    nav a {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        margin-left: 0;
        padding: 0.45rem 0.4rem;
        min-height: 42px;
        font-size: 0.8rem;
        max-width: 108px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .hero {
        padding: 2rem 1rem;
    }
    .hero h2 {
        font-size: 1.5rem;
    }
    .hero .hero-search {
        flex-direction: column;
    }

    main {
        --main-pad: 0.75rem;
        padding: 0.75rem;
        margin: 0;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .set-card {
        flex: 1 1 45%;
        max-width: 210px;
    }

    .bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        min-height: 0;
    }
    .bar .search-area,
    .bar .ctrl {
        position: static;
    }
    .bar .search-area {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .search-form {
        flex: 1;
        max-width: 100%;
    }
    .search-form input[type="search"] {
        width: 1px;
        flex: 1;
        min-width: 0;
    }
    .pager-top {
        justify-content: center;
    }
    .pager-top .arr {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.85rem;
    }
    .page-form input {
        height: 2.25rem;
        font-size: 0.85rem;
    }
    #top-btn {
        width: 2.75rem;
        height: 2.75rem;
        line-height: 2.75rem;
        font-size: 1.1rem;
        bottom: 1rem;
        right: 1rem;
    }
    .bar .ctrl {
        display: flex;
        justify-content: center;
    }
    .bar-bot .ctrl {
        display: none;
    }

    .filter-bar {
        gap: 0.35rem;
    }
    .filter-bar select {
        font-size: 0.72rem;
    }
    .filters-active {
        gap: 0.35rem;
    }
    .chip {
        font-size: 0.72rem;
        max-width: 190px;
    }
    .fa-clear {
        margin-left: 0;
    }

    .admin-page main {
        margin: 0.5rem;
    }
    .admin-search {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-search .aq {
        width: auto;
    }
    .admin-search select {
        min-width: 0;
        width: auto;
    }
    .admin-actions {
        flex-direction: column;
    }
    .admin-actions .btn {
        text-align: center;
    }
    .admin-table th,
    .admin-table td {
        padding: 0.4rem 0.35rem;
        font-size: 0.72rem;
    }
    .admin-table-wrap {
        margin: 0 -0.75rem;
        border-radius: 0;
    }
    .admin-panel {
        padding: 1rem;
    }
    .bulk-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .remove-grid {
        grid-template-columns: 1fr;
    }
}
