:root {
  color-scheme: light;
  --ink: #171a17;
  --muted: #747c75;
  --faint: #9da49e;
  --mist: #f3f5f1;
  --paper: #ffffff;
  --line: #e3e7e1;
  --line-soft: #edf0eb;
  --lime: #c8f43d;
  --lime-deep: #9bc31f;
  --lime-soft: #f3fbd4;
  --shadow: 0 18px 50px rgba(26, 36, 25, 0.07), 0 2px 8px rgba(26, 36, 25, 0.03);
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; overflow: hidden; background: var(--mist); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(158, 203, 28, 0.28); outline-offset: 2px; }
[hidden] { display: none !important; }

.v2-app { min-height: 100vh; background: var(--mist); animation: v2-fade-in 0.4s ease-out; }
.v2-topbar { height: 72px; display: grid; grid-template-columns: 280px 1fr auto auto; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid rgba(218, 223, 216, 0.86); background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(18px); animation: v2-slide-down 0.35s ease-out; }
.v2-brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--ink); text-decoration: none; font-family: var(--mono); font-size: 14px; font-weight: 800; letter-spacing: -0.04em; text-transform: uppercase; }
.v2-brand-name { font-family: inherit; }
.v2-brand-name::after { content: ".FUN"; color: var(--green); }
.v2-brand-mark { width: 27px; height: 27px; border-radius: 7px; display: block; }
.v2-tabs { justify-self: start; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 13px; background: #f4f6f2; }
.v2-tabs button { min-height: 34px; padding: 0 15px; border: 0; border-radius: 10px; background: transparent; color: #7b827c; font-size: 13px; font-weight: 650; cursor: pointer; transition: background 0.15s, color 0.15s; }
.v2-tabs button:hover { color: var(--ink); }
.v2-tabs button.is-current { background: var(--paper); color: var(--ink); box-shadow: 0 1px 5px rgba(20, 28, 19, 0.08); }
.v2-market-health { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; font-weight: 650; }
.v2-market-health small { margin-left: 2px; color: var(--faint); font-size: 11px; font-weight: 500; }
.v2-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #8fc91f; box-shadow: 0 0 0 4px rgba(143, 201, 31, 0.12); animation: v2-pulse 2s ease-in-out infinite; }
.v2-wallet-pill { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 15px 0 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 7px rgba(31, 41, 29, 0.03); transition: border-color 0.15s, transform 0.15s; }
.v2-wallet-pill:hover { border-color: #cbd1c8; transform: translateY(-1px); }
.v2-wallet-orb { width: 20px; height: 20px; border-radius: 7px; background: linear-gradient(145deg, #dafa62, #a7d21c); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.48); }

.v2-workspace { height: calc(100vh - 72px); display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 18px; padding: 18px; }
.v2-stake-dock { min-height: 0; display: flex; flex-direction: column; padding: 20px; border: 1px solid rgba(221, 226, 219, 0.95); border-radius: 22px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 12px 36px rgba(31, 40, 29, 0.055); animation: v2-fade-in 0.5s ease-out; }
.v2-account-block { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.v2-account-block > div { display: grid; gap: 5px; }
.v2-eyebrow { color: var(--faint); font-size: 10px; font-weight: 750; letter-spacing: 0.085em; text-transform: uppercase; }
.v2-account-block strong { font-size: 24px; line-height: 1; letter-spacing: -0.045em; }
.v2-account-block strong small { color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: 0.04em; }
.v2-add-funds { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 11px; background: var(--ink); color: white; font-size: 21px; font-weight: 400; cursor: pointer; }
.v2-add-funds:hover { background: #2a302b; }
.v2-stake-section { padding: 22px 0 20px; border-bottom: 1px solid var(--line-soft); }
.v2-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; color: var(--ink); font-size: 12px; font-weight: 720; }
.v2-section-heading span:last-child { color: var(--faint); font-size: 9px; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; }
.v2-stake-input { height: 52px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fafbf9; }
.v2-stake-input button { border: 0; background: transparent; color: #717972; font-size: 19px; cursor: pointer; }
.v2-stake-input button:hover { background: #f0f3ee; color: var(--ink); }
.v2-stake-input label { display: flex; align-items: center; justify-content: center; gap: 6px; border-inline: 1px solid var(--line-soft); }
.v2-stake-input input { min-width: 0; width: 72px; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 17px; font-weight: 700; text-align: right; }
.v2-stake-input input::-webkit-inner-spin-button { appearance: none; }
.v2-stake-input label span { color: var(--faint); font-size: 9px; font-weight: 750; }
.v2-stake-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; }
.v2-stake-presets button { height: 30px; border: 1px solid var(--line-soft); border-radius: 9px; background: white; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 650; cursor: pointer; }
.v2-stake-presets button:hover { border-color: #cfd5cc; color: var(--ink); }
.v2-stake-presets button.is-active { border-color: #d5e99b; background: var(--lime-soft); color: #4d6409; }
.v2-ticket { flex: 1; min-height: 218px; padding: 22px 0 16px; }
.v2-ticket-empty { height: 164px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.v2-empty-glyph { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf7; color: #919991; font-size: 17px; }
.v2-ticket-empty strong { font-size: 13px; }
.v2-ticket-empty p { max-width: 190px; margin: 5px 0 0; color: var(--faint); font-size: 11px; line-height: 1.5; }
.v2-contract-feature { display: grid; gap: 7px; padding: 14px; border-radius: 13px; background: #f6f8f3; }
.v2-contract-feature span { color: var(--faint); font-size: 10px; }
.v2-contract-feature strong { font-family: var(--mono); font-size: 17px; letter-spacing: -0.04em; }
.v2-ticket-content dl { margin: 13px 2px 0; }
.v2-ticket-content dl div { display: flex; justify-content: space-between; padding: 7px 0; }
.v2-ticket-content dt { color: var(--faint); font-size: 10px; }
.v2-ticket-content dd { margin: 0; font-family: var(--mono); font-size: 10px; font-weight: 650; }
.v2-lime { color: #789b12; }
.v2-confirm { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--lime); color: #1d2514; font-size: 12px; font-weight: 780; cursor: pointer; box-shadow: 0 7px 18px rgba(163, 204, 29, 0.2); }
.v2-confirm span:last-child { font-family: var(--mono); font-size: 9px; }
.v2-confirm:hover:not(:disabled) { background: #d0fa4d; transform: translateY(-1px); }
.v2-confirm:disabled { background: #eef0ec; color: #a0a69f; box-shadow: none; cursor: not-allowed; }
.v2-dock-note { margin: 12px 12px 0; color: var(--faint); font-size: 9px; line-height: 1.45; text-align: center; }
.v2-pnl-strip { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: #f6f8f3; }
.v2-pnl-strip span { color: var(--faint); font-size: 9px; }
.v2-pnl-strip strong { grid-row: span 2; align-self: center; font: 700 12px var(--mono); }
.v2-pnl-strip small { color: var(--faint); font: 600 8px var(--mono); }
.v2-pnl-strip strong.is-negative { color: #a34f3c; }
.v2-pnl-strip strong.is-positive { color: #6e9410; }

.v2-market-stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 78px minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(221, 226, 219, 0.95); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); animation: v2-fade-in 0.55s ease-out; }
.v2-market-header { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 28px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); }
.v2-instrument { display: flex; align-items: center; gap: 11px; min-width: 0; }
.v2-coin { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #171a17; color: var(--lime); font-family: var(--mono); font-size: 19px; }
.v2-instrument > div { display: grid; gap: 3px; }
.v2-instrument strong { font-size: 14px; letter-spacing: -0.02em; }
.v2-instrument div span { color: var(--faint); font-family: var(--mono); font-size: 9px; }
.v2-market-switcher { position: relative; display: flex; align-items: center; margin-left: 4px; }
.v2-market-switcher select { height: 30px; appearance: none; padding: 0 27px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; }
.v2-market-switcher > span { position: absolute; right: 9px; pointer-events: none; color: var(--faint); font-size: 10px; }
.v2-quote { min-width: 142px; display: grid; gap: 2px; text-align: right; }
.v2-quote strong { font-family: var(--mono); font-size: 19px; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.v2-quote small { color: #7da11c; font-size: 9px; font-weight: 650; }
.v2-quote small.is-down { color: #ad796a; }
.v2-market-actions { display: flex; align-items: center; gap: 7px; }
.v2-timeframe { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f5f7f3; }
.v2-timeframe button { width: 35px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 9px; font-weight: 700; cursor: pointer; }
.v2-timeframe button.is-active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(25, 32, 23, 0.08); }
.v2-zoom { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f5f7f3; }
.v2-zoom button { width: 32px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 11px; font-weight: 600; cursor: pointer; line-height: 1; }
.v2-zoom button.is-active { background: var(--ink); color: var(--lime); box-shadow: 0 1px 5px rgba(25, 32, 23, 0.08); }
.v2-icon-button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 14px; cursor: pointer; }
.v2-icon-button:hover { border-color: #cbd1c8; color: var(--ink); }
.v2-surface-shell { position: relative; min-height: 0; overflow: hidden; background: white; }
.v2-surface { display: block; width: 100%; height: 100%; }
.v2-now-seam { position: absolute; z-index: 2; top: 0; bottom: 0; width: 1px; pointer-events: none; background: linear-gradient(to bottom, rgba(151, 193, 25, 0), rgba(151, 193, 25, 0.9) 11%, rgba(151, 193, 25, 0.9) 89%, rgba(151, 193, 25, 0)); }
.v2-now-seam span { position: absolute; top: 13px; left: 0; transform: translateX(-50%); padding: 4px 7px; border: 1px solid #ddeaaf; border-radius: 7px; background: rgba(249, 253, 236, 0.94); color: #789914; font: 750 8px var(--mono); letter-spacing: 0.04em; }
.v2-price-chip { position: absolute; z-index: 3; padding: 5px 8px; border: 1px solid #d9e8a8; border-radius: 8px; background: rgba(250, 253, 239, 0.96); color: #607c0e; font: 700 9px var(--mono); pointer-events: none; box-shadow: 0 4px 12px rgba(82, 106, 13, 0.09); }
.v2-hover-card { position: absolute; z-index: 5; width: 194px; display: grid; gap: 4px; padding: 11px 12px; border: 1px solid rgba(215, 222, 212, 0.95); border-radius: 12px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 12px 30px rgba(30, 39, 28, 0.12); pointer-events: none; backdrop-filter: blur(10px); }
.v2-hover-card span { color: var(--faint); font: 600 8px var(--mono); }
.v2-hover-card strong { font: 700 12px var(--mono); }
.v2-hover-card small { color: #748318; font-size: 9px; }
.v2-surface-legend { position: absolute; z-index: 2; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 15px; padding: 6px 9px; border: 1px solid rgba(228, 232, 226, 0.9); border-radius: 9px; background: rgba(255, 255, 255, 0.83); color: var(--faint); font-size: 8px; font-weight: 650; backdrop-filter: blur(8px); pointer-events: none; }
.v2-surface-legend span { display: flex; align-items: center; gap: 6px; }
.v2-legend-line { width: 13px; height: 2px; background: #a7d719; }
.v2-legend-cell { width: 10px; height: 8px; border: 1px solid #dce7bd; background: var(--lime-soft); }
.v2-clock { position: absolute; z-index: 2; right: 13px; bottom: 11px; color: var(--faint); font: 500 8px var(--mono); pointer-events: none; }

.v2-overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(31, 36, 31, 0.2); backdrop-filter: blur(8px); }
.v2-sheet, .v2-activity { position: relative; width: min(420px, 100%); padding: 28px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(30, 37, 28, 0.2); }
.v2-sheet-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 18px; cursor: pointer; }
.v2-sheet h2, .v2-activity h2 { margin: 8px 0 8px; font-size: 26px; letter-spacing: -0.045em; }
.v2-sheet > p { margin: 0 0 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.v2-sheet-balance { display: flex; align-items: end; justify-content: space-between; padding: 17px; border-radius: 14px; background: var(--mist); }
.v2-sheet-balance span { color: var(--muted); font-size: 10px; }
.v2-sheet-balance strong { font-family: var(--mono); font-size: 14px; }
.v2-reserve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 10px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--line-soft); }
.v2-reserve-grid div { display: grid; gap: 5px; padding: 11px 12px; background: white; }
.v2-reserve-grid span { color: var(--faint); font-size: 8px; }
.v2-reserve-grid strong { font: 650 9px var(--mono); }
.v2-reserve-grid strong.is-negative { color: #a34f3c; }
.v2-funds-field { display: grid; gap: 8px; margin-top: 18px; }
.v2-funds-field > span { color: var(--faint); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.v2-funds-field > div { height: 51px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; }
.v2-funds-field input { min-width: 0; flex: 1; border: 0; outline: 0; font: 700 16px var(--mono); }
.v2-funds-field b { color: var(--faint); font-size: 9px; }
.v2-sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 12px; }
.v2-sheet-actions button { height: 44px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 11px; font-weight: 700; cursor: pointer; }
.v2-sheet-actions button.is-primary { border-color: var(--lime); background: var(--lime); }
.v2-wallet-status { display: flex; align-items: center; gap: 8px; margin-top: 17px; color: var(--muted); font-size: 9px; }
.v2-wallet-status i { width: 6px; height: 6px; border-radius: 50%; background: #9bc922; }
.v2-transaction-note { min-height: 15px; margin-top: 10px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.v2-transaction-note.is-error { color: #a34f3c; }
.v2-activity { width: min(520px, 100%); max-height: min(680px, calc(100vh - 40px)); overflow: auto; }
.v2-activity-list { display: grid; gap: 8px; margin-top: 24px; }
.v2-activity-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--faint); text-align: center; }
.v2-activity-empty > span { font-size: 30px; }
.v2-activity-empty strong { margin-top: 12px; color: var(--ink); font-size: 13px; }
.v2-activity-empty p { margin: 5px 0 0; font-size: 10px; }
.v2-activity-row { display: flex; justify-content: space-between; padding: 14px; border: 1px solid var(--line-soft); border-radius: 13px; }
.v2-activity-row > div { display: grid; gap: 4px; }
.v2-activity-row > div:last-child { text-align: right; }
.v2-activity-row strong { font: 700 11px var(--mono); }
.v2-activity-row span { color: var(--faint); font-size: 9px; text-transform: capitalize; }
.v2-activity-row time { color: #7c921c; font: 650 9px var(--mono); }
.v2-activity-row .is-won { color: #729811; }
.v2-activity-row .is-lost { color: #ad796a; }

@keyframes v2-pulse { 50% { box-shadow: 0 0 0 7px rgba(143, 201, 31, 0); } }
@keyframes v2-slide-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes v2-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes v2-price-flash { 0% { color: inherit; } 30% { color: #8fc91f; } 100% { color: inherit; } }
@keyframes v2-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

@media (max-width: 1050px) {
  .v2-topbar { grid-template-columns: 220px 1fr auto; }
  .v2-market-health { display: none; }
  .v2-workspace { grid-template-columns: 278px minmax(0, 1fr); }
  .v2-market-header { grid-template-columns: minmax(210px, 1fr) auto; }
  .v2-market-actions { display: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .v2-topbar { position: sticky; z-index: 10; top: 0; height: 62px; grid-template-columns: 1fr auto; padding: 0 14px; }
  .v2-tabs { display: none; }
  .v2-wallet-pill { height: 36px; }
  .v2-workspace { height: auto; min-height: calc(100vh - 62px); grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .v2-stake-dock { order: 2; min-height: 540px; border-radius: 18px; }
  .v2-market-stage { order: 1; height: 560px; border-radius: 18px; }
  .v2-market-header { height: 72px; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 0 14px; }
  .v2-instrument { gap: 8px; }
  .v2-coin { width: 31px; height: 31px; }
  .v2-market-switcher { display: none; }
  .v2-quote { min-width: 118px; }
  .v2-quote strong { font-size: 15px; }
  .v2-surface-legend { display: none; }
}

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