/* =====================================================================
   Gemeinsame Seiten-Stile (Basar, Laboratorium, Scriptorium, Refugium, Grimoire): Seitenraster, Seitentitel,
   Level-Siegel, Kacheln, Element-Details. Das Refugium selbst steht in css/refugium.css.
   ===================================================================== */

.landing-main {
  width: min(1100px, 94vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin: 22px auto 24px;
}
.card.wide, .landing-main > .wide { grid-column: 1 / -1; }

.level-block {
  flex: 0 0 auto; position: relative;
  width: 112px; height: 112px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--seal-text);
  background: var(--wax);
  box-shadow:
    inset 0 0 0 4px color-mix(in srgb, var(--wine-lo) 90%, transparent),
    inset 0 0 0 6px color-mix(in srgb, var(--gold-hi) 60%, transparent),
    inset 0 -6px 12px color-mix(in srgb, var(--shade) 35%, transparent),
    0 6px 14px color-mix(in srgb, var(--wine-lo) 50%, transparent);
  line-height: 1; cursor: default;
  /* leicht unregelmäßiger Rand wie gegossenes Wachs */
  border-radius: 52% 48% 50% 50% / 49% 52% 48% 51%;
}
.level-num {
  font-family: var(--font-display); font-size: 2.9rem; font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  text-shadow: 0 2px 0 color-mix(in srgb, var(--shade) 45%, transparent);
}
.level-word { margin-top: 2px; font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 10px; }
.stat-grid.main-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.big-stat {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 10px 6px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.big-stat b {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--wine);
  font-variant-numeric: tabular-nums lining-nums;
}
.main-stats .big-stat b { font-size: 2.2rem; }
.big-stat span { color: var(--ink-2); font-size: 0.85rem; text-align: center; font-style: italic; }

/* Rechte Seite: Arena-Siegel und Schatzkammer */
.coins-balance { display: flex; align-items: center; gap: 10px; font-size: 2.3rem; margin: 0 0 12px; }
.coins-balance b {
  font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  background: var(--gold-leaf); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 color-mix(in srgb, var(--shade) 35%, transparent));
}
/* ===== Seitentitel auf dem Tisch (Shop, Labor, Balance) ===== */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--parch-2);
}
.landing-main > .page-head { grid-column: 1 / -1; }
.page-head h1 {
  margin: 0; display: flex; align-items: center; gap: 14px;
  font-family: var(--font-deco); font-size: clamp(1.4rem, 7.4vw, 2.1rem);   /* lange Titel („Laboratorium“) passen auch auf schmale Handys */
  min-width: 0; overflow-wrap: anywhere;
  background: var(--gold-leaf); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 color-mix(in srgb, var(--shade) 60%, transparent));
}
.page-head p { margin: 4px 0 0; color: var(--parch-3); font-style: italic; }
.page-icon { -webkit-text-fill-color: initial; color: initial; filter: none; }
.page-head .coins-balance {
  margin: 0; padding: 6px 18px; font-size: 1.9rem;
  background: var(--paper); border-radius: 999px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--shade) 45%, transparent), inset 0 0 0 3px var(--parch), inset 0 0 0 4px var(--gold), 0 8px 18px color-mix(in srgb, var(--shade) 40%, transparent);
}

/* ===== Element-Details (Grimoire-Elementseiten, Musterseite: Popup-Beispiel) ===== */
.dialog-head { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; padding-right: 40px; }
.dialog-head h2 { margin: 0; font-family: var(--font-deco); font-size: 2rem; }
/* .d-emoji: Element-Medaillon, siehe css/style.css */
.d-owned { display: block; margin-top: 2px; color: var(--wine); font-weight: 700; }


.d-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; }
.d-stat {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 8px;
  padding: 5px 2px; border-bottom: 1px dotted var(--line-strong);
}
.d-stat > b { margin-left: auto; }   /* große Schrift: Wert rutscht rechtsbündig unter die Bezeichnung (QA 83 B2) */
.d-stat b { white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.d-stat.fallback b { opacity: 0.5; font-style: italic; }
.d-stat-wide { grid-column: 1 / -1; flex-wrap: wrap; }   /* große Schrift: Marken rutschen unter die Bezeichnung (QA 83 B1) */
.d-stat-wide .chips { margin-top: 0; margin-left: auto; min-width: 0; justify-content: flex-end; }
.d-stat-label { color: var(--ink-2); white-space: nowrap; }
.d-stat-value { display: flex; flex-direction: column; align-items: flex-end; }
.d-stat-sub { font-size: 0.75rem; font-weight: 400; color: var(--ink-3); font-style: italic; }

.d-abilities { display: flex; flex-direction: column; gap: 10px; }
.d-ability {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 6px;
  border-left: 3px solid color-mix(in srgb, var(--sym-color) 70%, var(--ink));
  background: linear-gradient(90deg, color-mix(in srgb, var(--sym-color) 16%, transparent), transparent 80%);
}
.d-ability > div { min-width: 0; }   /* Text darf schmaler werden als sein längstes Stück (QA 83 B1) */
.d-ability-icon {
  font-size: 1.4rem; flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; background: var(--parch); box-shadow: 0 0 0 1px var(--line-strong);
}
.d-ability.locked { opacity: 0.6; filter: sepia(0.5); }

.d-matchups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.d-table { width: 100%; border-collapse: collapse; }
.d-table th, .d-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.d-table thead th { color: var(--ink-2); border-bottom: 2px solid var(--ink-2); }
.d-table tfoot th, .d-table tfoot td { border-bottom: none; border-top: 2px solid var(--ink-2); font-weight: 700; }
.d-table .num { text-align: center; font-variant-numeric: tabular-nums lining-nums; }
.d-table tr.self td { opacity: 0.55; font-style: italic; }
s.raw { opacity: 0.5; font-weight: 400; color: var(--ink); margin-right: 2px; }
/* Schaden als Faktor des Grundschadens (factorCell in js/element-info.js): ×2, dahinter klein „→ n“ nach Rüstung */
.dmg-factor { font-variant-numeric: tabular-nums lining-nums; }
.dmg-eff { margin-left: 2px; font-size: 0.78em; font-weight: 400; opacity: 0.75; white-space: nowrap; }
.dmg-base { margin: -2px 0 6px; font-size: 0.82rem; font-style: italic; color: var(--ink-3); }

/* ===== Schmale Fenster ===== */
@media (max-width: 860px) {
  .landing-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .level-block { width: 86px; height: 86px; }
  .level-num { font-size: 2.2rem; }
  .d-matchups { grid-template-columns: 1fr; }
}

