/*
 * Angelwahn-Wiki: nur was die Startseite (../style.css) nicht schon hat - Steckbriefe wie Item-Tooltips (tipbox),
 * Slots, Reiter und Knöpfe von dort. Ein Minecraft-Pixel = 2 CSS-Pixel (--px).
 */

.nav-links a.on { color: #fff; }

/* Suche oben rechts: Textfeld wie im Spiel, Treffer als Tooltip darunter */
.wk-search { position: relative; display: flex; align-items: center; padding: 6px; min-width: 0; flex: 0 1 360px; }
.wk-search input {
  width: 100%; height: 36px; padding: 0 10px; border: var(--px) solid #A0A0A0; background: #000; color: #E0E0E0;
  caret-color: #E0E0E0;
}
.wk-search input::placeholder { color: #707070; }
.wk-search input:focus { outline: none; border-color: #fff; }
.wk-hits {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 30; margin: 0; padding: 6px; list-style: none;
  max-height: 70vh; overflow: auto;
}
.wk-hits li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer; }
.wk-hits li[aria-selected="true"], .wk-hits li:hover { background: rgba(255, 255, 255, .08); }
.wk-hits small { margin-left: auto; white-space: nowrap; }

.wk { padding-top: 24px; min-height: 60vh; }
.wk:focus { outline: none; }
.wk-crumbs { margin: 0 0 16px; color: var(--gray); }
.wk-crumbs a { color: var(--gray); }
.wk-crumbs a:hover { color: #fff; }
.wk-title { margin: 0 0 20px; font-size: 32px; }
.wk-ico { width: var(--ic24, 24px); height: var(--ic24, 24px); flex: none; vertical-align: middle; }
/* Bilder in den Slots: Vielfache in ganzen Bildschirmpixeln (wiki.js initPixelSize) */
.wk-tile .slot img, .wk-cat .slot img { width: var(--ic48, 48px); height: var(--ic48, 48px); }
.wk-area .slot img { width: var(--ic64, 64px); height: var(--ic64, 64px); }
.wk-head .slot img { width: var(--ic80, 80px); height: var(--ic80, 80px); }
.wk-table .slot img { width: var(--ic32, 32px); height: var(--ic32, 32px); }
.wk-link { display: inline-flex; align-items: center; gap: 6px; }
.wk-link:hover { text-decoration: none; }
.wk-link:hover .fn { text-decoration: underline; }
.wk-inline { display: inline; }
.wk-badge { white-space: nowrap; }
.wk-note { margin: 0 0 10px; }
.wk-pad { padding: 14px 18px; }

/* Startseite */
.wk-intro { padding: 24px clamp(18px, 3vw, 32px); }
.wk-intro h1 { margin: 0 0 6px; font-size: 32px; color: var(--yellow); }
.wk-intro > p { margin: 0 0 20px; max-width: 72ch; }
.wk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.wk-cat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 8px; color: #fff; background: rgba(255, 255, 255, .04);
}
.wk-cat .slot { grid-row: span 2; }
.wk-cat b { align-self: end; }
.wk-cat small { align-self: start; }
.wk-cat:hover { background: rgba(255, 255, 255, .09); text-decoration: none; }

.wk-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.wk-area { display: flex; align-items: center; gap: 14px; padding: 12px; color: #fff; height: 100%; }
.wk-area:hover { text-decoration: none; background-color: rgba(30, 6, 40, .96); }
.wk-area div { display: grid; gap: 2px; }
.wk-area b { font-size: 18px; }

.wk-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.wk-guide { display: grid; gap: 4px; padding: 14px 16px; color: #fff; height: 100%; }
.wk-guide:hover { text-decoration: none; background-color: rgba(30, 6, 40, .96); }

/* Abschnitte */
.wk-sec { margin: 36px 0 0; }
.wk-h { margin: 0 0 14px; font-size: 24px; color: #fff; }
.wk-gh { margin: 18px 0 8px; font-size: 16px; color: var(--c); }
.wk-groups > .wk-group:first-child .wk-gh { margin-top: 0; }

/* Kacheln: Slot + Name */
.wk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.wk-tile { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; color: #fff; background: rgba(0, 0, 0, .35); }
.wk-tile:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.wk-tile-text { display: grid; min-width: 0; }
.wk-tile-text .fn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-tile-text small { font-size: 14px; }

/* Reiter je Gebiet */
.wk-tabs { justify-content: flex-start; margin: 0 0 18px; }
.wk-tabs a {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; color: var(--gray);
  border: 6px solid transparent; border-image: url("../img/mc/reiter.png") 3 fill / 6px repeat;
}
.wk-tabs a:hover { color: #fff; text-decoration: none; border-image-source: url("../img/mc/reiter_hell.png"); }
.wk-tabs a[aria-selected="true"] { color: #fff; border-image-source: url("../img/mc/reiter_aktiv.png"); }

/* Kopf einer Seite */
.wk-head { display: flex; align-items: center; gap: 20px; padding: 16px 20px; }
.wk-head-text { min-width: 0; }
.wk-head h1 { margin: 0; font-size: 32px; line-height: 1.2; }
.wk-head p { margin: 6px 0 0; }

/* Steckbrief: Schlüssel links, Wert rechts */
.wk-kv { display: grid; gap: 6px; margin: 16px 0 0; padding: 16px 20px; }
.wk-kv > .wk-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; }
.wk-kv dt { color: var(--gray); }
.wk-kv dd { margin: 0; min-width: 0; }
.wk-kv .wk-tl-wide { margin-bottom: 8px; }

/* Tooltip-Zeilen aus dem Spiel */
.wk-tl { color: var(--gray); }
.wk-tl p { margin: 0; }
.wk-tl p.gap { height: .75em; }

.wk-riddle { margin: 16px 0 0; padding: 16px 20px; }
.wk-riddle .wk-h { font-size: 18px; }
.wk-riddle > p { margin: 12px 0 0; }

/* Kampf */
.wk-fight { padding: 16px 20px; }
.wk-fh { margin: 0 0 6px; font-size: 16px; color: #fff; }
.wk-fh:not(:first-child) { margin-top: 14px; }
.wk-abilities { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.wk-weak { margin: 0; }
.wk-weak b { color: var(--gold); font-weight: 400; }
.wk-tips { margin: 12px 0 0; }

/* Tabellen (Beute, Teile, Entwicklungen) */
.wk-table { width: 100%; border-collapse: collapse; background: rgba(0, 0, 0, .35); }
.wk-table th { text-align: left; color: var(--gray); font-weight: 400; padding: 8px 12px; border-bottom: var(--px) solid rgba(255, 255, 255, .1); }
.wk-table td { padding: 6px 12px; border-bottom: var(--px) solid rgba(255, 255, 255, .06); vertical-align: middle; }
.wk-table td .slot { display: inline-grid; vertical-align: middle; margin-right: 8px; }
.wk-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wk-costs { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.wk-n { display: inline-block; min-width: 3ch; text-align: right; font-weight: 400; color: #fff; }
.wk-uses { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }

/* Tooltip wie im Spiel (Ausrüstung, Köder) */
.wk-tip { padding: 10px 14px; max-width: 460px; }
.wk-tip-name { margin: 0 0 4px; }
.wk-levels { justify-content: flex-start; margin: 0 0 10px; }
.wk-levels button {
  height: 36px; padding: 0 12px; color: var(--gray); background: none; cursor: pointer;
  border: 6px solid transparent; border-image: url("../img/mc/reiter.png") 3 fill / 6px repeat;
}
.wk-levels button:hover { color: #fff; border-image-source: url("../img/mc/reiter_hell.png"); }
.wk-levels button[aria-selected="true"] { color: #fff; border-image-source: url("../img/mc/reiter_aktiv.png"); }
.wk-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.wk-piece { display: flex; gap: 10px; align-items: flex-start; }
.wk-piece .wk-tip { flex: 1; min-width: 0; }

/* Begleiter-Fähigkeiten */
.wk-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.wk-skills li { padding: 14px 16px; }
.wk-skills p { margin: 0 0 6px; }
.wk-skills small { display: block; margin-top: 8px; }

/* Texte von Hand (Markdown) */
.wk-md { max-width: 80ch; color: #DDD; }
.wk-md p { margin: 0 0 12px; }
.wk-md ul { margin: 0 0 12px; padding-left: 22px; }
.wk-md li { margin: 2px 0; }
.wk-mdh { margin: 22px 0 8px; color: #fff; font-size: 20px; }
.wk-article { padding: 22px clamp(18px, 3vw, 32px); }
.wk-article h1 { margin: 0 0 16px; font-size: 32px; color: var(--yellow); }

/* Kopfzeile: eigene Stufen (data-wk statt data-weg der Startseite) - zuerst weicht "Statistiken", dann wird sie
   zweizeilig (Suche darunter), ganz schmal fehlt der Name neben dem Hecht */
@media (max-width: 1320px) {
  .nav-links [data-wk="7"] { display: none; }
}
@media (max-width: 1060px) {
  .top { flex-wrap: wrap; }
  .nav { flex: 1 1 100%; }
  .wk-search { flex: 1 1 100%; }
}
/* Die Startseite zeigt ab 820 nur noch ihren letzten Link - im Wiki bleiben alle (bis auf "Statistiken"), notfalls
   in zwei Zeilen */
@media (max-width: 820px) {
  .nav-links { margin-left: 0; flex-wrap: wrap; }
  .nav-links li:not(:last-child) { display: block; }
}
@media (max-width: 640px) {
  .nav { align-items: flex-start; }
  .nav-links a:not(.btn) { padding: 6px 8px; }
  .brand span { display: none; }
  .wk-kv > .wk-row { grid-template-columns: 1fr; gap: 0; }
  .wk-head { gap: 14px; }
  .wk-head .slot { --s: 64px !important; }
  .wk-head h1, .wk-title { font-size: 24px; }
}

.wk-piece .slot img { width: var(--ic48, 48px); height: var(--ic48, 48px); }
.wk-narrow { width: auto; min-width: 280px; margin: 0 0 12px; }
/* Name oben links nie umbrechen - eher wird die Suche schmaler */
.top .brand { white-space: nowrap; flex: none; }
.wk-search { flex-basis: 300px; }
/* Handy: Tabellen enger (sonst ragten Chance und Hinweis über den Rand), Menü in einer Zeile zum Wischen */
@media (max-width: 640px) {
  .wk-table th, .wk-table td { padding: 6px; }
  .wk-table td .slot { margin-right: 4px; }
  .wk-link { gap: 4px; }
  .nav { flex-wrap: nowrap; min-width: 0; }               /* sonst hielt die Kopfzeile die Seite 700 px breit */
  .nav-links { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links { -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
}
/* Handy: Tabellenzeilen stapeln - Name über die ganze Breite, Chance und Hinweis darunter (sonst ragten Beute-,
   Rezept- und Entwicklungs-Tabellen bis zu 100 px über den Rand) */
@media (max-width: 640px) {
  .wk-table thead { display: none; }
  .wk-table tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px;
    border-bottom: var(--px) solid rgba(255, 255, 255, .06); padding: 4px 0; }
  .wk-table td { display: block; border: 0; padding: 2px 8px; }
  .wk-table td:first-child { flex: 1 1 100%; }
  .wk-table td:empty { display: none; }
  .wk-narrow tr { flex-wrap: nowrap; }
  .wk-narrow td:first-child { flex: 1 1 auto; }
}
/* Lange Namen ("Kaiserkrabbenrüstung", "Königskrabbenrüstung") brechen auf dem Handy um statt die Seite zu verbreitern */
.wk-head h1, .wk-title, .wk-article h1, .wk-intro h1, .wk-h { hyphens: auto; overflow-wrap: anywhere; }
.wk-kv dd, .wk-tip { overflow-wrap: anywhere; }
@media (max-width: 640px) { .wk-table td { overflow-wrap: anywhere; } }
