/* ============================================================
   VICTORY CORLENA - components.css
   Header, buttons, cards, pills, chips, lists, progress,
   modals, toasts, empty states.
   ============================================================ */

/* ---------- Top bar ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) var(--pad) 10px;
  min-height: var(--top-h);
}

.top__btn {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  color: var(--ink);
  transition: transform .12s ease, background .12s ease;
}
.top__btn:active { transform: scale(.92); background: var(--surface-3); }
.top__btn svg { width: 20px; height: 20px; }

.top__titles { flex: 1; min-width: 0; }
.top__title { font-size: 18px; font-weight: 800; line-height: 1.2; }
.top__sub { font-size: 12px; color: var(--ink-3); line-height: 1.3; }

/* ---------- Wallet ---------- */

.wallet { display: flex; gap: 6px; }
.wallet__pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 13px; font-weight: 800;
}
.wallet__pill svg { width: 15px; height: 15px; }
.wallet__pill--coin svg { color: var(--amber); }
.wallet__pill--gem  svg { color: var(--violet); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  box-shadow: 0 6px 16px rgba(20, 184, 166, .28);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px) scale(.99); box-shadow: 0 3px 10px rgba(20, 184, 166, .24); }
.btn svg { width: 18px; height: 18px; }

.btn--violet { background: linear-gradient(135deg, var(--violet), var(--violet-d)); box-shadow: 0 6px 16px rgba(124, 92, 255, .28); }
.btn--amber  { background: linear-gradient(135deg, #FFC759, var(--amber)); box-shadow: 0 6px 16px rgba(255, 176, 32, .3); color: #3A2A00; }
.btn--coral  { background: linear-gradient(135deg, #FF9C8C, var(--coral)); box-shadow: 0 6px 16px rgba(255, 122, 102, .3); color: #4A1207; }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
  border: 1px solid var(--line);
}
.btn--ghost:active { background: var(--surface-3); }
.btn--sm { min-height: 40px; font-size: 14px; border-radius: 13px; padding: 0 14px; width: auto; }
.btn--wide { width: 100%; }
.btn[disabled], .btn.is-off { opacity: .45; pointer-events: none; box-shadow: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px;
  border: 1px solid var(--line);
}
.card--flat { box-shadow: none; background: var(--surface-2); }
.card--tap { transition: transform .12s ease, box-shadow .12s ease; }
.card--tap:active { transform: scale(.985); box-shadow: var(--sh-2); }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px;
}
.section-title h2 { font-size: 16px; font-weight: 800; margin: 0; }
.section-title .link { font-size: 12px; font-weight: 800; color: var(--teal-d); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Pills / chips / tags ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip--teal   { background: var(--teal-l);   color: var(--teal-d); }
.chip--violet { background: var(--violet-l); color: var(--violet-d); }
.chip--amber  { background: var(--amber-l);  color: #A66A00; }
.chip--coral  { background: var(--coral-l);  color: #C0392B; }
.chip--mint   { background: var(--mint-l);   color: #148A52; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-new {
  padding: 2px 7px; border-radius: 99px;
  background: var(--coral); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
}

/* ---------- Stat cells ---------- */

.stats-row { display: flex; gap: 10px; }
.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 8px;
  text-align: center;
  min-width: 0;
}
.stat__v { font-size: 17px; font-weight: 800; line-height: 1.15; }
.stat__l { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }

/* ---------- Progress ---------- */

.bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar i {
  display: block; height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--violet));
  transition: width .4s cubic-bezier(.2, .9, .3, 1);
}
.bar--teal i   { background: linear-gradient(90deg, #4FE0CF, var(--teal)); }
.bar--violet i { background: linear-gradient(90deg, #A48BFF, var(--violet)); }
.bar--amber i  { background: linear-gradient(90deg, #FFD489, var(--amber)); }
.bar--mint i   { background: linear-gradient(90deg, #74E4AC, var(--mint)); }
.bar--coral i  { background: linear-gradient(90deg, #FFB0A2, var(--coral)); }
.bar--slim { height: 6px; }

/* ---------- Rows / list items ---------- */

.row-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
  transition: transform .12s ease;
}
.row-item:active { transform: scale(.99); }
.row-item__badge {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
  font-weight: 800;
}
.row-item__badge svg { width: 20px; height: 20px; }
.row-item__badge--teal   { background: var(--teal-l);   color: var(--teal-d); }
.row-item__badge--violet { background: var(--violet-l); color: var(--violet-d); }
.row-item__badge--amber  { background: var(--amber-l);  color: #A66A00; }
.row-item__badge--mint   { background: var(--mint-l);   color: #148A52; }
.row-item__badge--coral  { background: var(--coral-l);  color: #C0392B; }
.row-item__badge--off    { background: var(--surface-3); color: var(--ink-4); }
.row-item__main { flex: 1; min-width: 0; }
.row-item__t { font-weight: 700; font-size: 14.5px; }
.row-item__s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.row-item__end { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--ink-4); }
.row-item__end svg { width: 18px; height: 18px; }
.row-item.is-locked { opacity: .6; }

/* ---------- Stars ---------- */

.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; color: var(--line-2); }
.stars svg.on { color: var(--amber); }
.stars--lg svg { width: 30px; height: 30px; }
.stars--lg svg.on { filter: drop-shadow(0 4px 10px rgba(255, 176, 32, .45)); }

/* ---------- Avatar ---------- */

.avatar {
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
}
.avatar--g0 { background: linear-gradient(135deg, #4FE0CF, #0D8B80); }
.avatar--g1 { background: linear-gradient(135deg, #A48BFF, #5B3BE0); }
.avatar--g2 { background: linear-gradient(135deg, #FFD489, #E08A00); }
.avatar--g3 { background: linear-gradient(135deg, #FFA593, #E2503A); }
.avatar--g4 { background: linear-gradient(135deg, #74E4AC, #12A05F); }
.avatar--g5 { background: linear-gradient(135deg, #7DC8FF, #1667C4); }
.avatar--g6 { background: linear-gradient(135deg, #FF9BC0, #D62A6B); }
.avatar--g7 { background: linear-gradient(135deg, #C0A6FF, #7A3BD6); }

/* ---------- Modal / overlay screens ---------- */

.modal-back {
  position: absolute; inset: 0;
  background: rgba(16, 23, 54, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn .18s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 22px 18px 18px;
  animation: sheetIn .28s cubic-bezier(.2, .9, .3, 1.15) forwards;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

.sheet__mark {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 22px;
  display: grid; place-items: center;
  color: #fff;
}
.sheet__mark svg { width: 30px; height: 30px; }
.sheet__mark--win  { background: linear-gradient(135deg, #4FE0CF, var(--teal-d)); box-shadow: 0 10px 24px rgba(20, 184, 166, .34); }
.sheet__mark--perf { background: linear-gradient(135deg, #FFD489, var(--amber));  box-shadow: 0 10px 24px rgba(255, 176, 32, .36); color: #3A2A00; }
.sheet__mark--rec  { background: linear-gradient(135deg, #A48BFF, var(--violet-d)); box-shadow: 0 10px 24px rgba(124, 92, 255, .34); }
.sheet__mark--lose { background: linear-gradient(135deg, #FFA593, var(--coral));  box-shadow: 0 10px 24px rgba(255, 122, 102, .32); color: #4A1207; }
.sheet__mark--pause{ background: linear-gradient(135deg, #B9C2DA, #6C7796); }
.sheet__mark--info { background: linear-gradient(135deg, #7DC8FF, #1667C4); }

.sheet__title { text-align: center; font-size: 22px; font-weight: 800; }
.sheet__sub { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 2px; }

/* ---------- Toast ---------- */

.toast {
  pointer-events: none;
  max-width: 86%;
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(16, 23, 54, .93);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--sh-2);
  animation: toastIn .22s ease forwards;
}
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Empty state ---------- */

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
}
.empty svg { width: 40px; height: 40px; color: var(--ink-4); margin-bottom: 10px; }
.empty h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink-2); }
.empty p { margin: 0; font-size: 13px; }

/* ---------- Switch ---------- */

.switch {
  position: relative;
  width: 46px; height: 27px;
  border-radius: 99px;
  background: var(--line-2);
  transition: background .2s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16, 23, 54, .25);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.4);
}
.switch.on { background: linear-gradient(135deg, var(--teal), var(--teal-d)); }
.switch.on::after { transform: translateX(19px); }

/* ---------- Range ---------- */

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(20, 184, 166, .45);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid #fff;
  cursor: pointer;
}

/* ---------- Segmented ---------- */

.seg {
  display: flex;
  background: var(--surface-3);
  border-radius: 13px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  transition: background .16s ease, color .16s ease;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- Grid ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ---------- Horizontal scroller ---------- */

.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 auto; }
