/* =====================================================
   Open Bets and Bet History (js/openbets.js)
   ZennaBet360' own design in sea blue, purple and white:
   a curved gradient header with a pill switch, rounded cards,
   stat tiles, a timeline of picks and a timeline of days.
   ===================================================== */

#view-bets {
  --sea: #0a6ea8;
  --sea-2: #1391d4;
  --sea-soft: #e8f4fc;
  --violet: #7c3aed;
  --violet-deep: #5b21b6;
  --violet-soft: #f2ecff;
  --ob-bg: #f7f5ff;
  --ob-card: #ffffff;
  --ob-line: #e7e0fa;
  --ob-ink: #1b2340;
  --ob-muted: #6b7394;
  --ob-grad: linear-gradient(115deg, var(--sea) 0%, #3b52c9 55%, var(--violet) 100%);
  --ob-shadow: 0 6px 18px rgba(76, 29, 149, 0.10), 0 1px 3px rgba(10, 110, 168, 0.08);
  background: var(--ob-bg);
  color: var(--ob-ink);
}
.theme-dark #view-bets {
  --sea: #3aa8e8;
  --sea-2: #5bbcf0;
  --sea-soft: #10304a;
  --violet: #a78bfa;
  --violet-deep: #7c3aed;
  --violet-soft: #2a2150;
  --ob-bg: #0c1524;
  --ob-card: #131f33;
  --ob-line: #26304f;
  --ob-ink: #e6ecf7;
  --ob-muted: #93a0bd;
  --ob-grad: linear-gradient(115deg, #0b4f7c 0%, #2e3a8f 55%, #5b21b6 100%);
  --ob-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
#view-bets > * { background-color: var(--ob-bg); }

/* ----- Header: gradient with a curved edge, frosted balance, pill switch ----- */
#view-bets .bets-top {
  position: relative;
  padding: 14px 0 26px;
  background: var(--ob-grad);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 8px 22px rgba(76, 29, 149, 0.22);
}
#view-bets .bets-bar { padding: 0 16px 16px; }
#view-bets .help-link { font-size: 0.92rem; opacity: 0.95; }
#view-bets .bets-balance {
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 1rem;
}
#view-bets .bets-balance .avatar { background: #fff; color: var(--violet-deep); }
#view-bets .bets-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
#view-bets .bt-tab {
  border-radius: 999px;
  padding: 10px 8px;
  background: transparent;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
#view-bets .bt-tab.active { background: #fff; color: var(--violet-deep); box-shadow: 0 3px 10px rgba(27, 35, 64, 0.18); }

/* ----- Open Bets filters ----- */
.ob-bar { display: flex; align-items: center; gap: 8px; padding: 16px 16px 6px; }
.ob-filters { display: flex; gap: 8px; flex: 1; min-width: 0; }
.ob-filter, .ob-sim-all {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ob-line);
  border-radius: 999px;
  background: var(--ob-card);
  color: var(--sea);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ob-filter .icon { width: 14px; height: 14px; }
.ob-filter.on { background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.2); }
.ob-sim-all { flex: none; color: var(--violet); border-color: color-mix(in srgb, var(--violet) 45%, transparent); }
.ob-message { margin: 8px 16px 0; }
.ob-list { display: grid; gap: 14px; padding: 12px 14px 18px; }
.ob-empty { margin: 0; padding: 30px 16px; text-align: center; color: var(--ob-muted); }

/* ----- Open bet card ----- */
.ob-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--ob-card);
  box-shadow: var(--ob-shadow);
}
.ob-head { display: flex; align-items: center; gap: 10px; }
.ob-title { display: grid; gap: 1px; margin-right: auto; min-width: 0; }
.ob-title strong { font-size: 1.08rem; color: var(--violet); }
.ob-title small { color: var(--ob-muted); font-size: 0.78rem; }
.ob-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ob-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.ob-act:hover { background: var(--violet-soft); color: var(--violet); }
.ob-act .icon { width: 14px; height: 14px; }
.ob-icon { padding: 0 8px; }
.ob-badge { padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.ob-badge.won { background: color-mix(in srgb, #16a34a 14%, var(--ob-card)); color: #16a34a; }
.ob-badge.lost { background: color-mix(in srgb, var(--ob-muted) 16%, var(--ob-card)); color: var(--ob-muted); }
.ob-badge.cashed { background: var(--violet-soft); color: var(--violet); }
.ob-when { margin-top: -6px; color: var(--ob-muted); font-size: 0.78rem; }

/* Matches, collapsed: a soft panel */
.ob-matches {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sea-soft) 60%, var(--ob-card));
}
.ob-match { display: flex; align-items: center; gap: 8px; font-size: 0.97rem; }
.ob-match::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--sea); }
.ob-teams { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-vs { color: var(--ob-muted); font-size: 0.85em; }
.ob-live { color: #e5484d; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ob-live small { font-weight: 600; font-size: 0.72rem; }
.ob-ft { color: var(--ob-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ob-mark { font-weight: 800; }
.ob-mark.won { color: #16a34a; }
.ob-mark.lost { color: #e5484d; }

/* Matches, expanded: a timeline of picks */
.ob-sels { list-style: none; margin: 0; padding: 0; }
.ob-sel {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 14px;
}
.ob-sel:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--sea), var(--violet));
  opacity: 0.35;
}
.ob-state {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sea-soft);
  color: var(--sea);
}
.ob-state .icon { width: 18px; height: 18px; }
.ob-state.won { background: #16a34a; color: #fff; font-weight: 800; }
.ob-state.lost { background: #e5484d; color: #fff; font-weight: 800; }
.ob-state.live { background: color-mix(in srgb, #e5484d 14%, var(--ob-card)); color: #e5484d; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; }
.ob-sel-body { display: grid; gap: 3px; min-width: 0; padding-top: 4px; }
.ob-sel-pick { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 1rem; }
.ob-sel-pick .icon { flex: none; width: 16px; height: 16px; color: var(--sea); }
.ob-sel-pick strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-sel-pick span {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 700;
}
.ob-sel-teams {
  justify-self: start;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--ob-ink);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--sea) 50%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.ob-sel-teams { cursor: pointer; }
.ob-sel-when { color: var(--ob-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.ob-toggle {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px dashed var(--ob-line);
  border-radius: 999px;
  background: none;
  color: var(--sea);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ob-toggle .icon { width: 15px; height: 15px; color: var(--violet); transition: transform 0.2s; }
.ob-toggle .icon.up { transform: rotate(180deg); }

/* Stake | Pot. Win tiles */
.ob-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ob-tile {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sea-soft) 70%, var(--ob-card));
}
.ob-tile span { color: var(--ob-muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.ob-tile strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ob-tile.accent { background: var(--violet-soft); }
.ob-tile.accent strong { color: var(--violet); }

.ob-cashout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  border: none;
  border-radius: 999px;
  background: var(--ob-grad);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(76, 29, 149, 0.28);
  cursor: pointer;
}
.ob-cashout .icon { width: 17px; height: 17px; }
.ob-cashout:hover { filter: brightness(1.06); }

/* ----- Bet History: filter bar ----- */
.hb-bar { display: flex; align-items: center; gap: 8px; padding: 16px 16px 6px; }
.hb-drop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ob-line);
  border-radius: 999px;
  background: var(--ob-card);
  color: var(--sea);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.hb-drop .icon { width: 14px; height: 14px; }
.hb-drop.on { background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.hb-tools { display: flex; gap: 6px; margin-left: auto; }
.hb-tool {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ob-line);
  border-radius: 50%;
  background: var(--ob-card);
  color: var(--sea);
  cursor: pointer;
}
.hb-tool .icon { width: 19px; height: 19px; }

/* ----- Bet History: a timeline of days ----- */
.hb-list { padding: 8px 14px 18px 8px; }
.hb-day { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); }
.hb-day::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 62px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--violet), transparent);
  opacity: 0.3;
}
.hb-date {
  display: grid;
  place-content: center;
  justify-items: center;
  width: 46px;
  height: 46px;
  margin-top: 12px;
  border-radius: 50%;
  background: var(--ob-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.28);
}
.hb-date strong { font-size: 1.05rem; line-height: 1; }
.hb-date span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.hb-cards { display: grid; gap: 12px; padding: 10px 0 6px; }

/* ----- Bet History card: coloured side stripe, result pill ----- */
.hb-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px 18px;
  border-radius: 16px;
  background: var(--ob-card);
  box-shadow: var(--ob-shadow);
  overflow: hidden;
}
.hb-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--violet);
}
.hb-card.cashed::before { background: var(--sea); }
.hb-card.lost::before { background: #8a96b3; }
.hb-card.pending::before { background: linear-gradient(var(--sea), var(--violet)); }
.hb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ob-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hb-head strong { margin-right: auto; font-size: 1.05rem; }
.hb-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 11px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.hb-card.cashed .hb-state { background: var(--sea); }
.hb-card.lost .hb-state { background: color-mix(in srgb, #8a96b3 22%, var(--ob-card)); color: var(--ob-muted); }
.hb-card.pending .hb-state { background: var(--sea-soft); color: var(--sea); }
.hb-state .icon { width: 15px; height: 15px; transition: transform 0.2s; }
.hb-state .icon.down { transform: rotate(90deg); }

.hb-sum {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sea-soft) 60%, var(--ob-card));
}
.hb-sum dt { color: var(--ob-muted); font-size: 0.88rem; }
.hb-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hb-sum dd.hb-big { font-size: 1.4rem; font-weight: 800; }
.hb-sum dd.hb-big.plus { color: var(--violet); }
.hb-profit {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, #16a34a 14%, var(--ob-card));
  color: #16a34a;
  font-size: 0.78rem;
  font-weight: 700;
}
.hb-card .ob-sels { padding: 0 2px; }
.hb-ticket { margin: 0; color: var(--ob-muted); font-size: 0.76rem; }

.hb-foot { display: flex; align-items: flex-end; gap: 10px; }
.hb-names { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hb-names li {
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--ob-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-remix {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--ob-grad);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.25);
  cursor: pointer;
}
.hb-remix .icon { width: 15px; height: 15px; }

/* Choices in the bottom sheet */
.hb-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hb-option {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hb-option.on { border-color: #7c3aed; color: #7c3aed; font-weight: 700; background: color-mix(in srgb, #7c3aed 8%, var(--card)); }

/* Recommended codes under the open bets */
#view-bets .rec-head .bookmark { color: var(--violet); }

@media (max-width: 360px) {
  .ob-card { padding: 12px; }
  .hb-card { padding: 12px 12px 12px 16px; }
  .ob-act { padding: 0 8px; font-size: 0.76rem; }
  .ob-filter, .hb-drop { padding: 0 10px; font-size: 0.8rem; }
  .hb-day { grid-template-columns: 46px minmax(0, 1fr); }
  .hb-date { width: 40px; height: 40px; }
  .hb-day::before { left: 22px; }
}

/* Very narrow phones: the Bet History filters wrap onto two lines */
@media (max-width: 374px) {
  .hb-bar { flex-wrap: wrap; row-gap: 8px; }
  .hb-drop { max-width: 100%; }
}

/* Long team names shorten with "..." instead of stretching the cards past the screen */
.ob-list, .ob-card, .hb-cards, .hb-card, .ob-matches, .ob-sels { grid-template-columns: minmax(0, 1fr); }
.ob-card > *, .hb-card > * { min-width: 0; }

/* "+4 more matches" under the first 3 */
.ob-more { display: block; }
.ob-more::before { display: none; }
.ob-more button {
  padding: 2px 0 0 14px;
  border: none;
  background: none;
  color: var(--violet);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

/* Live odds of each pick: "1.62 ▲" (price rose since the bet), "1.25 ▼" (price fell), or a lock */
.ob-now {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ob-now b { font-size: 0.66rem; }
.ob-now.up { background: color-mix(in srgb, #16a34a 14%, var(--ob-card)); color: #16a34a; }
.ob-now.down { background: color-mix(in srgb, #e5484d 13%, var(--ob-card)); color: #e5484d; }
.ob-now.locked { color: var(--ob-muted); }
.ob-now .icon { width: 12px; height: 12px; }
.ob-sel-now { display: flex; align-items: center; gap: 8px; color: var(--ob-muted); font-size: 0.82rem; }

/* Won / lost mark on the left of a match once it is over (green tick, red cross) */
.ob-leg {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}
.ob-leg.won { background: #16a34a; }
.ob-leg.lost { background: #e5484d; }
.ob-match.has-result::before { display: none; }
.hb-names li { display: flex; align-items: center; gap: 5px; }
.hb-names .ob-leg { width: 15px; height: 15px; font-size: 0.6rem; margin: 0; }

/* Won / lost marks: just a green tick or a red cross, no background */
.ob-leg, .ob-leg.won, .ob-leg.lost,
.ob-state.won, .ob-state.lost {
  background: none !important;
  box-shadow: none;
  font-weight: 900;
}
.ob-leg.won, .ob-state.won, .ob-mark.won { color: #16a34a; }
.ob-leg.lost, .ob-state.lost, .ob-mark.lost { color: #e5484d; }
.theme-dark .ob-leg.won, .theme-dark .ob-state.won { color: #22c55e; }
.theme-dark .ob-leg.lost, .theme-dark .ob-state.lost { color: #f87171; }
.ob-leg { width: auto; height: auto; font-size: 1.05rem; margin-right: 4px; }
.hb-names .ob-leg { width: auto; height: auto; font-size: 0.9rem; }
.ob-state.won, .ob-state.lost { font-size: 1.45rem; }

/* Bet History: the top of each card in the result's colour
   (purple = won, grey = lost, sea blue = cashed out), white text */
.hb-card { padding-top: 0; }
.hb-head {
  margin: 0 -14px 0 -18px;
  padding: 11px 14px 11px 18px;
  color: #fff;
  background: #7c3aed;
}
.hb-card.won .hb-head { background: linear-gradient(100deg, #6d28d9, #8b5cf6); }
.hb-card.lost .hb-head { background: #7b8499; }
.hb-card.cashed .hb-head { background: linear-gradient(100deg, #0a6ea8, #1391d4); }
.hb-card.pending .hb-head { background: var(--sea-soft); color: var(--sea); }
.theme-dark .hb-card.lost .hb-head { background: #4a5268; }
.hb-card:not(.pending) .hb-state,
.hb-card.lost .hb-state,
.hb-card.cashed .hb-state {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
@media (max-width: 360px) {
  .hb-head { margin: 0 -12px 0 -16px; padding: 10px 12px 10px 16px; }
}

/* =====================================================
   Ticket Details (js/openbets.js renderTicket)
   ===================================================== */
#view-ticket {
  --sea: #0a6ea8; --sea-soft: #e8f4fc; --violet: #7c3aed; --violet-deep: #5b21b6; --violet-soft: #f2ecff;
  --tk-bg: #f7f5ff; --tk-card: #ffffff; --tk-line: #e7e0fa; --tk-muted: #6b7394;
  background: var(--tk-bg);
  min-height: 100vh;
  padding-bottom: 90px;
}
.theme-dark #view-ticket {
  --sea: #3aa8e8; --sea-soft: #10304a; --violet: #a78bfa; --violet-deep: #7c3aed; --violet-soft: #2a2150;
  --tk-bg: #0c1524; --tk-card: #131f33; --tk-line: #26304f; --tk-muted: #93a0bd;
}
.tk-top { grid-template-columns: auto 1fr auto; gap: 8px; }
.tk-top h1 { text-align: center; }
.tk-top .dep-back { color: #fff; }
.tk-top-tools { display: flex; gap: 4px; justify-self: end; }
.tk-icon { display: grid; place-items: center; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; }
.tk-icon .icon { width: 20px; height: 20px; }

/* Summary panel: sea blue into purple, white text */
.tk-sum {
  display: grid;
  gap: 8px;
  margin: 14px 12px 0;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0b3a66 0%, #25308a 55%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(76, 29, 149, 0.28);
}
.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tk-meta { color: rgba(255, 255, 255, 0.72); font-size: 0.85rem; }
.tk-type strong { font-size: 1.25rem; }
.tk-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; font-weight: 700; background: rgba(255, 255, 255, 0.16); }
.tk-status.won { background: #fff; color: var(--violet-deep); }
.tk-status .icon { width: 16px; height: 16px; }
.tk-return span { color: rgba(255, 255, 255, 0.8); }
.tk-return strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.tk-sum.won .tk-return strong { color: #d9ccff; }
.tk-facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin: 6px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.tk-facts dt { color: rgba(255, 255, 255, 0.72); }
.tk-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; border: none; border-radius: 999px;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.tk-btn .icon { width: 17px; height: 17px; }
.tk-btn.show { background: #fff; color: var(--violet-deep); }
.tk-btn.remix { background: rgba(255, 255, 255, 0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }

.tk-verify { margin: 12px 12px 0; padding: 10px; border-radius: 12px; background: var(--sea-soft); color: var(--tk-muted); text-align: center; font-size: 0.9rem; }
.tk-verify strong { color: var(--violet); letter-spacing: 0.04em; }

/* One block per match */
.tk-sels { list-style: none; margin: 12px 12px 0; padding: 0; display: grid; gap: 12px; }
.tk-sel {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: var(--tk-card);
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.08);
  min-width: 0;
}
.tk-game { color: var(--tk-muted); font-size: 0.82rem; }
.tk-teams { font-size: 1.05rem; font-weight: 600; }
.tk-teams span { color: var(--tk-muted); font-weight: 400; }
.tk-tracker {
  justify-self: start; display: inline-flex; align-items: center; gap: 5px;
  padding: 0; border: none; background: none; color: var(--sea);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.tk-tracker .icon { width: 16px; height: 16px; }
.tk-ft { display: flex; gap: 10px; align-items: baseline; }
.tk-ft span { color: var(--tk-muted); }
.tk-ft strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tk-pick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sea-soft);
}
.tk-sel.won .tk-pick { background: var(--violet-soft); }
.tk-sel.lost .tk-pick { background: color-mix(in srgb, var(--tk-muted) 14%, var(--tk-card)); }
.tk-pick dt { color: var(--tk-muted); text-align: right; }
.tk-pick dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-mark { font-weight: 900; font-size: 1.1rem; }
.tk-mark.won { color: #16a34a; }
.tk-mark.lost { color: #e5484d; }
.theme-dark .tk-mark.won { color: #22c55e; }
.theme-dark .tk-mark.lost { color: #f87171; }
#view-ticket .disclaimer { margin: 16px 12px 0; }
.tk-cashout {
  width: 100%;
  margin-top: 4px;
  background: #fff;
  color: var(--violet-deep);
}
.tk-sum.pending .tk-status { background: rgba(255, 255, 255, 0.2); }
.tk-ft .ob-live { font-weight: 700; }

/* Ticket Details: the summary panel takes the colour of the ticket's top bar in Bet History
   (purple = won, grey = lost, sea blue = cashed out, light sea blue = open) */
.tk-sum.won { background: linear-gradient(100deg, #6d28d9, #8b5cf6); }
.tk-sum.lost { background: #7b8499; box-shadow: 0 10px 24px rgba(40, 48, 70, 0.3); }
.tk-sum.cashed { background: linear-gradient(100deg, #0a6ea8, #1391d4); box-shadow: 0 10px 24px rgba(10, 110, 168, 0.3); }
.theme-dark .tk-sum.lost { background: #4a5268; }
.tk-sum.won .tk-return strong { color: #fff; }
.tk-sum.won .tk-status.won { background: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.tk-sum.lost .tk-status, .tk-sum.cashed .tk-status { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }

/* Open ticket: light sea blue with dark text, like its bar in Bet History */
.tk-sum.pending { background: var(--sea-soft); color: var(--sea); box-shadow: 0 8px 20px rgba(10, 110, 168, 0.15); }
.tk-sum.pending .tk-meta, .tk-sum.pending .tk-return span, .tk-sum.pending .tk-facts dt { color: var(--tk-muted); }
.tk-sum.pending .tk-type strong, .tk-sum.pending .tk-return strong, .tk-sum.pending .tk-facts dd { color: var(--sea); }
.tk-sum.pending .tk-facts { border-top-color: color-mix(in srgb, var(--sea) 25%, transparent); }
.tk-sum.pending .tk-status { background: #fff; color: var(--sea); }
.tk-sum.pending .tk-btn.show { background: var(--sea); color: #fff; }
.tk-sum.pending .tk-btn.remix { background: transparent; color: var(--sea); box-shadow: inset 0 0 0 1px var(--sea); }
.tk-sum.pending .tk-cashout { background: linear-gradient(115deg, #0a6ea8, #7c3aed); color: #fff; }
.theme-dark .tk-sum.pending .tk-status { background: rgba(255, 255, 255, 0.12); color: #9fd3f5; }
.theme-dark .tk-sum.pending .tk-type strong, .theme-dark .tk-sum.pending .tk-return strong, .theme-dark .tk-sum.pending .tk-facts dd { color: #9fd3f5; }

/* =====================================================
   Mirror (glass) finish for Ticket Details and the Bet History bars:
   the same colours a little darker, a reflection across the top half,
   a thin light edge and a slow diagonal shine.
   ===================================================== */
.tk-sum, .hb-head {
  --glass-a: rgba(91, 33, 182, 0.92);      /* won: deep purple */
  --glass-b: rgba(124, 58, 237, 0.72);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, var(--glass-a), var(--glass-b)) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.tk-sum.lost, .hb-card.lost .hb-head { --glass-a: rgba(58, 65, 84, 0.94); --glass-b: rgba(92, 101, 124, 0.8); }
.tk-sum.cashed, .hb-card.cashed .hb-head { --glass-a: rgba(7, 74, 118, 0.94); --glass-b: rgba(14, 116, 172, 0.78); }
.tk-sum.pending, .hb-card.pending .hb-head { --glass-a: rgba(12, 40, 64, 0.94); --glass-b: rgba(20, 66, 100, 0.82); }
:root:not(.theme-dark) .tk-sum.pending, :root:not(.theme-dark) .hb-card.pending .hb-head { --glass-a: rgba(214, 234, 248, 0.95); --glass-b: rgba(236, 245, 252, 0.85); }

.tk-sum { border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 12px 28px rgba(8, 12, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important; }
.hb-head { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.15); }

/* The reflection: bright at the top, fading out halfway down, like glass */
.tk-sum::before, .hb-head::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.06) 70%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
/* The shine: one soft diagonal streak that sweeps across once */
.tk-sum::after, .hb-head::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -60%;
  width: 45%;
  z-index: -1;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  animation: glass-shine 2.4s ease-out 0.3s 1 both;
  pointer-events: none;
}
@keyframes glass-shine { from { left: -60%; } to { left: 130%; } }
.tk-sum > *, .hb-head > * { position: relative; z-index: 1; }

/* Buttons and pills on the glass: frosted too */
.tk-sum .tk-btn.remix, .tk-sum .tk-status, .hb-card:not(.pending) .hb-state {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tk-sum.won .tk-btn.show { background: rgba(255, 255, 255, 0.92); }

@media (prefers-reduced-motion: reduce) {
  .tk-sum::after, .hb-head::after { animation: none; display: none; }
}

/* Cash out that follows the live odds (js/cashout.js) */
.co-move { margin-left: 4px; font-size: 0.72rem; }
.co-move.up { color: #86efac; }
.co-move.down { color: #fca5a5; }
.ob-cashout.co-paused, .tk-cashout.co-paused {
  background: color-mix(in srgb, var(--ob-muted, #6b7394) 28%, var(--ob-card, #131f33)) !important;
  color: var(--ob-muted, #93a0bd) !important;
  box-shadow: none !important;
  font-size: 0.9rem;
  cursor: not-allowed;
}
.co-paused .icon { width: 14px; height: 14px; }

/* =====================================================
   Bet Successful panel (js/betsuccess.js)
   ===================================================== */
.bs-success { padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.bso-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 14px; }
.bso-tick {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a6ea8, #7c3aed);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
  animation: bso-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes bso-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bso-head h2 { margin: 0; font-size: 1.45rem; }
.bso-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 12px;
  margin: 0;
  padding: 0 4px 16px;
  border-bottom: 1px solid var(--line);
}
.bso-rows dt { color: var(--muted); }
.bso-rows dd { margin: 0; justify-self: end; font-variant-numeric: tabular-nums; }
.bso-rows strong { font-size: 1.05rem; }
.bso-code { color: var(--text) !important; font-weight: 800; letter-spacing: 0.04em; }
.bso-tools { display: flex; gap: 6px; }
.bso-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--sea-soft, #e9f4fc);
  color: var(--ink);
  cursor: pointer;
}
.theme-dark .bso-icon { color: #8fd3ff; }
.bso-icon .icon { width: 18px; height: 18px; }
.bso-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--purple);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.bso-custom { color: var(--purple); letter-spacing: 0.04em; }
.bso-assign { grid-column: 1 / -1; justify-self: stretch !important; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.bso-assign .field { margin: 0; text-transform: uppercase; }
.bso-assign .message { grid-column: 1 / -1; margin: 0; }
.bso-rec {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 4px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bso-rec .bookmark { width: 26px; height: 26px; color: var(--purple); }
.bso-rec span { flex: 1; display: grid; gap: 2px; }
.bso-rec small { color: var(--muted); }
.bso-rec > .icon:last-child { transition: transform 0.2s; }
.bso-rec > .icon.up { transform: rotate(180deg); }
.bso-codes { margin: 8px 0 0; }
.bso-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }
.bso-btn {
  min-height: 52px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.bso-btn.rebet { background: var(--sea-soft, #e9f4fc); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent); }
.theme-dark .bso-btn.rebet { color: #8fd3ff; }
.bso-btn.ok { background: linear-gradient(115deg, #0a6ea8 0%, #3b52c9 55%, #7c3aed 100%); color: #fff; box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3); }
@media (prefers-reduced-motion: reduce) { .bso-tick { animation: none; } }

/* Booked code message in the bet slip (js/codes.js) */
.cd-booked { display: grid; gap: 8px; }
.cd-code { color: var(--purple); letter-spacing: 0.06em; font-size: 1.1em; }
.cd-tools { display: flex; gap: 8px; }

/* Void picks and bets: a match the site called off counts as 1.00, and a bet with only
   void picks gives the stake back. Shown in sea blue, like a cash out. */
.ob-state.void, .ob-leg.void, .tk-mark.void {
  display: inline-grid;
  place-items: center;
  background: var(--sea-soft, #e8f4fc) !important;
  color: var(--sea, #0a6ea8) !important;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ob-leg.void, .tk-mark.void { width: auto; height: auto; padding: 2px 6px; border-radius: 999px; font-size: 0.6rem; }
.hb-card.void::before { background: var(--sea); }
.hb-card.void .hb-head { --glass-a: rgba(7, 74, 118, 0.94); --glass-b: rgba(14, 116, 172, 0.78); }
.hb-card.void .hb-state { background: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.tk-sum.void { --glass-a: rgba(7, 74, 118, 0.94); --glass-b: rgba(14, 116, 172, 0.78); }
.tk-sum.void .tk-status { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.tk-sel.void .tk-pick { background: color-mix(in srgb, var(--tk-muted) 10%, var(--tk-card)); }
