* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #101a2b;
    color: white;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 60px;
}

header {
    text-align: center;
    margin-bottom: 35px;
}

.logo {
    margin: 0;
    font-size: clamp(34px, 7vw, 58px);
    font-weight: 800;
}

.subtitle,
.small-info {
    color: rgba(255, 255, 255, 0.62);
}

.subtitle {
    margin-top: 8px;
    font-size: 17px;
}

.small-info {
    margin-bottom: 3px;
    font-size: 14px;
}

.search {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 15px;
    padding: 0 18px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 17px;
    outline: none;
}

.search::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.search:focus {
    background: rgba(255, 255, 255, 0.17);
}

.top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.section-title {
    margin: 0;
    font-size: 25px;
}

.back-button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 13px;
    background: #1b2940;
    color: white;
    cursor: pointer;
    font-size: 27px;
}

.back-button:hover {
    background: #243651;
}


/* --------------------------------------------------
   Hauptsets und Erweiterungen
-------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.collection-card {
    min-height: 190px;
    padding: 20px 22px;
    border: 0;
    border-radius: 20px;
    background: #1b2940;
    color: white;
    text-align: left;
    cursor: pointer;

    display: flex;
    flex-direction: column;

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.collection-card:hover {
    transform: translateY(-3px);
    background: #243651;
}


/* --------------------------------------------------
   Logos
-------------------------------------------------- */

.collection-logo-area {
    height: 100px;
    width: 100%;
    margin-bottom: 14px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-logo {
    display: block;

    width: auto;
    height: auto;

    max-width: 90%;
    max-height: 90px;

    object-fit: contain;
}

.collection-logo-fallback {
    width: 100%;
    min-height: 80px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
}

.collection-card-content {
    margin-top: auto;
}

.card-name {
    margin-bottom: 7px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.card-info {
    color: rgba(255, 255, 255, 0.65);
}

.collection-card .card-info {
    text-align: center;
    font-size: 14px;
}


/* --------------------------------------------------
   Fortschritt
-------------------------------------------------- */

.progress {
    width: 100%;
    height: 8px;
    margin-top: 14px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #38c86f;
    transition: width 0.25s ease;
}


/* --------------------------------------------------
   Sammlung
-------------------------------------------------- */

.collection-summary {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 18px;
    background: #1b2940;
}

.collection-summary strong {
    font-size: 20px;
}

.collection-summary span {
    margin-left: 5px;
    color: rgba(255, 255, 255, 0.65);
}


/* --------------------------------------------------
   Kartenfilter
-------------------------------------------------- */

.card-filter {
    width: 100%;
    margin-bottom: 22px;
    padding: 5px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;

    border-radius: 15px;
    background: #1b2940;
}

.filter-button {
    min-height: 44px;
    padding: 8px 12px;

    border: 0;
    border-radius: 11px;

    background: transparent;
    color: rgba(255, 255, 255, 0.65);

    cursor: pointer;

    font-size: 15px;
    font-weight: 600;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.12s ease;
}

.filter-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.filter-button:active {
    transform: scale(0.98);
}

.filter-button.active {
    background: #243651;
    color: white;
}


/* --------------------------------------------------
   Karten
-------------------------------------------------- */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.pokemon-card {
    position: relative;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #1b2940;
    color: white;
    text-align: left;
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 245 / 342;
    overflow: hidden;
    background: #26354d;
}

.pokemon-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition:
        filter 0.25s ease,
        opacity 0.25s ease;
}

.pokemon-card.missing .pokemon-image {
    filter: grayscale(1);
    opacity: 0.48;
}

.owned-button {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 38px;
    height: 38px;

    border: 2px solid white;
    border-radius: 50%;

    background: rgba(16, 26, 43, 0.88);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    font-size: 21px;
    font-weight: 800;
}

.pokemon-card.owned .owned-button {
    background: #38c86f;
}

.pokemon-card-info {
    padding: 13px;
}

.pokemon-name {
    font-size: 16px;
    font-weight: 700;
}

.pokemon-number {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}


/* --------------------------------------------------
   Keine Karten im Filter
-------------------------------------------------- */

.empty-filter {
    grid-column: 1 / -1;

    padding: 40px 20px;

    border-radius: 18px;
    background: #1b2940;

    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 16px;
}


/* --------------------------------------------------
   Allgemein
-------------------------------------------------- */

.hidden {
    display: none;
}

footer {
    margin-top: 50px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}


/* --------------------------------------------------
   Tablet
-------------------------------------------------- */

@media (max-width: 850px) {

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


/* --------------------------------------------------
   Handy
-------------------------------------------------- */

@media (max-width: 650px) {

    .page {
        width: min(100% - 24px, 1100px);
        padding-top: 28px;
    }

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

    .collection-card {
        min-height: 180px;
    }

    .collection-logo-area {
        height: 95px;
    }

    .collection-logo {
        max-height: 85px;
    }

    .cards-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .pokemon-card-info {
        padding: 10px;
    }

    .pokemon-name {
        font-size: 14px;
    }

    .filter-button {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 14px;
    }

    .collection-summary {
        padding: 15px;
    }
}

/* --------------------------------------------------
   Immer sichtbarer Nach-oben-Button
-------------------------------------------------- */

.scroll-to-top-button {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1000;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(27, 41, 64, 0.94);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.15s ease, background 0.18s ease;
}

.scroll-to-top-button:hover {
    background: #243651;
    transform: translateY(-2px);
}

.scroll-to-top-button:active {
    transform: scale(0.94);
}


/* --------------------------------------------------
   Kartenvarianten & Holo-Effekt
-------------------------------------------------- */

.variant-row {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.variant-select {
    width: 100%;
    min-height: 36px;
    padding: 6px 30px 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: #26354d;
    color: white;
    outline: none;
    cursor: pointer;
}


.card-image-wrapper {
    --holo-x: 50%;
    --holo-y: 50%;
    --holo-rotate-x: 0deg;
    --holo-rotate-y: 0deg;
}

.pokemon-card.holo-card .card-image-wrapper,
.pokemon-card.reverse-holo-card .card-image-wrapper {
    transform:
        perspective(900px)
        rotateX(var(--holo-rotate-x))
        rotateY(var(--holo-rotate-y));
    transform-style: preserve-3d;
    transition: transform 0.12s ease-out;
}

.holo-effect {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    border-radius: inherit;
}

.pokemon-card.holo-card .holo-effect {
    opacity: 1;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(150, 80, 255, 0.00) 18%,
        rgba(150, 80, 255, 0.32) 27%,
        rgba(60, 130, 255, 0.38) 34%,
        rgba(0, 235, 255, 0.42) 41%,
        rgba(255, 255, 255, 0.52) 48%,
        rgba(255, 235, 80, 0.38) 54%,
        rgba(255, 80, 185, 0.36) 61%,
        rgba(145, 75, 255, 0.30) 68%,
        transparent 80%
    );
    background-size: 240% 240%;
    background-position: var(--holo-x) var(--holo-y);
    mix-blend-mode: screen;
    animation: pokeHoloMove 2.8s linear infinite;
}

.pokemon-card.holo-card .holo-effect::before {
    content: "";
    position: absolute;
    width: 45%;
    height: 180%;
    top: -40%;
    left: -70%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.10),
        rgba(255,255,255,0.70),
        rgba(255,255,255,0.10),
        transparent
    );
    transform: rotate(22deg);
    mix-blend-mode: screen;
    filter: blur(5px);
    animation: pokeLightSweep 2.8s linear infinite;
}

.pokemon-card.holo-card .holo-effect::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: repeating-linear-gradient(
        125deg,
        transparent 0px,
        transparent 22px,
        rgba(255,255,255,0.12) 24px,
        transparent 27px,
        transparent 48px
    );
    mix-blend-mode: screen;
    animation: pokeHoloLines 2.8s linear infinite;
}

.pokemon-card.reverse-holo-card .holo-effect {
    opacity: 1;
    background: linear-gradient(
        115deg,
        rgba(125, 45, 255, 0.10) 0%,
        rgba(145, 55, 255, 0.58) 16%,
        rgba(45, 105, 255, 0.64) 28%,
        rgba(0, 235, 255, 0.70) 40%,
        rgba(255,255,255,0.82) 49%,
        rgba(255,225,60,0.66) 57%,
        rgba(255,55,175,0.67) 68%,
        rgba(135,55,255,0.60) 80%,
        rgba(0,225,255,0.32) 100%
    );
    background-size: 260% 260%;
    background-position: var(--holo-x) var(--holo-y);
    mix-blend-mode: screen;
    animation: pokeReverseHoloMove 2.8s linear infinite;
}

.pokemon-card.reverse-holo-card .holo-effect::before {
    content: "";
    position: absolute;
    width: 38%;
    height: 210%;
    top: -55%;
    left: -75%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.05) 20%,
        rgba(255,255,255,0.55) 42%,
        rgba(255,255,255,0.95) 50%,
        rgba(255,255,255,0.55) 58%,
        rgba(255,255,255,0.05) 80%,
        transparent 100%
    );
    transform: rotate(22deg);
    mix-blend-mode: plus-lighter;
    filter: blur(4px);
    animation: pokeReverseLightSweep 2.8s linear infinite;
}

.pokemon-card.reverse-holo-card .holo-effect::after {
    content: "";
    position: absolute;
    inset: -50%;
    background: repeating-linear-gradient(
        125deg,
        transparent 0px,
        transparent 15px,
        rgba(180,100,255,0.18) 17px,
        transparent 20px,
        transparent 31px,
        rgba(50,190,255,0.20) 33px,
        transparent 36px,
        transparent 48px,
        rgba(255,255,255,0.22) 50px,
        transparent 53px,
        transparent 66px
    );
    background-size: 180% 180%;
    mix-blend-mode: plus-lighter;
    animation: pokeReverseLines 2.8s linear infinite;
}

.pokemon-card.holo-card .pokemon-image,
.pokemon-card.reverse-holo-card .pokemon-image {
    position: relative;
    z-index: 1;
}

.pokemon-card.holo-card .owned-button,
.pokemon-card.reverse-holo-card .owned-button {
    z-index: 4;
}

@keyframes pokeHoloMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pokeReverseHoloMove {
    0% { background-position: 0% 20%; }
    50% { background-position: 100% 80%; }
    100% { background-position: 0% 20%; }
}

@keyframes pokeLightSweep {
    0% { left: -75%; opacity: 0; }
    15% { opacity: 0.25; }
    45% { opacity: 0.75; }
    70% { opacity: 0.25; }
    100% { left: 135%; opacity: 0; }
}

@keyframes pokeReverseLightSweep {
    0% { left: -80%; opacity: 0; }
    12% { opacity: 0.35; }
    48% { opacity: 1; }
    72% { opacity: 0.40; }
    100% { left: 145%; opacity: 0; }
}

@keyframes pokeHoloLines {
    0% { transform: translate3d(-4%, -3%, 0); }
    50% { transform: translate3d(4%, 3%, 0); }
    100% { transform: translate3d(-4%, -3%, 0); }
}

@keyframes pokeReverseLines {
    0% { transform: translate3d(-8%, -5%, 0); }
    50% { transform: translate3d(8%, 5%, 0); }
    100% { transform: translate3d(-8%, -5%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .pokemon-card .card-image-wrapper,
    .pokemon-card .holo-effect,
    .pokemon-card .holo-effect::before,
    .pokemon-card .holo-effect::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ==================================================
   CARDMARKET-PREISE
================================================== */

.cardmarket-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 24px;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    line-height: 1.2;
}

.cardmarket-price span {
    opacity: 0.78;
}

.cardmarket-price strong {
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

.cardmarket-price.unavailable {
    justify-content: flex-start;
    opacity: 0.62;
    font-size: 0.72rem;
}

/* ==================================================
   CARDMARKET-PREISE
================================================== */
.cardmarket-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 24px;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    line-height: 1.2;
}
.cardmarket-price span { opacity: 0.78; }
.cardmarket-price strong {
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}
.cardmarket-price.unavailable {
    justify-content: flex-start;
    opacity: 0.62;
    font-size: 0.72rem;
}

/* ==================================================
   KARTEN-AKTIONEN
   Sammlung erst nach Auswahl der Karte anzeigen
================================================== */

.collection-action-button {
    display: none;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 12px auto 14px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.pokemon-card.collection-selected .collection-action-button {
    display: block;
}

.collection-action-button.add {
    background: #2e9f59;
    border-color: #39b86a;
    color: #ffffff;
}

.collection-action-button.add:hover,
.collection-action-button.add:focus {
    background: #36ad63;
    border-color: #46c276;
    color: #ffffff;
}

.collection-action-button.remove {
    background: #c93f4b;
    border-color: #dc5360;
    color: #ffffff;
}

.collection-action-button.remove:hover,
.collection-action-button.remove:focus {
    background: #d84b58;
    border-color: #e6606c;
    color: #ffffff;
}

/* ==================================================
   WUNSCHLISTE
================================================== */

.wishlist-action-button {
    cursor: pointer;
}

/* Auf der Wunschliste: dauerhaft deutlich gelb */
.wishlist-action-button.active,
.pokemon-card .wishlist-action-button.active,
.wishlist-action-button.active:hover,
.pokemon-card .wishlist-action-button.active:hover,
.wishlist-action-button.active:focus,
.pokemon-card .wishlist-action-button.active:focus,
.wishlist-action-button.active:active,
.pokemon-card .wishlist-action-button.active:active {
    background: #f6be3a !important;
    color: #172238 !important;
    border-color: #f6be3a !important;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(246, 190, 58, 0.35);
}

/* ==================================================
   WUNSCHLISTE â€“ Karte anklickbar
================================================== */
.wishlist-card[data-wishlist-open-id] {
    cursor: pointer;
}

.wishlist-card[data-wishlist-open-id]:focus-visible {
    outline: 2px solid #f6be3a;
    outline-offset: 3px;
}