/* Final combat-role overrides. Loaded after styles.css by every game screen. */

.combat-phase-heading {
  display: flex;
  min-height: 112px;
  padding: 14px 18px;
  overflow: hidden;
}

.combat-flow {
  margin: -6px 8px 18px;
}

.duel-side[data-owner="you"],
.duel-side[data-owner="player-1"] {
  --active-frame-image: var(--frame-image-bronze) !important;
}

.duel-side[data-owner="opponent"],
.duel-side[data-owner="player-2"] {
  --active-frame-image: var(--frame-image-opponent) !important;
}

.duel-side.is-actionable-panel {
  z-index: 2;
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(var(--role-accent-rgb), 0.14), rgba(9, 8, 6, 0.4));
  box-shadow: inset 0 0 38px rgba(var(--role-accent-rgb), 0.12), 0 0 0 2px rgba(var(--owner-accent-rgb), 0.72), 0 0 34px rgba(var(--owner-accent-rgb), 0.28);
  animation: combat-action-pulse 2.4s ease-in-out infinite;
}

.duel-side.is-opponent-action {
  background: linear-gradient(180deg, rgba(var(--owner-accent-rgb), 0.11), rgba(8, 7, 6, 0.46));
  box-shadow: inset 0 0 36px rgba(var(--owner-accent-rgb), 0.12), 0 0 0 2px rgba(var(--owner-accent-rgb), 0.46);
}

.duel-side.is-locked-panel {
  background: linear-gradient(180deg, rgba(18, 16, 13, 0.7), rgba(8, 7, 6, 0.42));
}

.revealed-card.is-actionable,
.revealed-card.awaiting-side.is-actionable {
  border-color: var(--role-accent);
  box-shadow: 0 0 0 3px var(--card-owner-frame), 0 0 28px rgba(var(--role-accent-rgb), 0.3);
}

.revealed-card.is-opponent-action .revealed-card-visual,
.revealed-card.is-waiting .revealed-card-visual {
  filter: saturate(0.86) brightness(0.92);
}

.side-options.is-actionable button {
  min-height: 52px;
  border-color: rgba(var(--role-accent-rgb), 0.62);
  background: linear-gradient(90deg, rgba(var(--role-accent-rgb), 0.18), rgba(13, 11, 9, 0.92));
  color: #fff3d9;
}

.side-choice-status {
  border-color: rgba(var(--owner-accent-rgb), 0.38);
  background: rgba(9, 8, 7, 0.8);
}

.side-choice-status.is-locked {
  border-color: rgba(var(--role-accent-rgb), 0.48);
  background: linear-gradient(90deg, rgba(var(--role-accent-rgb), 0.12), rgba(9, 8, 7, 0.82));
}

.result-card-token {
  position: relative;
  padding-top: 25px;
  border-top: 3px solid var(--role-accent);
  box-shadow: 0 0 0 1px rgba(var(--owner-accent-rgb), 0.55);
}

.selected-cards-mini .result-card-token > img {
  height: calc(100% - 25px);
  object-fit: contain;
}

.resolution-card--attack {
  transform: translateX(-70px) rotateY(12deg) rotate(-3deg);
}

.resolution-card--defense {
  transform: translateX(70px) rotateY(-12deg) rotate(3deg);
}

.resolution-duel.is-visible .resolution-card--attack,
.resolution-duel.is-visible .resolution-card--defense {
  transform: translateX(0) rotateY(0) rotate(0) !important;
}

.resolution-card,
.resolution-card-placeholder {
  position: relative;
  border-top: 3px solid var(--role-accent);
  box-shadow: 0 0 0 2px rgba(var(--owner-accent-rgb), 0.64), 0 18px 34px rgba(0, 0, 0, 0.45);
}

.character-sheet-header[data-role] {
  border-bottom: 3px solid var(--role-accent);
  box-shadow: inset 0 -18px 32px rgba(var(--role-accent-rgb), 0.06);
}

@media (max-width: 960px) {
  .combat-flow {
    margin-inline: 2px;
  }
}

@media (max-width: 720px) {
  .combat-phase-heading {
    min-height: 0;
    padding: 12px;
  }

  .combat-flow {
    grid-template-columns: 1fr;
  }

  .result-combatants,
  .resolution-participants {
    grid-template-columns: 1fr;
  }

  .fighter-lane .fighter-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .fighter-lane .fighter-combat-badges {
    width: auto;
    align-items: flex-start;
    flex-direction: row;
  }

  .fighter-lane .combat-role-chip {
    min-height: 25px;
    padding: 2px 5px;
  }

  .fighter-lane .combat-role-chip > .combat-role-icon {
    width: 18px;
    height: 18px;
  }

  .fighter-lane .combat-role-chip small {
    display: none;
  }

  .fighter-lane .combat-role-chip strong {
    font-size: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .duel-side.is-actionable-panel {
    animation: none;
  }
}
