#tarotApp, #tarotApp * { box-sizing: border-box; }
  #tarotApp [hidden] { display: none !important; }
  #tarotApp {
    --bg-deep: #120a1f;
    --bg-panel: #1c1230;
    --gold: #d4af37;
    --gold-soft: #f1d98b;
    --purple: #6b3fa0;
    --text: #f3ecff;
    --text-dim: #b9a9d9;
    --mayor-a: #4a2a7a; --mayor-b: #8a4fd6;
    --bastos-a: #7a2e0e; --bastos-b: #d9622b;
    --copas-a: #0e4a6b; --copas-b: #2fa8d9;
    --espadas-a: #3a3f4a; --espadas-b: #9aa5b5;
    --oros-a: #5a4a0e; --oros-b: #d4af37;
    max-width: 880px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    background: radial-gradient(circle at 50% 0%, var(--bg-panel), var(--bg-deep) 70%);
    color: var(--text) !important;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    border-radius: 1rem;
  }
  #tarotApp h1, #tarotApp h2, #tarotApp h3 { font-family: Georgia, 'Times New Roman', serif; margin: 0 0 0.5rem; color: var(--text) !important; }
  #tarotApp .tarot-header { text-align: center; margin-bottom: 1.5rem; }
  #tarotApp .tarot-header h1 { color: var(--gold-soft) !important; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; gap: 0.3rem; }

  #tarotApp .tarot-icon { position: relative; display: inline-block; vertical-align: middle; flex-shrink: 0; }
  #tarotApp .tarot-icon-card {
    position: absolute; border-radius: 3px; aspect-ratio: 2 / 3; object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.35);
  }
  #tarotApp .tarot-icon-card.c1 { left: 0; top: 16%; transform: rotate(-14deg); z-index: 1; }
  #tarotApp .tarot-icon-card.c2 { left: 30%; top: 0; transform: rotate(0deg); z-index: 2; }
  #tarotApp .tarot-icon-card.c3 { left: 60%; top: 16%; transform: rotate(14deg); z-index: 1; }

  #tarotApp .tarot-icon--lg { width: 96px; height: 66px; }
  #tarotApp .tarot-icon--lg .tarot-icon-card { width: 38px; }
  #tarotApp .tarot-icon--md { width: 68px; height: 48px; }
  #tarotApp .tarot-icon--md .tarot-icon-card { width: 27px; }
  #tarotApp .tarot-icon--sm { width: 54px; height: 38px; margin-bottom: 0.4rem; }
  #tarotApp .tarot-icon--sm .tarot-icon-card { width: 21px; }
  #tarotApp .subtitle { color: var(--text-dim) !important; margin: 0; }

  #tarotApp .step-intro { color: var(--text-dim) !important; margin: 0 0 1rem; }
  #tarotApp .link-btn {
    background: none; border: none; color: var(--text-dim) !important; cursor: pointer;
    font-size: 0.8rem; text-decoration: underline; padding: 0; margin-bottom: 0.8rem;
  }
  #tarotApp .link-btn:hover { color: var(--gold-soft) !important; }

  #tarotApp .mode-step { max-width: 580px; margin: 0 auto; text-align: center; }
  #tarotApp .mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  #tarotApp .mode-card {
    background: rgba(255,255,255,0.04); border: 1px solid var(--purple); border-radius: 0.8rem;
    padding: 1.2rem; cursor: pointer; text-align: left; color: var(--text) !important;
    transition: transform 0.15s ease, border-color 0.15s ease; font: inherit;
  }
  #tarotApp .mode-card:hover { transform: translateY(-3px); border-color: var(--gold) !important; }
  #tarotApp .mode-card h3 { color: var(--gold-soft) !important; font-size: 1.05rem; }
  #tarotApp .mode-card p { color: var(--text-dim) !important; font-size: 0.82rem; margin: 0; line-height: 1.4; }

  #tarotApp .question-step { max-width: 480px; margin: 0 auto; text-align: center; }
  #tarotApp label { display: block; margin-bottom: 0.5rem; color: var(--text-dim) !important; }
  #tarotApp textarea {
    width: 100%; border-radius: 0.6rem; border: 1px solid var(--purple);
    background: rgba(255,255,255,0.05); color: var(--text) !important; padding: 0.7rem;
    font-size: 1rem; resize: vertical; margin-bottom: 1rem;
  }
  #tarotApp .btn-primary, #tarotApp .btn-secondary {
    font-size: 1rem; padding: 0.7rem 1.4rem; border-radius: 2rem; border: none;
    cursor: pointer; font-weight: 600; transition: transform 0.15s ease, opacity 0.15s ease;
  }
  #tarotApp .btn-primary { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #241533 !important; }
  #tarotApp .btn-secondary { background: transparent; color: var(--text) !important; border: 1px solid var(--purple); }
  #tarotApp .btn-primary:hover, #tarotApp .btn-secondary:hover { transform: translateY(-2px); }
  #tarotApp .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  #tarotApp .shuffle-step { max-width: 400px; margin: 0 auto; text-align: center; }
  #tarotApp .shuffle-deck { position: relative; width: 130px; height: 195px; margin: 1.2rem auto 1.6rem; }
  #tarotApp .deck-card {
    position: absolute; inset: 0; border-radius: 0.6rem; border: 1px solid var(--purple);
    background: repeating-linear-gradient(135deg, #2a1a45, #2a1a45 8px, #241338 8px, #241338 16px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }
  #tarotApp .deck-card:nth-child(2) { transform: translate(3px, -3px); }
  #tarotApp .deck-card:nth-child(3) { transform: translate(6px, -6px); }
  #tarotApp .deck-card:nth-child(4) { transform: translate(9px, -9px); }
  #tarotApp .deck-card:nth-child(5) { transform: translate(12px, -12px); }
  @keyframes shuffleMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-16px, -8px) rotate(-9deg); }
    50% { transform: translate(14px, 4px) rotate(7deg); }
    75% { transform: translate(-8px, 6px) rotate(-4deg); }
  }
  #tarotApp .shuffle-deck.is-shuffling .deck-card { animation: shuffleMove 0.9s ease-in-out; }
  #tarotApp .shuffle-deck.is-shuffling .deck-card:nth-child(1) { animation-delay: 0s; }
  #tarotApp .shuffle-deck.is-shuffling .deck-card:nth-child(2) { animation-delay: 0.06s; }
  #tarotApp .shuffle-deck.is-shuffling .deck-card:nth-child(3) { animation-delay: 0.12s; }
  #tarotApp .shuffle-deck.is-shuffling .deck-card:nth-child(4) { animation-delay: 0.18s; }
  #tarotApp .shuffle-deck.is-shuffling .deck-card:nth-child(5) { animation-delay: 0.24s; }
  @media (prefers-reduced-motion: reduce) {
    #tarotApp .shuffle-deck.is-shuffling .deck-card { animation: none; }
  }

  #tarotApp .spread { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
  #tarotApp .slot { background: rgba(255,255,255,0.04); border: 1px dashed var(--purple); border-radius: 0.8rem; padding: 0.8rem; text-align: center; }
  #tarotApp .slot-label { color: var(--gold-soft) !important; font-weight: 600; margin-bottom: 0.6rem; display: block; }
  #tarotApp .slot-placeholder {
    width: 100%; aspect-ratio: 2 / 3; border-radius: 0.6rem; margin: 0 auto 0.6rem;
    background: repeating-linear-gradient(135deg, #2a1a45, #2a1a45 8px, #241338 8px, #241338 16px);
    border: 1px solid var(--purple); display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: var(--text-dim) !important;
  }
  #tarotApp .slot-name { font-size: 0.85rem; color: var(--text-dim) !important; min-height: 1.2em; margin-top: 0.3rem; }

  #tarotApp .card-face { width: 100%; aspect-ratio: 2 / 3; margin: 0 auto; }
  #tarotApp .card-inner {
    position: relative; width: 100%; height: 100%; border-radius: 0.6rem; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.25); transition: transform 0.4s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }
  #tarotApp .card-inner.is-reversed { transform: rotate(180deg); }
  #tarotApp .arcana-mayor .card-inner { background: linear-gradient(160deg, var(--mayor-a), var(--mayor-b)); }
  #tarotApp .suit-bastos .card-inner { background: linear-gradient(160deg, var(--bastos-a), var(--bastos-b)); }
  #tarotApp .suit-copas .card-inner { background: linear-gradient(160deg, var(--copas-a), var(--copas-b)); }
  #tarotApp .suit-espadas .card-inner { background: linear-gradient(160deg, var(--espadas-a), var(--espadas-b)); }
  #tarotApp .suit-oros .card-inner { background: linear-gradient(160deg, var(--oros-a), var(--oros-b)); }
  #tarotApp .card-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  #tarotApp .card-symbolic {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: space-between; padding: 0.4rem; text-align: center;
  }
  #tarotApp .card-tag { font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.85) !important; align-self: flex-start; }
  #tarotApp .card-icon { font-size: 2.2rem; }
  #tarotApp .card-name-mini { font-size: 0.8rem; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }

  #tarotApp .reading { background: rgba(255,255,255,0.04); border-radius: 0.8rem; padding: 1.2rem; margin-top: 1.5rem; }
  #tarotApp .reading-question { font-style: italic; color: var(--gold-soft) !important; }
  #tarotApp .reading-line { margin: 1rem 0; padding-left: 0.8rem; border-left: 3px solid var(--purple); }
  #tarotApp .reading h2 { color: var(--gold-soft) !important; display: flex; align-items: center; gap: 0.4rem; }
  #tarotApp .reading-line h3 { color: var(--gold-soft) !important; font-size: 1.05rem; }
  #tarotApp .reading-synthesis { margin-top: 1.2rem; padding: 1rem; background: rgba(212,175,55,0.08); border-radius: 0.6rem; border: 1px solid rgba(212,175,55,0.3); }
  #tarotApp .reading-synthesis h3 { color: var(--gold-soft) !important; display: flex; align-items: center; gap: 0.4rem; }
  #tarotApp .footer-actions { text-align: center; margin-top: 1rem; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

  #tarotApp .modal-overlay {
    position: fixed; inset: 0; background: rgba(5,2,15,0.85); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 1rem;
  }
  #tarotApp .modal {
    background: var(--bg-panel); border: 1px solid var(--purple); border-radius: 1rem;
    width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column;
    padding: 1rem; color: var(--text) !important;
  }
  #tarotApp .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
  #tarotApp .modal-close { background: none; border: none; color: var(--text) !important; font-size: 1.3rem; cursor: pointer; }
  #tarotApp .card-search-input {
    width: 100%; padding: 0.55rem 0.8rem; border-radius: 0.5rem; border: 1px solid var(--purple);
    background: rgba(255,255,255,0.05); color: var(--text) !important; margin-bottom: 0.6rem; font-size: 0.9rem;
  }
  #tarotApp .card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(67px, 1fr)); gap: 8px;
    overflow-y: auto; padding: 0.3rem; flex: 1;
  }
  #tarotApp .card-grid.card-grid--browse { grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 10px; }
  #tarotApp .card-mini-btn {
    aspect-ratio: 2 / 3; border-radius: 0.3rem; border: 1px solid var(--purple); cursor: pointer;
    background: repeating-linear-gradient(135deg, #2a1a45, #2a1a45 6px, #241338 6px, #241338 12px);
    transition: transform 0.15s ease;
  }
  #tarotApp .card-mini-btn:hover { transform: scale(1.08); border-color: var(--gold) !important; }
  #tarotApp .card-search-btn {
    display: block; width: 100%; padding: 0; border: none; background: transparent;
    cursor: pointer; border-radius: 0.4rem; transition: transform 0.15s ease;
  }
  #tarotApp .card-search-btn:hover { transform: scale(1.06); }
  #tarotApp .card-search-empty { color: var(--text-dim) !important; text-align: center; padding: 2rem 1rem; grid-column: 1 / -1; }
  #tarotApp .reveal-panel {
    display: flex; gap: 1rem; align-items: center; margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.15); animation: flipReveal 0.35s ease;
  }
  @keyframes flipReveal { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
  #tarotApp .reveal-card { width: 154px; flex-shrink: 0; }
  #tarotApp .reveal-info { flex: 1; }
  #tarotApp .reveal-info h3 { color: var(--gold-soft) !important; margin-bottom: 0.3rem; }
  #tarotApp .reveal-info p { color: var(--text-dim) !important; font-size: 0.9rem; margin: 0 0 0.7rem; }
  #tarotApp .orientation-toggle { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
  #tarotApp .orientation-btn {
    flex: 1; padding: 0.4rem 0.6rem; border-radius: 0.5rem; border: 1px solid var(--purple);
    background: transparent; color: var(--text-dim) !important; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  }
  #tarotApp .orientation-btn.active { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #241533 !important; border-color: transparent !important; }
  #tarotApp .reveal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

  @media (max-width: 560px) {
    #tarotApp .mode-options { grid-template-columns: 1fr; }
    #tarotApp .spread { grid-template-columns: 1fr; }
    #tarotApp .reveal-panel { flex-direction: column; }
    #tarotApp .reveal-card { width: 196px; }
  }
