/* ========== Prediction extras (Info / Graph / Bet buttons + modal) ========== */
.ost-pred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ost-pred-btn {
  flex: 1 1 auto;
  min-width: 70px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f3f8ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.ost-pred-btn:hover { background: rgba(255, 255, 255, 0.13); }
.ost-pred-btn:active { transform: scale(0.97); }
.ost-pred-btn--yes { background: linear-gradient(135deg, #1f8a4f, #2eaf6f); border-color: #2eaf6f; color: #fff; }
.ost-pred-btn--no  { background: linear-gradient(135deg, #b13b4a, #d04a5b); border-color: #d04a5b; color: #fff; }

.ost-pred-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
}
.ost-pred-modal.is-open { display: flex; }
.ost-pred-modal__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(6px); }
.ost-pred-modal__panel {
  position: relative; max-width: 720px; width: calc(100% - 32px);
  max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, #0e1730, #0a1024);
  border: 1px solid rgba(125, 200, 255, 0.18);
  border-radius: 18px; padding: 28px 26px; color: #e9f1ff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.ost-pred-modal__close {
  position: absolute; top: 10px; right: 14px; background: transparent; border: 0;
  color: #a8b6d6; font-size: 26px; cursor: pointer; line-height: 1;
}
.ost-pred-modal__close:hover { color: #fff; }
.ost-pred-modal__head { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ost-pred-tag {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(125, 200, 255, 0.12);
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
}
.ost-pred-modal__panel h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.3; }
.ost-pred-sub { color: #9bb0d8; margin: 0 0 14px; font-size: 13px; }
.ost-pred-meta {
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px;
  margin: 0 0 18px; font-size: 13px;
}
.ost-pred-meta dt { color: #9bb0d8; }
.ost-pred-meta dd { margin: 0; color: #f3f8ff; }
.ost-pred-modal__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ost-pred-modal__cta .ost-pred-btn { flex: 1 1 140px; padding: 12px 14px; font-size: 14px; }
.ost-pred-canvas {
  width: 100%; max-width: 100%; height: auto; aspect-ratio: 64/22;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.06);
}
.ost-pred-label { display: block; margin: 14px 0; font-size: 13px; color: #c8d4ee; }
.ost-pred-label input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid rgba(125, 200, 255, 0.25);
  background: rgba(2, 6, 23, 0.6); color: #fff; font-size: 18px;
}
.ost-pred-status { min-height: 1.4em; margin-top: 10px; font-size: 13px; color: #c4d3f0; }
.ost-pred-status code { background: rgba(255, 255, 255, 0.08); padding: 2px 6px; border-radius: 4px; font-size: 11px; }

/* My bets panel */
.ost-bets-panel {
  margin: 24px 16px; padding: 18px; border-radius: 14px;
  background: linear-gradient(180deg, #0c1530, #0a1024);
  border: 1px solid rgba(125, 200, 255, 0.16);
}
.ost-bets-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ost-bets-panel h3 { margin: 0; font-size: 16px; color: #e9f1ff; }
.ost-bets-panel #ost-bets-refresh {
  background: transparent; border: 1px solid rgba(125, 200, 255, 0.3); color: #a8c4ee;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.ost-bet-row {
  display: grid; gap: 6px; padding: 12px; border-radius: 10px; margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04); border-left: 3px solid #5a7;
}
.ost-bet-row.is-won  { border-left-color: #2eaf6f; background: rgba(46, 175, 111, 0.08); }
.ost-bet-row.is-lost { border-left-color: #d04a5b; background: rgba(208, 74, 91, 0.06); }
.ost-bet-row.is-open { border-left-color: #7bbcf0; }
.ost-bet-row__title { font-weight: 600; font-size: 14px; }
.ost-bet-row__meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #b9c8e8; }
.ost-bet-row__meta strong { color: #f3f8ff; }
.ost-bet-claimed { color: #7be3a8; font-size: 12px; font-weight: 600; }
.ost-pred-empty { color: #97a8c8; font-size: 13px; padding: 12px; text-align: center; }

/* ========== Mobile request-desktop bar + tour ========== */
.ost-mobile-bar {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; gap: 8px; z-index: -1;
  background: rgba(8, 14, 30, 0.92); border: 1px solid rgba(125, 200, 255, 0.25);
  border-radius: 999px; padding: 6px 8px; backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.ost-mobile-bar button {
  background: transparent; border: 0; color: #d8e4ff;
  padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ost-mobile-bar button.is-active { background: rgba(125, 200, 255, 0.2); color: #fff; }
@media (max-width: 780px) { .ost-mobile-bar { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; } }
body.ost-force-desktop .ost-mobile-bar { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
body.ost-force-desktop { min-width: 1280px; }

/* Mobile responsiveness fixes */
@media (max-width: 780px) {
  body:not(.ost-force-desktop) {
    font-size: 15px;
  }
  body:not(.ost-force-desktop) .prediction-card,
  body:not(.ost-force-desktop) .prediction-pulse-card {
    min-height: auto;
  }
  body:not(.ost-force-desktop) .ost-pred-btn {
    padding: 12px 8px; font-size: 13px; min-height: 44px;
  }
  body:not(.ost-force-desktop) .ost-pred-modal__panel {
    width: calc(100% - 16px); padding: 20px 16px; border-radius: 14px;
  }
  body:not(.ost-force-desktop) input,
  body:not(.ost-force-desktop) button:not(.ost-pred-btn):not(.ost-mobile-bar button) {
    min-height: 44px; /* iOS touch target */
  }
  /* Compartments dock collapses to bottom row on phones */
  body:not(.ost-force-desktop) .ost-compartments-dock {
    bottom: 60px !important; top: auto !important; right: 50% !important;
    transform: translateX(50%) !important;
    flex-direction: row !important; max-width: calc(100vw - 16px); overflow-x: auto;
  }
}

/* ========== Treasury reserves panel ========== */
.ost-treasury-panel {
  margin: 24px 16px; padding: 18px; border-radius: 14px;
  background: linear-gradient(180deg, #0b1430, #08101f);
  border: 1px solid rgba(125, 200, 255, 0.16);
  color: #e9f1ff;
}
.ost-treasury-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ost-treasury-panel h3 { margin: 0; font-size: 16px; }
.ost-treasury-panel #ost-treasury-refresh {
  background: transparent; border: 1px solid rgba(125, 200, 255, 0.3); color: #a8c4ee;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.ost-treasury-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ost-treasury-summary > div {
  background: rgba(255, 255, 255, 0.04); padding: 10px 12px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.ost-treasury-summary strong { font-size: 18px; }
.ost-treasury-label { font-size: 11px; color: #9bb0d8; text-transform: uppercase; letter-spacing: 0.06em; }
.ost-treasury-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ost-treasury-chip {
  background: rgba(125, 200, 255, 0.12); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; color: #c4d8f5;
}
.ost-treasury-chip strong { color: #fff; margin-right: 4px; }
.ost-treasury-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ost-treasury-table th, .ost-treasury-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ost-treasury-table th { color: #9bb0d8; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.ost-treasury-empty { color: #97a8c8; font-size: 13px; padding: 16px; text-align: center; }
@media (max-width: 780px) {
  body:not(.ost-force-desktop) .ost-treasury-table { display: block; overflow-x: auto; }
}

/* ========== Guided tour overlay ========== */
.ost-tour {
  position: fixed; inset: 0; z-index: 10050; display: none;
  pointer-events: none;
}
.ost-tour.is-open { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
.ost-tour__veil {
  position: absolute; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  pointer-events: auto;
}
.ost-tour__card {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  max-width: 480px; width: calc(100% - 32px);
  background: linear-gradient(180deg, #0e1730, #0a1024);
  border: 1px solid rgba(125, 200, 255, 0.3);
  border-radius: 16px; padding: 20px; color: #f3f8ff;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.ost-tour__step { font-size: 11px; color: #9bb0d8; letter-spacing: 0.08em; text-transform: uppercase; }
.ost-tour__title { margin: 6px 0 10px; font-size: 18px; }
.ost-tour__body { font-size: 14px; line-height: 1.5; color: #d8e4ff; }
.ost-tour__cta { display: flex; gap: 10px; margin-top: 16px; justify-content: space-between; flex-wrap: wrap; }
.ost-tour__cta button {
  padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 600; font-size: 13px;
}
.ost-tour__skip { background: transparent; color: #a8b6d6; }
.ost-tour__next { background: linear-gradient(135deg, #6cb3ff, #4f8cf0); color: #fff; }
.ost-tour__pulse {
  position: absolute; border: 3px solid #6cb3ff; border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.55);
  animation: ostTourPulse 1.6s ease-in-out infinite;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}
@keyframes ostTourPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.55), 0 0 0 0 rgba(108, 179, 255, 0.5); }
  50% { box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.55), 0 0 0 14px rgba(108, 179, 255, 0); }
}

/* ── My OST bets — Polymarket-style portfolio v2 ─────────────────────── */
.ost-bets-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(124,230,168,0.04), rgba(108,159,255,0.06));
  border: 1px solid rgba(108,159,255,0.18); border-radius: 12px;
}
.ost-bets-stat { display: flex; flex-direction: column; gap: 2px; }
.ost-bets-stat span { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #9ba0c8; }
.ost-bets-stat strong { font-size: 16px; color: #f4ead4; font-variant-numeric: tabular-nums; }
.ost-bets-stat.is-pos strong { color: #7ce6a8; }
.ost-bets-stat.is-neg strong { color: #ff7c8a; }
.ost-bets-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ost-bets-tab {
  appearance: none; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04);
  color: #cbd1f0; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ost-bets-tab em { font-style: normal; opacity: 0.55; margin-left: 4px; font-weight: 500; }
.ost-bets-tab.is-active { background: linear-gradient(135deg, #7ce6a8, #4cc985); color: #0a0a0a; border-color: transparent; }
.ost-bets-tab:hover:not(.is-active) { background: rgba(255,255,255,0.08); }
.ost-bets-rows { display: flex; flex-direction: column; gap: 8px; }
.ost-bet-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 12px; border-left: 3px solid #7bbcf0;
  background: rgba(255,255,255,0.025); cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}
.ost-bet-row:hover { background: rgba(124,230,168,0.07); }
.ost-bet-row.is-yes  { border-left-color: #7ce6a8; }
.ost-bet-row.is-no   { border-left-color: #ff7c8a; }
.ost-bet-row.is-won  { background: rgba(46,175,111,0.10); }
.ost-bet-row.is-lost { opacity: 0.55; background: rgba(208,74,91,0.06); }
.ost-bet-row__main { min-width: 0; }
.ost-bet-row__title { font-weight: 700; font-size: 14px; color: #f4ead4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.ost-bet-row__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ost-bet-chip { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.06); color: #cbd1f0; letter-spacing: 0.03em; }
.ost-bet-chip--side.is-yes { background: rgba(124,230,168,0.18); color: #7ce6a8; }
.ost-bet-chip--side.is-no  { background: rgba(255,124,138,0.18); color: #ff7c8a; }
.ost-bet-chip--live.is-pos { background: rgba(124,230,168,0.16); color: #7ce6a8; }
.ost-bet-chip--live.is-neg { background: rgba(255,124,138,0.16); color: #ff7c8a; }
.ost-bet-chip--status { background: rgba(108,159,255,0.18); color: #6c9fff; text-transform: uppercase; }
.ost-bet-row__numbers { display: flex; gap: 14px; }
.ost-bet-row__numbers > div { display: flex; flex-direction: column; align-items: flex-end; }
.ost-bet-row__numbers span { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: #9ba0c8; }
.ost-bet-row__numbers strong { font-size: 13px; font-variant-numeric: tabular-nums; color: #f4ead4; }
.ost-bet-row__actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ost-pred-btn--ghost {
  appearance: none; background: rgba(108,159,255,0.10); color: #6c9fff;
  border: 1px solid rgba(108,159,255,0.28); padding: 6px 12px; border-radius: 8px;
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ost-pred-btn--ghost:hover { background: rgba(108,159,255,0.20); }
.ost-bet-explorer { font-size: 10px; color: #9ba0c8; text-decoration: none; }
.ost-bet-explorer:hover { color: #cbd1f0; text-decoration: underline; }
@media (max-width: 720px) {
  .ost-bet-row { grid-template-columns: 1fr; gap: 8px; }
  .ost-bet-row__numbers, .ost-bet-row__actions { justify-content: flex-start; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
