:root {
  --bg: #14161c;
  --bg2: #1b1e26;
  --card: #21252e;
  --card2: #2b303b;
  --line: #343a48;
  --text: #f5f6f8;
  --muted: #9aa3b2;
  --accent: #ff9a3c;
  --ok: #35c46b;
  --want: #ff5d7a;
  --radius: 20px;
  --cell: 190px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }

.page {
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---- Leiste ---- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row + .bar-row { margin-top: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 800; flex: 1; }
.logo { font-size: 1.8rem; }
.title { flex: 1; min-width: 0; font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  font-size: 1.4rem; line-height: 1;
}
.iconbtn:active, .btn:active, .chip:active { transform: scale(.96); }
.sync {
  font-size: .8rem; color: var(--muted); padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); white-space: nowrap;
}
.sync.warn { color: var(--want); border-color: var(--want); }

/* ---- Startseite ---- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px 16px 40px;
}
.tile {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; border-radius: 26px; text-decoration: none; color: inherit;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--card)), var(--card) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
}
.tile:active { transform: scale(.98); }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; }
.mosaic .cell { position: relative; min-height: 0; min-width: 0; background: radial-gradient(circle at 50% 30%, #f4f5f8, #cdd1d9); overflow: hidden; }
.mosaic .cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4%; }
.mosaic .cell.ghost img { filter: grayscale(1); opacity: .5; }
.mosaic .big { grid-column: 1 / -1; grid-row: 1 / -1; font-size: 4rem; background: color-mix(in srgb, var(--accent) 25%, var(--card)); }
.tile h2 { font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.tile-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .95rem; }
.tile-foot b { color: var(--text); }
.tile.new {
  align-items: center; justify-content: center; min-height: 200px;
  background: transparent; border: 2px dashed var(--line); color: var(--muted); font-size: 1.1rem; font-weight: 700;
  font: inherit;
}
.tile.new span { font-size: 2.6rem; line-height: 1; color: var(--accent); }

/* ---- Fortschritt ---- */
.track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .35s ease; }

.hero {
  margin: 14px 16px 8px; padding: 18px 22px; border-radius: 26px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center;
}
.hero .pct { font-size: 3.4rem; font-weight: 800; color: var(--accent); line-height: 1; }
.hero .pct small { font-size: 1.1rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.hero .meter { display: flex; flex-direction: column; gap: 8px; }
.hero .nums { color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.hero .nums b { color: var(--text); }

/* ---- Werkzeuge ---- */
.search { flex: 1; min-width: 0; position: relative; }
.search input {
  width: 100%; height: 48px; padding: 0 14px 0 42px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: .7; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; flex: none; }
.seg button { width: 48px; height: 46px; border: 0; background: var(--card); font-size: 1.15rem; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #111; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 99px; background: transparent;
  border: 1.5px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap;
}
.chip b { color: var(--text); margin-left: 4px; }
.chip[data-f="have"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chip[data-f="want"] { color: var(--want); border-color: color-mix(in srgb, var(--want) 55%, transparent); }
.chip[data-f="dupe"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.chip[aria-pressed="true"] { background: color-mix(in srgb, currentColor 18%, transparent); border-color: currentColor; color: var(--text); }
.chip[aria-pressed="true"][data-f="have"] { color: var(--accent); }
.chip[aria-pressed="true"][data-f="want"] { color: var(--want); }
.chip[aria-pressed="true"][data-f="dupe"] { color: var(--ok); }
.chip[aria-pressed="true"] b { color: inherit; }

/* ---- Raster ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr));
  gap: 14px;
  padding: 14px 16px 120px;
}
.group {
  grid-column: 1 / -1; margin: 14px 4px 0; font-size: 1.2rem; font-weight: 800;
  color: var(--muted); letter-spacing: .06em;
}
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; font-size: 1.1rem; }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 2px solid transparent; border-radius: var(--radius);
  transition: border-color .15s;
}
.card.have { border-color: var(--accent); }
.card.pop { animation: pop .22s ease; }
@keyframes pop { 50% { transform: scale(1.04); } }
.card-head { padding: 10px 12px 8px; min-height: 4.2em; }
.code { display: block; color: var(--accent); font-weight: 800; font-size: .85rem; }
.name { display: block; font-weight: 700; line-height: 1.2; }
.meta { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }

.pic {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0;
  background: radial-gradient(circle at 50% 30%, #f4f5f8, #cdd1d9);
}
.pic img { width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: filter .2s, opacity .2s; }
.card:not(.have) .pic img { filter: grayscale(1); opacity: .5; }
.noimg { display: grid; place-items: center; height: 100%; font-size: 3rem; opacity: .5; color: #333; }

.badge {
  position: absolute; left: 8px; top: 8px; padding: 4px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  background: #2a1d0e; color: var(--accent); border: 1px solid var(--accent);
}
.badge.dupe { background: #0d2a18; color: var(--ok); border-color: var(--ok); }
.badge.bonus { left: auto; right: 8px; background: #222; color: #ddd; border-color: #666; }
.badge.want { top: auto; bottom: 8px; background: #2d0f18; color: var(--want); border-color: var(--want); }
.badge .short { display: none; }

.card-foot { display: flex; gap: 8px; padding: 10px; }
.btn {
  min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card2); font-weight: 700;
}
.btn.main { flex: 1; }
.btn.star.on { color: var(--want); border-color: var(--want); background: color-mix(in srgb, var(--want) 14%, var(--card2)); }
.stepper {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--card));
}
.stepper button { width: 52px; height: 46px; border: 0; background: transparent; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.stepper output { font-size: 1.2rem; font-weight: 800; }
.cap { display: none; }

/* Mini */
.grid.mini { --cell: 108px; gap: 10px; }
.mini .card { border-radius: 14px; }
.mini .card-head, .mini .card-foot { display: none; }
.mini .cap { display: block; text-align: center; font-size: .78rem; padding: 5px 2px 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .badge { left: 5px; top: 5px; padding: 2px 8px; font-size: .8rem; }
.mini .badge .long { display: none; }
.mini .badge .short { display: inline; }
.mini .badge.bonus, .mini .badge.want { display: none; }

/* Liste */
.grid.list { --cell: 380px; gap: 10px; }
.list .card { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; border-radius: 16px; }
.list .pic { grid-column: 1; grid-row: 1; width: 78px; height: 78px; }
.list .card-head { grid-column: 2; grid-row: 1; min-height: 0; }
.list .card-foot { grid-column: 3; grid-row: 1; padding: 8px; }
.list .btn.main { flex: none; }
.list .badge { display: none; }
.list .stepper { flex: none; width: 150px; }
.btn { white-space: nowrap; }
.btn.star { flex: none; width: 52px; padding: 0; font-size: 1.3rem; }
.sheet .btn.star { width: auto; padding: 0 14px; font-size: 1rem; }

/* ---- FAB ---- */
.fab {
  position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 20;
  width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 2rem; line-height: 1;
  background: var(--accent); color: #111; box-shadow: 0 8px 24px #0009;
}
.fab:active { transform: scale(.94); }

/* ---- Dialoge ---- */
dialog {
  border: 0; border-radius: 28px; padding: 0; background: var(--bg2); color: var(--text);
  width: min(560px, 94vw); max-height: 94dvh; overflow: auto; box-shadow: 0 30px 80px #000c;
}
dialog::backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { font-size: 1.4rem; font-weight: 800; }
.sheet .big { aspect-ratio: 1; max-height: 50dvh; width: 100%; margin: 0 auto; border-radius: 20px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #f4f5f8, #cdd1d9); display: grid; place-items: center; }
.sheet .big img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.sheet .big.ghost img { filter: grayscale(1); opacity: .5; }
.sheet .row { display: flex; gap: 10px; align-items: center; }
.sheet .row > * { flex: 1; }
.sheet .stepper { min-height: 60px; }
.sheet .stepper button { height: 58px; width: 70px; font-size: 2rem; }
.sheet .stepper output { font-size: 1.6rem; }
.btn.danger { color: var(--want); border-color: color-mix(in srgb, var(--want) 50%, var(--line)); }
.btn.primary { background: var(--accent); color: #111; border-color: transparent; }
.btn[disabled] { opacity: .5; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .9rem; }
.field input[type="text"] {
  height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 1.05rem; outline: none;
}
.field input[type="text"]:focus { border-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.photo {
  display: grid; place-items: center; height: 180px; border-radius: 18px; overflow: hidden;
  border: 2px dashed var(--line); background: var(--card); color: var(--muted); font-size: 1.1rem; width: 100%;
}
.photo img { width: 100%; height: 100%; object-fit: contain; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 48px; height: 48px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.swatch[aria-pressed="true"] { border-color: #fff; }
.icons { display: flex; gap: 8px; flex-wrap: wrap; }
.icons button { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-size: 1.6rem; }
.icons button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--card)); }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  z-index: 100; padding: 12px 20px; border-radius: 99px; background: #fff; color: #111; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.center { min-height: 60dvh; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; font-size: 1.1rem; }

@media (max-width: 600px) {
  .hero .pct { font-size: 2.6rem; }
  .grid { --cell: 150px; gap: 10px; }
  .grid.list { --cell: 100%; }
}
@media (min-width: 1100px) {
  .grid { --cell: 210px; }
  .grid.mini { --cell: 120px; }
}

/* ================= Spaß: Wackeln, Hüpfen, Feuerwerk, Party ================= */
[hidden] { display: none !important; }

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  25% { transform: rotate(3deg) translateY(-4%); }
  50% { transform: rotate(4deg) translateY(0); }
  75% { transform: rotate(-3deg) translateY(-3%); }
}
@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(-34px) scale(.9, 1.12) rotate(-8deg); }
  50% { transform: translateY(0) scale(1.15, .85); }
  70% { transform: translateY(-12px) rotate(8deg); }
  100% { transform: none; }
}
@keyframes dance {
  0% { transform: scale(1); }
  15% { transform: translateY(-14%) rotate(-12deg) scale(1.15); }
  30% { transform: translateY(0) rotate(10deg) scale(.92, 1.08); }
  45% { transform: translateY(-10%) rotate(-10deg) scale(1.1); }
  60% { transform: translateY(0) rotate(8deg); }
  80% { transform: rotate(-4deg); }
  100% { transform: none; }
}
@keyframes jelly {
  0% { transform: scale(1); }
  30% { transform: scale(1.25, .75); }
  50% { transform: scale(.85, 1.15); }
  70% { transform: scale(1.08, .94); }
  100% { transform: scale(1); }
}
@keyframes tumble {
  0% { opacity: 0; transform: translateY(40px) rotate(calc(var(--i, 0) * 1.5deg - 12deg)) scale(.6); }
  100% { opacity: 1; transform: none; }
}

.mosaic .cell.wig img { animation: wiggle var(--t, 1.6s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.card.enter { animation: tumble .5s cubic-bezier(.2, 1.4, .4, 1) backwards; animation-delay: calc(var(--i, 0) * 28ms); }
.pic.dance img { animation: dance .9s ease-in-out; }
.pic.jelly img { animation: jelly .5s; }
.pic:active img { transform: scale(.92); }

/* Figuren-Reihe im Kopf der Sammlung */
.hero .shelf { grid-column: 1 / -1; display: flex; gap: 12px; overflow-x: auto; padding: 14px 4px 6px; scrollbar-width: none; }
.hero .shelf::-webkit-scrollbar { display: none; }
.fig {
  flex: none; width: 70px; height: 70px; padding: 0; overflow: hidden; border-radius: 50%; border: 3px solid #fff;
  background: radial-gradient(circle at 50% 30%, #f4f5f8, #cdd1d9); box-shadow: 0 4px 12px #0006;
}
.fig img { width: 100%; height: 100%; object-fit: contain; padding: 8%; animation: wiggle var(--t, 1.6s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.fig.hop { animation: hop .6s cubic-bezier(.3, 1.6, .5, 1); }

/* Jubel-Blasen und Feuerwerk liegen im Top-Layer (Popover), über allem */
#fx {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; margin: 0; padding: 0; border: 0;
  background: transparent; overflow: visible; pointer-events: none;
}
.cheer {
  position: fixed; inset: auto; left: var(--x); top: var(--y); width: max-content; height: auto; margin: 0; padding: 8px 18px;
  border: 0; overflow: visible; background: var(--c); color: #111; font: 800 1.6rem/1 system-ui, sans-serif;
  border-radius: 99px; box-shadow: 0 6px 20px #0006; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--r)); animation: cheer 1.1s ease-out forwards;
}
@keyframes cheer {
  0% { transform: translate(-50%, -30%) scale(.3) rotate(var(--r)); opacity: 0; }
  20% { transform: translate(-50%, -90%) scale(1.25) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(-50%, -260%) scale(1) rotate(var(--r)); opacity: 0; }
}

.trophy { font-size: 5rem; text-align: center; line-height: 1; animation: hop 1s infinite; }
.center-text { text-align: center; }

/* PDF-Dialog */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; text-align: left;
  border-radius: 16px; border: 2px solid var(--line); background: var(--card);
}
.opt span { color: var(--muted); font-size: .9rem; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); }

/* Tanzparty */
.party {
  position: fixed; inset: 0; z-index: 150; overflow: hidden; opacity: 0; transition: opacity .3s; touch-action: none;
  background: radial-gradient(circle at 50% 120%, #3a1b6e, #150f2e 60%, #0a0818);
}
.party.on { opacity: 1; }
.party::before {
  content: ""; position: absolute; inset: -50%; filter: blur(50px); animation: spin 14s linear infinite;
  background: conic-gradient(from 0deg, #ff5d7a33, #ffd21f33, #4cc35b33, #4aa8ff33, #b06bff33, #ff5d7a33);
}
@keyframes spin { to { transform: rotate(360deg); } }
.beams { position: absolute; inset: 0; pointer-events: none; }
.beam {
  position: absolute; top: -10%; left: calc(var(--i) * 26% + 2%); width: 40%; height: 130%; mix-blend-mode: screen;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), transparent 75%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); transform-origin: 50% 0;
  animation: sweep 4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -1.1s);
}
@keyframes sweep { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28px; opacity: .8;
  background: repeating-conic-gradient(#ffffff2e 0 25%, #ffffff0a 0 50%) 0 0 / 56px 56px;
}
.stage { position: absolute; inset: 0; }
.sprite {
  position: absolute; left: 0; top: 0; will-change: transform; transform-origin: 50% 100%; touch-action: none; overflow: hidden;
  border-radius: 20%; border: 3px solid #fff; box-shadow: 0 8px 20px #0008;
  background: radial-gradient(circle at 50% 30%, #fff, #d9dce3);
}
.sprite img { width: 100%; height: 100%; object-fit: contain; padding: 6%; pointer-events: none; }
.party-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 12px 16px;
}
.party-title { flex: 1; font-size: 1.4rem; font-weight: 800; color: #fff; text-shadow: 0 2px 10px #000a; }
.party-label {
  position: absolute; left: 50%; bottom: 84px; padding: 10px 22px; border-radius: 99px; background: #fff; color: #111;
  font-weight: 800; font-size: 1.3rem; opacity: 0; pointer-events: none; transform: translateX(-50%);
}
.party-label.show { animation: label 1.5s ease-out; }
@keyframes label {
  0% { opacity: 0; transform: translateX(-50%) scale(.5); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.1); }
  80% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}
.party.intro { background: rgba(10, 8, 24, .8); }
.party.intro::before, .party.intro .beams, .party.intro .floor { display: none; }

@media (prefers-reduced-motion: reduce) {
  .mosaic .cell.wig img, .fig img, .card.enter, .pic.dance img, .pic.jelly img, .trophy { animation: none !important; }
}

/* Freigestellte Figuren: ohne Karte, mit Schatten */
.sprite.cut { background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; filter: drop-shadow(0 8px 10px #000a); }
.sprite.cut img { padding: 0; }

/* Spiel-Banner auf der Startseite */
.play-banner {
  grid-column: 1 / -1; position: relative; display: flex; align-items: center; gap: 18px; min-height: 140px;
  padding: 16px 22px; border-radius: 26px; border: 0; overflow: hidden; text-align: left; color: #fff;
  background: linear-gradient(120deg, #6a2cff, #ff3d8b 55%, #ffb21f);
  box-shadow: 0 10px 30px #6a2cff55, inset 0 0 0 2px #ffffff30;
}
.play-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, #ffffff14 0 22px, transparent 22px 60px);
  animation: stripes 3s linear infinite;
}
@keyframes stripes { to { background-position: 120px 0; } }
.play-banner:active { transform: scale(.98); }
.pb-figs { position: relative; flex: none; display: flex; align-items: flex-end; height: 110px; }
.pb-figs img { height: 100px; width: 80px; object-fit: contain; margin-right: -22px; animation: bounce .9s ease-in-out infinite alternate; animation-delay: var(--d); filter: drop-shadow(0 6px 6px #0007); }
.pb-figs img.card { width: 70px; height: 70px; border-radius: 16px; border: 3px solid #fff; background: #fff; margin-right: 6px; }
@keyframes bounce { from { transform: translateY(6px) rotate(-6deg); } to { transform: translateY(-14px) rotate(6deg); } }
.pb-text { position: relative; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pb-text b { font-size: 2rem; font-weight: 900; letter-spacing: .01em; text-shadow: 0 3px 0 #0004; }
.pb-text span { font-size: 1.05rem; opacity: .92; }
.pb-go {
  position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%;
  background: #fff; color: #ff3d8b; font-size: 1.8rem; box-shadow: 0 6px 18px #0005; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.12); } }
@media (max-width: 600px) {
  .pb-figs img { height: 70px; width: 56px; }
  .pb-text b { font-size: 1.5rem; }
}

/* Knöpfe im Kopf einer Sammlung */
.hero-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn.big { min-height: 56px; padding: 0 22px; font-size: 1.15rem; font-weight: 800; border-radius: 18px; }
.btn.big.play { background: linear-gradient(120deg, #6a2cff, #ff3d8b); border: 0; color: #fff; box-shadow: 0 6px 18px #ff3d8b55; }

.check { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: .9rem; }
.check b { color: var(--text); font-size: 1rem; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .play-banner::before, .pb-figs img, .pb-go { animation: none !important; }
}

/* ================= Spiel: Figuren-Blitz ================= */
.game {
  position: fixed; inset: 0; z-index: 160; overflow: hidden; background: #0c0822; opacity: 0; transition: opacity .25s;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.game.on { opacity: 1; }
.g-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

.g-hud {
  position: absolute; left: 0; right: 0; top: 0; display: none; align-items: flex-start; gap: 12px; pointer-events: none;
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left));
  color: #fff; text-shadow: 0 2px 6px #000a;
}
.game.playing .g-hud { display: flex; }
.g-left { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.g-score b { font-size: 2.6rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.g-best { font-size: .85rem; opacity: .8; font-weight: 700; }
.g-fever { width: 170px; height: 12px; border-radius: 99px; background: #ffffff26; overflow: hidden; box-shadow: inset 0 0 0 2px #ffffff30; }
.g-fever i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ff5d7a, #ffd21f, #4cc35b, #4aa8ff, #b06bff); transition: width .15s; }
.g-fever.on { animation: pulse .5s infinite; }
.g-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-wave { font-weight: 900; font-size: 1.2rem; opacity: .9; }
.g-combo { font-weight: 900; font-size: 1.6rem; color: #5fd4ff; min-height: 1.6em; }
.g-combo.bump { animation: jelly .35s; }
.g-right { display: flex; align-items: center; gap: 10px; }
.g-hearts { font-size: 1.6rem; letter-spacing: 2px; }
.g-hearts.hurt { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.g-icon {
  pointer-events: auto; width: 52px; height: 52px; border-radius: 16px; border: 2px solid #ffffff40; background: #ffffff1f;
  color: #fff; font-size: 1.4rem; display: grid; place-items: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.g-screens { position: absolute; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px; }
.g-screens[hidden] { display: none; }
.g-card {
  position: relative; width: min(620px, 100%); padding: 26px 26px 22px; border-radius: 32px; text-align: center; color: #fff;
  background: linear-gradient(160deg, #2b1663ee, #160b33ee); box-shadow: 0 30px 80px #000a, inset 0 0 0 2px #ffffff22;
  display: flex; flex-direction: column; align-items: center; gap: 14px; animation: card-in .45s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes card-in { from { transform: scale(.7) translateY(40px); opacity: 0; } }
.g-corner { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.g-title { margin: 6px 0 0; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; letter-spacing: .01em; line-height: 1.05;
  background: linear-gradient(90deg, #ffd21f, #ff5dd2, #5fd4ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #0006); }
.g-title span { display: inline-block; color: #ffd21f; animation: hop 1.2s infinite; }
.g-sub { margin: -6px 0 0; color: #c9b8ff; font-weight: 700; }
.g-muted { color: #b9a9e6; font-size: .9rem; }
.g-parade { display: flex; justify-content: center; align-items: flex-end; min-height: 110px; padding-top: 6px; }
.g-parade img { height: 100px; width: 80px; object-fit: contain; margin: 0 -6px; animation: bounce .7s ease-in-out infinite alternate; animation-delay: var(--d); filter: drop-shadow(0 8px 6px #000a); }
.g-parade img.card { width: 74px; height: 74px; border-radius: 16px; border: 3px solid #fff; background: #fff; margin: 0 4px; }
.g-howto { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.g-howto li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #ffffff12; text-align: left; font-weight: 700; font-size: .95rem; }
.g-howto li span { font-size: 1.5rem; flex: none; }
.g-btn {
  min-height: 56px; padding: 0 28px; border-radius: 18px; border: 2px solid #ffffff40; background: #ffffff1a; color: #fff;
  font-size: 1.15rem; font-weight: 800;
}
.g-btn:active, .g-icon:active { transform: scale(.95); }
.g-go {
  min-height: 74px; min-width: 240px; font-size: 2rem; font-weight: 900; border: 0; color: #2a0f45;
  background: linear-gradient(180deg, #ffe45c, #ffb21f); box-shadow: 0 8px 0 #c46d00, 0 14px 30px #ffb21f66; animation: pulse 1.1s infinite;
}
.g-go:active { transform: translateY(6px); box-shadow: 0 2px 0 #c46d00; }
.g-best-box { width: 100%; }
.g-best-box h3 { margin: 4px 0 8px; font-size: 1.1rem; }
.g-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.g-top li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 14px; background: #ffffff10; }
.g-top li b { font-size: 1.2rem; flex: 1; text-align: left; font-variant-numeric: tabular-nums; }
.g-top li.me { background: linear-gradient(90deg, #ffd21f55, #ff5dd255); box-shadow: inset 0 0 0 2px #ffd21f; }
.g-rank { width: 2em; font-size: 1.2rem; }
.g-top-wrap { width: 100%; }
.g-loading { flex-direction: row; justify-content: center; font-weight: 800; font-size: 1.2rem; }
.g-spin { width: 28px; height: 28px; border-radius: 50%; border: 4px solid #ffffff30; border-top-color: #ffd21f; animation: spin .8s linear infinite; }
.g-pause h2 { margin: 0; font-size: 2.4rem; }

.g-stars { display: flex; gap: 10px; font-size: 3.6rem; line-height: 1; }
.g-stars span { color: #ffffff30; animation: star-in .5s cubic-bezier(.2, 1.8, .4, 1) backwards; animation-delay: calc(.3s + var(--i) * .25s); }
.g-stars span.on { color: #ffd21f; text-shadow: 0 0 20px #ffd21f99; }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } }
.g-final { font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 6px 0 #0005; }
.g-final.pop { animation: jelly .5s; }
.g-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.g-stats div { display: flex; flex-direction: column; padding: 10px 4px; border-radius: 16px; background: #ffffff12; font-size: .8rem; color: #c9b8ff; font-weight: 700; }
.g-stats b { font-size: 1.6rem; color: #fff; }
.g-mvp { display: flex; align-items: center; gap: 4px; padding-right: 16px; border-radius: 20px; background: #ffffff10; font-weight: 700; }
.g-mvp .g-parade { min-height: 80px; }
.g-mvp .g-parade img { height: 76px; width: 64px; }
.g-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 600px) {
  .g-howto { grid-template-columns: 1fr; }
  .g-stats { grid-template-columns: repeat(2, 1fr); }
  .g-score b { font-size: 2rem; }
  .g-fever { width: 120px; }
}
.g-life { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.g-miss { display: flex; gap: 5px; }
.g-miss i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff30; }
.g-miss i.on { background: #ff5d7a; box-shadow: 0 0 8px #ff5d7a; }
.g-menu { padding-top: 70px; }

/* Anmeldung */
.login { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 28px; background: var(--bg2); box-shadow: 0 20px 60px #0008; text-align: left; color: var(--text); }
.login h1 { text-align: center; font-size: 1.8rem; font-weight: 900; }
.login .meta { text-align: center; color: var(--muted); }
.login-logo { text-align: center; font-size: 4rem; line-height: 1; animation: hop 1.4s infinite; }
.login .field input { height: 56px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 1.2rem; outline: none; }
.login .field input:focus { border-color: var(--accent); }
.login-err { min-height: 1.2em; color: var(--want); font-weight: 700; text-align: center; }
.login .btn.big { width: 100%; }
