/* =============================================
   PREDICTIONS PAGE — Mobile-first redesign
   ============================================= */

/* ── PAGE LAYOUT ─────────────────────────────── */
.predictions-page {
  padding: 20px 16px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.predictions-header {
  text-align: center;
  margin-bottom: 20px;
}

.predictions-header h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: #d4af37;
  margin-bottom: 6px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
}

.predictions-header > p {
  color: #666;
  font-size: 15px;
  margin-bottom: 16px;
}

.predictions-intro {
  display: none;
}
@media (min-width: 768px) {
  .predictions-intro {
    display: block;
    max-width: 640px;
    margin: 0 auto 16px;
    color: #888;
    font-size: 14px;
    line-height: 1.7;
  }
}

/* ── TRUST BAR ─────────────────────────────── */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px;
  background: rgba(212,175,55,0.04);
  border: 1px solid rgba(212,175,55,0.1);
  border-radius: 12px;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.trust-item__num {
  font-size: 20px;
  font-weight: 700;
  color: #d4af37;
  line-height: 1;
}

.trust-item__label {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}

/* ── CATEGORY FILTER TABS ─────────────────────── */
.pred-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 16px;
  margin-bottom: 4px;
}
.pred-filters::-webkit-scrollbar { display: none; }

.pred-filter-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.25);
  background: transparent;
  color: #666;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.pred-filter-btn.active {
  background: #d4af37;
  color: #000;
  border-color: #d4af37;
  font-weight: 600;
}

.pred-filter-btn:hover:not(.active) {
  border-color: rgba(212,175,55,0.5);
  color: #d4af37;
}

/* ── PREDICTIONS GRID ─────────────────────────── */
.predictions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 520px) {
  .predictions-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (min-width: 900px) {
  .predictions-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

@media (min-width: 1100px) {
  .predictions-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── PREDICTION CARD ─────────────────────────── */
.prediction-card {
  background: #0d0d12;
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 14px;
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.prediction-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
}

.prediction-card:hover,
.prediction-card:active {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 6px 20px rgba(212,175,55,0.1);
}

.prediction-card:hover::after,
.prediction-card:active::after { opacity: 1; }

/* Category color variants */
.prediction-card[data-cat="love"] { border-color: rgba(220,80,100,0.15); }
.prediction-card[data-cat="love"]:hover { border-color: rgba(220,80,100,0.5); box-shadow: 0 6px 20px rgba(220,80,100,0.12); }
.prediction-card[data-cat="runes"] { border-color: rgba(80,160,240,0.15); }
.prediction-card[data-cat="runes"]:hover { border-color: rgba(80,160,240,0.45); box-shadow: 0 6px 20px rgba(80,160,240,0.1); }
.prediction-card[data-cat="tarot"] { border-color: rgba(140,90,210,0.15); }
.prediction-card[data-cat="tarot"]:hover { border-color: rgba(140,90,210,0.45); box-shadow: 0 6px 20px rgba(140,90,210,0.1); }
.prediction-card[data-cat="quick"] { border-color: rgba(80,200,130,0.15); }
.prediction-card[data-cat="quick"]:hover { border-color: rgba(80,200,130,0.45); box-shadow: 0 6px 20px rgba(80,200,130,0.1); }

.prediction-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.prediction-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: #c8bfb0;
  margin: 0 0 3px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.prediction-card p {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
  margin: 0;
  display: none;
  position: relative;
  z-index: 1;
}

@media (min-width: 520px) {
  .prediction-card { min-height: 130px; padding: 18px 14px; }
  .prediction-icon { font-size: 2.2rem; }
  .prediction-card h3 { font-size: 13px; }
  .prediction-card p { display: block; }
}

.btn-predict { display: none; }

.hidden-cat { display: none !important; }

/* palmistry icon fix */
.prediction-card .prediction-icon .fa-hand-sparkles,
.prediction-card .prediction-icon i {
  font-size: 1.8rem;
  color: #d4af37;
}

/* ── BOTTOM-SHEET MODAL ─────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-end;
  background: rgba(0,0,0,0);
}

.modal.open {
  display: flex;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/*
 * modal-content = flex column
 *   ├── modal-handle        (shrink 0)
 *   ├── modal-header        (shrink 0)
 *   ├── modal-body          (flex: 1, overflow-y: auto) ← SCROLL HERE
 *   └── modal-footer        (shrink 0) ← action buttons always visible
 *
 * ВАЖНО: position:sticky не работает внутри элемента с transform.
 * Решение: modal-content = flex col; modal-body скроллится; modal-footer
 * прилипает к низу modal-content через flex layout (margin-top: auto).
 */
.modal-content {
  background: #0c0c14;
  border: 1px solid rgba(212,175,55,0.2);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-height: 93dvh;
  max-height: 93vh;
  /* flex column — не overflow на самом modal-content */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 -12px 50px rgba(0,0,0,0.75), 0 0 0 1px rgba(212,175,55,0.06);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal.open .modal-content {
  transform: translateY(0);
}

/* Scrollable body inside modal */
.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px 8px;
}

/* Fixed footer inside modal (action buttons) */
.modal-footer {
  flex-shrink: 0;
  padding: 12px 18px 28px;
  border-top: 1px solid rgba(212,175,55,0.08);
  background: #0c0c14;
}

/* Sheet drag handle */
.modal-handle {
  width: 44px;
  height: 4px;
  background: rgba(212,175,55,0.25);
  border-radius: 2px;
  margin: 12px auto 4px;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
  margin-bottom: 0;
  gap: 8px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #e8dcc8;
  line-height: 1.3;
}

.close-modal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.close-modal:hover { background: rgba(255,255,255,0.12); color: #ccc; }

/* Desktop: centered modal */
@media (min-width: 680px) {
  .modal { align-items: center; justify-content: center; }
  .modal-content {
    border-bottom: 1px solid rgba(212,175,55,0.18);
    border-radius: 20px;
    max-width: 580px;
    max-height: 88vh;
    width: 95%;
    transform: scale(0.96) translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .modal.open .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ── FORM STYLES ─────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.18);
  background: #111118;
  color: #e8dcc8;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus,
textarea:focus {
  border-color: rgba(212,175,55,0.55);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.07);
}

textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

/* Question hint chips */
.hint-chips-label {
  font-size: 11px;
  color: #444;
  margin-bottom: 8px;
  font-weight: 500;
}

.hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hint-chip {
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.2);
  background: rgba(212,175,55,0.04);
  color: #9a8a5a;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  line-height: 1;
}

.hint-chip:hover,
.hint-chip:active {
  background: rgba(212,175,55,0.12);
  border-color: rgba(212,175,55,0.45);
  color: #d4af37;
}

/* Subtype pills (≤6 subtypes) */
.subtype-group { display: none; }

.subtype-pills-wrap {
  margin-bottom: 16px;
  display: none;
}

.subtype-pills-wrap.visible { display: block; }

/* Subtype select (>6 subtypes) */
.subtype-select-styled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.subtype-select-styled option {
  background: #1a1a24;
  color: #e8dcc8;
  padding: 8px;
}

.subtype-pills-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subtype-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.subtype-pill {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.2);
  background: transparent;
  color: #777;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.subtype-pill.active {
  background: rgba(212,175,55,0.12);
  border-color: rgba(212,175,55,0.6);
  color: #d4af37;
  font-weight: 600;
}

/* Location toggle */
.location-toggle-link {
  font-size: 12px;
  color: #555;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  font-family: inherit;
}

.location-toggle-link:hover { color: #888; }

.location-group { display: none; }
.location-group.visible { display: block; }

.location-input-wrapper {
  display: flex;
  gap: 8px;
}

.location-input-wrapper input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.18);
  background: #111118;
  color: #e8dcc8;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.btn-location {
  padding: 0 16px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  color: #d4af37;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.btn-location:hover { background: rgba(212,175,55,0.15); }

/* Submit */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #d4af37 0%, #b8922a 100%);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  margin-top: 4px;
}

.btn-submit:hover { opacity: 0.9; }
.btn-submit:active { transform: scale(0.98); }

/* ── MAGICAL LOADING ─────────────────────────── */
#prediction-loading,
#palmistry-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 28px;
}

.magic-orb {
  position: relative;
  width: 88px;
  height: 88px;
}

.magic-orb__core {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fffde7 0%, #d4af37 40%, #7c5c15 80%, #3d2d08 100%);
  box-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 55px rgba(212,175,55,0.2), inset 0 4px 12px rgba(255,255,255,0.2);
  animation: orbPulse 2.4s ease-in-out infinite;
}

.magic-orb__ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.35);
  animation: orbRing 4s linear infinite;
}

.magic-orb__ring2 {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.15);
  animation: orbRing 6s linear infinite reverse;
}

.magic-orb__ring::before,
.magic-orb__ring2::before {
  content: '✦';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  color: #d4af37;
  font-size: 12px;
}

.magic-orb__ring2::before { content: '✧'; font-size: 10px; }

@keyframes orbPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 55px rgba(212,175,55,0.18);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(212,175,55,0.75), 0 0 90px rgba(212,175,55,0.3);
    transform: scale(1.06);
  }
}

@keyframes orbRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 15px;
  color: #b8a870;
  text-align: center;
  min-height: 24px;
  font-style: italic;
  letter-spacing: 0.2px;
  animation: textFade 0.4s ease;
}

@keyframes textFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── RESULT DISPLAY ─────────────────────────── */
#prediction-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-eyebrow {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.result-text {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 12px;
  padding: 18px 16px;
  line-height: 1.75;
  color: #d0c8b8;
  font-size: 15px;
  /* no max-height — modal-body handles scrolling */
}

.result-text p { margin: 0 0 12px; }
.result-text p:last-child { margin: 0; }
.result-text h3 { color: #d4af37; font-size: 14px; margin: 16px 0 8px; font-weight: 700; }
.result-text strong { color: #e8dcc8; }

/* Result actions — now lives in .modal-footer, no sticky needed */
.result-actions {
  display: flex;
  gap: 10px;
}

.btn-share {
  flex: 1;
  padding: 14px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.3);
  color: #d4af37;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.btn-share:hover { background: rgba(212,175,55,0.14); }

.btn-secondary {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: #666;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.04); color: #aaa; }

/* ── SPREAD VISUALIZATION ─────────────────────── */
.spread-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.spread-card {
  width: 80px;
  height: 124px;
  position: relative;
  flex: 0 0 auto;
  animation: dealCard 0.5s ease-out both;
}

@media (min-width: 420px) {
  .spread-card { width: 90px; height: 140px; }
}

@keyframes dealCard {
  from { opacity: 0; transform: translateY(-28px) rotateY(70deg); }
  to { opacity: 1; transform: translateY(0) rotateY(0); }
}

.card-inner {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,175,55,0.2);
}

.card-front {
  width: 100%;
  height: 100%;
  background: #1a1520;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spread-card.reversed .card-inner {
  transform: rotate(180deg);
}

.rune-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #131020, #1e1630);
  width: 100%;
  height: 100%;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.rune-symbol {
  font-size: 38px;
  color: #d4af37;
  text-shadow: 0 0 16px rgba(212,175,55,0.6);
  margin-bottom: 6px;
  line-height: 1;
}

.card-name {
  font-size: 10px;
  color: #777;
  margin-top: 4px;
  line-height: 1.2;
}

.card-rev-label {
  font-size: 9px;
  color: #d4804a;
  margin-top: 2px;
}

/* ── PALMISTRY UPLOAD ─────────────────────────── */
.upload-area {
  border: 2px dashed rgba(212,175,55,0.25);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-area:hover,
.upload-area.highlight {
  border-color: rgba(212,175,55,0.6);
  background: rgba(212,175,55,0.03);
}

.upload-area i { font-size: 2.5rem; color: #444; }
.upload-area p { color: #666; font-size: 14px; margin: 0; }

.btn-upload {
  padding: 10px 24px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.3);
  color: #d4af37;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-upload:hover { background: rgba(212,175,55,0.15); }

#image-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#preview-img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.2);
}

/* ── SHARE MODAL ─────────────────────────────── */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.share-modal.open { display: flex; }

.share-modal__content {
  background: #0f0f18;
  border: 1px solid rgba(212,175,55,0.2);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px 32px;
  width: 100%;
  max-width: 480px;
  color: #e8dcc8;
}

.share-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
}

.share-modal__close {
  background: transparent;
  border: none;
  color: #666;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.share-modal__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.share-btn {
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: filter 0.15s;
}
.share-btn:hover { filter: brightness(1.1); }
.share-btn--tg { background: #229ed9; }
.share-btn--wa { background: #25d366; }
.share-btn--fb { background: #1877f2; }
.share-btn--tw { background: #111; }
.share-btn--li { background: #0a66c2; }
.share-btn--em { background: #555; }

.share-modal__hint {
  font-size: 12px;
  color: #555;
  text-align: center;
  margin-top: 8px;
}

/* ── RUNE/CARD FALLBACK (inline override) ─────── */
