/* 636 kampf-groß – Handy ≤ 1039 px und PC. Buttons ≥ 56 px hoch (Handy), Namen ≥ 11 px, Balken mit Zahlen, Log einklappbar. Keine Filter, keine Animation, kein transform auf .uin. */
#lg636{display:none}
@media (max-width:1039px){
  #battle.k1 .bwrap{padding:4px 5px calc(5px + env(safe-area-inset-bottom,0px));gap:4px}
  #battle.k1 .bhead .turn{font-size:16px}
  #battle.k1 .bhead .apbar{flex:0 1 52%;font-size:15px;font-weight:800}
  #battle.k1 #bunits>.ucard{min-width:160px;padding:5px 8px}
  #battle.k1 #bunits>.ucard b{font-size:13px}
  #battle.k1 #bunits>.ucard .bar{height:12px;margin-top:2px;border-radius:6px}
  #battle.k1 #bunits>.ucard .bar span{display:block!important;font-size:9.5px;line-height:12px;padding-left:5px;white-space:nowrap}
  #battle.k1 #bhint{font-size:13.5px}
  #battle.k1 #k1last{min-height:40px}
  /* big buttons: the main row and the techniques */
  #battle.k1 .acts.k1acts .act{min-height:58px!important}
  #battle.k1 .k1row>.act{min-height:58px!important}
  #battle.k1 .k1row>.act span:not(.ico),#battle.k1 .k1jut>.act span:not(.ico){font-size:11.5px!important;line-height:1.1;letter-spacing:0!important}
  #battle.k1 .k1jut{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px}
  #battle.k1 .k1jut>.act{min-height:60px!important;padding:5px 2px 4px!important}
  #battle.k1 .acts.k1acts .act .ico.pix,#battle.k1 .k1jut>.act .ico.pix{width:22px!important;height:22px!important;min-height:22px!important}
}
@media (max-width:319px){ #battle.k1 .k1jut{grid-template-columns:repeat(4,minmax(0,1fr))!important} }
@media (max-width:1039px) and (max-height:700px){
  #battle.k1 .k1jut>.act{min-height:56px!important}
  #battle.k1 .k1row>.act{min-height:54px!important}
  #battle.k1 .k1jut>.act small,#battle.k1 .k1row>.act small{display:block!important}
}
@media (min-width:1040px){
  #lg636{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:13px}
  #battle.nolog636 #bsidelog{display:none}
  html body #battle .k1jut>.act,html body #battle .k1row>.act{min-height:64px!important}
  #battle .ucard .bar{height:17px}
  #battle .ucard .bar span{font-size:12px;line-height:17px}
  #battle .ucard b{font-size:15px}
  #battle .act{font-size:14px}
  #battle .k1jut>.act>span:not(.ico),#battle .acts .act>span:not(.ico){font-size:12.5px!important}
  #battle .bhead .turn{font-size:20px}
  #battle .bhead .apbar{font-size:15px;font-weight:800}
}

/* 636: the Tonic button in the main row; the old one at the end of the technique grid is hidden (our button presses it) */
#battle .k1jut>#potbtn{display:none!important}
#battle #tonic636[disabled]{opacity:.62}
#battle #tonic636:not([disabled]){outline:2px solid rgba(159,224,138,.7);outline-offset:-3px}
/* in a fight a window must not black out the buttons completely */
body.inbattle495 #modal,body.btl339 #modal{background:rgba(6,4,3,.5)!important}

/* 636b: unit cards on the phone – name and title may use two lines, never "…" */
@media (max-width:1039px){
  #battle.k1 #bunits>.ucard .grow>b{white-space:normal!important;display:block!important;-webkit-line-clamp:unset!important;overflow:visible!important;text-overflow:clip!important;line-height:1.12!important;font-size:12.5px!important}
  #battle.k1 #bunits>.ucard .rtbt{max-height:none!important;overflow:visible!important;margin-top:1px!important}
  #battle.k1 #bunits>.ucard .rtp{max-width:100%;white-space:normal}
  #battle.k1 #bunits>.ucard .rtp b{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:9.5px!important;line-height:1.05!important}
  #battle.k1 #bunits>.ucard .bar{height:11px}
  #battle.k1 #bunits>.ucard .bar span{font-size:9px;line-height:11px}
}
/* 636c: phone – main row in two lines of three (names 11.5 px fit), cards compact: only your own card shows chakra and stamina bars (the figures carry all three over their heads) */
@media (max-width:1039px){
  #battle.k1 #bunits>.ucard:not(:first-child) .bar.ck,#battle.k1 #bunits>.ucard:not(:first-child) .bar.st{display:none}
}
/* 636d: names win over the 9.5 px of 625 (more specific: #bpanel) – fitNames still shrinks a single too-long word */
@media (max-width:1039px){
  html body #battle.k1 #bpanel .k1row>.act>span:not(.ico),html body #battle.k1 #bpanel .k1jut>.act>span:not(.ico){font-size:11.5px!important;letter-spacing:0!important}
}
@media (min-width:1040px){
  html body #battle #bpanel .k1jut>.act>span:not(.ico),html body #battle #bpanel .k1row>.act>span:not(.ico){font-size:12.5px!important}
}
/* 636e: phone – the field keeps the full width: cards without the title row (the title is no help in a fight), tighter log row */
@media (max-width:1039px){
  #battle.k1 #bunits>.ucard .rtbt{display:none!important}
  #battle.k1 #k1last{min-height:36px!important}
  #battle.k1 .bwrap{gap:3px!important}
}
/* 636f: a little tighter so the field keeps the full width on a 360 x 740 phone */
@media (max-width:1039px){
  #battle.k1 .k1jut>.act,#battle.k1 .acts.k1acts .k1jut>.act{min-height:56px!important}
  #battle.k1 #bunits>.ucard{padding:3px 7px!important}
  #battle.k1 .bhead{min-height:24px!important}
}
@media (max-width:1039px){
  #battle.k1 #k1last{min-height:32px!important}
  #battle.k1 .k1jut>.act,#battle.k1 .acts.k1acts .k1jut>.act{min-height:54px!important}
}

/* 636g: phone – the Tonic button leads the technique grid (the main row keeps five wide buttons), main row 56 px */
@media (max-width:1039px){
  #battle.k1 .k1row>.act,#battle.k1 .acts.k1acts .k1row>.act{min-height:56px!important}
  #battle.k1 .k1jut>#tonic636{grid-column:auto}
}
/* 647 (User 29.11.: "das Bild wird im Auto-Kampf automatisch groß/klein, es zuckt"): on a computer the log column and the unit list grew with every log line and every new unit (summon, spirit),
   the page got a scrollbar and lost it again → the field was re-fitted by ~30 px each time. Both columns now scroll inside themselves, the scrollbar space is reserved. */
@media (min-width:1040px){
  #battle{scrollbar-gutter:stable}
  html body #battle #bsidelog{max-height:calc(100vh - 150px)!important;overflow-y:auto}
  html body #battle #bunits{max-height:calc(100vh - 150px);overflow-y:auto}
}
/* 647: the row under the panel (ticker/tabs) has a fixed height on a computer – its text used to wrap to two lines and push the field's row (26 → 51 px) */
@media (min-width:1040px){
  html body #battle .bwrap>.tabs{height:28px!important;max-height:28px!important;overflow:hidden!important}
  html body #battle #k1last{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis}
}
/* 647: the turn-order chips ("You › Yuki › Okami") stay on ONE line on the phone – with a summon and a spirit they wrapped to two and the field lost 25 px */
@media (max-width:1039px){
  #battle.k1 #turn330{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;max-height:24px!important;scrollbar-width:none;white-space:nowrap}
  #battle.k1 #turn330::-webkit-scrollbar{display:none}
}

/* 636h: small phones – the fight keeps fitting without scrolling (r-kampf-ein-bildschirm, r-display size l): the buttons get lower the less height there is */
@media (max-width:1039px) and (max-height:800px){
  #battle.k1 .k1row>.act,#battle.k1 .acts.k1acts .k1row>.act{min-height:42px!important}
  #battle.k1 .k1jut>.act,#battle.k1 .acts.k1acts .k1jut>.act{min-height:39px!important}
  #battle.k1 .acts.k1acts .act .ico.pix,#battle.k1 .k1jut>.act .ico.pix{width:18px!important;height:18px!important;min-height:18px!important}
}
@media (max-width:1039px) and (max-height:700px){
  html body #battle.k1 .k1row>.act,html body #battle.k1 .acts.k1acts .k1row>.act{min-height:40px!important}
  html body #battle.k1 .k1jut>.act,html body #battle.k1 .acts.k1acts .k1jut>.act{min-height:38px!important}
  html body #battle.k1 .k1jut>.act small,html body #battle.k1 .k1row>.act small{display:block!important}
  html body #battle.k1 .acts.k1acts .act .ico.pix,html body #battle.k1 .k1jut>.act .ico.pix{width:15px!important;height:15px!important;min-height:15px!important}
  #battle.k1 #bunits>.ucard .bar.ck,#battle.k1 #bunits>.ucard .bar.st{display:none}
  #battle.k1 #turn330{display:none!important}
}
}

/* 636i: "Large" interface size on a small phone (layout only ~330 px wide, ~680 px high): the technique buttons drop their second line so the fight still fits */
@media (max-width:1039px) and (max-height:700px) and (max-width:345px){
  html body #battle.k1 .k1jut>.act small{display:none!important}
}
