/* Blue Wave Baseball — accounts, leaderboard and toasts.
   Uses the palette already declared in styles.css. */

.account-layer {
  --acc-navy: #052a42;
  --acc-deep: #064a73;
  --acc-gold: #f3c744;
  --acc-paper: #fffaf0;
  --acc-ink: #10232d;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---- top bar ---------------------------------------------------- */

.account-bar {
  position: fixed;
  inset: max(0.9rem, env(safe-area-inset-top)) 0.9rem auto auto;
  z-index: 60;
  display: flex;
  gap: 0.5rem;
}

.account-chip {
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.62);
  backdrop-filter: blur(9px);
  color: var(--acc-paper);
  font: 600 0.82rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.account-chip:hover:not(:disabled) {
  background: rgba(6, 74, 115, 0.85);
  border-color: var(--acc-gold);
  transform: translateY(-1px);
}

.account-chip:disabled { opacity: 0.55; cursor: default; }

.account-chip.signed-in {
  border-color: var(--acc-gold);
  color: var(--acc-gold);
}

.account-chip.ghost { background: rgba(5, 42, 66, 0.4); }

/* ---- leaderboard panel ------------------------------------------ */

.board-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  width: min(23rem, 100vw);
  display: flex;
  flex-direction: column;
  padding: 1.3rem;
  background: linear-gradient(180deg, #073a5b, var(--acc-navy));
  color: var(--acc-paper);
  box-shadow: -22px 0 60px rgba(0, 20, 38, 0.5);
  animation: board-in 0.24s ease;
}

@keyframes board-in { from { transform: translateX(100%); } to { transform: none; } }

.board-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.board-panel h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.7rem;
  color: var(--acc-gold);
}

.board-close {
  width: 2rem; height: 2rem;
  border: 0; border-radius: 50%;
  background: rgba(255, 250, 240, 0.14);
  color: var(--acc-paper);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}

.board-close:hover { background: rgba(255, 250, 240, 0.26); }

.board-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.board-list li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border-radius: 0.7rem;
  background: rgba(255, 250, 240, 0.06);
}

.board-list li.is-me {
  background: rgba(243, 199, 68, 0.17);
  outline: 1px solid rgba(243, 199, 68, 0.5);
}

.board-list b {
  font-size: 0.9rem;
  color: rgba(255, 250, 240, 0.5);
  text-align: center;
}

.board-list li:nth-child(1) b { color: var(--acc-gold); }
.board-list li:nth-child(2) b { color: #d8dde0; }
.board-list li:nth-child(3) b { color: #d09a62; }

.board-list span {
  display: grid;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
}

.board-list span,
.board-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board-list small {
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(255, 250, 240, 0.55);
}

.board-list strong {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--acc-gold);
}

.board-empty {
  display: block !important;
  padding: 1.4rem 0.7rem !important;
  text-align: center;
  color: rgba(255, 250, 240, 0.6);
  font-size: 0.88rem;
  background: none !important;
}

.board-me {
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 250, 240, 0.18);
  font-size: 0.86rem;
  color: var(--acc-gold);
  text-align: center;
}

/* ---- modal ------------------------------------------------------- */

.acc-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  background: rgba(3, 20, 34, 0.72);
  backdrop-filter: blur(5px);
}

.acc-modal-card {
  position: relative;
  width: min(25rem, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 2rem 1.7rem 1.7rem;
  border-radius: 1.2rem;
  background: var(--acc-paper);
  color: var(--acc-ink);
  box-shadow: 0 30px 80px rgba(0, 20, 38, 0.45);
}

.acc-modal-close {
  position: absolute;
  top: 0.7rem; right: 0.8rem;
  width: 2rem; height: 2rem;
  border: 0; border-radius: 50%;
  background: transparent;
  color: #60737c;
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
}

.acc-modal-close:hover { background: rgba(16, 35, 45, 0.08); }

.acc-modal-card h2 {
  margin: 0 0 0.3rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.8rem;
  color: var(--acc-deep);
}

.acc-modal-sub {
  margin: 0 0 1.2rem;
  font-size: 0.88rem;
  color: #60737c;
}

.acc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.25rem;
  margin-bottom: 1.1rem;
  border-radius: 999px;
  background: rgba(16, 35, 45, 0.07);
}

.acc-tab {
  padding: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #60737c;
  font: 600 0.85rem Inter, system-ui, sans-serif;
  cursor: pointer;
}

.acc-tab.active {
  background: var(--acc-deep);
  color: var(--acc-paper);
}

.acc-form { display: grid; gap: 0.85rem; }

.acc-form label {
  display: grid;
  gap: 0.3rem;
  font: 600 0.8rem Inter, system-ui, sans-serif;
  color: var(--acc-ink);
}

.acc-form input {
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(16, 35, 45, 0.2);
  border-radius: 0.6rem;
  background: #fff;
  font: 400 1rem Inter, system-ui, sans-serif;
  color: var(--acc-ink);
}

.acc-form input:focus {
  outline: 2px solid var(--acc-deep);
  outline-offset: 1px;
  border-color: transparent;
}

.acc-submit {
  margin-top: 0.3rem;
  padding: 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--acc-deep);
  color: var(--acc-paper);
  font: 700 0.95rem Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.18s ease;
}

.acc-submit:hover:not(:disabled) { background: #0377b8; }
.acc-submit:disabled { opacity: 0.6; cursor: default; }

.acc-error {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(232, 95, 75, 0.14);
  color: #a5301d;
  font-size: 0.84rem;
}

/* ---- recovery code ----------------------------------------------- */

.acc-recovery h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--acc-deep);
}

.acc-recovery p {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: #60737c;
}

.acc-recovery code {
  display: block;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border: 1px dashed rgba(6, 74, 115, 0.45);
  border-radius: 0.6rem;
  background: rgba(6, 74, 115, 0.06);
  font: 700 1.05rem/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--acc-deep);
  word-break: break-all;
}

.acc-recovery .acc-submit { width: 100%; }

/* ---- toast -------------------------------------------------------- */

.acc-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(27rem, calc(100vw - 2rem));
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.94);
  color: var(--acc-paper);
  font: 600 0.87rem Inter, system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 20, 38, 0.4);
  animation: toast-in 0.24s ease;
}

.acc-toast.good { background: rgba(41, 139, 104, 0.96); }
.acc-toast.warn { background: rgba(232, 95, 75, 0.96); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 520px) {
  .account-bar { inset: max(0.6rem, env(safe-area-inset-top)) 0.6rem auto auto; }
  .account-chip { padding: 0.42rem 0.75rem; font-size: 0.76rem; }
  .board-panel { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  .board-panel, .acc-toast { animation: none; }
  .account-chip:hover:not(:disabled) { transform: none; }
}

/* ---- wallet chip in the top bar ---------------------------------- */

.account-chip.stats {
  cursor: default;
  border-color: rgba(243, 199, 68, 0.55);
  color: var(--acc-gold);
  font-variant-numeric: tabular-nums;
}

/* ---- cash + level strip above the career cards ------------------- */

.career-wallet {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  margin: 0 0 0.9rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(243, 199, 68, 0.28);
  border-radius: 0.8rem;
  background: rgba(5, 42, 66, 0.45);
  color: #fffaf0;
}

.wallet-guest {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 250, 240, 0.75);
}

.wallet-cash {
  display: grid;
  line-height: 1.15;
  padding-right: clamp(0.8rem, 2vw, 1.6rem);
  border-right: 1px solid rgba(255, 250, 240, 0.18);
}

.wallet-cash small,
.wallet-level small {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 250, 240, 0.6);
}

.wallet-cash strong {
  font-size: 1.35rem;
  color: var(--acc-gold);
  font-variant-numeric: tabular-nums;
}

.wallet-level { flex: 1; display: grid; gap: 0.35rem; min-width: 0; }

.wallet-level-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.wallet-level-top em {
  font-style: normal;
  font-size: 0.75rem;
  color: rgba(255, 250, 240, 0.6);
  font-variant-numeric: tabular-nums;
}

.wallet-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 250, 240, 0.16);
  overflow: hidden;
}

.wallet-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #f3c744, #ffe9a3);
  transition: width 0.5s ease;
}

/* ---- locked outfit cards ----------------------------------------- */

.style-option.skin-locked { position: relative; }

.style-option.skin-locked .style-card-art { filter: grayscale(0.72) brightness(0.52); }

.style-option.skin-locked .style-selected-label { display: none; }

.skin-lock {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem 0.85rem;
  background: linear-gradient(180deg, rgba(4, 26, 44, 0), rgba(4, 26, 44, 0.93) 42%);
  color: #fffaf0;
  text-align: center;
  pointer-events: none;
}

.skin-lock b {
  font-size: 1rem;
  color: var(--acc-gold);
  font-variant-numeric: tabular-nums;
}

.skin-lock small {
  font-size: 0.74rem;
  color: rgba(255, 250, 240, 0.72);
}

.skin-lock em {
  margin-top: 0.15rem;
  padding: 0.28rem 1rem;
  border-radius: 999px;
  background: var(--acc-gold);
  color: #10232d;
  font: 700 0.78rem/1 Inter, system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.02em;
}

.style-option.skin-locked:hover .style-card-art { filter: grayscale(0.45) brightness(0.68); }
.style-option.skin-locked:hover .skin-lock em { background: #ffe9a3; }

@media (max-width: 640px) {
  .career-wallet { flex-wrap: wrap; gap: 0.7rem; }
  .wallet-cash { border-right: 0; padding-right: 0; }
  .wallet-level { flex-basis: 100%; }
}
