/* ASCENDOJO ORACLE — reskin of kr1ptx-tools/oracle onto the shell's own
   glass/Dojo tokens (tokens.css, app.css), same approach as battle.css /
   chat.css: layout/behavior only, color/radius/type/motion come from
   shared design tokens. --dojo-accent resolves to the Trading Dojo's
   orange (tokens.css), which is close to the original tool's own primary
   orange (#FF5500) — a happy coincidence that keeps the migrated look
   feeling native to both worlds. */

.oracle-shell {
  max-width: 480px;
  margin: 0 auto;
}

/* ── Price panel ── */
.oracle-price-panel {
  text-align: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.oracle-asset-select {
  background: transparent;
  border: none;
  color: var(--shell-ink-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  outline: none;
  cursor: pointer;
  margin-bottom: 6px;
  text-align: center;
}
.oracle-asset-select:hover {
  color: var(--shell-ink);
}
.oracle-asset-select option {
  background: var(--shell-bg-raised);
  color: var(--shell-ink);
}
.oracle-price-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 9vw, 56px);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--shell-ink);
}
.oracle-price-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}

/* ── Sentiment + Hive Ratio ── */
.oracle-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.oracle-stat-card {
  text-align: center;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.oracle-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--shell-ink-faint);
  margin-bottom: 6px;
}
.oracle-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--shell-ink);
}
.oracle-ratio-wrap {
  position: relative;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
}
.oracle-ratio-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--shell-ink);
}

/* ── Direction select ── */
.oracle-dir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.oracle-dir-btn {
  height: 128px;
  border-radius: var(--r-lg);
  border: 1px solid var(--shell-border);
  background: var(--glass-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.oracle-dir-btn:active {
  transform: scale(0.97);
}
.oracle-dir-btn svg {
  width: 22px;
  height: 22px;
  padding: 10px;
  border-radius: 50%;
  background: var(--shell-bg);
  box-sizing: content-box;
}
.oracle-dir-btn span {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--shell-ink);
}
.oracle-dir-btn--long svg {
  color: var(--accent-green);
  border: 1px solid var(--accent-green-soft);
}
.oracle-dir-btn--long:hover {
  border-color: var(--accent-green);
}
.oracle-dir-btn--long.is-selected {
  background: var(--accent-green-soft);
  border-color: var(--accent-green);
  box-shadow: 0 0 24px -8px var(--accent-green-glow);
}
.oracle-dir-btn--short svg {
  color: var(--state-danger);
  border: 1px solid rgba(224, 96, 90, 0.2);
}
.oracle-dir-btn--short:hover {
  border-color: var(--state-danger);
}
.oracle-dir-btn--short.is-selected {
  background: rgba(224, 96, 90, 0.12);
  border-color: var(--state-danger);
  box-shadow: 0 0 24px -8px rgba(224, 96, 90, 0.45);
}

.oracle-tp-field {
  position: relative;
  margin-top: 16px;
}
.oracle-tp-field__prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--shell-ink-faint);
  font-weight: 600;
  pointer-events: none;
}
.oracle-tp-field input {
  padding-left: 30px;
  font-family: var(--font-mono);
  font-size: 18px;
  text-align: left;
}

/* ── Active / locked signal box ── */
.oracle-active-box {
  border-radius: var(--r-lg);
  border: 1px solid var(--dojo-accent);
  background: var(--dojo-accent-soft);
  text-align: center;
  padding: 44px 24px;
  margin-top: 24px;
}
.oracle-active-box--locked {
  border-color: var(--state-danger);
  background: rgba(224, 96, 90, 0.08);
}
.oracle-active-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dojo-accent);
  border-bottom: 1px solid var(--dojo-accent-soft);
  padding-bottom: 6px;
  margin-bottom: 16px;
  max-width: 340px;
}
.oracle-active-box--locked .oracle-active-status {
  color: var(--state-danger);
  border-color: rgba(224, 96, 90, 0.3);
}
.oracle-active-dir {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--shell-ink);
  margin-bottom: 6px;
}
.oracle-active-asset {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--shell-ink-muted);
  margin-bottom: 16px;
}
.oracle-active-asset b {
  color: var(--shell-ink);
}
.oracle-active-next {
  display: inline-block;
  background: var(--shell-bg-raised);
  border: 1px solid var(--shell-border);
  border-radius: var(--r-sm);
  padding: 8px 16px;
}
.oracle-active-next .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--shell-ink-faint);
}
.oracle-active-next .value {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--shell-ink);
}

/* ── Local fixed overlays (result modal, inspect modal) — same technique
   as chat.css's .chat-overlay/.chat-popup, just fixed (full viewport)
   instead of absolute (scoped to a panel), matching the original tool's
   own full-screen modals. ── */
.oracle-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(3, 3, 3, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.oracle-overlay.show {
  display: flex;
}
.oracle-modal {
  width: 100%;
  max-width: 380px;
  background: var(--shell-bg-raised);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--glass-inner-glow), var(--shadow-lg);
}
.oracle-modal__icon {
  color: var(--dojo-accent); /* default; overridden per-outcome inline via style.color on this element, which the svg below inherits */
}
.oracle-modal__icon svg {
  width: 40px;
  height: 40px;
}
.oracle-modal__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--shell-ink);
  margin-top: 10px;
}
.oracle-modal__xp {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--dojo-accent);
  margin-top: 4px;
  margin-bottom: 18px;
}
.oracle-modal__body {
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  color: var(--shell-ink-dim);
  background: var(--shell-surface);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 22px;
  white-space: pre-line;
  font-family: var(--font-mono);
}

/* ── Leaderboard ── */
.oracle-lb-head {
  text-align: center;
  margin-bottom: 24px;
}
.oracle-lb-head h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--shell-ink);
}
.oracle-lb-head .rule {
  width: 60px;
  height: 3px;
  background: var(--dojo-accent);
  border-radius: var(--r-pill);
  margin: 8px auto 10px;
}
.oracle-lb-head p {
  font-size: 11px;
  color: var(--shell-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.oracle-lb-list {
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  overflow: hidden;
}
.oracle-lb-cols {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-bg-raised);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--shell-ink-faint);
}
.oracle-lb-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--shell-border-hairline);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.oracle-lb-row:hover {
  background: var(--shell-surface-hover);
}
.oracle-lb-row:last-child {
  border-bottom: none;
}
.oracle-lb-rank {
  width: 34px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--shell-ink-faint);
}
.oracle-lb-rank--gold {
  color: #ffd700;
}
.oracle-lb-rank--silver {
  color: #c9c9d1;
}
.oracle-lb-rank--bronze {
  color: var(--accent-orange);
}
.oracle-lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--shell-surface);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--shell-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shell-ink-faint);
  flex-shrink: 0;
  margin: 0 10px;
}
.oracle-lb-avatar svg {
  width: 14px;
  height: 14px;
}
.oracle-lb-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--shell-ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oracle-lb-xp {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--dojo-accent);
}
.oracle-inspect-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--dojo-accent);
  box-shadow: 0 0 18px -4px var(--dojo-accent-soft);
  background: var(--shell-surface);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shell-ink-faint);
  margin: 0 auto 16px;
}
.oracle-inspect-avatar svg {
  width: 28px;
  height: 28px;
}
.oracle-inspect-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--shell-ink);
  margin-bottom: 12px;
}
.oracle-inspect-dir {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 4px;
}
.oracle-inspect-asset {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--shell-ink-faint);
  margin-bottom: 14px;
}
.oracle-inspect-target {
  display: inline-block;
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--shell-ink-faint);
}
.oracle-inspect-target b {
  color: var(--shell-ink);
  background: var(--shell-bg);
  padding: 0 4px;
}
.oracle-inspect-empty {
  color: var(--shell-ink-faint);
  font-size: 13px;
  margin-top: 12px;
}

/* ── ID Card ── */
.oracle-idcard-head {
  text-align: center;
  margin-bottom: 24px;
}
.oracle-idcard-head h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--shell-ink);
}
.oracle-card {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  background: linear-gradient(125deg, #000 0%, #1a0b2e 40%, #0f172a 70%, #000 100%);
  background-size: 300% 300%;
  animation: oracle-galaxy-drift 18s ease infinite;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
@keyframes oracle-galaxy-drift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.oracle-card__stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.25;
  pointer-events: none;
}
.oracle-card__inner {
  position: relative;
  z-index: 1;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.oracle-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.oracle-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}
.oracle-card__brand svg {
  width: 22px;
  height: 22px;
  color: var(--dojo-accent);
}
.oracle-card__clearance {
  text-align: right;
}
.oracle-card__clearance .label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dojo-accent);
  margin-bottom: 2px;
}
.oracle-card__clearance .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}
.oracle-card__mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  margin: 20px 0;
}
.oracle-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4) center/cover;
  box-shadow: 0 0 24px -4px var(--dojo-accent-glow, var(--dojo-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
}
.oracle-card__avatar svg {
  width: 34px;
  height: 34px;
}
.oracle-card__name-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
}
.oracle-card__name {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  word-break: break-word;
}
.oracle-card__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 24px;
}
.oracle-card__xp-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 2px;
}
.oracle-card__xp {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.oracle-card__qr {
  background: #fff;
  padding: 6px;
  border-radius: var(--r-sm);
  line-height: 0;
  flex-shrink: 0;
}
.oracle-idcard-hint {
  text-align: center;
  padding: 14px;
  border: 1px solid var(--shell-border);
  border-radius: var(--r-md);
  background: var(--glass-bg);
  margin-bottom: 16px;
}
.oracle-idcard-hint p {
  font-size: 11px;
  color: var(--shell-ink-faint);
}

/* ── ID card preview modal ── */
.oracle-preview-modal .oracle-modal {
  max-width: 460px;
  padding: 24px;
}
.oracle-preview-modal__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shell-ink);
  margin-bottom: 16px;
}
.oracle-preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.oracle-preview-actions .btn {
  flex: 1;
}

@media (max-width: 640px) {
  .oracle-dir-grid {
    gap: 10px;
  }
  .oracle-dir-btn {
    height: 108px;
  }
}
