/* Ki Clash cinematic 2.5D presentation layer.
   Deliberately additive: keep battle geometry and game-state behavior in their existing files. */
:root {
  --game-bg: #07101e;
  --game-panel: #101d30;
  --game-panel-raised: #1a2b42;
  --game-text: #f4f7ff;
  --game-muted: #aebed3;
  --game-gold: #f6cc73;
  --game-teal: #68d9c4;
  --game-danger: #ff7a85;
  --game-action: #ff982f;
  --game-radius: 12px;
  --game-shadow: 0 8px 20px rgb(0 0 0 / .3);
}

body {
  background:
    radial-gradient(ellipse at 50% 0%, rgb(39 76 123 / .2), transparent 42%),
    linear-gradient(155deg, #080f1c 0%, #050a13 72%, #101522 100%);
  color: var(--game-text);
}

.game-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgb(246 204 115 / .26);
  background:
    linear-gradient(110deg, rgb(255 255 255 / .045), transparent 34%),
    linear-gradient(180deg, #151e2d, #0b111c 88%);
  box-shadow: 0 2px 0 rgb(0 0 0 / .48), 0 8px 22px rgb(0 0 0 / .2);
}

.game-title {
  filter: drop-shadow(0 2px 0 #491a13) drop-shadow(0 5px 8px rgb(0 0 0 / .5));
}

.game-header .btn-icon {
  border-color: rgb(187 205 233 / .28);
  background: linear-gradient(180deg, #26364d, #121e30 78%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .13), 0 2px 0 #050a12, 0 5px 10px rgb(0 0 0 / .25);
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.game-header .btn-icon:hover { filter: brightness(1.12); }
.game-header .btn-icon:active { box-shadow: inset 0 2px 4px rgb(0 0 0 / .38); }
.game-header .btn-icon:focus-visible,
#screen-battle.battle-cockpit button:focus-visible,
#screen-menu.arcade-menu button:focus-visible {
  outline: 2px solid var(--game-gold);
  outline-offset: 2px;
}

/* A quiet depth field behind the existing DOM cockpit. */
#screen-battle.battle-cockpit {
  background:
    linear-gradient(180deg, rgb(7 13 24 / .54), rgb(7 13 24 / .7)),
    radial-gradient(ellipse at 51% 39%, rgb(43 120 131 / .15), transparent 46%),
    url('/images/arena/namek-atmosphere.svg');
  background-position: center, center, center;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  color: var(--game-text);
}

#screen-battle.battle-cockpit .turn-banner {
  border: 1px solid rgb(142 220 235 / .58);
  background:
    linear-gradient(112deg, rgb(80 197 207 / .2), transparent 42%),
    linear-gradient(180deg, #1b3048, #0c1b2e);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 -3px 0 rgb(0 0 0 / .2), 0 4px 0 #07101c, 0 8px 16px rgb(0 0 0 / .24);
}

#screen-battle.battle-cockpit .turn-banner.is-opponent-turn {
  border-color: rgb(255 142 132 / .64);
  background: linear-gradient(110deg, rgb(160 62 82 / .32), transparent 42%), linear-gradient(180deg, #352333, #171523);
}

#screen-battle.battle-cockpit .turn-banner.is-defense {
  border-color: rgb(246 204 115 / .74);
  background: linear-gradient(110deg, rgb(177 113 24 / .34), transparent 44%), linear-gradient(180deg, #393126, #1a1d25);
}

#screen-battle.battle-cockpit .battle-opponent-hud,
#screen-battle.battle-cockpit .battle-player-hud {
  position: relative;
  border: 1px solid rgb(174 190 211 / .28);
  border-radius: var(--game-radius);
  background:
    linear-gradient(115deg, rgb(255 255 255 / .055), transparent 40%),
    linear-gradient(180deg, #1b2b40, #101a2a 82%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -3px 0 rgb(0 0 0 / .24), 0 3px 0 #060b12, 0 8px 18px rgb(0 0 0 / .2);
}

#screen-battle.battle-cockpit .battle-player-hud { border-color: rgb(104 217 196 / .34); }
#screen-battle.battle-cockpit .battle-opponent-hud { border-color: rgb(255 122 133 / .26); }

#screen-battle.battle-cockpit .hud-avatar {
  border: 1px solid rgb(255 255 255 / .42);
  background: linear-gradient(145deg, #39516d, #121e30 76%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .23), 0 2px 0 #050b12, 0 4px 9px rgb(0 0 0 / .35);
}

#screen-battle.battle-cockpit .life-bar-bg {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 99px;
  background: #080e18;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / .65), 0 1px 0 rgb(255 255 255 / .1);
}

#screen-battle.battle-cockpit .life-bar-fill {
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 0 9px currentColor;
}

#screen-battle.battle-cockpit .ki-counter-badge,
#screen-battle.battle-cockpit .deck-count-badge {
  border: 1px solid rgb(104 217 196 / .4);
  border-radius: 999px;
  background: linear-gradient(180deg, #243950, #102035);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .17), 0 2px 0 #07101a;
}

/* Landscape art gives the small play fields a quiet horizon. The projected
   floor is decorative and sits beneath cards; it never receives pointer input. */
#screen-battle.battle-cockpit .battlefield-row {
  isolation: isolate;
  border: 1px solid rgb(184 210 228 / .22);
  border-radius: 12px;
  background-image:
    linear-gradient(180deg, rgb(6 16 31 / .35), rgb(6 14 28 / .7)),
    url('/images/arena/namek-atmosphere.svg');
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .17), inset 0 -12px 28px rgb(0 0 0 / .26), 0 3px 0 #050a13, 0 7px 14px rgb(0 0 0 / .2);
}

#screen-battle.battle-cockpit .battlefield-row::before {
  z-index: 1;
  color: rgb(209 229 235 / .2);
  text-shadow: 0 1px 2px rgb(0 0 0 / .75);
  background: linear-gradient(180deg, rgb(6 13 25 / .04), rgb(6 13 25 / .18));
}

#screen-battle.battle-cockpit .battlefield-row::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 35% 4% 2%;
  border: 1px solid rgb(171 222 220 / .08);
  border-radius: 42% 42% 10px 10px / 22% 22% 10px 10px;
  background:
    linear-gradient(180deg, transparent, rgb(12 27 40 / .25)),
    repeating-linear-gradient(0deg, transparent 0 17px, rgb(166 214 210 / .075) 18px 19px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgb(166 214 210 / .06) 35px 36px);
  opacity: .72;
  pointer-events: none;
  transform: perspective(190px) rotateX(24deg);
  transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 100%);
}

#screen-battle.battle-cockpit .battlefield-row > * { z-index: 2; }
#screen-battle.battle-cockpit .battlefield-row .card { z-index: 3; }
#screen-battle.battle-cockpit .battle-player-field { border-color: rgb(104 217 196 / .45); }
#screen-battle.battle-cockpit .battle-opponent-field { border-color: rgb(255 152 159 / .32); }

/* Cards receive a physical shell, directional edge light and a readable inset. */
#screen-battle.battle-cockpit .card {
  isolation: isolate;
  border: 1px solid rgb(197 210 227 / .58);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / .12), transparent 22%),
    linear-gradient(160deg, #26344a, #121b2b 58%, #0b1421);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .3),
    inset 0 -3px 0 rgb(0 0 0 / .38),
    0 2px 0 #070c14,
    0 5px 0 #101a27,
    0 9px 15px rgb(0 0 0 / .44);
  transition: box-shadow 130ms ease, filter 130ms ease, border-color 130ms ease;
}

#screen-battle.battle-cockpit .card-inner {
  border: 1px solid rgb(255 255 255 / .08);
  border-radius: 6px;
  background: linear-gradient(180deg, rgb(255 255 255 / .035), transparent 30%);
}

#screen-battle.battle-cockpit .card-art {
  border: 1px solid rgb(220 231 244 / .32);
  box-shadow: inset 0 1px 4px rgb(0 0 0 / .55), 0 1px 0 rgb(255 255 255 / .12);
}

#screen-battle.battle-cockpit .card-cost {
  border-color: #f7fbff;
  background: linear-gradient(145deg, #a9f0ff, #30bde2 48%, #126a9b);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .8), 0 1px 0 #07516c, 0 2px 5px rgb(0 0 0 / .45);
}

#screen-battle.battle-cockpit .battle-hand-dock .card:hover,
#screen-battle.battle-cockpit .battle-hand-dock .card:focus-visible {
  border-color: var(--game-gold);
  filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .36), 0 2px 0 #4b3215, 0 8px 17px rgb(0 0 0 / .48), 0 0 0 2px rgb(246 204 115 / .32);
}

#screen-battle.battle-cockpit .battlefield-row .card:hover,
#screen-battle.battle-cockpit .battlefield-row .card:focus-visible {
  border-color: #e7f8ff;
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 2px 0 #0a111a, 0 10px 17px rgb(0 0 0 / .48), 0 0 0 2px rgb(104 217 196 / .24);
}

#screen-battle.battle-cockpit .card.selected-attacker {
  border-color: #ff9e75 !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .38), 0 2px 0 #542211, 0 8px 18px rgb(0 0 0 / .48), 0 0 0 2px rgb(255 158 117 / .78), 0 0 20px rgb(255 105 68 / .42) !important;
}

#screen-battle.battle-cockpit .card.selected-blocker {
  border-color: #a3f4ff !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .42), 0 2px 0 #074660, 0 8px 18px rgb(0 0 0 / .48), 0 0 0 3px rgb(104 217 255 / .74), 0 0 18px rgb(47 202 255 / .42) !important;
}

#screen-battle.battle-cockpit .card.targetable-block {
  border-color: #ffe29b !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .36), 0 2px 0 #55401c, 0 7px 16px rgb(0 0 0 / .42), 0 0 0 2px rgb(246 204 115 / .65) !important;
}

#screen-battle.battle-cockpit .battle-coach {
  border: 1px solid rgb(150 191 211 / .26);
  border-radius: 10px;
  color: var(--game-text);
  background: linear-gradient(115deg, rgb(246 204 115 / .09), transparent 48%), linear-gradient(180deg, #17263a, #0e1929);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), 0 3px 0 #070d17, 0 6px 12px rgb(0 0 0 / .16);
}

#screen-battle.battle-cockpit .battle-actions .action-btn {
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .28), inset 0 -3px 0 rgb(0 0 0 / .18), 0 3px 0 #080d16, 0 6px 12px rgb(0 0 0 / .25);
}

#screen-battle.battle-cockpit .battle-actions .action-btn:active {
  filter: brightness(1.12);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / .35), 0 1px 0 #080d16;
}

#screen-battle.battle-cockpit .player-deck-pile {
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / .42));
}

#screen-battle.battle-cockpit .player-deck-pile .deck-top-card {
  border: 1px solid rgb(255 229 157 / .88);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .42), 0 3px 0 #3b260f, 0 6px 12px rgb(0 0 0 / .34);
}

/* Retain the existing arcade menu's clear hierarchy while giving its surfaces
   matching material, less all-over glow and crisp focus. */
#screen-menu.arcade-menu {
  background:
    radial-gradient(ellipse at 50% 0%, rgb(72 131 180 / .2), transparent 42%),
    linear-gradient(150deg, #070e1a, #050912 74%, #111b2b);
}

#screen-menu .arcade-console {
  border-color: rgb(210 224 239 / .35);
  background:
    linear-gradient(130deg, rgb(255 255 255 / .09), transparent 26%),
    radial-gradient(ellipse at 50% -10%, rgb(87 152 195 / .18), transparent 55%),
    linear-gradient(160deg, #1a2a40, #101a2b 62%, #0a1220);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .17), inset 0 -8px 22px rgb(0 0 0 / .28), 0 5px 0 #060b14, 0 18px 38px rgb(0 0 0 / .5);
}

#screen-menu .arcade-key {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .48), inset 0 -3px 0 rgb(0 0 0 / .12), 0 3px 0 var(--key-edge), 0 7px 13px rgb(0 0 0 / .24);
}

#screen-menu .arcade-key:active { transform: translateY(2px); }

.settings-card,
.card-inspect-card {
  border: 1px solid rgb(204 223 244 / .4);
  background: linear-gradient(135deg, rgb(255 255 255 / .08), transparent 30%), linear-gradient(150deg, #1b2a40, #0c1524);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 6px 0 #080d17, 0 20px 52px rgb(0 0 0 / .55);
}

@media (max-width: 600px) {
  .game-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 7px 8px;
  }

  .logo-group {
    justify-content: center;
    min-width: 0;
    gap: 6px;
  }

  .game-title { font-size: 1.4rem; letter-spacing: .7px; }
  .game-header .subtitle { font-size: .62rem; letter-spacing: .5px; padding: 2px 4px; }

  .header-controls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .header-controls .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    padding: 4px 2px;
    font-size: .82rem;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #screen-battle.battle-cockpit .battlefield-row::after { inset-inline: 3%; }
  #screen-battle.battle-cockpit .card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), inset 0 -2px 0 rgb(0 0 0 / .35), 0 2px 0 #070c14, 0 4px 9px rgb(0 0 0 / .34); }
}

@media (max-width: 359px) {
  .header-controls .btn-icon { font-size: .76rem; }
}

@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  #screen-battle.battle-cockpit .battlefield-row .card:hover { translate: 0 -2px; }
}

@media (prefers-reduced-motion: reduce) {
  #screen-battle.battle-cockpit .card,
  #screen-battle.battle-cockpit .battle-actions .action-btn,
  .game-header .btn-icon,
  .battle-recap-toast,
  .combat-forecast-bar {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation: none !important;
  }
}

/* =========================================================
   TACTICAL COMBAT FORECAST, RECAP, BOT PERSONALITY & DOJO UX
   ========================================================= */

/* Bot Difficulty Selector in Main Menu */
.bot-difficulty-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid rgb(174 190 211 / .22);
  border-radius: 10px;
  background: rgb(11 20 35 / .75);
}

.bot-diff-label {
  color: var(--game-gold);
  font: 800 .72rem/1 Outfit, sans-serif;
  letter-spacing: .04em;
  margin-right: 2px;
}

.bot-diff-btn {
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid rgb(148 163 184 / .35);
  border-radius: 8px;
  color: #cbd5e1;
  background: linear-gradient(180deg, #1b2940, #0f1829);
  font: 700 .72rem/1.1 Outfit, sans-serif;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.bot-diff-btn:hover {
  border-color: rgb(246 204 115 / .6);
  color: #fff;
}

.bot-diff-btn.active {
  border-color: var(--game-gold);
  color: #07101e;
  background: linear-gradient(180deg, #ffe58c, #f5b335);
  font-weight: 900;
  box-shadow: 0 2px 8px rgb(245 179 53 / .35);
}

/* Arena Utility Pills next to Keyword Help 'i' button */
#screen-battle.battle-cockpit .keyword-help-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.arena-utility-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgb(104 217 196 / .52);
  border-radius: 999px;
  color: #e6fbff;
  background: linear-gradient(180deg, #1d354f, #0e1e32);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 2px 6px rgb(0 0 0 / .32);
  font: 800 .72rem/1 Outfit, sans-serif;
  cursor: pointer;
}

.arena-utility-pill.undo-pill {
  border-color: rgb(255 184 108 / .75);
  color: #fff3d6;
  background: linear-gradient(180deg, #523018, #2b180b);
}

.arena-utility-pill.dojo-pill {
  border-color: rgb(246 204 115 / .8);
  color: #fff6d1;
  background: linear-gradient(180deg, #4b3814, #261b08);
}

.arena-utility-pill.hidden {
  display: none !important;
}

/* Tactical Combat Forecast Bar inside .battle-actions */
#screen-battle.battle-cockpit .combat-forecast-bar {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  border: 1px solid rgb(104 217 196 / .48);
  border-radius: 10px;
  background:
    linear-gradient(120deg, rgb(41 116 138 / .24), transparent 52%),
    linear-gradient(180deg, #13253b, #0b1626);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 4px 12px rgb(0 0 0 / .28);
  color: var(--game-text);
  font-size: .72rem;
  line-height: 1.25;
}

#screen-battle.battle-cockpit .combat-forecast-bar.is-lethal {
  border-color: rgb(255 122 133 / .82);
  background:
    linear-gradient(120deg, rgb(185 45 64 / .32), transparent 55%),
    linear-gradient(180deg, #2e1726, #160d18);
}

#screen-battle.battle-cockpit .combat-forecast-bar.hidden {
  display: none !important;
}

.forecast-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.forecast-main-stat {
  font-weight: 900;
  color: #fff4bd;
  letter-spacing: .02em;
}

.forecast-lethal-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6b6b, #c92a2a);
  color: #fff;
  font: 900 .64rem/1.1 Outfit, sans-serif;
  letter-spacing: .05em;
}

.forecast-sub-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.forecast-pair-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgb(165 243 252 / .32);
  border-radius: 6px;
  background: rgb(7 16 30 / .68);
  color: #d9f7ff;
  font-size: .64rem;
  font-weight: 700;
}

.forecast-hint-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgb(246 204 115 / .36);
  border-radius: 6px;
  background: rgb(42 32 14 / .65);
  color: #fde68a;
  font-size: .63rem;
}

/* Non-blocking Battle Recap Toast */
.battle-recap-toast {
  position: fixed;
  z-index: 2350;
  top: max(54px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px));
  padding: 8px 14px;
  border: 1px solid rgb(246 204 115 / .78);
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(22 38 62 / .95), rgb(10 19 34 / .96));
  box-shadow: 0 8px 24px rgb(0 0 0 / .55), 0 0 16px rgb(246 204 115 / .24);
  color: #fff6d6;
  font: 800 .76rem/1.2 Outfit, sans-serif;
  text-align: center;
  pointer-events: none;
}

.battle-recap-toast.hidden {
  display: none !important;
}

/* On-Card Combat & Status Badges */
.card-combat-status {
  position: absolute;
  top: 22px;
  left: 3px;
  right: 3px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.combat-status-pill {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 5px;
  border-radius: 4px;
  font: 900 .52rem/1.15 Outfit, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 5px rgb(0 0 0 / .55);
}

.combat-status-pill.is-attacking {
  background: linear-gradient(90deg, #dc2626, #ea580c);
  border: 1px solid #fed7aa;
  color: #fff;
}

.combat-status-pill.is-blocking {
  background: linear-gradient(90deg, #0284c7, #0d9488);
  border: 1px solid #a5f3fc;
  color: #fff;
}

.combat-status-pill.is-dazzled {
  background: linear-gradient(90deg, #ca8a04, #eab308);
  border: 1px solid #fef08a;
  color: #090d16;
}

.combat-status-pill.is-dodge {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border: 1px solid #ddd6fe;
  color: #fff;
}

/* Dojo Progress & Star Badges */
.dojo-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgb(246 204 115 / .4);
  border-radius: 10px;
  background: rgb(12 23 41 / .82);
  color: #fde68a;
  font: 800 .8rem/1.2 Outfit, sans-serif;
}

.dojo-puzzle-item.dojo-solved {
  border-color: rgb(104 217 196 / .65);
  background: linear-gradient(135deg, rgb(16 54 62 / .55), rgb(15 26 44 / .88));
}

.dojo-stars-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgb(246 204 115 / .18);
  border: 1px solid rgb(246 204 115 / .55);
  color: #ffe58c;
  font-size: .72rem;
}

/* Scouter Battle Log & Other World Modal */
.battle-log-card {
  width: min(100%, 560px);
}

.battle-log-graveyards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.graveyard-box {
  padding: 8px 10px;
  border: 1px solid rgb(148 163 184 / .3);
  border-radius: 10px;
  background: rgb(9 16 29 / .75);
  font-size: .75rem;
}

.graveyard-box h4 {
  margin: 0 0 5px;
  color: #93c5fd;
  font-size: .76rem;
}

.graveyard-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.graveyard-card-pill {
  padding: 2px 6px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 6px;
  background: #17253b;
  color: #e2e8f0;
  font: 700 .68rem/1.1 Outfit, sans-serif;
  cursor: pointer;
}

.battle-log-entries {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgb(104 217 196 / .25);
  border-radius: 10px;
  background: rgb(5 11 21 / .82);
}

.battle-log-entry {
  padding: 5px 8px;
  border-left: 3px solid var(--game-teal);
  border-radius: 4px;
  background: rgb(18 32 52 / .68);
  color: #e2e8f0;
  font-size: .76rem;
  line-height: 1.3;
}

@media (max-width: 600px) {
  .battle-log-graveyards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =========================================================
   LEADING CARD GAME ERGONOMICS: RADAR, TRANSFORM, STAT & MULLIGAN POLISH
   ========================================================= */

/* Restore Dragon Radar visibility as a compact Scouter meter inside the cockpit HUD */
#screen-battle.battle-cockpit .dragon-radar-meter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid rgb(246 204 115 / .42);
  border-radius: 999px;
  background: rgb(8 18 34 / .88);
  font-size: .58rem;
  flex: 0 0 auto;
}

#screen-battle.battle-cockpit .radar-label {
  color: var(--game-gold);
  font-weight: 800;
}

#screen-battle.battle-cockpit .radar-balls-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

#screen-battle.battle-cockpit .radar-ball {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgb(30 41 59 / .9);
  border: 1px solid rgb(148 163 184 / .35);
  color: #64748b;
  font-size: .5rem;
  line-height: 1;
}

#screen-battle.battle-cockpit .radar-ball.collected {
  background: radial-gradient(circle at 35% 35%, #fff7ae, #f59e0b 65%, #b45309);
  border-color: #fef08a;
  color: #7c2d12;
  box-shadow: 0 0 6px rgb(251 191 36 / .65);
}

#screen-battle.battle-cockpit .btn-shenron {
  padding: 2px 7px;
  margin-left: 3px;
  border: 1px solid #fef08a;
  border-radius: 999px;
  background: linear-gradient(180deg, #34d399, #059669);
  color: #022c22;
  font: 900 .58rem/1.1 Outfit, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

#screen-battle.battle-cockpit .btn-shenron.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  #screen-battle.battle-cockpit .dragon-radar-meter {
    padding: 1px 4px;
    gap: 1.5px;
    flex: 0 0 auto;
  }

  #screen-battle.battle-cockpit .dragon-radar-meter .radar-label {
    display: none;
  }

  #screen-battle.battle-cockpit .radar-ball {
    width: 8px;
    height: 8px;
    font-size: .44rem;
  }

  #screen-battle.battle-cockpit .hud-info {
    min-width: 0;
    flex: 1 1 auto;
  }

  #screen-battle.battle-cockpit .hud-name {
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #screen-battle.battle-cockpit .hud-center {
    flex: 0 0 auto;
    min-width: 78px;
  }

  #screen-battle.battle-cockpit .life-bar-bg {
    min-width: 24px;
  }
}

/* Battlefield Card Inner Proportions: never clip ATK/DEF stats on desktop or phone */
#screen-battle.battle-cockpit .battlefield-row .card .card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 2px;
}

#screen-battle.battle-cockpit .battlefield-row .card .card-top,
#screen-battle.battle-cockpit .battlefield-row .card .card-badges,
#screen-battle.battle-cockpit .battlefield-row .card .card-stats {
  flex: 0 0 auto;
}

#screen-battle.battle-cockpit .battlefield-row .card .card-art {
  flex: 1 1 auto;
  min-height: 28px;
  height: auto;
  margin: 1px 0;
}

#screen-battle.battle-cockpit .battlefield-row .card .card-badges {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 2px;
}

#screen-battle.battle-cockpit .battlefield-row .card .card-type-label,
#screen-battle.battle-cockpit .battlefield-row .card .badge-keyword {
  min-height: 15px;
  padding: 1px 5px;
  font-size: .5rem;
}

@media (min-width: 601px) {
  #screen-battle.battle-cockpit .player-zone-main {
    justify-content: space-between;
    gap: 6px;
  }

  #screen-battle.battle-cockpit .battle-player-field {
    flex: 1 1 auto;
    align-items: center;
  }

  #screen-battle.battle-cockpit .battlefield-row .card {
    max-height: 128px;
    width: clamp(88px, 11vw, 114px);
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  #screen-battle.battle-cockpit .battlefield-row .card {
    height: 100%;
    min-height: 86px;
    max-height: 118px;
    padding: 3px;
  }

  #screen-battle.battle-cockpit .battlefield-row .card .card-stats {
    font-size: .58rem;
    line-height: 1.05;
  }
}

/* Move UNAVAILABLE stamp to card center so ATK/DEF stats at bottom stay 100% readable */
#screen-battle.battle-cockpit .hand-card.cannot-play::after {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  opacity: .92;
}

/* Transform Discount & Synergy Highlights */
#screen-battle.battle-cockpit .hand-card.transform-ready {
  border-color: #fde047 !important;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .45),
    0 2px 0 #713f12,
    0 0 16px rgb(250 204 21 / .52) !important;
}

#screen-battle.battle-cockpit .card-cost.cost-discounted {
  border-color: #fef08a !important;
  color: #052e16 !important;
  background: linear-gradient(145deg, #bbf7d0, #34d399 55%, #059669) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .85), 0 0 10px rgb(52 211 153 / .7) !important;
}

/* Dynamic Combat Stat Coloring */
.stat-def.stat-damaged {
  color: #ff8e99 !important;
  font-weight: 900;
}

.stat-def.stat-buffed {
  color: #6ee7b7 !important;
  font-weight: 900;
}

.combat-status-pill.is-sick {
  background: rgb(30 41 59 / .92);
  border: 1px solid rgb(148 163 184 / .55);
  color: #cbd5e1;
}

/* Mulligan & Select All Attackers Pills */
.arena-utility-pill.mulligan-pill {
  border-color: rgb(147 197 253 / .72);
  color: #eff6ff;
  background: linear-gradient(180deg, #1e3a5f, #0f1f38);
}

.arena-utility-pill.attack-all-pill {
  border-color: rgb(252 165 165 / .78);
  color: #fff1f2;
  background: linear-gradient(180deg, #7f1d1d, #450a0a);
}

@media (prefers-reduced-motion: reduce) {
  #screen-battle.battle-cockpit .hand-card.transform-ready {
    transition: none !important;
  }
}
