/* ============================================================
   LUCK RAVENTO - components.css
   Everything reused across screens: the scoreboard top bar,
   wallet chips, cards, buttons, meters, list rows, modals,
   toasts and the empty state.
   ============================================================ */

/* ------------------------------------------------------------------ *
 * Top bar - styled as a stadium scoreboard header                      *
 * ------------------------------------------------------------------ */
.topbar {
  flex: 0 0 auto;
  min-height: var(--top-h);
  padding: calc(8px + var(--safe-top)) 12px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-850) 100%);
  border-bottom: 2px solid rgba(255, 122, 26, .35);
  box-shadow: 0 4px 18px rgba(8, 12, 36, .4);
  position: relative;
}
.topbar::after {
  /* goal-net hint under the scoreboard */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 8px;
  background-image:
    repeating-linear-gradient(90deg, rgba(247, 240, 224, .10) 0 1px, transparent 1px 11px);
  pointer-events: none;
}

.topbar__btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--cream-100);
  background: rgba(247, 240, 224, .09);
  transition: background .15s, transform .12s;
}
.topbar__btn:active { transform: scale(.92); background: rgba(247, 240, 224, .18); }

.topbar__mid { flex: 1 1 auto; min-width: 0; }
.topbar__title {
  font-size: 17px; font-weight: 800; color: var(--cream-50);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.2px;
}
.topbar__sub {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--orange-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ *
 * Wallet chips                                                         *
 * ------------------------------------------------------------------ */
.wallet { display: flex; gap: 6px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px 5px 7px;
  border-radius: var(--r-pill);
  background: rgba(8, 12, 36, .45);
  border: 1px solid rgba(247, 240, 224, .14);
  font-family: var(--font-num);
  font-size: 13px; font-weight: 700;
  color: var(--cream-100);
  white-space: nowrap;
}
.chip--coin { color: var(--orange-300); border-color: rgba(255, 154, 68, .3); }
.chip--boot { color: #FFD98A; border-color: rgba(255, 217, 138, .3); }
.chip--star { color: #FFE08A; }
.chip--fire { color: var(--orange-400); }
.chip--plain { background: rgba(247, 240, 224, .1); }
.chip--sm { padding: 3px 8px 3px 6px; font-size: 11.5px; }

/* ------------------------------------------------------------------ *
 * Cards                                                                *
 * ------------------------------------------------------------------ */
.card {
  background: linear-gradient(180deg, var(--cream-50) 0%, var(--cream-100) 100%);
  border-radius: var(--r-md);
  padding: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, .6);
  position: relative;
  overflow: hidden;
}
.card--navy {
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 100%);
  color: var(--on-navy);
  border-color: rgba(247, 240, 224, .1);
}
.card--navy .card__title { color: var(--cream-50); }
.card--navy .card__sub { color: var(--on-navy-soft); }

.card--tap { transition: transform .12s ease, box-shadow .12s ease; cursor: pointer; }
.card--tap:active { transform: scale(.978); box-shadow: var(--shadow-sm); }

.card--locked { opacity: .55; filter: saturate(.4); }
.card--flat { box-shadow: none; }

.card__title { font-size: 15.5px; font-weight: 800; color: var(--navy-800); letter-spacing: -.2px; }
.card__sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* A thin orange pitch-line down the left edge of feature cards. */
.card--accent::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--orange-400), var(--orange-600));
}
.card--accent { padding-left: 18px; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ------------------------------------------------------------------ *
 * Buttons                                                              *
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 800; letter-spacing: .2px;
  background: rgba(247, 240, 224, .12);
  color: var(--cream-50);
  border: 1px solid rgba(247, 240, 224, .18);
  transition: transform .1s ease, filter .15s ease, opacity .15s;
}
.btn:active { transform: scale(.96); }
.btn[disabled], .btn.is-disabled { opacity: .42; pointer-events: none; }

.btn--primary {
  background: linear-gradient(180deg, var(--orange-400) 0%, var(--orange-600) 100%);
  border-color: var(--orange-700);
  color: #26150A;
  box-shadow: 0 5px 0 var(--orange-700), var(--shadow-md);
}
.btn--primary:active { box-shadow: 0 2px 0 var(--orange-700); transform: translateY(3px) scale(.99); }

.btn--indigo {
  background: linear-gradient(180deg, var(--indigo-400) 0%, var(--indigo-500) 100%);
  border-color: var(--navy-700);
  color: var(--cream-50);
  box-shadow: 0 5px 0 var(--navy-700), var(--shadow-md);
}
.btn--indigo:active { box-shadow: 0 2px 0 var(--navy-700); transform: translateY(3px) scale(.99); }

.btn--cream {
  background: linear-gradient(180deg, var(--cream-50) 0%, var(--cream-200) 100%);
  border-color: var(--cream-400);
  color: var(--navy-800);
  box-shadow: 0 4px 0 var(--cream-400), var(--shadow-sm);
}
.btn--cream:active { box-shadow: 0 1px 0 var(--cream-400); transform: translateY(3px) scale(.99); }

.btn--ghost { background: rgba(247, 240, 224, .08); }
.btn--danger { background: rgba(229, 72, 77, .16); border-color: rgba(229, 72, 77, .45); color: #FFB4B6; }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 36px; padding: 0 13px; font-size: 13px; }
.btn--lg { min-height: 54px; font-size: 17px; }

.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1 1 0; }

/* ------------------------------------------------------------------ *
 * Meters                                                              *
 * ------------------------------------------------------------------ */
.bar {
  height: 9px;
  border-radius: var(--r-pill);
  background: rgba(8, 12, 36, .34);
  overflow: hidden;
  border: 1px solid rgba(247, 240, 224, .1);
}
.card .bar { background: rgba(30, 41, 101, .16); border-color: rgba(30, 41, 101, .1); }

.bar__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--orange-400), var(--orange-600));
  transition: width .5s cubic-bezier(.2, .8, .3, 1);
}
.bar__fill--indigo { background: linear-gradient(90deg, var(--indigo-300), var(--indigo-500)); }
.bar__fill--good { background: linear-gradient(90deg, #56D89A, var(--good-dark)); }
.bar--tall { height: 13px; }

.meter-row { display: flex; align-items: center; gap: 9px; }
.meter-row .bar { flex: 1 1 auto; }
.meter-val { font-family: var(--font-num); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.card--navy .meter-val, .screen__scroll > .meter-row .meter-val { color: var(--on-navy-soft); }

/* ------------------------------------------------------------------ *
 * List rows                                                            *
 * ------------------------------------------------------------------ */
.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  background: rgba(247, 240, 224, .07);
  border: 1px solid rgba(247, 240, 224, .1);
  color: var(--on-navy);
  transition: background .14s, transform .1s;
  text-align: left;
  width: 100%;
}
.row-item--tap { cursor: pointer; }
.row-item--tap:active { transform: scale(.985); background: rgba(247, 240, 224, .13); }
.row-item--done { border-color: rgba(47, 191, 113, .4); background: rgba(47, 191, 113, .1); }
.row-item--ready { border-color: rgba(255, 154, 68, .5); background: rgba(255, 154, 68, .12); }
.row-item--locked { opacity: .5; }

.row-item__body { flex: 1 1 auto; min-width: 0; }
.row-item__title { font-size: 14.5px; font-weight: 800; color: var(--cream-50); }
.row-item__sub { font-size: 12px; color: var(--on-navy-soft); margin-top: 1px; }

/* Circular badge that fronts most rows. */
.orb {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--indigo-400), var(--indigo-500));
  color: var(--cream-50);
  box-shadow: var(--shadow-sm), var(--shadow-in);
}
.orb--orange { background: linear-gradient(180deg, var(--orange-400), var(--orange-600)); color: #26150A; }
.orb--cream  { background: linear-gradient(180deg, var(--cream-100), var(--cream-300)); color: var(--navy-800); }
.orb--good   { background: linear-gradient(180deg, #56D89A, var(--good-dark)); color: #06351D; }
.orb--dim    { background: rgba(247, 240, 224, .12); color: var(--on-navy-soft); box-shadow: none; }
.orb--lg { width: 56px; height: 56px; }
.orb--xl { width: 76px; height: 76px; }

/* Rarity tints for collection cards + achievement tiers. */
.tier-bronze { background: linear-gradient(180deg, #D69A5C, #A66A32); color: #33200C; }
.tier-silver { background: linear-gradient(180deg, #DDE3EE, #9AA6BE); color: #1E2436; }
.tier-gold   { background: linear-gradient(180deg, #FFDD8A, #E0A32C); color: #3A2703; }

.rarity-common { --rar: #9AA6BE; }
.rarity-rare   { --rar: #55B6F0; }
.rarity-epic   { --rar: #B47CF0; }
.rarity-legend { --rar: #FFC24D; }

/* ------------------------------------------------------------------ *
 * Stars                                                                *
 * ------------------------------------------------------------------ */
.stars { display: inline-flex; gap: 2px; color: rgba(247, 240, 224, .22); }
.stars .on { color: #FFD24D; filter: drop-shadow(0 1px 2px rgba(255, 178, 26, .5)); }
.card .stars { color: rgba(30, 41, 101, .18); }

/* ------------------------------------------------------------------ *
 * Stat tiles                                                           *
 * ------------------------------------------------------------------ */
.stat {
  padding: 12px 10px;
  border-radius: var(--r-md);
  background: rgba(247, 240, 224, .07);
  border: 1px solid rgba(247, 240, 224, .1);
  text-align: center;
}
.stat__val { font-family: var(--font-num); font-size: 21px; font-weight: 800; color: var(--cream-50); line-height: 1.15; }
.stat__lab { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--on-navy-soft); margin-top: 3px; }
.stat--accent .stat__val { color: var(--orange-400); }

/* ------------------------------------------------------------------ *
 * Empty state                                                          *
 * ------------------------------------------------------------------ */
.empty {
  text-align: center;
  padding: 34px 20px;
  color: var(--on-navy-soft);
}
.empty__icon {
  width: 66px; height: 66px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(247, 240, 224, .08);
  color: var(--indigo-300);
}
.empty__title { font-size: 16px; font-weight: 800; color: var(--cream-100); }
.empty__text { font-size: 13px; margin-top: 5px; }

/* ------------------------------------------------------------------ *
 * Modal                                                                *
 * ------------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 12, 36, .68);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease-out both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheetUp { from { transform: translateY(28px); opacity: .4 } to { transform: none; opacity: 1 } }

.modal__box {
  width: 100%;
  max-width: 560px;
  max-height: 86%;
  overflow-y: auto;
  padding: 20px var(--pad) calc(20px + var(--safe-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-850) 100%);
  border-top: 3px solid var(--orange-500);
  box-shadow: var(--shadow-lg);
  animation: sheetUp .22s cubic-bezier(.2, .9, .3, 1) both;
}
.modal__grip {
  width: 42px; height: 4px; border-radius: 2px;
  background: rgba(247, 240, 224, .28);
  margin: -8px auto 14px;
}
.modal__title { font-size: 19px; font-weight: 800; color: var(--cream-50); text-align: center; }
.modal__text { font-size: 14px; color: var(--on-navy-soft); text-align: center; margin-top: 7px; }
.modal__actions { display: flex; gap: 10px; margin-top: 18px; }
.modal__actions > .btn { flex: 1 1 0; }

/* ------------------------------------------------------------------ *
 * Toast                                                                *
 * ------------------------------------------------------------------ */
#toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 520px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 15px;
  border-radius: var(--r-pill);
  background: rgba(8, 12, 36, .94);
  border: 1px solid rgba(255, 122, 26, .45);
  color: var(--cream-50);
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease-out both;
  max-width: 100%;
}
.toast--good { border-color: rgba(47, 191, 113, .6); }
.toast--bad { border-color: rgba(229, 72, 77, .6); }
.toast.is-out { animation: toastOut .25s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) } }

/* ------------------------------------------------------------------ *
 * Switch (settings)                                                    *
 * ------------------------------------------------------------------ */
.switch {
  width: 50px; height: 29px; flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: rgba(8, 12, 36, .5);
  border: 1px solid rgba(247, 240, 224, .16);
  position: relative;
  transition: background .2s, border-color .2s;
}
.switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--cream-200);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1), background .2s;
  box-shadow: var(--shadow-sm);
}
.switch.on { background: linear-gradient(90deg, var(--orange-500), var(--orange-600)); border-color: var(--orange-700); }
.switch.on::after { transform: translateX(21px); background: #fff; }

/* ------------------------------------------------------------------ *
 * Pills / tabs                                                         *
 * ------------------------------------------------------------------ */
.tabs {
  display: flex; gap: 6px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(8, 12, 36, .4);
  border: 1px solid rgba(247, 240, 224, .1);
}
.tab {
  flex: 1 1 0;
  min-height: 36px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 800;
  color: var(--on-navy-soft);
  transition: background .16s, color .16s;
}
.tab.on { background: linear-gradient(180deg, var(--orange-400), var(--orange-600)); color: #26150A; }

/* Small dot used for "you have something to claim". */
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 0 2px rgba(255, 122, 26, .3);
  flex: 0 0 auto;
}
.badge-count {
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--orange-500);
  color: #26150A;
  font-family: var(--font-num); font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}

/* Divider */
.hr { height: 1px; background: rgba(247, 240, 224, .12); margin: 14px 0; border: 0; }
.card .hr { background: rgba(30, 41, 101, .12); }

/* ------------------------------------------------------------------ *
 * Inline spans used as block text                                      *
 * Screens are built as HTML strings and a <button> cannot contain a    *
 * <div>, so titles and subtitles are spans. They still need to stack.  *
 * ------------------------------------------------------------------ */
.card__title, .card__sub,
.row-item__title, .row-item__sub,
.stat__val, .stat__lab,
.coll-card__name,
.boost__n, .boost__lab,
.quick__lab,
.chapter__name, .chapter__sub, .chapter__blurb, .chapter__no,
.mode-tile__name, .mode-tile__desc,
.cal-day__n, .cal-day__v,
.inv-tile__n, .inv-tile__lab,
.home-head__lvl, .home-head__meta,
.play-card__eyebrow, .play-card__title, .play-card__sub,
.hud__lab, .hud__val { display: block; }

.chapter__head, .chapter__foot, .mode-tile__body, .row-item__body,
.shop-item__body, .home-head__body { display: flex; }
.chapter__head { align-items: center; gap: 11px; }
.mode-tile__body, .row-item__body, .shop-item__body, .home-head__body {
  flex-direction: column;
  align-items: flex-start;
}
.chapter__no { position: absolute; }
