/* EntenGames Wiki (Stand 15.11.2026). Baut auf styles.css auf: gleiche Farben, Schriften, Karten.
   Seiten werden von website-server/wiki/build_wiki.py erzeugt, nicht von Hand bearbeiten.
   Joshi: "schön mit Grafiken und wenig Text", Handy zuerst. 3D-Symbole stehen frei, ohne farbige Unterlage. */

.wiki { padding: 24px 0 72px; }
.wiki-home { padding-bottom: 44px; }

/* Brotkrumen */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 0 0 6px; padding: 0; list-style: none; font-size: var(--fs-ui); font-weight: 600; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "›"; margin: 0 8px 0 4px; color: var(--primary); font-weight: 800; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs [aria-current] { color: var(--text); }

/* ---------- Übersicht ---------- */

.wiki-top { margin-bottom: 28px; }
.wiki-top h1 { margin-bottom: 18px; }
.wiki-search input {
  width: 100%;
  min-height: 58px;
  padding: 12px 16px 12px 54px;
  font: 600 19px "Figtree", system-ui, sans-serif;
  color: var(--text);
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f6fd1' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") no-repeat 18px 50% / 24px 24px;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  -webkit-appearance: none;
  appearance: none;
}
.wiki-search input::placeholder { color: #4a5a7a; }
.wiki-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wiki-search input::-webkit-search-decoration { -webkit-appearance: none; }

.wiki-results { margin: 10px 0 0; padding: 0; list-style: none; background: #ffffff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-card); }
.wiki-results li + li { border-top: 1px solid var(--line); }
.wiki-results a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; text-decoration: none; }
.wiki-results a:hover, .wiki-results a:focus-visible { background: var(--primary-soft); color: var(--text); }
.wiki-results img { flex: none; width: 38px; height: 38px; }
.wiki-results .txt { min-width: 0; }
.wiki-results b { display: block; font-family: var(--display); font-weight: 700; line-height: 1.25; }
.wiki-results .txt span { display: block; font-size: var(--fs-ui); line-height: 1.35; }
.wiki-results .leer { padding: 14px 16px; }

.wiki-area { margin-bottom: 28px; }
.wiki-area h2 { font-size: var(--fs-h3); margin-bottom: 12px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tiles li { display: flex; }
.tile {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 100%;
  padding: 16px 10px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.12s;
}
.tile-ico { width: 88px; height: 88px; transition: transform 0.15s ease-out; }
.tile span { font-family: var(--display); font-weight: 800; font-size: var(--fs-ui); line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.tile:hover { border-color: var(--primary); color: var(--text); }
.tile:hover span { color: var(--primary-dark); }
.tile:hover .tile-ico { transform: scale(1.06); }
.tile:active { border-color: var(--primary-dark); }
/* Am Handy: bleibt in einem Bereich eine Kachel allein, wird sie breit statt eine Lücke zu lassen */
@media (max-width: 719px) {
  .tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tiles li:last-child:nth-child(odd) .tile { flex-direction: row; justify-content: center; gap: 16px; padding: 12px 16px; }
  .tiles li:last-child:nth-child(odd) .tile-ico { width: 76px; height: 76px; }
}

/* ---------- Artikel ---------- */

.wiki-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.wiki-article { min-width: 0; max-width: 820px; }

.art-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 20px; }
.art-ico { width: 64px; height: 64px; }
.art-head .lead { font-size: var(--fs-md); line-height: 1.4; margin-top: 6px; }

/* Auf dieser Seite: am Handy eingeklappt, am Desktop offen (kleines Skript in der Seite) */
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 4px; }
.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--fs-md);
  cursor: pointer;
  list-style: none;
  border-radius: var(--r-lg);
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 3px solid var(--primary);
  border-bottom: 3px solid var(--primary);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.toc[open] summary::after { transform: rotate(-135deg); margin-top: 5px; }
.toc summary:hover { color: var(--primary-dark); }
.toc ol { margin: 0; padding: 0 20px 12px 42px; }
.toc li { padding: 1px 0; }
.toc a { display: block; padding: 7px 0; font-weight: 600; line-height: 1.35; }

.wiki-section { padding-top: 32px; scroll-margin-top: 16px; }
.wiki-section h2 { font-size: var(--fs-h3); margin-bottom: 14px; }
.wiki-section h3 { font-size: var(--fs-h3); margin: 26px 0 10px; }
.wiki-section p { margin-bottom: 14px; }
.wiki-section .steps { margin: 6px 0 14px; }
.wiki-section code.lang { white-space: normal; overflow-wrap: anywhere; }

.h-sym { display: flex; align-items: center; gap: 10px; }
.h-sym img { flex: none; width: 44px; height: 44px; }

.wiki-list { margin: 0 0 14px; padding: 0; list-style: none; }
.wiki-list li { position: relative; padding: 4px 0 4px 30px; }
.wiki-list li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 12px; height: 12px; border-radius: 3px; background: var(--yellow); box-shadow: inset 0 0 0 2px var(--text); }

.note { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--r-md); padding: 14px 16px; }

/* Symbolreihe (Kisten, Perks): eine ruhige Fläche, keine Einzelkarten, damit nichts wie ein Knopf wirkt */
.sym-grid {
  display: grid;
  grid-template-columns: repeat(var(--sp, 2), minmax(0, 1fr));
  gap: 14px 8px;
  margin: 4px 0 16px;
  padding: 16px 12px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.sym-grid li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sym-grid img { width: 60px; height: 60px; }
.sym-grid span { font-family: var(--display); font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; }

/* Tabellen: scrollen nur in sich, nie die ganze Seite */
.tbl { overflow-x: auto; margin: 4px 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); -webkit-overflow-scrolling: touch; }
.tbl table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: 1.4; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl thead th { background: var(--primary-soft); font-family: var(--display); font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.tbl tbody th { font-weight: 700; }
.tbl code { white-space: normal; }
.tbl-cmd tbody th { width: 44%; }
.tbl-ranks table { min-width: 560px; }
.tbl-ranks td { text-align: center; }
.tbl-ranks thead th:not(:first-child) { text-align: center; }
/* Erste Spalte bleibt beim seitlichen Wischen stehen */
.tbl-ranks tbody th, .tbl-ranks thead th:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.tbl-ranks tbody th { background: var(--card); }
.tbl-ranks thead th:first-child { background: var(--primary-soft); }
.tbl:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Befehlstabellen am Handy: Befehl oben, Erklärung darunter, statt zwei schmaler Spalten */
@media (max-width: 599px) {
  .tbl-cmd thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .tbl-cmd table, .tbl-cmd tbody, .tbl-cmd tr, .tbl-cmd tbody th, .tbl-cmd td { display: block; width: auto; }
  .tbl-cmd tr { padding: 11px 14px 12px; border-bottom: 1px solid var(--line); }
  .tbl-cmd tbody tr:last-child { border-bottom: 0; }
  .tbl-cmd tbody th, .tbl-cmd td { padding: 0; border: 0; }
  .tbl-cmd tbody th { width: auto; margin-bottom: 4px; }
  /* Kistentabellen: Stufe und Chance oben, Gewinne darunter */
  .tbl-kiste thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .tbl-kiste table, .tbl-kiste tbody, .tbl-kiste tbody th, .tbl-kiste td { display: block; width: auto; }
  .tbl-kiste tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 14px 12px; border-bottom: 1px solid var(--line); }
  .tbl-kiste tbody tr:last-child { border-bottom: 0; }
  .tbl-kiste tbody th, .tbl-kiste td { padding: 0; border: 0; }
  .tbl-kiste td:nth-of-type(1) { font-weight: 700; }
  .tbl-kiste td:nth-of-type(2) { grid-column: 1 / -1; }
}

/* Weiter / Zurück */
.pagers { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 40px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 72px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: var(--fs-text); line-height: 1.2; }
.pager-ico { flex: none; width: 48px; height: 48px; }
.pager-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pager-text span { font-family: "Figtree", sans-serif; font-weight: 600; font-size: var(--fs-sm); color: var(--primary-dark); }
.pager:hover { border-color: var(--primary); color: var(--text); }
.pager-next { justify-content: flex-end; text-align: right; }
.wiki-stand { margin-top: 28px; font-size: var(--fs-ui); }

/* Seitenleiste */
.wiki-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; align-self: start; }
.side-home { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--display); font-weight: 800; font-size: var(--fs-md); text-decoration: none; }
.side-group { margin-top: 10px; }
.side-title { font-family: var(--display); font-weight: 800; font-size: var(--fs-sm); color: var(--primary-dark); margin-bottom: 2px; }
.side-group ul { margin: 0; padding: 0; list-style: none; }
.side-group a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; margin: 0 -10px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; line-height: 1.25; }
.side-ico { flex: none; width: 30px; height: 30px; }
.side-group a:hover { background: var(--primary-soft); color: var(--text); }
.side-group a[aria-current="page"] { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary-line); font-weight: 800; }

@media (min-width: 600px) {
  .sym-grid { grid-template-columns: repeat(var(--sd, 4), minmax(0, 1fr)); }
  .sym-grid img { width: 72px; height: 72px; }
}

@media (min-width: 720px) {
  .wiki-search { max-width: 640px; }
  .wiki-results { max-width: 640px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tile-ico { width: 100px; height: 100px; }
  .tile span { font-size: var(--fs-md); }
  .wiki-area h2 { font-size: var(--fs-h3); }
  .art-head { grid-template-columns: 88px minmax(0, 1fr); gap: 18px; }
  .art-ico { width: 88px; height: 88px; }
  .art-head .lead { font-size: var(--fs-title); }
  .wiki-section h2 { font-size: var(--fs-h3-lg); }
  .pagers { grid-template-columns: 1fr 1fr; }
  .pager-next:only-child { grid-column: 2; }
}

@media (min-width: 1000px) {
  .wiki { padding-top: 32px; }
  .wiki-home .wiki-top { margin-bottom: 36px; }
  /* Bereich links, Kacheln rechts: eine Zeile je Bereich */
  .wiki-area { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 20px; }
  .wiki-area h2 { margin: 0; padding-top: 18px; }
  .tile { padding: 18px 12px 18px; }
  .tile-ico { width: 108px; height: 108px; }
  .wiki-grid { grid-template-columns: 280px minmax(0, 1fr); gap: 48px; }
  .wiki-side { grid-column: 1; grid-row: 1; position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; }
  .wiki-article { grid-column: 2; grid-row: 1; }
  .side-group { margin-top: 8px; }
  .side-group a { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile-ico, .toc summary::after { transition: none; }
  .tile:hover .tile-ico { transform: none; }
}
