/* Portrait battlefield mock. 3×2 each side; full 2:3 cards scale to rank height. */
body[data-view="tcg-field"] .canvas {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.5rem 0.55rem 0.55rem;
}
.view-tcg-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 0;
}
.view-tcg-field[hidden] { display: none !important; }
.view-tcg-field .tcg-head { margin: 0 0 0.28rem; }
.tf-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.35rem;
}
.tf-turn {
  margin: 0;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
}
.tf-replay {
  flex: 0 0 auto;
  border: 1px solid var(--skin-line);
  border-radius: 0.45rem;
  padding: 0.2rem 0.5rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}
.tf-board {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.tf-side {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.tf-side.is-foe { color: #f0a8a8; }
.tf-side.is-you { color: #9fd4c8; }
.tf-ranks {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}
.tf-rank {
  container-type: size;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.08rem;
  border-radius: 0.4rem;
}
.tf-rank.is-wall {
  background: color-mix(in srgb, currentColor 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent);
}
.tf-lab {
  flex: 0 0 0.72rem;
  display: grid;
  place-items: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}
.tf-rank.is-wall .tf-lab { opacity: 1; }
.tf-cells {
  height: 100%;
  width: min(100%, calc(100cqh * 2 + 0.56rem));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.28rem;
  min-width: 0;
  min-height: 0;
}
.tf-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 0.32rem;
  background: #14161b;
}
.tf-cell.is-empty {
  border: 1px dashed color-mix(in srgb, var(--skin-muted) 45%, transparent);
  background: transparent;
}
.tf-unit {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--skin-line) 80%, #000);
  cursor: pointer;
  padding: 0;
  background: #14161b;
  color: inherit;
  font: inherit;
}
.tf-unit img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}
.tf-unit.is-it {
  border-color: #f4d35e;
  box-shadow: 0 0 0 2px #f4d35e;
  z-index: 2;
}
.tf-unit.is-mark {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px #ff6b6b;
  z-index: 2;
}
.tf-unit.is-hurt img { filter: saturate(0.85) brightness(0.92); }
.tf-unit.is-ko {
  opacity: 0.22;
  filter: grayscale(1);
  pointer-events: none;
  z-index: 0;
}
.tf-unit.is-ko img { filter: grayscale(1) brightness(0.65); }
.tf-unit.is-ko.is-it,
.tf-unit.is-ko.is-mark {
  border-color: color-mix(in srgb, var(--skin-line) 80%, #000);
  box-shadow: none;
}
.tf-mark,
.tf-hp {
  position: absolute;
  z-index: 1;
  line-height: 1;
  pointer-events: none;
}
.tf-mark {
  top: 0.16rem;
  left: 0.16rem;
  min-width: 0.85rem;
  padding: 0.08rem 0.16rem;
  border-radius: 0.2rem;
  background: rgb(8 10 12 / 0.72);
  font-size: 0.58rem;
  font-weight: 800;
}
.tf-hp {
  right: 0.16rem;
  bottom: 0.16rem;
  left: 0.16rem;
  height: 0.22rem;
}
.tf-bar {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: rgb(0 0 0 / 0.45);
  overflow: hidden;
}
.tf-bar i {
  display: block;
  height: 100%;
  background: #6fdf9a;
  transition: width 0.18s ease;
}
.tf-unit.is-hurt .tf-bar i { background: #ff8a8a; }
.tf-mid {
  flex: 0 0 auto;
  height: 2px;
  margin: 0.02rem 0.72rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--skin-accent, #c9a227) 70%, #fff);
}
.tf-hint {
  margin: 0.35rem 0 0;
  min-height: 2.1em;
  color: var(--skin-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}
.tf-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
  color: #f4d35e;
}
.tf-fx.is-def { color: #ff7a7a; }
.tf-arc {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 75%, transparent));
  opacity: 0;
}
.tf-arc.is-on { opacity: 1; }
.tf-unit.is-lunge-up { z-index: 4; transform: translateY(-12%); }
.tf-unit.is-lunge-down { z-index: 4; transform: translateY(12%); }
.tf-unit.is-hit { animation: tf-shake 0.4s ease; }
.tf-unit.is-boom img { animation: tf-impact 0.45s ease; }
@keyframes tf-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
}
@keyframes tf-impact {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); filter: brightness(1.35); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .tf-unit.is-lunge-up,
  .tf-unit.is-lunge-down { transform: none; }
  .tf-unit.is-hit,
  .tf-unit.is-boom img { animation: none; }
  .tf-arc { opacity: 1; }
  .tf-bar i { transition: none; }
}
@media (min-width: 700px) and (max-height: 820px) {
  .view-tcg-field { max-width: 34rem; }
  .tf-lab { font-size: 0.48rem; }
}
