/*
 * Shared Bet Slip styles (flag-gated: new_bet_slip).
 * - Market option buttons rendered on game cards (.ph-markets / .ph-opt)
 * - Mobile (<768px): collapsed pill + expanding bottom sheet
 * - Desktop (>=768px): docked right rail with collapse tab
 * Matches the approved mockups (MLBPage / MLBPageDesktop).
 */

/* ---------- market buttons on game cards ----------
   Styled to match the House Odds box (.betting-odds-section):
   green-tinted glass container, uppercase green section titles,
   dark centered boxes with uppercase label + green bold odds. */
.ph-markets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid rgba(0, 255, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  backdrop-filter: blur(5px);
}
.ph-market-title {
  font-size: 0.8rem;
  color: #00cc88;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.ph-market-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ph-opt {
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.3s ease;
}
.ph-opt:hover {
  background: rgba(0, 255, 0, 0.1);
  border-color: rgba(0, 255, 0, 0.3);
  transform: translateY(-1px);
}
.ph-opt-label {
  font-size: 0.8rem;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.ph-opt-odds {
  font-size: 1rem;
  color: #00ff00;
  font-weight: bold;
  white-space: nowrap;
}
.ph-opt-on {
  background: rgba(0, 255, 136, 0.12);
  border-color: rgba(0, 255, 136, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
}
.ph-opt-on .ph-opt-label { color: #fff; }
.ph-opt-on .ph-opt-odds { color: #00ff88; }
.ph-opt-on::after {
  content: '✓';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00ff88;
  color: #050714;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- slip shell ---------- */
#ph-slip { font-family: inherit; }
.ph-coin {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  vertical-align: -0.18em;
  object-fit: cover;
}
.ph-slip-panel {
  background: #0d1130;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  color: #fff;
}
.ph-slip-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ph-slip-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-slip-count {
  font-size: 11px;
  font-weight: 700;
  color: #050714;
  background: #00ff88;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-slip-head-actions { display: flex; align-items: center; gap: 10px; }
.ph-slip-clear {
  background: none;
  border: none;
  color: #8b91b0;
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
}
.ph-slip-clear:hover { color: #ff4444; }
.ph-slip-collapse {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1a1e3a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8b91b0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.ph-slip-collapse:hover { color: #fff; }

.ph-slip-parlaybar {
  margin: 12px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #00ff88;
}
.ph-slip-parlaybar b { font-size: 13px; }

.ph-slip-legs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.ph-slip-leg {
  background: #1a1e3a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ph-slip-leg-info { display: flex; flex-direction: column; min-width: 0; }
.ph-slip-leg-pick {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}
.ph-slip-leg-sub {
  font-size: 10px;
  color: #8b91b0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-slip-leg-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ph-slip-leg-odds { font-size: 13px; font-weight: 700; color: #00ff88; }
.ph-slip-leg-x {
  background: none;
  border: none;
  color: #ff4444;
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ph-slip-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 32px 24px;
}
.ph-slip-empty-ico { font-size: 40px; opacity: 0.3; }
.ph-slip-empty-title { font-size: 14px; font-weight: 600; color: #fff; }
.ph-slip-empty-sub { font-size: 12px; color: #8b91b0; line-height: 1.5; }

.ph-slip-foot {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Currency toggle (Coins / Cash) — pill pair per approved canvas mockup */
.ph-slip-curtoggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ph-slip-curpill {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 2px;
}
.ph-slip-curbtn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: #8b91b0;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ph-slip-curbtn .ph-coin { width: 1em; height: 1em; }
.ph-slip-curbtn:hover { color: #d8dcef; }
.ph-slip-curbtn-on {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.4);
}
.ph-slip-curbtn-cash.ph-slip-curbtn-on {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.4);
}
/* Hound Cash bill artwork (replaces old "$" badge everywhere) */
.ph-cash-bill {
  height: 1.05em;
  width: auto;
  border-radius: 2px;
  vertical-align: -0.12em;
  display: inline-block;
}
.ph-slip-curbtn .ph-cash-bill { height: 11px; }
.ph-cash-doll {
  font-weight: 700;
  color: #fff;
  margin-left: 2px;
}
.ph-cashgreen { color: #00ff88; font-weight: 700; }
.ph-slip-bal {
  margin-left: auto;
  font-size: 11px;
  color: #8b91b0;
}
.ph-slip-bal b { color: #d8dcef; font-weight: 700; }
.ph-chip-cash.ph-slip-chip-on {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.4);
}
.ph-slip-chips-cash { grid-template-columns: repeat(4, 1fr); }

/* Currency switch confirmation pop-up (per approved canvas mockup) */
.ph-slip-curmodal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  background: rgba(3, 5, 16, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.ph-slip-curmodal-card {
  width: 100%;
  max-width: 330px;
  background: #1a1e3a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.ph-curmodal-bill {
  width: 200px;
  max-width: 85%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.25);
}
.ph-curmodal-coin { font-size: 44px; line-height: 1; }
.ph-curmodal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.ph-curmodal-sub {
  font-size: 12px;
  color: #8b91b0;
  line-height: 1.45;
}
.ph-curmodal-real { color: #00ff88; font-weight: 700; }
.ph-curmodal-kyc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
}
.ph-curmodal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.ph-curmodal-cancel {
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8b91b0;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.ph-curmodal-cancel:hover { background: rgba(255, 255, 255, 0.1); }
.ph-curmodal-confirm {
  height: 44px;
  border-radius: 12px;
  border: none;
  color: #050714;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.ph-curmodal-confirm-cash {
  background: #00ff88;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
}
.ph-curmodal-confirm-coin {
  background: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}
.ph-slip-place.ph-place-cash {
  background: linear-gradient(135deg, #00cc66, #00aa55);
}
.ph-slip-stakerow {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ph-slip-stakelabel { font-size: 12px; color: #8b91b0; }
.ph-slip-stakebox {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 7px 8px 7px 10px;
}
.ph-slip-stakebox input {
  width: 64px;
  background: transparent;
  border: none;
  outline: none;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: inherit;
}
.ph-slip-stakebox .ph-hc { font-size: 11px; color: #8b91b0; font-weight: 500; }
.ph-slip-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ph-slip-chip {
  height: 32px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  color: #8b91b0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.ph-slip-chip .ph-coin { width: 1em; height: 1em; }
/* Tailspin wheel-tier gradients (same as tailspin.html tier buttons) */
.ph-chip-bronze { background: linear-gradient(135deg, #e8a972, #b5743a); color: #1a0f05; border-color: rgba(0,0,0,0.25); }
.ph-chip-silver { background: linear-gradient(135deg, #eef2f6, #9fb1c2); color: #10161d; border-color: rgba(0,0,0,0.25); }
.ph-chip-gold   { background: linear-gradient(135deg, #fff1b8, #c8901a); color: #1c1303; border-color: rgba(0,0,0,0.25); }
.ph-chip-bronze:hover, .ph-chip-silver:hover, .ph-chip-gold:hover { filter: brightness(1.08); }
.ph-slip-chip:hover { background: rgba(255, 255, 255, 0.1); }
.ph-chip-bronze:hover { background: linear-gradient(135deg, #e8a972, #b5743a); }
.ph-chip-silver:hover { background: linear-gradient(135deg, #eef2f6, #9fb1c2); }
.ph-chip-gold:hover   { background: linear-gradient(135deg, #fff1b8, #c8901a); }
.ph-chip-bronze.ph-slip-chip-on, .ph-chip-silver.ph-slip-chip-on, .ph-chip-gold.ph-slip-chip-on {
  box-shadow: 0 0 0 2px #00ff88;
}
.ph-chip-bronze.ph-slip-chip-on { background: linear-gradient(135deg, #e8a972, #b5743a); color: #1a0f05; }
.ph-chip-silver.ph-slip-chip-on { background: linear-gradient(135deg, #eef2f6, #9fb1c2); color: #10161d; }
.ph-chip-gold.ph-slip-chip-on   { background: linear-gradient(135deg, #fff1b8, #c8901a); color: #1c1303; }
.ph-slip-chip-on {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.4);
}
.ph-slip-payrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.ph-slip-payrow .ph-slip-paylabel { color: #8b91b0; }
.ph-slip-payrow .ph-slip-payval { font-weight: 800; color: #ffd700; }
.ph-slip-msg {
  font-size: 12px;
  line-height: 1.4;
  border-radius: 8px;
  padding: 8px 10px;
  display: none;
}
.ph-slip-msg.ph-err {
  display: block;
  color: #ff6b6b;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
}
.ph-slip-msg.ph-ok {
  display: block;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.ph-slip-place {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: #00ff88;
  color: #050714;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
  transition: filter 0.15s, transform 0.1s;
}
.ph-slip-place:hover { filter: brightness(1.1); }
.ph-slip-place:active { transform: scale(0.99); }
.ph-slip-place:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* ---------- mobile (<768px): pill + bottom sheet ---------- */
.ph-slip-pill {
  position: fixed;
  left: 16px;
  right: 16px;
  /* sit above the mobile bottom nav (its measured height, +gap to clear the
     elevated center Slip button). Falls back to ~nav height before JS measures. */
  bottom: calc(var(--ph-botnav-h, 64px) + 22px);
  z-index: 9040;
  height: 42px;
  border-radius: 999px;
  background: #1a1e3a;
  border: 1px solid rgba(0, 255, 136, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  font-family: inherit;
}
.ph-slip-pill-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.ph-slip-pill-left .ph-dim { color: #8b91b0; font-weight: 500; }
.ph-slip-pill-left .ph-gold { color: #ffd700; font-weight: 700; }
.ph-slip-pill-arrow { color: #8b91b0; font-size: 14px; }

@media (max-width: 767px) {
  .ph-slip-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--ph-botnav-h, 64px) + 22px);
    z-index: 9045;
    max-height: 62vh;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  }
  .ph-slip-tab { display: none !important; }
  /* Desktop-only affordances hidden on mobile */
  .ph-slip-clear { display: inline-flex; }
}

/* ---------- desktop (>=768px): docked right rail ---------- */
@media (min-width: 768px) {
  .ph-slip-pill { display: none !important; }
  .ph-slip-panel {
    position: fixed;
    top: var(--ph-nav-h, 0px);
    right: 0;
    bottom: 0;
    width: 360px;
    z-index: 9030;
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }
  .ph-slip-tab {
    position: fixed;
    right: 0;
    top: 40%;
    z-index: 9030;
    width: 46px;
    padding: 14px 0 12px;
    border-radius: 12px 0 0 12px;
    background: #0d1130;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    color: #8b91b0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.35);
  }
  .ph-slip-tab:hover { background: #111744; }
  .ph-slip-tab-ico {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    position: relative;
  }
  .ph-slip-tab-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0d1130;
  }
  .ph-slip-tab-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
  }
  /* Push page content when the rail is open on wide screens */
  body.ph-rail-open { padding-right: 360px; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  /* On smaller desktops the rail overlays instead of pushing content */
  body.ph-rail-open { padding-right: 0; }
}
@media (min-width: 1100px) {
  /* The body padding-right that makes room for the rail also squeezes the
     sticky top navbar (width:100% of the body content box), which re-centers
     its inner .navbar-container and shifts the username pill left. Cancel the
     padding for the navbar row so it stays full viewport width; only the page
     content below the navbar gets pushed. */
  body.ph-rail-open #navbar-container { margin-right: -360px; }
}

/* New Bet Slip replaces the old Quick Menu FAB (parlays live in the slip,
   coin buying moved to the Hound Shop). Hide it wherever the slip loads. */
#quick-menu-fab, #quick-menu-options { display: none !important; }

/* HoundMind assistant: on desktop new-slip pages the right-rail bet slip lives
   on the right, so move the HoundMind button + chat panel to the bottom-LEFT to
   clear it. On mobile HoundMind lives as a tab in the bottom nav (Phase 2), so
   this desktop-only rule leaves the mobile floating button untouched for now. */
@media (min-width: 768px) {
  .houndmind-fab { left: 20px; right: auto; }
  .houndmind-panel { left: 20px; right: auto; }
}
