/* Der Look ist selbst gebaut, nicht aus dem Spiel extrahiert. Nur die
   Kartenbilder stammen von Supercells CDN, über die URLs der offiziellen API.
   Leitidee: Tiefe statt flacher Flächen, kräftige Rahmen, klare Hierarchie. */
:root {
  --bg: #0b1026;
  --bg-glow: #2b3a8c;
  --panel: #182046;
  --panel-hi: #222c5c;
  --edge: #33407e;
  --edge-hi: #4a5aa8;
  --gold: #ffc23c;
  --gold-deep: #b87c12;
  --text: #f0f4ff;
  --muted: #939fcc;
  --good: #47d98a;
  --bad: #ff6b6b;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 10px 30px #00000060, 0 2px 0 #ffffff10 inset;
}

/* Markenschrift für den Nav-Brand -- selbst gehostet (Bungee, SIL Open Font
   License, siehe /fonts/OFL.txt), damit kein externer Google-Fonts-Request
   nötig ist. */
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/bungee-latin.woff2') format('woff2');
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -5%, #3a2b8c55, transparent 70%),
    radial-gradient(1100px 600px at 85% 0%, var(--bg-glow) -20%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--gold); }

/* ---- Kopfbereich ------------------------------------------------- */
.top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 20px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: center;
  gap: 12px;
}
.top-copy { text-align: left; }
h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff3cf 10%, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #00000050);
}
.sub { margin: 0 0 24px; max-width: 520px; color: var(--muted); font-size: 16px; }
.sub strong { color: var(--text); font-weight: 700; }

.lookup { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.lookup input {
  background: #0d1230;
  border: 2px solid var(--edge);
  border-radius: 14px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 13px 18px;
  width: min(240px, 68vw);
  text-transform: uppercase;
  box-shadow: 0 2px 12px #00000050 inset;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lookup input::placeholder { color: #5b68a0; font-weight: 600; }
.lookup input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px #ffc23c25, 0 2px 12px #00000050 inset;
}
.lookup button {
  background: linear-gradient(180deg, #ffd977, var(--gold) 45%, var(--gold-deep));
  border: none;
  border-radius: 14px;
  box-shadow: 0 5px 0 #7d5309, 0 8px 18px #00000055;
  color: #2b1d00;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  padding: 13px 26px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.lookup button:hover { filter: brightness(1.06); }
.lookup button:active { box-shadow: 0 1px 0 #7d5309; transform: translateY(4px); }
.lookup button[disabled] { opacity: 0.55; cursor: progress; }

.status { min-height: 22px; margin: 14px 0 0; color: var(--muted); }
.status.error { color: var(--bad); font-weight: 600; }

/* Kartenreihen, die im Hintergrund durchlaufen -- rein dekorativ, echte
   Bilder von Supercells CDN, zufällig aus dem geladenen Kartenindex gewählt.
   Jede Reihe läuft endlos in eine Richtung, abwechselnd rechts/links. */
.hero-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.hero-row { overflow: hidden; }
.hero-track {
  display: flex;
  gap: 6px;
  width: max-content;
  animation: hero-scroll-left var(--dur, 16s) linear infinite;
}
.hero-row.rev .hero-track { animation-name: hero-scroll-right; }
.hero-track img {
  display: block;
  width: 122px;
  height: 122px;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 8px 14px #00000070);
}
@keyframes hero-scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes hero-scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-track { animation: none; }
}
@media (max-width: 880px) {
  .top { grid-template-columns: 1fr; padding-top: 40px; }
  .top-copy {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-top: -175px;
  }
  .top-copy::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 24px;
    background: linear-gradient(180deg, #0b102670 0%, #0b1026ec 35%, var(--bg) 62%);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    mask-image: linear-gradient(180deg, transparent, black 22%);
    -webkit-mask-image: linear-gradient(180deg, transparent, black 22%);
  }
  .sub { margin-left: auto; margin-right: auto; }
  .lookup { justify-content: center; }
  .hero-visual { gap: 6px; order: -1; }
  .hero-track { gap: 4px; }
  .hero-track img { width: 84px; height: 84px; border-radius: 14px; }
}

main { max-width: 1120px; margin: 0 auto; padding: 0 20px 70px; }

/* ---- Profil & Filter --------------------------------------------- */
.profile { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 24px 0 20px; }
.chip {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14px;
  box-shadow: 0 2px 8px #00000040;
}
.chip b { color: var(--gold); font-weight: 800; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  gap: 14px 18px;
  background: linear-gradient(180deg, #ffffff08, transparent), var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.controls label {
  font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px;
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700;
}
.controls label.check {
  grid-column: 1 / -1;
  flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px;
}
.controls select {
  width: 100%;
  background: #0d1230; border: 1px solid var(--edge); border-radius: 10px;
  color: var(--text); padding: 8px 10px; font-size: 14px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.controls select:focus { outline: none; border-color: var(--gold); }
.controls input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; }

/* ---- Deck-Familie ------------------------------------------------- */
#decks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: 20px;
}
/* Überschriften und Hinweise sind Geschwister der Deck-Karten in #decks,
   sollen aber nicht als eigene Rasterzelle mitzählen -- volle Breite,
   eigene Zeile. */
#decks > h2,
#decks > .empty {
  grid-column: 1 / -1;
}
@media (max-width: 880px) {
  #decks { grid-template-columns: 1fr; }
}
.family {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel) 40%, #131a3c);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.18s, transform 0.18s;
}
#decks .family { margin-bottom: 0; }
.family:hover { border-color: var(--edge-hi); }

.family > header {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  padding: 14px 18px;
  background: linear-gradient(180deg, #ffffff0e, transparent);
  border-bottom: 1px solid #ffffff12;
}
.rank {
  font-size: 15px; font-weight: 900; color: #2b1d00;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: linear-gradient(180deg, #ffd977, var(--gold-deep));
  border-radius: 9px; box-shadow: 0 2px 0 #7d5309;
}
.arch { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.spacer { flex: 1; }

.stat, .winbar { display: flex; flex-direction: column; line-height: 1.15; min-width: 52px; }
.stat b, .winbar b { font-size: 18px; font-weight: 800; }
.stat i, .winbar i {
  font-style: normal; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.stat.best b { color: var(--gold); }
/* Kennzahlen duerfen nicht umbrechen -- sonst rutscht das Label unter den Wert
   und kollidiert mit dem Nachbarn. */
.stat i, .winbar i { white-space: nowrap; }

.winbar { min-width: 78px; }
.winbar.good b { color: var(--good); }
.winbar.bad b { color: var(--bad); }
.winbar .track { display: block; height: 4px; border-radius: 3px; background: #ffffff18; margin-top: 5px; overflow: hidden; }
.winbar .fill { display: block; height: 100%; width: var(--fill); border-radius: 3px; background: var(--good); }
.winbar.bad .fill { background: var(--bad); }

.flag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  border-radius: 7px; padding: 4px 8px; font-weight: 800; align-self: center;
}
.flag.weak { background: #5a1414; color: #ffb4b4; border: 1px solid #8c2020; }
.flag.unsure { background: #4d3208; color: #ffd98a; border: 1px solid #8a5c11; }

/* ---- Karten -------------------------------------------------------- */
.cards { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; }
.card { width: calc(12.5% - 9px); min-width: 68px; text-align: center; }
/* Kein eigener Rahmen: die Kartenbilder von Supercell haben schon einen. */
.card .frame {
  position: relative; border-radius: 10px;
  transition: transform 0.15s, filter 0.15s;
}
.card:hover .frame { transform: translateY(-4px); filter: drop-shadow(0 8px 14px #00000070); }
/* height:auto ist Pflicht: die HTML-Attribute width/height auf <img> (gegen
   Layout-Sprünge) setzen sonst eine feste Höhe, die aspect-ratio bei jeder
   von 150px abweichenden Breite ignoriert -- Karten liefen dadurch je nach
   Kartengröße viel zu hoch. */
.card img { width: 100%; height: auto; display: block; aspect-ratio: 302 / 363; object-fit: contain; }

.card .nm { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.2; font-weight: 600; }

.card.missing .frame { filter: grayscale(1) brightness(0.45); }
.card.missing .nm { color: var(--bad); }

/* ---- Details ------------------------------------------------------- */
.players { padding: 0 18px 12px; font-size: 13px; color: var(--muted); }
.players b { color: var(--text); font-weight: 700; }

.gaps {
  margin: 0 18px 14px; padding: 9px 12px; font-size: 13px;
  color: #ffc9c9; background: #ff6b6b14; border-left: 3px solid var(--bad); border-radius: 8px;
}

.actions { display: flex; gap: 10px; padding: 0 18px 18px; flex-wrap: wrap; }
.btn {
  background: linear-gradient(180deg, var(--panel-hi), #131a3c);
  border: 1px solid var(--edge); border-radius: 11px;
  color: var(--text); cursor: pointer; font-size: 14px; font-weight: 700;
  padding: 10px 16px; text-decoration: none; display: inline-block;
  transition: border-color 0.15s, transform 0.08s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(2px); }
.btn.primary {
  background: linear-gradient(180deg, #ffd977, var(--gold) 45%, var(--gold-deep));
  color: #2b1d00; border-color: transparent; box-shadow: 0 4px 0 #7d5309;
}
.btn.primary:active { box-shadow: 0 1px 0 #7d5309; transform: translateY(3px); }
.btn.copied { background: linear-gradient(180deg, #6ff0a8, #1f9e5c); color: #06280f; border-color: transparent; }

.variants { border-top: 1px solid #ffffff12; background: #00000030; }
.variant {
  padding: 11px 18px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid #ffffff08;
}
.variant:last-child { border-bottom: none; }
.variant-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.variant .btn { padding: 7px 12px; font-size: 13px; }
.variant .stat { min-width: 44px; }
.variant .stat b { font-size: 15px; }

/* Kartentausch als Bild: die verdraengte Karte ausgegraut links, ein Pfeil,
   die neue Karte rechts -- auf einen Blick erkennbar, ohne die Namen lesen
   zu muessen. */
.swapvisual { display: flex; flex-wrap: wrap; gap: 14px; }
.swappair { display: flex; align-items: center; gap: 6px; }
.swappair .card { width: 46px; }
.swap-arrow { color: var(--muted); font-size: 16px; font-weight: 700; }
.swap-out .frame { filter: grayscale(1) brightness(0.6); opacity: 0.75; }

/* ---- Abschnitte ---------------------------------------------------- */
h2 {
  font-size: 13px; margin: 38px 0 16px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.4px; font-weight: 800;
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--edge), transparent); }

.empty {
  color: var(--muted); background: var(--panel); border: 1px dashed var(--edge);
  border-radius: var(--radius); padding: 32px; text-align: center;
}

#advisor table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: var(--radius); overflow: hidden; font-size: 14px;
  box-shadow: var(--shadow);
}
#advisor td, #advisor th { padding: 11px 16px; border-bottom: 1px solid #ffffff10; text-align: left; }
#advisor th {
  color: var(--muted); font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.7px; background: #ffffff08;
}
#advisor tbody tr:last-child td { border-bottom: none; }
#advisor tbody tr:hover { background: #ffffff08; }
#advisor td:first-child { font-weight: 700; }

details#collection { margin-top: 34px; }
details#collection summary {
  cursor: pointer; color: var(--gold); font-weight: 700; padding: 10px 0;
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
}
#collectionGrid { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; }
#collectionGrid .card { width: 58px; min-width: 0; }

.foot { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; color: #6f7bab; font-size: 12px; text-align: center; }

@media (max-width: 620px) {
  .card { width: calc(25% - 8px); min-width: 0; }
  .family > header { gap: 12px; padding: 12px 14px; }
  .stat, .winbar { min-width: 44px; }
  .stat b, .winbar b { font-size: 16px; }
  .cards { padding: 14px; gap: 8px; }
  .controls { grid-template-columns: 1fr; }
}

/* ---- Statische Seiten (Decks, Archetypen, Karten) -------------------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.nav {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 16px 20px;
  font-size: 14px; font-weight: 700;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--gold); }
.nav .brand {
  font-family: 'Bungee', ui-sans-serif, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-right: auto;
  text-decoration: none;
  background: linear-gradient(180deg, #fff3cf 10%, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #00000050);
}
.nav .brand:hover { filter: drop-shadow(0 2px 0 #00000050) brightness(1.1); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }

.crumbs { font-size: 13px; color: var(--muted); margin: 10px 0 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.crumbs .sep { opacity: 0.5; margin: 0 2px; }

.wrap h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 900; letter-spacing: -0.8px; margin: 0 0 12px; }
.lede { font-size: 17px; color: var(--muted); max-width: 70ch; margin: 0 0 24px; }
.lede strong { color: var(--text); }

.top h1 .hl { color: var(--gold); }

.statrow { display: flex; flex-wrap: wrap; gap: 26px; list-style: none; padding: 18px 22px; margin: 0 0 22px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--edge);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.statrow li { display: flex; flex-direction: column; }
.statrow b { font-size: 24px; font-weight: 800; }
.statrow i { font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }

ul.cards { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 10px; }
ul.cards .card a { text-decoration: none; display: block; }
ul.cards.mini { gap: 5px; margin: 8px 0 0; }
ul.cards.mini .card { width: 46px; }
ul.cards.mini .nm { display: none; }

.rows {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: start;
}
@media (max-width: 880px) {
  .rows { grid-template-columns: 1fr; }
}
.row {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--edge);
  border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.row:hover { border-color: var(--edge-hi); }
.rowlink { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; text-decoration: none; }
.rowtitle { font-size: 17px; font-weight: 800; color: var(--text); }
.rowmeta { font-size: 13px; color: var(--muted); }
.row-open { align-self: flex-start; }

/* Feste Kachelgröße unabhängig von Titellänge oder Kartenzahl (1 oder 2):
   Bilder oben in fester Höhe, Titel auf zwei Zeilen gekappt statt frei zu
   wachsen -- sonst wird jede Kachel so hoch wie ihr längster Titel. */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles a {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px 12px 12px; text-decoration: none; color: var(--text); font-weight: 700;
}
.tiles a:hover { border-color: var(--gold); }
.tiles .art { display: flex; justify-content: center; gap: 4px; }
.tiles .art img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.tiles b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 14px; line-height: 1.3; min-height: 2.6em;
}
.tiles .count { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: auto; }

ul.plain, ul.players { list-style: none; padding: 0; margin: 0 0 22px; }
ul.plain li, ul.players li { padding: 8px 0; border-bottom: 1px solid #ffffff10; font-size: 14px; color: var(--muted); }
ul.plain a { font-weight: 700; text-decoration: none; }
ul.players b { color: var(--text); }
.note { color: var(--muted); font-size: 14px; }

.prose { max-width: 78ch; color: var(--muted); }
.prose h2 { font-size: 22px; color: var(--text); margin: 34px 0 12px; text-transform: none; letter-spacing: -0.3px; }
.prose h2::after { content: none; }
.prose h3 { font-size: 16px; color: var(--text); margin: 22px 0 6px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.65; }
.prose ol { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose code { background: #ffffff12; padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
.prose strong { color: var(--text); }

/* ---- Clan War -------------------------------------------------------- */
.modes { display: flex; gap: 8px; justify-content: center; margin: 0 0 22px; }
.modes button {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 999px;
  color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 700;
  padding: 10px 20px; transition: color 0.15s, border-color 0.15s;
}
.modes button:hover { color: var(--text); border-color: var(--edge-hi); }
.modes button.on {
  background: linear-gradient(180deg, #ffd977, var(--gold) 45%, var(--gold-deep));
  color: #2b1d00; border-color: transparent; box-shadow: 0 3px 0 #7d5309;
}

.warbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.warinfo { font-size: 14px; color: var(--muted); }
.warinfo b { color: var(--text); font-size: 16px; }
.warinfo b.warn { color: var(--warn, #fbbf24); }
.waractions { display: flex; gap: 8px; flex-wrap: wrap; }
.warhint { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; max-width: 76ch; }
.warhint strong { color: var(--text); }

/* Gesperrte Decks sichtbar vom Rest abheben -- sonst weiß man nach dem
   Würfeln nicht, was absichtlich stehen geblieben ist. */
.family.pinned { border-color: var(--gold); box-shadow: 0 0 0 1px #ffc23c40, var(--shadow); }
.btn.lock.on { background: linear-gradient(180deg, #ffd977, var(--gold-deep)); color: #2b1d00; border-color: transparent; }

.empty.slot { margin-bottom: 18px; }

/* ---- Levelstand ------------------------------------------------------ */
.card .lvl {
  position: absolute; left: 3px; bottom: 3px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.2px;
  border-radius: 6px; padding: 2px 5px;
  background: linear-gradient(180deg, #ffb457, #b45309); color: #2b1500;
  border: 1px solid #00000060; box-shadow: 0 2px 5px #00000070;
}
/* Untermaximale Karten leicht zurücknehmen -- sichtbar, aber nicht alarmierend
   wie eine fehlende Karte. */
.card.under .frame { filter: saturate(0.75) brightness(0.88); }
.card.under .nm { color: #ffca7a; }

.flag.lvls { font-weight: 700; letter-spacing: 0.3px; text-transform: none; font-size: 11px; }
.flag.lvls.max { background: #0f3d24; color: #7ff0b0; border: 1px solid #1c6b40; }
.flag.lvls.mixed { background: #4a2f08; color: #ffcf8a; border: 1px solid #7c5211; }
.flag.formgap {
  background: #4a2f08; color: #ffcf8a; border: 1px solid #7c5211;
  font-weight: 700; letter-spacing: 0.3px; text-transform: none; font-size: 11px;
}

/* Karte besessen, aber in der falschen Form -- eigene Markierung, unten
   rechts, damit sie nicht mit dem Level-Hinweis (unten links) kollidiert. */
.card .needform {
  position: absolute; right: 3px; bottom: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.2px;
  border-radius: 6px; padding: 2px 5px;
  background: linear-gradient(180deg, #ff9d5c, #b9490f); color: #2b1000;
  border: 1px solid #00000060; box-shadow: 0 2px 5px #00000070;
}
