/* Oracle Paywall & Credits Styling */

body.oracle-modal-open {
  overflow: hidden;
}

.oracle-credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(27, 22, 32, 0.85);
  border: 1px solid #8f7bd1;
  color: #f3ece4;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.oracle-credit-badge__val {
  color: #f5c542;
  font-weight: 700;
}

.oracle-credit-badge .button--subtle {
  padding: 0.15rem 0.5rem;
  min-height: auto;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #cbbfd6;
  background: transparent;
  color: #f3ece4;
}

.oracle-credit-badge .button--subtle:hover {
  background: #8f7bd1;
  color: #fff;
}

/* Modals */
.oracle-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.oracle-modal-overlay[hidden] {
  display: none;
}

#credit-user-banner:not([hidden]) {
  display: flex;
}

.oracle-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 14, 0.85);
  backdrop-filter: blur(6px);
}

.oracle-modal-panel {
  position: relative;
  z-index: 10000;
  width: min(100%, 36rem);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 12px;
  background: #231b2c;
  color: #f3ece4;
  border: 1px solid #8f7bd1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

.oracle-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #cbbfd6;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.oracle-modal-close:hover {
  color: #fff;
}

.oracle-modal-close:focus-visible {
  outline: 3px solid var(--blue);
}

.oracle-modal-title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.75rem;
  color: #f5c542;
}

.oracle-modal-desc {
  margin: 0 0 1.5rem;
  color: #cbbfd6;
  font-size: 0.95rem;
  line-height: 1.5;
}

.oracle-modal-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: rgba(164, 69, 47, 0.25);
  border: 1px solid #a4452f;
  color: #ffb4a2;
  font-size: 0.9rem;
}

.oracle-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.oracle-modal-actions .button {
  min-height: 44px;
}

.button--subtle {
  background: transparent;
  border: 1px solid transparent;
  color: #cbbfd6;
  cursor: pointer;
}

.button--subtle:hover {
  color: #fff;
  text-decoration: underline;
}

/* Forms */
.oracle-auth-form .form-field {
  margin-bottom: 1.25rem;
}

.oracle-auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f3ece4;
}

.oracle-auth-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #8f7bd1;
  background: #1b1620;
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
}

.oracle-auth-form input:focus {
  outline: none;
  border-color: #f5c542;
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.3);
}

.oracle-auth-otp-note {
  margin: 0 0 1rem;
  color: #cbbfd6;
  font-size: 0.95rem;
}

/* Credit Bundles Grid */
.credit-bundles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.credit-bundle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  border-radius: 8px;
  background: #1b1620;
  border: 2px solid #8f7bd1;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.credit-bundle-card:hover {
  transform: translateY(-2px);
  border-color: #cbbfd6;
}

.credit-bundle-card.is-selected {
  border-color: #f5c542;
  background: #2a1f38;
  box-shadow: 0 0 16px rgba(245, 197, 66, 0.2);
}

.credit-bundle-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f5c542;
  color: #1b1620;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.credit-bundle-title {
  margin: 0.5rem 0 0.25rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: #fff;
}

.credit-bundle-credits {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5c542;
  margin: 0.25rem 0;
}

.credit-bundle-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f3ece4;
  margin-bottom: 0.25rem;
}

.credit-bundle-unit {
  font-size: 0.8rem;
  color: #cbbfd6;
  margin: 0;
}

/* PayPal Button Container */
.paypal-button-container {
  margin-top: 1.5rem;
  min-height: 48px;
}

.paypal-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #cbbfd6;
  padding: 1.5rem;
  font-size: 0.95rem;
}
.oracle { width: 100%; }
  .oracle [hidden] { display: none !important; }
  .oracle-form fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
  .oracle-form legend { font-family: var(--display); font-size: 1.4rem; margin-bottom: 0.75rem; }
  .oracle-moods { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .oracle-mood input { position: absolute; opacity: 0; }
  .oracle-mood span {
    display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--line);
    border-radius: 999px; cursor: pointer; font-family: var(--sans);
  }
  .oracle-mood input:checked + span { background: var(--rust); border-color: var(--rust); color: #fff; }
  .oracle-mood input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
  .oracle-counter { text-align: right; color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0; }
  .oracle-instructions, .oracle-status { color: var(--muted); font-size: 0.95rem; }
  .oracle-stage {
    position: relative; width: 100%; height: min(70vh, 34rem); background: #1b1620;
    border-radius: 8px; overflow: hidden; box-sizing: border-box; padding-bottom: 3.5rem;
  }
  .oracle-prompt {
    position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
    padding: 0.75rem; overflow: auto; background: rgba(27, 22, 32, 0.8); border-radius: 8px;
  }
  .oracle-prompt__panel {
    width: min(100%, 34rem); margin: auto; padding: 1.25rem; border-radius: 8px;
    background: #2a2233; color: #f3ece4; border: 1px solid #8f7bd1;
  }
  .oracle-prompt__mood { margin: 0 0 0.75rem; font-family: var(--display); font-size: 1.2rem; }
  .oracle-prompt label { color: #f3ece4; }
  .oracle-prompt textarea { width: 100%; box-sizing: border-box; }
  .oracle-prompt .oracle-counter { color: #cbbfd6; }
  .oracle-prompt__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
  .oracle-prompt .button--outline { color: #f3ece4; border-color: #cbbfd6; }
  .oracle-prompt .button:disabled { opacity: 0.5; cursor: not-allowed; }
  .oracle-simple__moods { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; align-content: center; flex: 1; }
  .oracle-simple__moods-title { flex-basis: 100%; text-align: center; margin: 0 0 0.5rem; font-family: var(--display); font-size: 1.4rem; color: #f3ece4; }
  .oracle-simple__mood {
    padding: 0.6rem 1.1rem; border-radius: 999px; border: 2px solid #8f7bd1; background: #3b2b66;
    color: #fff; font-family: var(--serif, Georgia, serif); font-size: 1rem; cursor: pointer;
  }
  .oracle-simple__mood[aria-checked='true'] { background: #a4452f; border-color: #f5c542; }
  .oracle-simple__mood:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
  .oracle-stage-wrap { position: relative; }
  .oracle-intent {
    margin: 0 0 0.5rem; padding: 0.5rem 0.8rem; border-radius: 8px; pointer-events: none;
    background: #1b1620; color: #f3ece4; font-size: 0.85rem; line-height: 1.35;
  }
  .oracle-intent-float .oracle-intent {
    position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2; margin: 0;
    width: max-content; max-width: calc(var(--oracle-free-left, 0px) - 0.75rem);
    background: rgba(27, 22, 32, 0.72); backdrop-filter: blur(4px);
  }
  .oracle-intent__row { margin: 0; overflow-wrap: anywhere; }
  .oracle-intent__row + .oracle-intent__row { margin-top: 0.2rem; }
  .oracle-intent__label {
    font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em;
    font-size: 0.65rem; color: #e0a58f; margin-right: 0.4rem;
  }
  .oracle-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
  .oracle-stage.is-revealing { height: min(70vh, 34rem); }
  .oracle-stage.is-revealing .oracle-simple__deck { display: none; }
  .oracle-stage.is-revealing .oracle-simple__spread { flex-wrap: wrap; align-content: center; flex: 1; }
  .oracle-stage.is-revealing .oracle-simple__slot { width: min(30%, 14rem); }
  .oracle-canvas:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
  .oracle-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }
  .oracle-count { margin: 0; font-weight: 600; margin-right: auto; }
  .oracle-controls--scene {
    position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; z-index: 4; margin: 0;
    gap: 0.5rem; justify-content: flex-end; pointer-events: none;
  }
  .oracle-controls--scene > * { pointer-events: auto; }
  .oracle-controls--scene .button { padding: 0.45rem 0.85rem; font-size: 0.85rem; background-color: rgba(27, 22, 32, 0.78); color: #f3ece4; border-color: #cbbfd6; backdrop-filter: blur(4px); }
  .oracle-controls--scene .button:not(.button--outline) { background-color: var(--rust); border-color: var(--rust); color: #fff; }
  .oracle-controls--scene .button:disabled { opacity: 0.5; cursor: not-allowed; }
  .oracle-controls--scene .oracle-count { color: #f3ece4; background: rgba(27, 22, 32, 0.78); padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.85rem; }
  @media (max-width: 600px) {
    .oracle-stage { padding-bottom: 6.5rem; }
    .oracle-controls--scene { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; gap: 0.4rem; }
    .oracle-controls--scene .button { padding: 0.4rem 0.65rem; font-size: 0.78rem; min-height: 2.75rem; }
  }
  .oracle-reading h2 { font-family: var(--display); }
  .oracle-reading__card { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem; }
  .oracle-reading__position { color: var(--rust); font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin: 0; }
  .oracle-reading__framing { color: var(--muted); font-style: italic; }
  .oracle-reading__note { color: var(--muted); font-size: 0.9rem; }

  .oracle-simple { height: 100%; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
  .oracle-simple__deck { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; transition: opacity 0.3s; }
  .oracle-simple__deck.is-dimmed { opacity: 0.3; }
  .oracle-simple__deck.is-stacked { gap: 0; }
  .oracle-simple__deck.is-stacked .oracle-simple__card { margin-left: -2.4rem; }
  .oracle-simple__deck.is-shuffling .oracle-simple__card { animation: oracle-shake 0.3s infinite alternate; }
  .oracle-simple__card {
    width: 3rem; aspect-ratio: 512 / 820; border: 1px solid #fff4; border-radius: 4px; padding: 0;
    background: #6d2e24 url('/oracle/back.webp') center / cover; cursor: pointer;
  }
  .oracle-simple__card:disabled { cursor: default; }
  .oracle-simple__card.is-picked { opacity: 0.25; }
  .oracle-simple__card:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
  .oracle-simple__spread { list-style: none; display: flex; gap: 0.5rem; justify-content: center; margin: 0; padding: 0; }
  .oracle-simple__slot { width: 4.5rem; aspect-ratio: 512 / 820; background: #fff1; border: 1px dashed #fff5; border-radius: 4px; }
  .oracle-simple__slot img { width: 100%; height: 100%; display: block; border-radius: 4px; animation: oracle-flip 0.6s ease-out; }
  @keyframes oracle-shake { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
  @keyframes oracle-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
  @media (prefers-reduced-motion: reduce) {
    .oracle-simple__deck.is-shuffling .oracle-simple__card, .oracle-simple__slot img { animation: none; }
  }