/* The player's combat screen (sub-project 3D): the board overlay's frame. Tokens only. */

:root {
  --player-band-h: 44vh;
}

.anima-workspace--player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
}

.anima-workspace--player > .anima-whiteboard-body {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.anima-workspace--player .anima-whiteboard-stage {
  background: var(--board);
}

.anima-player-region {
  min-width: 0;
  min-height: 0;
}

.anima-player-region--aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
}

/* Over the top-left corner of the stage, which fills its pane; it never takes a gesture. */
.anima-player-board-hint {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  margin: 0;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
}

/* iPad portrait: the aside is a band under the board, scrolling on its own. */
@media (max-width: 1023.98px) {
  .anima-workspace--player {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) var(--player-band-h);
  }

  .anima-player-region--aside {
    overflow: auto;
  }

  /* Two columns (ruling 1): « me » and the initiative on the left, MES ACTIONS on the right, so
     « Terminer mon tour » and the Mode select are on screen without scrolling. */
  .anima-player-region--aside .anima-player-aside {
    display: grid;
    /* Fills the band, so the initiative card and the actions column reach its bottom edge
       instead of leaving it empty; taller content still scrolls the band. */
    flex: 1 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
  }

  .anima-player-region--aside .anima-player-me,
  .anima-player-region--aside .anima-player-order {
    grid-column: 1;
  }

  .anima-player-region--aside .anima-player-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .anima-player-region--aside .anima-player-aside-empty {
    grid-column: 2;
  }
}

/* The turn banner (mockup [PlayerCombat]): the accent strip above the workspace. */
.anima-player-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 20px;
  background: var(--accent);
  color: var(--on-accent);
}

.anima-player-banner-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.anima-player-banner-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anima-player-banner-board {
  flex-shrink: 0;
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--on-accent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
}

/* The « Mon combat » aside: three cards, the last one taking the free height. */
.anima-player-aside {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.anima-player-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.anima-player-heading {
  margin: 0 0 var(--space-1);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--muted);
}

.anima-player-me-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.anima-player-me .anima-character-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.anima-player-me-name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anima-player-me-sheet {
  min-height: var(--touch-min);
  padding: 0 var(--space-2);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: underline;
}

.anima-player-gauge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
}

.anima-player-gauge-label {
  flex-shrink: 0;
  width: 2rem;
  color: var(--ink);
}

.anima-player-gauge .anima-participant-hp,
.anima-player-gauge .anima-participant-hp-toggle {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

.anima-player-gauge .anima-hp-bar {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.anima-player-gauge .anima-hp-bar-track,
.anima-player-fatigue-track {
  height: 10px;
  border-radius: 5px;
}

.anima-player-gauge .anima-hp-bar-label {
  color: var(--ink);
}

.anima-player-fatigue-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-2);
}

.anima-player-fatigue-fill {
  display: block;
  height: 100%;
  background: var(--fatigue);
}

.anima-player-fatigue-value {
  font-family: var(--font-num);
  color: var(--ink);
}

.anima-player-order {
  gap: var(--space-1);
}

.anima-player-order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
}

.anima-player-order-row.is-acting {
  background: var(--selected);
}

.anima-player-order-init {
  width: 40px;
  font-family: var(--font-num);
  color: var(--accent);
}

.anima-player-order-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anima-player-order-row.is-me .anima-player-order-name {
  font-weight: 700;
}

.anima-player-order-note {
  font-size: 0.8rem;
  color: var(--muted);
}

.anima-player-actions {
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
}

.anima-player-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.anima-player-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

.anima-player-action--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.anima-player-action-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.anima-player-action-hint {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Out of my turn, or while a result shows: they read as unavailable; the hint says why. */
.anima-player-action:disabled,
.anima-player-action--primary:disabled {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.anima-player-hint,
.anima-player-aside-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.anima-player-aside-empty {
  padding: 0 var(--space-1);
}

.anima-player-spacer {
  flex: 1 1 auto;
}

.anima-player-end-turn {
  min-height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.anima-player-end-turn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

/* The ambient FAB stays (players have no other mute): it moves to the board's bottom-left corner,
   off the aside, and sits above the board's measure readout (`.anima-wb-measure`, bottom-left of
   the board) so it hides neither. On a wide screen the board's bottom is the screen's (workspace
   padding 14 + 16); in portrait the board ends above the band, whose height is fixed for that
   reason. */
body:has(.anima-whiteboard-overlay--player) .anima-ambient-fab {
  right: auto;
  bottom: var(--player-fab-bottom, 104px);
  left: 28px;
}

@media (max-width: 1023.98px) {
  body:has(.anima-whiteboard-overlay--player) .anima-ambient-fab {
    bottom: calc(var(--player-band-h) + var(--player-fab-bottom, 104px));
  }
}

/* ========== Defense and counterattack short modals (3D, task 4) ==========
   Mockups [PlayerCombatDefense], [PlayerCombatCounterDark]: an accent eyebrow, a serif title, one
   sentence, then big touch choices. The box itself is the socle's `.anima-modal--short` (520 px). */
.anima-modal-eyebrow {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

.anima-defense-modal h4,
.anima-counter-modal h4 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.22rem;
}

.anima-defense-modal .anima-modal-subtitle,
.anima-counter-modal .anima-modal-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.anima-defense-modal form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.anima-defense-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* A single option (fear: PsR only) spans both columns. */
.anima-defense-choice:only-child {
  grid-column: 1 / -1;
}

.anima-defense-choice {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}

.anima-defense-choice[aria-pressed='true'] {
  border: 2px solid var(--accent);
  background: var(--selected);
}

.anima-defense-choice-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.anima-defense-choice-value {
  font-family: var(--font-num);
  font-size: 1rem;
}


.anima-counter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--space-3);
}

.anima-counter-ignore,
.anima-counter-attack {
  height: 56px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.anima-counter-ignore {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
}

.anima-counter-attack {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
}

.anima-counter-modal {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* The defense's actions follow the counterattack choice's: the accent primary and an outline. */
.anima-defense-submit,
.anima-defense-cancel {
  min-height: 56px;
  padding: 0 var(--space-4);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.anima-defense-submit {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
}

.anima-defense-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.anima-defense-cancel {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
}
