  /* ============ ВИДЖЕТ ТАРО ============ */
  .tarot-section { padding: 60px 0; }

  .widget-tarot {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 20px 20px 150px;
  min-height: 650px;
  user-select: none;
  overflow: visible;
}

  .tarot-card {
    width: 200px; height: 360px;
    position: absolute;
    left: 50%; top: 45%;
    margin-left: -100px; margin-top: -180px;
    transform-style: preserve-3d;
    border-radius: 12px;
    border: 3px solid #963dcf;
    background: linear-gradient(135deg, #2a2a4e, #1a1a3e);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    cursor: pointer;
    will-change: transform;
    transition: opacity .6s ease, box-shadow .3s ease;
  }
  .tarot-card.hidden { opacity: 0; pointer-events: none; }
  .tarot-card.drawn  { box-shadow: 0 0 30px rgba(7,158,148,0.8); }
  .tarot-card.top    { z-index: 150 !important; }
  .tarot-card.bottom { z-index: 50  !important; }

  .tarot-card .front,
  .tarot-card .back {
    position: absolute;
    width: 100%; height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a4e, #1a1a3e);
  }
  .tarot-card .back { transform: rotateY(180deg); }
  .tarot-card .front img,
  .tarot-card .back  img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
  }
  .tarot-card.no-image .front img,
  .tarot-card.no-image .back  img { display: none; }
  .tarot-card .num {
    display: none;
    position: absolute; inset: 0;
    align-items: center; justify-content: center;
    font: bold 72px/1 'Segoe UI', Arial, sans-serif;
    color: rgba(212,175,55,0.65);
    pointer-events: none;
  }
  .tarot-card.no-image .num { display: flex; }

  /* ============ КНОПКА «ПЕРЕМЕШАТЬ» ============ */
.shuffle-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  min-width: 220px;
  height: 54px;
  font-size: 18px;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  border: none;
  cursor: pointer;
  z-index: 1000;
  white-space: nowrap;
  transition: opacity .3s;
  -webkit-box-reflect: below 1px linear-gradient(transparent, #0004);
}

.shuffle-btn .shuffle-btn-inner {
  position: absolute;
  top: 1px; left: 1px; right: 1px; bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0c0c0c;
  color: rgba(255, 255, 255, 0.25);
  transition: color .5s;
  z-index: 2;
}

.shuffle-btn:hover .shuffle-btn-inner {
  color: rgba(255, 255, 255, 1);
}

.shuffle-btn .shuffle-btn-inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 50%;
  background: rgba(255, 255, 255, 0.08);
  z-index: 10;
  pointer-events: none;
}

.shuffle-btn::before,
.shuffle-btn::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    45deg,
    #c0392b, #f39c12, #f1c40f, #2ecc71,
    #3498db, #2980b9, #9b59b6, #8e44ad,
    #c0392b, #f39c12, #f1c40f, #2ecc71,
    #3498db, #2980b9, #9b59b6, #8e44ad
  );
  background-size: 400%;
  opacity: 0;
  transition: opacity 0.5s;
  animation: tarot-btn-eff 20s linear infinite;
  z-index: 1;
}

.shuffle-btn::after {
  filter: blur(20px);
}

.shuffle-btn:hover::before,
.shuffle-btn:hover::after {
  opacity: 1;
}

@keyframes tarot-btn-eff {
  0%   { background-position: 0 0; }
  50%  { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

.shuffle-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.shuffle-btn .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

  /* ============ МОДАЛКА ВИДЖЕТА ============
     Классы переименованы с tarot-префиксом,
     чтобы не конфликтовать с Bootstrap-модалками темы. */
  .tarot-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
  .tarot-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
  .tarot-modal-content {
    position: absolute;
    left: 50%; top: 50%;
    box-sizing: border-box;
    width: max-content;
    max-width: min(90vw, 500px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    background: #16213e;
    border: 1px solid rgba(212,175,55,0.7);
    border-radius: 16px;
    padding: 30px 25px 25px;
    box-shadow:
      0 0 0 1px rgba(212,175,55,0.3),
      0 0 20px rgba(212,175,55,0.4),
      0 0 60px rgba(212,175,55,0.15),
      0 20px 40px rgba(0,0,0,0.6);
    transform: translate(-50%, -50%) scale(0.9);
    transition: transform 0.3s ease;
    color: #fff;
    display: block;
    border-style: solid;
  }
  .tarot-modal-overlay.active .tarot-modal-content {
    transform: translate(-50%, -50%) scale(1);
  }
  .tarot-modal-content .tarot-close-modal {
    position: absolute; top: 8px; right: 14px;
    font-size: 30px; cursor: pointer;
    color: #663b67; background: none;
    border: none; line-height: 1; padding: 0;
  }
  .tarot-modal-content .tarot-close-modal:hover { color: #c96dd9; }
  .tarot-modal-content .tarot-card-name    { font-size: 28px; font-weight: bold; color: #12c3b4; margin-bottom: 10px; }
  .tarot-modal-content .tarot-card-meaning { font-size: 18px; color: #4ed7f7; line-height: 1.5; min-height: 2em; }
  .tarot-modal-content .tarot-card-meaning.loading { color: #6c7fa4; font-style: italic; }

  @media (max-width: 768px) {
    .widget-tarot { padding: 15px 15px 70px; min-height: 560px; }
    .tarot-card { width: 150px; height: 270px; margin-left: -75px; margin-top: -135px; }
    .shuffle-btn { font-size: 15px; min-width: 190px; height: 48px; }
    .tarot-modal-content .tarot-card-name { font-size: 24px; }
    .tarot-modal-content .tarot-card-meaning { font-size: 16px; }
  }
  @media (max-width: 480px) {
    .widget-tarot { padding: 10px 10px 60px; min-height: 440px;}
    .tarot-card { width: 120px; height: 216px; margin-left: -60px; margin-top: -108px; }
    .shuffle-btn { font-size: 13px; min-width: 170px; height: 44px; bottom: 15px; }
    .tarot-modal-content { padding: 20px 15px 15px; }
    .tarot-modal-content .tarot-card-name { font-size: 20px; }
    .tarot-modal-content .tarot-card-meaning { font-size: 14px; }
  }
  @media (min-width: 1200px) {
    .tarot-card { width: 240px; height: 432px; margin-left: -120px; margin-top: -216px; }
  }

.tarot-modal-content .tarot-card-meaning p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.tarot-modal-content .tarot-card-meaning p:last-child {
  margin-bottom: 0;
}
.tarot-modal-content .tarot-card-meaning strong {
  color: #b073ff;
}
.tarot-modal-content .tarot-card-meaning .tarot-polarity {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-style: italic;
  color: #b073ff;
}
/* ============ НАЗВАНИЕ КАРТЫ (на месте кнопки «Перемешать») ============ */
.tarot-name-reveal {
  position: absolute;
  left: 50%;
  bottom: 32px;                 /* центр совпадает с центром кнопки (20 + 54/2 - 15) */
  transform: translate(-50%, 10px);
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5d76e;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;

  opacity: 0;
  filter: blur(16px);
  text-shadow:
    0 0 24px rgba(255, 235, 180, 0.95),
    0 0 48px rgba(150, 61, 207, 0.85),
    0 0 80px rgba(150, 61, 207, 0.5);

  transition:
    opacity      1.4s ease-out,
    filter       1.8s cubic-bezier(0.2, 0.9, 0.3, 1),
    transform    1.4s ease-out,
    text-shadow  1.8s ease-out;
  will-change: opacity, filter, transform;
}

.tarot-name-reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, 0);
  text-shadow:
    0 0 10px rgba(255, 235, 180, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.95);
}

@media (max-width: 768px) {
  .tarot-name-reveal {
    font-size: 18px;
    bottom: 28px;               /* кнопка 48px: 20 + 48/2 - 16 */
  }
}
@media (max-width: 480px) {
  .tarot-name-reveal {
    font-size: 15px;
    letter-spacing: 0.06em;
    bottom: 22px;               /* кнопка 44px, bottom 15: 15 + 44/2 - 15 */
  }
}
@media (min-width: 1200px) {
  .tarot-name-reveal {
    font-size: 26px;
  }
}