:root {
  --hg: #f4f2fa;
  --box: #ffffff;
  --text: #1c1730;
  --leise: #6a6483;
  --rand: #e4dff0;
  --akzent: #b0179f;
  --akzent-2: #6a2bd9;
  --akzent-hell: #f6e8fb;
  --gut: #157a3c;
  --gut-hg: #e3f7ea;
  --schlecht: #b42323;
  --schlecht-hg: #fde8e8;
  --stern: #f2a516;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(28, 23, 48, .06), 0 4px 16px rgba(28, 23, 48, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--hg);
}
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
p { margin: 0 0 10px; }
button, input, select { font: inherit; color: inherit; }

/* Kopfzeile */
.kopf {
  background: linear-gradient(100deg, var(--akzent-2), var(--akzent));
  color: #fff;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 10px rgba(80, 20, 120, .25);
}
.kopf-innen {
  max-width: 980px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.marke { font-weight: 700; font-size: 18px; letter-spacing: .2px; white-space: nowrap; }
.marke-zeichen { display: inline-block; margin-right: 4px; }
.kopf-nutzer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kopf-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seite { max-width: 980px; margin: 0 auto; padding: 16px 16px 60px; }
.box {
  background: var(--box); border: 1px solid var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px; margin-bottom: 14px;
}

/* Formularteile */
.beschriftung { display: block; font-size: 13px; font-weight: 600; color: var(--leise); margin-bottom: 4px; }
.eingabe {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid #cfc8e2; border-radius: 10px; background: #fff;
}
.eingabe:focus { outline: 2px solid var(--akzent-2); outline-offset: 1px; border-color: transparent; }
select.eingabe { padding-right: 30px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; background: #ece8f6; color: var(--text);
  transition: filter .15s, background .15s;
}
.knopf:hover:not(:disabled) { filter: brightness(.96); }
.knopf:focus-visible { outline: 2px solid var(--akzent-2); outline-offset: 2px; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.haupt { background: linear-gradient(100deg, var(--akzent-2), var(--akzent)); color: #fff; }
.knopf.hell { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .35); }
.knopf.klein { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.knopf.rand { background: #fff; border-color: #cfc8e2; }
.knopf.gefahr { background: #fff; border-color: #efc4c4; color: var(--schlecht); }
.knopf.breit { width: 100%; margin-top: 14px; }

.fehlertext { color: var(--schlecht); font-weight: 600; min-height: 0; margin: 8px 0 0; }
.fehlertext:empty { display: none; }
.hinweis { color: var(--leise); font-size: 14px; }

/* Anmeldung */
.login { display: flex; justify-content: center; padding-top: 6vh; }
.login-box { width: 100%; max-width: 420px; padding: 26px; }
.login-box .hinweis { margin: 16px 0 0; }

/* Einstellungsleiste */
.leiste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin-bottom: 6px; }
.leiste-feld { min-width: 120px; }
.schalter { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; font-weight: 600; user-select: none; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter-bahn {
  width: 42px; height: 24px; border-radius: 12px; background: #d6d0e6; position: relative; transition: background .15s;
  flex: none;
}
.schalter-bahn::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.schalter input:checked + .schalter-bahn { background: var(--akzent); }
.schalter input:checked + .schalter-bahn::after { transform: translateX(18px); }
.schalter input:focus-visible + .schalter-bahn { outline: 2px solid var(--akzent-2); outline-offset: 2px; }

.slots { margin-left: auto; min-width: 190px; flex: 1 1 190px; max-width: 280px; }
.slots-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--leise); margin-bottom: 6px; }
.slots-text strong { color: var(--text); font-size: 16px; }
.slots-balken { height: 10px; background: #ece8f6; border-radius: 5px; overflow: hidden; }
.slots-balken div { height: 100%; width: 0; background: linear-gradient(90deg, var(--akzent-2), var(--akzent)); transition: width .25s; }
.slots.voll .slots-balken div { background: var(--schlecht); }
.slots.voll .slots-text strong { color: var(--schlecht); }
.faktoren { font-size: 13px; color: var(--leise); margin: 0 4px 14px; }

/* Reiter */
.reiter { display: flex; gap: 6px; margin-bottom: 14px; background: #e9e5f4; padding: 4px; border-radius: 12px; }
.reiter-knopf {
  flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--leise);
}
.reiter-knopf[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(28, 23, 48, .12); }
.reiter-knopf:focus-visible { outline: 2px solid var(--akzent-2); }

/* Suche */
.suche { position: relative; margin-bottom: 12px; }
.suche-feld { position: relative; }
.suche-feld::before {
  content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--leise); font-size: 20px; pointer-events: none;
}
.suche-feld .eingabe { padding-left: 36px; }
.treffer {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--rand); border-radius: 12px; box-shadow: 0 10px 30px rgba(28, 23, 48, .16);
  max-height: 360px; overflow-y: auto;
}
.treffer li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.treffer li.aktiv, .treffer li:hover { background: var(--akzent-hell); }
.treffer .keine { color: var(--leise); cursor: default; }
.treffer .keine:hover { background: transparent; }

.gewaehlt {
  display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--rand); border-radius: 12px; background: #faf8fe;
}
.gewaehlt .knopf { margin-left: auto; }

/* Kartendarstellung */
.bild { width: 40px; height: 57px; border-radius: 6px; object-fit: cover; background: #ece8f6; flex: none; }
.bild.gross { width: 64px; height: 92px; border-radius: 8px; }
.karten-info { min-width: 0; }
.karten-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karten-unter { font-size: 13px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treffer-wert { margin-left: auto; font-weight: 600; font-size: 14px; color: var(--leise); white-space: nowrap; }

.auswahl-zeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.auswahl-zeile .leiste-feld { flex: 1 1 140px; }
.vorschau-wert { margin: 10px 0 0; font-size: 14px; color: var(--leise); }
.vorschau-wert:empty { display: none; }
.vorschau-wert strong { color: var(--text); }

/* Base-Liste */
.titel-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.titel-zeile h2 { margin: 0; }
.summe { font-size: 14px; color: var(--leise); }
.summe strong { color: var(--text); }
.base-liste { list-style: none; margin: 8px 0 0; padding: 0; }
.base-eintrag {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 10px 4px; border-top: 1px solid var(--rand);
}
.base-eintrag:first-child { border-top: 0; }
.base-eintrag.schlechteste { background: #fff6f6; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.base-werte { text-align: right; font-size: 14px; white-space: nowrap; }
.base-werte .haupt-wert { font-weight: 700; font-size: 15px; }
.base-werte .sn { color: var(--leise); }
.base-aktionen { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.base-aktionen .eingabe { width: auto; min-height: 34px; padding: 4px 28px 4px 10px; font-size: 14px; }
.leer { color: var(--leise); text-align: center; padding: 18px 0 6px; margin: 0; }
.marke-klein {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 999px; vertical-align: 2px; margin-left: 6px;
  background: var(--schlecht-hg); color: var(--schlecht);
}

.marke-klein.gut { background: var(--gut-hg); color: var(--gut); }
.base-eintrag.lohnt { background: #f3fbf5; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.urteil-klein { border-radius: 10px; padding: 10px 14px; margin: 4px 0 8px; font-size: 14px; border: 1px solid transparent; }
.urteil-klein.ja { background: var(--gut-hg); border-color: #9fdcb5; color: var(--gut); }
.urteil-klein.nein { background: #fff; border-color: var(--rand); color: var(--leise); }
.urteil-klein strong { font-size: 16px; }
.leise { color: var(--leise); }

/* Abgleich aus dem Spiel / gezogene Karten */
.abgleich { font-size: 13px; color: var(--leise); margin: 0 0 4px; }
.abgleich strong { color: var(--text); }
.link-knopf {
  border: 0; background: none; padding: 0; color: var(--akzent-2); font-weight: 600; cursor: pointer; text-decoration: underline;
}
.link-knopf:focus-visible { outline: 2px solid var(--akzent-2); outline-offset: 2px; }
.pack-zahlen { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.pack-zahlen:empty { display: none; }
.pack-zahl { font-size: 13px; background: #f1edf9; color: var(--leise); padding: 3px 10px; border-radius: 999px; }
.pack-zahl strong { color: var(--text); }

.sterne { color: var(--stern); letter-spacing: 1px; font-size: 14px; white-space: nowrap; }
.sterne .aus { color: #d9d4e6; }
.mut {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  background: #ececf1; color: #474559; white-space: nowrap;
}
.mut-Shiny { background: #e0f1fd; color: #0f5f93; }
.mut-Gold { background: #fdf1cc; color: #8a5a00; }
.mut-Diamond { background: #d5f6fa; color: #0b6876; }
.mut-Kawaii { background: #fde4f1; color: #b0186b; }
.mut-Psycho { background: #efe3fd; color: #6c1eb8; }
.mut-Supernova { background: #ffe8d4; color: #b2410b; }
.mut-Illusion { background: linear-gradient(90deg, #fbd3ec, #d7dcff, #c9f3fb, #d4f7dc); color: #3f1a8a; }

/* Ergebnis */
.urteil {
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px; text-align: center; border: 2px solid transparent;
}
.urteil.ja { background: var(--gut-hg); border-color: #9fdcb5; color: var(--gut); }
.urteil.nein { background: var(--schlecht-hg); border-color: #f2b4b4; color: var(--schlecht); }
.urteil.neutral { background: #fff; border-color: var(--rand); color: var(--leise); }
.urteil-text { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.urteil-unter { margin: 6px 0 0; color: var(--text); }

.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.vergleich .box { margin: 0; }
.vergleich-titel { font-size: 13px; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.vergleich-karte { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.vergleich-wert { font-size: 22px; font-weight: 800; }
.vergleich-klein { font-size: 13px; color: var(--leise); }

.ab { font-size: 17px; }
.ab strong { font-size: 19px; }
.leiter { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.leiter th { text-align: left; font-size: 13px; color: var(--leise); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--rand); }
.leiter td { padding: 8px; border-bottom: 1px solid var(--rand); }
.leiter tr:last-child td { border-bottom: 0; }
.leiter .rechts { text-align: right; }
.leiter tr.jetzt td { background: #f4effd; font-weight: 700; }
.leiter tr.schwelle td:first-child { box-shadow: inset 3px 0 0 var(--gut); }
.ok { color: var(--gut); font-weight: 700; }
.nicht { color: var(--schlecht); font-weight: 700; }

/* Meldungen */
.meldung {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: #241d3b; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  max-width: calc(100% - 32px); font-weight: 600;
}
.meldung.fehler { background: var(--schlecht); }

@media (max-width: 640px) {
  .seite { padding: 12px 10px 60px; }
  .box { padding: 14px; }
  .marke { font-size: 16px; }
  .slots { margin-left: 0; max-width: none; }
  .vergleich { grid-template-columns: 1fr; }
  .urteil-text { font-size: 26px; }
  .base-eintrag { grid-template-columns: auto minmax(0, 1fr); }
  .base-werte { grid-column: 2; text-align: left; }
}
