/* Pokemon-like battle command layer for Core Beast. */
.battle-screen{
  grid-template-rows:52px 1fr 192px!important;
  grid-template-columns:minmax(260px,320px) 1fr minmax(260px,320px)!important;
  padding-bottom:10px!important;
}
.command-panel{
  grid-template-columns:1fr 420px!important;
  grid-template-areas:"dialog menu"!important;
  min-height:178px!important;
  padding:10px!important;
  gap:10px!important;
  overflow:visible!important;
  background:linear-gradient(180deg,rgba(13,19,31,.98),rgba(8,11,20,.98))!important;
  border:4px solid #be3d35!important;
  box-shadow:0 -8px 0 rgba(0,0,0,.28), inset 0 0 0 3px rgba(255,255,255,.06)!important;
}
.command-panel:before{display:none!important}
.battle-log{display:none!important}
.poke-dialog{
  grid-area:dialog;
  display:flex;
  align-items:center;
  min-width:0;
  height:100%;
  border:3px solid rgba(255,255,255,.16);
  background:#2d2538;
  box-shadow:inset 0 0 0 3px rgba(0,0,0,.25);
  padding:18px 22px;
  color:#fff;
  font-weight:900;
  font-size:clamp(22px,2.3vw,34px);
  line-height:1.35;
  letter-spacing:-.04em;
  word-break:keep-all;
  overflow-wrap:anywhere;
  white-space:normal;
  text-shadow:0 2px 0 rgba(0,0,0,.55);
}
.poke-menu{
  grid-area:menu;
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-auto-rows:1fr;
  gap:8px;
  height:100%;
  min-width:0;
  border:3px solid rgba(255,255,255,.16);
  background:#2d2538;
  padding:10px;
  box-shadow:inset 0 0 0 3px rgba(0,0,0,.25);
}
.poke-menu button,.poke-back{
  min-width:0;
  border:0;
  background:transparent;
  color:#fff;
  text-align:left;
  padding:8px 10px 8px 30px;
  font-weight:900;
  font-size:clamp(18px,1.9vw,28px);
  line-height:1.15;
  letter-spacing:-.04em;
  cursor:pointer;
  position:relative;
  overflow:visible;
  white-space:nowrap;
  text-shadow:0 2px 0 rgba(0,0,0,.55);
}
.poke-menu button:before,.poke-back:before{
  content:'▶';
  position:absolute;
  left:4px;
  top:50%;
  transform:translateY(-50%);
  opacity:0;
  font-size:.82em;
}
.poke-menu button:hover:before,.poke-menu button:focus-visible:before,.poke-back:hover:before,.poke-back:focus-visible:before{opacity:1}
.poke-menu button:disabled{opacity:.45;cursor:not-allowed}
.command-panel .side-actions{display:none!important}
.command-panel.poke-mode-main #teamBar,
.command-panel.poke-mode-main #moveGrid,
.command-panel.poke-mode-main .poke-back{display:none!important}
.command-panel.poke-mode-fight{
  grid-template-columns:1fr 150px!important;
  grid-template-areas:"moves back"!important;
}
.command-panel.poke-mode-fight .poke-dialog,
.command-panel.poke-mode-fight .poke-menu,
.command-panel.poke-mode-fight #teamBar{display:none!important}
.command-panel.poke-mode-fight #moveGrid{
  grid-area:moves;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  min-width:0;
}
.command-panel.poke-mode-team{
  grid-template-columns:1fr 150px!important;
  grid-template-areas:"team back"!important;
}
.command-panel.poke-mode-team .poke-dialog,
.command-panel.poke-mode-team .poke-menu,
.command-panel.poke-mode-team #moveGrid{display:none!important}
.command-panel.poke-mode-team #teamBar{
  grid-area:team;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  min-width:0;
}
.command-panel .poke-back{
  grid-area:back;
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  border:3px solid rgba(255,255,255,.16);
  background:#2d2538;
  box-shadow:inset 0 0 0 3px rgba(0,0,0,.25);
  padding-left:34px;
}
.move-btn{
  min-width:0!important;
  min-height:0!important;
  height:100%!important;
  padding:13px!important;
  border:3px solid rgba(255,255,255,.16)!important;
  background:#2d2538!important;
  box-shadow:inset 0 0 0 3px rgba(0,0,0,.18)!important;
  overflow:hidden!important;
}
.move-btn b{
  font-size:clamp(16px,1.45vw,23px)!important;
  line-height:1.18!important;
  white-space:normal!important;
  word-break:keep-all!important;
  overflow-wrap:anywhere!important;
}
.move-btn span,.move-btn small{
  font-size:12px!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.team-chip{
  min-width:0!important;
  height:100%!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  padding:12px!important;
  overflow:hidden!important;
}
.team-chip b{
  min-width:0;
  font-size:clamp(15px,1.25vw,21px)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.team-chip em{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.unit-box{overflow:visible!important}
.unit-head{min-width:0}.unit-head strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.unit-head span{white-space:nowrap}
.poke-toast{
  position:absolute;
  left:50%;
  bottom:218px;
  transform:translateX(-50%);
  z-index:20;
  border:3px solid rgba(255,255,255,.18);
  background:#2d2538;
  color:#fff;
  padding:12px 18px;
  font-weight:900;
  font-size:18px;
  box-shadow:0 14px 34px rgba(0,0,0,.42);
}
@media(max-width:900px){
  .battle-screen{grid-template-columns:1fr!important;grid-template-rows:auto auto auto 250px!important;min-height:100vh!important}
  .command-panel{grid-template-columns:1fr!important;grid-template-areas:"dialog" "menu"!important;min-height:238px!important;margin:0!important}
  .poke-dialog{min-height:92px;font-size:22px}.poke-menu{min-height:116px}.poke-menu button{font-size:20px}
  .command-panel.poke-mode-fight,.command-panel.poke-mode-team{grid-template-columns:1fr!important;grid-template-areas:"moves" "back"!important}
  .command-panel.poke-mode-team{grid-template-areas:"team" "back"!important}
  .command-panel.poke-mode-fight #moveGrid,.command-panel.poke-mode-team #teamBar{grid-template-columns:1fr!important;min-height:160px}
  .poke-back{min-height:54px}
}
