:root {
  --bg: #98d9ff;
  --bg-2: #7fc55f;
  --panel: rgba(110, 79, 55, 0.98);
  --panel-soft: rgba(130, 93, 64, 0.96);
  --line: rgba(231, 250, 191, 0.34);
  --text: #fff8eb;
  --muted: #f0e1c3;
  --lime: #c9f56b;
  --mint: #9ce79a;
  --pink: #f3a27c;
  --peach: #ffd36f;
  --danger: #ff8d72;
  --shadow: 0 8px 0 rgba(73, 48, 31, 0.86), 0 18px 30px rgba(64, 38, 20, 0.22);
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Courier New", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior-y: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(180deg, #98d9ff 0%, #cfeeff 42%, #8fd66a 42%, #6ba34d 100%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
}

html.is-round-scroll-locked,
body.is-round-scroll-locked {
  overscroll-behavior: none;
}

button,
select,
input {
  font: inherit;
}

button,
.chip-button,
.action-button,
.tiny-button,
.hint-status-slot,
.stage-wrap,
.stage-wrap canvas {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

select,
select option {
  color-scheme: dark;
}

#app {
  width: min(100%, 520px);
  min-height: 100vh;
  padding: 16px 14px calc(18px + var(--safe-bottom));
  overscroll-behavior-y: none;
}

.arcade-shell {
  display: grid;
  gap: 14px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(170, 222, 111, 0.96) 0 18%, rgba(126, 88, 58, 0.98) 18%, rgba(94, 66, 45, 0.98) 100%);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(rgba(61,39,24,0.08) 1px, transparent 1px);
  background-size: 18px 18px;
}

.hero-panel {
  padding: 18px;
}

.hero-top,
.hud-row,
.hint-row,
.footer-row,
.overlay-footer,
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-top {
  align-items: flex-start;
  margin-bottom: 14px;
}

.eyebrow,
.mini-pill,
.state-pill,
.signal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 2px solid rgba(255, 239, 199, 0.28);
  background: rgba(109, 78, 54, 0.84);
  color: #fff1d2;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.eyebrow.practice {
  background: rgba(200, 255, 115, 0.16);
  color: #1a2212;
  border-color: rgba(200, 255, 115, 0.32);
  font-weight: 700;
}

.eyebrow.safe {
  background: rgba(131, 255, 210, 0.12);
  color: #d5fff0;
}

.title-block h1 {
  margin: 6px 0 4px;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
}

.title-block p,
.hint-copy,
.support-copy,
.overlay-copy,
.summary-copy,
.legal-copy,
.signal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.mascot-wrap {
  display: grid;
  place-items: center;
  width: 112px;
  min-width: 112px;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(154, 220, 255, 0.98) 0 36%, rgba(170, 222, 111, 0.98) 36%, rgba(113, 82, 56, 0.98) 100%);
  border: 3px solid rgba(255, 247, 214, 0.22);
}

.mascot {
  position: relative;
  width: 86px;
  height: 86px;
  transform-origin: center bottom;
  transition: transform 180ms ease;
}

.mascot .ear {
  position: absolute;
  top: 2px;
  width: 28px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(180deg, #b8f062, #8fcc45);
  border: 3px solid rgba(23, 34, 20, 0.55);
}

.mascot .ear.left {
  left: 10px;
  transform: rotate(-18deg);
}

.mascot .ear.right {
  right: 10px;
  transform: rotate(18deg);
}

.mascot .face {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 8px;
  top: 16px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, #b4e95f, #89c842 72%, #71af34);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
}

.mascot .eye {
  position: absolute;
  top: 28px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: #153220;
}

.mascot .eye.left {
  left: 22px;
}

.mascot .eye.right {
  right: 22px;
}

.mascot .mouth {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 12px;
  margin-left: -11px;
  border: 3px solid #153220;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.mascot.mood-cheer {
  transform: translateY(-2px) scale(1.02);
}

.mascot.mood-cheer .mouth {
  height: 15px;
}

.mascot.mood-alert .eye {
  width: 12px;
  height: 12px;
}

.mascot.mood-alert .mouth {
  height: 8px;
  border-radius: 0 0 3px 3px;
}

.mascot.mood-oops .mouth {
  width: 16px;
  margin-left: -8px;
  height: 6px;
  border-radius: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip-button,
.action-button,
.ghost-button,
.overlay-button,
.tiny-button {
  border: 3px solid rgba(18, 24, 17, 0.72);
  cursor: pointer;
  color: var(--text);
  background: rgba(61, 82, 53, 0.96);
  border-radius: 6px;
  box-shadow: 0 4px 0 rgba(11, 16, 10, 0.72);
  transition: transform 80ms ease, background 120ms ease, opacity 120ms ease;
}

.chip-button {
  min-height: 48px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
}

.chip-button.is-active {
  background: linear-gradient(180deg, rgba(169, 227, 75, 0.96), rgba(132, 186, 53, 0.98));
  color: #152016;
}

.chip-button.is-zfp:not(.is-active) {
  background: linear-gradient(180deg, rgba(223, 184, 104, 0.28), rgba(155, 114, 41, 0.18));
  color: #fff0cf;
  border-color: rgba(77, 53, 18, 0.6);
}

.chip-button.is-muted {
  opacity: 0.82;
}

.stage-panel {
  padding: 10px;
  overflow-anchor: none;
}

.stage-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.stage-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.04;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  contain: layout paint;
  border-radius: 6px;
  border: 3px solid rgba(195, 211, 176, 0.18);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(180deg, #162218 0%, #101812 100%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
  aspect-ratio: 0.76;
}

.stage-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  image-rendering: pixelated;
}

.toast-host,
.overlay-root,
.summary-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.round-chip {
  position: absolute;
  top: 12px;
  right: 12px;
}

.hud-card,
.hint-card,
.footer-card {
  padding: 14px;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(56, 74, 47, 0.84), rgba(28, 40, 25, 0.94));
  border: 3px solid rgba(20, 25, 18, 0.42);
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: clamp(18px, 4.8vw, 24px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hint-card {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(52, 71, 48, 0.82), rgba(26, 38, 25, 0.9));
  border: 3px solid rgba(18, 24, 17, 0.4);
  min-height: 58px;
  align-content: center;
  overflow-anchor: none;
  padding: 10px 12px;
}

.hint-card.has-status {
  grid-template-rows: minmax(28px, auto) 34px;
}

.hint-title {
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 1.05;
}

.hint-copy {
  min-height: 1.2em;
  max-height: 1.2em;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.hint-row {
  min-height: 28px;
  display: flex;
  align-items: center;
}

.hint-status-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
  border: 3px solid rgba(18, 24, 17, 0.54);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(101, 81, 59, 0.92), rgba(67, 52, 38, 0.96));
  color: #fff0cc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}

.hint-status-slot.is-locked {
  background: linear-gradient(180deg, rgba(126, 136, 144, 0.95), rgba(77, 84, 92, 0.98));
  color: rgba(244, 247, 248, 0.96);
}

.hint-status-slot.is-settling {
  background: linear-gradient(180deg, rgba(255, 128, 103, 0.94), rgba(181, 31, 24, 0.98));
  color: #fff4ec;
}

.hint-status-icon {
  position: relative;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.hint-status-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  width: 9px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.action-controls {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  overflow-anchor: none;
  position: relative;
}

.pred3-control-stack {
  display: grid;
  gap: 6px;
}

.pred3-pick-slot {
  position: relative;
  min-height: 44px;
}

.pred3-pick-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pred3-pick-row.is-locked .pred3-pick-button {
  color: rgba(242, 244, 247, 0.96);
  background: linear-gradient(180deg, rgba(135, 144, 152, 0.96), rgba(92, 99, 108, 0.98));
  border-color: rgba(48, 53, 58, 0.88);
  box-shadow: 0 4px 0 rgba(11, 16, 10, 0.44);
  filter: grayscale(1) saturate(0);
  opacity: 0.98;
}

.pred3-pick-button.is-picked {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.22) inset, 0 4px 0 rgba(11, 16, 10, 0.72);
}

.pred3-pick-button.is-faded {
  opacity: 0.5;
}

.action-button,
.ghost-button,
.overlay-button {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.action-button.primary {
  color: #203113;
  background: linear-gradient(180deg, #d2fb7f, #95cf50);
}

.action-button.secondary {
  color: #fff3ea;
  background: linear-gradient(180deg, #ffb084, #c4673f);
}

.action-button.alt {
  color: #fff7e4;
  background: linear-gradient(180deg, #ffe193, #d29d42);
}

.pred3-close-slot {
  min-height: 44px;
  position: sticky;
  bottom: calc(8px + var(--safe-bottom));
  z-index: 4;
  padding-top: 2px;
}

.pred3-close-button.is-live-close,
.pred3-close-button.is-ready {
  color: #fff3eb;
  background: linear-gradient(180deg, #ff8067, #b51f18);
}

.pred3-pick-button,
.pred3-close-button {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
}

.pred3-close-button.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.action-button:disabled,
.ghost-button:disabled,
.overlay-button:disabled,
.tiny-button:disabled,
.chip-button:disabled {
  opacity: 0.52;
  cursor: default;
  box-shadow: 0 2px 0 rgba(11, 16, 10, 0.42);
  filter: saturate(0.62);
}

.ghost-button,
.overlay-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tiny-button {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.footer-card {
  display: grid;
  gap: 10px;
}

.market-panel,
.trade-panel {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: 20px;
}

.panel-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.market-grid,
.trade-grid,
.positions-grid {
  display: grid;
  gap: 10px;
}

.market-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-grid {
  grid-template-columns: 1fr;
}

.market-card,
.position-card {
  padding: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(143, 101, 67, 0.94), rgba(104, 73, 49, 0.98));
  border: 3px solid rgba(83, 54, 32, 0.34);
}

.trade-field {
  display: grid;
  gap: 6px;
}

.trade-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trade-input {
  min-height: 46px;
  width: 100%;
  border: 3px solid rgba(83, 54, 32, 0.44);
  border-radius: 6px;
  background: rgba(132, 96, 67, 0.92);
  color: #fff8ee;
  padding: 12px 14px;
}

.pair-select,
.pair-select option {
  background: #8f6542;
  color: #fff7ea;
}

.trade-stack {
  display: grid;
  gap: 10px;
}

.pair-select {
  width: 100%;
}

.leverage-rail {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  border: 3px solid rgba(83, 54, 32, 0.36);
  background:
    linear-gradient(180deg, rgba(171, 222, 111, 0.94) 0 20%, rgba(129, 92, 63, 0.96) 20%, rgba(101, 73, 50, 0.98) 100%);
  --slider-progress: 0%;
  --threshold-progress: 100%;
  --heat-strength: 0;
}

.leverage-topline,
.leverage-scale {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leverage-scale {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.threshold-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe5bb;
  white-space: nowrap;
}

.leverage-rail.has-zfp::after {
  content: "";
  position: absolute;
  left: var(--threshold-progress);
  top: 48px;
  width: 3px;
  height: 22px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: rgba(255, 201, 135, 0.9);
  box-shadow: 0 0 12px rgba(255, 201, 135, 0.26);
}

.leverage-rail.is-zfp {
  border-color: rgba(255, 201, 135, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 201, 135, 0.08);
}

.leverage-rail.is-zfp .mini-pill {
  background: rgba(255, 201, 135, 0.16);
  color: #fff0cf;
}

.leverage-rail.is-bumping {
  animation: zfp-thump 360ms ease;
}

.leverage-rail.is-hot {
  box-shadow:
    inset 0 0 0 1px rgba(255, 168, 109, 0.12),
    0 0 calc(8px + 16px * var(--heat-strength)) rgba(232, 120, 83, 0.18);
}

.leverage-rail.is-hot .mini-pill {
  border-color: rgba(232, 120, 83, 0.34);
}

.leverage-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  margin: 2px 0 0;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(131, 255, 210, 0.62) 0%, rgba(131, 255, 210, 0.62) var(--slider-progress), rgba(255, 255, 255, 0.08) var(--slider-progress), rgba(255, 255, 255, 0.08) 100%);
  outline: none;
}

.leverage-rail.is-zfp .leverage-slider {
  background:
    linear-gradient(90deg, rgba(255, 201, 135, 0.82) 0%, rgba(255, 201, 135, 0.82) var(--slider-progress), rgba(255, 255, 255, 0.08) var(--slider-progress), rgba(255, 255, 255, 0.08) 100%);
}

.leverage-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 2px;
  border: 3px solid #182315;
  background: linear-gradient(180deg, #d7e9c9, #9ebf7a);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.leverage-rail.is-zfp .leverage-slider::-webkit-slider-thumb {
  background: linear-gradient(180deg, #f0d89e, #c19849);
  box-shadow: 0 4px 0 rgba(75, 50, 16, 0.4);
}

.leverage-slider::-moz-range-track {
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.leverage-slider::-moz-range-progress {
  height: 12px;
  border-radius: 3px;
  background: rgba(131, 255, 210, 0.62);
}

.leverage-rail.is-zfp .leverage-slider::-moz-range-progress {
  background: rgba(255, 201, 135, 0.82);
}

.leverage-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #182315;
  border-radius: 2px;
  background: linear-gradient(180deg, #d7e9c9, #9ebf7a);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.leverage-rail.is-zfp .leverage-slider::-moz-range-thumb {
  background: linear-gradient(180deg, #f0d89e, #c19849);
  box-shadow: 0 4px 0 rgba(75, 50, 16, 0.4);
}

.trade-actions {
  display: grid;
  gap: 10px;
}

.positions-grid {
  grid-template-columns: 1fr;
}

.position-card .summary-copy {
  margin-top: 4px;
}

.mono-soft {
  font-family: Consolas, "Courier New", monospace;
  color: #d7e9e2;
  font-size: 12px;
  word-break: break-all;
}

.status-strip {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(132, 96, 67, 0.9);
  border: 3px solid rgba(83, 54, 32, 0.32);
  color: #fff1d1;
  font-size: 13px;
  line-height: 1.45;
}

.status-strip.error {
  color: #ffd9e4;
  border-color: rgba(255, 123, 159, 0.24);
}

.status-strip.settle {
  font-weight: 700;
}

.status-strip.settle.good {
  color: #ecffd2;
  border-color: rgba(200, 255, 115, 0.28);
  background: rgba(200, 255, 115, 0.1);
}

.status-strip.settle.warn {
  color: #fff0cc;
  border-color: rgba(255, 201, 135, 0.24);
  background: rgba(255, 201, 135, 0.08);
}

.status-strip.settle.bad {
  color: #ffd8e4;
  border-color: rgba(255, 123, 159, 0.26);
  background: rgba(255, 123, 159, 0.08);
}

.quote-big {
  font-size: clamp(24px, 5.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.quote-delta.up {
  color: var(--lime);
}

.quote-delta.down {
  color: var(--danger);
}

.footer-row {
  align-items: stretch;
}

.footer-row .tiny-button {
  flex: 1;
}

.legal-copy {
  margin-top: 6px;
  font-size: 12px;
  overflow-anchor: none;
}

.toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(9, 17, 19, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(18px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.good {
  border-color: rgba(200, 255, 115, 0.32);
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 255, 115, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(19, 30, 16, 0.96), rgba(12, 20, 17, 0.96));
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.32), 0 0 28px rgba(200, 255, 115, 0.14);
}

.toast.good .toast-badge {
  background: rgba(200, 255, 115, 0.16);
  color: #efffd2;
}

.toast.warn {
  border-color: rgba(255, 201, 135, 0.32);
}

.toast.bad {
  border-color: rgba(255, 123, 159, 0.32);
}

.toast strong,
.overlay-card h3,
.summary-card h3 {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.toast-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.toast-amount {
  margin: 2px 0 4px;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.toast.has-amount.good .toast-amount {
  color: var(--lime);
  text-shadow: 0 0 16px rgba(200, 255, 115, 0.28);
}

.toast.has-amount.warn .toast-amount {
  color: var(--peach);
}

.toast.has-amount.bad .toast-amount {
  color: var(--pink);
}

.toast-burst {
  position: absolute;
  inset: -16px;
  pointer-events: none;
  overflow: hidden;
}

.toast-burst span {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  opacity: 0;
}

.toast.good .toast-burst span {
  background: radial-gradient(circle at 35% 35%, #fffbe0, #d8ff8f 70%);
}

.toast.is-visible .toast-burst span {
  animation: toast-spark 700ms ease-out forwards;
}

.toast.is-visible.good {
  animation: toast-win-pop 520ms ease-out;
}

.toast-burst span:nth-child(1) {
  --dx: -84px;
  --dy: -52px;
}

.toast-burst span:nth-child(2) {
  --dx: -36px;
  --dy: -76px;
}

.toast-burst span:nth-child(3) {
  --dx: 14px;
  --dy: -82px;
}

.toast-burst span:nth-child(4) {
  --dx: 70px;
  --dy: -56px;
}

.toast-burst span:nth-child(5) {
  --dx: -28px;
  --dy: -8px;
}

.toast-burst span:nth-child(6) {
  --dx: 44px;
  --dy: -12px;
}

@keyframes toast-spark {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.2);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1.1);
  }
}

@keyframes toast-win-pop {
  0% {
    transform: translateY(18px) scale(0.92);
  }

  42% {
    transform: translateY(-2px) scale(1.02);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes zfp-thump {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.position-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.position-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.settle-card.latest {
  border-width: 2px;
}

.settle-card.settle-good {
  border-color: rgba(200, 255, 115, 0.26);
}

.settle-card.settle-warn {
  border-color: rgba(255, 201, 135, 0.22);
}

.settle-card.settle-bad {
  border-color: rgba(255, 123, 159, 0.22);
}

.settle-amount {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.settle-amount.up {
  color: var(--lime);
}

.settle-amount.down {
  color: var(--pink);
}

.overlay-root,
.summary-root {
  display: grid;
  align-items: end;
}

.overlay-root.is-open,
.summary-root.is-open {
  pointer-events: auto;
  background: rgba(5, 11, 13, 0.54);
  backdrop-filter: blur(10px);
}

.overlay-card,
.summary-card {
  margin: 16px;
  padding: 18px;
  max-height: min(52vh, 360px);
  overflow: auto;
  border-radius: 28px;
  background:
    radial-gradient(circle at 84% 0%, rgba(255, 154, 200, 0.16), transparent 24%),
    radial-gradient(circle at 16% 0%, rgba(200, 255, 115, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(21, 36, 39, 0.98), rgba(13, 21, 23, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.overlay-root.is-open .overlay-card,
.summary-root.is-open .summary-card {
  transform: translateY(0);
  opacity: 1;
}

.overlay-grid,
.summary-grid,
.summary-list {
  display: grid;
  gap: 10px;
}

.overlay-step,
.summary-metric,
.summary-item {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.overlay-step strong,
.summary-metric strong,
.summary-item strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-item small {
  color: var(--muted);
}

.overlay-button.placeholder,
.tiny-button.placeholder {
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

.chip-button:active,
.action-button:active,
.ghost-button:active,
.overlay-button:active,
.tiny-button:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 420px) {
  #app {
    padding-inline: 10px;
  }

  .hero-top {
    align-items: stretch;
  }

  .mascot-wrap {
    width: 96px;
    min-width: 96px;
  }

  .hud-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .pred3-pick-slot {
    min-height: 42px;
  }

  .hint-card {
    min-height: 52px;
    padding: 9px 10px;
  }

  .hint-row {
    min-height: 26px;
  }

  .hint-card.has-status {
    grid-template-rows: minmax(26px, auto) 32px;
  }

  .hint-status-slot {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .pred3-pick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .pred3-pick-button,
  .pred3-close-button {
    min-height: 42px;
    padding: 8px 9px;
    font-size: 14px;
  }

  .pred3-close-slot {
    min-height: 42px;
    bottom: calc(6px + var(--safe-bottom));
  }

  .market-grid,
  .trade-grid {
    grid-template-columns: 1fr;
  }
}
