/* Styles owned by the account agent. Loaded after style.css, so rules here win. */

/* ===== Filter chips (Bet History, Transactions, Take a Break) ===== */
.hist-filters { display: grid; gap: 8px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.hist-row { display: flex; gap: 8px; }
.hist-chip {
  flex: none;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.hist-chip:hover { border-color: var(--green); }
.hist-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.hist-chip:focus-visible, .bet-head:focus-visible, .set-row:focus-visible, .set-back:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.hist-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.hist-total strong { color: var(--text); }

/* ===== Bet cards that open and close ===== */
.bet-head {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
}
.bet-head .bet-top { margin-bottom: 0; }
.bet-type strong { color: var(--text); }
.bet-sum {
  display: grid;
  grid-template-columns: 1fr 1fr 20px;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.bet-sum > span { display: grid; gap: 1px; }
.bet-sum > span > span { color: var(--muted); font-size: 0.78rem; }
.bet-sum strong { font-size: 1rem; }
.bet-chev { width: 18px; height: 18px; color: var(--muted); transform: rotate(180deg); transition: transform 0.2s ease; }
.bet-card.expanded .bet-chev { transform: rotate(0deg); }
.bet-when { color: var(--muted); font-size: 0.8rem; }
.bet-more { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--line); }
.bet-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.bet-facts dt { color: var(--muted); }
.bet-facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* ===== Me page menu groups ===== */
.me-menu .me-group {
  padding: 16px 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ===== Transactions page ===== */
#view-transactions { background: var(--bg); min-height: 60vh; }
.tx-balance {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 16px;
  background: var(--ink-deep);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.tx-balance span, .tx-balance small { color: rgba(255, 255, 255, 0.8); }
.tx-balance strong { font-size: 1.6rem; color: var(--gold); }
.tx-sum {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.tx-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-block: 1px solid var(--line); }
.tx-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.tx-row:last-child { border-bottom: none; }
.tx-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); color: var(--ink); }
.tx-icon .icon { width: 20px; height: 20px; }
.tx-icon.deposit, .tx-icon.win { color: var(--win); }
.tx-icon.withdraw, .tx-icon.bet { color: var(--red); }
.tx-icon.bonus { color: var(--purple); }
.tx-main, .tx-amt { display: grid; gap: 1px; min-width: 0; }
.tx-main small { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.tx-amt { justify-items: end; font-variant-numeric: tabular-nums; }
.tx-amt small { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

/* ===== Account Settings pages ===== */
.set-list { display: grid; margin: 12px 0 4px; border-top: 1px solid var(--line); }
.set-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
}
.set-row > span { display: grid; gap: 1px; }
.set-row small { color: var(--muted); }
.set-row .icon { width: 22px; height: 22px; color: var(--ink); }
.set-row .chev { width: 16px; height: 16px; color: var(--muted); }
.set-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--green);
  font-weight: 600;
}
.set-back .icon { width: 16px; height: 16px; }
.cp-form .auth-pass { margin-bottom: 12px; }
.cp-form .pw-rules { margin: -4px 0 12px; }
.profile-facts { margin-bottom: 8px; }

/* Responsible gambling */
.rg-limits { display: grid; gap: 4px; }
.rg-limit { display: grid; grid-template-columns: minmax(0, 1fr) 130px; align-items: center; gap: 12px; }
.rg-limit > span { display: grid; gap: 1px; }
.rg-limit small { color: var(--muted); font-size: 0.8rem; }
.rg-limit .field { margin-bottom: 0; }
.rg-limit .rg-pending { color: #8a6400; }
.rg-small { font-size: 0.82rem; }
.rg-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rg-agree { margin-bottom: 12px; font-size: 0.9rem; }
.rg-break-on {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #fffaeb;
}
.dep-limit-note { margin: 4px 0 0; color: #8a6400; font-size: 0.85rem; }

/* ===== Dark mode ===== */
.theme-dark .hist-chip { background: #183549; }
.theme-dark .hist-chip.on { background: var(--green); }
.theme-dark .rg-break-on { background: #2b2410; }
.theme-dark .rg-limit .rg-pending, .theme-dark .dep-limit-note { color: var(--gold); }
.theme-dark .tx-icon { background: #183549; color: var(--aqua); }
.theme-dark .tx-icon.deposit, .theme-dark .tx-icon.win { color: #4ade80; }
.theme-dark .tx-icon.withdraw, .theme-dark .tx-icon.bet { color: #f87171; }
.theme-dark .tx-icon.bonus { color: #b794f6; }
.theme-dark .set-row .icon { color: var(--aqua); }

@media (prefers-reduced-motion: reduce) {
  .bet-chev { transition: none; }
}

/* ===== Desktop: Log In and Register as a centred panel over the page ===== */
@media (min-width: 1024px) {
  #view-login:not([hidden]), #view-register:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 45;   /* above the header (40), under the backdrop and sheets (50, 70) */
    min-height: 0;
    padding: 24px;
    display: grid;
    align-content: center;
    justify-items: center;
    overflow-y: auto;
    background: rgba(3, 22, 36, 0.72);
  }
  #view-login > *, #view-register > * { width: min(440px, 100%); }
  #view-login .login-sheet, #view-register .login-sheet {
    min-height: 0;
    padding: 56px 32px 28px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }
  /* Forgot Password steps: blue bar on top, form under it */
  #view-login > .dep-top { border-radius: 14px 14px 0 0; }
  #view-login > .auth-body { border-radius: 0 0 14px 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }

  /* Transactions page gets rounded corners in the centre column */
  #view-transactions { border-radius: 8px; overflow: hidden; }
}

/* ===== Phones and tablets: filter chips tall enough to tap ===== */
@media (max-width: 1023px) {
  .hist-chip { min-height: 38px; }
}
