/* Shared vertical settings layout: keep this block identical in both modes. */
#rocambor-recovery-settings .recovery-settings-card {
  width: min(620px, 100%);
  padding: 16px 18px 10px;
  font-family: Montserrat, Arial, sans-serif;
}
#rocambor-recovery-settings .recovery-classic-settings-hero {
  padding: 0 0 12px;
  text-align: center;
}
#rocambor-recovery-settings .recovery-classic-settings-hero h2 {
  min-width: 0;
  max-width: 100%;
  margin: 0 auto 8px;
  padding: 8px 16px;
  font-size: 20px;
  line-height: 1.2;
}
#rocambor-recovery-settings .recovery-classic-settings-hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
#rocambor-recovery-settings .recovery-classic-settings-panel {
  padding: 12px;
}
#rocambor-recovery-settings .recovery-classic-settings-heading {
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
  padding-bottom: 9px;
}
#rocambor-recovery-settings .recovery-classic-settings-heading h3 { font-size: 22px; }
#rocambor-recovery-settings .recovery-classic-settings-heading p { margin: 0; font-size: 12px; }
#rocambor-recovery-settings .recovery-classic-rules-grid,
#rocambor-recovery-settings .recovery-practice-rules-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
#rocambor-recovery-settings .recovery-classic-rule {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-column: auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 76px;
  padding: 12px;
  border-radius: 16px;
}
#rocambor-recovery-settings .recovery-classic-rule > span { min-width: 0; gap: 4px; }
#rocambor-recovery-settings .recovery-classic-rule strong { font-size: 16px; line-height: 1.2; white-space: normal; }
#rocambor-recovery-settings .recovery-classic-rule small { font-size: 12px; line-height: 1.4; }
#rocambor-recovery-settings .recovery-classic-rule select {
  box-sizing: border-box;
  width: 180px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 14px;
}
#rocambor-recovery-settings .recovery-classic-switch {
  box-sizing: border-box;
  width: 78px;
  height: 44px;
  padding: 3px;
}
#rocambor-recovery-settings .recovery-classic-switch em { width: 32px; height: 32px; font-size: 10px; }
#rocambor-recovery-settings .recovery-classic-rule input:checked + .recovery-classic-switch em { transform: translateX(34px); }
#rocambor-recovery-settings .recovery-classic-rule--timer > div { min-width: 0; gap: 10px; }
#rocambor-recovery-settings .recovery-classic-rule--timer select { width: 110px; }
#rocambor-recovery-settings .recovery-classic-settings-note { margin: 10px 0 0; font-size: 12px; line-height: 1.4; }
#rocambor-recovery-settings .recovery-settings-card footer button { padding: 10px 16px; font-size: 14px; }
#rocambor-recovery-settings .recovery-settings-card.recovery-settings-card--classic footer {
  bottom: -10px;
  margin-bottom: -10px;
}
@media (max-width: 480px) {
  #rocambor-recovery-settings .recovery-settings-card { padding: 12px 10px 8px; }
  #rocambor-recovery-settings .recovery-settings-card.recovery-settings-card--classic footer { bottom: -8px; margin-bottom: -8px; }
  #rocambor-recovery-settings .recovery-classic-settings-panel { padding: 8px; }
  #rocambor-recovery-settings .recovery-classic-rule--select,
  #rocambor-recovery-settings .recovery-classic-rule--timer { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #rocambor-recovery-settings .recovery-classic-rule--select select { width: 100%; }
  #rocambor-recovery-settings .recovery-classic-rule--timer > div { justify-content: flex-end; }
}
/* End shared vertical settings layout. */

/* Settings must scroll inside the visible viewport on desktop and touch
   devices. The Classic skin is also used by Practice and formerly hid overflow. */
#rocambor-recovery-settings.recovery-settings-overlay {
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}

#rocambor-recovery-settings .recovery-settings-card {
  box-sizing: border-box;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

#rocambor-recovery-settings .recovery-settings-card footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  background: #142017;
  box-shadow: 0 -8px 14px rgba(9, 18, 12, .3);
}

#rocambor-recovery-settings .recovery-settings-card footer button {
  flex: 1 1 160px;
  min-width: 0;
  min-height: 48px;
}

.recovery-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 13, 10, .86);
  backdrop-filter: blur(5px);
  font-family: Georgia, "Times New Roman", serif;
}

.recovery-construction-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 9, 6, .9);
  backdrop-filter: blur(6px);
  font-family: Georgia, "Times New Roman", serif;
}

.recovery-construction-card {
  position: relative;
  width: min(920px, 95vw);
  max-height: 92vh;
  overflow: auto;
  border: 2px solid #c99a32;
  border-radius: 20px;
  color: #f8efd7;
  background: #10251d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
}

.recovery-construction-card > img {
  display: block;
  width: 100%;
  max-height: min(55vh, 540px);
  object-fit: cover;
  object-position: center;
}

.recovery-construction-copy {
  padding: 24px 30px 28px;
  text-align: center;
  background: linear-gradient(145deg, #203d31, #10251d);
}

.recovery-construction-copy > span {
  color: #e8bc5b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

.recovery-construction-copy h2 {
  margin: 6px 0 8px;
  color: #fff3cc;
  font-size: clamp(30px, 5vw, 48px);
}

.recovery-construction-copy p {
  max-width: 650px;
  margin: 0 auto 20px;
  color: #d5d7c9;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
}

.recovery-construction-copy button,
.recovery-construction-close {
  border: 1px solid #e4bc5e;
  color: #17231e;
  background: #e7b941;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.recovery-construction-copy button {
  border-radius: 10px;
  padding: 12px 22px;
}

.recovery-construction-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  background: rgba(121, 43, 27, .94);
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 650px) {
  .recovery-construction-overlay { padding: 12px; }
  .recovery-construction-card > img { max-height: 42vh; }
  .recovery-construction-copy { padding: 20px 18px 24px; }
}

.recovery-settings-card {
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  color: #f7f0db;
  border: 2px solid #c99a32;
  border-radius: 18px;
  background: linear-gradient(145deg, #203d31, #10251d);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.recovery-settings-card header { padding: 26px 30px 18px; border-bottom: 1px solid rgba(201,154,50,.42); }
.recovery-settings-card header span { color: #e8bc5b; font-size: 12px; letter-spacing: .16em; }
.recovery-settings-card h2 { margin: 6px 0; font-size: 30px; }
.recovery-settings-card p { margin: 0; color: #d5d7c9; }
.recovery-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 22px 30px 16px; }
.recovery-settings-grid label { display: grid; gap: 7px; }
.recovery-settings-grid label > span { color: #e9c66f; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.recovery-settings-grid select { width: 100%; padding: 12px; color: #18241f; border: 0; border-radius: 9px; background: #f6f0dc; font: inherit; }
.recovery-settings-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 6px 30px 18px; }
.recovery-settings-toggles label { display: flex; gap: 10px; align-items: flex-start; padding: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.045); }
.recovery-settings-toggles input { margin-top: 3px; accent-color: #d7a72f; }
.recovery-settings-toggles span { display: grid; gap: 3px; }
.recovery-settings-toggles small { color: #bfc9c1; line-height: 1.25; }
.recovery-settings-note { margin: 0 30px 18px !important; padding: 10px 12px; border-left: 3px solid #d7a72f; background: rgba(0,0,0,.16); }
.recovery-settings-card footer { display: flex; justify-content: flex-end; gap: 12px; padding: 18px 30px 24px; border-top: 1px solid rgba(201,154,50,.25); }
.recovery-settings-card footer button { padding: 11px 20px; border: 1px solid #d2ac52; border-radius: 9px; color: #f8efd5; background: transparent; font: 700 15px inherit; cursor: pointer; }
.recovery-settings-card footer [data-settings-start] { color: #17231e; background: #e7b941; }

.recovery-settings-validation {
  min-height: 18px;
  margin: 8px 16px 0 !important;
  color: #f1c85d !important;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: opacity .18s ease;
}

.recovery-settings-validation.is-visible { opacity: 1; }

.recovery-settings-card--classic {
  width: min(1180px, 96vw);
  max-height: 96vh;
  padding: 14px 30px 18px;
  border: 3px solid #b8902d;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 0, rgba(166, 137, 51, .25), transparent 38%),
    linear-gradient(105deg, #0b1a14 0%, #1a2518 50%, #11160f 100%);
  box-shadow: inset 0 0 0 5px rgba(216, 178, 72, .13), 0 28px 90px rgba(0, 0, 0, .72);
  font-family: Montserrat, Arial, sans-serif;
  overflow: hidden;
}

.recovery-settings-card--classic .recovery-classic-settings-hero {
  padding: 0 0 10px;
  border: 0;
  text-align: center;
}

.recovery-classic-settings-hero h2 {
  display: inline-block;
  min-width: 350px;
  margin: -14px auto 9px;
  padding: 6px 30px 8px;
  border-radius: 0 0 28px 28px;
  color: #e5bc49;
  background: rgba(119, 96, 28, .28);
  font-size: 19px;
  line-height: 1;
  letter-spacing: .11em;
}

.recovery-settings-card--classic .recovery-classic-settings-hero p {
  color: #e6e2d4;
  font-size: 13px;
  font-weight: 600;
}

.recovery-classic-settings-panel,
.recovery-classic-match-panel {
  border: 2px solid rgba(170, 137, 45, .48);
  border-radius: 25px;
  background: linear-gradient(100deg, rgba(44, 57, 39, .82), rgba(29, 29, 21, .86));
}

.recovery-classic-settings-panel { padding: 13px 16px 12px; }

.recovery-classic-settings-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  padding: 0 2px 9px;
  border-bottom: 1px solid rgba(199, 161, 55, .22);
}

.recovery-classic-settings-heading span,
.recovery-classic-match-panel > span {
  color: #e0b944;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
}

.recovery-classic-settings-heading h3 {
  margin: 2px 0 0;
  color: #f5efdc;
  font: 400 23px/1 Georgia, "Times New Roman", serif;
}

.recovery-settings-card--classic .recovery-classic-settings-heading p {
  color: #d4d2c6;
  font-size: 12px;
  font-weight: 600;
}

.recovery-classic-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 11px;
}

.recovery-settings-card--practice { width: min(1040px, 96vw); }
.recovery-practice-rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recovery-settings-card--practice .recovery-classic-settings-note { margin-top: 9px; }

.recovery-classic-rule {
  position: relative;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(170, 137, 45, .34);
  border-radius: 18px;
  background: rgba(32, 38, 29, .7);
  cursor: pointer;
}

.recovery-classic-rule > span { flex: 1 1 auto; min-width: 140px; display: grid; gap: 3px; }
.recovery-classic-rule strong { overflow: visible; color: #f3f0e5; font-size: 15px; line-height: 1.05; white-space: nowrap; }
.recovery-classic-rule small { color: #c9c8bc; font-size: 10px; line-height: 1.2; }
.recovery-classic-rule input { position: absolute; opacity: 0; pointer-events: none; }

.recovery-classic-switch {
  flex: 0 0 70px;
  width: 70px;
  height: 36px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 2px solid rgba(202, 178, 117, .28);
  border-radius: 999px;
  background: #6c5b4d;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .25);
  transition: background .18s ease;
}

.recovery-classic-switch em {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #675d4f;
  background: #e9e5db;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  transition: transform .18s ease;
}

.recovery-classic-rule input:checked + .recovery-classic-switch {
  background: linear-gradient(180deg, #d9b23e, #b88b20);
}

.recovery-classic-rule input:checked + .recovery-classic-switch em {
  transform: translateX(34px);
  color: #6d5520;
  background: #fff8dc;
}

.recovery-classic-rule--select { cursor: default; }
.recovery-classic-rule--wide { grid-column: 1 / -1; }
.recovery-classic-rule select {
  flex: 0 0 145px;
  max-width: 48%;
  padding: 10px 11px;
  border: 2px solid rgba(163, 128, 32, .5);
  border-radius: 15px;
  color: #eee9d9;
  background: #0b100b;
  font: 700 12px Montserrat, Arial, sans-serif;
}

.recovery-classic-rule--timer { cursor: default; }
.recovery-classic-rule--timer > div {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}
.recovery-classic-rule--timer > div > input { position: absolute; opacity: 0; pointer-events: none; }
.recovery-classic-rule--timer select { width: 76px; max-width: none; padding: 9px 6px; }

.recovery-settings-card--classic .recovery-classic-settings-note {
  margin: 12px 0 0;
  color: #c5a84d;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.recovery-classic-match-panel { margin-top: 14px; padding: 14px 20px 2px; }
.recovery-classic-match-panel .recovery-settings-grid { padding: 10px 0 14px; }
.recovery-classic-match-panel .recovery-settings-grid label > span { color: #dbc16d; }
.recovery-classic-match-panel .recovery-settings-grid select {
  color: #eee9d9;
  border: 2px solid rgba(163, 128, 32, .5);
  background: #0b100b;
}

.recovery-settings-card--classic footer {
  padding: 12px 0 0;
  border: 0;
}

.recovery-settings-card--classic footer button { min-width: 170px; padding: 9px 16px; }
.recovery-settings-card--classic footer [data-settings-start] {
  color: #201a0d;
  background: linear-gradient(180deg, #e6bd4d, #bd8e25);
}

/* The recovered frontend always renders its Actions shell, even during trick
   play when it has no contextual controls. Keep real action sections visible
   and remove only the empty header-only shell. */
.tacticas-panel-solo-acciones:not(:has(> .tactica-section)) {
  display: none !important;
}

.tacticas-panel-solo-acciones.recovery-actions-panel-empty {
  display: none !important;
}

@media (max-width: 650px) {
  .recovery-settings-grid, .recovery-settings-toggles { grid-template-columns: 1fr; }
  .recovery-settings-card header, .recovery-settings-grid, .recovery-settings-toggles { padding-left: 20px; padding-right: 20px; }
  .recovery-settings-card--classic { padding: 14px; border-radius: 20px; }
  .recovery-classic-settings-hero h2 { min-width: 0; width: 92%; font-size: 16px; }
  .recovery-classic-rules-grid { grid-template-columns: 1fr; }
  .recovery-practice-rules-grid { grid-template-columns: 1fr; }
  .recovery-classic-rule--wide { grid-column: auto; }
  .recovery-classic-settings-heading { align-items: flex-start; flex-direction: column; }
  .recovery-classic-rule { min-height: 68px; }
  .recovery-classic-rule > span { min-width: 0; }
  .recovery-classic-rule select { flex-basis: 145px; max-width: 48%; }
}

@media (min-width: 651px) and (max-width: 1050px) {
  .recovery-classic-rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recovery-settings-card--classic { max-height: 96vh; }
}

.recovery-card-timer {
  position: absolute;
  right: -170px;
  bottom: 78px;
  z-index: 430;
  min-width: 112px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  border: 2px solid rgba(247, 201, 72, .8);
  border-radius: 13px;
  color: #fff8df;
  background: linear-gradient(145deg, rgba(14, 42, 31, .96), rgba(7, 20, 15, .96));
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  text-align: left;
}
.recovery-card-timer span { grid-column: 1 / -1; color: #f7c948; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.recovery-card-timer strong { font-size: 25px; line-height: 1; }
.recovery-card-timer small { color: #d8d5c7; font-size: 9px; }

.recovery-trump-symbol {
  width: calc(var(--manual-trump-card-width, 58px) * var(--trump-ui-scale, 1.9));
  aspect-ratio: .7;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #18130b;
  background: #fffaf0;
  box-shadow: 0 14px 26px rgba(0, 0, 0, .4);
  font: 700 72px/1 Georgia, "Times New Roman", serif;
}

.recovery-trump-symbol--diamonds,
.recovery-trump-symbol--hearts { color: #bb201b; }

/* During exchange, a click is the selection signal. Keep an unselected card
   in the hand even while the pointer is still over it after deselection. */
.mesa-stage-frame .jugador-bottom
  .carta-img-btn-intercambio:not(.carta-img-btn-seleccionada),
.mesa-stage-frame .jugador-bottom
  .carta-img-btn-intercambio:not(.carta-img-btn-seleccionada):hover {
  z-index: auto !important;
  transform: translateY(0) scale(1) !important;
  filter: none !important;
  transition: transform .18s ease !important;
}

.recovery-turn-instruction {
  position: absolute;
  z-index: 45;
  left: 50%;
  /* Keep turn guidance in the open lane between the enlarged trick cards and
     the top player's seat instead of covering the cards at the top edge. */
  top: clamp(180px, 35%, 280px);
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 40px));
  padding: 9px 16px;
  border: 1px solid rgba(226, 184, 83, 0.85);
  border-radius: 999px;
  background: rgba(31, 24, 13, 0.9);
  color: #f6e5b2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: normal;
  text-align: center;
  text-wrap: balance;
}

.recovery-turn-instruction--human {
  background: rgba(109, 52, 17, 0.94);
  color: #fff8df;
}

@media (max-width: 680px) {
  .recovery-turn-instruction {
    top: clamp(145px, 33%, 205px);
    max-width: calc(100% - 28px);
    padding: 7px 12px;
    font-size: 11.5px;
  }
}

/* Recovered dealer control: when the human is sitting out as dealer, AUTO
   advances completed bot tricks while OFF preserves the inspection pause. */
.mesa-stage-frame {
  --auto-next-trick-right: -18px;
  --auto-next-trick-bottom: 50px;
}

.mesa-stage-frame .jugador-bottom .auto-next-trick-toggle {
  position: absolute !important;
  right: var(--auto-next-trick-right) !important;
  bottom: var(--auto-next-trick-bottom) !important;
  z-index: 390 !important;
  min-width: 160px !important;
  min-height: 48px !important;
  padding: 10px 16px !important;
  border: 2px solid rgba(255, 244, 185, .6) !important;
  border-radius: 14px !important;
  color: #fff !important;
  font-size: 18px !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .35), 0 0 0 3px rgba(247, 201, 72, .1) !important;
}

.mesa-stage-frame .jugador-bottom .auto-next-trick-inactive {
  background: linear-gradient(135deg, #8f2f24, #d86b4f) !important;
}

.mesa-stage-frame .jugador-bottom .auto-next-trick-active {
  border-color: rgba(175, 255, 193, .72) !important;
  background: linear-gradient(135deg, #167445, #2bad69) !important;
  animation: autoNextTrickPulse 1.2s ease-in-out infinite !important;
}

@keyframes autoNextTrickPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

/* Recovered behavior: the first play remains visibly marked as LEAD until
   NEXT TRICK clears the table. The player's name chip carries the same gold
   aura, so the opening player remains obvious even after all three cards land. */
.mesa-card .recovery-lead-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.mesa-card .recovery-lead-card-label {
  flex: 0 0 auto;
  margin-bottom: 5px;
  white-space: nowrap;
  pointer-events: none;
}

.mesa-card .mesa-slot-bottom .recovery-lead-card-label {
  margin-top: -25px;
  margin-bottom: 0;
}

.mesa-card .recovery-lead-player .jugador-badge {
  box-shadow:
    0 0 0 3px rgba(255, 226, 139, .8),
    0 0 22px 8px rgba(225, 173, 54, .88),
    0 8px 20px rgba(0, 0, 0, .48) !important;
  animation: recoveryLeadPlayerAura 1.4s ease-in-out infinite;
}

.mesa-card .recovery-finish-match-ready {
  min-width: 190px;
  color: #241807 !important;
  border: 2px solid rgba(255, 235, 170, .9) !important;
  background: linear-gradient(135deg, #d9a93e, #f2d878) !important;
  box-shadow: 0 0 24px rgba(231, 190, 87, .78), 0 12px 26px rgba(0, 0, 0, .5) !important;
  animation: recoveryResultReady 1.2s ease-in-out infinite;
}

.recovery-practice-round-progress {
  margin: .35rem auto .65rem;
  color: #d9b44a;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.recovery-practice-next-round {
  min-width: 226px;
  padding: .9rem 1.35rem;
  color: #fff !important;
  border: 1px solid #8bd397 !important;
  border-radius: 14px;
  background: linear-gradient(180deg, #67bd78, #3d8f51) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.recovery-practice-next-round:disabled {
  cursor: wait;
  opacity: .72;
}

@keyframes recoveryResultReady {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.04); filter: brightness(1.1); }
}

@keyframes recoveryLeadPlayerAura {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* The recovered table owns the winner announcement and LAST TRICK panel.
   These classes restore the collection motion during its two-second winner
   sequence. */
.mesa-card[class*="recovery-trick-collect-"] .carta-mesa-wrap,
.mesa-card[class*="recovery-trick-collect-"] .mini-carta-fieltro {
  pointer-events: none;
  animation-duration: 1.05s !important;
  animation-delay: .28s !important;
  animation-timing-function: cubic-bezier(.22,.72,.18,1) !important;
  animation-fill-mode: forwards !important;
}

.mesa-card.recovery-trick-collect-top .carta-mesa-wrap,
.mesa-card.recovery-trick-collect-top .mini-carta-fieltro {
  animation-name: recoveryCollectTrickTop !important;
}
.mesa-card.recovery-trick-collect-left .carta-mesa-wrap,
.mesa-card.recovery-trick-collect-left .mini-carta-fieltro {
  animation-name: recoveryCollectTrickLeft !important;
}
.mesa-card.recovery-trick-collect-right .carta-mesa-wrap,
.mesa-card.recovery-trick-collect-right .mini-carta-fieltro {
  animation-name: recoveryCollectTrickRight !important;
}
.mesa-card.recovery-trick-collect-bottom .carta-mesa-wrap,
.mesa-card.recovery-trick-collect-bottom .mini-carta-fieltro {
  animation-name: recoveryCollectTrickBottom !important;
}

@keyframes recoveryCollectTrickTop {
  to { transform: translate(0, -285px) rotate(0deg) scale(.2); opacity: 0; filter: blur(2px); }
}
@keyframes recoveryCollectTrickLeft {
  to { transform: translate(-560px, 55px) rotate(-90deg) scale(.2); opacity: 0; filter: blur(2px); }
}
@keyframes recoveryCollectTrickRight {
  to { transform: translate(560px, 55px) rotate(90deg) scale(.2); opacity: 0; filter: blur(2px); }
}
@keyframes recoveryCollectTrickBottom {
  to { transform: translate(0, 285px) rotate(0deg) scale(.2); opacity: 0; filter: blur(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .mesa-card .recovery-lead-player .jugador-badge {
    animation: none;
  }

  .mesa-card .recovery-finish-match-ready {
    animation: none;
  }

  .mesa-stage-frame .jugador-bottom .auto-next-trick-active {
    animation: none !important;
  }

  .mesa-card[class*="recovery-trick-collect-"] .carta-mesa-wrap,
  .mesa-card[class*="recovery-trick-collect-"] .mini-carta-fieltro {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
  }
}

.recovery-exit-button {
  border-color: rgba(255, 190, 145, .78) !important;
  background: linear-gradient(135deg, #963d25, #c75f39) !important;
  color: #fff8e8 !important;
}

.recovery-bot-inspector-trigger-host {
  position: relative;
}

.recovery-bot-inspector-secret-trigger {
  position: absolute;
  z-index: 2;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: default;
}

.recovery-exit-confirmation-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647 !important;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 9, 6, .86);
  font-family: Arial, sans-serif;
}

.recovery-exit-confirmation {
  width: min(470px, 92vw);
  border: 2px solid rgba(211, 176, 83, .88);
  border-radius: 18px;
  padding: 26px;
  color: #30240d;
  text-align: center;
  background: #f8f0d9;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .72);
}

.recovery-exit-confirmation > span {
  color: #963d25;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}

.recovery-exit-confirmation h2 {
  margin: 10px 0;
  font-size: clamp(22px, 4vw, 30px);
}

.recovery-exit-confirmation p {
  margin: 0 0 22px;
  color: #6e624c;
}

.recovery-exit-confirmation > div {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.recovery-exit-confirmation button {
  min-width: 130px;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.recovery-exit-confirmation [data-recovery-exit-cancel] {
  background: #6e756f;
}

.recovery-exit-confirmation [data-recovery-exit-confirm] {
  background: linear-gradient(135deg, #963d25, #c75f39);
}

.recovery-bot-inspector-overlay {
  position: fixed;
  inset: 0;
  /* Keep Test Mode above gameplay prompts that may appear while it is open. */
  z-index: 2147483647 !important;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: auto !important;
  isolation: isolate;
  color: #30240d;
  background: rgba(2, 9, 6, .84);
  font-family: Arial, sans-serif;
}

.recovery-bot-inspector {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 2px solid rgba(211, 176, 83, .8);
  border-radius: 18px;
  padding: 18px;
  background: #f8f0d9;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .7);
}

.recovery-bot-inspector > header,
.recovery-bot-inspector-summary,
.recovery-bot-inspector > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.recovery-bot-inspector > header span {
  color: #7a5a12;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}

.recovery-bot-inspector h2,
.recovery-bot-inspector h3 {
  margin: 2px 0;
}

.recovery-bot-inspector > header button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: #7f2e1e;
  font-size: 27px;
  cursor: pointer;
}

.recovery-bot-inspector-note {
  margin: 10px 0 16px;
  color: #665b43;
}

.recovery-bot-inspector-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.recovery-bot-inspector-bot {
  min-width: 0;
  border: 1px solid #cbbd96;
  border-radius: 14px;
  padding: 14px;
  background: #fffaf0;
}

.recovery-bot-inspector-summary > strong {
  border-radius: 999px;
  padding: 8px 14px;
  color: white;
  letter-spacing: .06em;
}

.recovery-bot-inspector-summary .will-play { background: #16764b; }
.recovery-bot-inspector-summary .will-pass { background: #8b3427; }
.recovery-bot-inspector-summary span { color: #6e6248; font-size: 12px; font-weight: 700; }

.recovery-bot-inspector-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 12px 0;
  font-size: 12px;
}

.recovery-bot-inspector-metrics span {
  border-radius: 7px;
  padding: 6px 8px;
  background: #eee4c8;
}

.recovery-bot-inspector-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.recovery-bot-inspector-sort {
  margin: 10px 0 8px;
}

.recovery-bot-inspector-sort > span {
  display: block;
  margin-bottom: 5px;
  color: #665b43;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.recovery-bot-inspector-sort > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recovery-bot-inspector-sort button {
  border: 1px solid #a98b45;
  border-radius: 999px;
  padding: 5px 10px;
  color: #493817;
  background: #fffaf0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.recovery-bot-inspector-sort button.is-selected {
  border-color: #176c46;
  color: white;
  background: #176c46;
}

.recovery-inspector-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #aa9563;
  border-radius: 6px;
  padding: 5px 7px;
  color: #261f11;
  background: white;
  font-size: 11px;
  font-weight: 700;
}

.recovery-inspector-card i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: white;
  background: #8b6b25;
  font-size: 9px;
  font-style: normal;
}

.recovery-bot-inspector table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: center;
}

.recovery-bot-inspector th,
.recovery-bot-inspector td {
  border-bottom: 1px solid #ded2b3;
  padding: 6px 4px;
}

.recovery-bot-inspector tbody tr.is-best { background: #d9edcf; font-weight: 800; }
.recovery-bot-inspector > footer { justify-content: flex-end; margin-top: 14px; }
.recovery-bot-inspector > footer button {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  color: white;
  background: #176c46;
  font-weight: 800;
  cursor: pointer;
}

.recovery-bot-inspector-empty {
  grid-column: 1 / -1;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  background: #eee4c8;
}

/* The Classic score bar only shows the Widow bank when that option was chosen. */
.serie-score-floating-no-widow {
  display: none !important;
}

.recovery-practice-declaration {
  position: absolute; right: auto; bottom: auto; z-index: 600;
  width: min(300px, calc(100% - 24px)); box-sizing: border-box;
  padding: 16px; border: 1px solid #bd9234; border-radius: 14px;
  background: #faf2da; color: #332a18; font: 18px/1.35 system-ui, sans-serif;
}
.recovery-declaration-positioned-panel {
  position: absolute !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 600 !important;
  box-sizing: border-box !important;
  width: min(300px, calc(100% - 24px)) !important;
  max-width: calc(100% - 24px) !important;
  padding: 16px !important;
  border: 1px solid #bd9234 !important;
  border-radius: 14px !important;
  color: #332a18 !important;
  background: #faf2da !important;
  box-shadow: 0 10px 28px #0006 !important;
}
.recovery-practice-declaration label { display: block; margin-top: 10px; }
.recovery-practice-declaration select, .recovery-practice-declaration button {
  width: 100%; min-height: 44px; font: inherit; margin-top: 5px;
}
.recovery-practice-declaration button { background: #68aa70; color: white; border: 0; border-radius: 8px; }
.recovery-practice-declaration p:empty { display: none; }
.recovery-declaration-positioned-panel [role="alert"]:empty { display: none; }
.recovery-practice-declaration label { display: grid; gap: 4px; }
.recovery-practice-declaration select { box-sizing: border-box; width: 100%; }

/* Atomic panel handoff: a late native render must never show behind the owner. */
.mesa-stage-frame:has([data-practice-declaration]) .tacticas-panel-solo-acciones,
.mesa-stage-frame[data-practice-declaration-owner="recovery"] .tacticas-panel-solo-acciones:has(.declare-game-compact-section),
.mesa-stage-frame:has([data-practice-declaration]) .declare-game-compact-section:not([data-practice-declaration]) {
  display: none !important;
}
