.booster-btn,
.booster-create,
.booster-opening-actions button,
.booster-opening-actions a,
.collection-empty a {
    border: 3px solid #25252d;
    box-shadow: 4px 4px 0 #25252d;
    border-radius: 9px;
    background: #ffd166;
    color: #25252d;
    font: 800 0.95rem 'Sora', sans-serif;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.booster-btn:hover,
.booster-create:hover,
.booster-opening-actions button:hover,
.booster-opening-actions a:hover,
.collection-empty a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #25252d;
}

.booster-btn:disabled,
.booster-create:disabled { opacity: .55; cursor: wait; }
.booster-btn:disabled { cursor: not-allowed; }
.booster-modal-open { overflow: hidden; }
.booster-overlay[hidden], .booster-dialog [hidden] { display: none !important; }

.booster-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(27, 22, 41, .82);
    backdrop-filter: blur(9px);
}

.booster-dialog {
    position: relative;
    width: min(94vw, 720px);
    max-height: 94vh;
    overflow: auto;
    border: 4px solid #25252d;
    border-radius: 22px;
    box-shadow: 12px 12px 0 #121218;
    background: linear-gradient(145deg, #fff 0%, #fff3bc 100%);
    padding: clamp(24px, 5vw, 48px);
    text-align: center;
}

.booster-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
}

.booster-kicker,
.collection-hero > span {
    display: inline-block;
    background: #25252d;
    color: #fff;
    padding: 5px 10px;
    transform: rotate(-2deg);
    font-weight: 900;
    letter-spacing: .12em;
}

.booster-dialog h2 { margin: 18px 0 8px; font-size: clamp(1.7rem, 5vw, 2.7rem); }
.booster-dialog p { line-height: 1.5; }
.booster-dialog label { display: block; margin: 28px 0 8px; font-weight: 800; text-align: left; }
.booster-dialog input {
    display: block;
    width: 100%;
    border: 3px solid #25252d;
    border-radius: 9px;
    padding: 14px;
    background: #fff;
    font: 700 1.1rem 'Sora', sans-serif;
    box-shadow: 4px 4px 0 #d6a9ff;
}
.booster-dialog input.invalid { border-color: #e43d5b; animation: card-shake .25s 2; }
.booster-create { width: 100%; margin-top: 22px; background: #9bf6ff; }

.booster-loading { padding: 18px 0; }
.pack-loader {
    width: 210px;
    aspect-ratio: 2 / 3;
    margin: 32px auto 38px;
    position: relative;
    overflow: hidden;
    border: 4px solid #25252d;
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.95) 0 8%, transparent 9%),
        repeating-conic-gradient(from -12deg at 50% 42%, #8d55ef 0 13deg, #ff6f9e 13deg 26deg);
    box-shadow: 9px 9px 0 #25252d, 18px 18px 36px rgba(37,37,45,.18);
    color: #25252d;
    animation: pack-float 2.2s ease-in-out infinite;
}
.pack-loader::before,
.pack-loader::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 15px;
    z-index: 2;
    background: #ffd166;
    border-bottom: 3px solid #25252d;
}
.pack-loader::before { top: 0; }
.pack-loader::after { bottom: 0; border-top: 3px solid #25252d; border-bottom: 0; }
.pack-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 47%, transparent 62%); transform: translateX(-100%); animation: foil 3s ease-in-out infinite; }
.pack-brand { position: absolute; top: 28px; left: 0; right: 0; color: white; font-size: .72rem; font-weight: 1000; letter-spacing: .22em; text-shadow: 2px 2px 0 #25252d; }
.pack-flame { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 76px; height: 76px; border: 4px solid #25252d; border-radius: 50%; background: #fff4c7; font-size: 2.4rem; }
.pack-loader > strong { position: absolute; left: 12px; right: 12px; top: 55%; padding: 10px 8px; border: 3px solid #25252d; background: white; font-size: .92rem; line-height: 1.15; overflow-wrap: anywhere; transform: rotate(-1deg); }
.pack-loader > small { position: absolute; right: 12px; bottom: 24px; z-index: 3; padding: 3px 6px; border: 2px solid #25252d; border-radius: 5px; background: white; font-size: .58rem; font-weight: 900; letter-spacing: .08em; }

.reveal-card { display: block; margin: 0 auto; border: 0; padding: 0; background: transparent; box-shadow: none; cursor: pointer; perspective: 1200px; }
.card-back,
.reveal-card .trading-card { animation: card-flip .55s cubic-bezier(.2,.8,.2,1) both; }
.card-back {
    width: min(72vw, 330px);
    aspect-ratio: 2 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 6px solid #25252d;
    border-radius: 20px;
    background: radial-gradient(circle, #ffd166 0 14%, transparent 15%), repeating-conic-gradient(#8d55ef 0 12deg, #ff5d8f 12deg 24deg);
    color: #25252d;
    box-shadow: 10px 10px 0 #121218;
}
.card-back b { background: white; border: 4px solid #25252d; padding: 9px 14px; font-size: 1.5rem; }
.card-back small { background: #25252d; color: white; padding: 4px 7px; font-weight: 900; }
.reveal-hint { margin: 16px 0 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.booster-opening-actions { min-height: 48px; display: flex; justify-content: center; gap: 12px; }
.booster-opening-actions a { background: #9bf6ff; }
.revealed-cards { width: 100%; margin-top: 26px; text-align: left; }
.revealed-cards[hidden] { display: none; }
.revealed-cards h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.revealed-cards h2 span { min-width: 24px; padding: 2px 6px; border: 2px solid #25252d; border-radius: 999px; background: #ffd166; text-align: center; font-size: .7rem; }
.revealed-cards ol { display: flex; gap: 12px; margin: 0; padding: 3px 5px 12px 3px; overflow-x: auto; overscroll-behavior-inline: contain; list-style: none; scroll-snap-type: inline proximity; }
.revealed-card-thumbnail {
    --rarity-color: var(--common);
    width: 112px;
    flex: 0 0 112px;
    overflow: hidden;
    border: 3px solid #25252d;
    border-radius: 10px;
    background: white;
    box-shadow: 4px 4px 0 var(--rarity-color);
    scroll-snap-align: end;
    animation: history-card-in .35s cubic-bezier(.2,.8,.2,1) both;
}
.revealed-card-thumbnail img { display: block; width: 100%; aspect-ratio: 4 / 5; border-bottom: 2px solid #25252d; object-fit: cover; }
.revealed-card-thumbnail.full-card-thumbnail img { object-fit: contain; }
.revealed-card-thumbnail span { display: grid; gap: 2px; padding: 7px; }
.revealed-card-thumbnail b { overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.revealed-card-thumbnail small { color: var(--rarity-color); font-size: .53rem; font-weight: 1000; letter-spacing: .05em; }

.card-particle {
    --rarity-color: var(--common);
    position: absolute;
    z-index: 10;
    top: 48%; left: 50%; width: 10px; height: 18px;
    background: var(--rarity-color);
    pointer-events: none;
    animation: particle-burst 1s ease-out forwards;
}

.collection-page { max-width: 1500px; margin: 86px auto 50px; padding: 24px; }
.collection-hero { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.collection-hero h1 { margin: 18px 0 8px; font-size: clamp(2.4rem, 7vw, 5rem); line-height: .95; }
.collection-hero p { font-weight: 650; line-height: 1.5; }
.pending-boosters {
    max-width: 1200px; margin: 0 auto 30px; padding: 18px;
    display: grid; grid-template-columns: minmax(180px, .45fr) 1fr; gap: 20px;
    border: 3px solid #25252d; border-radius: 12px; background: #fff3bc;
    box-shadow: 6px 6px 0 #25252d;
}
.pending-boosters[hidden] { display: none; }
.pending-boosters h2 { margin: 7px 0 0; }
.pending-boosters > div > span { font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.pending-booster-list { display: grid; gap: 10px; }
.pending-booster {
    display: flex; align-items: center; justify-content: space-between; gap: 15px;
    padding: 12px 14px; border: 2px solid #25252d; border-radius: 8px;
    background: #fff; color: #25252d; text-decoration: none; box-shadow: 3px 3px 0 #25252d;
}
.pending-booster span { font-size: .75rem; font-weight: 850; }
.collection-toolbar {
    max-width: 1200px; margin: 0 auto 30px; padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 15px;
    background: white; border: 3px solid #25252d; border-radius: 10px; box-shadow: 5px 5px 0 #25252d;
}
.collection-toolbar select { border: 2px solid #25252d; border-radius: 7px; padding: 8px; background: #fff3bc; font-weight: 750; }
.collection-grid { max-width: 1200px; margin: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 42px 30px; align-items: start; }
.collection-grid > .collection-card-button, .collection-grid > .bulk-select-card { width: 100%; justify-self: center; }
.collection-grid .trading-card { width: 100%; transition: transform .2s; }
.collection-grid .trading-card:hover { transform: translateY(-8px) rotate(-1deg); }
.collection-card-button { display: block; border: 0; padding: 0; background: transparent; text-align: inherit; cursor: pointer; }
.collection-card-button:focus-visible { outline: 4px solid #8d55ef; outline-offset: 8px; }
.collection-empty { max-width: 600px; margin: 60px auto; text-align: center; }
.collection-empty div { font-size: 5rem; }
.collection-empty h2 { margin: 10px 0 28px; }

.booster-gift-body { padding: 0; overflow-x: hidden; background: #f8f5ff; }
.gift-page {
    min-height: calc(100svh - 64px);
    padding: clamp(38px, 7vh, 82px) 20px 60px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 13% 18%, #ffd5e5 0 8%, transparent 8.3%),
        radial-gradient(circle at 86% 78%, #d8c1ff 0 12%, transparent 12.3%),
        linear-gradient(145deg, #fffdf7 0%, #f5efff 55%, #eafcff 100%);
}
.gift-page::before { content: '✦'; position: absolute; top: 12%; left: 9%; color: #8d55ef; font-size: clamp(2rem, 7vw, 5rem); transform: rotate(-12deg); }
.gift-page::after { content: '★'; position: absolute; right: 8%; bottom: 12%; color: #ff6f9e; font-size: clamp(2rem, 6vw, 4.5rem); transform: rotate(13deg); }
.gift-panel,
.gift-opening {
    width: min(92vw, 680px);
    position: relative;
    z-index: 1;
    padding: clamp(28px, 5vw, 54px);
    text-align: center;
    border: 4px solid #25252d;
    border-radius: 28px;
    background: rgba(255,255,255,.94);
    box-shadow: 12px 12px 0 #25252d, 0 28px 80px rgba(91,63,135,.15);
}
.gift-panel h1 { margin: 20px 0 12px; color: #25252d; text-shadow: none; font-size: clamp(2.25rem, 7vw, 4.4rem); line-height: .93; letter-spacing: -.065em; }
.gift-panel h1 em { color: #8d55ef; font-style: normal; }
.gift-message { max-width: 540px; margin: 0 auto; color: #625c6d; font-weight: 650; line-height: 1.5; }
.gift-panel .booster-create { width: auto; min-width: min(100%, 290px); margin: 0 auto; background: #9bf6ff; }
.gift-login { display: inline-block; margin-top: 0; }
.gift-login-note { max-width: 440px; margin: 18px auto 0; font-size: .82rem; opacity: .68; }
.gift-opening { display: grid; justify-items: center; }
.gift-page [hidden] { display: none !important; }
.opening-eyebrow { margin: 0 0 16px; font-size: .72rem; font-weight: 900; letter-spacing: .16em; color: #71677c; }

.card-inspector[hidden] { display: none; }
.card-inspector { position: fixed; inset: 0; z-index: 22000; display: grid; place-items: center; padding: 20px; background: rgba(27, 22, 41, .82); backdrop-filter: blur(8px); }
.card-inspector > section { position: relative; width: min(94vw, 720px); max-height: 92vh; overflow: auto; padding: clamp(24px, 5vw, 45px); border: 4px solid #25252d; border-radius: 18px; background: white; box-shadow: 10px 10px 0 #121218; }
.inspector-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; font-size: 2rem; font-weight: 900; cursor: pointer; }
.card-inspector h2 { margin: 18px 0; font-size: clamp(1.7rem, 5vw, 3rem); }
.card-inspector img { width: min(100%, 360px); aspect-ratio: 4 / 5; object-fit: cover; border: 3px solid #25252d; border-radius: 10px; }
.card-inspector dl { display: grid; gap: 0; margin: 24px 0 0; border: 2px solid #25252d; border-radius: 8px; overflow: hidden; }
.card-inspector dl div { display: grid; grid-template-columns: minmax(150px, .7fr) 1.3fr; border-bottom: 1px solid #bcb7c5; }
.card-inspector dl div:last-child { border-bottom: 0; }
.card-inspector dt, .card-inspector dd { margin: 0; padding: 11px; }
.card-inspector dt { background: #f4eaff; font-weight: 900; }
.card-sale-form { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: end; margin-top: 22px; padding: 16px; border: 3px solid #25252d; border-radius: 10px; background: #fff3bc; box-shadow: 4px 4px 0 #25252d; }
.card-sale-form > div { display: grid; gap: 3px; }
.card-sale-form small { font-size: .7rem; }
.card-sale-form label { display: grid; gap: 4px; font-size: .75rem; font-weight: 900; }
.card-sale-form input { width: 100px; border: 2px solid #25252d; border-radius: 6px; padding: 8px; font-weight: 800; }
.card-sale-form button { border: 2px solid #25252d; border-radius: 7px; padding: 9px 11px; background: #9bf6ff; box-shadow: 3px 3px 0 #25252d; font-weight: 900; cursor: pointer; }
.card-sale-form .sale-remove { background: #ffb4c3; }

@keyframes pack-float { 50% { transform: translateY(-8px) rotate(1.5deg); box-shadow: 12px 15px 0 #25252d, 20px 28px 40px rgba(37,37,45,.16); } }
@keyframes card-flip { from { opacity: 0; transform: rotateY(90deg) scale(.82); } to { opacity: 1; transform: rotateY(0) scale(1); } }
@keyframes history-card-in { from { opacity: 0; transform: translateY(16px) rotate(3deg) scale(.85); } to { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }
@keyframes particle-burst { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
@keyframes card-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-width: 700px) {
    .booster-dialog { padding: 35px 18px 24px; }
    .collection-page { padding: 12px; }
    .collection-toolbar { align-items: stretch; flex-direction: column; }
    .pending-boosters { grid-template-columns: 1fr; }
    .collection-grid { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
    .card-sale-form { grid-template-columns: 1fr; align-items: stretch; }
    .gift-page { padding: 28px 14px 45px; }
    .gift-panel, .gift-opening { width: 100%; padding: 28px 18px 34px; border-radius: 20px; box-shadow: 7px 7px 0 #25252d; }
    .gift-page::before, .gift-page::after { opacity: .35; }
    .card-back { width: min(78vw, 310px); }
    .revealed-card-thumbnail { width: 92px; flex-basis: 92px; }
}

.motion-reduced :is(.pack-loader, .card-back, .reveal-card .trading-card, .card-particle, .revealed-card-thumbnail) { animation: none; }
.reveal-rewards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}
.reveal-rewards[hidden] { display: none; }
.reveal-rewards span {
    padding: 6px 10px;
    border: 2px solid #171717;
    border-radius: 6px;
    color: #171717;
    font-weight: 800;
    box-shadow: 2px 2px 0 #171717;
}
.reveal-rewards small { font-size: 11px; }
.reveal-reward-new { background: #baffd0; }
.reveal-reward-discovered { background: #ffe08a; }
.reveal-reward-xp { padding: 6px; font-size: 20px; }
