@property --px { syntax: "<number>"; inherits: true; initial-value: 0.5; }
@property --py { syntax: "<number>"; inherits: true; initial-value: 0.5; }

:root { --bg: #14120f; --panel: #1e1b17; --panel2: #26221c; --edge: #3a3429; --ink: #f1ebdd; --muted: #9a9283; --gold: #e3c77d;
        --cw: 260px; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
       -webkit-touch-callout: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }

.btn { border: 1px solid #4a4335; background: none; border-radius: 22px; padding: 11px 20px; cursor: pointer; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1d170a; font-weight: 600; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); white-space: nowrap;
              transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--edge); color: var(--ink); }
.pop { position: absolute; z-index: 50; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
       box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: popin .18s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(-6px); } }

/* ───────── Anmelden ───────── */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto;
        background: radial-gradient(ellipse at 50% 30%, #2a2318, var(--bg) 70%); }
.auth-packs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-packs img { position: absolute; left: 50%; top: 50%; height: min(70vh, 560px); opacity: .2;
                  transform: translate(-50%, -50%) translateX(var(--x)) rotate(var(--r)); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-50%, -52%) translateX(var(--x)) rotate(calc(var(--r) * 1.15)); } }
.auth-box { position: relative; width: min(100%, 360px); background: rgba(30,27,23,.92); border: 1px solid var(--edge); border-radius: 18px;
            padding: 28px 22px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: rise .5s cubic-bezier(.2,.8,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.auth-box h1 { margin: 0; text-align: center; font: 600 2rem Georgia, "Times New Roman", serif; color: var(--gold); letter-spacing: .02em; }
.auth-sub { margin: 4px 0 20px; text-align: center; color: var(--muted); font-size: .92rem; }
.auth-seg { margin-bottom: 16px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 5px 2px; }
.field input { width: 100%; padding: 11px 13px; background: #15130f; border: 1px solid var(--edge); border-radius: 10px; outline: none;
               -webkit-user-select: text; user-select: text; transition: border-color .2s; }
.field input:focus { border-color: var(--gold); }
.auth-err { min-height: 1.3em; margin: 2px 2px 10px; color: #ff9c7a; font-size: .86rem; }

/* ───────── App-Rahmen ───────── */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 54px; padding: 0 12px; flex: none; position: relative; z-index: 30; }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: none; padding: 8px 13px; border-radius: 18px; cursor: pointer; color: var(--muted); }
.tabs button[aria-pressed="true"] { color: var(--ink); background: rgba(255,255,255,.08); }
.game-seg { flex: none; padding: 2px; }
.game-seg button { padding: 5px 10px; font-size: .85rem; }
/* schmale Handys: Spiel-Umschalter + Konto oben, Tabs darunter */
@media (max-width: 560px) {
  header { flex-wrap: wrap; height: auto; padding-top: 6px; padding-bottom: 2px; row-gap: 4px; }
  .tabs { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 420px) { .tabs button { padding: 8px 9px; } }
.me { position: relative; min-width: 0; display: flex; align-items: center; gap: 6px; }
.trade-btn { position: relative; flex: none; border: 0; background: none; padding: 7px 11px; border-radius: 18px; cursor: pointer; color: var(--muted); }
.trade-btn[aria-pressed="true"] { color: var(--ink); background: rgba(255,255,255,.08); }
.badge { position: absolute; top: -5px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d9543a; color: #fff;
         font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: zin .3s cubic-bezier(.2,1.1,.35,1); }
.me-btn { border: 1px solid var(--edge); background: var(--panel); border-radius: 18px; padding: 6px 12px; cursor: pointer; max-width: 100%;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-pop { right: 0; top: calc(100% + 6px); padding: 6px; min-width: 150px; }
.me-pop button { width: 100%; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.me-pop button:hover { background: var(--panel2); }

.bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 8px; flex: none; position: relative; z-index: 25; transition: opacity .3s; }
.bar.busy { opacity: 0; pointer-events: none; }
.bar .seg { flex: none; }

/* Erweiterungs-Auswahl */
.picker { flex: 1 1 210px; min-width: 0; position: relative; }
.pick-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px;
            padding: 4px 12px 4px 6px; cursor: pointer; text-align: left; height: 44px; transition: border-color .2s; }
.pick-btn:hover, .pick-btn[aria-expanded="true"] { border-color: #5a5040; }
.pick-btn img { height: 34px; width: 18px; object-fit: contain; flex: none; }
.pick-btn span { flex: 1; min-width: 0; line-height: 1.15; }
.pick-btn b { display: block; font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn small { color: var(--muted); font-size: .74rem; }
.chev { width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); flex: none; transition: transform .2s; }
.pick-btn[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-2px); }
.pick-pop { left: 0; right: 0; top: calc(100% + 6px); max-height: min(62vh, 520px); overflow-y: auto; padding: 6px; min-width: 260px; }
.pick-pop h3 { margin: 8px 8px 4px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pick-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; background: none; border-radius: 9px;
             padding: 5px 10px 5px 6px; cursor: pointer; text-align: left; }
.pick-item:hover, .pick-item:focus-visible { background: var(--panel2); outline: none; }
.pick-item[aria-selected="true"] { border-color: rgba(227,199,125,.5); background: rgba(227,199,125,.08); }
.pick-item img { height: 46px; width: 24px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.pick-item span { flex: 1; min-width: 0; }
.pick-item b { display: block; font-weight: 500; font-size: .92rem; }
.pick-item small { color: var(--muted); font-size: .75rem; }

main { flex: 1; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; }
#viewOpen { overflow: hidden; overflow: clip; overscroll-behavior: none; touch-action: none; }   /* Schneiden/Wischen überall, ohne dass die Seite scrollt */   /* clip: weggeworfene Karten machen den Bereich nicht scrollbar */

.mood { position: absolute; inset: -20%; background-color: transparent; transition: background-color 1.2s;
        -webkit-mask: radial-gradient(closest-side, #000, transparent); mask: radial-gradient(closest-side, #000, transparent); }
.rays { position: absolute; left: 50%; top: 50%; width: 130vmax; height: 130vmax; margin: -65vmax 0 0 -65vmax; pointer-events: none;
        background: repeating-conic-gradient(from 0deg, var(--ray, #fff) 0deg 3deg, transparent 3deg 15deg);
        -webkit-mask: radial-gradient(circle, #000 0, rgba(0,0,0,.35) 10%, transparent 30%); mask: radial-gradient(circle, #000 0, rgba(0,0,0,.35) 10%, transparent 30%);
        opacity: 0; transition: opacity 1.4s; animation: spin 60s linear infinite; }
.rays.on { opacity: .07; }
.rays.strong { opacity: .28; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) { .rays { animation: none; } }
.halo { position: absolute; left: 50%; top: 50%; width: calc(var(--cw) * 2.2); height: calc(var(--cw) * 2.6); transform: translate(-50%, -50%) scale(.7);
        border-radius: 50%; background: radial-gradient(closest-side, var(--halo, #fff), transparent); opacity: 0; pointer-events: none; z-index: 1;
        transition: opacity .9s, transform 1.2s cubic-bezier(.2,.8,.3,1); }
.halo.on { opacity: .55; transform: translate(-50%, -50%) scale(1); }

/* ───────── Booster (echtes Produktfoto, oben wird ein Streifen abgerissen) ───────── */
.pack-pos { position: absolute; left: 50%; top: 50%; z-index: 3; }
.pack-float { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-7px) rotate(.6deg); } }
.pack { position: absolute; width: var(--pw); height: var(--ph); left: calc(var(--pw) / -2); top: calc(var(--ph) / -2);
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.8,.3,1); cursor: pointer;
        touch-action: none; isolation: isolate; }
.pack-shadow { position: absolute; left: calc(var(--pw) * -.45); width: calc(var(--pw) * .9); top: calc(var(--ph) * .42); height: calc(var(--ph) * .16);
               border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); pointer-events: none; }
.pack.tearing { transition: none; }
.pack .part { position: absolute; inset: 0; background: var(--img) center / 100% 100% no-repeat; }
.pack .piece { will-change: transform; }
.pack .sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; transition: opacity .3s;
               -webkit-mask: var(--img) center / 100% 100%; mask: var(--img) center / 100% 100%;
               background: linear-gradient(calc(100deg + var(--ry, 0deg) * 2), transparent 35%, rgba(255,255,255,.55) 48%, rgba(255,255,255,.1) 56%, transparent 66%) 0 0 / 250% 100%;
               animation: sheen 6s ease-in-out infinite; }
@keyframes sheen { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0% 0; } }
.blade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.shard { position: absolute; width: 10px; height: 3px; margin: -1.5px 0 0 -5px; border-radius: 2px; box-shadow: 0 0 6px rgba(255,255,255,.7); }

/* ───────── Karten ───────── */
/* Hülle über dem Booster: beim Herausziehen schneidet sie die Karten an der Schnittlinie ab, als steckten sie noch drin */
.stack-clip { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.stack { position: absolute; left: 50%; top: calc(50% + 14px); width: 0; height: 0; z-index: 2; }
.stack .card { pointer-events: auto; }
.card { position: absolute; left: 0; top: 0; width: var(--cw); height: calc(var(--cw) * 1.393); touch-action: none; cursor: grab;
        transform: translate(-50%, -50%); transition: transform .45s cubic-bezier(.2,1.1,.35,1); }
.card.dragging { transition: none; cursor: grabbing; }
.tilt { position: relative; width: 100%; height: 100%; border-radius: calc(var(--cw) * .047); transition: transform .4s cubic-bezier(.2,.8,.3,1);
        transform: perspective(1200px) rotateY(calc((var(--px) - .5) * 18deg)) rotateX(calc((.5 - var(--py)) * 18deg)); }
.tracking .tilt { transition: transform .08s linear; }
.face { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: #1d1b17; isolation: isolate;
        -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); }
.tilt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4); }
.face img { position: relative; width: 100%; height: 100%; display: block; object-fit: cover; }
.face .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ───── Glanz & Foil ─────
   Foil ist kein Filter über dem Bild, sondern Licht: die Farben bleiben so satt wie bei Nicht-Foil.
   – .foil: ein weicher, schräger Lichtstreifen (etwa ein Drittel der Karte breit), der mit der Neigung (--px/--py)
     über die ganze Karte zieht; schwaches „color-dodge“ hellt nur innerhalb des Streifens auf. --band tönt ihn (Gold, Silber).
   – .surge: Surge-Foil – wellige Streifen (fx/surge.webp als Maske) in kräftigem Regenbogen, leicht versetzt (Parallaxe);
     „hard-light“ färbt die Streifen, statt sie weiß ausbrennen zu lassen. Dazu ein leichter Regenbogen-Schimmer über der ganzen Karte.
     Beides wird erst beim Schwenken sichtbar: --sv (0…1) wächst mit der Neigung, gerade gehalten ist kaum Regenbogen zu sehen.
   – .glare: Glanzpunkt dort, wo das Licht hinfällt; die abgewandte Seite wird etwas dunkler.
   --px/--py (0…1) kommen von Maus, Finger, Lagesensor oder dem langsamen Wiegen. */
.glare, .foil, .surge { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.glare { mix-blend-mode: soft-light; opacity: .5;
         background: radial-gradient(farthest-corner circle at calc(var(--px) * 100%) calc(var(--py) * 100%), rgba(255,255,255,.75) 0%, rgba(255,255,255,.1) 28%, rgba(0,0,0,.28) 92%); }
/* Hintergrund ist dreimal so breit wie die Karte: Streifen 36–64 % ≈ ein Drittel der Kartenbreite.
   Position 6 % … 94 % schiebt ihn von ganz rechts außen nach ganz links außen. */
.foil { --band: 255,255,255; mix-blend-mode: color-dodge; opacity: 1;
        background: linear-gradient(105deg, transparent 36%, rgba(var(--band),.12) 43%, rgba(var(--band),.38) 50%, rgba(var(--band),.12) 57%, transparent 64%)
                    calc((.5 + (.5 - var(--px)) * .9 + (var(--py) - .5) * .2) * 100%) 0 / 300% 100% no-repeat; }
/* --sv steht an den Ebenen selbst, damit es das gewiegte --px der .tilt übernimmt (|x| = max(x, -x)) */
.fin-surge .surge, .fin-surge .foil { --sv: clamp(0, (max(var(--px) - .5, .5 - var(--px)) + max(var(--py) - .5, .5 - var(--py)) - .08) * 3, 1); }
.surge { mix-blend-mode: hard-light; opacity: calc(.85 * var(--sv, 1));
         background-image: repeating-linear-gradient(105deg, #ff4f6d 0%, #ffb347 3%, #e9ff5c 6%, #4dff9a 9%, #4dd2ff 12%, #6f6bff 15%, #e05cff 18%, #ff4f6d 21%);
         background-size: 300% 300%;
         background-position: calc(50% + (var(--px) - .5) * 90%) calc(50% + (var(--py) - .5) * 120%);
         -webkit-mask-image: url(fx/surge.webp); mask-image: url(fx/surge.webp);
         -webkit-mask-size: 112% 112%; mask-size: 112% 112%;
         -webkit-mask-position: calc(50% + (var(--px) - .5) * 14%) calc(50% + (var(--py) - .5) * 14%);
         mask-position: calc(50% + (var(--px) - .5) * 14%) calc(50% + (var(--py) - .5) * 14%); }
.fin-surge .foil { background-image: linear-gradient(105deg, transparent 36%, rgba(var(--band),.12) 43%, rgba(var(--band),.38) 50%, rgba(var(--band),.12) 57%, transparent 64%),
    linear-gradient(115deg, rgba(255,60,90,calc(.16 * var(--sv))), rgba(255,180,60,calc(.16 * var(--sv))), rgba(90,255,120,calc(.16 * var(--sv))),
                    rgba(60,190,255,calc(.16 * var(--sv))), rgba(170,90,255,calc(.16 * var(--sv))), rgba(255,60,90,calc(.16 * var(--sv))));
  background-size: 300% 100%, 250% 250%; background-repeat: no-repeat, repeat;
  background-position: calc((.5 + (.5 - var(--px)) * .9 + (var(--py) - .5) * .2) * 100%) 0, calc((.5 - var(--px)) * 160%) calc((.5 - var(--py)) * 160%); }
.fin-gold .foil { --band: 255,214,140; }
.fin-silver .foil { --band: 214,226,255; }
/* ohne Maus/Finger/Lagesensor wiegt sich die Foil-Karte langsam, damit der Glanz wandert */
.card.top.is-foil .tilt, .zoom .is-foil .tilt { animation: sway 18s ease-in-out infinite alternate; }
/* Maus, Finger oder Lagesensor übernehmen (Selektoren so spezifisch wie die Zeile darüber, sonst gewinnt das Wiegen) */
.card.top.is-foil.tracking .tilt, .card.top.is-foil.dragging .tilt, .gyro .card.top.is-foil .tilt,
.zoom .is-foil.tracking .tilt, .gyro .zoom .is-foil .tilt { animation: none; }
/* lange gedrückt: Karte schwenken – stärkere Neigung, leicht angehoben */
.swivel .tilt, .tracking.swivel .tilt { transform: perspective(900px) rotateY(calc((var(--px) - .5) * 48deg)) rotateX(calc((.5 - var(--py)) * 42deg)) scale(1.04);
                transition: transform .12s linear; }
.swivel .tags, .swivel .wish-btn { opacity: 0 !important; }
@keyframes sway { 0% { --px: .1; --py: .42; } 50% { --px: .5; --py: .58; } 100% { --px: .9; --py: .4; } }


/* ───── Hüllen ─────
   .inner = Karte + Soft Sleeve (wird beim Hard-Sleeven zusammen bewegt), .hard liegt darum.
   Klarer Kunststoff: kaum Farbe, ein schräger Glanz, der mit dem Licht (--px/--py) wandert, helle Kanten. */
.inner { position: absolute; inset: 0; border-radius: inherit; }
.sleeve { position: absolute; pointer-events: none; opacity: 0; }
.card.soft .sleeve.soft, .card.hard .sleeve.hard { opacity: 1; }
.sleeve.soft { inset: -7% -2.4% -1.4%; border-radius: calc(var(--cw) * .05);
  background: linear-gradient(calc(110deg + (var(--px) - .5) * 40deg), rgba(255,255,255,.14) 0%, rgba(255,255,255,.03) 28%, transparent 48%, rgba(255,255,255,.07) 70%, rgba(255,255,255,.16) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), inset 0 calc(var(--cw) * .012) 0 rgba(255,255,255,.12); }
/* offene Oberkante des Soft Sleeves */
.sleeve.soft::before { content: ""; position: absolute; left: 3%; right: 3%; top: 0; height: 1px; background: rgba(255,255,255,.45); }
.sleeve.hard { inset: -10% -6.5% -4.5%; border-radius: calc(var(--cw) * .045);
  background: linear-gradient(calc(115deg + (var(--px) - .5) * 30deg), rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 30%, transparent 50%, rgba(255,255,255,.06) 72%, rgba(255,255,255,.15) 100%);
  box-shadow: inset 0 0 0 calc(var(--cw) * .02) rgba(214,230,255,.16), inset 0 0 0 calc(var(--cw) * .02 + 1px) rgba(255,255,255,.4),
              inset 0 0 0 1px rgba(255,255,255,.5), 0 12px 30px rgba(0,0,0,.35); }
/* Öffnung oben am Toploader: ein Stück dünner, mit Griffmulde */
.sleeve.hard::before { content: ""; position: absolute; left: 4%; right: 4%; top: 0; height: 4.5%; border-bottom: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(rgba(255,255,255,.08), transparent); }
.sleeve.hard::after { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 2.4%; transform: translateX(-50%); border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: rgba(20,18,15,.9); box-shadow: inset 0 -1px 0 rgba(255,255,255,.35); }
.card.soft .tags { margin-bottom: calc(10px + var(--cw) * .07); }
.card.hard .tags { margin-bottom: calc(10px + var(--cw) * .1); }
.card.soft .wish-btn { bottom: calc(100% + 6px + var(--cw) * .07); }
.card.hard .wish-btn { bottom: calc(100% + 6px + var(--cw) * .1); right: calc(var(--cw) * -.065); }
.caption .hint { opacity: .6; margin-top: 2px; }
/* beim Sleeven nur die eine Karte zeigen – sonst sieht man durch die leere Hülle die nächste */
.card { transition: transform .45s cubic-bezier(.2,1.1,.35,1), opacity .25s; }
.stack.sleeving .card:not(.top) { opacity: 0; }

/* „Neu“ / „Foil“ stehen über der Karte, nicht auf ihr */
.tags { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none;
        opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.card.top .tags { opacity: 1; transform: none; transition-delay: .15s; }
.card:not(.top) .tags, .card.dragging .tags, .stack.rising .tags { opacity: 0; transition: none; }
.tag { padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
       border: 1px solid; background: rgba(20,18,15,.7); }
.tag.new { color: var(--gold); border-color: rgba(227,199,125,.6); }
.tag.foiltag { color: #cfe9ff; border-color: rgba(170,210,255,.5); background: linear-gradient(90deg, rgba(255,200,120,.12), rgba(130,220,255,.14), rgba(220,150,255,.12)); }

.caption { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted);
           font-size: .88rem; line-height: 1.45; transition: opacity .3s; pointer-events: none; z-index: 4; }
.caption b { color: var(--ink); font-weight: 600; }
.caption small { display: block; opacity: .85; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.undo { position: absolute; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 11; border: 1px solid var(--edge);
        background: rgba(30,27,23,.85); color: var(--ink); border-radius: 18px; padding: 7px 13px; font-size: .85rem; cursor: pointer;
        animation: fade .25s; }
.undo:active { transform: scale(.95); }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.ember { position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; }

/* ───────── Übersicht nach dem Öffnen ───────── */
.summary { position: absolute; inset: 0; z-index: 10; overflow-y: auto; touch-action: pan-y; padding: 8px 12px calc(20px + env(safe-area-inset-bottom)); }
.summary-in { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(64px, 17vw, 112px), 1fr)); gap: 12px 8px; width: 100%; max-width: 760px; }
.mini-wrap { opacity: 0; transform: translateY(14px) scale(.92); animation: deal .5s calc(var(--i) * 45ms) cubic-bezier(.2,.8,.3,1) forwards; }
.mini-tags { height: 18px; display: flex; justify-content: center; gap: 4px; margin-bottom: 3px; }
.mini-tags .tag { padding: 1px 6px; font-size: .62rem; }
.mini { position: relative; aspect-ratio: 488 / 680; border-radius: 5px; overflow: hidden; cursor: pointer; background: #1d1b17;
        box-shadow: 0 6px 16px rgba(0,0,0,.5); --cw: 110px; }
.mini img { width: 100%; height: 100%; display: block; }
@keyframes deal { to { opacity: 1; transform: none; } }
.sum-head { text-align: center; color: var(--muted); font-size: .9rem; }
.sum-head b { color: var(--ink); font-weight: 600; font-size: 1.05rem; display: block; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; opacity: 0; animation: deal .4s .6s forwards; }

/* ───────── Sammlung ───────── */
#viewColl, #viewWish, #viewTrade { overflow-y: auto; padding: 4px 12px calc(32px + env(safe-area-inset-bottom)); }
.coll-head { max-width: 960px; margin: 6px auto 14px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.coll-head b { color: var(--ink); font-weight: 600; }
.binder { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.slot { position: relative; aspect-ratio: 488 / 680; border-radius: 6px; overflow: hidden; cursor: pointer; background: #1d1b17;
        box-shadow: 0 6px 16px rgba(0,0,0,.45); transition: transform .2s; --cw: 110px; }
.slot:hover { transform: translateY(-3px); }
.slot img { width: 100%; height: 100%; display: block; }
.qty { position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.78); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 10px; }
.slot .foil, .mini .foil, .slot .surge, .mini .surge { --px: .55; --py: .45; --sv: .5; }
.slot .foil, .mini .foil { opacity: .6; }
.empty { max-width: 960px; margin: 40px auto; text-align: center; color: var(--muted); }
.legal { max-width: 960px; margin: 28px auto 0; color: #6e6656; font-size: .75rem; line-height: 1.5; }
.legal a { color: inherit; }

/* ───────── Großansicht ───────── */
.zoom { position: fixed; inset: 0; z-index: 60; background: rgba(8,7,5,.9); display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 14px; padding: 16px; animation: fade .25s; touch-action: none; }
@keyframes fade { from { opacity: 0; } }
.zoom .card { position: relative; transform: none; transition: none; cursor: default; animation: zin .4s cubic-bezier(.2,1.1,.35,1); }
@keyframes zin { from { transform: scale(.85); opacity: 0; } }
.zinfo { text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.zinfo b { color: var(--ink); font-weight: 600; font-size: 1rem; }
.zinfo a { color: var(--gold); }

/* ───────── Wunschliste ───────── */
.wish-btn { position: absolute; z-index: 5; bottom: calc(100% + 6px); right: 0;   /* über der Karte, berührt sie nicht */ width: 38px; height: 38px; border-radius: 50%;
            display: grid; place-items: center; padding: 0; cursor: pointer; border: 1px solid var(--edge); background: rgba(20,18,15,.82); color: var(--muted);
            box-shadow: 0 4px 12px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s, color .2s, transform .15s; }
.wish-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.wish-btn.on { color: var(--gold); border-color: rgba(227,199,125,.6); }
.wish-btn.on svg { fill: currentColor; }
.wish-btn:active { transform: scale(.9); }
.card.top:not(.dragging) .wish-btn, .zoom .wish-btn { opacity: 1; pointer-events: auto; }
.stack.rising .wish-btn { opacity: 0; }
.wish-pop { position: fixed; z-index: 80; width: 250px; padding: 6px; max-height: 60vh; overflow-y: auto; }
.wish-pop h3 { margin: 6px 8px 6px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.wish-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.wish-item:hover { background: var(--panel2); }
.wish-item i { width: 18px; height: 18px; border: 1.5px solid #5a5040; border-radius: 5px; flex: none; display: grid; place-items: center; font-style: normal; font-size: .8rem; }
.wish-item[aria-checked="true"] i { background: var(--gold); border-color: var(--gold); color: #1d170a; }
.wish-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wish-new { display: flex; gap: 6px; padding: 6px 4px 4px; border-top: 1px solid var(--edge); margin-top: 4px; }
.wish-new input { flex: 1; min-width: 0; padding: 8px 10px; background: #15130f; border: 1px solid var(--edge); border-radius: 8px; outline: none;
                  -webkit-user-select: text; user-select: text; }
.wish-new input:focus { border-color: var(--gold); }
.wish-new button { border: 0; border-radius: 8px; padding: 0 12px; background: var(--gold); color: #1d170a; font-weight: 600; cursor: pointer; }
.wish-none { padding: 6px 10px 8px; color: var(--muted); font-size: .85rem; }
.wl { max-width: 960px; margin: 0 auto 26px; }
.wl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.wl-head b { font-weight: 600; }
.wl-head small { color: var(--muted); margin-left: 6px; }
.wl-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 4px 6px; }
.wl-del:hover { color: #ff9c7a; }
.slot .have { position: absolute; left: 5px; bottom: 5px; background: rgba(0,0,0,.78); color: var(--gold); font-size: .68rem; padding: 1px 7px; border-radius: 10px; }

/* ───────── Tauschen ───────── */
.tr-sec { max-width: 720px; margin: 6px auto 24px; }
.tr-sec h3, .tr-pick-head { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 8px 0 10px; }
.tr-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); margin-bottom: 8px; }
.tr-row .slot { width: 52px; flex: none; border-radius: 4px; }
.tr-row span { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.4; color: var(--muted); }
.tr-row b { color: var(--ink); font-weight: 600; }
.tr-row .btn { flex: none; padding: 8px 14px; }
.tr-users { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-user { border: 1px solid var(--edge); background: var(--panel); border-radius: 18px; padding: 8px 14px; cursor: pointer; }
.tr-user:hover { border-color: #5a5040; }
.tr-msg { max-width: 720px; margin: 8px auto 0; color: var(--gold); font-size: .9rem; }
.tr-offer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 20px; }
.tr-offer > p:first-child { margin: 4px 0 0; color: var(--muted); }
.tr-offer > p b { color: var(--ink); }
.tr-offer .card { position: relative; transform: none; transition: none; cursor: default; animation: zin .4s cubic-bezier(.2,1.1,.35,1); }
.tr-offer .zinfo { margin: 0; }
.tr-offer .actions { opacity: 1; animation: none; }
.tr-pick-head { max-width: 960px; margin: 6px auto 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
                text-transform: none; letter-spacing: 0; font-size: .9rem; }
.tr-pick-head b { color: var(--ink); }
.slot.sel { outline: 3px solid var(--gold); outline-offset: 2px; transform: translateY(-3px); }
.tr-go { position: sticky; bottom: 0; display: flex; justify-content: center; padding: 14px 0 4px; pointer-events: none; }
.tr-go .btn { pointer-events: auto; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.tr-go .btn[disabled] { opacity: .45; cursor: default; background: var(--panel2); border-color: var(--edge); color: var(--muted); }

/* Tausch-Animation */
.trade-fx { position: fixed; inset: 0; z-index: 29; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, #2a2318, var(--bg) 70%); animation: fade .3s; }
.trade-fx .tx { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; will-change: transform; }
.trade-fx .card { cursor: default; transition: none; }
.trade-fx .tilt::before { transition: box-shadow .4s; }
.trade-fx.swap .tilt::before { box-shadow: 0 0 34px 10px rgba(255,205,120,.55), 0 14px 36px rgba(0,0,0,.5); }
.trade-fx.done .tx.get .tilt::before { box-shadow: 0 0 60px 14px rgba(255,190,100,.45), 0 14px 36px rgba(0,0,0,.5); }
.tx-name { position: absolute; left: 0; right: 0; text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; transition: opacity .4s; }
.tx-name.top { top: calc(10px + env(safe-area-inset-top)); }
.tx-name.bottom { bottom: calc(10px + env(safe-area-inset-bottom)); }
.trade-fx.done .tx-name { opacity: 0; }
.tx-ring { position: absolute; left: 50%; top: 50%; width: 30vmin; height: 30vmin; border-radius: 50%; opacity: 0; pointer-events: none;
           border: 3px solid rgba(255,228,160,.9); box-shadow: 0 0 30px 6px rgba(255,190,90,.6), inset 0 0 30px 6px rgba(255,190,90,.5); }
.tx-cap { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; color: var(--gold); font-size: .78rem;
          letter-spacing: .12em; text-transform: uppercase; }
.tx-cap:not(:empty) { animation: rise .4s; }
.tx-cap b { display: block; color: var(--ink); font-size: 1.05rem; letter-spacing: 0; text-transform: none; font-weight: 600; margin-top: 2px; }
.tx-cap small { display: block; color: var(--muted); letter-spacing: 0; text-transform: none; font-size: .8rem; margin-top: 4px; }

/* ───────── God-Pack ───────── */
.god-flash { position: fixed; inset: 0; z-index: 31; pointer-events: none;
             background: radial-gradient(circle at 50% 45%, rgba(255,246,214,.95), rgba(255,200,90,.55) 25%, rgba(255,150,60,0) 65%); }
.god-ring { position: fixed; left: 50%; top: 45%; width: 40vmin; height: 40vmin; margin: -20vmin 0 0 -20vmin; border-radius: 50%; z-index: 31; pointer-events: none;
            border: 3px solid rgba(255,228,160,.9); box-shadow: 0 0 30px 6px rgba(255,190,90,.6), inset 0 0 30px 6px rgba(255,190,90,.5); }
.god-title { position: fixed; left: 0; right: 0; bottom: calc(6% + env(safe-area-inset-bottom)); z-index: 32; text-align: center; pointer-events: none;
             font: 700 clamp(2.4rem, 11vw, 4.6rem) Georgia, "Times New Roman", serif; letter-spacing: .06em; color: transparent;
             background: linear-gradient(100deg, #b8862e 0%, #fff0c2 30%, #e3c77d 45%, #fff 50%, #e3c77d 55%, #b8862e 80%) 0 0 / 250% 100%;
             -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 18px rgba(255,170,60,.55)); animation: godshine 1.6s linear infinite; }
.god-title small { display: block; font: 600 clamp(.8rem, 3.2vw, 1rem) system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #ffe3a0;
                   -webkit-text-fill-color: #ffe3a0; margin-top: 4px; }
@keyframes godshine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.confetti { position: absolute; width: 7px; height: 12px; border-radius: 2px; }

.toast { position: absolute; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; max-width: 90vw;
         background: #3a2a22; border: 1px solid #6b4535; color: #ffd9c9; padding: 9px 14px; border-radius: 10px; font-size: .86rem; animation: rise .3s; }

@media (prefers-reduced-motion: reduce) { .pack-float, .rays, .sheen, .card.top.is-foil .tilt, .zoom .is-foil .tilt, .auth-packs img { animation: none; } }
