.battle-screen {
  display: none;
  color: #f7f2e7;
  background: #111214;
}

.battle-screen.is-active { display: block; }

.battle-playmat {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 43%, rgba(236, 226, 201, .12), transparent 31%),
    linear-gradient(145deg, #282a2e 0 43%, #17181b 43% 57%, #25272b 57% 100%);
}

.battle-playmat::before {
  content: "";
  position: absolute;
  inset: 54px 0 116px;
  opacity: .14;
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(82%, 350px) auto;
  filter: grayscale(1) contrast(1.25);
  pointer-events: none;
}

.battle-playmat.mat-red::before { background-image: url("../images/card/play_mat/yoruaka_logo.png"); }
.battle-playmat.mat-circle::before { background-image: url("../images/card/play_mat/circle_logo.png"); }
.battle-playmat.mat-none::before {
  background-image:
    repeating-linear-gradient(126deg, transparent 0 28px, rgba(255,255,255,.09) 29px 30px),
    radial-gradient(circle, rgba(215,25,45,.9) 0 2px, transparent 3px);
  background-size: auto, 22px 22px;
}

.battle-playmat::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255,255,255,.025) 8.2% 8.5%, transparent 8.7% 91%, rgba(255,255,255,.025) 91.2% 91.5%, transparent 91.7%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.018) 40px);
}

.battle-topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: max(8px, env(safe-area-inset-top)) 12px 6px;
  border-bottom: 1px solid rgba(255,255,255,.22);
  background: rgba(8,9,11,.88);
  backdrop-filter: blur(8px);
}

.battle-opponent { display: flex; align-items: center; gap: 8px; min-width: 0; }
.battle-opponent-face { width: 46px; height: 38px; overflow: hidden; border: 1px solid #eee7d7; background: #aaa; }
.battle-opponent-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 17%; filter: none; }
.battle-opponent small, .battle-opponent strong { display: block; }
.battle-opponent small { color: #e44954; font: 800 6px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .11em; }
.battle-opponent strong { margin-top: 3px; overflow: hidden; font-family: "Yu Mincho", serif; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

.battle-turn-chip { min-width: 42px; padding: 4px 7px; border-inline: 1px solid rgba(255,255,255,.24); text-align: center; }
.battle-turn-chip small, .battle-turn-chip strong { display: block; }
.battle-turn-chip small { color: #aaa49a; font: 700 6px/1 ui-monospace, Consolas, monospace; letter-spacing: .15em; }
.battle-turn-chip strong { margin-top: 2px; font: 900 16px/1 Impact, sans-serif; }

.battle-menu-button {
  display: grid;
  place-content: center;
  gap: 4px;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 1px solid #eee7d7;
  color: #eee7d7;
  background: transparent;
  cursor: pointer;
}
.battle-menu-button span { display: block; width: 17px; height: 1px; background: currentColor; }
.battle-menu-button:hover, .battle-menu-button:focus-visible { color: #fff; border-color: #d7192d; outline: none; background: #d7192d; }

.field-side { position: absolute; z-index: 2; left: 0; right: 0; height: 300px; }
.enemy-field { top: 58px; }
.player-field { top: 358px; }
.field-side::before {
  content: "";
  position: absolute;
  inset: 8px 11px;
  border: 1px solid rgba(247,242,231,.16);
  clip-path: polygon(0 0, 94% 0, 100% 9%, 100% 100%, 6% 100%, 0 91%);
}

.field-resources { position: absolute; top: 14px; left: 16px; display: flex; align-items: center; gap: 6px; }
.enemy-resources { flex-direction: row-reverse; }
.deck-pile, .grave-pile {
  display: grid;
  place-items: center;
  width: 47px;
  height: 60px;
  padding: 4px;
  border: 1px solid rgba(247,242,231,.65);
  color: #f7f2e7;
  background: rgba(7,8,10,.72);
  box-shadow: 3px 3px 0 rgba(215,25,45,.55);
}
.grave-pile { cursor: pointer; }
.deck-pile span, .grave-pile span { font: 800 6px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.deck-pile strong, .grave-pile strong { margin-top: 5px; font: 900 17px/1 Impact, sans-serif; }
.grave-pile:hover, .grave-pile:focus-visible { border-color: #d7192d; outline: none; }

.enemy-hand { position: absolute; top: 12px; left: 50%; display: flex; transform: translateX(-50%); }
.card-back-mini { width: 25px; height: 38px; margin-left: -8px; border: 1px solid #e8e0d1; background: repeating-linear-gradient(135deg, #191a1d 0 4px, #b31323 5px 6px); box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.card-back-mini:first-child { margin-left: 0; }

.fighter-row { position: absolute; top: 80px; left: 50%; display: flex; align-items: flex-end; gap: 14px; transform: translateX(-50%); }
.main-slot, .sub-slots { display: flex; align-items: flex-end; justify-content: center; }
.main-slot { width: 94px; min-height: 136px; }
.sub-slots { gap: 7px; min-width: 135px; min-height: 110px; }
.main-slot:empty::before, .sub-slots:empty::before {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(247,242,231,.27);
  color: rgba(247,242,231,.34);
  font: 700 7px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .14em;
}
.main-slot:empty::before { content: "MAIN ATTACKER"; width: 72px; height: 104px; }
.sub-slots:empty::before { content: "SUB ATTACKER × 2"; width: 116px; height: 82px; }

.seed-zone { position: absolute; right: 17px; bottom: 14px; display: flex; align-items: center; gap: 4px; }
.seed-card { width: 30px; height: 45px; border: 1px solid #e6dece; background: linear-gradient(145deg, #8b1521, #21080c); box-shadow: inset 0 0 0 3px #17181b, 2px 2px 0 rgba(0,0,0,.45); }
.summon-cost-display { display: grid; place-items: center; align-self: stretch; min-width: 46px; padding: 4px 5px 3px; border: 1px solid rgba(238,231,216,.72); color: #f3eddf; background: rgba(9,10,12,.88); }
.summon-cost-display small { font: 700 6px/1.15 "Yu Gothic", sans-serif; letter-spacing: .04em; white-space: nowrap; }
.summon-cost-display strong { color: #fff; font: 900 20px/.9 Impact, "Arial Narrow", sans-serif; }

.field-divider {
  position: absolute;
  z-index: 3;
  top: 349px;
  left: 0;
  right: 0;
  height: 18px;
  border-block: 1px solid rgba(255,255,255,.28);
  background: rgba(7,8,10,.84);
}
.field-divider::before, .field-divider::after { content: ""; position: absolute; top: 8px; width: calc(50% - 24px); height: 1px; background: #d7192d; }
.field-divider::before { left: 0; }
.field-divider::after { right: 0; }
.field-divider span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) skewX(-12deg); color: #f7f2e7; font: 900 11px/1 Impact, sans-serif; }

.player-hand-zone {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  height: 128px;
  padding: 21px 82px 8px 12px;
  border-top: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(180deg, rgba(13,14,17,.91), #08090b);
  backdrop-filter: blur(8px);
}
.hand-label { position: absolute; top: 5px; left: 13px; right: 86px; display: flex; justify-content: space-between; color: #aaa49a; font: 700 7px/1 ui-monospace, Consolas, monospace; letter-spacing: .13em; }
.player-hand { display: flex; align-items: flex-end; height: 96px; margin-right: 84px; overflow: visible; padding: 2px 5px 4px; }
.player-hand::-webkit-scrollbar { display: none; }

.battle-actions { position: absolute; z-index: 7; right: 8px; bottom: 7px; display: grid; gap: 6px; width: 72px; }
.battle-action { min-height: 47px; padding: 5px 3px; border: 1px solid #f3eddf; color: #f3eddf; background: #101114; font-weight: 900; cursor: pointer; clip-path: polygon(9% 0, 100% 0, 100% 86%, 91% 100%, 0 100%, 0 14%); }
.battle-action-primary { font: 900 12px/1 Impact, sans-serif; letter-spacing: .08em; background: #b41424; }
.battle-action-secondary { font-size: 8px; line-height: 1.25; }
.battle-action:disabled { cursor: not-allowed; opacity: .28; filter: grayscale(1); }
.battle-action:not(:disabled):hover, .battle-action:not(:disabled):focus-visible { outline: 2px solid #d7192d; outline-offset: 2px; }

.battle-card {
  position: relative;
  flex: 0 0 auto;
  width: 63px;
  height: 91px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #f4eddf;
  color: #171719;
  background: #eee8da;
  box-shadow: 3px 4px 0 rgba(0,0,0,.43);
  user-select: none;
  touch-action: manipulation;
}
.battle-card.is-main { width: 82px; height: 119px; }
.battle-card.is-sub { width: 61px; height: 89px; }
.player-hand .battle-card { margin-left: -10px; transform-origin: 50% 100%; transition: transform 280ms cubic-bezier(.22,1,.36,1), margin 240ms cubic-bezier(.22,1,.36,1), box-shadow 240ms ease, outline-color 200ms ease; will-change: transform; cursor: pointer; }
.player-hand .battle-card:first-child { margin-left: 0; }
.player-hand .battle-card:hover, .player-hand .battle-card:focus-visible { z-index: 3; margin-right: 6px; outline: none; transform: translateY(-7px) rotate(-1deg); }
.player-hand[data-hand-count="6"] .battle-card { margin-left: -16px; }
.player-hand[data-hand-count="7"] .battle-card { margin-left: -20px; }
.player-hand[data-hand-count="8"] .battle-card { margin-left: -26px; }
.player-hand[data-hand-count="9"] .battle-card { margin-left: -31px; }
.player-hand[data-hand-count="6"] .battle-card:first-child,
.player-hand[data-hand-count="7"] .battle-card:first-child,
.player-hand[data-hand-count="8"] .battle-card:first-child,
.player-hand[data-hand-count="9"] .battle-card:first-child { margin-left: 0; }
.player-hand .battle-card:nth-child(1) { z-index: 1; }
.player-hand .battle-card:nth-child(2) { z-index: 2; }
.player-hand .battle-card:nth-child(3) { z-index: 3; }
.player-hand .battle-card:nth-child(4) { z-index: 4; }
.player-hand .battle-card:nth-child(5) { z-index: 5; }
.player-hand .battle-card:nth-child(6) { z-index: 6; }
.player-hand .battle-card:nth-child(7) { z-index: 7; }
.player-hand .battle-card:nth-child(8) { z-index: 8; }
.player-hand .battle-card:nth-child(9) { z-index: 9; }
.player-hand[data-hand-count="6"] .battle-card:hover,
.player-hand[data-hand-count="7"] .battle-card:hover,
.player-hand[data-hand-count="8"] .battle-card:hover,
.player-hand[data-hand-count="9"] .battle-card:hover,
.player-hand[data-hand-count="6"] .battle-card:focus-visible,
.player-hand[data-hand-count="7"] .battle-card:focus-visible,
.player-hand[data-hand-count="8"] .battle-card:focus-visible,
.player-hand[data-hand-count="9"] .battle-card:focus-visible { z-index: 12; margin-right: 0; }
.battle-card.is-selectable { box-shadow: 0 0 0 2px #e12b3c, 3px 4px 0 rgba(0,0,0,.43); }
.battle-card.is-tap-armed { z-index: 12 !important; outline: 3px solid #ff3045; outline-offset: 2px; box-shadow: 0 0 18px rgba(225,43,60,.95), 3px 4px 0 rgba(0,0,0,.43); transform: translateY(-10px) scale(1.025) !important; }
.battle-card.is-damaged { box-shadow: 0 0 0 2px #d7192d, 3px 4px 0 rgba(0,0,0,.43); }
.enemy-field .battle-card { transform: rotate(180deg); }
.enemy-field .battle-card.is-hit { animation: enemy-card-hit 360ms ease both; }
.player-field .battle-card.is-hit { animation: player-card-hit 360ms ease both; }

.battle-card-name { display: block; overflow: hidden; height: 14px; padding-right: 15px; border-bottom: 1px solid rgba(10,10,11,.3); font-family: "Yu Mincho", serif; font-size: 7px; font-weight: 800; line-height: 13px; white-space: nowrap; text-overflow: ellipsis; }
.battle-card-cost { position: absolute; z-index: 2; top: 2px; right: 2px; display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid #171719; border-radius: 50%; color: #f7f2e7; background: #b41424; font: 900 8px/1 Impact, sans-serif; }
.battle-card-art { position: relative; display: grid; place-items: center; height: 53px; margin-top: 3px; overflow: hidden; color: rgba(255,255,255,.9); background: linear-gradient(145deg, var(--card-accent, #5f6268), #17181b); font: 900 18px/1 "Yu Mincho", serif; }
.is-main .battle-card-art { height: 75px; font-size: 25px; }
.battle-card-art::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(132deg, transparent 0 12px, rgba(255,255,255,.1) 13px 14px); }
.battle-card-art.has-art { background: #fff; }
.battle-card-art img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.battle-card-effect { display: none; }
.battle-card-stats { position: absolute; left: 4px; right: 4px; bottom: 3px; display: flex; justify-content: space-between; gap: 3px; font: 650 8px/1.05 ui-monospace, Consolas, monospace; letter-spacing: -.015em; }
.is-main .battle-card-stats { font-size: 8px; }
.battle-card-stats .hp { color: #9a101d; }
.battle-card-stats .at { color: #151517; }

.phase-banner {
  position: absolute;
  z-index: 12;
  top: 43%;
  left: 22px;
  right: 22px;
  padding: 13px 18px;
  border-block: 1px solid #f3eddf;
  color: #f3eddf;
  text-align: center;
  background: rgba(8,9,11,.93);
  transform: skewX(-8deg);
  pointer-events: none;
  opacity: 0;
}
.phase-banner.is-visible { animation: phase-banner 900ms ease both; }
.phase-banner small, .phase-banner strong { display: block; transform: skewX(8deg); }
.phase-banner small { color: #db2737; font: 800 7px/1 ui-monospace, Consolas, monospace; letter-spacing: .2em; }
.phase-banner strong { margin-top: 5px; font-family: "Yu Mincho", serif; font-size: 20px; letter-spacing: .12em; }

.battle-toast {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: 137px;
  max-width: calc(100% - 40px);
  padding: 8px 13px;
  color: #161719;
  text-align: center;
  background: #f4eddf;
  box-shadow: 4px 4px 0 #d7192d;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-line;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
}
.battle-toast.is-visible { animation: toast-in 1700ms ease both; }

.battle-dialog {
  width: min(calc(100% - 28px), 390px);
  max-height: min(820px, calc(100svh - 28px));
  padding: 17px;
  overflow: auto;
  border: 0;
  color: #111214;
  background: #f5f0e6;
  box-shadow: 0 26px 80px rgba(0,0,0,.62);
}
.battle-dialog::backdrop { background: rgba(5,6,8,.82); backdrop-filter: blur(4px); }
.battle-dialog h2 { margin: 14px 39px 12px 0; font-family: "Yu Mincho", serif; font-size: 22px; }
.battle-dialog-body { color: #4e4b48; font-size: 11px; line-height: 1.7; }
.battle-dialog-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 7px; margin-top: 18px; }
.battle-dialog-actions button { min-height: 46px; padding: 8px 10px; border: 1px solid #111214; color: #111214; background: transparent; font-weight: 800; cursor: pointer; }
.battle-dialog-actions button.is-primary { color: #f7f2e7; background: #111214; }
.battle-dialog-actions button:hover, .battle-dialog-actions button:focus-visible { color: #fff; border-color: #b41424; outline: none; background: #b41424; }
.battle-dialog.is-result { padding-top: 30px; text-align: center; }
.battle-dialog.is-result .dialog-index { text-align: center; letter-spacing: .24em; }
.battle-dialog.is-result h2 {
  margin: 18px 0 16px;
  color: #b41424;
  font: 900 clamp(58px, 18vw, 78px)/.88 Impact, "Arial Black", sans-serif;
  letter-spacing: .06em;
  text-align: center;
  text-shadow: 3px 3px 0 #111214;
}
.battle-dialog.is-result .battle-dialog-body { text-align: center; }
.battle-dialog.is-result .battle-dialog-actions { margin-top: 24px; }
.battle-dialog-actions:empty { display: none; }

.battle-dialog.is-card-only { width: min(calc(100% - 18px), 328px); padding: 10px 40px 10px 10px; overflow: visible; background: transparent; box-shadow: none; }
.battle-dialog.is-card-only::backdrop { background: rgba(5,6,8,.9); backdrop-filter: blur(4px); }
.battle-dialog.is-card-only .dialog-index,
.battle-dialog.is-card-only > h2 { display: none; }
.battle-dialog.is-card-only .battle-dialog-body { color: inherit; }
.battle-dialog.is-card-only .battle-dialog-actions { grid-template-columns: 1fr; width: min(100%, 270px); margin: 8px auto 0; }
.battle-dialog.is-card-only .battle-dialog-actions button { min-height: 42px; color: #f7f2e7; border-color: #f7f2e7; background: rgba(13,14,17,.94); }
.battle-dialog.is-card-only .dialog-x { top: 10px; right: 2px; color: #f7f2e7; border-color: #f7f2e7; background: #111216; }

.battle-dialog.is-spotlight { width: min(calc(100% - 24px), 350px); padding: 16px; overflow: hidden; color: #f7f2e7; background: #0d0e11; box-shadow: 9px 9px 0 #c7182b, 0 30px 90px rgba(0,0,0,.8); animation: ace-spotlight-in 260ms cubic-bezier(.16,.86,.24,1.15) both; }
.battle-dialog.is-spotlight::backdrop { background: rgba(3,4,6,.94); backdrop-filter: blur(6px); }
.battle-dialog.is-spotlight .dialog-index { color: #f02b40; text-align: center; }
.battle-dialog.is-spotlight > h2 { margin: 13px 0 14px; color: #fff; font-size: 21px; text-align: center; }
.battle-dialog.is-spotlight .card-detail-card { width: min(100%, 292px); box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 18px 44px rgba(0,0,0,.72); }

.battle-dialog.is-ace-effect { width: min(calc(100% - 32px), 330px); padding: 15px 16px 16px; overflow: auto; animation: ace-spotlight-in 240ms cubic-bezier(.16,.86,.24,1.1) both; }
.battle-dialog.is-ace-effect::backdrop { background: rgba(3,4,6,.9); backdrop-filter: blur(5px); }
.battle-dialog.is-ace-effect .dialog-index { margin-bottom: 8px; color: #b41424; text-align: center; }
.battle-dialog.is-ace-effect > h2 { margin: 8px 0 12px; font-size: 18px; line-height: 1.4; text-align: center; }
.battle-dialog.is-ace-effect .card-detail-card { width: min(100%, 238px); padding: 8px; border-width: 4px; }
.battle-dialog.is-ace-effect .card-detail-name { padding: 5px 7px; font-size: 13px; }
.battle-dialog.is-ace-effect .card-detail-art { margin: 8px 7px; }
.battle-dialog.is-ace-effect .card-detail-effect { min-height: 45px; margin: 0 7px 7px; padding: 7px; font-size: 9px; }
.battle-dialog.is-ace-effect .card-detail-stats { padding-inline: 7px; font-size: 14px; }
.battle-dialog.is-ace-effect .battle-dialog-actions { grid-template-columns: 1fr; width: min(100%, 238px); margin: 12px auto 0; }
.battle-dialog.is-ace-effect .battle-dialog-actions button { min-height: 42px; }

.ace-dialog { width: min(calc(100% - 24px), 334px); max-height: calc(100svh - 24px); padding: 0; overflow: visible; border: 0; color: #f7f2e7; background: transparent; box-shadow: none; animation: ace-spotlight-in 260ms cubic-bezier(.16,.86,.24,1.15) both; cursor: pointer; }
.ace-dialog::backdrop { background: rgba(3,4,6,.94); backdrop-filter: blur(6px); }
.ace-dialog .card-detail { margin: 0; }
.ace-dialog .card-detail-card { width: min(calc(100vw - 36px), 310px); box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 18px 44px rgba(0,0,0,.72); }

.card-detail { margin: -2px 0 0; }
.card-detail-card { width: min(100%, 270px); margin: 0 auto; padding: 10px; border: 5px solid #18191c; background: #eee8da; box-shadow: none; }
.card-detail-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid #18191c; color: #18191c; background: #f7f2e7; font-family: "Yu Mincho", serif; font-size: 15px; font-weight: 800; }
.card-detail-cost { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #18191c; border-radius: 50%; color: #fff; background: #b41424; font: 900 14px/1 Impact, sans-serif; }
.card-detail-art { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; margin: 10px 8px; overflow: hidden; color: rgba(255,255,255,.93); background: linear-gradient(145deg, var(--card-accent, #62656b), #161719); font: 900 52px/1 "Yu Mincho", serif; }
.card-detail-art.has-art { aspect-ratio: 3 / 4; background: #fff; }
.card-detail-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-detail-art.has-art img { position: absolute; inset: 0; height: 100%; }
.card-detail-art.is-zoomable { cursor: zoom-in; touch-action: none; user-select: none; -webkit-user-select: none; }
.card-detail-art.is-zoomable img { -webkit-user-drag: none; }
.card-detail-effect { min-height: 55px; margin: 0 8px 9px; padding: 8px; border: 1px solid #18191c; color: #18191c; background: rgba(255,255,255,.45); font-size: 10px; line-height: 1.55; }
.card-detail-effect.is-usable { color: #075fc9; border-color: #075fc9; cursor: pointer; }
.card-detail-stats { display: flex; justify-content: space-between; gap: 12px; padding: 2px 8px 3px; color: #18191c; font: 600 16px/1.3 ui-monospace, "Yu Gothic", Consolas, monospace; letter-spacing: 0; }
.card-detail-note { margin: 13px 2px 0; color: #69635d; font-size: 9px; text-align: center; }

.card-art-dialog { width: fit-content; max-width: calc(100vw - 24px); max-height: calc(100svh - 24px); padding: 12px; overflow: visible; border: 1px solid #18191c; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.68); }
.card-art-dialog::backdrop { background: rgba(5,6,8,.9); backdrop-filter: blur(4px); }
.card-art-dialog img { display: block; width: auto; height: auto; max-width: calc(100vw - 50px); max-height: calc(100svh - 84px); object-fit: contain; }
.catalog-card-art img, .card-detail-art img, .battle-card-art img, .card-art-dialog img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.card-art-dialog p { margin: 8px 32px 0 0; color: #625d57; font-size: 9px; }

.grave-list, .choice-list { display: grid; gap: 7px; }
.grave-list-item, .choice-list button { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px; border: 1px solid rgba(17,18,20,.3); color: #171719; text-align: left; background: rgba(255,255,255,.34); }
.choice-list button { width: 100%; cursor: pointer; }
.choice-list button:hover, .choice-list button:focus-visible { border-color: #b41424; outline: none; background: #fff; }
.choice-list button.is-selected { color: #fff; border-color: #b41424; background: #b41424; }
.choice-list button.is-selected small { color: #f2dfe1; }
.grave-list-art { display: grid; place-items: center; width: 34px; height: 38px; color: #fff; background: linear-gradient(145deg, var(--card-accent, #555), #171719); font-family: "Yu Mincho", serif; font-weight: 900; }
.grave-list-item small, .choice-list small { color: #746e67; font-size: 8px; }
.grave-list-item strong, .choice-list strong { font-family: "Yu Mincho", serif; font-size: 11px; }

.revealed-card-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.revealed-card { display: flex; min-width: 0; padding: 5px; flex-direction: column; gap: 5px; border: 1px solid #18191c; color: #18191c; text-align: left; background: #eee8da; }
button.revealed-card { width: 100%; cursor: pointer; }
button.revealed-card:hover, button.revealed-card:focus-visible { border-color: #b41424; outline: 2px solid #b41424; }
.revealed-card-name { min-height: 30px; font-family: "Yu Mincho", serif; font-size: 9px; font-weight: 800; line-height: 1.4; }
.revealed-card-art { position: relative; display: grid; width: 100%; aspect-ratio: 3 / 4; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--card-accent, #555), #171719); font-family: "Yu Mincho", serif; font-size: 26px; font-weight: 900; }
.revealed-card-art.has-art { background: #fff; }
.revealed-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.revealed-card-stats { font: 600 7px/1.45 ui-monospace, Consolas, monospace; }
.revealed-card em { color: #b41424; font-size: 7px; font-style: normal; font-weight: 800; }

.battle-result { text-align: center; }
.battle-result-word { margin: 12px 0; color: #b41424; font: 900 54px/.95 Impact, sans-serif; letter-spacing: .03em; }
.battle-result p { margin: 0; }

@keyframes phase-banner { 0% { opacity: 0; transform: translateX(30px) skewX(-8deg); } 18%,72% { opacity: 1; transform: translateX(0) skewX(-8deg); } 100% { opacity: 0; transform: translateX(-28px) skewX(-8deg); } }
@keyframes toast-in { 0%,100% { opacity: 0; transform: translate(-50%,8px); } 12%,82% { opacity: 1; transform: translate(-50%,0); } }
@keyframes enemy-card-hit { 40% { transform: rotate(180deg) translateY(-12px); filter: brightness(1.8); } }
@keyframes player-card-hit { 40% { transform: translateY(12px); filter: brightness(1.8); } }
@keyframes ace-spotlight-in { from { opacity: 0; transform: scale(.72) rotate(-2deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

@media (max-height: 760px) {
  .field-side { height: 245px; }
  .enemy-field { top: 54px; }
  .player-field { top: 306px; }
  .field-divider { top: 298px; }
  .fighter-row { top: 64px; }
  .battle-card.is-main { width: 69px; height: 101px; }
  .battle-card.is-sub { width: 54px; height: 79px; }
  .battle-card-art { height: 45px; }
  .is-main .battle-card-art { height: 62px; }
  .seed-zone { bottom: 7px; }
  .player-hand-zone { height: 112px; padding-top: 18px; }
  .player-hand { height: 82px; }
  .player-hand .battle-card { width: 56px; height: 80px; }
  .battle-actions { bottom: 6px; }
  .battle-action { min-height: 40px; }
  .battle-toast { bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .phase-banner.is-visible, .battle-toast.is-visible, .enemy-field .battle-card.is-hit, .player-field .battle-card.is-hit { animation-duration: .01ms !important; }
}
