/* ==========================================================================
   TRIUMPH MARVION - components.css
   The shared vocabulary produced by ui.js: the screen shell, top bar, buttons,
   cards, rows, meters, stars, chips, modals, toasts and form controls.
   ========================================================================== */

/* ==========================================================================
   SCREEN SHELL
   ========================================================================== */
.screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(180deg, rgba(8, 26, 22, .92), rgba(8, 26, 22, .55));
  border-bottom: 1px solid var(--line-2);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.topbar__mid { min-width: 0; }
.topbar__title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.topbar__right { display: flex; align-items: center; gap: 6px; }

.iconbtn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-2);
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.iconbtn:active { transform: scale(.93); background: rgba(255, 255, 255, .1); }
.iconbtn--ghost { background: none; border: 0; }

.screen__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 14px var(--pad) 0;
}
.screen__pad { height: 26px; }

.screen__footer {
  flex: 0 0 auto;
  padding: 10px var(--pad);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(6, 22, 18, .0), rgba(6, 22, 18, .92) 34%);
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   WALLET PILLS
   ========================================================================== */
.wallet { display: flex; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  transition: transform .14s var(--ease);
}
.pill:active { transform: scale(.94); }
.pill--coin { color: var(--gold-b); border-color: rgba(232, 193, 90, .3); }
.pill--dust { color: var(--teal-b); border-color: rgba(53, 214, 208, .28); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform .14s var(--ease), filter .16s var(--ease), opacity .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--wide { width: 100%; }
.btn--sm { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 11px; }

.btn--primary {
  color: #04211A;
  background: linear-gradient(160deg, var(--emerald-b), var(--emerald) 62%, var(--teal-d));
  box-shadow: 0 6px 18px rgba(18, 135, 107, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn--gold {
  color: #2B1F02;
  background: linear-gradient(160deg, var(--gold-b), var(--gold) 60%, var(--gold-d));
  box-shadow: 0 6px 18px rgba(232, 193, 90, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--ghost {
  color: var(--text-2);
  background: rgba(255, 255, 255, .05);
  border-color: var(--line);
}
.btn--danger {
  color: #FFE9E5;
  background: rgba(226, 96, 79, .16);
  border-color: rgba(226, 96, 79, .38);
}
.btn.is-off, .btn[disabled] { opacity: .42; pointer-events: none; }

.btn__badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-size: 11px; font-style: normal; font-weight: 800;
  color: #2B1F02;
  background: var(--gold);
}

.btnrow { display: flex; gap: 8px; }
.btnrow > .btn { flex: 1 1 0; min-width: 0; }

.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal-b);
  padding: 4px 2px;
}
.linkbtn svg { opacity: .8; }

.minibtn {
  height: 30px;
  padding: 0 13px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 800;
  color: #2B1F02;
  background: linear-gradient(160deg, var(--gold-b), var(--gold));
  box-shadow: 0 3px 10px rgba(232, 193, 90, .26);
}
.minibtn:active { transform: scale(.94); }

/* ==========================================================================
   SECTIONS / CARDS / ROWS
   ========================================================================== */
.sec { margin: 18px 0 0; }
.sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.sec__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.card.is-locked { opacity: .55; }

.list { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-2);
  transition: background .16s var(--ease), transform .14s var(--ease);
}
button.row:active { transform: scale(.99); background: rgba(255, 255, 255, .07); }
.row.is-locked { opacity: .5; }
.row.is-dim { opacity: .62; }
.row.is-ready { border-color: rgba(232, 193, 90, .34); background: rgba(232, 193, 90, .07); }
.row.is-claimed { opacity: .6; }
.row.is-danger { border-color: rgba(226, 96, 79, .3); }

.row__lead { flex: 0 0 auto; }
.row__mid { flex: 1 1 auto; min-width: 0; }
.row__title { font-size: 14.5px; font-weight: 650; }
.row__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}
.row__trail { flex: 0 0 auto; color: var(--dim); display: flex; align-items: center; }
.row__stat { font-size: 13px; font-weight: 700; color: var(--text-2); }
.row__stat--big { font-size: 18px; color: var(--gold-b); }
.row__done { color: var(--good); }
.row__hot {
  min-width: 22px; height: 22px;
  padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 800;
  color: #2B1F02;
  background: var(--gold);
}

.rowico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: var(--emerald-b);
  background: rgba(30, 192, 143, .11);
  border: 1px solid rgba(30, 192, 143, .18);
}
.rowico--ach { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: var(--line-2); }
.rowico--ach.is-on { color: var(--gold-b); background: rgba(232, 193, 90, .12); border-color: rgba(232, 193, 90, .3); }
.rowico--danger { color: var(--bad); background: rgba(226, 96, 79, .11); border-color: rgba(226, 96, 79, .2); }

.minibar { margin-top: 7px; }

/* ==========================================================================
   METERS / STARS / CHIPS / STATS
   ========================================================================== */
.meter {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--emerald), var(--emerald-b));
  transition: width .32s var(--ease);
}
.meter--gold i { background: linear-gradient(90deg, var(--gold-d), var(--gold-b)); }
.meter--xp i    { background: linear-gradient(90deg, var(--teal), var(--teal-b)); }
.meter--dim i   { background: rgba(255, 255, 255, .2); }
.meter__label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
}

.stars { display: inline-flex; gap: 2px; }
.star { color: rgba(255, 255, 255, .16); line-height: 0; }
.star.is-on { color: var(--gold); filter: drop-shadow(0 1px 4px rgba(232, 193, 90, .4)); }

.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-2);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-2);
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.stat {
  padding: 11px 8px;
  border-radius: var(--r);
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-2);
}
.stat__ico { color: var(--teal-b); display: grid; place-items: center; margin-bottom: 5px; opacity: .85; }
.stat__val { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.stat__lab { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }

.ruleslist { display: flex; flex-direction: column; gap: 1px; border-radius: var(--r); overflow: hidden; }
.rrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .035);
  font-size: 13px;
}
.rrow svg { color: var(--teal-b); opacity: .8; flex: 0 0 auto; }
.rrow span { flex: 1 1 auto; color: var(--text-2); }
.rrow b { color: var(--text); font-weight: 700; text-align: right; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
  background: rgba(53, 214, 208, .07);
  border: 1px solid rgba(53, 214, 208, .18);
  margin-bottom: 4px;
}
.banner svg { color: var(--teal-b); flex: 0 0 auto; }
.banner.is-hot {
  background: rgba(232, 193, 90, .09);
  border-color: rgba(232, 193, 90, .28);
}
.banner.is-hot svg { color: var(--gold-b); }

.blurb { font-size: 13px; line-height: 1.55; color: var(--text-2); }
.note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 8px;
}
.note--good { color: var(--good); }
.tips { display: flex; flex-direction: column; gap: 7px; }
.tips li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.tips li::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 5px; height: 5px;
  border-radius: 99px;
  background: var(--emerald-b);
}

.empty {
  text-align: center;
  padding: 46px 20px;
}
.empty__ico {
  width: 66px; height: 66px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-2);
}
.empty__title { font-size: 16px; font-weight: 700; }
.empty__text { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ==========================================================================
   REWARDS
   ========================================================================== */
.rewards { display: flex; flex-wrap: wrap; gap: 8px; }
.rewards__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--gold-b);
  background: rgba(232, 193, 90, .09);
  border: 1px solid rgba(232, 193, 90, .24);
}

/* ==========================================================================
   BOOSTER TILES
   ========================================================================== */
.boostrow { display: flex; flex-wrap: wrap; gap: 7px; }
.boost {
  position: relative;
  flex: 1 1 66px;
  min-width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 7px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-2);
  transition: transform .14s var(--ease), background .16s;
}
.boost:active { transform: scale(.95); }
.boost.is-off { opacity: .38; }
.boost.is-active {
  background: rgba(232, 193, 90, .13);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 193, 90, .2);
}
.boost__ico { color: var(--teal-b); }
.boost.is-active .boost__ico { color: var(--gold-b); }
.boost__name {
  font-size: 9.5px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
  line-height: 1.1;
}
.boost__count {
  position: absolute;
  top: -5px; right: -3px;
  min-width: 19px; height: 19px;
  padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  color: #04211A;
  background: var(--emerald-b);
  border: 2px solid var(--surface);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.opts { display: flex; flex-direction: column; gap: 1px; border-radius: var(--r); overflow: hidden; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, .035);
}
.opt__mid { flex: 1 1 auto; min-width: 0; }
.opt__label {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.opt__label b { color: var(--teal-b); font-weight: 700; }
.opt__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.switch {
  flex: 0 0 auto;
  width: 46px; height: 27px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid var(--line);
  padding: 2px;
  transition: background .2s var(--ease);
}
.switch i {
  display: block;
  width: 21px; height: 21px;
  border-radius: 99px;
  background: #fff;
  transition: transform .2s var(--ease);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.switch.is-on { background: var(--emerald); border-color: var(--emerald-b); }
.switch.is-on i { transform: translateX(19px); }

.opt--slider { flex-direction: column; align-items: stretch; gap: 8px; }
.slider { position: relative; height: 22px; display: flex; align-items: center; }
.slider__track {
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.slider__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-b));
}
.slider input[type="range"] {
  position: relative;
  width: 100%;
  height: 22px;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.slider input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border: 0;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal__scrim {
  position: absolute; inset: 0;
  background: rgba(2, 10, 8, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal__box {
  position: relative;
  width: 100%;
  max-width: 360px;
  max-height: 86%;
  overflow-y: auto;
  padding: 22px 20px 20px;
  border-radius: var(--r-xl);
  text-align: center;
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: modalIn .26s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal__x {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
}
.modal__hero { margin-bottom: 12px; }
.modal__icon {
  width: 66px; height: 66px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 22px;
  color: var(--emerald-b);
  background: rgba(30, 192, 143, .12);
  border: 1px solid rgba(30, 192, 143, .24);
}
.modal__icon--gold {
  color: var(--gold-b);
  background: rgba(232, 193, 90, .12);
  border-color: rgba(232, 193, 90, .28);
}
.modal__title { font-size: 19px; font-weight: 800; }
.modal__text { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.55; }
.modal__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.modal--confirm .modal__actions { flex-direction: row; }
.modal--confirm .modal__actions .btn { flex: 1 1 0; }

.pausestats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 16px;
}
.pause__obj {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--gold-b);
  background: rgba(232, 193, 90, .08);
  border: 1px solid rgba(232, 193, 90, .2);
}
.pause__obj svg { flex: 0 0 auto; }

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(10, 36, 30, .96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  animation: toastIn .28s var(--ease) both;
}
.toast__ico { color: var(--teal-b); display: flex; }
.toast--good { border-color: rgba(47, 203, 138, .4); }
.toast--good .toast__ico { color: var(--good); }
.toast--warn { border-color: rgba(232, 169, 62, .4); }
.toast--warn .toast__ico { color: var(--warn); }
.toast.is-out { animation: toastOut .4s var(--ease) both; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px) scale(.97); }
}
