/* ============================================================
   Way of Kunai – Desktop-Vorschlag (desktop.css)
   Nur für große Bildschirme. Jede Regel steht in einer Media-Query
   ab 1040 px (dort beginnt die PC-Leiste links) oder breiter.
   Handy/Tablet (< 1040 px) bleibt unverändert.
   Keine transform auf .uin, kein :has(), keine Filter, keine Animationen.
   ============================================================ */

/* ---------- A) ab 1040 px: Fehler, die jeder PC-Bildschirm zeigt ---------- */
@media (min-width:1040px){

  /* A1 Seitenleiste: Balken-Schrift lesbar (10 px -> 11.5 px) */
  body.shell #top .bars .bar{height:17px}
  body.shell #top .bars .bar span{font-size:11px;line-height:15px;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* A2 Seitenleiste: Menü rutscht nicht mehr unter die Knöpfe Codex/Suche */
  body.shell #nav{top:436px}

  /* A3 Tasche: die vier Reiter gleich breit statt quer verstreut */
  body.shell .bagtabs262{grid-template-columns:repeat(4,minmax(0,1fr))!important;justify-content:stretch}
  body.shell .bagtabs262 button{font-size:13.5px}

  /* A4 Ninja: alle Reiter in einer Zeile (vorher 7 + „Linked accounts“ allein darunter) */
  body.shell #view>.nintabs.nt263{grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
  body.shell #view>.nintabs.nt263 button{font-size:13px;padding-left:6px;padding-right:6px}

  /* A5 Ausrüstung/Slots: bewusst NICHT hier – gehört zu Update 485 (W1: HQ-Slots, Puppe, Profil-Kopf) */

  /* A6 Tasche: Werkzeugzeile in einer Reihe statt Kästchen-Stapel */
  body.shell[data-v="ninja"] #bagtools{display:flex;flex-wrap:wrap;max-width:none;gap:8px;align-items:center}
  body.shell[data-v="ninja"] #bagtools>*{grid-column:auto}
  body.shell[data-v="ninja"] #bagtools>.btn,body.shell[data-v="ninja"] #bagtools>#asbtn{flex:0 0 auto;min-width:170px;min-height:36px}

  /* A7 Tasche: größere Gegenstand-Kacheln (68 px -> 92 px), Stufe lesbar */
  body.shell .bag:not(.baglist){grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:10px}
  body.shell .bag.bagscroll{max-height:560px}
  body.shell .bag:not(.baglist) .bitem i{font-size:12px;right:7px;bottom:5px}

  /* A8 Ninja-Übersicht / Missionen: der Hilfe-Knopf bricht die zwei Spalten nicht mehr auseinander
        (vorher: Steckbrief links allein, rechts 400 px leer) */
  body.shell[data-v="ninja"][data-nt="overview"] #view>.tabhelp{column-span:none}
  body.shell:is([data-v="missions"],[data-v="events"],[data-v="arena"],[data-v="dungeons"]) #view>*:not(.view-head):not(.story):not(.tabhelp):not(.htabs){margin-top:0}

  /* A9 Werkstatt: Rohstoff-Symbole größer (26 -> 48 px, ganzzahlig zu den 64-px-Pixelbildern), Beschriftung lesbar */
  body.shell .resbar:not(.small) .resc{padding:12px 6px}
  body.shell .resbar:not(.small) .resc .ico{width:48px;height:48px}
  body.shell .resbar:not(.small) .resc small{font-size:12.5px}

  /* A10 Einstellungen: Beschriftung links, Auswahl rechts – keine 1000 px breiten Knopfleisten */
  body.shell .drow361{grid-template-columns:minmax(220px,.8fr) minmax(0,1.4fr);column-gap:24px;align-items:center}
  body.shell .drow361>.dl361{grid-column:1;margin:0}
  body.shell .drow361>:not(.dl361){grid-column:2;margin-top:0}
  body.shell .drow361 .seg235.seg361{max-width:560px}
  body.shell #codecard .row{max-width:640px}

  /* A11 Kampf: Knopf-Beschriftungen lesbar */
  #battle .act{font-size:13px}
  #battle .act small{font-size:11.5px}

  /* A12 Kampf: Lebens-/Chakra-Zahlen in den Kämpfer-Karten lesbar (8 px -> 10 px) */
  #battle .ucard .bar{height:13px}
  #battle .ucard .bar span{font-size:10px;line-height:13px}
}

/* Bildschirme mit wenig Höhe (Laptop 1366x768): Menü passend unter die Knöpfe */
@media (min-width:1040px) and (max-height:770px){
  body.shell #nav{top:388px}
}

/* ---------- B) ab 1440 px: Platz nutzen ---------- */
@media (min-width:1440px){

  /* B1 Mittelspalte breiter (1020 -> 1320 px), weniger leerer Rand */
  body.shell #view{max-width:none}

  /* B2 Dorf: Bild füllt die linke Spalte bis zur Höhe der rechten (keine Lücke darunter) */
  body.shell[data-v="village"] #view>.scene{align-self:stretch;display:flex;flex-direction:column;justify-content:flex-end}

  /* B3 Dorf: Orts-Kacheln größer (108 -> ~150 px, Bild 62 -> 92 px), Reihe füllt die Breite */
  body.shell[data-v="village"] #view .signs{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(148px,1fr))!important;gap:12px!important}
  body.shell[data-v="village"] #view .sign{flex:none;width:auto;min-height:150px}
  body.shell[data-v="village"] #view .sign.pic209 .sgpic209{width:92px;height:92px}
  body.shell[data-v="village"] #view .sign b{font-size:14px}

  /* B3b Dorf: die Schnellknöpfe im Bild in zwei gleichmäßigen Reihen (vorher 10 + 1 allein) */
  body.shell[data-v="village"] .scene .chips{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));max-width:760px}

  /* B4 Codex: Bildkacheln größer (62 -> 84 px) */
  body.shell .lore369g{grid-template-columns:repeat(auto-fill,minmax(124px,1fr))!important}
  body.shell .lore369p{width:84px;height:84px}
  body.shell .lore369p img{width:80px;height:80px}

  /* B5 Profil-Rahmen: Vorschau größer */
  body.shell .pfgrid224{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important}

  /* B6 Kampf: breiteres Feld (max 1280 -> 1560 px), Seitenspalte 340 px */
  /* B6 Kampf: Protokoll links, Brett in der Mitte, Kämpfer-Karten rechts; Brett skaliert mit der Höhe */
  #battle .bwrap{max-width:none;grid-template-columns:300px minmax(0,1fr) 340px;grid-template-areas:"head head head" "log board units" "log hint units" "log panel units"}
  #battle .side{display:contents}
  #battle #bunits{grid-area:units;align-self:start}
  #battle #bsidelog{grid-area:log;max-height:none;min-height:240px;align-self:stretch}
  #battle .board svg{max-height:calc(100vh - 290px)}
}

/* ---------- C) ab 1760 px (Full-HD): noch etwas breiter ---------- */
@media (min-width:1760px){
  body.shell #view{max-width:none}
  body.shell[data-v="village"] #view .signs{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))!important}
  body.shell .bag:not(.baglist){grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
}

/* ---------- D) fließende Breite: Inhalt bis an den Rand (Leitung 28.11. „leere Ränder nutzen“) ---------- */
@media (min-width:1040px){
  body.shell #app{padding-right:96px;padding-left:calc(var(--side) + 24px)}   /* rechts Platz für die Chat-Blase (52 px + 22 px Rand), sonst liegt sie über Knöpfen (fabcheck) */
  body.shell #view{max-width:none}
  body.shell #view>p,body.shell #view .card>p,body.shell #view .story p{max-width:78ch}   /* Lesetext bleibt lesbar */
  body.shell #view.mapwide{max-width:none}
  .pix410,.sgpic209,.lore369p img,.bitem img,.slot img{image-rendering:pixelated}
}
@media (min-width:1040px){
  /* D2 Dorf: Kacheln wachsen mit der Breite und stehen mittig (feste, mit der Breite wachsende Größe) */
  body.shell[data-v="village"] #view .signs{grid-template-columns:repeat(auto-fill,minmax(var(--tile495,150px),var(--tile495,150px)))!important;justify-content:start}
}
@media (min-width:1440px){ body.shell{--tile495:clamp(150px,7.4vw,200px)} }
@media (min-width:1700px){
  /* E) rechte Spalte (340 px): Aufgaben, Ziel, Bonus, Glocke oben, Weltchat dauerhaft angedockt darunter */
  body.shell #app{padding-right:calc(24px + 340px + 16px)}
  body.shell{--chatw:352px}   /* Breite der rechten Spalte (340 + 12 Rand); Feldkarte (W2): #mapsheet{right:var(--chatw,0)} */
  body.shell #chatbtn{display:none}
  body.shell #chatbox{position:fixed;right:12px;left:auto;top:var(--rch,12px);bottom:12px;width:340px;height:auto;max-height:none}
  body.shell #chatbox .chead{gap:4px}
  body.shell #chatbox .ctabs{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;min-width:0;flex:1 1 auto}
  body.shell #chatbox .ctabs::-webkit-scrollbar{display:none}
  body.shell #chatbox .ctabs button{flex:0 0 auto;font-size:12px;padding:5px 9px}
  body.shell #chatbox .chead>button{flex:0 0 auto}
  body.shell #chatbox .chead>button:last-child{display:none}   /* Schließen: die Spalte bleibt stehen */
  body.inbattle495 #chatbox{display:none}   /* im Kampf keine Chat-Box über Protokoll/Knöpfen */
  #rcol{position:fixed;right:12px;top:12px;width:340px;max-height:48vh;overflow:auto;z-index:14;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin}
  #rcol .rcsec{position:relative;padding:6px 8px;font-size:13px;line-height:1.35;border:0;border-style:solid;border-color:transparent;border-width:9px;border-image:url(assets/ui/slot-legendary.png) 18 fill / 9px stretch;background:radial-gradient(circle at 15% 0,#2c2216,#0f0b08) padding-box;image-rendering:auto}
  #rcol h4{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-family:var(--serif);font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:#f6e3b0;font-weight:700}
  #rcol .rcmed{flex:0 0 28px;width:28px;height:28px;display:inline-grid;place-items:center;border-radius:50%;background:radial-gradient(circle at 35% 25%,#4b3823,#150f09);box-shadow:0 0 0 2px #e0b04a}
  #rcol .rcmed i{display:block;width:18px;height:18px;background:center/contain no-repeat;image-rendering:pixelated}
  #rcol .rcrow{display:flex;flex-direction:row;align-items:center;gap:10px;width:100%;text-align:left;background:rgba(255,255,255,.03);border:1px solid var(--line2);border-radius:0;padding:6px 8px;margin:0 0 6px;color:inherit;cursor:pointer;min-height:44px}
  #rcol .rcrow:hover{border-color:var(--gold3);background:rgba(224,176,74,.08)}
  #rcol .rctx{display:flex;flex-direction:column;min-width:0}
  #rcol .rcrow b{color:var(--gold2);font-size:13px}
  #rcol .rcrow small{color:var(--soft);font-size:11.5px}
  body.rcol #view .todo-upd{display:none}   /* die Aufgaben stehen schon rechts – nicht doppelt */
  body.rcol #top .fbbar{display:none}   /* ab 1700 sitzt die Buff-Leiste in der rechten Spalte */
  #rcol .fbbar{margin:2px 0 4px;gap:12px}
  body.rcol .fbbar.fbrc .fbchip{width:36px;height:36px}
  #rcol p{margin:0 0 4px}
  #rcol .rcnone,#rcol .rclog{color:var(--soft);font-size:12px}
  #rcol .rclog{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #rcol .rctag{display:flex;align-items:center;gap:8px;font-size:12.5px}
  #rcol .rcmore{margin-top:2px;background:none;border:0;color:var(--gold2);font-size:12px;cursor:pointer;padding:2px 0}
}
