.battle-review-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(226, 186, 99, .65);
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(190, 139, 55, .12), transparent 70%),
    linear-gradient(180deg, rgba(22, 20, 17, .98), rgba(6, 9, 11, .98));
  box-shadow: inset 0 1px rgba(255, 224, 160, .08), inset 0 -2px rgba(0, 0, 0, .5);
  color: #f1d28f;
  text-align: center;
}
.battle-review-bar.hidden { display: none; }
.battle-review-bar button { white-space: normal; }
.battle-review-bar > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: "Cinzel", Georgia, serif;
  font-size: .72rem;
  line-height: 1.45;
  letter-spacing: .025em;
  text-shadow: 0 2px 3px #000;
}
:is(#battleLogFinalBtn, #pveBattleLogFinalBtn, #battleReviewRestoreBtn, #pveBattleRestoreBtn).battle-review-action {
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid #89683b;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(213, 166, 79, .16), transparent 70%),
    linear-gradient(180deg, #29251d, #121517 70%, #090c0e);
  color: #f2dfb6;
  -webkit-text-fill-color: #f2dfb6;
  font-family: "Cinzel", Georgia, serif;
  font-size: .74rem;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: .025em;
  text-shadow: 0 2px 3px #000;
  box-shadow: inset 0 1px rgba(255, 224, 160, .12), inset 0 -2px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .4);
  white-space: normal;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
:is(#battleLogFinalBtn, #pveBattleLogFinalBtn).battle-review-action {
  width: 100%;
  font-size: .68rem;
  padding-inline: 8px;
}
@media (hover: hover) {
  :is(#battleLogFinalBtn, #pveBattleLogFinalBtn, #battleReviewRestoreBtn, #pveBattleRestoreBtn).battle-review-action:hover:not(:disabled) {
    border-color: #cba05e;
    background: linear-gradient(180deg, #3b3020, #1d1b17 75%, #0e1112);
  }
}
:is(#battleLogFinalBtn, #pveBattleLogFinalBtn, #battleReviewRestoreBtn, #pveBattleRestoreBtn).battle-review-action:focus-visible {
  outline: 2px solid #f1d28f;
  outline-offset: 2px;
}
body.battle-review-active .hand-panel h3,
body.battle-review-active #handCards,
body.battle-review-active #handScrollBar { display: none !important; }
.battle-result-reason { margin: 12px 0; padding: 10px; background: rgba(0, 0, 0, .3); border-radius: 6px; }
.battle-result-reason h3 { font-size: 1rem; margin: 0 0 6px; color: #f1d28f; }
#battleResultReason, #pveBattleResultReason { white-space: pre-line; overflow-wrap: anywhere; font-size: .85rem; }
.battle-log-final { border: 1px solid #d9b06a; color: #f1d28f; background: rgba(128, 90, 28, .18); white-space: pre-line; }
.battle-log-context { display: block; opacity: .8; font-size: .8em; margin-bottom: 3px; }
.creature-effect-cue {
  position: fixed; z-index: 1200; pointer-events: none;
  transform: translate(-50%, -50%); padding: 4px 8px; border-radius: 6px;
  border: 1px solid #d9b06a; background: rgba(15, 20, 18, .94); color: #f1d28f;
  font-size: clamp(10px, 1vw, 13px); line-height: 1.25; text-align: center;
  max-width: min(200px, 85vw); box-shadow: 0 2px 8px #0008;
  animation: creature-effect-cue 1.4s ease-out both;
}
.creature-effect-frost { color: #ddf6ff; border-color: #9bd9ee; background: rgba(10, 30, 45, .94); }
.card .card-art { position: relative; }
.card-frostbite-overlay {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: url('assets/effects/frost damage.png') center / 100% 100% no-repeat;
  opacity: .66;
  mask-image: radial-gradient(ellipse at center, #0005 12%, #000 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #0005 12%, #000 78%);
}
.creature-effect-fire { color: #ffdfb6; border-color: #ee9451; background: rgba(45, 20, 10, .94); }
.creature-effect-impact {
  position: fixed; z-index: 1199; pointer-events: none;
  background: url('assets/effects/frost damage.png') center / contain no-repeat;
  transform: translate(-50%, -50%); animation: creature-effect-impact 1.1s ease-out both;
}
.creature-effect-impact[data-variant="fire"] {
  background-image: url('assets/ui/danno fuoco.webp');
  transform-origin: center;
  animation: creature-fire-impact 1.1s cubic-bezier(.16, .7, .3, 1) both;
  filter: drop-shadow(0 0 7px #ff7b22);
  isolation: isolate;
}
.creature-effect-impact[data-variant="spell"] {
  background-image: url('assets/effects/spell damaged.webp');
}
.creature-effect-impact[data-variant="fire"]::before,
.creature-effect-impact[data-variant="fire"]::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.creature-effect-impact[data-variant="fire"]::before {
  z-index: -1;
  background: radial-gradient(ellipse at center, #fff4b9b3 0%, #ffb52b80 20%, #ff4a182e 45%, transparent 68%);
}
.creature-effect-impact[data-variant="fire"]::after {
  background: url('assets/ui/danno fuoco.webp') center / contain no-repeat;
  opacity: 0;
  transform-origin: center;
  animation: creature-fire-tongues 1.1s ease-out both;
}
@keyframes creature-effect-cue {
  0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes creature-effect-impact {
  0%, 65% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes creature-fire-impact {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.08); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(.32); }
  38% { opacity: 1; transform: translate(-50%, -50%) scale(.78); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72% { opacity: .85; transform: translate(-50%, -50%) scale(.98, 1); }
  86% { opacity: .45; transform: translate(-50%, -52%) scale(1, .98); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1); }
}
@keyframes creature-fire-tongues {
  0%, 12% { opacity: 0; transform: translateY(3%) scale(.7, .8); }
  30% { opacity: .45; transform: translateY(-2%) scale(.88, 1); }
  48% { opacity: .3; transform: translate(-2%, -5%) scale(.94, 1.04); }
  65% { opacity: .5; transform: translate(2%, -9%) scale(.9, 1.08); }
  82% { opacity: .2; transform: translate(-1%, -14%) scale(.85, 1.12); }
  100% { opacity: 0; transform: translateY(-20%) scale(.8, 1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .creature-effect-impact, .creature-effect-cue,
  .creature-effect-impact[data-variant="fire"],
  .creature-effect-impact[data-variant="fire"]::after { animation: none; }
}
.log-panel .panel-header-row { flex-wrap: wrap; }
#battleLogFinalBtn { font-size: .72rem; padding: 5px 7px; flex-basis: 100%; width: 100%; white-space: normal; grid-column: 1 / -1; grid-row: 2; }
#closeLogPanelBtn { grid-column: 3; grid-row: 1; }
#resultOverlay .result-card, #pveResultOverlay .result-card { max-height: 94dvh; overflow-y: auto !important; }
:is(#resultOverlay, #pveResultOverlay).result-overlay .result-card {
  padding-top: 78px;
  justify-content: safe flex-end;
}
:is(#resultOverlay, #pveResultOverlay) .result-card > :not(.result-art) {
  flex-shrink: 0;
}
:is(#resultAnalyzeBtn, #pveBattleAnalyzeBtn).battle-analysis-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 10px 18px;
  border: 1px solid #98544a;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(205, 109, 73, .18), transparent 70%),
    linear-gradient(180deg, #592525, #311314 70%, #210d10);
  color: #f7dfbd;
  -webkit-text-fill-color: #f7dfbd;
  font-family: "Cinzel", Georgia, serif;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .035em;
  text-shadow: 0 2px 3px #000;
  box-shadow: inset 0 1px rgba(255, 214, 163, .14), inset 0 -2px rgba(0, 0, 0, .5), 0 5px 16px rgba(0, 0, 0, .55);
  white-space: normal;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
@media (hover: hover) {
  :is(#resultAnalyzeBtn, #pveBattleAnalyzeBtn).battle-analysis-btn:hover:not(:disabled) {
    border-color: #c68468;
    background: linear-gradient(180deg, #73332d, #421b1b 75%, #2c1114);
  }
}
:is(#resultAnalyzeBtn, #pveBattleAnalyzeBtn).battle-analysis-btn:focus-visible {
  outline: 2px solid #f1d28f;
  outline-offset: 3px;
}
@media (max-width: 680px) and (orientation: portrait) {
  :is(#resultOverlay, #pveResultOverlay).result-overlay .result-card { padding-top: 72px; }
  :is(#resultAnalyzeBtn, #pveBattleAnalyzeBtn).battle-analysis-btn { top: 14px; right: 14px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  :is(#resultOverlay, #pveResultOverlay).result-overlay .result-card { padding-top: 66px; }
  :is(#resultAnalyzeBtn, #pveBattleAnalyzeBtn).battle-analysis-btn {
    top: 12px;
    right: 14px;
    padding: 8px 12px;
    font-size: .7rem;
  }
  .battle-review-bar { padding: 5px 8px; gap: 4px 8px; font-size: .7rem; }
  .battle-review-bar > span { font-size: .62rem; }
  :is(#battleLogFinalBtn, #pveBattleLogFinalBtn, #battleReviewRestoreBtn, #pveBattleRestoreBtn).battle-review-action {
    padding: 6px 10px;
    font-size: .65rem;
  }
  :is(#resultOverlay, #pveResultOverlay) .battle-result-reason { padding: 6px; margin: 6px 0; }
  :is(#resultOverlay, #pveResultOverlay) .battle-result-reason h3 { font-size: .85rem; }
  :is(#resultOverlay, #pveResultOverlay) .battle-result-reason p { margin: 0; font-size: .75rem; line-height: 1.3; }
  #resultOverlay .result-actions { gap: 5px; }
}
