/* ==========================================================================
   TRIUMPH SOREVIA - components.css
   Cards, buttons, pills, bars, rows, tabs, modals, toasts, badges.
   ========================================================================== */

/* --------------------------------------------------------------- card --- */
.card {
  position: relative;
  border-radius: var(--r-l);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  padding: 15px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
}
.card--flat { background: var(--surface); border-radius: var(--r-m); }
.card--tap { cursor: pointer; transition: transform .13s ease, border-color .16s ease; }
.card--tap:active { transform: scale(.978); border-color: var(--line-3); }
.card--inset { background: rgba(5, 11, 26, .55); border-color: var(--line); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--s { gap: 7px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ------------------------------------------------------------- button --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 17px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, var(--blue-l), var(--blue));
  box-shadow: 0 4px 0 var(--blue-dd), var(--shadow-1);
  transition: transform .1s ease, box-shadow .1s ease, filter .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-dd); }
.btn .ic { width: 19px; height: 19px; }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 60px; font-size: 17px; border-radius: 20px; }
.btn--sm { min-height: 40px; font-size: 13px; padding: 0 14px; border-radius: 13px; }

.btn--gold   { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: #3A2600; box-shadow: 0 4px 0 var(--gold-d), var(--shadow-1); }
.btn--gold:active { box-shadow: 0 1px 0 var(--gold-d); }
.btn--green  { background: linear-gradient(180deg, #6BE3A8, var(--green)); color: #04301B; box-shadow: 0 4px 0 #12764A, var(--shadow-1); }
.btn--green:active { box-shadow: 0 1px 0 #12764A; }
.btn--danger { background: linear-gradient(180deg, #FF8A98, var(--red)); box-shadow: 0 4px 0 #9C1B2C, var(--shadow-1); }
.btn--danger:active { box-shadow: 0 1px 0 #9C1B2C; }
.btn--ghost  { background: transparent; border: 1px solid var(--line-2); color: var(--txt-2); box-shadow: none; }
.btn--ghost:active { transform: scale(.97); background: rgba(47, 123, 255, .1); }
.btn--soft   { background: var(--surface-3); box-shadow: 0 3px 0 #16305E, var(--shadow-1); }
.btn--soft:active { box-shadow: 0 1px 0 #16305E; }

.btn[disabled], .btn.is-off {
  opacity: .42;
  pointer-events: none;
  filter: grayscale(.5);
}

/* --------------------------------------------------------------- pill --- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 100px;
  background: rgba(5, 11, 26, .62);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--txt-2);
  white-space: nowrap;
}
.pill .ic { width: 15px; height: 15px; }
.pill--coin .ic { color: var(--gold); }
.pill--gem  .ic { color: var(--cyan); }
.pill--coin b, .pill--gem b { color: #fff; }
.pill--blue  { background: rgba(47, 123, 255, .18); border-color: var(--line-2); color: var(--blue-ll); }
.pill--gold  { background: rgba(255, 201, 77, .16); border-color: rgba(255, 201, 77, .4); color: var(--gold-l); }
.pill--green { background: rgba(53, 208, 127, .16); border-color: rgba(53, 208, 127, .4); color: #8CEFC0; }
.pill--red   { background: rgba(255, 91, 110, .16); border-color: rgba(255, 91, 110, .4); color: #FFA8B3; }
.pill--tap { cursor: pointer; }
.pill--tap:active { transform: scale(.94); }

.wallet { display: flex; gap: 7px; }

/* --------------------------------------------------------------- bars --- */
.bar {
  position: relative;
  height: 9px;
  border-radius: 100px;
  background: rgba(5, 11, 26, .7);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .05);
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .5s cubic-bezier(.22, .9, .3, 1);
}
.bar--gold i  { background: linear-gradient(90deg, var(--gold-d), var(--gold-l)); }
.bar--green i { background: linear-gradient(90deg, #12764A, var(--green)); }
.bar--red i   { background: linear-gradient(90deg, #9C1B2C, var(--red)); }
.bar--thin { height: 6px; }
.bar--tall { height: 13px; }

/* --------------------------------------------------------------- rows --- */
.lrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-m);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.lrow--tap { cursor: pointer; transition: transform .13s ease, border-color .16s ease; }
.lrow--tap:active { transform: scale(.982); border-color: var(--line-3); }
.lrow__ic {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: rgba(47, 123, 255, .16);
  color: var(--blue-l);
}
.lrow__ic .ic { width: 22px; height: 22px; }
.lrow__t { font-size: 14.5px; font-weight: 800; }
.lrow__s { font-size: 12px; color: var(--txt-3); margin-top: 1px; }
.lrow__go { color: var(--txt-4); flex: none; }
.lrow.is-locked { opacity: .55; }

/* -------------------------------------------------------------- stars --- */
.stars { display: inline-flex; gap: 3px; align-items: center; }
.stars .star { color: rgba(255, 255, 255, .16); line-height: 0; }
.stars .star .ic { width: 15px; height: 15px; }
.stars .star.on { color: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 201, 77, .55)); }
.stars--lg .star .ic { width: 30px; height: 30px; }
.stars--xl .star .ic { width: 42px; height: 42px; }

/* ------------------------------------------------------------- badges --- */
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid var(--bg-navy);
}
.badge--gold { background: var(--gold); color: #3A2600; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--bg-navy);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .09);
  color: var(--txt-3);
}
.tag--common    { background: rgba(124, 149, 194, .18); color: #A9BEE0; }
.tag--rare      { background: rgba(47, 155, 255, .2);  color: #8FCBFF; }
.tag--epic      { background: rgba(168, 112, 255, .2); color: #D0B4FF; }
.tag--legendary { background: rgba(255, 201, 77, .2);  color: var(--gold-l); }
.tag--live      { background: rgba(53, 208, 127, .2);  color: #8CEFC0; }

/* --------------------------------------------------------------- tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 100px;
  background: rgba(5, 11, 26, .62);
  border: 1px solid var(--line);
  margin: 4px 0 14px;
}
.tab {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--txt-3);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.tab.is-on {
  background: linear-gradient(180deg, var(--blue-l), var(--blue-d));
  color: #fff;
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------------- avatar --- */
.av { width: 44px; height: 44px; border-radius: 14px; display: block; }
.av--sm { width: 34px; height: 34px; border-radius: 11px; }
.av--lg { width: 76px; height: 76px; border-radius: 22px; }
.avwrap {
  position: relative;
  flex: none;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--blue-l), var(--blue-d));
}
.avwrap--gold { background: linear-gradient(140deg, var(--gold-l), var(--gold-d)); }
.avwrap--lg { border-radius: 26px; padding: 4px; }

/* -------------------------------------------------------------- empty --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 44px 22px;
  color: var(--txt-3);
}
.empty .ic { width: 42px; height: 42px; color: var(--txt-4); }
.empty h3 { font-size: 16px; color: var(--txt-2); }
.empty p { font-size: 13px; max-width: 260px; }

.locknote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: var(--r-s);
  background: rgba(255, 91, 110, .1);
  border: 1px solid rgba(255, 91, 110, .3);
  color: #FFB3BC;
  font-size: 12.5px;
  font-weight: 700;
}
.locknote .ic { width: 16px; height: 16px; }

/* -------------------------------------------------------------- toast --- */
.toast {
  pointer-events: none;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 100px;
  background: rgba(12, 27, 61, .96);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--txt);
  opacity: 0;
  transform: translateY(14px) scale(.94);
  transition: opacity .26s ease, transform .26s cubic-bezier(.22, .9, .3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.toast.show { opacity: 1; transform: none; }
.toast--good { border-color: rgba(53, 208, 127, .5); }
.toast--bad  { border-color: rgba(255, 91, 110, .5); }
.toast__ic { line-height: 0; color: var(--gold); }
.toast__ic .ic { width: 17px; height: 17px; }

/* -------------------------------------------------------------- modal --- */
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 20, .74);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 34px);
  max-width: 400px;
  max-height: calc(100% - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-navy));
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-3);
  padding: 22px 20px;
  animation: popIn .3s cubic-bezier(.2, 1.25, .4, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.88); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal__panel--sm { max-width: 330px; }
.modal__panel--full {
  width: 100%; max-width: 520px; height: 100%; max-height: 100%;
  border-radius: 0; border: 0;
  top: 0; left: 0; transform: none;
  padding: calc(var(--safe-t) + 18px) 20px calc(var(--safe-b) + 18px);
  animation: fadeIn .22s ease both;
  display: flex; flex-direction: column;
}

.dlg { text-align: center; }
.dlg__ic {
  width: 58px; height: 58px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: rgba(47, 123, 255, .17);
  color: var(--blue-l);
}
.dlg__ic .ic { width: 30px; height: 30px; }
.dlg h2 { font-size: 20px; margin-bottom: 6px; }
.dlg p { font-size: 13.5px; color: var(--txt-3); margin-bottom: 18px; }
.dlg__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg__row .btn { width: 100%; }

.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.sheet__head h2 { font-size: 19px; }

/* ----------------------------------------------------------- confetti --- */
.confetti {
  position: absolute;
  top: -18px;
  width: 8px; height: 13px;
  border-radius: 2px;
  animation: fall 1.5s linear forwards;
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(760deg); opacity: 0; }
}

/* ------------------------------------------------------------ toggles --- */
.tgl {
  position: relative;
  width: 50px; height: 29px;
  flex: none;
  border-radius: 100px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .2s ease;
}
.tgl::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.tgl.is-on { background: linear-gradient(90deg, var(--blue), var(--cyan)); border-color: transparent; }
.tgl.is-on::after { transform: translateX(21px); }

.slider {
  position: relative;
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
}
.slider input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 8px;
  border-radius: 100px;
  background: rgba(5, 11, 26, .7);
  outline: none;
  margin: 0;
}
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.slider input::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  cursor: pointer;
}
.slider__fill {
  position: absolute;
  left: 0; top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  pointer-events: none;
}

/* -------------------------------------------------------------- stats --- */
.stat {
  padding: 12px;
  border-radius: var(--r-m);
  background: rgba(5, 11, 26, .5);
  border: 1px solid var(--line);
  text-align: center;
}
.stat__v { font-size: 19px; font-weight: 900; }
.stat__k { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--txt-3); margin-top: 2px; }
.stat .ic { width: 18px; height: 18px; margin-bottom: 3px; }
