/* The Grand Court has a reserved HUD band: no tower, health bar or bridge sits
   beneath a score panel. The existing hand, energy and deployment controls stay
   in the same reading order in the document. */
.battle-game {
  --court-ink:#102f39;
  --court-gold:#d4b676;
  background:radial-gradient(ellipse at 50% 38%,#748d7c 0,#405f5b 48%,#193c43 100%);
}
.battle-game .battle-game-hud {
  position:relative;inset:auto;flex:0 0 calc(100px + env(safe-area-inset-top));
  height:calc(100px + env(safe-area-inset-top));align-items:flex-start;
  padding:calc(9px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 37px max(12px,env(safe-area-inset-left));
  background:linear-gradient(115deg,#183d45,#102b38 70%);
  border-bottom:1px solid #c5ab6e88;
  box-shadow:inset 0 -3px #081d2777,0 3px 12px #102a3240;
}
.battle-game-hud .battle-rival { align-items:center;gap:8px; }
.battle-game-hud .battle-rival-badge { width:32px;height:39px; }
.battle-game-hud .battle-rival strong { color:#ffedbf;max-width:200px; }
.battle-game-hud .battle-rival small { color:#aacbc7;font-size:10px;letter-spacing:.5px;line-height:1.5; }
.battle-game #battle-clock {
  min-width:70px;min-height:49px;border:1px solid #d5b879;border-radius:9px;
  background:linear-gradient(#294c50,#17353d);box-shadow:inset 0 1px #e8d9a640,0 3px #061f2b;
}
.battle-game #battle-clock:before { color:#cfddcf; }
.battle-game .battle-menu-button {
  min-width:44px;min-height:48px;border:1px solid #88b2b5;border-radius:10px;
  background:linear-gradient(#39646c,#1b414f);box-shadow:inset 0 1px #c6e0d955,0 3px #08242f;
}
.battle-game .battle-crown-line {
  z-index:12;
  top:calc(66px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));
  width:112px;height:27px;padding:2px 8px;border-color:#8bafa477;
  background:#0c273599;box-shadow:inset 0 1px #e3edce19;
}
.battle-game .battle-crown-line strong { font-size:21px; }
.battle-game #battle-phase {
  z-index:12;
  top:calc(67px + env(safe-area-inset-top));left:max(13px,env(safe-area-inset-left));
  padding:4px 8px;font-size:10px;border-color:#8aa8a366;
  background:#193f47;color:#d6e9df;
}
.battle-game .battle-playfield { background:transparent; }
.battle-game #online-arena {
  background:radial-gradient(ellipse at 50% 36%,#7f9781 0,#456862 53%,#21434a 100%);
}
.battle-game .battle-connection { top:10px;background:#102f40f2;border-color:#a7c4b8;font-size:12px; }
.battle-game .battle-connection-actions { top:67px; }
.battle-game .battle-controls {
  border-top:2px solid #d4b676;
  background:linear-gradient(120deg,#274e55,#153543 68%,#112d3c);
  box-shadow:inset 0 2px #e9d8a543,0 -3px #102732,0 -8px 22px #0d283555;
}
.battle-controls .battle-hand-card {
  border-color:#bfcece;box-shadow:inset 0 0 0 2px #244a62,inset 0 2px #f4ffef99,0 4px #071f32,0 5px 5px #071c3380;
}
.battle-controls .battle-hand-card.selected { border-color:#ffe7a0; }
.battle-controls .battle-hand-card>strong { bottom:27px;min-height:27px; }
.battle-controls .hand-evolution { position:absolute;z-index:3;top:4px;left:4px;display:grid;place-items:center;width:18px;height:18px;border:1px solid #e7c47b;border-radius:5px;background:#49366de8;color:#ffeaa2;font:800 13px/1 system-ui;text-shadow:0 1px #342346; }
.battle-controls .battle-lane-actions button { border-color:#a3c7bd;background:linear-gradient(#335d63e8,#193b4aee); }
.battle-controls .battle-lane-actions>span { background:#102f3ce8;color:#e9efda;border:1px solid #97ada644; }
.battle-controls .hand-kind { background:#102f46e8; }
.is-online-battle #online-root { background:#15353f; }
@media(max-width:374px) {
  .battle-game-hud .battle-rival strong { max-width:153px;font-size:17px; }
  .battle-game-hud .battle-rival small { font-size:9px; }
  .battle-game #battle-clock { min-width:61px;font-size:28px; }
}
@media(max-height:650px) and (orientation:portrait) {
  .battle-game .battle-game-hud { flex-basis:calc(88px + env(safe-area-inset-top));height:calc(88px + env(safe-area-inset-top));padding-top:calc(5px + env(safe-area-inset-top)); }
  .battle-game .battle-crown-line { top:calc(57px + env(safe-area-inset-top)); }
  .battle-game #battle-phase { top:calc(58px + env(safe-area-inset-top)); }
}
@media(max-height:500px) and (orientation:landscape) and (min-width:620px) {
  .is-online-battle #online-root { max-width:1180px;width:100%; }
  .battle-game { display:grid;grid-template-columns:minmax(0,1fr) 244px;grid-template-rows:76px minmax(0,1fr); }
  .battle-game .battle-game-hud { grid-column:1;grid-row:1;height:76px;padding-top:5px; }
  .battle-game .battle-playfield { grid-column:1;grid-row:2;min-height:0; }
  .battle-game .battle-crown-line { right:calc(244px + 12px);top:47px;height:24px; }
  .battle-game #battle-phase { top:48px;max-width:calc(100% - 390px);padding:3px 6px; }
  .battle-game .battle-controls {
    grid-column:2;grid-row:1 / 3;grid-template-columns:36px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 23px 38px;
    gap:10px 6px;padding:10px 9px max(7px,env(safe-area-inset-bottom));border-top:0;border-left:2px solid #bca66c;
  }
  .battle-controls .hand { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));height:100%;width:100%;gap:12px 7px;align-items:stretch; }
  .battle-controls .battle-hand-card { height:100%;min-height:76px; }
  .battle-controls .battle-hand-card>strong { font-size:10px;bottom:23px;min-height:25px; }
  .battle-controls .battle-hand-card .hand-energy { width:26px;height:28px;font-size:21px; }
  .battle-controls .battle-hand-card.selected { transform:none; }
  .battle-controls .battle-lane-actions { position:static;grid-column:1 / 3;grid-row:3;gap:7px; }
  .battle-controls .battle-lane-actions button { min-height:36px!important;height:36px;width:38px;min-width:38px;border-radius:8px; }
  .battle-controls .battle-lane-actions button:after { font-size:24px!important; }
  .battle-controls .battle-lane-actions>span { font-size:10px;padding:3px 6px; }
  .battle-controls .battle-placement-status { bottom:10px;left:10px;right:254px; }
}
/* Battle cards show elements as symbols, with names retained for screen readers. */
.battle-hand-element{display:flex;align-items:center;justify-content:center;min-height:24px}
.battle-hand-element .mt-rarity,.battle-hand-element .mt-element>span{display:none!important}
.battle-hand-element .mt-badges{margin:0!important;padding:0!important}
.battle-hand-element .mt-element{padding:3px!important;min-width:25px;justify-content:center}
.battle-hand-element .mt-element-mark{width:19px;height:19px}
