/* =========================================================================
   Quartett - Stylesheet
   Mobil zuerst; ab 720px breitet sich das Spielfeld auf zwei Spalten aus.
   ========================================================================= */

:root {
  --bg:        #0e1017;
  --bg-soft:   #171a25;
  --panel:     #1c2030;
  --panel-2:   #232839;
  --line:      #2e3448;
  --text:      #e8ecf5;
  --muted:     #98a1b8;
  --accent:    #f0b429;
  --accent-2:  #ffd66b;
  --win:       #3ecf8e;
  --lose:      #ef5f6b;
  --tie:       #7f8bab;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
  --tap:       44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ein gesetztes display: in einer Klassenregel wuerde das hidden-Attribut
   sonst aushebeln - deshalb hier einmal verbindlich. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  background-image:
    radial-gradient(1100px 620px at 50% -12%, #232a44 0%, transparent 62%),
    radial-gradient(700px 500px at 92% 108%, #1d2740 0%, transparent 60%);
  background-attachment: fixed;
}

/* --------------------------------- Views -------------------------------- */

.view { display: none; height: 100dvh; flex-direction: column; }
.view.active { display: flex; }

.scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 24px;
}
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }

.topbar, .matchbar, .actionbar, .statusbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(14,16,23,.82);
  backdrop-filter: blur(12px);
}
.topbar  { border-bottom: 1px solid var(--line); padding-top: max(10px, env(safe-area-inset-top)); }
.actionbar, .statusbar {
  border-top: 1px solid var(--line);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .2px; margin-right: auto; }

/* Das Wortzeichen stoesst in der Datei bis an den Rand - der Abstand hier
   verschafft ihm den fehlenden Luftraum, ohne die Vorlage anzufassen. */
.brand-logo { display: flex; align-items: center; padding: 0 4px; }
.brand-logo img { height: 19px; width: auto; display: block; }
.topbar .chip:first-child + .brand { margin-right: 0; margin-left: auto; }

/* Der Weg ins Spiel ist von jeder Ansicht aus einen Griff entfernt. */
.btn.go-play {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 999px;
}

/* Auf schmalen Geraeten weichen erst der Name, dann das Wort im Titel -
   der Spielen-Knopf bleibt in jedem Fall stehen. */
@media (max-width: 560px) {
  .topbar .name-chip { display: none; }
}
@media (max-width: 470px) {
  .topbar .brand-word { display: none; }
  .topbar .chip { padding: 0 9px; font-size: 12.5px; }
  .brand-logo img { height: 16px; }
}

/* Fassungsangabe: da, wenn man sie sucht, sonst unauffaellig. */
.fassung {
  margin: 22px auto 4px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: .5;
  font-variant-numeric: tabular-nums;
  user-select: text;
}

/* ------------------------------- Bausteine ------------------------------ */

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
}
.scroller > .panel:not(.stake) { margin-left: auto; margin-right: auto; }
.panel h2 { font-size: 17px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 14px; }
.hint  { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 12px; }

.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s, filter .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #241a02; }
.btn.ghost   { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.danger  { color: var(--lose); border-color: #4a2730; }
.btn.wide    { width: 100%; margin-top: 10px; }
.actionbar .btn { flex: 1; padding: 0 10px; white-space: nowrap; }
.actionbar .btn.primary { flex: 1.4; }

.chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.danger { color: var(--lose); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #241a02; font-weight: 600; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------- Sammlung ------------------------------- */

.intro p { margin-bottom: 12px; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; }
.tally span {
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid currentColor;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 10px;
  max-width: 1080px;
  margin: 0 auto;
}

/* -------------------------------- Karte --------------------------------- */
/* Die Aufmachung staffelt sich ueber --stufe (Rang der Seltenheit, 0..n).
   Hoehere Stufen bekommen mehr Leuchten, Strahlen und Glanz - ohne dass
   irgendwo ein Seltenheitsname im Stylesheet steht. */

.card {
  --art-h: 86px;
  --wucht: max(0, calc(var(--stufe) - 1));       /* erst ab Episch sichtbar */
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(168deg, #1d2233, #12151f);
  border: 1px solid color-mix(in srgb, var(--rar) calc(28% + var(--stufe) * 18%), var(--line));
  border-radius: 13px;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow:
    0 2px 10px rgba(0,0,0,.4),
    0 0 calc(var(--wucht) * 14px) color-mix(in srgb, var(--rar) 45%, transparent);
  transition: transform .12s, box-shadow .18s;
}
button.card { cursor: pointer; }
button.card:active { transform: scale(.98); }

/* ---- Bildflaeche ---- */

.card-art {
  position: relative;
  height: var(--art-h);
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 118%,
      color-mix(in srgb, var(--rar) calc(20% + var(--stufe) * 14%), transparent) 0%,
      transparent 70%),
    linear-gradient(180deg, #232a3d, #171b28);
  border-bottom: 1px solid color-mix(in srgb, var(--rar) 35%, var(--line));
}

/* Strahlenkranz - nur bei den hohen Stufen zu sehen */
.card-rays {
  position: absolute;
  inset: -40% -10%;
  background: repeating-conic-gradient(from 0deg at 50% 100%,
    color-mix(in srgb, var(--rar) 55%, transparent) 0deg 5deg,
    transparent 5deg 14deg);
  opacity: calc(var(--wucht) * .18);
  pointer-events: none;
}

/* Illustration: fuellt die Flaeche, der Zuschnitt passt sich dem Ort an.
   Der Schwerpunkt liegt etwas ueber der Mitte - dort sitzt bei Kreaturen
   ueblicherweise der Kopf, und genau der soll auch im flachsten Zuschnitt
   der Partieansicht stehen bleiben. */
.card-bild {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}

/* Verlauf zum Namensschild hin, damit der Uebergang nicht hart bricht
   und die Seltenheitsplakette auf jedem Motiv lesbar bleibt. */
.card-schleier {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,12,18,.55) 0%, transparent 32%),
    linear-gradient(0deg, rgba(10,12,18,.75) 0%, transparent 45%);
  pointer-events: none;
}

.card.gemalt .card-art { background: #0f131d; }

.card-emoji {
  position: relative;
  font-size: calc(var(--art-h) * .52);
  line-height: 1;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.65));
}

/* ---- Namensschild ---- */

.card-plate {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px 7px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--rar) calc(9% + var(--stufe) * 5%), #1a1f2e), #161a26);
  border-bottom: 1px solid var(--line);
}
.card-name {
  align-self: stretch;
  font-size: 13.5px; font-weight: 800; letter-spacing: .1px; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-rar {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--rar);
  line-height: 1.1;
}


/* ---- Glanzstreifen ---- */

.card-sheen {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg,
    transparent 38%,
    rgba(255,255,255,.16) 47%,
    rgba(255,255,255,.03) 52%,
    transparent 60%);
  background-size: 260% 100%;
  background-position: 130% 0;
  opacity: calc(var(--wucht) * 1);
}
/* Der Streifen wandert nur dort, wo eine Karte im Mittelpunkt steht -
   40 laufende Animationen im Sammlungsraster waeren reine Unruhe. */
.card.showcase .card-sheen,
button.card:hover .card-sheen { animation: sheen 2.6s ease-in-out infinite; }
@keyframes sheen {
  0%   { background-position: 130% 0; }
  55%  { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}

/* ---- Zustaende ---- */

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(0,0,0,.5);
}
.card.selected::after {
  content: "✓";
  position: absolute; top: 6px; left: 7px; z-index: 4;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #241a02;
  font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}
.card-dupe {
  position: absolute; top: 6px; left: 7px; z-index: 4;
  background: rgba(10,12,18,.75); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; font-size: 11px; color: var(--text);
}
.card.selected .card-dupe { left: 33px; }

.card.showcase { --art-h: 128px; }
.card.showcase .card-name { font-size: 15px; }
.card.compact .card-plate { border-bottom: 0; }
.card.compact.showcase { --art-h: 104px; }
/* Ohne Werteliste ist Platz da: Namen duerfen umbrechen statt abzuschneiden. */
.card.compact .card-name {
  white-space: normal;
  overflow: visible;
  font-size: 12.5px;
  line-height: 1.2;
}


/* ---- Eigenschaften ---- */

.card-attrs { display: flex; flex-direction: column; }

.attr {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 12px;
  border: 0;
  border-bottom: 1px solid rgba(46,52,72,.5);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.attr:last-child { border-bottom: 0; }
.attr .k { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr .v { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.attr .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--rar) 26%, transparent),
    color-mix(in srgb, var(--rar) 5%, transparent));
  pointer-events: none;
}
.attr.low .fill {
  background: linear-gradient(90deg, rgba(127,139,171,.22), rgba(127,139,171,.05));
}

button.attr { cursor: pointer; min-height: 34px; }
button.attr:hover  { background: rgba(240,180,41,.10); }
button.attr:active { background: rgba(240,180,41,.20); }

.attr.chosen { background: rgba(240,180,41,.14); box-shadow: inset 3px 0 0 var(--accent); }
.attr.chosen .k { color: var(--accent-2); }
.attr.result-win  .v { color: var(--win); }
.attr.result-lose .v { color: var(--lose); }

/* ------------------------------- Deckbau -------------------------------- */

.stake { display: flex; align-items: center; gap: 18px; max-width: 460px; margin-inline: auto; }
.stake-count { text-align: center; line-height: 1.15; }
.stake-count strong { font-size: 30px; color: var(--accent); }
.stake-count span   { font-size: 18px; color: var(--muted); }
.stake-count small  { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.stake-risk { flex: 1; }
.risk-bar { height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.risk-bar i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--win), var(--accent) 55%, var(--lose));
  transition: width .3s ease; }
.stake-risk small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* -------------------------------- Lobby --------------------------------- */

.join-form { display: flex; gap: 10px; }
.code-input {
  flex: 1; min-width: 0;
  min-height: var(--tap);
  padding: 0 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: 700 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .28em;
  text-align: center;
  text-transform: uppercase;
}
.code-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.code-display {
  margin: 14px 0;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  font: 800 40px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .3em;
  text-indent: .3em;
  text-align: center;
  color: var(--accent-2);
}
.waiting { text-align: center; }

.mm-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 12px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mm-stats span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mm-stats strong {
  font-size: 19px; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.mm-stats small { font-size: 10.5px; color: var(--muted); }
.spinner {
  width: 26px; height: 26px; margin: 18px auto 8px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------- Partie -------------------------------- */

.view-match { overflow: hidden; }

/* Im Spiel muessen beim Aufdecken zwei volle Karten aufs Handy passen:
   kleinere Bildflaeche, engere Zeilen - antippbare Zeilen bleiben gross genug. */
/* Schmalere Karten und hoehere Bildflaeche: So liegt das Seitenverhaeltnis
   bei 2,58:1 statt 4,54:1 - eine Illustration ueberlebt diesen Zuschnitt,
   und zwei Karten passen weiterhin ohne Scrollen aufs Handy. */
.view-match .lane { max-width: 260px; }
.view-match .card { --art-h: 100px; }
/* Die verdeckte Karte soll wie eine Karte wirken, nicht wie ein Streifen. */
.view-match .card-back { min-height: 232px; font-size: 46px; }
.view-match .attr { padding: 4px 10px; }
.view-match button.attr { min-height: 36px; }

.matchbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
  font-size: 13px;
}
.side { display: flex; align-items: center; gap: 7px; min-width: 0; }
.side.meta { flex-direction: column; gap: 2px; color: var(--muted); font-size: 11px; }
.pname { color: var(--muted); max-width: 8ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilecount {
  min-width: 28px; padding: 3px 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; text-align: center; font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background .25s, color .25s;
}
.pilecount.bump { background: var(--accent); color: #241a02; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--win); }
.dot.off { background: var(--lose); }
.pot { color: var(--accent); font-weight: 700; }

.arena {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
  padding: 12px;
  align-content: center;
  align-items: start;
  justify-items: center;
}
.lane { width: 100%; max-width: 320px; display: flex; align-items: center; justify-content: center; }
.lane .card { width: 100%; }

.card-back {
  width: 100%; min-height: 150px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg, #1b2133 0 9px, #202741 9px 18px);
  display: grid; place-items: center;
  font-size: 30px; opacity: .85;
}

.verdict {
  max-width: 100%;
  text-align: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  border: 1px solid var(--line);
  background: var(--panel);
  animation: pop .25s ease-out;
}
.verdict.win  { color: var(--win);  border-color: var(--win); }
.verdict.lose { color: var(--lose); border-color: var(--lose); }
.verdict.tie  { color: var(--tie); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.statusbar { justify-content: space-between; }
.status { font-size: 14px; color: var(--muted); line-height: 1.3; }
.status.turn { color: var(--accent-2); font-weight: 600; }

.dealt { animation: dealt .3s ease-out; }
@keyframes dealt { from { transform: translateY(10px) scale(.96); opacity: 0; } }

/* ------------------------------ Anmeldung ------------------------------- */

.panel.auth { max-width: 380px; text-align: center; }
.auth-brand { margin: 2px 0 10px; padding: 0 6px; }
.auth-brand img { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.auth-claim { margin-bottom: 20px; }

.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  flex: 1; min-height: 38px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab.on { background: var(--panel-2); color: var(--text); box-shadow: var(--shadow); }

.stack { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.feld { display: flex; flex-direction: column; gap: 5px; }
.feld > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.feld input {
  min-height: var(--tap);
  padding: 0 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
}
.feld input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.uebernahme {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13.5px;
  cursor: pointer;
}
.uebernahme input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.hint.bad { color: var(--lose); }

/* -------------------------- Rangliste & Profil -------------------------- */

.chip.rating strong { color: var(--accent); }

.profile-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-elo {
  margin-left: auto;
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.table { display: flex; flex-direction: column; }
.table .row {
  display: grid;
  grid-template-columns: 2.2em 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(46,52,72,.6);
  font-size: 14px;
}
.table .row:last-child { border-bottom: 0; }
.table .row.self { background: rgba(240,180,41,.08); border-radius: 8px; }
.table .rank   { color: var(--muted); font-variant-numeric: tabular-nums; }
.table .who    { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .record { color: var(--muted); font-size: 12.5px; text-align: right; }
.table .elo    { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }
.table .elo.plus  { color: var(--win); }
.table .elo.minus { color: var(--lose); }
.table .row.sieg   .rank { color: var(--win); }
.table .row.pleite .rank { color: var(--lose); }

.logout { max-width: 460px; margin: 4px auto 20px; display: block; }

.matchbar .elo {
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --------------------------- Wertungsaenderung -------------------------- */

.elo-change {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.elo-change .elo-value {
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.elo-change .elo-delta { font-size: 15px; font-weight: 700; color: var(--muted); }
.elo-change.plus  .elo-delta { color: var(--win); }
.elo-change.minus .elo-delta { color: var(--lose); }
.elo-change small { color: var(--muted); font-size: 11px; }

/* ------------------------------ Kartenladen ----------------------------- */

.chip.coins strong { color: var(--accent-2); }

.panel.shop { max-width: 400px; text-align: center; }
.purse {
  font-size: 15px; color: var(--muted);
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.purse strong { font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }

.pack-offer { padding-top: 16px; }
.pack-visual {
  position: relative;
  height: 108px; width: 96px;
  margin: 0 auto 14px;
}
.pack-card {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #1b2133 0 9px, #202741 9px 18px);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}
.pack-card.c1 { transform: rotate(-3deg); }
.pack-card.c2 { transform: rotate(6deg) translate(7px, -5px); }
.pack-card.c3 { transform: rotate(14deg) translate(14px, -9px); }

.earn { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 7px; }
.earn li { font-size: 13.5px; color: var(--muted); padding-left: 16px; position: relative; }
.earn li::before { content: "·"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
.earn b { color: var(--accent-2); }

/* ---- Paketoeffnung ---- */

.pack-result { max-width: 620px; }
.pack-cards {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 16px 0 6px;
}
.pack-slot {
  width: 130px;
  animation: aufdecken .5s cubic-bezier(.2,.9,.3,1.2) backwards;
}
@keyframes aufdecken {
  from { opacity: 0; transform: rotateY(75deg) translateY(14px) scale(.9); }
  to   { opacity: 1; transform: none; }
}

/* ---- Karten-Einzelsicht ---- */

.card-detail { max-width: 300px; }
.detail-slot { display: flex; justify-content: center; margin-bottom: 14px; }
.detail-slot .card { width: 210px; }

.coin-gain { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--accent-2); }

/* ------------------------------- Overlays ------------------------------- */

.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  overflow-y: auto;                 /* lange Inhalte muessen erreichbar bleiben */
  padding: 20px;
  background: rgba(8,10,16,.82);
  backdrop-filter: blur(6px);
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.result-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.result-icon { font-size: 54px; line-height: 1; margin-bottom: 8px; animation: pop .35s ease-out; }
.result-card h2 { font-size: 24px; margin-bottom: 6px; }
.loot { margin-top: 18px; }
.loot .loot-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.loot .card { max-width: 190px; margin: 0 auto; animation: dealt .4s ease-out .15s backwards; }
.loot.gain .loot-label { color: var(--win); }
.loot.loss .loot-label { color: var(--lose); }

.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: pop .2s ease-out;
}
.toast.bad { border-color: var(--lose); color: var(--lose); }

/* ------------------------------ Ab Tablet ------------------------------- */

@media (min-width: 720px) {
  .arena {
    grid-template-rows: auto auto;
    grid-template-columns: 1fr 1fr;
    gap: 10px 26px;
    align-content: center;
    padding: 18px;
  }
  .lane-opp { grid-column: 1; grid-row: 1; }
  .lane-you { grid-column: 2; grid-row: 1; }
  .verdict  { grid-column: 1 / -1; grid-row: 2; }
  .lane { max-width: 300px; }
  .attr { font-size: 13px; padding: 7px 12px; }
  button.attr { min-height: 38px; }
  .pname { max-width: 16ch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
