/* Lehrerkarten: Aufbau und Funktion für alle Demos. Das Motto setzt nur die --lk-* Farben und Schriften
   und darf einzelne Teile (Pack, Kartenrückseite) zusätzlich gestalten. */
:root {
  --lk-font-display: inherit;
  --lk-font-body: inherit;
  --lk-display-weight: 700; /* 400 bei Schriften, die nur einen Schnitt haben */
  --lk-fg: #1d1d1f;
  --lk-muted: #6b6b72;
  --lk-bg: #f6f5f2;          /* Hintergrund der Vollbild-Übersicht */
  --lk-surface: #ffffff;     /* Suchfeld, Chips, Teaser */
  --lk-line: rgba(0, 0, 0, .12);
  --lk-accent: #2f5bff;
  --lk-accent-fg: #ffffff;
  --lk-radius: 18px;
  --lk-card-radius: 14px;
  --lk-card-bg: #ffffff;
  --lk-card-fg: #1d1d1f;
  --lk-card-border: rgba(0, 0, 0, .1);
  --lk-back-bg: #1d1d1f;
  --lk-back-fg: #ffffff;
  --lk-pack-bg: linear-gradient(160deg, #2f5bff, #142a8a);
  --lk-pack-flap: #0f1f66;
  --lk-pack-fg: #ffffff;
  --lk-pack-seal: rgba(255, 255, 255, .6);
  --lk-common: #8a8f98;
  --lk-rare: #3b82f6;
  --lk-epic: #a855f7;
  --lk-legendary: #f59e0b;
  --lk-mythic: #ef4444;
}

/* Teaser mit Pack */
.lk-teaser { display: flex; align-items: center; gap: 22px; padding: 20px; border-radius: var(--lk-radius); background: var(--lk-surface); color: var(--lk-fg); border: 1px solid var(--lk-line); font-family: var(--lk-font-body); }
.lk-teaser h3 { margin: 0 0 4px; font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: 22px; line-height: 1.15; }
.lk-teaser p { margin: 0 0 12px; color: var(--lk-muted); font-size: 15px; line-height: 1.5; }
@media (max-width: 520px) { .lk-teaser { flex-direction: column; text-align: center; } }

.lk-pack { position: relative; flex: none; width: 92px; aspect-ratio: 5 / 7; padding: 0; border: 0; background: none; cursor: pointer; animation: lk-float 3.2s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.lk-pack-body { position: absolute; inset: 0; border-radius: 10px; background: var(--lk-pack-bg); color: var(--lk-pack-fg); display: grid; place-items: center; padding: 22px 6px 6px; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .18); overflow: hidden; }
.lk-pack-mark { font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: 13px; line-height: 1.05; text-align: center; letter-spacing: .02em; hyphens: manual; }
.lk-pack-flap { position: absolute; left: -2px; right: -2px; top: -3px; height: 18%; z-index: 2; border-radius: 10px 10px 3px 3px; background: var(--lk-pack-flap); border-bottom: 2px dashed var(--lk-pack-seal); transform-origin: top left; }
.lk-pack:focus-visible { outline: 3px solid var(--lk-accent); outline-offset: 4px; border-radius: 12px; }
.lk-pack.lk-opening { animation: lk-shake .5s ease; }
.lk-pack.lk-opening .lk-pack-flap { transition: transform .45s ease .2s, opacity .3s ease .45s; transform: translateY(-16px) rotate(-22deg); opacity: 0; }
@keyframes lk-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes lk-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg) scale(1.05); } 40% { transform: rotate(6deg) scale(1.05); } 60% { transform: rotate(-4deg) scale(1.08); } 80% { transform: rotate(3deg) scale(1.08); } }

.lk-btn { min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--lk-accent); background: var(--lk-accent); color: var(--lk-accent-fg); font: inherit; font-weight: 700; cursor: pointer; }
.lk-btn.ghost { background: transparent; color: var(--lk-fg); border-color: var(--lk-line); }
.lk-btn:focus-visible, .lk-x:focus-visible, .lk-chips button:focus-visible, .lk-card:focus-visible { outline: 3px solid var(--lk-accent); outline-offset: 2px; }

/* Vollbild-Übersicht */
html.lk-lock { overflow: hidden; }
.lk-overview { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--lk-bg); color: var(--lk-fg); font-family: var(--lk-font-body); }
.lk-overview[open] { display: flex; flex-direction: column; animation: lk-in .3s cubic-bezier(.2, .8, .2, 1); }
.lk-overview::backdrop { background: rgba(0, 0, 0, .5); }
@keyframes lk-in { from { opacity: 0; transform: scale(.97); } }
.lk-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: max(18px, env(safe-area-inset-top)) 20px 12px; border-bottom: 1px solid var(--lk-line); }
.lk-head > div { flex: 1; min-width: 0; }
.lk-head h2 { margin: 0; font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: clamp(24px, 6vw, 34px); line-height: 1.1; }
.lk-head p { margin: 4px 0 0; color: var(--lk-muted); font-size: 14px; }
.lk-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-fg); font-size: 26px; line-height: 1; cursor: pointer; }
.lk-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 20px max(28px, calc(env(safe-area-inset-bottom) + 16px)); }
@media (min-width: 900px) { .lk-head, .lk-body { padding-left: max(28px, calc((100vw - 1100px) / 2)); padding-right: max(28px, calc((100vw - 1100px) / 2)); } }
.lk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lk-search input { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-fg); font: inherit; font-size: 16px; }
.lk-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 6px; }
.lk-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; max-width: calc(100% + 40px); }
.lk-chips::-webkit-scrollbar { display: none; }
.lk-chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-fg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lk-chips button[aria-pressed="true"] { background: var(--lk-fg); color: var(--lk-bg); border-color: var(--lk-fg); }
.lk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.lk-select select { min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-fg); font: inherit; font-size: 16px; }
.lk-count { margin: 4px 0 12px; color: var(--lk-muted); font-size: 14px; }
.lk-empty { text-align: center; color: var(--lk-muted); padding: 32px 0; }
.lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: 14px; }
@media (min-width: 900px) { .lk-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.lk-grid.lk-deal .lk-card { animation: lk-deal .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes lk-deal { from { opacity: 0; transform: translateY(28px) scale(.88) rotate(-4deg); } }

/* Seltenheitsfarben */
.lk-common { --rc: var(--lk-common); }
.lk-rare { --rc: var(--lk-rare); }
.lk-epic { --rc: var(--lk-epic); }
.lk-legendary { --rc: var(--lk-legendary); }
.lk-mythic { --rc: var(--lk-mythic); }

/* Karte (Vorderseite) */
.lk-card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--lk-card-radius); transition: transform .2s; }
.lk-card:hover { transform: translateY(-3px); }
.lk-card.lk-soon { cursor: default; opacity: .7; }
.lk-card.lk-soon:hover { transform: none; }
.lk-face { position: relative; display: flex; flex-direction: column; aspect-ratio: 5 / 7; padding: 10px; border-radius: var(--lk-card-radius); overflow: hidden; }
.lk-front { background: var(--lk-card-bg); color: var(--lk-card-fg); border: 1px solid var(--lk-card-border); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 55%, transparent), 0 14px 28px -16px rgba(0, 0, 0, .5); font-family: var(--lk-font-body); }
.lk-rarity { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: var(--rc); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lk-art { flex: 1; display: grid; place-items: center; margin: 8px 0; border-radius: calc(var(--lk-card-radius) - 6px); background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--rc) 45%, #fff), color-mix(in srgb, var(--rc) 85%, #000)); }
.lk-art span { font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: clamp(34px, 9vw, 52px); line-height: 1; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.lk-name { font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: 16px; line-height: 1.15; }
.lk-fach { font-size: 13px; opacity: .7; margin-top: 2px; }
.lk-soon .lk-art { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rc) 70%, #000) 0 10px, color-mix(in srgb, var(--rc) 50%, #000) 10px 20px); }

/* Detail: große Karte zum Umdrehen */
.lk-detail { border: 0; padding: 0; background: transparent; overflow: visible; max-width: 100vw; }
.lk-detail::backdrop { background: rgba(0, 0, 0, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lk-detail[open] { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lk-flip { width: min(72vw, 320px); padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; font-family: var(--lk-font-body); }
.lk-inner { position: relative; display: block; transition: transform .6s cubic-bezier(.3, .9, .3, 1); transform-style: preserve-3d; }
.lk-flip.lk-flipped .lk-inner { transform: rotateY(180deg); }
.lk-inner .lk-face { -webkit-backface-visibility: hidden; backface-visibility: hidden; padding: 16px; }
.lk-inner .lk-front .lk-name { font-size: 24px; }
.lk-inner .lk-front .lk-fach { font-size: 15px; }
.lk-inner .lk-front .lk-art span { font-size: 84px; }
.lk-inner .lk-back { position: absolute; inset: 0; transform: rotateY(180deg); background: var(--lk-back-bg); color: var(--lk-back-fg); gap: 14px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 70%, transparent); text-align: left; }
.lk-back-top b { display: block; font-family: var(--lk-font-display); font-weight: var(--lk-display-weight); font-size: 24px; line-height: 1.1; }
.lk-back-top small, .lk-stat small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-bottom: 2px; }
.lk-stat { font-size: 16px; line-height: 1.4; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--lk-back-fg) 20%, transparent); }
.lk-note { margin-top: auto; font-size: 11px; opacity: .6; }
.lk-actions { display: flex; gap: 10px; }
.lk-actions .lk-btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }

@media (prefers-reduced-motion: reduce) {
  .lk-pack, .lk-pack.lk-opening, .lk-grid.lk-deal .lk-card, .lk-overview[open] { animation: none; }
  .lk-pack.lk-opening .lk-pack-flap, .lk-inner, .lk-card { transition: none; }
}
