:root {
  --bg: #0e0f12;
  --panel: #14161a;
  --panel-2: #1a1c21;
  --panel-3: #202228;
  --line: #292c32;
  --line-soft: #22252a;
  --text: #f3efe8;
  --muted: #858991;
  --faint: #595e67;
  --orange: #ff6a3d;
  --orange-soft: #ff9a78;
  --amber: #e9b44c;
  --plum: #bd78e8;
  --red: #ee5573;
}

* { box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: clip; }
body {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { text-decoration: none; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.hidden { display: none !important; }

.app { min-height: 100vh; }
.topbar {
  height: 72px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 230px minmax(280px, 610px) 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #111216;
}
.brand { display: flex; align-items: center; gap: 10px; width: max-content; font-family: "Space Grotesk"; font-size: 19px; font-weight: 700; letter-spacing: -.05em; }
.brand-cube { width: 35px; height: 35px; display: grid; place-items: center; color: #19100d; border-radius: 9px 3px 9px 3px; background: var(--orange); font-size: 18px; }
.brand b { margin-left: -3px; padding: 4px 6px; color: var(--orange-soft); border: 1px solid rgba(255,106,61,.24); border-radius: 4px; font-family: "DM Mono"; font-size: 9px; letter-spacing: .05em; }
.global-search { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #191b20; }
.global-search > span { color: var(--orange); font-size: 20px; transform: rotate(-16deg); }
.global-search input { width: 100%; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 14px; }
.global-search input::placeholder { color: var(--faint); }
.global-search kbd { padding: 4px 6px; color: var(--faint); border: 1px solid #34373e; border-radius: 4px; background: #22242a; font-family: "DM Mono"; font-size: 10px; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.btc-ticker { height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.btc-ticker > i { width: 25px; height: 25px; display: grid; place-items: center; color: #1c1710; border-radius: 50%; background: var(--amber); font-style: normal; font-weight: 800; }
.btc-ticker div { display: flex; flex-direction: column; line-height: 1; }
.btc-ticker small { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.btc-ticker strong { margin-top: 5px; font-family: "DM Mono"; font-size: 12px; }
.btc-ticker em { color: var(--orange-soft); font-size: 11px; font-style: normal; font-weight: 700; }
.btc-ticker em.negative { color: var(--red); }
.icon-button, .wallet-button { height: 42px; border-radius: 9px; font-size: 11px; font-weight: 800; }
.icon-button { padding: 0 11px; color: #c0c2c6; border: 1px solid var(--line); background: var(--panel); }
.icon-button span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); }
.wallet-button { padding: 0 15px; color: #18100d; border: 0; background: var(--orange); }
.wallet-button b { margin-left: 10px; }
.wallet-button:hover { background: var(--orange-soft); }

.ticker-strip { height: 36px; padding: 0 22px; display: flex; align-items: center; gap: 12px; color: var(--faint); border-bottom: 1px solid var(--line); background: #0b0c0f; font-family: "DM Mono"; font-size: 10px; letter-spacing: .05em; }
.ticker-strip > span:first-child { color: #a3a6ab; }
.ticker-strip i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--orange); }
.ticker-strip b { color: #373a40; }
.ticker-right { margin-left: auto; }
.ticker-right strong { margin-left: 7px; color: var(--orange-soft); }

.workspace { min-height: calc(100vh - 108px); display: grid; grid-template-columns: 230px minmax(0,1fr) 285px; }
.sidebar { position: relative; padding: 20px 13px; border-right: 1px solid var(--line); background: #111216; }
.sidebar-section + .sidebar-section { margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line-soft); }
.sidebar-heading { padding: 0 10px 10px; color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.filters, .asset-filters, .market-types { display: grid; gap: 3px; }
.filter, .asset-filter, .market-types button { width: 100%; height: 44px; padding: 0 10px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; color: var(--muted); border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 13px; text-align: left; transition: .17s; }
.filter i, .asset-filter i, .market-types i { color: #70757e; font-size: 12px; font-style: normal; text-align: center; }
.filter b { min-width: 22px; color: var(--faint); font-family: "DM Mono"; font-size: 10px; font-weight: 500; text-align: right; }
.filter:hover, .filter.active, .asset-filter:hover, .asset-filter.active, .market-types button:hover { color: var(--text); border-color: var(--line); background: var(--panel-2); }
.filter.active { box-shadow: inset 2px 0 0 var(--orange); }
.filter.active i, .asset-filter.active i { color: var(--orange); }
.market-types { display: grid; }
.market-types button { display: grid; }
.sidebar-bottom { position: absolute; left: 13px; right: 13px; bottom: 17px; padding: 13px 10px 0; border-top: 1px solid var(--line-soft); }
.network-dot { display: flex; align-items: center; color: var(--muted); font-size: 10px; font-weight: 700; }
.network-dot i { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 7px var(--orange); }
.network-dot b { margin-left: auto; color: var(--orange-soft); font-size: 9px; }
.sidebar-bottom p { margin: 11px 0 0; color: #626770; font-size: 10px; line-height: 1.5; }

.market-main { min-width: 0; padding: 27px 22px 45px; }
.market-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.breadcrumb { color: var(--faint); font-family: "DM Mono"; font-size: 10px; letter-spacing: .06em; }
.breadcrumb span { color: var(--orange-soft); }
h1 { margin: 8px 0 0; font-family: "Space Grotesk"; font-size: 36px; letter-spacing: -.045em; }
.market-header p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.header-controls { display: flex; align-items: center; gap: 8px; }
.source-badge { height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.source-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.source-badge.error { color: var(--red); }
.sort-button { height: 40px; padding: 0 12px; color: #b5b7bb; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 11px; font-weight: 700; }
.sort-button span { margin-left: 6px; color: var(--orange); }
.market-subnav { height: 48px; margin: 20px 0 13px; display: flex; align-items: center; gap: 5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.market-subnav button { height: 34px; padding: 0 11px; color: var(--muted); border: 0; border-radius: 6px; background: transparent; font-size: 11px; font-weight: 700; }
.market-subnav button:hover, .market-subnav button.active { color: var(--text); background: var(--panel-2); }
.market-subnav > span { margin-left: auto; color: var(--faint); font-size: 10px; }

.markets-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.market-card { position: relative; min-width: 0; min-height: 260px; padding: 18px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; transition: .18s; }
.market-card:hover { border-color: #3a3e45; background: #17191e; transform: translateY(-2px); box-shadow: 0 14px 35px rgba(0,0,0,.18); }
.market-card-head { min-height: 92px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: start; gap: 12px; }
.market-image { width: 48px; height: 48px; display: grid; place-items: center; color: #1b100c; border-radius: 10px; background: var(--orange); font-family: "Space Grotesk"; font-size: 20px; font-weight: 700; }
.market-sports .market-image { background: var(--amber); }
.market-politics .market-image { color: #fff; background: #743552; }
.market-info { min-width: 0; }
.market-meta { margin-bottom: 7px; display: flex; gap: 7px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.market-meta span:first-child { color: var(--orange-soft); }
.market-sports .market-meta span:first-child { color: var(--amber); }
.market-politics .market-meta span:first-child { color: var(--plum); }
.market-info h3 { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 15px; line-height: 1.4; }
.confidence { display: flex; flex-direction: column; align-items: flex-end; }
.confidence strong { font-family: "DM Mono"; font-size: 16px; }
.confidence small { margin-top: 4px; color: var(--faint); font-size: 9px; font-weight: 700; }
.odds { margin-top: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.odd-button { min-width: 0; height: 62px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); transition: .17s; }
.odd-button:disabled { opacity: .45; cursor: not-allowed; }
.odd-button > span { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.odd-button em { color: var(--orange-soft); font-size: 11px; font-style: normal; }
.odd-button strong { font-family: "DM Mono"; font-size: 16px; }
.odd-button:hover, .odd-button.selected { color: #1a100c; border-color: var(--orange); background: var(--orange); }
.odd-button:hover span, .odd-button:hover em, .odd-button:hover strong, .odd-button.selected span, .odd-button.selected em, .odd-button.selected strong { color: #1a100c; }
.market-footer { margin-top: auto; padding-top: 13px; display: flex; align-items: center; gap: 8px; color: var(--faint); border-top: 1px solid var(--line-soft); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.market-live { color: var(--red); }
.market-live i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--red); box-shadow: 0 0 5px var(--red); }
.market-details { margin-left: auto; display: flex; gap: 8px; }
.market-details strong { color: #a2a5aa; }
.skeleton-card { height: 260px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(100deg,var(--panel) 20%,var(--panel-2) 40%,var(--panel) 60%); background-size: 200% 100%; animation: skeleton 1.4s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
.no-markets { grid-column: 1/-1; padding: 75px 20px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: var(--panel); text-align: center; font-size: 12px; }
.show-more { width: 100%; height: 54px; margin-top: 12px; color: #aaaeb4; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 12px; font-weight: 800; }
.show-more span { margin-left: 7px; color: var(--orange); }
.show-more:hover { color: var(--text); background: var(--panel-2); }

.right-rail { padding: 20px 13px; border-left: 1px solid var(--line); background: #111216; }
.rail-card { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rail-card + .rail-card { margin-top: 10px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.rail-title i { padding: 3px 5px; color: var(--orange-soft); border: 1px solid rgba(255,106,61,.2); border-radius: 4px; font-size: 9px; font-style: normal; }
.overview-stat { margin-top: 20px; }
.overview-stat small, .overview-grid small { display: block; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.overview-stat strong { display: block; margin-top: 5px; font-family: "DM Mono"; font-size: 23px; }
.overview-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(2,1fr); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.overview-grid > div { padding: 12px 0; }
.overview-grid > div + div { padding-left: 13px; border-left: 1px solid var(--line-soft); }
.overview-grid strong { display: block; margin-top: 5px; font-family: "DM Mono"; font-size: 13px; }
.volume-bars { height: 60px; margin-top: 16px; display: flex; align-items: flex-end; gap: 5px; border-bottom: 1px solid #363940; }
.volume-bars span { flex: 1; background: var(--orange); opacity: .4; }
.volume-bars span:nth-child(3n) { opacity: 1; }
.quick-guide { margin: 16px 0 0; padding: 0; list-style: none; }
.quick-guide li { padding: 11px 0; display: grid; grid-template-columns: 27px 1fr; gap: 7px; border-top: 1px solid var(--line-soft); }
.quick-guide li b { color: var(--orange); font-family: "DM Mono"; font-size: 10px; }
.quick-guide li div { display: flex; flex-direction: column; }
.quick-guide strong { font-size: 12px; }
.quick-guide span { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.45; }
.rail-disclaimer { margin-top: 10px; padding: 12px; display: flex; gap: 9px; color: var(--faint); border: 1px dashed #34373e; border-radius: 9px; }
.rail-disclaimer i { color: var(--amber); font-style: normal; }
.rail-disclaimer p { margin: 0; font-size: 10px; line-height: 1.5; }

.betslip { position: fixed; z-index: 50; right: 20px; bottom: 20px; width: 330px; border: 1px solid rgba(255,106,61,.25); border-radius: 12px; background: #15171b; box-shadow: 0 28px 90px rgba(0,0,0,.6); overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(25px); transition: .2s; }
.betslip.open { opacity: 1; pointer-events: auto; transform: none; }
.betslip-head { height: 58px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.betslip-head > div { display: flex; align-items: center; gap: 8px; }
.betslip-head > div > span { width: 25px; height: 25px; display: grid; place-items: center; color: #1a100c; border-radius: 6px; background: var(--orange); font-weight: 800; }
.betslip-head h3 { margin: 0; font-size: 12px; }
.betslip-head button { color: var(--muted); border: 0; background: none; font-size: 20px; }
.empty-bet { padding: 40px; text-align: center; }
.bet-content { padding: 16px; }
.selected-market { padding: 13px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.selected-market small, .bet-content > label { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.selected-market p { margin: 8px 0 12px; font-size: 12px; line-height: 1.5; }
.selected-market > div { display: flex; justify-content: space-between; color: var(--orange-soft); font-size: 12px; font-weight: 800; }
.stake-input { height: 48px; padding: 0 11px; margin-top: 6px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #0f1013; }
.stake-input span { color: var(--faint); font-size: 10px; }
.stake-input input { width: 100%; color: var(--text); border: 0; outline: 0; background: none; text-align: right; font-family: "DM Mono"; font-size: 16px; }
.quick-stakes { margin: 6px 0 15px; display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.quick-stakes button { padding: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; background: none; font-size: 10px; }
.bet-summary { padding: 13px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); font-size: 11px; }
.bet-summary span { color: var(--muted); }
.bet-summary strong { color: var(--orange-soft); font-family: "DM Mono"; font-size: 13px; }
.place-bet { width: 100%; height: 48px; color: #1a100c; border: 0; border-radius: 8px; background: var(--orange); font-size: 12px; font-weight: 800; }
.place-bet span { margin-left: 25px; }
.bet-note { color: var(--faint); text-align: center; font-size: 9px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 25px; padding: 11px 15px; color: #1a100c; border-radius: 7px; background: var(--orange); box-shadow: 0 18px 55px rgba(0,0,0,.5); font-size: 11px; font-weight: 800; opacity: 0; transform: translate(-50%,70px); transition: .22s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1450px) {
  .workspace { grid-template-columns: 205px minmax(0,1fr) 240px; }
  .markets-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .topbar { grid-template-columns: 205px 1fr auto; }
  .btc-ticker { display: none; }
  .workspace { grid-template-columns: 190px minmax(0,1fr); }
  .right-rail { display: none; }
}
@media (max-width: 720px) {
  .topbar { height: 64px; padding: 0 12px; grid-template-columns: 1fr auto; }
  .brand b, .global-search, .icon-button { display: none; }
  .ticker-strip { padding: 0 12px; overflow: hidden; white-space: nowrap; }
  .ticker-right { display: none; }
  .workspace { display: block; }
  .sidebar { position: static; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-section:first-child { margin: 0; padding: 0; border: 0; }
  .sidebar-heading, .sidebar-section:not(:first-child), .sidebar-bottom { display: none; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter { min-width: 0; }
  .market-main { padding: 21px 12px 35px; }
  .market-header { align-items: flex-start; flex-direction: column; }
  .header-controls { width: 100%; justify-content: space-between; }
  h1 { font-size: 26px; }
  .market-subnav { overflow-x: auto; }
  .market-subnav button { flex: 0 0 auto; }
  .market-subnav > span { display: none; }
  .markets-list { grid-template-columns: 1fr; }
  .market-card { min-height: 220px; }
  .betslip { right: 8px; bottom: 8px; width: calc(100% - 16px); }
}
