/* ==========================================================================
   Alembic - visual system
   Deep sea-green glass, brass trim, warm reagent accents. Mobile first.
   ========================================================================== */

:root {
  --bg: #0d1b1e;
  --bg-deep: #081316;
  --panel: #122528;
  --panel-2: #173034;
  --panel-3: #1d3b3f;
  --line: rgba(122, 196, 174, 0.16);
  --line-strong: rgba(122, 196, 174, 0.32);
  --ink: #e6f5ef;
  --ink-dim: #8fb3aa;
  --ink-faint: #5d7d78;
  --gold: #e8c05a;
  --gold-deep: #a8811f;
  --mint: #5fd3a6;
  --danger: #ff7a6b;
  --violet: #b98cf0;

  --axis-essence: #f2b23e;
  --axis-zest: #7ede5a;
  --axis-density: #e06a5a;
  --axis-aura: #b98cf0;
  --axis-charge: #5ac8f0;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, "Noto Sans", sans-serif;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(120% 70% at 50% -10%, #1b3a3c 0%, transparent 60%),
    radial-gradient(90% 60% at 10% 110%, #14262a 0%, transparent 55%),
    var(--bg-deep);
}

#app { height: 100%; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: var(--mint); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.01em; }
p { margin: 0 0 8px; line-height: 1.5; }
em { color: var(--ink-dim); font-style: normal; }

/* -------------------------------------------------------------- shell */

.screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 14px;
  position: relative;
  animation: screenIn 0.28s ease-out;
}

@supports not (height: 100dvh) {
  .screen { height: 100vh; }
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 2px 10px;
  min-height: 54px;
  flex-wrap: wrap;
}

.stage {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
}

.dock {
  padding: 10px 2px calc(12px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(to top, var(--bg-deep) 55%, transparent);
}

.stage-title {
  font-size: 1.15rem;
  margin: 4px 0 14px;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.venue-tag {
  font-size: 0.86rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: block;
  width: 100%;
  padding: 15px 18px;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 650;
  text-align: center;
  transition: transform 0.12s ease, filter 0.18s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.975); }

.btn-primary {
  background: linear-gradient(180deg, #f0cf72, var(--gold-deep));
  color: #241a05;
  box-shadow: 0 6px 18px rgba(168, 129, 31, 0.3);
}

.btn-ghost {
  background: rgba(122, 196, 174, 0.09);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-link {
  background: none;
  color: var(--ink-dim);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px;
}

.btn-small {
  width: auto;
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: var(--r-sm);
  background: rgba(232, 192, 90, 0.14);
  color: var(--gold);
  border: 1px solid rgba(232, 192, 90, 0.3);
}

.btn:disabled, .btn.is-disabled {
  opacity: 0.4;
  filter: grayscale(0.7);
  pointer-events: none;
}

/* ---------------------------------------------------------------- chips */

.chips { display: flex; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(122, 196, 174, 0.08);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}

.chip-value { font-weight: 650; }

/* -------------------------------------------------------------- banners */

.banner {
  padding: 10px 13px;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  margin: 10px 0;
  border: 1px solid transparent;
}

.banner-warn { background: rgba(232, 192, 90, 0.1); border-color: rgba(232, 192, 90, 0.28); color: #f3dda2; }
.banner-ban { background: rgba(255, 122, 107, 0.1); border-color: rgba(255, 122, 107, 0.3); color: #ffb3a8; }
.banner-good { background: rgba(95, 211, 166, 0.1); border-color: rgba(95, 211, 166, 0.3); color: #a9ead1; }

.note { color: var(--ink-dim); font-size: 0.84rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 15px;
  margin-bottom: 12px;
}

.panel h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------- title */

.title-screen .stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.title-art { position: relative; width: 190px; height: 190px; margin-bottom: 6px; }

.title-halo {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 192, 90, 0.28), transparent 68%);
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

.title-vessel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5.4rem;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.6));
}

.title-orbit {
  position: absolute;
  font-size: 1.5rem;
  animation: orbit 9s linear infinite;
}

.orbit-a { top: 6%; left: 50%; animation-delay: 0s; }
.orbit-b { top: 46%; left: 0; animation-delay: -3s; }
.orbit-c { top: 46%; right: 0; animation-delay: -6s; }

@keyframes orbit {
  from { transform: rotate(0deg) translateY(-8px); }
  50% { transform: translateY(-16px); }
  to { transform: rotate(0deg) translateY(-8px); }
}

.title-word {
  font-size: 2.5rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  background: linear-gradient(180deg, #fff3cd, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-tag { color: var(--ink-dim); margin: 8px 0 18px; font-size: 0.92rem; }

.title-axes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.axis-pill {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--c);
  background: rgba(255, 255, 255, 0.02);
}

/* ------------------------------------------------------------ axis list */

.axis-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.axis-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; }
.axis-name { color: var(--c); font-weight: 600; }
.axis-hint { color: var(--ink-faint); text-align: right; }

.steps { margin: 0; padding-left: 20px; font-size: 0.88rem; line-height: 1.7; color: var(--ink); }

/* -------------------------------------------------------------- markets */

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

.market-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.market-card:active { transform: scale(0.985); }
.market-card.is-locked { opacity: 0.58; }
.market-card.is-blocked { opacity: 0.72; border-color: rgba(255, 122, 107, 0.35); }

.market-motif { font-size: 1.7rem; flex: 0 0 auto; }
.market-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.market-name { font-weight: 650; font-size: 1rem; }
.market-meta { font-size: 0.76rem; color: var(--ink-dim); }
.market-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }

.badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
}

.badge-warn { color: #f3dda2; border-color: rgba(232, 192, 90, 0.35); }
.badge-entry { color: #a9ead1; border-color: rgba(95, 211, 166, 0.35); }
.badge-new { color: #241a05; background: var(--gold); border-color: var(--gold); font-weight: 700; }

.market-go { color: var(--mint); font-size: 1.2rem; }
.market-lock { font-size: 0.76rem; color: var(--ink-dim); white-space: nowrap; }

/* ----------------------------------------------------------------- shop */

.shop {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
}

.shop summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
}

.shop summary::-webkit-details-marker { display: none; }
.shop-body { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 9px; }

.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.shop-row.is-max { color: var(--ink-faint); }
.shop-row em { font-size: 0.76rem; display: block; }

/* --------------------------------------------------------------- patrons */

.patron-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.patron {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 12px 10px;
  text-align: center;
}

.patron.is-dramatic { border-color: rgba(185, 140, 240, 0.34); }
.patron.is-known { border-color: rgba(95, 211, 166, 0.4); background: #14332f; }

.patron-face { display: block; font-size: 2.1rem; line-height: 1.15; }
.patron-title { display: block; font-size: 0.74rem; color: var(--ink-dim); margin: 4px 0 8px; overflow-wrap: anywhere; }
.patron-unknown { font-size: 1rem; letter-spacing: 0.24em; color: var(--ink-faint); }

.patron-prefs { display: flex; flex-direction: column; gap: 4px; }
.pref-row { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; }
.pref-icon { width: 16px; }
.pref-bar { flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pref-bar i { display: block; height: 100%; background: var(--c); border-radius: 999px; }
.pref-num { width: 26px; text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ brew */

.patron-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.strip-face { opacity: 0.62; }
.strip-face.is-known { opacity: 1; filter: drop-shadow(0 0 6px rgba(95, 211, 166, 0.6)); }

.alembic-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }

.alembic {
  position: relative;
  width: 118px;
  height: 148px;
  flex: 0 0 auto;
  border-radius: 46% 46% 34% 34% / 34% 34% 52% 52%;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--line-strong);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.alembic.is-full { border-color: var(--gold); box-shadow: 0 0 20px rgba(232, 192, 90, 0.3); }

.alembic-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(95, 211, 166, 0.65), rgba(35, 120, 96, 0.85));
  transition: height 0.3s ease;
}

.alembic-liquid::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 12px;
  background: rgba(140, 240, 200, 0.5);
  border-radius: 50%;
  animation: slosh 2.4s ease-in-out infinite;
}

@keyframes slosh {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-3px) scaleY(1.2); }
}

.alembic-label { position: relative; font-size: 2.2rem; opacity: 0.9; }
.alembic-count { position: absolute; bottom: 8px; font-size: 0.76rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.gauges { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.gauges-wide { margin-top: 12px; }

.gauge { display: flex; align-items: center; gap: 8px; }
.gauge-icon { width: 18px; font-size: 0.85rem; }
.gauge-track { flex: 1; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.gauge-track i { display: block; height: 100%; background: var(--c); border-radius: 999px; transition: width 0.3s ease; }

.drops { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 56px; align-items: center; }
.drops-empty { color: var(--ink-faint); font-size: 0.82rem; }

.drop {
  position: relative;
  font-size: 1.9rem;
  padding: 6px;
  border-radius: 50%;
  background: rgba(122, 196, 174, 0.08);
  border: 1px solid var(--line);
  transform: scale(var(--scale, 1));
  animation: popIn 0.24s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(var(--scale, 1)); opacity: 1; }
}

.drop-count {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.62rem;
  background: var(--panel-3);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--gold);
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  max-height: 34vh;
  overflow-y: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.reagent {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 7px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: transform 0.1s ease, border-color 0.2s ease;
}

.reagent:active { transform: scale(0.93); border-color: var(--gold); }
.reagent-emoji { font-size: 1.55rem; }
.reagent-name { font-size: 0.58rem; color: var(--ink-dim); text-align: center; line-height: 1.15; }
.reagent.is-banned { opacity: 0.34; }
.reagent-flag { position: absolute; top: 2px; right: 3px; font-size: 0.7rem; }

/* -------------------------------------------------------------- binding */

.catalyst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; margin: 12px 0; }

.catalyst {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.catalyst.is-on { border-color: var(--gold); background: rgba(232, 192, 90, 0.1); }
.catalyst-emoji { font-size: 1.6rem; }
.catalyst-name { font-size: 0.74rem; }
.catalyst-delta { font-size: 0.62rem; color: var(--ink-dim); }

/* -------------------------------------------------------------- verdict */

.verdict-grid { display: flex; flex-direction: column; gap: 10px; }

.verdict {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
  opacity: 0;
  animation: verdictIn 0.36s ease-out forwards;
}

.verdict.is-dramatic { border-color: rgba(185, 140, 240, 0.34); }
.verdict-face { font-size: 1.7rem; }
.verdict-score { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict-react { font-size: 1.6rem; }
.verdict-title { font-size: 0.72rem; color: var(--ink-dim); text-align: right; }

@keyframes verdictIn {
  from { opacity: 0; transform: translateX(-14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.reveal-late { opacity: 0; animation: verdictIn 0.4s ease-out forwards; }

/* -------------------------------------------------------------- results */

.results-screen .stage { text-align: center; }
.results-face { font-size: 3.4rem; animation: popIn 0.4s ease-out; }

.payout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px 15px;
  margin: 14px 0;
}

.payout-line {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  font-size: 0.94rem;
  border-bottom: 1px solid var(--line);
}

.payout-line:last-child { border-bottom: 0; }
.payout-note { font-size: 0.78rem; color: var(--mint); padding: 6px 0 10px; }
.payout-note.is-warn { color: var(--danger); }

.totals { display: flex; justify-content: center; gap: 22px; color: var(--ink-dim); font-size: 0.88rem; margin-bottom: 14px; }

/* -------------------------------------------------------------- triumph */

.triumph-screen .stage { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.trophy { font-size: 4.5rem; animation: popIn 0.5s ease-out; }
.triumph-word {
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  margin: 8px 0;
  background: linear-gradient(180deg, #fff3cd, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.triumph-recipe { font-size: 1.5rem; margin: 12px 0; }
.triumph-jury { font-size: 1.4rem; letter-spacing: 4px; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.confetti-bit {
  position: absolute;
  top: -10%;
  font-size: 1.1rem;
  animation: fall linear infinite;
}

@keyframes fall {
  from { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  to { transform: translateY(110vh) rotate(420deg); opacity: 0.2; }
}

/* ------------------------------------------------------------ ad widget */

.ad-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  margin-top: 10px;
  border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(232, 192, 90, 0.1), rgba(95, 211, 166, 0.06));
  border: 1px dashed rgba(232, 192, 90, 0.45);
  transition: transform 0.12s ease;
}

.ad-card:active { transform: scale(0.985); }
.ad-card.is-disabled { opacity: 0.45; pointer-events: none; }
.ad-card.is-busy { opacity: 0.7; }

.ad-card-icon { font-size: 1.5rem; }
.ad-card-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-card-title { font-weight: 650; font-size: 0.92rem; }
.ad-card-sub { font-size: 0.74rem; color: var(--ink-dim); }
.ad-left { color: var(--ink-faint); }

.ad-card-tag {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(232, 192, 90, 0.18);
  color: var(--gold);
  border: 1px solid rgba(232, 192, 90, 0.35);
}

.placement-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.85rem; }
.placement-icon { margin-right: 4px; }
.placement-meta { font-size: 0.75rem; color: var(--ink-faint); margin-top: 3px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.92rem;
}

.switch {
  width: 50px;
  height: 29px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background 0.2s ease;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch.is-on { background: rgba(95, 211, 166, 0.3); border-color: var(--mint); }
.switch.is-on i { transform: translateX(21px); background: var(--mint); }

.status { font-size: 0.8rem; padding: 8px 11px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.04); color: var(--ink-dim); }
.status-ready { color: #a9ead1; }
.status-not-configured, .status-opted-out { color: #f3dda2; }
.status-sdk-error { color: #ffb3a8; }

/* --------------------------------------------------------------- ledger */

.ledger { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.ledger li {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.ledger-when { color: var(--ink-faint); font-size: 0.72rem; }
.ledger-amount { color: var(--gold); font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; color: var(--ink-faint); padding: 34px 0; font-size: 0.88rem; }
.build-stamp { text-align: center; font-size: 0.7rem; color: var(--ink-faint); margin-top: 18px; }

/* --------------------------------------------------------------- chrome */

.corner {
  position: fixed;
  top: 10px;
  /* Sit on the right edge of the centred column, not the viewport. */
  right: calc(max(0px, (100vw - 540px) / 2) + 14px);
  display: flex;
  gap: 6px;
  z-index: 20;
}

.corner-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(18, 37, 40, 0.88);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--ink-dim);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.corner-btn:active { border-color: var(--gold); color: var(--gold); }

/* Ensure the TOPBAR never collides with the corner buttons. */
.topbar { padding-right: 148px; }

/* --------------------------------------------------------------- toasts */

.toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + var(--safe-b));
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  max-width: 90vw;
}

.toast-host.is-live { opacity: 1; }

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: rgba(18, 37, 40, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: center;
}

.toast-good { border-color: rgba(95, 211, 166, 0.5); color: #a9ead1; }
.toast-warn { border-color: rgba(232, 192, 90, 0.5); color: #f3dda2; }

/* -------------------------------------------------------------- overlay */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 10, 12, 0.82);
  display: grid;
  place-items: center;
  padding: 22px;
  backdrop-filter: blur(3px);
  animation: screenIn 0.25s ease-out;
}

.overlay-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.overlay-card h2 { font-size: 1.15rem; margin-bottom: 12px; color: var(--gold); }
.overlay-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
